@c80/ui 1.0.58 → 1.0.62

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.
Files changed (93) hide show
  1. package/esm2022/index.js +1 -0
  2. package/esm2022/index.js.map +1 -1
  3. package/esm2022/lib/action-list/action-list.types.js.map +1 -1
  4. package/esm2022/lib/card-level/card-level.component.js +1 -3
  5. package/esm2022/lib/card-level/card-level.component.js.map +1 -1
  6. package/esm2022/lib/card-level/card-level.interface.js.map +1 -1
  7. package/esm2022/lib/card-level/index.js.map +1 -1
  8. package/esm2022/lib/error-notification/error-notification.component.js +41 -0
  9. package/esm2022/lib/error-notification/error-notification.component.js.map +1 -0
  10. package/esm2022/lib/error-notification/error-notification.types.js +2 -0
  11. package/esm2022/lib/error-notification/error-notification.types.js.map +1 -0
  12. package/esm2022/lib/error-notification/index.js +3 -0
  13. package/esm2022/lib/error-notification/index.js.map +1 -0
  14. package/esm2022/lib/header/header.component.js +2 -2
  15. package/esm2022/lib/header/header.component.js.map +1 -1
  16. package/esm2022/lib/icon/icon.component.js +1 -3
  17. package/esm2022/lib/icon/icon.component.js.map +1 -1
  18. package/esm2022/lib/icon/icon.definitions.js +74 -1
  19. package/esm2022/lib/icon/icon.definitions.js.map +1 -1
  20. package/esm2022/lib/icon/theme.service.js +3 -0
  21. package/esm2022/lib/icon/theme.service.js.map +1 -1
  22. package/esm2022/lib/modal/index.js.map +1 -1
  23. package/esm2022/lib/modal/modal.component.js +2 -2
  24. package/esm2022/lib/modal/modal.component.js.map +1 -1
  25. package/esm2022/lib/modal/modal.service.js.map +1 -1
  26. package/esm2022/lib/modal/modal.types.js +2 -0
  27. package/esm2022/lib/modal/modal.types.js.map +1 -0
  28. package/esm2022/lib/select/index.js +1 -1
  29. package/esm2022/lib/select/index.js.map +1 -1
  30. package/esm2022/lib/select/select.component.js +4 -1
  31. package/esm2022/lib/select/select.component.js.map +1 -1
  32. package/esm2022/lib/select/select.types.js +2 -0
  33. package/esm2022/lib/select/select.types.js.map +1 -0
  34. package/esm2022/lib/snackbar/index.js.map +1 -1
  35. package/esm2022/lib/snackbar/snackbar.component.js +2 -2
  36. package/esm2022/lib/snackbar/snackbar.component.js.map +1 -1
  37. package/esm2022/lib/snackbar/snackbar.service.js.map +1 -1
  38. package/esm2022/lib/snackbar/snackbar.types.js +2 -0
  39. package/esm2022/lib/snackbar/{snackbar.model.js.map → snackbar.types.js.map} +1 -1
  40. package/esm2022/lib/stat-card/index.js.map +1 -1
  41. package/esm2022/lib/stat-card/stat-card.component.js.map +1 -1
  42. package/esm2022/lib/stat-card/stat-card.types.js +2 -0
  43. package/esm2022/lib/stat-card/stat-card.types.js.map +1 -0
  44. package/esm2022/lib/tab/c80-tab.types.js +2 -0
  45. package/esm2022/lib/tab/c80-tab.types.js.map +1 -0
  46. package/esm2022/lib/tab/index.js.map +1 -1
  47. package/esm2022/lib/table/index.js +2 -0
  48. package/esm2022/lib/table/index.js.map +1 -1
  49. package/esm2022/lib/table/table-data-utils.service.js +1 -3
  50. package/esm2022/lib/table/table-data-utils.service.js.map +1 -1
  51. package/esm2022/lib/table/table-dto-mapper.service.js +98 -0
  52. package/esm2022/lib/table/table-dto-mapper.service.js.map +1 -0
  53. package/esm2022/lib/table/table-pagination.service.js +79 -0
  54. package/esm2022/lib/table/table-pagination.service.js.map +1 -0
  55. package/esm2022/lib/table/table.component.js +66 -6
  56. package/esm2022/lib/table/table.component.js.map +1 -1
  57. package/esm2022/lib/table/table.types.js.map +1 -1
  58. package/esm2022/lib/table/table.utils.js +3 -2
  59. package/esm2022/lib/table/table.utils.js.map +1 -1
  60. package/index.d.ts +1 -0
  61. package/lib/action-list/action-list.types.d.ts +1 -1
  62. package/lib/error-notification/error-notification.component.d.ts +20 -0
  63. package/lib/error-notification/error-notification.types.d.ts +4 -0
  64. package/lib/error-notification/index.d.ts +2 -0
  65. package/lib/icon/icon.component.d.ts +1 -1
  66. package/lib/modal/index.d.ts +1 -0
  67. package/lib/modal/modal.component.d.ts +1 -16
  68. package/lib/modal/modal.service.d.ts +1 -1
  69. package/lib/modal/modal.types.d.ts +15 -0
  70. package/lib/select/index.d.ts +1 -1
  71. package/lib/select/select.component.d.ts +2 -1
  72. package/lib/snackbar/index.d.ts +1 -1
  73. package/lib/snackbar/snackbar.component.d.ts +1 -1
  74. package/lib/snackbar/snackbar.service.d.ts +1 -1
  75. package/lib/stat-card/index.d.ts +1 -0
  76. package/lib/stat-card/stat-card.component.d.ts +1 -7
  77. package/lib/stat-card/stat-card.types.d.ts +7 -0
  78. package/lib/tab/index.d.ts +1 -1
  79. package/lib/table/index.d.ts +2 -0
  80. package/lib/table/table-dto-mapper.service.d.ts +34 -0
  81. package/lib/table/table-pagination.service.d.ts +41 -0
  82. package/lib/table/table.component.d.ts +24 -3
  83. package/lib/table/table.types.d.ts +16 -1
  84. package/lib/table/table.utils.d.ts +2 -1
  85. package/package.json +1 -1
  86. package/esm2022/lib/select/select.model.js +0 -2
  87. package/esm2022/lib/select/select.model.js.map +0 -1
  88. package/esm2022/lib/snackbar/snackbar.model.js +0 -2
  89. package/esm2022/lib/tab/c80-tab.model.js +0 -2
  90. package/esm2022/lib/tab/c80-tab.model.js.map +0 -1
  91. /package/lib/select/{select.model.d.ts → select.types.d.ts} +0 -0
  92. /package/lib/snackbar/{snackbar.model.d.ts → snackbar.types.d.ts} +0 -0
  93. /package/lib/tab/{c80-tab.model.d.ts → c80-tab.types.d.ts} +0 -0
@@ -135,10 +135,10 @@ export class ModalComponent {
135
135
  return this.config().noText ?? 'No';
136
136
  }
