@neural-ui/core 1.7.1 → 1.7.3

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 (129) hide show
  1. package/bottom-sheet/package.json +4 -0
  2. package/confirm-popup/package.json +4 -0
  3. package/data-view/package.json +4 -0
  4. package/fesm2022/neural-ui-core-alert.mjs +48 -21
  5. package/fesm2022/neural-ui-core-alert.mjs.map +1 -1
  6. package/fesm2022/neural-ui-core-autocomplete.mjs +153 -71
  7. package/fesm2022/neural-ui-core-autocomplete.mjs.map +1 -1
  8. package/fesm2022/neural-ui-core-block-ui.mjs +2 -2
  9. package/fesm2022/neural-ui-core-block-ui.mjs.map +1 -1
  10. package/fesm2022/neural-ui-core-bottom-sheet.mjs +121 -0
  11. package/fesm2022/neural-ui-core-bottom-sheet.mjs.map +1 -0
  12. package/fesm2022/neural-ui-core-breadcrumb.mjs +2 -2
  13. package/fesm2022/neural-ui-core-breadcrumb.mjs.map +1 -1
  14. package/fesm2022/neural-ui-core-button.mjs +2 -2
  15. package/fesm2022/neural-ui-core-button.mjs.map +1 -1
  16. package/fesm2022/neural-ui-core-calendar.mjs +2 -2
  17. package/fesm2022/neural-ui-core-calendar.mjs.map +1 -1
  18. package/fesm2022/neural-ui-core-checkbox.mjs +69 -39
  19. package/fesm2022/neural-ui-core-checkbox.mjs.map +1 -1
  20. package/fesm2022/neural-ui-core-chip.mjs +2 -2
  21. package/fesm2022/neural-ui-core-chip.mjs.map +1 -1
  22. package/fesm2022/neural-ui-core-code-block.mjs +2 -2
  23. package/fesm2022/neural-ui-core-code-block.mjs.map +1 -1
  24. package/fesm2022/neural-ui-core-confirm-popup.mjs +105 -0
  25. package/fesm2022/neural-ui-core-confirm-popup.mjs.map +1 -0
  26. package/fesm2022/neural-ui-core-dashboard-grid.mjs +9 -3
  27. package/fesm2022/neural-ui-core-dashboard-grid.mjs.map +1 -1
  28. package/fesm2022/neural-ui-core-data-view.mjs +386 -0
  29. package/fesm2022/neural-ui-core-data-view.mjs.map +1 -0
  30. package/fesm2022/neural-ui-core-date-input.mjs +185 -10
  31. package/fesm2022/neural-ui-core-date-input.mjs.map +1 -1
  32. package/fesm2022/neural-ui-core-empty-state.mjs +19 -5
  33. package/fesm2022/neural-ui-core-empty-state.mjs.map +1 -1
  34. package/fesm2022/neural-ui-core-form-field.mjs +81 -0
  35. package/fesm2022/neural-ui-core-form-field.mjs.map +1 -0
  36. package/fesm2022/neural-ui-core-inline-editor.mjs +428 -0
  37. package/fesm2022/neural-ui-core-inline-editor.mjs.map +1 -0
  38. package/fesm2022/neural-ui-core-input-mask.mjs +110 -0
  39. package/fesm2022/neural-ui-core-input-mask.mjs.map +1 -0
  40. package/fesm2022/neural-ui-core-input.mjs +2 -2
  41. package/fesm2022/neural-ui-core-input.mjs.map +1 -1
  42. package/fesm2022/neural-ui-core-listbox.mjs +219 -0
  43. package/fesm2022/neural-ui-core-listbox.mjs.map +1 -0
  44. package/fesm2022/neural-ui-core-menu.mjs +229 -0
  45. package/fesm2022/neural-ui-core-menu.mjs.map +1 -0
  46. package/fesm2022/neural-ui-core-modal.mjs +34 -10
  47. package/fesm2022/neural-ui-core-modal.mjs.map +1 -1
  48. package/fesm2022/neural-ui-core-multiselect.mjs +170 -179
  49. package/fesm2022/neural-ui-core-multiselect.mjs.map +1 -1
  50. package/fesm2022/neural-ui-core-number-input.mjs +2 -2
  51. package/fesm2022/neural-ui-core-number-input.mjs.map +1 -1
  52. package/fesm2022/neural-ui-core-panel.mjs +92 -0
  53. package/fesm2022/neural-ui-core-panel.mjs.map +1 -0
  54. package/fesm2022/neural-ui-core-password.mjs +106 -0
  55. package/fesm2022/neural-ui-core-password.mjs.map +1 -0
  56. package/fesm2022/neural-ui-core-pick-list.mjs +133 -0
  57. package/fesm2022/neural-ui-core-pick-list.mjs.map +1 -0
  58. package/fesm2022/neural-ui-core-select.mjs +128 -166
  59. package/fesm2022/neural-ui-core-select.mjs.map +1 -1
  60. package/fesm2022/neural-ui-core-sidebar.mjs +14 -3
  61. package/fesm2022/neural-ui-core-sidebar.mjs.map +1 -1
  62. package/fesm2022/neural-ui-core-slider.mjs +2 -2
  63. package/fesm2022/neural-ui-core-slider.mjs.map +1 -1
  64. package/fesm2022/neural-ui-core-spinner.mjs +19 -9
  65. package/fesm2022/neural-ui-core-spinner.mjs.map +1 -1
  66. package/fesm2022/neural-ui-core-split-button.mjs +2 -2
  67. package/fesm2022/neural-ui-core-split-button.mjs.map +1 -1
  68. package/fesm2022/neural-ui-core-table.mjs +503 -62
  69. package/fesm2022/neural-ui-core-table.mjs.map +1 -1
  70. package/fesm2022/neural-ui-core-tabs.mjs +11 -4
  71. package/fesm2022/neural-ui-core-tabs.mjs.map +1 -1
  72. package/fesm2022/neural-ui-core-tags.mjs +134 -0
  73. package/fesm2022/neural-ui-core-tags.mjs.map +1 -0
  74. package/fesm2022/neural-ui-core-textarea.mjs +2 -2
  75. package/fesm2022/neural-ui-core-textarea.mjs.map +1 -1
  76. package/fesm2022/neural-ui-core-toggle-button-group.mjs +2 -2
  77. package/fesm2022/neural-ui-core-toggle-button-group.mjs.map +1 -1
  78. package/fesm2022/neural-ui-core-toolbar.mjs +16 -4
  79. package/fesm2022/neural-ui-core-toolbar.mjs.map +1 -1
  80. package/fesm2022/neural-ui-core-tree-select.mjs +259 -0
  81. package/fesm2022/neural-ui-core-tree-select.mjs.map +1 -0
  82. package/fesm2022/neural-ui-core-tree-table.mjs +267 -8
  83. package/fesm2022/neural-ui-core-tree-table.mjs.map +1 -1
  84. package/fesm2022/neural-ui-core-tree.mjs +15 -14
  85. package/fesm2022/neural-ui-core-tree.mjs.map +1 -1
  86. package/fesm2022/neural-ui-core-uploader.mjs +103 -12
  87. package/fesm2022/neural-ui-core-uploader.mjs.map +1 -1
  88. package/form-field/package.json +4 -0
  89. package/inline-editor/package.json +4 -0
  90. package/input-mask/package.json +4 -0
  91. package/listbox/package.json +4 -0
  92. package/menu/package.json +4 -0
  93. package/package.json +53 -1
  94. package/panel/package.json +4 -0
  95. package/password/package.json +4 -0
  96. package/pick-list/package.json +4 -0
  97. package/styles/_tokens.scss +33 -17
  98. package/tags/package.json +4 -0
  99. package/tree-select/package.json +4 -0
  100. package/types/neural-ui-core-alert.d.ts +2 -1
  101. package/types/neural-ui-core-autocomplete.d.ts +22 -2
  102. package/types/neural-ui-core-bottom-sheet.d.ts +20 -0
  103. package/types/neural-ui-core-checkbox.d.ts +6 -1
  104. package/types/neural-ui-core-confirm-popup.d.ts +38 -0
  105. package/types/neural-ui-core-dashboard-grid.d.ts +1 -0
  106. package/types/neural-ui-core-data-view.d.ts +95 -0
  107. package/types/neural-ui-core-date-input.d.ts +35 -5
  108. package/types/neural-ui-core-empty-state.d.ts +11 -1
  109. package/types/neural-ui-core-form-field.d.ts +33 -0
  110. package/types/neural-ui-core-inline-editor.d.ts +66 -0
  111. package/types/neural-ui-core-input-mask.d.ts +26 -0
  112. package/types/neural-ui-core-listbox.d.ts +54 -0
  113. package/types/neural-ui-core-menu.d.ts +49 -0
  114. package/types/neural-ui-core-modal.d.ts +10 -2
  115. package/types/neural-ui-core-multiselect.d.ts +10 -1
  116. package/types/neural-ui-core-panel.d.ts +25 -0
  117. package/types/neural-ui-core-password.d.ts +29 -0
  118. package/types/neural-ui-core-pick-list.d.ts +40 -0
  119. package/types/neural-ui-core-select.d.ts +7 -1
  120. package/types/neural-ui-core-sidebar.d.ts +5 -1
  121. package/types/neural-ui-core-spinner.d.ts +4 -2
  122. package/types/neural-ui-core-table.d.ts +89 -5
  123. package/types/neural-ui-core-tabs.d.ts +2 -0
  124. package/types/neural-ui-core-tags.d.ts +32 -0
  125. package/types/neural-ui-core-toolbar.d.ts +8 -2
  126. package/types/neural-ui-core-tree-select.d.ts +57 -0
  127. package/types/neural-ui-core-tree-table.d.ts +111 -4
  128. package/types/neural-ui-core-tree.d.ts +1 -1
  129. package/types/neural-ui-core-uploader.d.ts +26 -3