137
137
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
138
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: ModalComponent, isStandalone: true, selector: "c80-modal", ngImport: i0, template: "<!-- Modal Backdrop -->\n@if (isOpen()) {\n<div class=\"modal-backdrop\" [class.show]=\"isVisible()\" tabindex=\"-1\" (click)=\"onBackdropClick($event)\" (keydown.escape)=\"closeModal()\">\n\n <!-- Modal Container -->\n <dialog class=\"modal-container\" [class.show]=\"isVisible()\" [attr.aria-labelledby]=\"'modal-title'\" [open]=\"isVisible()\">\n\n <!-- Modal Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" id=\"modal-title\">{{ config().title }}</h4>\n <c80-icon [button]=\"true\" icon=\"close\" (iconClick)=\"closeModal()\" title=\"Cerrar\" color=\"warn\" />\n </div>\n\n <!-- Modal Body -->\n <div class=\"modal-body\">\n <p class=\"modal-message\">{{ config().message }}</p>\n </div>\n\n <!-- Modal Footer -->\n <div class=\"modal-footer\">\n\n <!-- Info Modal - Solo OK -->\n @if (showOkButton()) {\n <c80-icon [button]=\"true\" icon=\"check\" textRight=\"OK\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n }\n\n <!-- Yes/No Modal -->\n @if (showYesNoButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getYesText()\" (iconClick)=\"onYes()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getNoText()\" color=\"warn\" (iconClick)=\"onNo()\" [border]=\"true\" />\n }\n\n <!-- Confirm Modal -->\n @if (showConfirmButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getConfirmText()\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getCancelText()\" color=\"warn\" (iconClick)=\"onCancel()\" [border]=\"true\" />\n }\n\n </div>\n </dialog>\n</div>\n}", styles: [".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1100;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out;outline:none}.modal-backdrop.show{opacity:1}.modal-container{background:var(--color-bg-primary);border-radius:8px;box-shadow:0 4px 20px #00000026;border:1px solid var(--color-border-default);max-width:400px;width:90%;max-height:90vh;overflow:hidden;transform:scale(.9) translateY(-10px);transition:all .15s ease-out;position:relative;padding:0}.modal-container.show{transform:scale(1) translateY(0)}.modal-container::backdrop{background:transparent}.modal-header{display:flex;align-items:center;gap:8px;padding:16px 20px 12px;border-bottom:1px solid var(--color-border-default);background:var(--color-bg-secondary)}.modal-header .modal-title{flex:1;margin:0;font-size:16px;font-weight:600;color:var(--color-text-primary);line-height:1.3}.modal-body{padding:16px 20px}.modal-body .modal-message{margin:0;font-size:14px;line-height:1.5;color:var(--color-text-primary);white-space:pre-line}.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;background:var(--color-bg-secondary);border-top:1px solid var(--color-border-default)}@media(max-width:768px){.modal-container{width:95%;margin:10px}.modal-header{padding:12px 16px 8px}.modal-header .modal-title{font-size:15px}.modal-body{padding:12px 16px}.modal-body .modal-message{font-size:13px}.modal-footer{padding:8px 16px 12px;flex-direction:column}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "c80-icon", inputs: ["icon", "color", "customColor", "disabled", "size", "button", "border", "type", "textLeft", "textRight", "dark"], outputs: ["iconClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
138
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: ModalComponent, isStandalone: true, selector: "c80-modal", ngImport: i0, template: "<!-- Modal Backdrop -->\n@if (isOpen()) {\n<div class=\"modal-backdrop\" [class.show]=\"isVisible()\" tabindex=\"-1\" (click)=\"onBackdropClick($event)\" (keydown.escape)=\"closeModal()\">\n\n <!-- Modal Container -->\n <dialog class=\"modal-container\" [class.show]=\"isVisible()\" [attr.aria-labelledby]=\"'modal-title'\" [open]=\"isVisible()\">\n\n <!-- Modal Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" id=\"modal-title\">{{ config().title }}</h4>\n <c80-icon [button]=\"true\" icon=\"close\" (iconClick)=\"closeModal()\" title=\"Cerrar\" />\n </div>\n\n <!-- Modal Body -->\n <div class=\"modal-body\">\n <p class=\"modal-message\">{{ config().message }}</p>\n </div>\n\n <!-- Modal Footer -->\n <div class=\"modal-footer\">\n\n <!-- Info Modal - Solo OK -->\n @if (showOkButton()) {\n <c80-icon [button]=\"true\" icon=\"check\" textRight=\"OK\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n }\n\n <!-- Yes/No Modal -->\n @if (showYesNoButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getYesText()\" (iconClick)=\"onYes()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getNoText()\" (iconClick)=\"onNo()\" [border]=\"true\" />\n }\n\n <!-- Confirm Modal -->\n @if (showConfirmButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getConfirmText()\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getCancelText()\" (iconClick)=\"onCancel()\" [border]=\"true\" />\n }\n\n </div>\n </dialog>\n</div>\n}", styles: [".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1100;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out;outline:none}.modal-backdrop.show{opacity:1}.modal-container{background:var(--color-bg-primary);border-radius:8px;box-shadow:0 4px 20px #00000026;border:1px solid var(--color-border-default);max-width:400px;width:90%;max-height:90vh;overflow:hidden;transform:scale(.9) translateY(-10px);transition:all .15s ease-out;position:relative;padding:0}.modal-container.show{transform:scale(1) translateY(0)}.modal-container::backdrop{background:transparent}.modal-header{display:flex;align-items:center;gap:8px;padding:16px 20px 12px;border-bottom:1px solid var(--color-border-default);background:var(--color-bg-secondary)}.modal-header .modal-title{flex:1;margin:0;font-size:16px;font-weight:600;color:var(--color-text-primary);line-height:1.3}.modal-body{padding:16px 20px}.modal-body .modal-message{margin:0;font-size:14px;line-height:1.5;color:var(--color-text-primary);white-space:pre-line}.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;background:var(--color-bg-secondary);border-top:1px solid var(--color-border-default)}@media(max-width:768px){.modal-container{width:95%;margin:10px}.modal-header{padding:12px 16px 8px}.modal-header .modal-title{font-size:15px}.modal-body{padding:12px 16px}.modal-body .modal-message{font-size:13px}.modal-footer{padding:8px 16px 12px;flex-direction:column}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "c80-icon", inputs: ["icon", "color", "customColor", "disabled", "size", "button", "border", "type", "textLeft", "textRight", "dark"], outputs: ["iconClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
139
139
  }
140
140
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: ModalComponent, decorators: [{
141
141
  type: Component,
142
- args: [{ selector: 'c80-modal', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Modal Backdrop -->\n@if (isOpen()) {\n<div class=\"modal-backdrop\" [class.show]=\"isVisible()\" tabindex=\"-1\" (click)=\"onBackdropClick($event)\" (keydown.escape)=\"closeModal()\">\n\n <!-- Modal Container -->\n <dialog class=\"modal-container\" [class.show]=\"isVisible()\" [attr.aria-labelledby]=\"'modal-title'\" [open]=\"isVisible()\">\n\n <!-- Modal Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" id=\"modal-title\">{{ config().title }}</h4>\n <c80-icon [button]=\"true\" icon=\"close\" (iconClick)=\"closeModal()\" title=\"Cerrar\" color=\"warn\" />\n </div>\n\n <!-- Modal Body -->\n <div class=\"modal-body\">\n <p class=\"modal-message\">{{ config().message }}</p>\n </div>\n\n <!-- Modal Footer -->\n <div class=\"modal-footer\">\n\n <!-- Info Modal - Solo OK -->\n @if (showOkButton()) {\n <c80-icon [button]=\"true\" icon=\"check\" textRight=\"OK\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n }\n\n <!-- Yes/No Modal -->\n @if (showYesNoButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getYesText()\" (iconClick)=\"onYes()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getNoText()\" color=\"warn\" (iconClick)=\"onNo()\" [border]=\"true\" />\n }\n\n <!-- Confirm Modal -->\n @if (showConfirmButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getConfirmText()\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getCancelText()\" color=\"warn\" (iconClick)=\"onCancel()\" [border]=\"true\" />\n }\n\n </div>\n </dialog>\n</div>\n}", styles: [".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1100;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out;outline:none}.modal-backdrop.show{opacity:1}.modal-container{background:var(--color-bg-primary);border-radius:8px;box-shadow:0 4px 20px #00000026;border:1px solid var(--color-border-default);max-width:400px;width:90%;max-height:90vh;overflow:hidden;transform:scale(.9) translateY(-10px);transition:all .15s ease-out;position:relative;padding:0}.modal-container.show{transform:scale(1) translateY(0)}.modal-container::backdrop{background:transparent}.modal-header{display:flex;align-items:center;gap:8px;padding:16px 20px 12px;border-bottom:1px solid var(--color-border-default);background:var(--color-bg-secondary)}.modal-header .modal-title{flex:1;margin:0;font-size:16px;font-weight:600;color:var(--color-text-primary);line-height:1.3}.modal-body{padding:16px 20px}.modal-body .modal-message{margin:0;font-size:14px;line-height:1.5;color:var(--color-text-primary);white-space:pre-line}.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;background:var(--color-bg-secondary);border-top:1px solid var(--color-border-default)}@media(max-width:768px){.modal-container{width:95%;margin:10px}.modal-header{padding:12px 16px 8px}.modal-header .modal-title{font-size:15px}.modal-body{padding:12px 16px}.modal-body .modal-message{font-size:13px}.modal-footer{padding:8px 16px 12px;flex-direction:column}}\n"] }]
142
+ args: [{ selector: 'c80-modal', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Modal Backdrop -->\n@if (isOpen()) {\n<div class=\"modal-backdrop\" [class.show]=\"isVisible()\" tabindex=\"-1\" (click)=\"onBackdropClick($event)\" (keydown.escape)=\"closeModal()\">\n\n <!-- Modal Container -->\n <dialog class=\"modal-container\" [class.show]=\"isVisible()\" [attr.aria-labelledby]=\"'modal-title'\" [open]=\"isVisible()\">\n\n <!-- Modal Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" id=\"modal-title\">{{ config().title }}</h4>\n <c80-icon [button]=\"true\" icon=\"close\" (iconClick)=\"closeModal()\" title=\"Cerrar\" />\n </div>\n\n <!-- Modal Body -->\n <div class=\"modal-body\">\n <p class=\"modal-message\">{{ config().message }}</p>\n </div>\n\n <!-- Modal Footer -->\n <div class=\"modal-footer\">\n\n <!-- Info Modal - Solo OK -->\n @if (showOkButton()) {\n <c80-icon [button]=\"true\" icon=\"check\" textRight=\"OK\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n }\n\n <!-- Yes/No Modal -->\n @if (showYesNoButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getYesText()\" (iconClick)=\"onYes()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getNoText()\" (iconClick)=\"onNo()\" [border]=\"true\" />\n }\n\n <!-- Confirm Modal -->\n @if (showConfirmButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getConfirmText()\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getCancelText()\" (iconClick)=\"onCancel()\" [border]=\"true\" />\n }\n\n </div>\n </dialog>\n</div>\n}", styles: [".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1100;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out;outline:none}.modal-backdrop.show{opacity:1}.modal-container{background:var(--color-bg-primary);border-radius:8px;box-shadow:0 4px 20px #00000026;border:1px solid var(--color-border-default);max-width:400px;width:90%;max-height:90vh;overflow:hidden;transform:scale(.9) translateY(-10px);transition:all .15s ease-out;position:relative;padding:0}.modal-container.show{transform:scale(1) translateY(0)}.modal-container::backdrop{background:transparent}.modal-header{display:flex;align-items:center;gap:8px;padding:16px 20px 12px;border-bottom:1px solid var(--color-border-default);background:var(--color-bg-secondary)}.modal-header .modal-title{flex:1;margin:0;font-size:16px;font-weight:600;color:var(--color-text-primary);line-height:1.3}.modal-body{padding:16px 20px}.modal-body .modal-message{margin:0;font-size:14px;line-height:1.5;color:var(--color-text-primary);white-space:pre-line}.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;background:var(--color-bg-secondary);border-top:1px solid var(--color-border-default)}@media(max-width:768px){.modal-container{width:95%;margin:10px}.modal-header{padding:12px 16px 8px}.modal-header .modal-title{font-size:15px}.modal-body{padding:12px 16px}.modal-body .modal-message{font-size:13px}.modal-footer{padding:8px 16px 12px;flex-direction:column}}\n"] }]
143
143
  }], ctorParameters: () => [] });
144
144
  //# sourceMappingURL=modal.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/modal/modal.component.ts","../../../../../libs/ui/src/lib/modal/modal.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAA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GG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC;IACtC,CAAC;wGAlJU,cAAc;4FAAd,cAAc,qEClC3B,wsDAyCC,unDDZW,aAAa;;4FAKZ,cAAc;kBAT1B,SAAS;+BAEE,WAAW,cACT,IAAI,WACP,CAAC,aAAa,CAAC,mBAGP,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, computed, effect, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { ModalService } from './modal.service';\nimport { IconComponent } from './../icon';\n\nexport type ModalType = 'info' | 'confirm' | 'yesNo' | 'warning' | 'error';\n\nexport interface ModalConfig {\n title: string;\n message: string;\n type?: ModalType;\n confirmText?: string;\n cancelText?: string;\n yesText?: string;\n noText?: string;\n showCancel?: boolean;\n}\n\nexport interface ModalResult {\n action: 'confirm' | 'cancel' | 'yes' | 'no';\n confirmed: boolean;\n}\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-modal',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ModalComponent {\n private readonly modalService = inject(ModalService);\n\n readonly isOpen = this.modalService.modalState.isOpen;\n readonly config = this.modalService.modalState.config;\n readonly isVisible = computed(() => this.isOpen());\n\n /**\n *\n */\n constructor() {\n effect(() => {\n if (this.isOpen()) {\n // Auto-focus modal when opened for accessibility\n /* v8 ignore next 8 */\n setTimeout(() => {\n const backdrop = document.querySelector(\n '.modal-backdrop'\n ) as HTMLElement;\n if (backdrop) {\n backdrop.focus();\n }\n }, 100);\n }\n });\n }\n\n /**\n * Maneja la confirmación del modal\n */\n onConfirm(): void {\n this.modalService.handleResult({ action: 'confirm', confirmed: true });\n }\n\n /**\n * Maneja la cancelación del modal\n */\n onCancel(): void {\n this.modalService.handleResult({ action: 'cancel', confirmed: false });\n }\n\n /**\n * Maneja la respuesta afirmativa del modal\n */\n onYes(): void {\n this.modalService.handleResult({ action: 'yes', confirmed: true });\n }\n\n /**\n * Maneja la respuesta negativa del modal\n */\n onNo(): void {\n this.modalService.handleResult({ action: 'no', confirmed: false });\n }\n\n /**\n * Cierra el modal actual\n */\n closeModal(): void {\n this.modalService.closeModal();\n }\n\n /**\n * Maneja el clic en el backdrop del modal\n * @param event - Evento de clic\n */\n onBackdropClick(event: Event): void {\n if (event.target === event.currentTarget) {\n this.closeModal();\n }\n }\n\n /**\n *\n * @returns Clase CSS del botón primario según el tipo de modal\n */\n getPrimaryButtonClass(): string {\n const configValue = this.config();\n switch (configValue.type) {\n case 'warning':\n return 'btn-warning';\n case 'error':\n return 'btn-danger';\n case 'confirm':\n case 'yesNo':\n return 'btn-primary';\n default:\n return 'btn-info';\n }\n }\n\n /**\n *\n * @returns true si debe mostrar botones Sí/No\n */\n showYesNoButtons(): boolean {\n return this.config().type === 'yesNo';\n }\n\n /**\n *\n * @returns true si debe mostrar botones Confirmar/Cancelar\n */\n showConfirmButtons(): boolean {\n const type = this.config().type;\n return type === 'confirm' || type === 'warning' || type === 'error';\n }\n\n /**\n *\n * @returns true si debe mostrar botón OK\n */\n showOkButton(): boolean {\n return this.config().type === 'info';\n }\n\n /**\n *\n * @returns Texto del botón de confirmación\n */\n getConfirmText(): string {\n return this.config().confirmText ?? 'Confirmar';\n }\n\n /**\n *\n * @returns Texto del botón de cancelar\n */\n getCancelText(): string {\n return this.config().cancelText ?? 'Cancelar';\n }\n\n /**\n *\n * @returns Texto del botón Sí\n */\n getYesText(): string {\n return this.config().yesText ?? 'Sí';\n }\n\n /**\n *\n * @returns Texto del botón No\n */\n getNoText(): string {\n return this.config().noText ?? 'No';\n }\n}\n","<!-- Modal Backdrop -->\n@if (isOpen()) {\n<div class=\"modal-backdrop\" [class.show]=\"isVisible()\" tabindex=\"-1\" (click)=\"onBackdropClick($event)\" (keydown.escape)=\"closeModal()\">\n\n <!-- Modal Container -->\n <dialog class=\"modal-container\" [class.show]=\"isVisible()\" [attr.aria-labelledby]=\"'modal-title'\" [open]=\"isVisible()\">\n\n <!-- Modal Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" id=\"modal-title\">{{ config().title }}</h4>\n <c80-icon [button]=\"true\" icon=\"close\" (iconClick)=\"closeModal()\" title=\"Cerrar\" color=\"warn\" />\n </div>\n\n <!-- Modal Body -->\n <div class=\"modal-body\">\n <p class=\"modal-message\">{{ config().message }}</p>\n </div>\n\n <!-- Modal Footer -->\n <div class=\"modal-footer\">\n\n <!-- Info Modal - Solo OK -->\n @if (showOkButton()) {\n <c80-icon [button]=\"true\" icon=\"check\" textRight=\"OK\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n }\n\n <!-- Yes/No Modal -->\n @if (showYesNoButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getYesText()\" (iconClick)=\"onYes()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getNoText()\" color=\"warn\" (iconClick)=\"onNo()\" [border]=\"true\" />\n }\n\n <!-- Confirm Modal -->\n @if (showConfirmButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getConfirmText()\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getCancelText()\" color=\"warn\" (iconClick)=\"onCancel()\" [border]=\"true\" />\n }\n\n </div>\n </dialog>\n</div>\n}"]}
1
+ {"version":3,"file":"modal.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/modal/modal.component.ts","../../../../../libs/ui/src/lib/modal/modal.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,eAAe,C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Aa;QACX,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,IAAI,UAAU,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC;IACtC,CAAC;wGAlJU,cAAc;4FAAd,cAAc,qEChB3B,2pDAyCC,unDD9BW,aAAa;;4FAKZ,cAAc;kBAT1B,SAAS;+BAEE,WAAW,cACT,IAAI,WACP,CAAC,aAAa,CAAC,mBAGP,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, computed, effect, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { ModalService } from './modal.service';\nimport { IconComponent } from './../icon';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-modal',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ModalComponent {\n private readonly modalService = inject(ModalService);\n\n readonly isOpen = this.modalService.modalState.isOpen;\n readonly config = this.modalService.modalState.config;\n readonly isVisible = computed(() => this.isOpen());\n\n /**\n *\n */\n constructor() {\n effect(() => {\n if (this.isOpen()) {\n // Auto-focus modal when opened for accessibility\n /* v8 ignore next 8 */\n setTimeout(() => {\n const backdrop = document.querySelector(\n '.modal-backdrop'\n ) as HTMLElement;\n if (backdrop) {\n backdrop.focus();\n }\n }, 100);\n }\n });\n }\n\n /**\n * Maneja la confirmación del modal\n */\n onConfirm(): void {\n this.modalService.handleResult({ action: 'confirm', confirmed: true });\n }\n\n /**\n * Maneja la cancelación del modal\n */\n onCancel(): void {\n this.modalService.handleResult({ action: 'cancel', confirmed: false });\n }\n\n /**\n * Maneja la respuesta afirmativa del modal\n */\n onYes(): void {\n this.modalService.handleResult({ action: 'yes', confirmed: true });\n }\n\n /**\n * Maneja la respuesta negativa del modal\n */\n onNo(): void {\n this.modalService.handleResult({ action: 'no', confirmed: false });\n }\n\n /**\n * Cierra el modal actual\n */\n closeModal(): void {\n this.modalService.closeModal();\n }\n\n /**\n * Maneja el clic en el backdrop del modal\n * @param event - Evento de clic\n */\n onBackdropClick(event: Event): void {\n if (event.target === event.currentTarget) {\n this.closeModal();\n }\n }\n\n /**\n *\n * @returns Clase CSS del botón primario según el tipo de modal\n */\n getPrimaryButtonClass(): string {\n const configValue = this.config();\n switch (configValue.type) {\n case 'warning':\n return 'btn-warning';\n case 'error':\n return 'btn-danger';\n case 'confirm':\n case 'yesNo':\n return 'btn-primary';\n default:\n return 'btn-info';\n }\n }\n\n /**\n *\n * @returns true si debe mostrar botones Sí/No\n */\n showYesNoButtons(): boolean {\n return this.config().type === 'yesNo';\n }\n\n /**\n *\n * @returns true si debe mostrar botones Confirmar/Cancelar\n */\n showConfirmButtons(): boolean {\n const type = this.config().type;\n return type === 'confirm' || type === 'warning' || type === 'error';\n }\n\n /**\n *\n * @returns true si debe mostrar botón OK\n */\n showOkButton(): boolean {\n return this.config().type === 'info';\n }\n\n /**\n *\n * @returns Texto del botón de confirmación\n */\n getConfirmText(): string {\n return this.config().confirmText ?? 'Confirmar';\n }\n\n /**\n *\n * @returns Texto del botón de cancelar\n */\n getCancelText(): string {\n return this.config().cancelText ?? 'Cancelar';\n }\n\n /**\n *\n * @returns Texto del botón Sí\n */\n getYesText(): string {\n return this.config().yesText ?? 'Sí';\n }\n\n /**\n *\n * @returns Texto del botón No\n */\n getNoText(): string {\n return this.config().noText ?? 'No';\n }\n}\n","<!-- Modal Backdrop -->\n@if (isOpen()) {\n<div class=\"modal-backdrop\" [class.show]=\"isVisible()\" tabindex=\"-1\" (click)=\"onBackdropClick($event)\" (keydown.escape)=\"closeModal()\">\n\n <!-- Modal Container -->\n <dialog class=\"modal-container\" [class.show]=\"isVisible()\" [attr.aria-labelledby]=\"'modal-title'\" [open]=\"isVisible()\">\n\n <!-- Modal Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" id=\"modal-title\">{{ config().title }}</h4>\n <c80-icon [button]=\"true\" icon=\"close\" (iconClick)=\"closeModal()\" title=\"Cerrar\" />\n </div>\n\n <!-- Modal Body -->\n <div class=\"modal-body\">\n <p class=\"modal-message\">{{ config().message }}</p>\n </div>\n\n <!-- Modal Footer -->\n <div class=\"modal-footer\">\n\n <!-- Info Modal - Solo OK -->\n @if (showOkButton()) {\n <c80-icon [button]=\"true\" icon=\"check\" textRight=\"OK\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n }\n\n <!-- Yes/No Modal -->\n @if (showYesNoButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getYesText()\" (iconClick)=\"onYes()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getNoText()\" (iconClick)=\"onNo()\" [border]=\"true\" />\n }\n\n <!-- Confirm Modal -->\n @if (showConfirmButtons()) {\n <c80-icon [button]=\"true\" icon=\"check\" [textRight]=\"getConfirmText()\" (iconClick)=\"onConfirm()\" [border]=\"true\" />\n <c80-icon [button]=\"true\" icon=\"cancel\" [textRight]=\"getCancelText()\" (iconClick)=\"onCancel()\" [border]=\"true\" />\n }\n\n </div>\n </dialog>\n</div>\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/modal/modal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAGnD;;GAEG;AAIH,MAAM,OAAO,YAAY;IACN,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC,CAAC;IACvB,MAAM,GAAG,MAAM,CAAc;QAC5C,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,MAAM;KACb,kDAAC,CAAC;IAEK,cA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AAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport type { ModalConfig, ModalResult } from './modal.component';\n\n/**\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ModalService {\n private readonly isOpen = signal(false);\n private readonly config = signal<ModalConfig>({\n title: '',\n message: '',\n type: 'info',\n });\n\n private resolvePromise?: (result: ModalResult) => void;\n\n readonly modalState = {\n isOpen: this.isOpen.asReadonly(),\n config: this.config.asReadonly(),\n };\n\n /**\n *\n * @param config\n */\n async showModal(config: ModalConfig): Promise<ModalResult> {\n this.config.set(config);\n this.isOpen.set(true);\n\n return new Promise<ModalResult>((resolve) => {\n this.resolvePromise = resolve;\n });\n }\n\n /**\n *\n * @param options\n * @param options.title\n * @param options.message\n * @param options.confirmText\n * @param options.cancelText\n * @returns Promise que resuelve true si se confirmó\n */\n async confirm(options: {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n }): Promise<boolean> {\n const { title, message, confirmText = 'Confirmar', cancelText = 'Cancelar' } = options;\n return this.showModal({\n title,\n message,\n type: 'confirm',\n confirmText,\n cancelText,\n }).then((result) => result.confirmed);\n }\n\n /**\n *\n * @param options\n * @param options.title\n * @param options.message\n * @param options.yesText\n * @param options.noText\n * @returns Promise que resuelve true si se eligió Sí\n */\n async yesNo(options: {\n title: string;\n message: string;\n yesText?: string;\n noText?: string;\n }): Promise<boolean> {\n const { title, message, yesText = 'Sí', noText = 'No' } = options;\n return this.showModal({\n title,\n message,\n type: 'yesNo',\n yesText,\n noText,\n }).then((result) => result.action === 'yes');\n }\n\n /**\n *\n * @param title\n * @param message\n * @returns Promise que resuelve cuando se cierra el modal\n */\n async info(title: string, message: string): Promise<void> {\n return this.showModal({\n title,\n message,\n type: 'info',\n }).then(() => void 0);\n }\n\n /**\n *\n * @param options\n * @param options.title\n * @param options.message\n * @param options.confirmText\n * @param options.cancelText\n * @returns Promise que resuelve true si se confirmó\n */\n async warning(options: {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n }): Promise<boolean> {\n const { title, message, confirmText = 'Entendido', cancelText = 'Cancelar' } = options;\n return this.showModal({\n title,\n message,\n type: 'warning',\n confirmText,\n cancelText,\n }).then((result) => result.confirmed);\n }\n\n /**\n *\n * @param title\n * @param message\n * @param confirmText\n * @returns Promise que resuelve true si se confirmó\n */\n async error(\n title: string,\n message: string,\n confirmText = 'Entendido'\n ): Promise<void> {\n return this.showModal({\n title,\n message,\n type: 'error',\n confirmText,\n }).then(() => void 0);\n }\n\n /**\n * Maneja el resultado del modal y resuelve la promesa\n * @param result - Resultado de la acción del modal\n */\n handleResult(result: ModalResult): void {\n if (this.resolvePromise) {\n this.resolvePromise(result);\n this.resolvePromise = undefined;\n }\n this.closeModal();\n }\n\n /**\n * Cierra el modal actual\n */\n closeModal(): void {\n this.isOpen.set(false);\n }\n}\n"]}
1
+ {"version":3,"file":"modal.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/modal/modal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAGnD;;GAEG;AAIH,MAAM,OAAO,YAAY;IACN,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC,CAAC;IACvB,MAAM,GAAG,MAAM,CAAc;QAC5C,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,MAAM;KACb,kDAAC,CAAC;IAEK,cAAc,CAAiC;IAE9C,UAAU,GAAG;QACpB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;QAChC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;KACjC,CAAC;IAEF;;;OAGG;IACH,KAAK,CAAC,SAAS,CAAC,MAAmB;QACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEtB,OAAO,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AE,GAAG,OAAO,CAAC;QACvF,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK;YACL,OAAO;YACP,IAAI,EAAE,SAAS;YACf,WAAW;YACX,UAAU;SACX,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CACT,KAAa,EACb,OAAe,EACf,WAAW,GAAG,WAAW;QAEzB,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,KAAK;YACL,OAAO;YACP,IAAI,EAAE,OAAO;YACb,WAAW;SACZ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAmB;QAC9B,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAC5B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAClC,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;wGA1JU,YAAY;4GAAZ,YAAY,cAFX,MAAM;;4FAEP,YAAY;kBAHxB,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport type { ModalConfig, ModalResult } from './modal.types';\n\n/**\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ModalService {\n private readonly isOpen = signal(false);\n private readonly config = signal<ModalConfig>({\n title: '',\n message: '',\n type: 'info',\n });\n\n private resolvePromise?: (result: ModalResult) => void;\n\n readonly modalState = {\n isOpen: this.isOpen.asReadonly(),\n config: this.config.asReadonly(),\n };\n\n /**\n *\n * @param config\n */\n async showModal(config: ModalConfig): Promise<ModalResult> {\n this.config.set(config);\n this.isOpen.set(true);\n\n return new Promise<ModalResult>((resolve) => {\n this.resolvePromise = resolve;\n });\n }\n\n /**\n *\n * @param options\n * @param options.title\n * @param options.message\n * @param options.confirmText\n * @param options.cancelText\n * @returns Promise que resuelve true si se confirmó\n */\n async confirm(options: {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n }): Promise<boolean> {\n const { title, message, confirmText = 'Confirmar', cancelText = 'Cancelar' } = options;\n return this.showModal({\n title,\n message,\n type: 'confirm',\n confirmText,\n cancelText,\n }).then((result) => result.confirmed);\n }\n\n /**\n *\n * @param options\n * @param options.title\n * @param options.message\n * @param options.yesText\n * @param options.noText\n * @returns Promise que resuelve true si se eligió Sí\n */\n async yesNo(options: {\n title: string;\n message: string;\n yesText?: string;\n noText?: string;\n }): Promise<boolean> {\n const { title, message, yesText = 'Sí', noText = 'No' } = options;\n return this.showModal({\n title,\n message,\n type: 'yesNo',\n yesText,\n noText,\n }).then((result) => result.action === 'yes');\n }\n\n /**\n *\n * @param title\n * @param message\n * @returns Promise que resuelve cuando se cierra el modal\n */\n async info(title: string, message: string): Promise<void> {\n return this.showModal({\n title,\n message,\n type: 'info',\n }).then(() => void 0);\n }\n\n /**\n *\n * @param options\n * @param options.title\n * @param options.message\n * @param options.confirmText\n * @param options.cancelText\n * @returns Promise que resuelve true si se confirmó\n */\n async warning(options: {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n }): Promise<boolean> {\n const { title, message, confirmText = 'Entendido', cancelText = 'Cancelar' } = options;\n return this.showModal({\n title,\n message,\n type: 'warning',\n confirmText,\n cancelText,\n }).then((result) => result.confirmed);\n }\n\n /**\n *\n * @param title\n * @param message\n * @param confirmText\n * @returns Promise que resuelve true si se confirmó\n */\n async error(\n title: string,\n message: string,\n confirmText = 'Entendido'\n ): Promise<void> {\n return this.showModal({\n title,\n message,\n type: 'error',\n confirmText,\n }).then(() => void 0);\n }\n\n /**\n * Maneja el resultado del modal y resuelve la promesa\n * @param result - Resultado de la acción del modal\n */\n handleResult(result: ModalResult): void {\n if (this.resolvePromise) {\n this.resolvePromise(result);\n this.resolvePromise = undefined;\n }\n this.closeModal();\n }\n\n /**\n * Cierra el modal actual\n */\n closeModal(): void {\n this.isOpen.set(false);\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=modal.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/modal/modal.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ModalType = 'info' | 'confirm' | 'yesNo' | 'warning' | 'error';\n\nexport interface ModalConfig {\n title: string;\n message: string;\n type?: ModalType;\n confirmText?: string;\n cancelText?: string;\n yesText?: string;\n noText?: string;\n showCancel?: boolean;\n}\n\nexport interface ModalResult {\n action: 'confirm' | 'cancel' | 'yes' | 'no';\n confirmed: boolean;\n}\n"]}
@@ -1,3 +1,3 @@
1
- export * from './select.model';
1
+ export * from './select.types';
2
2
  export * from './select.component';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './select.model';\nexport * from './select.component';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './select.types';\nexport * from './select.component';\n"]}