@@ -186,7 +186,7 @@ class NeuCodeBlockComponent {
186
186
  tabindex="0"
187
187
  ><code class="neu-code-block__code">{{ code() }}</code></pre>
188
188
  </div>
189
- `, isInline: true, styles: [".neu-code-block{border-radius:var(--neu-radius-lg);overflow:hidden;border:1px solid var(--neu-code-block-border);font-family:var(--neu-font-mono)}.neu-code-block__header{display:flex;align-items:center;gap:var(--neu-space-3);padding:10px 16px;background:var(--neu-code-block-bar-bg);border-bottom:1px solid var(--neu-code-block-border)}.neu-code-block__dots{display:flex;gap:6px;flex-shrink:0}.neu-code-block__dots span{display:block;width:12px;height:12px;border-radius:50%}.neu-code-block__dots span:nth-child(1){background:#ff5f57}.neu-code-block__dots span:nth-child(2){background:#febc2e}.neu-code-block__dots span:nth-child(3){background:#28c840}.neu-code-block__lang{flex:1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--neu-code-block-accent);font-family:var(--neu-font-mono)}.neu-code-block__copy{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;background:var(--neu-code-block-border);border:1px solid var(--neu-code-block-copy-border);border-radius:6px;font-size:11px;font-weight:500;color:var(--neu-code-block-copy-text);cursor:pointer;font-family:var(--neu-font-sans);transition:all var(--neu-transition);flex-shrink:0}.neu-code-block__copy svg{width:12px;height:12px;flex-shrink:0}.neu-code-block__copy:hover{background:var(--neu-code-block-copy-hover-bg);color:var(--neu-code-block-copy-hover-text);border-color:var(--neu-code-block-copy-hover-border)}.neu-code-block__pre{margin:0;padding:20px 24px;background:var(--neu-code-block-bg);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--neu-code-block-muted) transparent}.neu-code-block__pre::-webkit-scrollbar{height:4px}.neu-code-block__pre::-webkit-scrollbar-track{background:transparent}.neu-code-block__pre::-webkit-scrollbar-thumb{background:var(--neu-code-block-muted);border-radius:99px}.neu-code-block__code{display:block;font-size:13.5px;line-height:1.75;color:var(--neu-code-block-text);font-family:inherit;white-space:pre;tab-size:2}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
189
+ `, isInline: true, styles: [".neu-code-block{border-radius:var(--neu-radius-lg);overflow:hidden;border:1px solid var(--neu-code-block-border, rgba(255, 255, 255, .14));font-family:var(--neu-font-mono)}.neu-code-block__header{display:flex;align-items:center;gap:var(--neu-space-3);padding:10px 16px;background:var(--neu-code-block-bar-bg, #16161e);border-bottom:1px solid var(--neu-code-block-border, rgba(255, 255, 255, .14))}.neu-code-block__dots{display:flex;gap:6px;flex-shrink:0}.neu-code-block__dots span{display:block;width:12px;height:12px;border-radius:50%}.neu-code-block__dots span:nth-child(1){background:#ff5f57}.neu-code-block__dots span:nth-child(2){background:#febc2e}.neu-code-block__dots span:nth-child(3){background:#28c840}.neu-code-block__lang{flex:1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--neu-code-block-accent, #9ab8ff);font-family:var(--neu-font-mono)}.neu-code-block__copy{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;background:var(--neu-code-block-copy-bg, rgba(255, 255, 255, .12));border:1px solid var(--neu-code-block-copy-border, rgba(255, 255, 255, .22));border-radius:6px;font-size:11px;font-weight:500;color:var(--neu-code-block-copy-text, #d9e2ff);cursor:pointer;font-family:var(--neu-font-sans);transition:all var(--neu-transition);flex-shrink:0}.neu-code-block__copy svg{width:12px;height:12px;flex-shrink:0}.neu-code-block__copy:hover{background:var(--neu-code-block-copy-hover-bg, rgba(255, 255, 255, .18));color:var(--neu-code-block-copy-hover-text, #ffffff);border-color:var(--neu-code-block-copy-hover-border, rgba(255, 255, 255, .34))}.neu-code-block__pre{margin:0;padding:20px 24px;background:var(--neu-code-block-bg, #1a1b26);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--neu-code-block-muted, #8f99bd) transparent}.neu-code-block__pre::-webkit-scrollbar{height:4px}.neu-code-block__pre::-webkit-scrollbar-track{background:transparent}.neu-code-block__pre::-webkit-scrollbar-thumb{background:var(--neu-code-block-muted, #8f99bd);border-radius:99px}.neu-code-block__code{display:block;font-size:13.5px;line-height:1.75;color:var(--neu-code-block-text, #d9e2ff);font-family:inherit;white-space:pre;tab-size:2}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
190
190
  }
191
191
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuCodeBlockComponent, decorators: [{
192
192
  type: Component,
@@ -240,7 +240,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
240
240
  tabindex="0"
241
241
  ><code class="neu-code-block__code">{{ code() }}</code></pre>
242
242
  </div>
243
- `, host: { '[attr.lang]': 'null' }, styles: [".neu-code-block{border-radius:var(--neu-radius-lg);overflow:hidden;border:1px solid var(--neu-code-block-border);font-family:var(--neu-font-mono)}.neu-code-block__header{display:flex;align-items:center;gap:var(--neu-space-3);padding:10px 16px;background:var(--neu-code-block-bar-bg);border-bottom:1px solid var(--neu-code-block-border)}.neu-code-block__dots{display:flex;gap:6px;flex-shrink:0}.neu-code-block__dots span{display:block;width:12px;height:12px;border-radius:50%}.neu-code-block__dots span:nth-child(1){background:#ff5f57}.neu-code-block__dots span:nth-child(2){background:#febc2e}.neu-code-block__dots span:nth-child(3){background:#28c840}.neu-code-block__lang{flex:1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--neu-code-block-accent);font-family:var(--neu-font-mono)}.neu-code-block__copy{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;background:var(--neu-code-block-border);border:1px solid var(--neu-code-block-copy-border);border-radius:6px;font-size:11px;font-weight:500;color:var(--neu-code-block-copy-text);cursor:pointer;font-family:var(--neu-font-sans);transition:all var(--neu-transition);flex-shrink:0}.neu-code-block__copy svg{width:12px;height:12px;flex-shrink:0}.neu-code-block__copy:hover{background:var(--neu-code-block-copy-hover-bg);color:var(--neu-code-block-copy-hover-text);border-color:var(--neu-code-block-copy-hover-border)}.neu-code-block__pre{margin:0;padding:20px 24px;background:var(--neu-code-block-bg);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--neu-code-block-muted) transparent}.neu-code-block__pre::-webkit-scrollbar{height:4px}.neu-code-block__pre::-webkit-scrollbar-track{background:transparent}.neu-code-block__pre::-webkit-scrollbar-thumb{background:var(--neu-code-block-muted);border-radius:99px}.neu-code-block__code{display:block;font-size:13.5px;line-height:1.75;color:var(--neu-code-block-text);font-family:inherit;white-space:pre;tab-size:2}\n"] }]
243
+ `, host: { '[attr.lang]': 'null' }, styles: [".neu-code-block{border-radius:var(--neu-radius-lg);overflow:hidden;border:1px solid var(--neu-code-block-border, rgba(255, 255, 255, .14));font-family:var(--neu-font-mono)}.neu-code-block__header{display:flex;align-items:center;gap:var(--neu-space-3);padding:10px 16px;background:var(--neu-code-block-bar-bg, #16161e);border-bottom:1px solid var(--neu-code-block-border, rgba(255, 255, 255, .14))}.neu-code-block__dots{display:flex;gap:6px;flex-shrink:0}.neu-code-block__dots span{display:block;width:12px;height:12px;border-radius:50%}.neu-code-block__dots span:nth-child(1){background:#ff5f57}.neu-code-block__dots span:nth-child(2){background:#febc2e}.neu-code-block__dots span:nth-child(3){background:#28c840}.neu-code-block__lang{flex:1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--neu-code-block-accent, #9ab8ff);font-family:var(--neu-font-mono)}.neu-code-block__copy{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;background:var(--neu-code-block-copy-bg, rgba(255, 255, 255, .12));border:1px solid var(--neu-code-block-copy-border, rgba(255, 255, 255, .22));border-radius:6px;font-size:11px;font-weight:500;color:var(--neu-code-block-copy-text, #d9e2ff);cursor:pointer;font-family:var(--neu-font-sans);transition:all var(--neu-transition);flex-shrink:0}.neu-code-block__copy svg{width:12px;height:12px;flex-shrink:0}.neu-code-block__copy:hover{background:var(--neu-code-block-copy-hover-bg, rgba(255, 255, 255, .18));color:var(--neu-code-block-copy-hover-text, #ffffff);border-color:var(--neu-code-block-copy-hover-border, rgba(255, 255, 255, .34))}.neu-code-block__pre{margin:0;padding:20px 24px;background:var(--neu-code-block-bg, #1a1b26);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--neu-code-block-muted, #8f99bd) transparent}.neu-code-block__pre::-webkit-scrollbar{height:4px}.neu-code-block__pre::-webkit-scrollbar-track{background:transparent}.neu-code-block__pre::-webkit-scrollbar-thumb{background:var(--neu-code-block-muted, #8f99bd);border-radius:99px}.neu-code-block__code{display:block;font-size:13.5px;line-height:1.75;color:var(--neu-code-block-text, #d9e2ff);font-family:inherit;white-space:pre;tab-size:2}\n"] }]
244
244
  }], ctorParameters: () => [], propDecorators: { code: [{ type: i0.Input, args: [{ isSignal: true, alias: "code", required: false }] }], lang: [{ type: i0.Input, args: [{ isSignal: true, alias: "lang", required: false }] }], language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], copyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyLabel", required: false }] }], copiedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copiedLabel", required: false }] }], copyAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyAriaLabel", required: false }] }], copiedAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copiedAriaLabel", required: false }] }] } });