@@ -31,12 +31,15 @@ export class SelectComponent {
31
31
  controlId = `c80-select-${++uniqueIdCounter}`;
32
32
  searchInput = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInput" }] : []));
33
33
  filteredOptions = computed(() => {
34
- const term = this.searchTerm().toLowerCase().trim();
34
+ const term = this.normalizeString(this.searchTerm());
35
35
  if (!term || !this.filterable()) {
36
36
  return this.options();
37
37
  }
38
38
  return this.options().filter(opt => opt.label.toLowerCase().includes(term));
39
39
  }, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : []));
40
+ normalizeString(str) {
41
+ return str.toLowerCase().trim();
42
+ }
40
43
  /**
41
44
  *
42
45
  */
@@ -1 +1 @@
1
- {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.component.ts","../../../../../libs/ui/src/lib/select/select.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAmB,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAGhI,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;GAEG;AAUH,MAAM,OAAO,eAAe;IACjB,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAU,CAAC;IAC1C,oBAAoB;IACX,WAAW,GAAG,KAAK,CAAS,aAAa,uDAAC,CAAC;IACpD,oBAAoB;IACX,KAAK,GAAG,KAAK,CAAW,IAAI,iDAAC,CAAC;IACvC,oBAAoB;IACX,OAAO,GAAG,KAAK,CAAoB,EAAE,mDAAC,CAAC;IAChD,oBAAoB;IACX,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC,CAAC;IAC1C,oBAAoB;IACX,OAAO,GAAG,KAAK,CAAU,KAAK,mDAAC,CAAC;IACzC,oBAAoB;IACX,YAAY,GAAG,KAAK,CAAS,6BAA6B,wDAAC,CAAC;IACrE,oBAAoB;IACX,SAAS,GAAG,KAAK,CAAS,OAAO,qDAAC,CAAC;IAC5C,oBAAoB;IACX,UAAU,GAAG,KAAK,CAAU,KAAK,sDAAC,CAAC;IAEnC,WAAW,GAAG,MAAM,EAAY,CAAC;IACjC,MAAM,GAAG,MAAM,EAAQ,CAAC;IAEjC,oBAAoB;IACX,MAAM,GAAG,MAA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YAAY,cACV,IAAI,WACP,EAAE,mBAGM,uBAAuB,CAAC,MAAM;whCA6BgB,aAAa","sourcesContent":["import { type ElementRef, ChangeDetectionStrategy, Component, computed, input, output, signal, viewChild } from '@angular/core';\nimport type { SelectOption } from './select.model';\n\nlet uniqueIdCounter = 0;\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-select',\n standalone: true,\n imports: [],\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SelectComponent<T = string> {\n readonly label = input.required<string>();\n /* v8 ignore next */\n readonly placeholder = input<string>('Seleccionar');\n /* v8 ignore next */\n readonly value = input<T | null>(null);\n /* v8 ignore next */\n readonly options = input<SelectOption<T>[]>([]);\n /* v8 ignore next */\n readonly disabled = input<boolean>(false);\n /* v8 ignore next */\n readonly loading = input<boolean>(false);\n /* v8 ignore next */\n readonly emptyMessage = input<string>('No hay opciones disponibles');\n /* v8 ignore next */\n readonly maxHeight = input<string>('300px');\n /* v8 ignore next */\n readonly filterable = input<boolean>(false);\n\n readonly valueChange = output<T | null>();\n readonly opened = output<void>();\n\n /* v8 ignore next */\n readonly isOpen = signal(false);\n /* v8 ignore next */\n readonly searchTerm = signal<string>('');\n readonly controlId = `c80-select-${++uniqueIdCounter}`;\n readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput');\n\n readonly filteredOptions = computed(() => {\n const term = this.searchTerm().toLowerCase().trim();\n if (!term || !this.filterable()) {\n return this.options();\n }\n return this.options().filter(opt =>\n opt.label.toLowerCase().includes(term)\n );\n });\n\n /**\n *\n */\n toggleDropdown(): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n\n const wasOpen = this.isOpen();\n this.isOpen.set(!wasOpen);\n\n if (wasOpen) {\n this.clearSearch();\n } else {\n this.opened.emit();\n if (this.filterable()) {\n /* v8 ignore next 2 */\n setTimeout(() => this.searchInput()?.nativeElement.focus(), 0);\n }\n }\n }\n\n /**\n *\n * @param option\n */\n selectOption(option: SelectOption<T>): void {\n if (option.disabled) {\n return;\n }\n\n this.valueChange.emit(option.value);\n this.isOpen.set(false);\n }\n\n /**\n *\n */\n selectNull(): void {\n this.valueChange.emit(null);\n this.isOpen.set(false);\n }\n\n /**\n *\n * @returns Etiqueta del valor seleccionado o placeholder\n */\n getSelectedLabel(): string {\n const currentValue = this.value();\n if (currentValue === null || currentValue === undefined) {\n return this.placeholder();\n }\n\n const selected = this.options().find(opt => opt.value === currentValue);\n return selected?.label ?? this.placeholder();\n }\n\n /**\n *\n */\n closeDropdown(): void {\n this.isOpen.set(false);\n this.clearSearch();\n }\n\n /**\n *\n * @param term\n */\n onSearchChange(term: string): void {\n this.searchTerm.set(term);\n }\n\n /**\n *\n */\n clearSearch(): void {\n this.searchTerm.set('');\n }\n}\n","<div class=\"k-select\" [class.k-select--disabled]=\"disabled()\" [class.k-select--open]=\"isOpen()\">\n <button type=\"button\" class=\"k-select__control\" [attr.id]=\"controlId\" [attr.aria-label]=\"label()\" [attr.aria-expanded]=\"isOpen()\" [disabled]=\"disabled() || loading()\" (click)=\"toggleDropdown()\" (keydown.enter)=\"toggleDropdown()\"\n (keydown.space)=\"$event.preventDefault(); toggleDropdown()\">\n <span class=\"k-select__value\" [class.k-select__value--placeholder]=\"value() === null\">\n @if (loading()) {\n Cargando...\n } @else {\n {{ getSelectedLabel() }}\n }\n </span>\n <span class=\"k-select__arrow\" [class.k-select__arrow--up]=\"isOpen()\">▼</span>\n </button>\n\n @if (isOpen()) {\n <div class=\"k-select__backdrop\" tabindex=\"-1\" (click)=\"closeDropdown()\" (keydown.escape)=\"closeDropdown()\"></div>\n <!-- eslint-disable-next-line @angular-eslint/template/no-inline-styles -->\n <div class=\"k-select__dropdown\" [style.max-height]=\"maxHeight()\">\n @if (filterable()) {\n <div class=\"k-select__search\">\n <input type=\"text\" class=\"k-select__search-input\" [value]=\"searchTerm()\" (input)=\"onSearchChange($any($event.target).value)\" placeholder=\"Buscar...\" (click)=\"$event.stopPropagation()\" (keydown.escape)=\"closeDropdown()\" #searchInput />\n </div>\n }\n\n <button type=\"button\" class=\"k-select__option\" (click)=\"selectNull()\" (keydown.enter)=\"selectNull()\">\n -- {{ placeholder() }} --\n </button>\n\n @if (loading()) {\n <button type=\"button\" class=\"k-select__option k-select__option--disabled\" disabled>\n Cargando...\n </button>\n } @else if (filteredOptions().length === 0) {\n <button type=\"button\" class=\"k-select__option k-select__option--disabled\" disabled>\n {{ searchTerm() ? 'No se encontraron resultados' : emptyMessage() }}\n </button>\n } @else {\n @for (option of filteredOptions(); track option.value) {\n <button type=\"button\" class=\"k-select__option\" [class.k-select__option--selected]=\"option.value === value()\" [class.k-select__option--disabled]=\"option.disabled\" [disabled]=\"option.disabled\" (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\">\n {{ option.label }}\n </button>\n }\n }\n </div>\n }\n</div>"]}
1
+ {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.component.ts","../../../../../libs/ui/src/lib/select/select.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAmB,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAGhI,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;GAEG;AAUH,MAAM,OAAO,eAAe;IACjB,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAU,CAAC;IAC1C,oBAAoB;IACX,WAAW,GAAG,KAAK,CAAS,aAAa,uDAAC,CAAC;IACpD,oBAAoB;IACX,KAAK,GAAG,KAAK,CAAW,IAAI,iDAAC,CAAC;IACvC,oBAAoB;IACX,OAAO,GAAG,KAAK,CAAoB,EAAE,mDAAC,CAAC;IAChD,oBAAoB;IACX,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC,CAAC;IAC1C,oBAAoB;IACX,OAAO,GAAG,KAAK,CAA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OAEG;IACH,aAAa;QACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,IAAY;QACzB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;wGAzHU,eAAe;4FAAf,eAAe,u5CCjB5B,i0EA6CM;;4FD5BO,eAAe;kBAT3B,SAAS;+BAEE,YAAY,cACV,IAAI,WACP,EAAE,mBAGM,uBAAuB,CAAC,MAAM;whCA6BgB,aAAa","sourcesContent":["import { type ElementRef, ChangeDetectionStrategy, Component, computed, input, output, signal, viewChild } from '@angular/core';\nimport type { SelectOption } from './select.types';\n\nlet uniqueIdCounter = 0;\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-select',\n standalone: true,\n imports: [],\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SelectComponent<T = string> {\n readonly label = input.required<string>();\n /* v8 ignore next */\n readonly placeholder = input<string>('Seleccionar');\n /* v8 ignore next */\n readonly value = input<T | null>(null);\n /* v8 ignore next */\n readonly options = input<SelectOption<T>[]>([]);\n /* v8 ignore next */\n readonly disabled = input<boolean>(false);\n /* v8 ignore next */\n readonly loading = input<boolean>(false);\n /* v8 ignore next */\n readonly emptyMessage = input<string>('No hay opciones disponibles');\n /* v8 ignore next */\n readonly maxHeight = input<string>('300px');\n /* v8 ignore next */\n readonly filterable = input<boolean>(false);\n\n readonly valueChange = output<T | null>();\n readonly opened = output<void>();\n\n /* v8 ignore next */\n readonly isOpen = signal(false);\n /* v8 ignore next */\n readonly searchTerm = signal<string>('');\n readonly controlId = `c80-select-${++uniqueIdCounter}`;\n readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput');\n\n readonly filteredOptions = computed(() => {\n const term = this.normalizeString(this.searchTerm());\n if (!term || !this.filterable()) {\n return this.options();\n }\n return this.options().filter(opt =>\n opt.label.toLowerCase().includes(term)\n );\n });\n\n normalizeString(str: string): string {\n return str.toLowerCase().trim();\n }\n\n /**\n *\n */\n toggleDropdown(): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n\n const wasOpen = this.isOpen();\n this.isOpen.set(!wasOpen);\n\n if (wasOpen) {\n this.clearSearch();\n } else {\n this.opened.emit();\n if (this.filterable()) {\n /* v8 ignore next 2 */\n setTimeout(() => this.searchInput()?.nativeElement.focus(), 0);\n }\n }\n }\n\n /**\n *\n * @param option\n */\n selectOption(option: SelectOption<T>): void {\n if (option.disabled) {\n return;\n }\n\n this.valueChange.emit(option.value);\n this.isOpen.set(false);\n }\n\n /**\n *\n */\n selectNull(): void {\n this.valueChange.emit(null);\n this.isOpen.set(false);\n }\n\n /**\n *\n * @returns Etiqueta del valor seleccionado o placeholder\n */\n getSelectedLabel(): string {\n const currentValue = this.value();\n if (currentValue === null || currentValue === undefined) {\n return this.placeholder();\n }\n\n const selected = this.options().find(opt => opt.value === currentValue);\n return selected?.label ?? this.placeholder();\n }\n\n /**\n *\n */\n closeDropdown(): void {\n this.isOpen.set(false);\n this.clearSearch();\n }\n\n /**\n *\n * @param term\n */\n onSearchChange(term: string): void {\n this.searchTerm.set(term);\n }\n\n /**\n *\n */\n clearSearch(): void {\n this.searchTerm.set('');\n }\n}\n","<div class=\"k-select\" [class.k-select--disabled]=\"disabled()\" [class.k-select--open]=\"isOpen()\">\n <button type=\"button\" class=\"k-select__control\" [attr.id]=\"controlId\" [attr.aria-label]=\"label()\" [attr.aria-expanded]=\"isOpen()\" [disabled]=\"disabled() || loading()\" (click)=\"toggleDropdown()\" (keydown.enter)=\"toggleDropdown()\"\n (keydown.space)=\"$event.preventDefault(); toggleDropdown()\">\n <span class=\"k-select__value\" [class.k-select__value--placeholder]=\"value() === null\">\n @if (loading()) {\n Cargando...\n } @else {\n {{ getSelectedLabel() }}\n }\n </span>\n <span class=\"k-select__arrow\" [class.k-select__arrow--up]=\"isOpen()\">▼</span>\n </button>\n\n @if (isOpen()) {\n <div class=\"k-select__backdrop\" tabindex=\"-1\" (click)=\"closeDropdown()\" (keydown.escape)=\"closeDropdown()\"></div>\n <!-- eslint-disable-next-line @angular-eslint/template/no-inline-styles -->\n <div class=\"k-select__dropdown\" [style.max-height]=\"maxHeight()\">\n @if (filterable()) {\n <div class=\"k-select__search\">\n <input type=\"text\" class=\"k-select__search-input\" [value]=\"searchTerm()\" (input)=\"onSearchChange($any($event.target).value)\" placeholder=\"Buscar...\" (click)=\"$event.stopPropagation()\" (keydown.escape)=\"closeDropdown()\" #searchInput />\n </div>\n }\n\n <button type=\"button\" class=\"k-select__option\" (click)=\"selectNull()\" (keydown.enter)=\"selectNull()\">\n -- {{ placeholder() }} --\n </button>\n\n @if (loading()) {\n <button type=\"button\" class=\"k-select__option k-select__option--disabled\" disabled>\n Cargando...\n </button>\n } @else if (filteredOptions().length === 0) {\n <button type=\"button\" class=\"k-select__option k-select__option--disabled\" disabled>\n {{ searchTerm() ? 'No se encontraron resultados' : emptyMessage() }}\n </button>\n } @else {\n @for (option of filteredOptions(); track option.value) {\n <button type=\"button\" class=\"k-select__option\" [class.k-select__option--selected]=\"option.value === value()\" [class.k-select__option--disabled]=\"option.disabled\" [disabled]=\"option.disabled\" (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\">\n {{ option.label }}\n </button>\n }\n }\n </div>\n }\n</div>"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=select.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SelectOption<T = string> {\n value: T;\n label: string;\n disabled?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { SnackbarComponent } from './snackbar.component';\nexport { SnackbarService } from './snackbar.service';\nexport type { SnackbarConfig, SnackbarData } from './snackbar.model';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { SnackbarComponent } from './snackbar.component';\nexport { SnackbarService } from './snackbar.service';\nexport type { SnackbarConfig, SnackbarData } from './snackbar.types';\n"]}
@@ -67,10 +67,10 @@ export class SnackbarComponent {
67
67
  }
68
68
  }