245
245
 
246
246
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"neural-ui-core-code-block.mjs","sources":["../../../../projects/ui-core/code-block/neu-code-block.component.ts","../../../../projects/ui-core/code-block/neural-ui-core-code-block.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * NeuralUI Code Block\n *\n * Bloque de código con estilo editor oscuro (Tokyo Night).\n * Incluye botón de copiar al portapapeles, badge del lenguaje\n * y soporte para resaltado futuro con ngx-highlightjs.\n *\n * Uso:\n * <neu-code-block [code]=\"snippet\" lang=\"TypeScript\" />\n *\n * Con ngx-highlightjs instalado, envuelve el <pre> con\n * [highlight]=\"code\" para resaltado automático.\n */\n@Component({\n selector: 'neu-code-block',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"neu-code-block\">\n <!-- Encabezado del editor -->\n <div class=\"neu-code-block__header\">\n <!-- Traffic lights decorativos -->\n <div class=\"neu-code-block__dots\" aria-hidden=\"true\">\n <span></span><span></span><span></span>\n </div>\n <span class=\"neu-code-block__lang\">{{ displayLang() }}</span>\n <button\n class=\"neu-code-block__copy\"\n type=\"button\"\n [attr.aria-label]=\"copied() ? resolvedCopiedAriaLabel() : resolvedCopyAriaLabel()\"\n (click)=\"copy()\"\n >\n @if (copied()) {\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n {{ resolvedCopiedLabel() }}\n } @else {\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\" />\n </svg>\n {{ resolvedCopyLabel() }}\n }\n </button>\n </div>\n\n <!-- Bloque de código -->\n <pre\n class=\"neu-code-block__pre\"\n tabindex=\"0\"\n ><code class=\"neu-code-block__code\">{{ code() }}</code></pre>\n </div>\n `,\n host: { '[attr.lang]': 'null' },\n styleUrl: './neu-code-block.component.scss',\n})\nexport class NeuCodeBlockComponent {\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Código fuente a mostrar / Source code to display */\n code = input<string>('');\n\n /** Nombre del lenguaje (decorativo) / Language name (decorative) */\n lang = input<string>('');\n\n /**\n * Identificador de lenguaje estándar (typescript, scss, html, bash…).\n * Genera automáticamente el label legible para el badge.\n * Language identifier — auto-generates a readable badge label.\n */\n language = input<string>('');\n\n /** Label legible derivado de lang o language / Readable label derived from lang or language */\n protected readonly displayLang = computed(() => {\n const explicit = this.lang();\n if (explicit) return explicit;\n const id = this.language().toLowerCase().trim();\n const map: Record<string, string> = {\n typescript: 'TypeScript',\n javascript: 'JavaScript',\n ts: 'TypeScript',\n js: 'JavaScript',\n scss: 'SCSS',\n css: 'CSS',\n less: 'Less',\n html: 'HTML',\n xml: 'XML',\n bash: 'Bash',\n shell: 'Shell',\n sh: 'Shell',\n json: 'JSON',\n yaml: 'YAML',\n yml: 'YAML',\n angular: 'Angular',\n jsx: 'JSX',\n tsx: 'TSX',\n };\n return map[id] ?? (id ? id.toUpperCase() : 'TypeScript');\n });\n\n /** Texto del botón cuando no se ha copiado / Button text when not yet copied */\n copyLabel = input<string | undefined>(undefined);\n\n /** Texto del botón tras copiar / Button text after copying */\n copiedLabel = input<string | undefined>(undefined);\n\n /** Aria-label del botón copiar / Aria-label for the copy button */\n copyAriaLabel = input<string | undefined>(undefined);\n\n /** Aria-label del botón tras copiar / Aria-label for the button after copying */\n copiedAriaLabel = input<string | undefined>(undefined);\n\n private readonly localeLabels = signal(this._getLocaleLabels());\n\n protected readonly resolvedCopyLabel = computed(\n () => this._resolveInputLabel(this.copyLabel()) ?? this.localeLabels().copyLabel,\n );\n\n protected readonly resolvedCopiedLabel = computed(\n () => this._resolveInputLabel(this.copiedLabel()) ?? this.localeLabels().copiedLabel,\n );\n\n protected readonly resolvedCopyAriaLabel = computed(\n () => this._resolveInputLabel(this.copyAriaLabel()) ?? this.localeLabels().copyAriaLabel,\n );\n\n protected readonly resolvedCopiedAriaLabel = computed(\n () => this._resolveInputLabel(this.copiedAriaLabel()) ?? this.localeLabels().copiedAriaLabel,\n );\n\n protected readonly copied = signal(false);\n private _copyTimer?: ReturnType<typeof setTimeout>;\n\n constructor() {\n const root = this.doc.documentElement;\n const win = this.doc.defaultView;\n\n this.destroyRef.onDestroy(() => clearTimeout(this._copyTimer));\n\n if (!root || !win?.MutationObserver) return;\n\n const observer = new win.MutationObserver(() => {\n this.localeLabels.set(this._getLocaleLabels());\n });\n\n observer.observe(root, {\n attributes: true,\n attributeFilter: ['lang'],\n });\n\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n\n copy(): void {\n const text = this.code();\n const win = this.doc.defaultView;\n\n if (win?.navigator?.clipboard) {\n void win.navigator.clipboard.writeText(text).then(() => this._markCopied());\n } else {\n // Fallback para HTTP o navegadores sin Clipboard API\n const ta = this.doc.createElement('textarea');\n ta.value = text;\n ta.style.cssText = 'position:fixed;top:0;left:0;opacity:0;pointer-events:none';\n this.doc.body.appendChild(ta);\n ta.focus();\n ta.select();\n try {\n this.doc.execCommand('copy');\n this._markCopied();\n } finally {\n this.doc.body.removeChild(ta);\n }\n }\n }\n\n private _markCopied(): void {\n this.copied.set(true);\n clearTimeout(this._copyTimer);\n this._copyTimer = setTimeout(() => this.copied.set(false), 2000);\n }\n\n private _getLocaleLabels(): {\n copyLabel: string;\n copiedLabel: string;\n copyAriaLabel: string;\n copiedAriaLabel: string;\n } {\n const lang = this.doc.documentElement?.lang?.toLowerCase() ?? 'en';\n\n if (lang.startsWith('es')) {\n return {\n copyLabel: 'Copiar',\n copiedLabel: 'Copiado',\n copyAriaLabel: 'Copiar código',\n copiedAriaLabel: 'Código copiado',\n };\n }\n\n return {\n copyLabel: 'Copy',\n copiedLabel: 'Copied',\n copyAriaLabel: 'Copy code',\n copiedAriaLabel: 'Code copied',\n };\n }\n\n private _resolveInputLabel(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed ? value : undefined;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAYA;;;;;;;;;;;;AAYG;MA4DU,qBAAqB,CAAA;AACf,IAAA,GAAG,G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UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAtDtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,27DAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FAIU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA3DjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,EAAE,EAAA,aAAA,EACI,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDT,EAAA,CAAA,EAAA,IAAA,EACK,EAAE,aAAa,EAAE,MAAM,EAAE,EAAA,MAAA,EAAA,CAAA,27DAAA,CAAA,EAAA;;;ACjFjC;;AAEG;;;;"}
1
+ {"version":3,"file":"neural-ui-core-code-block.mjs","sources":["../../../../projects/ui-core/code-block/neu-code-block.component.ts","../../../../projects/ui-core/code-block/neural-ui-core-code-block.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * NeuralUI Code Block\n *\n * Bloque de código con estilo editor oscuro (Tokyo Night).\n * Incluye botón de copiar al portapapeles, badge del lenguaje\n * y soporte para resaltado futuro con ngx-highlightjs.\n *\n * Uso:\n * <neu-code-block [code]=\"snippet\" lang=\"TypeScript\" />\n *\n * Con ngx-highlightjs instalado, envuelve el <pre> con\n * [highlight]=\"code\" para resaltado automático.\n */\n@Component({\n selector: 'neu-code-block',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"neu-code-block\">\n <!-- Encabezado del editor -->\n <div class=\"neu-code-block__header\">\n <!-- Traffic lights decorativos -->\n <div class=\"neu-code-block__dots\" aria-hidden=\"true\">\n <span></span><span></span><span></span>\n </div>\n <span class=\"neu-code-block__lang\">{{ displayLang() }}</span>\n <button\n class=\"neu-code-block__copy\"\n type=\"button\"\n [attr.aria-label]=\"copied() ? resolvedCopiedAriaLabel() : resolvedCopyAriaLabel()\"\n (click)=\"copy()\"\n >\n @if (copied()) {\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n {{ resolvedCopiedLabel() }}\n } @else {\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\" />\n </svg>\n {{ resolvedCopyLabel() }}\n }\n </button>\n </div>\n\n <!-- Bloque de código -->\n <pre\n class=\"neu-code-block__pre\"\n tabindex=\"0\"\n ><code class=\"neu-code-block__code\">{{ code() }}</code></pre>\n </div>\n `,\n host: { '[attr.lang]': 'null' },\n styleUrl: './neu-code-block.component.scss',\n})\nexport class NeuCodeBlockComponent {\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Código fuente a mostrar / Source code to display */\n code = input<string>('');\n\n /** Nombre del lenguaje (decorativo) / Language name (decorative) */\n lang = input<string>('');\n\n /**\n * Identificador de lenguaje estándar (typescript, scss, html, bash…).\n * Genera automáticamente el label legible para el badge.\n * Language identifier — auto-generates a readable badge label.\n */\n language = input<string>('');\n\n /** Label legible derivado de lang o language / Readable label derived from lang or language */\n protected readonly displayLang = computed(() => {\n const explicit = this.lang();\n if (explicit) return explicit;\n const id = this.language().toLowerCase().trim();\n const map: Record<string, string> = {\n typescript: 'TypeScript',\n javascript: 'JavaScript',\n ts: 'TypeScript',\n js: 'JavaScript',\n scss: 'SCSS',\n css: 'CSS',\n less: 'Less',\n html: 'HTML',\n xml: 'XML',\n bash: 'Bash',\n shell: 'Shell',\n sh: 'Shell',\n json: 'JSON',\n yaml: 'YAML',\n yml: 'YAML',\n angular: 'Angular',\n jsx: 'JSX',\n tsx: 'TSX',\n };\n return map[id] ?? (id ? id.toUpperCase() : 'TypeScript');\n });\n\n /** Texto del botón cuando no se ha copiado / Button text when not yet copied */\n copyLabel = input<string | undefined>(undefined);\n\n /** Texto del botón tras copiar / Button text after copying */\n copiedLabel = input<string | undefined>(undefined);\n\n /** Aria-label del botón copiar / Aria-label for the copy button */\n copyAriaLabel = input<string | undefined>(undefined);\n\n /** Aria-label del botón tras copiar / Aria-label for the button after copying */\n copiedAriaLabel = input<string | undefined>(undefined);\n\n private readonly localeLabels = signal(this._getLocaleLabels());\n\n protected readonly resolvedCopyLabel = computed(\n () => this._resolveInputLabel(this.copyLabel()) ?? this.localeLabels().copyLabel,\n );\n\n protected readonly resolvedCopiedLabel = computed(\n () => this._resolveInputLabel(this.copiedLabel()) ?? this.localeLabels().copiedLabel,\n );\n\n protected readonly resolvedCopyAriaLabel = computed(\n () => this._resolveInputLabel(this.copyAriaLabel()) ?? this.localeLabels().copyAriaLabel,\n );\n\n protected readonly resolvedCopiedAriaLabel = computed(\n () => this._resolveInputLabel(this.copiedAriaLabel()) ?? this.localeLabels().copiedAriaLabel,\n );\n\n protected readonly copied = signal(false);\n private _copyTimer?: ReturnType<typeof setTimeout>;\n\n constructor() {\n const root = this.doc.documentElement;\n const win = this.doc.defaultView;\n\n this.destroyRef.onDestroy(() => clearTimeout(this._copyTimer));\n\n if (!root || !win?.MutationObserver) return;\n\n const observer = new win.MutationObserver(() => {\n this.localeLabels.set(this._getLocaleLabels());\n });\n\n observer.observe(root, {\n attributes: true,\n attributeFilter: ['lang'],\n });\n\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n\n copy(): void {\n const text = this.code();\n const win = this.doc.defaultView;\n\n if (win?.navigator?.clipboard) {\n void win.navigator.clipboard.writeText(text).then(() => this._markCopied());\n } else {\n // Fallback para HTTP o navegadores sin Clipboard API\n const ta = this.doc.createElement('textarea');\n ta.value = text;\n ta.style.cssText = 'position:fixed;top:0;left:0;opacity:0;pointer-events:none';\n this.doc.body.appendChild(ta);\n ta.focus();\n ta.select();\n try {\n this.doc.execCommand('copy');\n this._markCopied();\n } finally {\n this.doc.body.removeChild(ta);\n }\n }\n }\n\n private _markCopied(): void {\n this.copied.set(true);\n clearTimeout(this._copyTimer);\n this._copyTimer = setTimeout(() => this.copied.set(false), 2000);\n }\n\n private _getLocaleLabels(): {\n copyLabel: string;\n copiedLabel: string;\n copyAriaLabel: string;\n copiedAriaLabel: string;\n } {\n const lang = this.doc.documentElement?.lang?.toLowerCase() ?? 'en';\n\n if (lang.startsWith('es')) {\n return {\n copyLabel: 'Copiar',\n copiedLabel: 'Copiado',\n copyAriaLabel: 'Copiar código',\n copiedAriaLabel: 'Código copiado',\n };\n }\n\n return {\n copyLabel: 'Copy',\n copiedLabel: 'Copied',\n copyAriaLabel: 'Copy code',\n copiedAriaLabel: 'Code copied',\n };\n }\n\n private _resolveInputLabel(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed ? value : undefined;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAYA;;;;;;;;;;;;AAYG;MA4DU,qBAAqB,CAAA;AACf,IAAA,GAAG,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,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAtDtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,gqEAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FAIU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA3DjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,EAAE,EAAA,aAAA,EACI,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDT,EAAA,CAAA,EAAA,IAAA,EACK,EAAE,aAAa,EAAE,MAAM,EAAE,EAAA,MAAA,EAAA,CAAA,gqEAAA,CAAA,EAAA;;;ACjFjC;;AAEG;;;;"}
@@ -0,0 +1,105 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, Injectable, input, output, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { NeuButtonComponent } from '@neural-ui/core/button';
4
+
5
+ class NeuConfirmPopupService {
6
+ state = signal(null, ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
7
+ resolver = null;
8
+ confirm(options) {
9
+ this.state.set(options);
10
+ return new Promise((resolve) => {
11
+ this.resolver = resolve;
12
+ });
13
+ }
14
+ close(value) {
15
+ this.state.set(null);
16
+ this.resolver?.(value);
17
+ this.resolver = null;
18
+ }
19
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuConfirmPopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
20
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuConfirmPopupService, providedIn: 'root' });
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuConfirmPopupService, decorators: [{
23
+ type: Injectable,
24
+ args: [{ providedIn: 'root' }]
25
+ }] });
26
+ class NeuConfirmPopupComponent {
27
+ service;
28
+ open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
29
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
30
+ message = input('', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
31
+ acceptLabel = input('Confirm', ...(ngDevMode ? [{ debugName: "acceptLabel" }] : /* istanbul ignore next */ []));
32
+ rejectLabel = input('Cancel', ...(ngDevMode ? [{ debugName: "rejectLabel" }] : /* istanbul ignore next */ []));
33
+ accepted = output();
34
+ rejected = output();
35
+ constructor(service) {
36
+ this.service = service;
37
+ }
38
+ currentTitle() {
39
+ return this.service.state()?.title ?? this.title();
40
+ }
41
+ currentMessage() {
42
+ return this.service.state()?.message ?? this.message();
43
+ }
44
+ currentAcceptLabel() {
45
+ return this.service.state()?.acceptLabel ?? this.acceptLabel();
46
+ }
47
+ currentRejectLabel() {
48
+ return this.service.state()?.rejectLabel ?? this.rejectLabel();
49
+ }
50
+ accept() {
51
+ this.accepted.emit();
52
+ this.service.close(true);
53
+ }
54
+ reject() {
55
+ this.rejected.emit();
56
+ this.service.close(false);
57
+ }
58
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuConfirmPopupComponent, deps: [{ token: NeuConfirmPopupService }], target: i0.ɵɵFactoryTarget.Component });
59
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuConfirmPopupComponent, isStandalone: true, selector: "neu-confirm-popup", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, acceptLabel: { classPropertyName: "acceptLabel", publicName: "acceptLabel", isSignal: true, isRequired: false, transformFunction: null }, rejectLabel: { classPropertyName: "rejectLabel", publicName: "rejectLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { accepted: "accepted", rejected: "rejected" }, host: { classAttribute: "neu-confirm-popup-host" }, ngImport: i0, template: `
60
+ @if (open() || service.state()) {
61
+ <div class="neu-confirm-popup" role="alertdialog" aria-modal="false">
62
+ @if (currentTitle()) {
63
+ <h3>{{ currentTitle() }}</h3>
64
+ }
65
+ <p>{{ currentMessage() }}</p>
66
+ <div class="neu-confirm-popup__actions">
67
+ <button neu-button type="button" class="neu-confirm-popup__reject" variant="secondary" size="sm" (click)="reject()">
68
+ {{ currentRejectLabel() }}
69
+ </button>
70
+ <button neu-button type="button" class="neu-confirm-popup__accept" variant="primary" size="sm" (click)="accept()">
71
+ {{ currentAcceptLabel() }}
72
+ </button>
73
+ </div>
74
+ </div>
75
+ }
76
+ `, isInline: true, styles: [".neu-confirm-popup-host{position:relative;display:inline-block}.neu-confirm-popup{position:absolute;z-index:calc(var(--neu-z-overlay, 99) + 1);top:calc(100% + .5rem);left:0;width:min(18rem,100vw - 2rem);border:1px solid var(--neu-border, #d1d5db);border-radius:.75rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);box-shadow:var(--neu-shadow-lg, 0 18px 40px rgba(15, 23, 42, .18));padding:1rem}.neu-confirm-popup h3{margin:0 0 .375rem;font-size:1rem}.neu-confirm-popup p{margin:0;color:var(--neu-text-muted, #6b7280)}.neu-confirm-popup__actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}\n"], dependencies: [{ kind: "component", type: NeuButtonComponent, selector: "button[neu-button]", inputs: ["variant", "size", "disabled", "loading", "fullWidth", "icon", "iconPosition", "iconOnly", "ariaLabel"], outputs: ["neuClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
77
+ }
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuConfirmPopupComponent, decorators: [{
79
+ type: Component,
80
+ args: [{ selector: 'neu-confirm-popup', imports: [NeuButtonComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'neu-confirm-popup-host' }, template: `
81
+ @if (open() || service.state()) {
82
+ <div class="neu-confirm-popup" role="alertdialog" aria-modal="false">
83
+ @if (currentTitle()) {
84
+ <h3>{{ currentTitle() }}</h3>
85
+ }
86
+ <p>{{ currentMessage() }}</p>
87
+ <div class="neu-confirm-popup__actions">
88
+ <button neu-button type="button" class="neu-confirm-popup__reject" variant="secondary" size="sm" (click)="reject()">
89
+ {{ currentRejectLabel() }}
90
+ </button>
91
+ <button neu-button type="button" class="neu-confirm-popup__accept" variant="primary" size="sm" (click)="accept()">
92
+ {{ currentAcceptLabel() }}
93
+ </button>
94
+ </div>
95
+ </div>
96
+ }
97
+ `, styles: [".neu-confirm-popup-host{position:relative;display:inline-block}.neu-confirm-popup{position:absolute;z-index:calc(var(--neu-z-overlay, 99) + 1);top:calc(100% + .5rem);left:0;width:min(18rem,100vw - 2rem);border:1px solid var(--neu-border, #d1d5db);border-radius:.75rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);box-shadow:var(--neu-shadow-lg, 0 18px 40px rgba(15, 23, 42, .18));padding:1rem}.neu-confirm-popup h3{margin:0 0 .375rem;font-size:1rem}.neu-confirm-popup p{margin:0;color:var(--neu-text-muted, #6b7280)}.neu-confirm-popup__actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}\n"] }]
98
+ }], ctorParameters: () => [{ type: NeuConfirmPopupService }], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], acceptLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptLabel", required: false }] }], rejectLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rejectLabel", required: false }] }], accepted: [{ type: i0.Output, args: ["accepted"] }], rejected: [{ type: i0.Output, args: ["rejected"] }] } });
99
+
100
+ /**
101
+ * Generated bundle index. Do not edit.
102
+ */
103
+
104
+ export { NeuConfirmPopupComponent, NeuConfirmPopupService };
105
+ //# sourceMappingURL=neural-ui-core-confirm-popup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neural-ui-core-confirm-popup.mjs","sources":["../../../../projects/ui-core/confirm-popup/neu-confirm-popup.component.ts","../../../../projects/ui-core/confirm-popup/neural-ui-core-confirm-popup.ts"],"sourcesContent":["import { Injectable, signal, ChangeDetectionStrategy, Component, ViewEncapsulation, input, output } from '@angular/core';\nimport { NeuButtonComponent } from '@neural-ui/core/button';\n\nexport interface NeuConfirmPopupOptions {\n title?: string;\n message: string;\n acceptLabel?: string;\n rejectLabel?: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NeuConfirmPopupService {\n readonly state = signal<NeuConfirmPopupOptions | null>(null);\n private resolver: ((value: boolean) => void) | null = null;\n\n confirm(options: NeuConfirmPopupOptions): Promise<boolean> {\n this.state.set(options);\n return new Promise((resolve) => {\n this.resolver = resolve;\n });\n }\n\n close(value: boolean): void {\n this.state.set(null);\n this.resolver?.(value);\n this.resolver = null;\n }\n}\n\n@Component({\n selector: 'neu-confirm-popup',\n imports: [NeuButtonComponent],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'neu-confirm-popup-host' },\n template: `\n @if (open() || service.state()) {\n <div class=\"neu-confirm-popup\" role=\"alertdialog\" aria-modal=\"false\">\n @if (currentTitle()) {\n <h3>{{ currentTitle() }}</h3>\n }\n <p>{{ currentMessage() }}</p>\n <div class=\"neu-confirm-popup__actions\">\n <button neu-button type=\"button\" class=\"neu-confirm-popup__reject\" variant=\"secondary\" size=\"sm\" (click)=\"reject()\">\n {{ currentRejectLabel() }}\n </button>\n <button neu-button type=\"button\" class=\"neu-confirm-popup__accept\" variant=\"primary\" size=\"sm\" (click)=\"accept()\">\n {{ currentAcceptLabel() }}\n </button>\n </div>\n </div>\n }\n `,\n styleUrl: './neu-confirm-popup.component.scss',\n})\nexport class NeuConfirmPopupComponent {\n readonly open = input(false);\n readonly title = input('');\n readonly message = input('');\n readonly acceptLabel = input('Confirm');\n readonly rejectLabel = input('Cancel');\n readonly accepted = output<void>();\n readonly rejected = output<void>();\n\n constructor(readonly service: NeuConfirmPopupService) {}\n\n currentTitle(): string {\n return this.service.state()?.title ?? this.title();\n }\n\n currentMessage(): string {\n return this.service.state()?.message ?? this.message();\n }\n\n currentAcceptLabel(): string {\n return this.service.state()?.acceptLabel ?? this.acceptLabel();\n }\n\n currentRejectLabel(): string {\n return this.service.state()?.rejectLabel ?? this.rejectLabel();\n }\n\n accept(): void {\n this.accepted.emit();\n this.service.close(true);\n }\n\n reject(): void {\n this.rejected.emit();\n this.service.close(false);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAWa,sBAAsB,CAAA;AACxB,IAAA,KAAK,GAAG,MAAM,CAAgC,IAAI,4EAAC;IACpD,QAAQ,GAAsC,IAAI;AAE1D,IAAA,OAAO,CAAC,OAA+B,EAAA;AACrC,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;AACvB,QAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAI;AAC7B,YAAA,IAAI,C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AA,EACd,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAA,QAAA,EAC/B;;;;;;;;;;;;;;;;;AAiBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,0nBAAA,CAAA,EAAA;;;ACpDH;;AAEG;;;;"}
@@ -1,5 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, output, signal, viewChildren, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
2
+ import { inject, ElementRef, PLATFORM_ID, input, output, signal, viewChildren, effect, untracked, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { isPlatformBrowser } from '@angular/common';
3
4
  import { moveItemInArray, CdkDrag, CdkDragPlaceholder, CdkDragPreview, CdkDropList } from '@angular/cdk/drag-drop';
4
5
 
5
6
  /**
@@ -14,6 +15,7 @@ import { moveItemInArray, CdkDrag, CdkDragPlaceholder, CdkDragPreview, CdkDropLi
14
15
  */
15
16
  class NeuDashboardGridComponent {
16
17
  _host = inject(ElementRef);
18
+ _platformId = inject(PLATFORM_ID);
17
19
  tiles = input([], ...(ngDevMode ? [{ debugName: "tiles" }] : /* istanbul ignore next */ []));
18
20
  columns = input(3, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
19
21
  /** Emitido cuando el orden cambia / Emitted when order changes */
@@ -28,7 +30,9 @@ class NeuDashboardGridComponent {
28
30
  effect(() => {
29
31
  this._orderedTiles();
30
32
  this._tileSlots();
31
- queueMicrotask(() => this._attachProjectedTiles());
33
+ if (isPlatformBrowser(this._platformId)) {
34
+ queueMicrotask(() => this._attachProjectedTiles());
35
+ }
32
36
  });
33
37
  }
34
38
  _onDrop(event) {
@@ -38,7 +42,9 @@ class NeuDashboardGridComponent {
38
42
  this.orderChange.emit(tiles);
39
43
  }
40
44
  _attachProjectedTiles() {
41
- const slots = new Map(this._tileSlots().map((slotRef) => [
45
+ if (!isPlatformBrowser(this._platformId))
46
+ return;
47
+ const slots = new Map(this._tileSlots().filter(Boolean).map((slotRef) => [
42
48
  slotRef.nativeElement.dataset['slotId'],
43
49
  slotRef.nativeElement,
44
50
  ]));
@@ -1 +1 @@
1
- {"version":3,"file":"neural-ui-core-dashboard-grid.mjs","sources":["../../../../projects/ui-core/dashboard-grid/neu-dashboard-grid.component.ts","../../../../projects/ui-core/dashboard-grid/neural-ui-core-dashboard-grid.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport {\n CdkDrag,\n CdkDragDrop,\n CdkDragPlaceholder,\n CdkDragPreview,\n CdkDropList,\n moveItemInArray,\n} from '@angular/cdk/drag-drop';\n\nexport interface NeuDashboardTileConfig {\n /** Identificador único / Unique identifier */\n id: string;\n /** Número de columnas que ocupa / Column span */\n cols?: number;\n /** Número de filas que ocupa / Row span */\n rows?: number;\n /** Título del tile / Tile title */\n title?: string;\n}\n\n/**\n * NeuralUI DashboardGrid\n *\n * Cuadrícula de tiles reordenables mediante drag-and-drop (CDK DragDrop).\n *\n * Uso:\n * <neu-dashboard-grid [tiles]=\"tileConfigs\" [columns]=\"3\">\n * <ng-template neuDashboardTile id=\"tile-1\">...</ng-template>\n * </neu-dashboard-grid>\n */\n@Component({\n selector: 'neu-dashboard-grid',\n imports: [CdkDrag, CdkDragPlaceholder, CdkDragPreview, CdkDropList],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'neu-dg',\n '[style.--neu-dg-cols]': 'columns()',\n },\n template: `\n <div class=\"neu-dg__projection-source\" aria-hidden=\"true\">\n <ng-content />\n </div>\n\n <div\n class=\"neu-dg__grid\"\n cdkDropList\n [cdkDropListData]=\"_orderedTiles()\"\n (cdkDropListDropped)=\"_onDrop($event)\"\n >\n @for (tile of _orderedTiles(); track tile.id) {\n <div\n class=\"neu-dg__tile\"\n cdkDrag\n [cdkDragData]=\"tile\"\n [style.--tile-cols]=\"tile.cols ?? 1\"\n [style.--tile-rows]=\"tile.rows ?? 1\"\n >\n <!-- Drag handle -->\n <div class=\"neu-dg__tile-handle\" cdkDragHandle>\n @if (tile.title) {\n <span class=\"neu-dg__tile-title\">{{ tile.title }}</span>\n }\n <span class=\"neu-dg__handle-icon\" aria-hidden=\"true\">⠿</span>\n </div>\n <!-- Drag placeholder -->\n <div *cdkDragPlaceholder class=\"neu-dg__placeholder\"></div>\n <!-- Drag preview -->\n <div *cdkDragPreview class=\"neu-dg__preview\">{{ tile.title ?? tile.id }}</div>\n <!-- Content slot -->\n <div class=\"neu-dg__tile-content\" tabindex=\"0\">\n <div class=\"neu-dg__tile-slot\" #tileSlot [attr.data-slot-id]=\"tile.id\"></div>\n </div>\n </div>\n }\n </div>\n `,\n styleUrl: './neu-dashboard-grid.component.scss',\n})\nexport class NeuDashboardGridComponent {\n private readonly _host = inject(ElementRef) as ElementRef<HTMLElement>;\n\n readonly tiles = input<NeuDashboardTileConfig[]>([]);\n readonly columns = input<number>(3);\n\n /** Emitido cuando el orden cambia / Emitted when order changes */\n readonly orderChange = output<NeuDashboardTileConfig[]>();\n\n readonly _orderedTiles = signal<NeuDashboardTileConfig[]>([]);\n readonly _tileSlots = viewChildren<ElementRef<HTMLElement>>('tileSlot');\n\n constructor() {\n effect(() => {\n const t = this.tiles();\n untracked(() => this._orderedTiles.set([...t]));\n });\n\n effect(() => {\n this._orderedTiles();\n this._tileSlots();\n queueMicrotask(() => this._attachProjectedTiles());\n });\n }\n\n _onDrop(event: CdkDragDrop<NeuDashboardTileConfig[]>): void {\n const tiles = [...this._orderedTiles()];\n moveItemInArray(tiles, event.previousIndex, event.currentIndex);\n this._orderedTiles.set(tiles);\n this.orderChange.emit(tiles);\n }\n\n private _attachProjectedTiles(): void {\n const slots = new Map(\n this._tileSlots().map((slotRef) => [\n slotRef.nativeElement.dataset['slotId'],\n slotRef.nativeElement,\n ]),\n );\n\n const projectedTiles = this._host.nativeElement.querySelectorAll(\n '[data-tile-id]',\n ) as NodeListOf<HTMLElement>;\n\n for (const tileContent of projectedTiles) {\n const tileId = tileContent.dataset['tileId'];\n const slot = slots.get(tileId);\n\n if (slot && tileContent.parentElement !== slot) {\n slot.appendChild(tileContent);\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAiCA;;;;;;;;;AASG;MAkDU,yBAAyB,CAAA;AACnB,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAA4B;AAE7D,IAAA,KAAK,GAAG,KAAK,CAA2B,EAAE,4EAAC;AAC3C,IAAA,OAAO,GAAG,KAAK,CAAS,CAAC,8EAAC;;IAG1B,WAAW,GAAG,MAAM,EAA4B;AAEhD,IAAA,aAAa,GAAG,MAAM,CAA2B,EAAE,oFAAC;AACpD,IAAA,UAAU,GAAG,YAAY,CAA0B,UAAU,iFAAC;AAEvE,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE;AACtB,YAAA,SAAS,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjD,QAAA,CAAC,CAAC;QAEF,MAAM,CAAC,MAAK;YACV,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,UAAU,EAAE;YACjB,cAAc,CAAC,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC;AACpD,QAAA,CAAC,CAAC;IACJ;AAEA,IAAA,OAAO,CAAC,KAA4C,EAAA;QAClD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACvC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAA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,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,EAAA,iBAAA,EAAA,wBAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,4BAAA,EAAA,2BAAA,EAAA,0BAAA,EAAA,+BAAA,EAAA,2BAAA,EAAA,6BAAA,EAAA,sBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,oBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FA+CvD,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAjDrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,WACrB,CAAC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,CAAC,EAAA,aAAA,EACpD,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,QAAQ;AACf,wBAAA,uBAAuB,EAAE,WAAW;qBACrC,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,wkDAAA,CAAA,EAAA;wVAa2D,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACtGxE;;AAEG;;;;"}
1
+ {"version":3,"file":"neural-ui-core-dashboard-grid.mjs","sources":["../../../../projects/ui-core/dashboard-grid/neu-dashboard-grid.component.ts","../../../../projects/ui-core/dashboard-grid/neural-ui-core-dashboard-grid.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n CdkDrag,\n CdkDragDrop,\n CdkDragPlaceholder,\n CdkDragPreview,\n CdkDropList,\n moveItemInArray,\n} from '@angular/cdk/drag-drop';\n\nexport interface NeuDashboardTileConfig {\n /** Identificador único / Unique identifier */\n id: string;\n /** Número de columnas que ocupa / Column span */\n cols?: number;\n /** Número de filas que ocupa / Row span */\n rows?: number;\n /** Título del tile / Tile title */\n title?: string;\n}\n\n/**\n * NeuralUI DashboardGrid\n *\n * Cuadrícula de tiles reordenables mediante drag-and-drop (CDK DragDrop).\n *\n * Uso:\n * <neu-dashboard-grid [tiles]=\"tileConfigs\" [columns]=\"3\">\n * <ng-template neuDashboardTile id=\"tile-1\">...</ng-template>\n * </neu-dashboard-grid>\n */\n@Component({\n selector: 'neu-dashboard-grid',\n imports: [CdkDrag, CdkDragPlaceholder, CdkDragPreview, CdkDropList],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'neu-dg',\n '[style.--neu-dg-cols]': 'columns()',\n },\n template: `\n <div class=\"neu-dg__projection-source\" aria-hidden=\"true\">\n <ng-content />\n </div>\n\n <div\n class=\"neu-dg__grid\"\n cdkDropList\n [cdkDropListData]=\"_orderedTiles()\"\n (cdkDropListDropped)=\"_onDrop($event)\"\n >\n @for (tile of _orderedTiles(); track tile.id) {\n <div\n class=\"neu-dg__tile\"\n cdkDrag\n [cdkDragData]=\"tile\"\n [style.--tile-cols]=\"tile.cols ?? 1\"\n [style.--tile-rows]=\"tile.rows ?? 1\"\n >\n <!-- Drag handle -->\n <div class=\"neu-dg__tile-handle\" cdkDragHandle>\n @if (tile.title) {\n <span class=\"neu-dg__tile-title\">{{ tile.title }}</span>\n }\n <span class=\"neu-dg__handle-icon\" aria-hidden=\"true\">⠿</span>\n </div>\n <!-- Drag placeholder -->\n <div *cdkDragPlaceholder class=\"neu-dg__placeholder\"></div>\n <!-- Drag preview -->\n <div *cdkDragPreview class=\"neu-dg__preview\">{{ tile.title ?? tile.id }}</div>\n <!-- Content slot -->\n <div class=\"neu-dg__tile-content\" tabindex=\"0\">\n <div class=\"neu-dg__tile-slot\" #tileSlot [attr.data-slot-id]=\"tile.id\"></div>\n </div>\n </div>\n }\n </div>\n `,\n styleUrl: './neu-dashboard-grid.component.scss',\n})\nexport class NeuDashboardGridComponent {\n private readonly _host = inject(ElementRef) as ElementRef<HTMLElement>;\n private readonly _platformId = inject(PLATFORM_ID);\n\n readonly tiles = input<NeuDashboardTileConfig[]>([]);\n readonly columns = input<number>(3);\n\n /** Emitido cuando el orden cambia / Emitted when order changes */\n readonly orderChange = output<NeuDashboardTileConfig[]>();\n\n readonly _orderedTiles = signal<NeuDashboardTileConfig[]>([]);\n readonly _tileSlots = viewChildren<ElementRef<HTMLElement>>('tileSlot');\n\n constructor() {\n effect(() => {\n const t = this.tiles();\n untracked(() => this._orderedTiles.set([...t]));\n });\n\n effect(() => {\n this._orderedTiles();\n this._tileSlots();\n if (isPlatformBrowser(this._platformId)) {\n queueMicrotask(() => this._attachProjectedTiles());\n }\n });\n }\n\n _onDrop(event: CdkDragDrop<NeuDashboardTileConfig[]>): void {\n const tiles = [...this._orderedTiles()];\n moveItemInArray(tiles, event.previousIndex, event.currentIndex);\n this._orderedTiles.set(tiles);\n this.orderChange.emit(tiles);\n }\n\n private _attachProjectedTiles(): void {\n if (!isPlatformBrowser(this._platformId)) return;\n const slots = new Map(\n this._tileSlots().filter(Boolean).map((slotRef) => [\n slotRef.nativeElement.dataset['slotId'],\n slotRef.nativeElement,\n ]),\n );\n\n const projectedTiles = this._host.nativeElement.querySelectorAll(\n '[data-tile-id]',\n ) as NodeListOf<HTMLElement>;\n\n for (const tileContent of projectedTiles) {\n const tileId = tileContent.dataset['tileId'];\n const slot = slots.get(tileId);\n\n if (slot && tileContent.parentElement !== slot) {\n slot.appendChild(tileContent);\n }\n }\n }\n}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