69
69
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SnackbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: SnackbarComponent, isStandalone: true, selector: "c80-snackbar", ngImport: i0, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding:.875rem 1rem;background:var(--color-bg-snackbar);color:var(--color-text-primary);border-radius:.25rem;box-shadow:var(--shadow-lg);pointer-events:auto;animation:slideIn .3s ease-out;min-width:18rem;max-width:35rem}.snackbar-message{flex:1;font-size:.875rem}.snackbar-action{background:transparent;border:none;color:var(--color-text-link-light);cursor:pointer;font-size:.875rem;font-weight:500;text-transform:uppercase;padding:.25rem .5rem;border-radius:.25rem;transition:background-color .2s}.snackbar-action:hover{background-color:var(--color-bg-hover-overlay)}.notification-success{background:var(--color-icon-success)}.notification-success .snackbar-action{color:var(--color-text-inverse)}.notification-error{background:var(--color-icon-danger)}.notification-error .snackbar-action{color:var(--color-text-primary)}@keyframes slideIn{0%{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: SnackbarComponent, isStandalone: true, selector: "c80-snackbar", ngImport: i0, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding:1rem 1.25rem;background:var(--color-bg-secondary);color:var(--color-text-primary);border:1px solid var(--color-border-default);border-radius:.5rem;box-shadow:var(--shadow-lg);pointer-events:auto;animation:slideIn .3s ease-out;min-width:20rem;max-width:35rem}.snackbar-message{flex:1;font-size:.875rem;line-height:1.5;font-weight:500}.snackbar-action{background:transparent;border:1px solid var(--color-border-default);color:var(--color-text-secondary);cursor:pointer;font-size:.75rem;font-weight:600;text-transform:uppercase;padding:.375rem .75rem;border-radius:.375rem;transition:all .2s ease;white-space:nowrap}.snackbar-action:hover{background-color:var(--color-bg-hover);border-color:var(--color-border-medium);color:var(--color-text-primary)}.snackbar-action:active{transform:scale(.98)}.notification-success{background:var(--color-bg-success-light);border-color:var(--color-border-success);color:var(--color-text-success)}.notification-success .snackbar-message{color:var(--color-text-success)}.notification-success .snackbar-action{color:var(--color-text-success);border-color:var(--color-border-success)}.notification-success .snackbar-action:hover{background-color:var(--color-bg-success);border-color:var(--color-border-success)}.notification-error{background:var(--color-bg-danger-light);border-color:var(--color-border-danger);color:var(--color-text-danger)}.notification-error .snackbar-message{color:var(--color-text-danger)}.notification-error .snackbar-action{color:var(--color-text-danger);border-color:var(--color-border-danger)}.notification-error .snackbar-action:hover{background-color:var(--color-bg-danger);border-color:var(--color-border-danger)}@keyframes slideIn{0%{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
71
71
  }
72
72
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SnackbarComponent, decorators: [{
73
73
  type: Component,
74
- args: [{ selector: 'c80-snackbar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding:.875rem 1rem;background:var(--color-bg-snackbar);color:var(--color-text-primary);border-radius:.25rem;box-shadow:var(--shadow-lg);pointer-events:auto;animation:slideIn .3s ease-out;min-width:18rem;max-width:35rem}.snackbar-message{flex:1;font-size:.875rem}.snackbar-action{background:transparent;border:none;color:var(--color-text-link-light);cursor:pointer;font-size:.875rem;font-weight:500;text-transform:uppercase;padding:.25rem .5rem;border-radius:.25rem;transition:background-color .2s}.snackbar-action:hover{background-color:var(--color-bg-hover-overlay)}.notification-success{background:var(--color-icon-success)}.notification-success .snackbar-action{color:var(--color-text-inverse)}.notification-error{background:var(--color-icon-danger)}.notification-error .snackbar-action{color:var(--color-text-primary)}@keyframes slideIn{0%{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}\n"] }]
74
+ args: [{ selector: 'c80-snackbar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding:1rem 1.25rem;background:var(--color-bg-secondary);color:var(--color-text-primary);border:1px solid var(--color-border-default);border-radius:.5rem;box-shadow:var(--shadow-lg);pointer-events:auto;animation:slideIn .3s ease-out;min-width:20rem;max-width:35rem}.snackbar-message{flex:1;font-size:.875rem;line-height:1.5;font-weight:500}.snackbar-action{background:transparent;border:1px solid var(--color-border-default);color:var(--color-text-secondary);cursor:pointer;font-size:.75rem;font-weight:600;text-transform:uppercase;padding:.375rem .75rem;border-radius:.375rem;transition:all .2s ease;white-space:nowrap}.snackbar-action:hover{background-color:var(--color-bg-hover);border-color:var(--color-border-medium);color:var(--color-text-primary)}.snackbar-action:active{transform:scale(.98)}.notification-success{background:var(--color-bg-success-light);border-color:var(--color-border-success);color:var(--color-text-success)}.notification-success .snackbar-message{color:var(--color-text-success)}.notification-success .snackbar-action{color:var(--color-text-success);border-color:var(--color-border-success)}.notification-success .snackbar-action:hover{background-color:var(--color-bg-success);border-color:var(--color-border-success)}.notification-error{background:var(--color-bg-danger-light);border-color:var(--color-border-danger);color:var(--color-text-danger)}.notification-error .snackbar-message{color:var(--color-text-danger)}.notification-error .snackbar-action{color:var(--color-text-danger);border-color:var(--color-border-danger)}.notification-error .snackbar-action:hover{background-color:var(--color-bg-danger);border-color:var(--color-border-danger)}@keyframes slideIn{0%{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}\n"] }]
75
75
  }] });
76
76
  //# sourceMappingURL=snackbar.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snackbar.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.component.ts","../../../../../libs/ui/src/lib/snackbar/snackbar.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;;AAGvI;;GAEG;AASH,MAAM,OAAO,iBAAiB;IACX,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC7B,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAEjD,oBAAoB;IACX,IAAI,GAAG,MAAM,CAAsB,IAAI,gDAAC,CAAC;IAClD,oBAAoB;IACX,OAAO,GAAG,MAAM,CAAC,KAAK,mDAAC,CAAC;IAEzB,OAAO,CAAiC;IAEvC,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,wDAAC,CAAC;IAEvF;;;OAGG;IACH,IAAI,CAAC,IAAkB;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEvB,6CAA6C;QAC7C,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAExB,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,GA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AAI,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;wGA1EU,iBAAiB;4FAAjB,iBAAiB,wECd9B,oUASC;;4FDKY,iBAAiB;kBAR7B,SAAS;+BAEE,cAAc,cACZ,IAAI,mBAGC,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, computed, signal, ElementRef, inject, Renderer2, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\nimport type { SnackbarData } from './snackbar.model';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-snackbar',\n standalone: true,\n templateUrl: './snackbar.component.html',\n styleUrl: './snackbar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackbarComponent {\n private readonly elementRef = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /* v8 ignore next */\n readonly data = signal<SnackbarData | null>(null);\n /* v8 ignore next */\n readonly visible = signal(false);\n\n private timerId?: ReturnType<typeof setTimeout>;\n\n readonly panelClasses = computed(() => this.data()?.config.panelClass.join(' ') ?? '');\n\n /**\n *\n * @param data\n */\n show(data: SnackbarData): void {\n this.clearTimer();\n this.data.set(data);\n this.applyPosition(data.config);\n this.visible.set(true);\n\n // Marcar para revisión de cambios con OnPush\n this.cdr.markForCheck();\n\n if (data.config.duration > 0) {\n this.timerId = setTimeout(() => this.dismiss(), data.config.duration);\n }\n }\n\n /**\n *\n */\n dismiss(): void {\n this.visible.set(false);\n this.clearTimer();\n\n // Marcar para revisión de cambios con OnPush\n this.cdr.markForCheck();\n }\n\n /**\n *\n */\n private clearTimer(): void {\n if (this.timerId !== undefined) {\n clearTimeout(this.timerId);\n this.timerId = undefined;\n }\n }\n\n /**\n *\n * @param config\n */\n private applyPosition(config: SnackbarData['config']): void {\n const host = this.elementRef.nativeElement;\n const { verticalPosition, horizontalPosition } = config;\n\n const positions = ['top', 'bottom', 'left', 'right', 'transform'];\n for (const pos of positions) {\n this.renderer.removeStyle(host, pos);\n }\n\n this.renderer.setStyle(host, verticalPosition, '1rem');\n\n if (horizontalPosition === 'center') {\n this.renderer.setStyle(host, 'left', '50%');\n this.renderer.setStyle(host, 'transform', 'translateX(-50%)');\n } else {\n this.renderer.setStyle(host, horizontalPosition, '1rem');\n }\n }\n}\n","@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}"]}
1
+ {"version":3,"file":"snackbar.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.component.ts","../../../../../libs/ui/src/lib/snackbar/snackbar.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;;AAGvI;;GAEG;AASH,MAAM,OAAO,iBAAiB;IACX,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC7B,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAEjD,oBAAoB;IACX,IAAI,GAAG,MAAM,CAAsB,IAAI,gDAAC,CAAC;IAClD,oBAAoB;IACX,OAAO,GAAG,MAAM,CAAC,KAAK,mDAAC,CAAC;IAEzB,OAAO,CAAiC;IAEvC,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI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C,CAAC;QAClE,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;QAEvD,IAAI,kBAAkB,KAAK,QAAQ,EAAE,CAAC;YACpC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;wGA1EU,iBAAiB;4FAAjB,iBAAiB,wECd9B,oUASC;;4FDKY,iBAAiB;kBAR7B,SAAS;+BAEE,cAAc,cACZ,IAAI,mBAGC,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, computed, signal, ElementRef, inject, Renderer2, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\nimport type { SnackbarData } from './snackbar.types';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-snackbar',\n standalone: true,\n templateUrl: './snackbar.component.html',\n styleUrl: './snackbar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackbarComponent {\n private readonly elementRef = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /* v8 ignore next */\n readonly data = signal<SnackbarData | null>(null);\n /* v8 ignore next */\n readonly visible = signal(false);\n\n private timerId?: ReturnType<typeof setTimeout>;\n\n readonly panelClasses = computed(() => this.data()?.config.panelClass.join(' ') ?? '');\n\n /**\n *\n * @param data\n */\n show(data: SnackbarData): void {\n this.clearTimer();\n this.data.set(data);\n this.applyPosition(data.config);\n this.visible.set(true);\n\n // Marcar para revisión de cambios con OnPush\n this.cdr.markForCheck();\n\n if (data.config.duration > 0) {\n this.timerId = setTimeout(() => this.dismiss(), data.config.duration);\n }\n }\n\n /**\n *\n */\n dismiss(): void {\n this.visible.set(false);\n this.clearTimer();\n\n // Marcar para revisión de cambios con OnPush\n this.cdr.markForCheck();\n }\n\n /**\n *\n */\n private clearTimer(): void {\n if (this.timerId !== undefined) {\n clearTimeout(this.timerId);\n this.timerId = undefined;\n }\n }\n\n /**\n *\n * @param config\n */\n private applyPosition(config: SnackbarData['config']): void {\n const host = this.elementRef.nativeElement;\n const { verticalPosition, horizontalPosition } = config;\n\n const positions = ['top', 'bottom', 'left', 'right', 'transform'];\n for (const pos of positions) {\n this.renderer.removeStyle(host, pos);\n }\n\n this.renderer.setStyle(host, verticalPosition, '1rem');\n\n if (horizontalPosition === 'center') {\n this.renderer.setStyle(host, 'left', '50%');\n this.renderer.setStyle(host, 'transform', 'translateX(-50%)');\n } else {\n this.renderer.setStyle(host, horizontalPosition, '1rem');\n }\n }\n}\n","@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"snackbar.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;AAGzD;;GAEG;AAIH,MAAM,OAAO,eAAe;IACT,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAChC,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAChD,YAAY,CAAmC;IAEtC,aAAa,GAA6B;QACzD,QAAQ,EAAE,IAAI;QACd,kBAAkB,EAAE,OAAO;QAC3B,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,EAAE;KACf,CAAC;IAEF;;;;;OAKG;IACH,IAAI,CAAC,OAAe,EAAE,MAAe,EAAE,MAAuB;QAC5D,MAAM,YAAY,GAA6B;YAC7C,GAAG,IAAI,CAAC,aAAa;YACrB,GAAG,MAAM;YACT,UAAU,EAAE,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU;SAChE,CAAC;QAEF,MAAM,IAAI,GAAiB;YACzB,OAAO;YACP,MAAM;YACN,MAAM,EAAE,YAAY;SACrB,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,iBAAiB,EAAE;gBACrD,mBAAmB,EAAE,IAAI,CAAC,QAAQ;aACnC,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;wGAzCU,eAAe;4GAAf,eAAe,cAFd,MAAM;;4FAEP,eAAe;kBAH3B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import {\n type ComponentRef,\n Injectable,\n inject,\n ApplicationRef,\n createComponent,\n EnvironmentInjector\n} from '@angular/core';\nimport { SnackbarComponent } from './snackbar.component';\nimport type { SnackbarConfig, SnackbarData } from './snackbar.model';\n\n/**\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackbarService {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private componentRef?: ComponentRef<SnackbarComponent>;\n\n private readonly defaultConfig: Required<SnackbarConfig> = {\n duration: 2000,\n horizontalPosition: 'right',\n verticalPosition: 'top',\n panelClass: [],\n };\n\n /**\n *\n * @param message\n * @param action\n * @param config\n */\n open(message: string, action?: string, config?: SnackbarConfig): void {\n const mergedConfig: Required<SnackbarConfig> = {\n ...this.defaultConfig,\n ...config,\n panelClass: config?.panelClass ?? this.defaultConfig.panelClass,\n };\n\n const data: SnackbarData = {\n message,\n action,\n config: mergedConfig,\n };\n\n if (!this.componentRef) {\n this.componentRef = createComponent(SnackbarComponent, {\n environmentInjector: this.injector,\n });\n\n this.appRef.attachView(this.componentRef.hostView);\n document.body.appendChild(this.componentRef.location.nativeElement);\n }\n\n this.componentRef.instance.show(data);\n }\n}\n"]}
1
+ {"version":3,"file":"snackbar.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;AAGzD;;GAEG;AAIH,MAAM,OAAO,eAAe;IACT,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAChC,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAChD,YAAY,CAAmC;IAEtC,aAAa,GAA6B;QACzD,QAAQ,EAAE,IAAI;QACd,kBAAkB,EAAE,OAAO;QAC3B,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,EAAE;KACf,CAAC;IAEF;;;;;OAKG;IACH,IAAI,CAAC,OAAe,EAAE,MAAe,EAAE,MAAuB;QAC5D,MAAM,YAAY,GAA6B;YAC7C,GAAG,IAAI,CAAC,aAAa;YACrB,GAAG,MAAM;YACT,UAAU,EAAE,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU;SAChE,CAAC;QAEF,MAAM,IAAI,GAAiB;YACzB,OAAO;YACP,MAAM;YACN,MAAM,EAAE,YAAY;SACrB,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,iBAAiB,EAAE;gBACrD,mBAAmB,EAAE,IAAI,CAAC,QAAQ;aACnC,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;wGAzCU,eAAe;4GAAf,eAAe,cAFd,MAAM;;4FAEP,eAAe;kBAH3B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import {\n type ComponentRef,\n Injectable,\n inject,\n ApplicationRef,\n createComponent,\n EnvironmentInjector\n} from '@angular/core';\nimport { SnackbarComponent } from './snackbar.component';\nimport type { SnackbarConfig, SnackbarData } from './snackbar.types';\n\n/**\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackbarService {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private componentRef?: ComponentRef<SnackbarComponent>;\n\n private readonly defaultConfig: Required<SnackbarConfig> = {\n duration: 2000,\n horizontalPosition: 'right',\n verticalPosition: 'top',\n panelClass: [],\n };\n\n /**\n *\n * @param message\n * @param action\n * @param config\n */\n open(message: string, action?: string, config?: SnackbarConfig): void {\n const mergedConfig: Required<SnackbarConfig> = {\n ...this.defaultConfig,\n ...config,\n panelClass: config?.panelClass ?? this.defaultConfig.panelClass,\n };\n\n const data: SnackbarData = {\n message,\n action,\n config: mergedConfig,\n };\n\n if (!this.componentRef) {\n this.componentRef = createComponent(SnackbarComponent, {\n environmentInjector: this.injector,\n });\n\n this.appRef.attachView(this.componentRef.hostView);\n document.body.appendChild(this.componentRef.location.nativeElement);\n }\n\n this.componentRef.instance.show(data);\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=snackbar.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snackbar.model.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.model.ts"],"names":[],"mappings":"","sourcesContent":["export interface SnackbarConfig {\n duration?: number;\n horizontalPosition?: 'left' | 'center' | 'right';\n verticalPosition?: 'top' | 'bottom';\n panelClass?: string[];\n}\n\nexport interface SnackbarData {\n message: string;\n action?: string;\n config: Required<SnackbarConfig>;\n}\n"]}
1
+ {"version":3,"file":"snackbar.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SnackbarConfig {\n duration?: number;\n horizontalPosition?: 'left' | 'center' | 'right';\n verticalPosition?: 'top' | 'bottom';\n panelClass?: string[];\n}\n\nexport interface SnackbarData {\n message: string;\n action?: string;\n config: Required<SnackbarConfig>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './stat-card.component';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './stat-card.component';\nexport type { CardDef } from './stat-card.types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stat-card.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/stat-card.component.ts","../../../../../libs/ui/src/lib/stat-card/stat-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;;AAUxC;;GAEG;AAUH,MAAM,OAAO,iBAAiB;IAC5B,oBAAoB;IACX,KAAK,GAAG,KAAK,CAAY,EAAE,iDAAC,CAAC;wGAF3B,iBAAiB;4FAAjB,iBAAiB,6MCvB9B,+lBAeM,6zBDGM,aAAa;;4FAKZ,iBAAiB;kBAT7B,SAAS;+BAEE,eAAe,cACb,IAAI,WACP,CAAC,aAAa,CAAC,mBAGP,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, input, ChangeDetectionStrategy } from '@angular/core';\nimport { IconComponent } from '../icon';\nimport type { IconType } from '../icon/icon.types';\n\nexport interface CardDef {\n color: string; // Acepta cualquier color CSS\n icon: IconType;\n text: string;\n count: number;\n}\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-stat-card',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stat-card.component.html',\n styleUrls: ['./stat-card.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class StatCardComponent {\n /* v8 ignore next */\n readonly cards = input<CardDef[]>([]);\n}\n","<div class=\"stats-section py-4\">\n @for (card of cards(); track card.text) {\n <!-- eslint-disable-next-line @angular-eslint/template/no-inline-styles -->\n <div class=\"stat-card\" [style.border-left-color]=\"card.color\">\n <div class=\"stat-card-content\">\n <div class=\"stat-content\">\n <c80-icon [icon]=\"card.icon\" [color]=\"'secondary'\" [size]=\"1.1\" />\n <div class=\"stat-info\">\n <div class=\"stat-number\">{{ card.count }}</div>\n <div class=\"stat-label\">{{ card.text }}</div>\n </div>\n </div>\n </div>\n </div>\n }\n</div>"]}
1
+ {"version":3,"file":"stat-card.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/stat-card.component.ts","../../../../../libs/ui/src/lib/stat-card/stat-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;;AAGxC;;GAEG;AAUH,MAAM,OAAO,iBAAiB;IAC5B,oBAAoB;IACX,KAAK,GAAG,KAAK,CAAY,EAAE,iDAAC,CAAC;wGAF3B,iBAAiB;4FAAjB,iBAAiB,6MChB9B,+lBAeM,6zBDJM,aAAa;;4FAKZ,iBAAiB;kBAT7B,SAAS;+BAEE,eAAe,cACb,IAAI,WACP,CAAC,aAAa,CAAC,mBAGP,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, input, ChangeDetectionStrategy } from '@angular/core';\nimport { IconComponent } from '../icon';\nimport type { CardDef } from './stat-card.types';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-stat-card',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stat-card.component.html',\n styleUrls: ['./stat-card.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class StatCardComponent {\n /* v8 ignore next */\n readonly cards = input<CardDef[]>([]);\n}\n","<div class=\"stats-section py-4\">\n @for (card of cards(); track card.text) {\n <!-- eslint-disable-next-line @angular-eslint/template/no-inline-styles -->\n <div class=\"stat-card\" [style.border-left-color]=\"card.color\">\n <div class=\"stat-card-content\">\n <div class=\"stat-content\">\n <c80-icon [icon]=\"card.icon\" [color]=\"'secondary'\" [size]=\"1.1\" />\n <div class=\"stat-info\">\n <div class=\"stat-number\">{{ card.count }}</div>\n <div class=\"stat-label\">{{ card.text }}</div>\n </div>\n </div>\n </div>\n </div>\n }\n</div>"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stat-card.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat-card.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/stat-card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { IconType } from '../icon/icon.types';\n\nexport interface CardDef {\n color: string; // Acepta cualquier color CSS\n icon: IconType;\n text: string;\n count: number;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=c80-tab.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c80-tab.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/c80-tab.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface C80Tab {\n readonly label: string;\n readonly icon?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export { TabComponent } from './c80-tab.component';\nexport { C80TabItemDirective } from './directives/c80-tab-item.directive';\nexport { C80TabLabelDirective } from './directives/c80-tab-label.directive';\nexport type { C80Tab } from './c80-tab.model';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export { TabComponent } from './c80-tab.component';\nexport { C80TabItemDirective } from './directives/c80-tab-item.directive';\nexport { C80TabLabelDirective } from './directives/c80-tab-label.directive';\nexport type { C80Tab } from './c80-tab.types';\n"]}
@@ -6,4 +6,6 @@ export * from './table-column-visibility.service';
6
6
  export * from './table-data-utils.service';
7
7
  export * from './table-selection.service';
8
8
  export * from './table-crud-state.service';
9
+ export * from './table-dto-mapper.service';
10
+ export * from './table-pagination.service';
9
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './table.types';\nexport * from './table.component';\nexport * from './table.utils';\nexport * from './table-data-converter.service';\nexport * from './table-column-visibility.service';\nexport * from './table-data-utils.service';\nexport * from './table-selection.service';\nexport * from './table-crud-state.service';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './table.types';\nexport * from './table.component';\nexport * from './table.utils';\nexport * from './table-data-converter.service';\nexport * from './table-column-visibility.service';\nexport * from './table-data-utils.service';\nexport * from './table-selection.service';\nexport * from './table-crud-state.service';\nexport * from './table-dto-mapper.service';\nexport * from './table-pagination.service';\n"]}
@@ -29,9 +29,7 @@ export class TableDataUtilsService {
29
29
  * @returns El valor anidado o undefined
30
30
  */
31
31
  getNestedValue(obj, accessor) {
32
- return accessor.split('.').reduce((current, key) => {
33
- return current && typeof current === 'object' ? current[key] : undefined;
34
- }, obj);
32
+ return accessor.split('.').reduce((current, key) => current && typeof current === 'object' ? current[key] : undefined, obj);
35
33
  }
36
34
  /**
37
35
  * Devuelve el valor de display para una celda, mostrando '-' para valores falsy excepto 0, false y objetos/arrays vacíos
@@ -1 +1 @@
1
- {"version":3,"file":"table-data-utils.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/table-data-utils.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAG3C;;;;;;;;GAQG;AAIH,MAAM,OAAO,qBAAqB;IAEhC;;;;;OAKG;IACH,YAAY,CAAoC,GAAM,EAAE,QAAgB;QACtE,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC5C,CAAC;QACD,OAAQ,GAA+B,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAED;;;;;OAKG;IACH,cAAc,CAAC,GAA4B,EAAE,QAAgB;QAC3D,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;YACjD,OAAO,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAE,OAAmC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxG,CAAC,EAAE,GAAc,CAAC,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,KAAc,EAAE,GAAiB;QAC/C,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1D,OAAO,GAAG,EAAE,QAAQ,CAAC,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BAAqB,cAFpB,MAAM;;4FAEP,qBAAqB;kBAHjC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport type { TableColDef } from './table.types';\n\n/**\n * Servicio para utilidades de manipulación de datos en tablas C80\n *\n * Proporciona métodos para:\n * - Acceso a valores de celdas (incluyendo propiedades anidadas)\n * - Formateo de valores para display\n * - Gestión de enums y colores\n * - Ordenamiento de datos\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TableDataUtilsService {\n\n /**\n * Obtiene el valor de una celda usando el accessor, soportando notación de punto para propiedades anidadas\n * @param row - La fila de datos\n * @param accessor - El accessor de la columna\n * @returns El valor de la celda\n */\n getCellValue<T extends Record<string, unknown>>(row: T, accessor: string): unknown {\n if (accessor.includes('.')) {\n return this.getNestedValue(row, accessor);\n }\n return (row as Record<string, unknown>)[accessor];\n }\n\n /**\n * Obtiene el valor de un objeto usando notación de punto (ej: 'task.name')\n * @param obj - Objeto del cual obtener el valor\n * @param accessor - Ruta de acceso usando notación de punto\n * @returns El valor anidado o undefined\n */\n getNestedValue(obj: Record<string, unknown>, accessor: string): unknown {\n return accessor.split('.').reduce((current, key) => {\n return current && typeof current === 'object' ? (current as Record<string, unknown>)[key] : undefined;\n }, obj as unknown);\n }\n\n /**\n * Devuelve el valor de display para una celda, mostrando '-' para valores falsy excepto 0, false y objetos/arrays vacíos\n * @param value - Valor a formatear\n * @param col - Definición de columna (opcional) para formateo específico por tipo\n * @returns Cadena formateada para display\n */\n getDisplayValue(value: unknown, col?: TableColDef): string {\n const formattedValue = this.formatValueByType(value, col);\n return col?.truncate ? this.truncateText(formattedValue, col.truncate) : formattedValue;\n }\n\n /**\n * Trunca un texto a N caracteres y agrega '...' si es necesario\n * @param value - Texto a truncar\n * @param maxLength - Longitud máxima\n * @returns Texto truncado\n */\n private truncateText(value: string, maxLength: number): string {\n if (!value || typeof value !== 'string') {\n return value;\n }\n\n if (value.length <= maxLength) {\n return value;\n }\n\n return `${value.substring(0, maxLength)}...`;\n }\n\n private formatValueByType(value: unknown, col?: TableColDef): string {\n if (value === 0) return '0';\n if (value === false) return 'false';\n if (col?.type === 'date' && value) return this.formatDateValue(value);\n if (typeof value === 'object' && value !== null) return this.formatObjectValue(value);\n if (!value) return '-';\n return this.formatPrimitiveValue(value);\n }\n\n private formatPrimitiveValue(value: unknown): string {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n return '-';\n }\n\n /**\n * Formatea un valor de fecha a formato legible\n * @param value - Valor de fecha (Date, string ISO, timestamp)\n * @returns Fecha formateada como DD/MM/YYYY HH:MM\n */\n private formatDateValue(value: unknown): string {\n try {\n const date = this.parseDate(value);\n if (!date || Number.isNaN(date.getTime())) return '-';\n\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${day}/${month}/${year} ${hours}:${minutes}`;\n } catch {\n return '-';\n }\n }\n\n private parseDate(value: unknown): Date | null {\n if (value instanceof Date) return value;\n if (typeof value === 'string' || typeof value === 'number') return new Date(value);\n return null;\n }\n\n private formatObjectValue(value: unknown): string {\n try {\n return JSON.stringify(value);\n } catch {\n return '[object Object]';\n }\n } /**\n * Obtiene el texto de display para un valor enum\n * @param value - Valor del enum\n * @param col - Definición de la columna\n * @returns Texto formateado del enum\n */\n getEnumDisplayValue(value: unknown, col: TableColDef): string {\n if (!col.enum || (value !== 0 && !value)) {\n return '-';\n }\n const displayValue = col.enum[value as string | number];\n return (\n displayValue ||\n (typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '-')\n );\n }\n\n /**\n * Obtiene las opciones del enum como array para dropdowns select\n * @param col - Definición de la columna\n * @returns Array de opciones con value y label\n */\n getEnumOptions(col: TableColDef): { value: string | number; label: string }[] {\n if (!col.enum) return [];\n return Object.entries(col.enum).map(([value, label]) => ({\n value: Number.isNaN(Number(value)) ? value : Number(value),\n label,\n }));\n }\n\n /**\n * Obtiene el color CSS para un valor de celda basado en la configuración de color de la columna\n * @param value - Valor de la celda\n * @param col - Definición de la columna\n * @returns Color CSS o undefined si no hay configuración\n */\n getCellColor(value: unknown, col: TableColDef): string | undefined {\n if (!col.color || (value !== 0 && !value)) {\n return undefined;\n }\n return col.color[value as string | number];\n }\n\n /**\n * Aplica ordenamiento a los items basándose en las columnas con configuración de orden\n * @param items - Array de items a ordenar (se modifica in-place)\n * @param columns - Definiciones de columnas\n */\n applySorting<T extends Record<string, unknown>>(items: T[], columns: TableColDef[]): void {\n const orderedColumns = columns.filter((col) => col.order);\n if (orderedColumns.length > 0) {\n for (const col of orderedColumns) {\n items.sort((a, b) => {\n const valueA = this.getCellValue(a, col.accessor) as string | number;\n const valueB = this.getCellValue(b, col.accessor) as string | number;\n\n if (col.order === 'ASC') {\n if (valueA > valueB) return 1;\n if (valueA < valueB) return -1;\n return 0;\n } else {\n if (valueA < valueB) return 1;\n if (valueA > valueB) return -1;\n return 0;\n }\n });\n }\n }\n }\n\n /**\n * Calcula el max-height de la tabla basado en el tamaño\n * @param size - Tamaño configurado (0 = sin límite)\n * @returns String CSS para max-height o undefined si sin límite\n */\n getTableMaxHeight(size: number): string | undefined {\n if (size <= 0) {\n return undefined; // Sin límite de altura\n }\n // Altura base de 400px * size\n const baseHeight = 400;\n const maxHeight = Math.round(baseHeight * size);\n return `${maxHeight}px`;\n }\n}\n"]}
1
+ {"version":3,"file":"table-data-utils.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/table-data-utils.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAG3C;;;;;;;;GAQG;AAIH,MAAM,OAAO,qBAAqB;IAEhC;;;;;OAKG;IACH,YAAY,CAAoC,GAAM,EAAE,QAAgB;QACtE,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAA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E,OAAO,CAAC,CAAC,CAAC;wBAC/B,OAAO,CAAC,CAAC;oBACX,CAAC;yBAAM,CAAC;wBACN,IAAI,MAAM,GAAG,MAAM;4BAAE,OAAO,CAAC,CAAC;wBAC9B,IAAI,MAAM,GAAG,MAAM;4BAAE,OAAO,CAAC,CAAC,CAAC;wBAC/B,OAAO,CAAC,CAAC;oBACX,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,IAAY;QAC5B,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACd,OAAO,SAAS,CAAC,CAAC,uBAAuB;QAC3C,CAAC;QACD,8BAA8B;QAC9B,MAAM,UAAU,GAAG,GAAG,CAAC;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;QAChD,OAAO,GAAG,SAAS,IAAI,CAAC;IAC1B,CAAC;wGA7LU,qBAAqB;4GAArB,qBAAqB,cAFpB,MAAM;;4FAEP,qBAAqB;kBAHjC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport type { TableColDef } from './table.types';\n\n/**\n * Servicio para utilidades de manipulación de datos en tablas C80\n *\n * Proporciona métodos para:\n * - Acceso a valores de celdas (incluyendo propiedades anidadas)\n * - Formateo de valores para display\n * - Gestión de enums y colores\n * - Ordenamiento de datos\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TableDataUtilsService {\n\n /**\n * Obtiene el valor de una celda usando el accessor, soportando notación de punto para propiedades anidadas\n * @param row - La fila de datos\n * @param accessor - El accessor de la columna\n * @returns El valor de la celda\n */\n getCellValue<T extends Record<string, unknown>>(row: T, accessor: string): unknown {\n if (accessor.includes('.')) {\n return this.getNestedValue(row, accessor);\n }\n return (row as Record<string, unknown>)[accessor];\n }\n\n /**\n * Obtiene el valor de un objeto usando notación de punto (ej: 'task.name')\n * @param obj - Objeto del cual obtener el valor\n * @param accessor - Ruta de acceso usando notación de punto\n * @returns El valor anidado o undefined\n */\n getNestedValue(obj: Record<string, unknown>, accessor: string): unknown {\n return accessor.split('.').reduce((current, key) => current && typeof current === 'object' ? (current as Record<string, unknown>)[key] : undefined, obj as unknown);\n }\n\n /**\n * Devuelve el valor de display para una celda, mostrando '-' para valores falsy excepto 0, false y objetos/arrays vacíos\n * @param value - Valor a formatear\n * @param col - Definición de columna (opcional) para formateo específico por tipo\n * @returns Cadena formateada para display\n */\n getDisplayValue(value: unknown, col?: TableColDef): string {\n const formattedValue = this.formatValueByType(value, col);\n return col?.truncate ? this.truncateText(formattedValue, col.truncate) : formattedValue;\n }\n\n /**\n * Trunca un texto a N caracteres y agrega '...' si es necesario\n * @param value - Texto a truncar\n * @param maxLength - Longitud máxima\n * @returns Texto truncado\n */\n private truncateText(value: string, maxLength: number): string {\n if (!value || typeof value !== 'string') {\n return value;\n }\n\n if (value.length <= maxLength) {\n return value;\n }\n\n return `${value.substring(0, maxLength)}...`;\n }\n\n private formatValueByType(value: unknown, col?: TableColDef): string {\n if (value === 0) return '0';\n if (value === false) return 'false';\n if (col?.type === 'date' && value) return this.formatDateValue(value);\n if (typeof value === 'object' && value !== null) return this.formatObjectValue(value);\n if (!value) return '-';\n return this.formatPrimitiveValue(value);\n }\n\n private formatPrimitiveValue(value: unknown): string {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n return '-';\n }\n\n /**\n * Formatea un valor de fecha a formato legible\n * @param value - Valor de fecha (Date, string ISO, timestamp)\n * @returns Fecha formateada como DD/MM/YYYY HH:MM\n */\n private formatDateValue(value: unknown): string {\n try {\n const date = this.parseDate(value);\n if (!date || Number.isNaN(date.getTime())) return '-';\n\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n\n return `${day}/${month}/${year} ${hours}:${minutes}`;\n } catch {\n return '-';\n }\n }\n\n private parseDate(value: unknown): Date | null {\n if (value instanceof Date) return value;\n if (typeof value === 'string' || typeof value === 'number') return new Date(value);\n return null;\n }\n\n private formatObjectValue(value: unknown): string {\n try {\n return JSON.stringify(value);\n } catch {\n return '[object Object]';\n }\n } /**\n * Obtiene el texto de display para un valor enum\n * @param value - Valor del enum\n * @param col - Definición de la columna\n * @returns Texto formateado del enum\n */\n getEnumDisplayValue(value: unknown, col: TableColDef): string {\n if (!col.enum || (value !== 0 && !value)) {\n return '-';\n }\n const displayValue = col.enum[value as string | number];\n return (\n displayValue ||\n (typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '-')\n );\n }\n\n /**\n * Obtiene las opciones del enum como array para dropdowns select\n * @param col - Definición de la columna\n * @returns Array de opciones con value y label\n */\n getEnumOptions(col: TableColDef): { value: string | number; label: string }[] {\n if (!col.enum) return [];\n return Object.entries(col.enum).map(([value, label]) => ({\n value: Number.isNaN(Number(value)) ? value : Number(value),\n label,\n }));\n }\n\n /**\n * Obtiene el color CSS para un valor de celda basado en la configuración de color de la columna\n * @param value - Valor de la celda\n * @param col - Definición de la columna\n * @returns Color CSS o undefined si no hay configuración\n */\n getCellColor(value: unknown, col: TableColDef): string | undefined {\n if (!col.color || (value !== 0 && !value)) {\n return undefined;\n }\n return col.color[value as string | number];\n }\n\n /**\n * Aplica ordenamiento a los items basándose en las columnas con configuración de orden\n * @param items - Array de items a ordenar (se modifica in-place)\n * @param columns - Definiciones de columnas\n */\n applySorting<T extends Record<string, unknown>>(items: T[], columns: TableColDef[]): void {\n const orderedColumns = columns.filter((col) => col.order);\n if (orderedColumns.length > 0) {\n for (const col of orderedColumns) {\n items.sort((a, b) => {\n const valueA = this.getCellValue(a, col.accessor) as string | number;\n const valueB = this.getCellValue(b, col.accessor) as string | number;\n\n if (col.order === 'ASC') {\n if (valueA > valueB) return 1;\n if (valueA < valueB) return -1;\n return 0;\n } else {\n if (valueA < valueB) return 1;\n if (valueA > valueB) return -1;\n return 0;\n }\n });\n }\n }\n }\n\n /**\n * Calcula el max-height de la tabla basado en el tamaño\n * @param size - Tamaño configurado (0 = sin límite)\n * @returns String CSS para max-height o undefined si sin límite\n */\n getTableMaxHeight(size: number): string | undefined {\n if (size <= 0) {\n return undefined; // Sin límite de altura\n }\n // Altura base de 400px * size\n const baseHeight = 400;\n const maxHeight = Math.round(baseHeight * size);\n return `${maxHeight}px`;\n }\n}\n"]}
@@ -0,0 +1,98 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Servicio para mapear automáticamente datos de tabla a DTOs
5
+ * basándose en la configuración de TableColDef.
6
+ *
7
+ * Reglas de exclusión:
8
+ * - readOnly: true → campo NO se incluye
9
+ * - accessor: 'id' → campo NO se incluye (IDs van en URL, no en body)
10
+ * - readOnly: false o undefined → campo se incluye
11
+ */
12
+ export class TableDtoMapperService {
13
+ /**
14
+ * Mapea un objeto de fila a DTO, excluyendo campos readOnly e id
15
+ * @param row - Datos de la fila
16
+ * @param columns - Definiciones de columnas
17
+ * @param additionalFields - Campos adicionales a agregar al DTO (ej: boxId)
18
+ * @returns DTO con solo campos editables (sin id)
19
+ */
20
+ mapToDto(row, columns, additionalFields) {
21
+ const dto = {};
22
+ // Mapear solo columnas NO readOnly y NO id
23
+ const editableColumns = columns.filter(col => !col.readOnly && col.accessor !== 'id');
24
+ for (const col of editableColumns) {
25
+ const value = row[col.accessor];
26
+ // Solo incluir si el valor existe
27
+ if (value !== undefined && value !== null && value !== '') {
28
+ dto[col.accessor] = this.convertValue(value, col);
29
+ }
30
+ }
31
+ // Agregar campos adicionales (ej: boxId, profileId)
32
+ if (additionalFields) {
33
+ Object.assign(dto, additionalFields);
34
+ }
35
+ return dto;
36
+ }
37
+ /**
38
+ * Convierte un valor según el tipo de columna
39
+ * @param value - Valor a convertir
40
+ * @param col - Definición de columna
41
+ * @returns Valor convertido
42
+ */
43
+ convertValue(value, col) {
44
+ switch (col.type) {
45
+ case 'integer':
46
+ return this.toInteger(value, col);
47
+ case 'number':
48
+ return this.toNumber(value);
49
+ case 'boolean':
50
+ return this.toBoolean(value);
51
+ case 'string':
52
+ case 'password':
53
+ case 'enum':
54
+ return this.toString(value);
55
+ default:
56
+ return value;
57
+ }
58
+ }
59
+ toInteger(value, col) {
60
+ if (typeof value !== 'number')
61
+ return undefined;
62
+ let result = Math.floor(value);
63
+ // Aplicar min/max si existen
64
+ if (col.min !== undefined)
65
+ result = Math.max(result, col.min);
66
+ if (col.max !== undefined)
67
+ result = Math.min(result, col.max);
68
+ return result;
69
+ }
70
+ toNumber(value) {
71
+ if (typeof value === 'number')
72
+ return value;
73
+ if (typeof value === 'string') {
74
+ const num = Number(value);
75
+ return Number.isNaN(num) ? undefined : num;
76
+ }
77
+ return undefined;
78
+ }
79
+ toBoolean(value) {
80
+ if (typeof value === 'boolean')
81
+ return value;
82
+ if (typeof value === 'string')
83
+ return value.toLowerCase() === 'true';
84
+ return Boolean(value);
85
+ }
86
+ toString(value) {
87
+ return String(value);
88
+ }
89
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: TableDtoMapperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
90
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: TableDtoMapperService, providedIn: 'root' });
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: TableDtoMapperService, decorators: [{
93
+ type: Injectable,
94
+ args: [{
95
+ providedIn: 'root'
96
+ }]
97
+ }] });
98
+ //# sourceMappingURL=table-dto-mapper.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-dto-mapper.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/table-dto-mapper.service.ts"],"names":[],"mappings":"AAAA,O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,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;wGA1FQ,qBAAqB;4GAArB,qBAAqB,cAFlB,MAAM;;4FAET,qBAAqB;kBAHjC,UAAU;mBAAC;oBACR,UAAU,EAAE,MAAM;iBACrB","sourcesContent":["import { Injectable } from '@angular/core';\nimport type { TableColDef } from './table.types';\n\n/**\n * Servicio para mapear automáticamente datos de tabla a DTOs\n * basándose en la configuración de TableColDef.\n * \n * Reglas de exclusión:\n * - readOnly: true → campo NO se incluye\n * - accessor: 'id' → campo NO se incluye (IDs van en URL, no en body)\n * - readOnly: false o undefined → campo se incluye\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TableDtoMapperService {\n\n /**\n * Mapea un objeto de fila a DTO, excluyendo campos readOnly e id\n * @param row - Datos de la fila\n * @param columns - Definiciones de columnas\n * @param additionalFields - Campos adicionales a agregar al DTO (ej: boxId)\n * @returns DTO con solo campos editables (sin id)\n */\n mapToDto(\n row: Record<string, unknown>,\n columns: TableColDef[],\n additionalFields?: Record<string, unknown>\n ): Record<string, unknown> {\n const dto: Record<string, unknown> = {};\n\n // Mapear solo columnas NO readOnly y NO id\n const editableColumns = columns.filter(col =>\n !col.readOnly && col.accessor !== 'id'\n );\n\n for (const col of editableColumns) {\n const value = row[col.accessor];\n\n // Solo incluir si el valor existe\n if (value !== undefined && value !== null && value !== '') {\n dto[col.accessor] = this.convertValue(value, col);\n }\n }\n\n // Agregar campos adicionales (ej: boxId, profileId)\n if (additionalFields) {\n Object.assign(dto, additionalFields);\n }\n\n return dto;\n }\n\n /**\n * Convierte un valor según el tipo de columna\n * @param value - Valor a convertir\n * @param col - Definición de columna\n * @returns Valor convertido\n */\n private convertValue(value: unknown, col: TableColDef): unknown {\n switch (col.type) {\n case 'integer':\n return this.toInteger(value, col);\n case 'number':\n return this.toNumber(value);\n case 'boolean':\n return this.toBoolean(value);\n case 'string':\n case 'password':\n case 'enum':\n return this.toString(value);\n default:\n return value;\n }\n }\n\n private toInteger(value: unknown, col: TableColDef): number | undefined {\n if (typeof value !== 'number') return undefined;\n\n let result = Math.floor(value);\n\n // Aplicar min/max si existen\n if (col.min !== undefined) result = Math.max(result, col.min);\n if (col.max !== undefined) result = Math.min(result, col.max);\n\n return result;\n }\n\n private toNumber(value: unknown): number | undefined {\n if (typeof value === 'number') return value;\n if (typeof value === 'string') {\n const num = Number(value);\n return Number.isNaN(num) ? undefined : num;\n }\n return undefined;\n }\n\n private toBoolean(value: unknown): boolean {\n if (typeof value === 'boolean') return value;\n if (typeof value === 'string') return value.toLowerCase() === 'true';\n return Boolean(value);\n }\n\n private toString(value: unknown): string {\n return String(value);\n }\n}\n"]}