@weeehaoooz/talos-ui 0.1.1 → 0.1.2

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 (190) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/{weeehaoooz-talos-ui-button-button-group.mjs → weeehaoooz-talos-ui-button.mjs} +91 -15
  3. package/fesm2022/weeehaoooz-talos-ui-button.mjs.map +1 -0
  4. package/fesm2022/weeehaoooz-talos-ui-data-display.mjs +3110 -0
  5. package/fesm2022/weeehaoooz-talos-ui-data-display.mjs.map +1 -0
  6. package/fesm2022/weeehaoooz-talos-ui-data-viz.mjs +2414 -0
  7. package/fesm2022/weeehaoooz-talos-ui-data-viz.mjs.map +1 -0
  8. package/fesm2022/weeehaoooz-talos-ui-dropdown.mjs +1039 -0
  9. package/fesm2022/weeehaoooz-talos-ui-dropdown.mjs.map +1 -0
  10. package/fesm2022/weeehaoooz-talos-ui-feedback.mjs +2885 -0
  11. package/fesm2022/weeehaoooz-talos-ui-feedback.mjs.map +1 -0
  12. package/fesm2022/weeehaoooz-talos-ui-form.mjs +10799 -0
  13. package/fesm2022/weeehaoooz-talos-ui-form.mjs.map +1 -0
  14. package/fesm2022/weeehaoooz-talos-ui-layout.mjs +1316 -7
  15. package/fesm2022/weeehaoooz-talos-ui-layout.mjs.map +1 -1
  16. package/fesm2022/weeehaoooz-talos-ui-nav.mjs +3 -3
  17. package/fesm2022/weeehaoooz-talos-ui-nav.mjs.map +1 -1
  18. package/fesm2022/weeehaoooz-talos-ui.mjs +21592 -16293
  19. package/fesm2022/weeehaoooz-talos-ui.mjs.map +1 -1
  20. package/package.json +20 -139
  21. package/styles/_breadcrumb.scss +16 -0
  22. package/styles/_button-group.scss +2 -1
  23. package/styles/_buttons.scss +51 -0
  24. package/styles/_dropdown.scss +438 -0
  25. package/styles/_form-controls.scss +13 -0
  26. package/styles/_progress-bar.scss +43 -0
  27. package/styles/_skeleton.scss +176 -0
  28. package/styles/_spinner.scss +58 -0
  29. package/styles/_variables.scss +33 -0
  30. package/styles/index.scss +6 -1
  31. package/types/weeehaoooz-talos-ui-button.d.ts +92 -0
  32. package/types/weeehaoooz-talos-ui-button.d.ts.map +1 -0
  33. package/types/weeehaoooz-talos-ui-data-display.d.ts +1018 -0
  34. package/types/weeehaoooz-talos-ui-data-display.d.ts.map +1 -0
  35. package/types/weeehaoooz-talos-ui-data-viz.d.ts +839 -0
  36. package/types/weeehaoooz-talos-ui-data-viz.d.ts.map +1 -0
  37. package/types/weeehaoooz-talos-ui-dropdown.d.ts +187 -0
  38. package/types/weeehaoooz-talos-ui-dropdown.d.ts.map +1 -0
  39. package/types/weeehaoooz-talos-ui-feedback.d.ts +1495 -0
  40. package/types/weeehaoooz-talos-ui-feedback.d.ts.map +1 -0
  41. package/types/weeehaoooz-talos-ui-form.d.ts +2639 -0
  42. package/types/weeehaoooz-talos-ui-form.d.ts.map +1 -0
  43. package/types/weeehaoooz-talos-ui-layout.d.ts +851 -3
  44. package/types/weeehaoooz-talos-ui-layout.d.ts.map +1 -1
  45. package/types/weeehaoooz-talos-ui-nav.d.ts +1 -1
  46. package/types/weeehaoooz-talos-ui.d.ts +7148 -4629
  47. package/types/weeehaoooz-talos-ui.d.ts.map +1 -1
  48. package/fesm2022/weeehaoooz-talos-ui-button-button-group.mjs.map +0 -1
  49. package/fesm2022/weeehaoooz-talos-ui-button-button.mjs +0 -94
  50. package/fesm2022/weeehaoooz-talos-ui-button-button.mjs.map +0 -1
  51. package/fesm2022/weeehaoooz-talos-ui-data-display-badge.mjs +0 -233
  52. package/fesm2022/weeehaoooz-talos-ui-data-display-badge.mjs.map +0 -1
  53. package/fesm2022/weeehaoooz-talos-ui-data-display-data-grid.mjs +0 -1627
  54. package/fesm2022/weeehaoooz-talos-ui-data-display-data-grid.mjs.map +0 -1
  55. package/fesm2022/weeehaoooz-talos-ui-data-display-status-tag.mjs +0 -361
  56. package/fesm2022/weeehaoooz-talos-ui-data-display-status-tag.mjs.map +0 -1
  57. package/fesm2022/weeehaoooz-talos-ui-data-display-timeline.mjs +0 -312
  58. package/fesm2022/weeehaoooz-talos-ui-data-display-timeline.mjs.map +0 -1
  59. package/fesm2022/weeehaoooz-talos-ui-data-display-trend-indicator.mjs +0 -235
  60. package/fesm2022/weeehaoooz-talos-ui-data-display-trend-indicator.mjs.map +0 -1
  61. package/fesm2022/weeehaoooz-talos-ui-data-viz-category-bar.mjs +0 -462
  62. package/fesm2022/weeehaoooz-talos-ui-data-viz-category-bar.mjs.map +0 -1
  63. package/fesm2022/weeehaoooz-talos-ui-data-viz-heatmap.mjs +0 -805
  64. package/fesm2022/weeehaoooz-talos-ui-data-viz-heatmap.mjs.map +0 -1
  65. package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-donut.mjs +0 -267
  66. package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-donut.mjs.map +0 -1
  67. package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-gauge.mjs +0 -351
  68. package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-gauge.mjs.map +0 -1
  69. package/fesm2022/weeehaoooz-talos-ui-data-viz-sparkline.mjs +0 -566
  70. package/fesm2022/weeehaoooz-talos-ui-data-viz-sparkline.mjs.map +0 -1
  71. package/fesm2022/weeehaoooz-talos-ui-feedback-alert.mjs +0 -534
  72. package/fesm2022/weeehaoooz-talos-ui-feedback-alert.mjs.map +0 -1
  73. package/fesm2022/weeehaoooz-talos-ui-feedback-dialog.mjs +0 -446
  74. package/fesm2022/weeehaoooz-talos-ui-feedback-dialog.mjs.map +0 -1
  75. package/fesm2022/weeehaoooz-talos-ui-feedback-snackbar.mjs +0 -376
  76. package/fesm2022/weeehaoooz-talos-ui-feedback-snackbar.mjs.map +0 -1
  77. package/fesm2022/weeehaoooz-talos-ui-feedback-tooltip.mjs +0 -147
  78. package/fesm2022/weeehaoooz-talos-ui-feedback-tooltip.mjs.map +0 -1
  79. package/fesm2022/weeehaoooz-talos-ui-form-affix.mjs +0 -242
  80. package/fesm2022/weeehaoooz-talos-ui-form-affix.mjs.map +0 -1
  81. package/fesm2022/weeehaoooz-talos-ui-form-autocomplete.mjs +0 -514
  82. package/fesm2022/weeehaoooz-talos-ui-form-autocomplete.mjs.map +0 -1
  83. package/fesm2022/weeehaoooz-talos-ui-form-checkbox.mjs +0 -548
  84. package/fesm2022/weeehaoooz-talos-ui-form-checkbox.mjs.map +0 -1
  85. package/fesm2022/weeehaoooz-talos-ui-form-chips.mjs +0 -692
  86. package/fesm2022/weeehaoooz-talos-ui-form-chips.mjs.map +0 -1
  87. package/fesm2022/weeehaoooz-talos-ui-form-color-picker.mjs +0 -761
  88. package/fesm2022/weeehaoooz-talos-ui-form-color-picker.mjs.map +0 -1
  89. package/fesm2022/weeehaoooz-talos-ui-form-date-picker.mjs +0 -896
  90. package/fesm2022/weeehaoooz-talos-ui-form-date-picker.mjs.map +0 -1
  91. package/fesm2022/weeehaoooz-talos-ui-form-date-range-picker.mjs +0 -872
  92. package/fesm2022/weeehaoooz-talos-ui-form-date-range-picker.mjs.map +0 -1
  93. package/fesm2022/weeehaoooz-talos-ui-form-date-time-picker.mjs +0 -119
  94. package/fesm2022/weeehaoooz-talos-ui-form-date-time-picker.mjs.map +0 -1
  95. package/fesm2022/weeehaoooz-talos-ui-form-date-time-range-picker.mjs +0 -135
  96. package/fesm2022/weeehaoooz-talos-ui-form-date-time-range-picker.mjs.map +0 -1
  97. package/fesm2022/weeehaoooz-talos-ui-form-drop-zone.mjs +0 -666
  98. package/fesm2022/weeehaoooz-talos-ui-form-drop-zone.mjs.map +0 -1
  99. package/fesm2022/weeehaoooz-talos-ui-form-form-field.mjs +0 -147
  100. package/fesm2022/weeehaoooz-talos-ui-form-form-field.mjs.map +0 -1
  101. package/fesm2022/weeehaoooz-talos-ui-form-input.mjs +0 -33
  102. package/fesm2022/weeehaoooz-talos-ui-form-input.mjs.map +0 -1
  103. package/fesm2022/weeehaoooz-talos-ui-form-otp.mjs +0 -455
  104. package/fesm2022/weeehaoooz-talos-ui-form-otp.mjs.map +0 -1
  105. package/fesm2022/weeehaoooz-talos-ui-form-password-input.mjs +0 -379
  106. package/fesm2022/weeehaoooz-talos-ui-form-password-input.mjs.map +0 -1
  107. package/fesm2022/weeehaoooz-talos-ui-form-radio.mjs +0 -297
  108. package/fesm2022/weeehaoooz-talos-ui-form-radio.mjs.map +0 -1
  109. package/fesm2022/weeehaoooz-talos-ui-form-range-input.mjs +0 -661
  110. package/fesm2022/weeehaoooz-talos-ui-form-range-input.mjs.map +0 -1
  111. package/fesm2022/weeehaoooz-talos-ui-form-rating.mjs +0 -346
  112. package/fesm2022/weeehaoooz-talos-ui-form-rating.mjs.map +0 -1
  113. package/fesm2022/weeehaoooz-talos-ui-form-select-input.mjs +0 -896
  114. package/fesm2022/weeehaoooz-talos-ui-form-select-input.mjs.map +0 -1
  115. package/fesm2022/weeehaoooz-talos-ui-form-slide-toggle.mjs +0 -252
  116. package/fesm2022/weeehaoooz-talos-ui-form-slide-toggle.mjs.map +0 -1
  117. package/fesm2022/weeehaoooz-talos-ui-form-transfer-list.mjs +0 -916
  118. package/fesm2022/weeehaoooz-talos-ui-form-transfer-list.mjs.map +0 -1
  119. package/types/weeehaoooz-talos-ui-button-button-group.d.ts +0 -62
  120. package/types/weeehaoooz-talos-ui-button-button-group.d.ts.map +0 -1
  121. package/types/weeehaoooz-talos-ui-button-button.d.ts +0 -38
  122. package/types/weeehaoooz-talos-ui-button-button.d.ts.map +0 -1
  123. package/types/weeehaoooz-talos-ui-data-display-badge.d.ts +0 -119
  124. package/types/weeehaoooz-talos-ui-data-display-badge.d.ts.map +0 -1
  125. package/types/weeehaoooz-talos-ui-data-display-data-grid.d.ts +0 -272
  126. package/types/weeehaoooz-talos-ui-data-display-data-grid.d.ts.map +0 -1
  127. package/types/weeehaoooz-talos-ui-data-display-status-tag.d.ts +0 -135
  128. package/types/weeehaoooz-talos-ui-data-display-status-tag.d.ts.map +0 -1
  129. package/types/weeehaoooz-talos-ui-data-display-timeline.d.ts +0 -144
  130. package/types/weeehaoooz-talos-ui-data-display-timeline.d.ts.map +0 -1
  131. package/types/weeehaoooz-talos-ui-data-display-trend-indicator.d.ts +0 -83
  132. package/types/weeehaoooz-talos-ui-data-display-trend-indicator.d.ts.map +0 -1
  133. package/types/weeehaoooz-talos-ui-data-viz-category-bar.d.ts +0 -255
  134. package/types/weeehaoooz-talos-ui-data-viz-category-bar.d.ts.map +0 -1
  135. package/types/weeehaoooz-talos-ui-data-viz-heatmap.d.ts +0 -204
  136. package/types/weeehaoooz-talos-ui-data-viz-heatmap.d.ts.map +0 -1
  137. package/types/weeehaoooz-talos-ui-data-viz-mini-donut.d.ts +0 -101
  138. package/types/weeehaoooz-talos-ui-data-viz-mini-donut.d.ts.map +0 -1
  139. package/types/weeehaoooz-talos-ui-data-viz-mini-gauge.d.ts +0 -138
  140. package/types/weeehaoooz-talos-ui-data-viz-mini-gauge.d.ts.map +0 -1
  141. package/types/weeehaoooz-talos-ui-data-viz-sparkline.d.ts +0 -161
  142. package/types/weeehaoooz-talos-ui-data-viz-sparkline.d.ts.map +0 -1
  143. package/types/weeehaoooz-talos-ui-feedback-alert.d.ts +0 -212
  144. package/types/weeehaoooz-talos-ui-feedback-alert.d.ts.map +0 -1
  145. package/types/weeehaoooz-talos-ui-feedback-dialog.d.ts +0 -259
  146. package/types/weeehaoooz-talos-ui-feedback-dialog.d.ts.map +0 -1
  147. package/types/weeehaoooz-talos-ui-feedback-snackbar.d.ts +0 -147
  148. package/types/weeehaoooz-talos-ui-feedback-snackbar.d.ts.map +0 -1
  149. package/types/weeehaoooz-talos-ui-feedback-tooltip.d.ts +0 -32
  150. package/types/weeehaoooz-talos-ui-feedback-tooltip.d.ts.map +0 -1
  151. package/types/weeehaoooz-talos-ui-form-affix.d.ts +0 -88
  152. package/types/weeehaoooz-talos-ui-form-affix.d.ts.map +0 -1
  153. package/types/weeehaoooz-talos-ui-form-autocomplete.d.ts +0 -113
  154. package/types/weeehaoooz-talos-ui-form-autocomplete.d.ts.map +0 -1
  155. package/types/weeehaoooz-talos-ui-form-checkbox.d.ts +0 -165
  156. package/types/weeehaoooz-talos-ui-form-checkbox.d.ts.map +0 -1
  157. package/types/weeehaoooz-talos-ui-form-chips.d.ts +0 -152
  158. package/types/weeehaoooz-talos-ui-form-chips.d.ts.map +0 -1
  159. package/types/weeehaoooz-talos-ui-form-color-picker.d.ts +0 -144
  160. package/types/weeehaoooz-talos-ui-form-color-picker.d.ts.map +0 -1
  161. package/types/weeehaoooz-talos-ui-form-date-picker.d.ts +0 -138
  162. package/types/weeehaoooz-talos-ui-form-date-picker.d.ts.map +0 -1
  163. package/types/weeehaoooz-talos-ui-form-date-range-picker.d.ts +0 -148
  164. package/types/weeehaoooz-talos-ui-form-date-range-picker.d.ts.map +0 -1
  165. package/types/weeehaoooz-talos-ui-form-date-time-picker.d.ts +0 -44
  166. package/types/weeehaoooz-talos-ui-form-date-time-picker.d.ts.map +0 -1
  167. package/types/weeehaoooz-talos-ui-form-date-time-range-picker.d.ts +0 -48
  168. package/types/weeehaoooz-talos-ui-form-date-time-range-picker.d.ts.map +0 -1
  169. package/types/weeehaoooz-talos-ui-form-drop-zone.d.ts +0 -227
  170. package/types/weeehaoooz-talos-ui-form-drop-zone.d.ts.map +0 -1
  171. package/types/weeehaoooz-talos-ui-form-form-field.d.ts +0 -42
  172. package/types/weeehaoooz-talos-ui-form-form-field.d.ts.map +0 -1
  173. package/types/weeehaoooz-talos-ui-form-input.d.ts +0 -15
  174. package/types/weeehaoooz-talos-ui-form-input.d.ts.map +0 -1
  175. package/types/weeehaoooz-talos-ui-form-otp.d.ts +0 -111
  176. package/types/weeehaoooz-talos-ui-form-otp.d.ts.map +0 -1
  177. package/types/weeehaoooz-talos-ui-form-password-input.d.ts +0 -145
  178. package/types/weeehaoooz-talos-ui-form-password-input.d.ts.map +0 -1
  179. package/types/weeehaoooz-talos-ui-form-radio.d.ts +0 -84
  180. package/types/weeehaoooz-talos-ui-form-radio.d.ts.map +0 -1
  181. package/types/weeehaoooz-talos-ui-form-range-input.d.ts +0 -181
  182. package/types/weeehaoooz-talos-ui-form-range-input.d.ts.map +0 -1
  183. package/types/weeehaoooz-talos-ui-form-rating.d.ts +0 -110
  184. package/types/weeehaoooz-talos-ui-form-rating.d.ts.map +0 -1
  185. package/types/weeehaoooz-talos-ui-form-select-input.d.ts +0 -195
  186. package/types/weeehaoooz-talos-ui-form-select-input.d.ts.map +0 -1
  187. package/types/weeehaoooz-talos-ui-form-slide-toggle.d.ts +0 -79
  188. package/types/weeehaoooz-talos-ui-form-slide-toggle.d.ts.map +0 -1
  189. package/types/weeehaoooz-talos-ui-form-transfer-list.d.ts +0 -192
  190. package/types/weeehaoooz-talos-ui-form-transfer-list.d.ts.map +0 -1
@@ -1,566 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, output, signal, computed, afterNextRender, DestroyRef, Component, NgModule } from '@angular/core';
3
-
4
- /**
5
- * Types and interfaces for TalosSparklineComponent
6
- */
7
- const GOLDEN_RATIO = 1.618;
8
-
9
- const PRESET_PALETTES = {
10
- primary: { stroke: '#2563eb', fillStart: 'rgba(37, 99, 235, 0.35)', fillEnd: 'rgba(37, 99, 235, 0.0)' },
11
- blue: { stroke: '#3b82f6', fillStart: 'rgba(59, 130, 246, 0.35)', fillEnd: 'rgba(59, 130, 246, 0.0)' },
12
- success: { stroke: '#16a34a', fillStart: 'rgba(22, 163, 74, 0.35)', fillEnd: 'rgba(22, 163, 74, 0.0)' },
13
- emerald: { stroke: '#10b981', fillStart: 'rgba(16, 185, 129, 0.35)', fillEnd: 'rgba(16, 185, 129, 0.0)' },
14
- danger: { stroke: '#ef4444', fillStart: 'rgba(239, 68, 68, 0.35)', fillEnd: 'rgba(239, 68, 68, 0.0)' },
15
- rose: { stroke: '#f43f5e', fillStart: 'rgba(244, 63, 94, 0.35)', fillEnd: 'rgba(244, 63, 94, 0.0)' },
16
- warning: { stroke: '#f59e0b', fillStart: 'rgba(245, 158, 11, 0.35)', fillEnd: 'rgba(245, 158, 11, 0.0)' },
17
- amber: { stroke: '#d97706', fillStart: 'rgba(217, 119, 6, 0.35)', fillEnd: 'rgba(217, 119, 6, 0.0)' },
18
- info: { stroke: '#0284c7', fillStart: 'rgba(2, 132, 199, 0.35)', fillEnd: 'rgba(2, 132, 199, 0.0)' },
19
- cyan: { stroke: '#06b6d4', fillStart: 'rgba(6, 182, 212, 0.35)', fillEnd: 'rgba(6, 182, 212, 0.0)' },
20
- violet: { stroke: '#8b5cf6', fillStart: 'rgba(139, 92, 246, 0.35)', fillEnd: 'rgba(139, 92, 246, 0.0)' },
21
- slate: { stroke: '#64748b', fillStart: 'rgba(100, 116, 139, 0.3)', fillEnd: 'rgba(100, 116, 139, 0.0)' }
22
- };
23
- // Golden Ratio (~1.618:1) and proportional defaults
24
- const DEFAULT_SIZE_DIMENSIONS = {
25
- xs: { width: 64, height: 40 },
26
- sm: { width: 96, height: 60 },
27
- md: { width: 130, height: 80 },
28
- lg: { width: 180, height: 110 },
29
- responsive: { width: 240, height: 60 },
30
- custom: { width: 130, height: 80 }
31
- };
32
- let uniqueIdCounter = 0;
33
- class TalosSparklineComponent {
34
- elementRef = inject(ElementRef);
35
- resizeObserver;
36
- /** Data points (numbers or objects) */
37
- data = input([], /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
39
- /** Chart type: line, area, or bar */
40
- type = input('area', /* @ts-ignore */
41
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
42
- /** Visual color theme or custom hex code */
43
- color = input('primary', /* @ts-ignore */
44
- ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
45
- /** Automatically choose green/red based on first -> last delta */
46
- autoColorTrend = input(false, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "autoColorTrend" }] : /* istanbul ignore next */ []));
48
- /** Smooth Bezier interpolation vs straight line */
49
- smooth = input(true, /* @ts-ignore */
50
- ...(ngDevMode ? [{ debugName: "smooth" }] : /* istanbul ignore next */ []));
51
- /** Stroke line width */
52
- strokeWidth = input(2, /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "strokeWidth" }] : /* istanbul ignore next */ []));
54
- /** Marker dots display mode */
55
- showMarkers = input('none', /* @ts-ignore */
56
- ...(ngDevMode ? [{ debugName: "showMarkers" }] : /* istanbul ignore next */ []));
57
- /** Marker circle radius */
58
- markerRadius = input(3.5, /* @ts-ignore */
59
- ...(ngDevMode ? [{ debugName: "markerRadius" }] : /* istanbul ignore next */ []));
60
- /** Optional reference horizontal baseline */
61
- referenceValue = input(null, /* @ts-ignore */
62
- ...(ngDevMode ? [{ debugName: "referenceValue" }] : /* istanbul ignore next */ []));
63
- /** Show interactive hover tooltip */
64
- showTooltip = input(true, /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "showTooltip" }] : /* istanbul ignore next */ []));
66
- /** Interactive mouse events enabled */
67
- interactive = input(true, /* @ts-ignore */
68
- ...(ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []));
69
- /** Gap between bars for bar sparklines */
70
- barGap = input(3, /* @ts-ignore */
71
- ...(ngDevMode ? [{ debugName: "barGap" }] : /* istanbul ignore next */ []));
72
- /** Corner radius for bars */
73
- barRadius = input(2, /* @ts-ignore */
74
- ...(ngDevMode ? [{ debugName: "barRadius" }] : /* istanbul ignore next */ []));
75
- /** Preset size */
76
- size = input('md', /* @ts-ignore */
77
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
78
- /** Aspect ratio configuration (e.g. 'golden', 1.618, '2:1', '16:9') */
79
- aspectRatio = input(null, /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "aspectRatio" }] : /* istanbul ignore next */ []));
81
- /** Custom width override (e.g. '120px' or '100%') */
82
- width = input(null, /* @ts-ignore */
83
- ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
84
- /** Custom height override (e.g. '36px') */
85
- height = input(null, /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
87
- /** Explicit minimum value bounds */
88
- min = input(null, /* @ts-ignore */
89
- ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
90
- /** Explicit maximum value bounds */
91
- max = input(null, /* @ts-ignore */
92
- ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
93
- /** Custom accessible label */
94
- ariaLabel = input(null, /* @ts-ignore */
95
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
96
- /** Value formatter for tooltip */
97
- valueFormatter = input((val) => val.toLocaleString(), /* @ts-ignore */
98
- ...(ngDevMode ? [{ debugName: "valueFormatter" }] : /* istanbul ignore next */ []));
99
- /** Hover event emitter */
100
- pointHover = output();
101
- /** Click event emitter */
102
- pointClick = output();
103
- // Unique ID for SVG linear gradient IDs
104
- gradientId = `talos-sparkline-grad-${++uniqueIdCounter}`;
105
- // Interactive hover state
106
- hoveredPoint = signal(null, /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "hoveredPoint" }] : /* istanbul ignore next */ []));
108
- isHovering = signal(false, /* @ts-ignore */
109
- ...(ngDevMode ? [{ debugName: "isHovering" }] : /* istanbul ignore next */ []));
110
- // Dynamic container dimensions for 1:1 SVG coordinate rendering (prevents non-uniform stretching)
111
- containerWidth = signal(120, /* @ts-ignore */
112
- ...(ngDevMode ? [{ debugName: "containerWidth" }] : /* istanbul ignore next */ []));
113
- containerHeight = signal(36, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "containerHeight" }] : /* istanbul ignore next */ []));
115
- svgWidth = computed(() => this.containerWidth(), /* @ts-ignore */
116
- ...(ngDevMode ? [{ debugName: "svgWidth" }] : /* istanbul ignore next */ []));
117
- svgHeight = computed(() => this.containerHeight(), /* @ts-ignore */
118
- ...(ngDevMode ? [{ debugName: "svgHeight" }] : /* istanbul ignore next */ []));
119
- padding = computed(() => {
120
- if (this.type() === 'bar')
121
- return 2;
122
- if (this.showMarkers() !== 'none' || this.interactive())
123
- return 5;
124
- return 3;
125
- }, /* @ts-ignore */
126
- ...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
127
- constructor() {
128
- afterNextRender(() => {
129
- this.updateDimensions();
130
- if (typeof ResizeObserver !== 'undefined') {
131
- this.resizeObserver = new ResizeObserver((entries) => {
132
- for (const entry of entries) {
133
- const { width, height } = entry.contentRect;
134
- if (width > 0 && height > 0) {
135
- this.containerWidth.set(Math.round(width));
136
- this.containerHeight.set(Math.round(height));
137
- }
138
- }
139
- });
140
- this.resizeObserver.observe(this.elementRef.nativeElement);
141
- }
142
- });
143
- inject(DestroyRef).onDestroy(() => {
144
- this.resizeObserver?.disconnect();
145
- });
146
- }
147
- updateDimensions() {
148
- const el = this.elementRef.nativeElement;
149
- const rect = el.getBoundingClientRect();
150
- if (rect.width > 0 && rect.height > 0) {
151
- this.containerWidth.set(Math.round(rect.width));
152
- this.containerHeight.set(Math.round(rect.height));
153
- }
154
- else {
155
- const defaultDims = DEFAULT_SIZE_DIMENSIONS[this.size()] || DEFAULT_SIZE_DIMENSIONS.md;
156
- this.containerWidth.set(defaultDims.width);
157
- this.containerHeight.set(defaultDims.height);
158
- }
159
- }
160
- /** Host styles */
161
- hostWidth = computed(() => {
162
- const custom = this.width();
163
- if (custom !== null)
164
- return typeof custom === 'number' ? `${custom}px` : custom;
165
- return null;
166
- }, /* @ts-ignore */
167
- ...(ngDevMode ? [{ debugName: "hostWidth" }] : /* istanbul ignore next */ []));
168
- hostHeight = computed(() => {
169
- const custom = this.height();
170
- if (custom !== null)
171
- return typeof custom === 'number' ? `${custom}px` : custom;
172
- return null;
173
- }, /* @ts-ignore */
174
- ...(ngDevMode ? [{ debugName: "hostHeight" }] : /* istanbul ignore next */ []));
175
- computedAspectRatio = computed(() => {
176
- const ar = this.aspectRatio();
177
- if (ar === 'golden')
178
- return `${GOLDEN_RATIO} / 1`;
179
- if (typeof ar === 'number')
180
- return `${ar} / 1`;
181
- if (typeof ar === 'string') {
182
- if (ar.includes(':')) {
183
- const [w, h] = ar.split(':');
184
- return `${w.trim()} / ${h.trim()}`;
185
- }
186
- return ar;
187
- }
188
- return null;
189
- }, /* @ts-ignore */
190
- ...(ngDevMode ? [{ debugName: "computedAspectRatio" }] : /* istanbul ignore next */ []));
191
- /** Normalized points array */
192
- normalizedPoints = computed(() => {
193
- const raw = this.data();
194
- if (!raw || raw.length === 0)
195
- return [];
196
- return raw.map((item, idx) => {
197
- if (typeof item === 'number') {
198
- return { value: item };
199
- }
200
- return item;
201
- });
202
- }, /* @ts-ignore */
203
- ...(ngDevMode ? [{ debugName: "normalizedPoints" }] : /* istanbul ignore next */ []));
204
- /** Determine effective color palette */
205
- effectiveColor = computed(() => {
206
- if (this.autoColorTrend()) {
207
- const pts = this.normalizedPoints();
208
- if (pts.length >= 2) {
209
- const first = pts[0].value;
210
- const last = pts[pts.length - 1].value;
211
- if (last >= first) {
212
- return PRESET_PALETTES['success'];
213
- }
214
- else {
215
- return PRESET_PALETTES['danger'];
216
- }
217
- }
218
- }
219
- const c = this.color();
220
- if (PRESET_PALETTES[c]) {
221
- return PRESET_PALETTES[c];
222
- }
223
- // Custom hex/rgb
224
- return {
225
- stroke: c,
226
- fillStart: c.startsWith('#') ? `${c}40` : 'rgba(37, 99, 235, 0.3)',
227
- fillEnd: c.startsWith('#') ? `${c}00` : 'rgba(37, 99, 235, 0.0)'
228
- };
229
- }, /* @ts-ignore */
230
- ...(ngDevMode ? [{ debugName: "effectiveColor" }] : /* istanbul ignore next */ []));
231
- /** Min & Max calculation */
232
- valueBounds = computed(() => {
233
- const pts = this.normalizedPoints();
234
- if (pts.length === 0)
235
- return { min: 0, max: 100, span: 100, rawMin: 0, rawMax: 100 };
236
- let calculatedMin = pts[0].value;
237
- let calculatedMax = pts[0].value;
238
- for (const p of pts) {
239
- if (p.value < calculatedMin)
240
- calculatedMin = p.value;
241
- if (p.value > calculatedMax)
242
- calculatedMax = p.value;
243
- }
244
- // Include reference value if set
245
- const ref = this.referenceValue();
246
- if (ref !== null) {
247
- if (ref < calculatedMin)
248
- calculatedMin = ref;
249
- if (ref > calculatedMax)
250
- calculatedMax = ref;
251
- }
252
- // Explicit override
253
- const explicitMin = this.min();
254
- const explicitMax = this.max();
255
- const finalMin = explicitMin !== null ? explicitMin : calculatedMin;
256
- const finalMax = explicitMax !== null ? explicitMax : calculatedMax;
257
- // Prevent divide by zero if constant value
258
- const span = finalMax === finalMin ? 1 : finalMax - finalMin;
259
- return { min: finalMin, max: finalMax, span, rawMin: calculatedMin, rawMax: calculatedMax };
260
- }, /* @ts-ignore */
261
- ...(ngDevMode ? [{ debugName: "valueBounds" }] : /* istanbul ignore next */ []));
262
- /** Computed internal points with SVG coordinates */
263
- internalPoints = computed(() => {
264
- const pts = this.normalizedPoints();
265
- if (pts.length === 0)
266
- return [];
267
- const { min, span, rawMin, rawMax } = this.valueBounds();
268
- const w = this.svgWidth();
269
- const h = this.svgHeight();
270
- const p = this.padding();
271
- const availableW = Math.max(1, w - p * 2);
272
- const availableH = Math.max(1, h - p * 2);
273
- const count = pts.length;
274
- const stepX = count > 1 ? availableW / (count - 1) : availableW / 2;
275
- return pts.map((pt, idx) => {
276
- const x = count === 1 ? w / 2 : p + idx * stepX;
277
- // Invert Y because SVG 0 is top
278
- const normalizedRatio = (pt.value - min) / span;
279
- const y = h - p - normalizedRatio * availableH;
280
- return {
281
- index: idx,
282
- value: pt.value,
283
- label: pt.label,
284
- date: pt.date,
285
- x,
286
- y,
287
- color: pt.color,
288
- isMin: pt.value === rawMin,
289
- isMax: pt.value === rawMax,
290
- isFirst: idx === 0,
291
- isLast: idx === count - 1
292
- };
293
- });
294
- }, /* @ts-ignore */
295
- ...(ngDevMode ? [{ debugName: "internalPoints" }] : /* istanbul ignore next */ []));
296
- /** SVG Path line data */
297
- linePath = computed(() => {
298
- const pts = this.internalPoints();
299
- if (pts.length < 2)
300
- return '';
301
- if (!this.smooth()) {
302
- return pts.map((p, idx) => `${idx === 0 ? 'M' : 'L'} ${p.x.toFixed(2)} ${p.y.toFixed(2)}`).join(' ');
303
- }
304
- // Smooth Bezier Curve (Catmull-Rom or Monotone-like control points)
305
- let d = `M ${pts[0].x.toFixed(2)} ${pts[0].y.toFixed(2)}`;
306
- for (let i = 0; i < pts.length - 1; i++) {
307
- const p0 = i > 0 ? pts[i - 1] : pts[i];
308
- const p1 = pts[i];
309
- const p2 = pts[i + 1];
310
- const p3 = i < pts.length - 2 ? pts[i + 2] : p2;
311
- const cp1x = p1.x + (p2.x - p0.x) / 6;
312
- const cp1y = p1.y + (p2.y - p0.y) / 6;
313
- const cp2x = p2.x - (p3.x - p1.x) / 6;
314
- const cp2y = p2.y - (p3.y - p1.y) / 6;
315
- d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${p2.x.toFixed(2)} ${p2.y.toFixed(2)}`;
316
- }
317
- return d;
318
- }, /* @ts-ignore */
319
- ...(ngDevMode ? [{ debugName: "linePath" }] : /* istanbul ignore next */ []));
320
- /** SVG Area path (closed polygon under curve) */
321
- areaPath = computed(() => {
322
- const line = this.linePath();
323
- const pts = this.internalPoints();
324
- if (!line || pts.length < 2)
325
- return '';
326
- const lastPt = pts[pts.length - 1];
327
- const firstPt = pts[0];
328
- const baselineY = this.svgHeight();
329
- return `${line} L ${lastPt.x.toFixed(2)} ${baselineY} L ${firstPt.x.toFixed(2)} ${baselineY} Z`;
330
- }, /* @ts-ignore */
331
- ...(ngDevMode ? [{ debugName: "areaPath" }] : /* istanbul ignore next */ []));
332
- /** Bar chart segments */
333
- barSegments = computed(() => {
334
- const pts = this.normalizedPoints();
335
- if (pts.length === 0)
336
- return [];
337
- const explicitMin = this.min();
338
- const explicitMax = this.max();
339
- const { rawMin, rawMax } = this.valueBounds();
340
- // For bar charts, default baseline is 0 unless min is explicitly provided
341
- const barMin = explicitMin !== null ? explicitMin : Math.min(0, rawMin);
342
- const barMax = explicitMax !== null ? explicitMax : Math.max(0, rawMax);
343
- const barSpan = barMax === barMin ? (barMax !== 0 ? Math.abs(barMax) : 1) : barMax - barMin;
344
- const w = this.svgWidth();
345
- const h = this.svgHeight();
346
- const p = this.padding();
347
- const gap = this.barGap();
348
- const count = pts.length;
349
- const availableW = Math.max(1, w - p * 2);
350
- const totalGaps = (count - 1) * gap;
351
- const barW = Math.max(2, (availableW - totalGaps) / count);
352
- const availableH = Math.max(1, h - p * 2);
353
- const baseColor = this.effectiveColor().stroke;
354
- // Calculate Y position of zero baseline
355
- const zeroRatio = Math.max(0, Math.min(1, (0 - barMin) / barSpan));
356
- const zeroY = h - p - zeroRatio * availableH;
357
- return pts.map((pt, idx) => {
358
- const x = p + idx * (barW + gap);
359
- const val = pt.value;
360
- let y;
361
- let barH;
362
- if (barMin >= 0) {
363
- // All positive (standard case)
364
- const ratio = Math.max(0, Math.min(1, (val - barMin) / barSpan));
365
- barH = Math.max(2, ratio * availableH);
366
- y = h - p - barH;
367
- }
368
- else if (barMax <= 0) {
369
- // All negative
370
- const ratio = Math.max(0, Math.min(1, Math.abs(val) / barSpan));
371
- barH = Math.max(2, ratio * availableH);
372
- y = p;
373
- }
374
- else {
375
- // Mixed positive & negative values around zero baseline
376
- if (val >= 0) {
377
- const ratio = Math.min(1, val / barSpan);
378
- barH = Math.max(2, ratio * availableH);
379
- y = zeroY - barH;
380
- }
381
- else {
382
- const ratio = Math.min(1, Math.abs(val) / barSpan);
383
- barH = Math.max(2, ratio * availableH);
384
- y = zeroY;
385
- }
386
- }
387
- return {
388
- index: idx,
389
- value: pt.value,
390
- label: pt.label,
391
- x,
392
- y,
393
- width: barW,
394
- height: barH,
395
- color: pt.color || baseColor
396
- };
397
- });
398
- }, /* @ts-ignore */
399
- ...(ngDevMode ? [{ debugName: "barSegments" }] : /* istanbul ignore next */ []));
400
- /** Highlight markers based on showMarkers input */
401
- markersToRender = computed(() => {
402
- const mode = this.showMarkers();
403
- if (mode === 'none')
404
- return [];
405
- const pts = this.internalPoints();
406
- switch (mode) {
407
- case 'all':
408
- return pts;
409
- case 'endpoints':
410
- return pts.filter((p) => p.isFirst || p.isLast);
411
- case 'min-max':
412
- return pts.filter((p) => p.isMin || p.isMax);
413
- case 'last':
414
- return pts.length > 0 ? [pts[pts.length - 1]] : [];
415
- default:
416
- return [];
417
- }
418
- }, /* @ts-ignore */
419
- ...(ngDevMode ? [{ debugName: "markersToRender" }] : /* istanbul ignore next */ []));
420
- /** Reference baseline Y coordinate */
421
- referenceLineY = computed(() => {
422
- const ref = this.referenceValue();
423
- if (ref === null)
424
- return null;
425
- const { min, span } = this.valueBounds();
426
- const h = this.svgHeight();
427
- const p = this.padding();
428
- const availableH = Math.max(1, h - p * 2);
429
- const ratio = (ref - min) / span;
430
- return h - p - ratio * availableH;
431
- }, /* @ts-ignore */
432
- ...(ngDevMode ? [{ debugName: "referenceLineY" }] : /* istanbul ignore next */ []));
433
- /** Aria label for accessibility */
434
- computedAriaLabel = computed(() => {
435
- const custom = this.ariaLabel();
436
- if (custom)
437
- return custom;
438
- const pts = this.normalizedPoints();
439
- if (pts.length === 0)
440
- return 'Empty sparkline';
441
- const first = pts[0].value;
442
- const last = pts[pts.length - 1].value;
443
- const delta = last - first;
444
- const direction = delta >= 0 ? 'increased' : 'decreased';
445
- return `Sparkline trend: ${first} to ${last} (${direction} by ${Math.abs(delta).toFixed(1)})`;
446
- }, /* @ts-ignore */
447
- ...(ngDevMode ? [{ debugName: "computedAriaLabel" }] : /* istanbul ignore next */ []));
448
- /** Handle mouse move for interactive hover tracking */
449
- onMouseMove(event) {
450
- if (!this.interactive())
451
- return;
452
- const rect = this.elementRef.nativeElement.getBoundingClientRect();
453
- const mouseX = event.clientX - rect.left;
454
- if (this.type() === 'bar') {
455
- const bars = this.barSegments();
456
- if (bars.length === 0)
457
- return;
458
- let nearest = bars[0];
459
- let minDistance = Math.abs(bars[0].x + bars[0].width / 2 - mouseX);
460
- for (let i = 1; i < bars.length; i++) {
461
- const centerX = bars[i].x + bars[i].width / 2;
462
- const dist = Math.abs(centerX - mouseX);
463
- if (dist < minDistance) {
464
- minDistance = dist;
465
- nearest = bars[i];
466
- }
467
- }
468
- const point = {
469
- index: nearest.index,
470
- value: nearest.value,
471
- label: nearest.label,
472
- x: Math.round(nearest.x + nearest.width / 2),
473
- y: nearest.y
474
- };
475
- this.hoveredPoint.set(point);
476
- this.isHovering.set(true);
477
- this.pointHover.emit({
478
- index: nearest.index,
479
- value: nearest.value,
480
- label: nearest.label,
481
- x: point.x,
482
- y: point.y
483
- });
484
- return;
485
- }
486
- const pts = this.internalPoints();
487
- if (pts.length === 0)
488
- return;
489
- // Find nearest point based on direct pixel coordinate
490
- let nearest = pts[0];
491
- let minDistance = Math.abs(pts[0].x - mouseX);
492
- for (let i = 1; i < pts.length; i++) {
493
- const dist = Math.abs(pts[i].x - mouseX);
494
- if (dist < minDistance) {
495
- minDistance = dist;
496
- nearest = pts[i];
497
- }
498
- }
499
- this.hoveredPoint.set(nearest);
500
- this.isHovering.set(true);
501
- this.pointHover.emit({
502
- index: nearest.index,
503
- value: nearest.value,
504
- label: nearest.label,
505
- x: nearest.x,
506
- y: nearest.y
507
- });
508
- }
509
- /** Handle mouse leave */
510
- onMouseLeave() {
511
- if (!this.interactive())
512
- return;
513
- this.hoveredPoint.set(null);
514
- this.isHovering.set(false);
515
- this.pointHover.emit(null);
516
- }
517
- /** Handle point click */
518
- onPointClick(point) {
519
- const x = 'width' in point ? Math.round(point.x + point.width / 2) : ('x' in point ? point.x : 0);
520
- this.pointClick.emit({
521
- index: point.index,
522
- value: point.value,
523
- label: point.label,
524
- x,
525
- y: 'y' in point ? point.y : 0
526
- });
527
- }
528
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSparklineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
529
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosSparklineComponent, isStandalone: true, selector: "talos-sparkline", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, autoColorTrend: { classPropertyName: "autoColorTrend", publicName: "autoColorTrend", isSignal: true, isRequired: false, transformFunction: null }, smooth: { classPropertyName: "smooth", publicName: "smooth", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, markerRadius: { classPropertyName: "markerRadius", publicName: "markerRadius", isSignal: true, isRequired: false, transformFunction: null }, referenceValue: { classPropertyName: "referenceValue", publicName: "referenceValue", isSignal: true, isRequired: false, transformFunction: null }, showTooltip: { classPropertyName: "showTooltip", publicName: "showTooltip", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, barGap: { classPropertyName: "barGap", publicName: "barGap", isSignal: true, isRequired: false, transformFunction: null }, barRadius: { classPropertyName: "barRadius", publicName: "barRadius", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, aspectRatio: { classPropertyName: "aspectRatio", publicName: "aspectRatio", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, valueFormatter: { classPropertyName: "valueFormatter", publicName: "valueFormatter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointHover: "pointHover", pointClick: "pointClick" }, host: { properties: { "class.talos-sparkline-xs": "size() === \"xs\"", "class.talos-sparkline-sm": "size() === \"sm\"", "class.talos-sparkline-md": "size() === \"md\"", "class.talos-sparkline-lg": "size() === \"lg\"", "class.talos-sparkline-responsive": "size() === \"responsive\"", "style.width": "hostWidth()", "style.height": "hostHeight()", "style.aspectRatio": "computedAspectRatio()", "attr.role": "\"img\"", "attr.aria-label": "computedAriaLabel()" }, classAttribute: "talos-sparkline" }, ngImport: i0, template: "<svg\n class=\"talos-sparkline-svg\"\n [attr.viewBox]=\"'0 0 ' + svgWidth() + ' ' + svgHeight()\"\n (mousemove)=\"onMouseMove($event)\"\n (mouseleave)=\"onMouseLeave()\"\n aria-hidden=\"true\"\n>\n <defs>\n <linearGradient [id]=\"gradientId\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" [attr.stop-color]=\"effectiveColor().fillStart\" />\n <stop offset=\"100%\" [attr.stop-color]=\"effectiveColor().fillEnd\" />\n </linearGradient>\n </defs>\n\n <!-- Reference Baseline (if provided) -->\n @if (referenceLineY() !== null) {\n <line\n class=\"talos-sparkline-reference-line\"\n [attr.x1]=\"0\"\n [attr.y1]=\"referenceLineY()\"\n [attr.x2]=\"svgWidth()\"\n [attr.y2]=\"referenceLineY()\"\n />\n }\n\n <!-- Chart Type: Area / Line -->\n @if (type() === 'area' || type() === 'line') {\n @if (type() === 'area' && areaPath()) {\n <path\n class=\"talos-sparkline-area\"\n [attr.d]=\"areaPath()\"\n [attr.fill]=\"'url(#' + gradientId + ')'\"\n />\n }\n\n @if (linePath()) {\n <path\n class=\"talos-sparkline-line\"\n [attr.d]=\"linePath()\"\n [attr.stroke]=\"effectiveColor().stroke\"\n [attr.stroke-width]=\"strokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n }\n }\n\n <!-- Chart Type: Bar -->\n @if (type() === 'bar') {\n @for (bar of barSegments(); track bar.index) {\n <rect\n class=\"talos-sparkline-bar\"\n [class.talos-sparkline-bar-hovered]=\"isHovering() && hoveredPoint()?.index === bar.index\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [attr.rx]=\"barRadius()\"\n [attr.ry]=\"barRadius()\"\n [attr.fill]=\"bar.color\"\n (click)=\"onPointClick(bar)\"\n />\n }\n }\n\n <!-- Highlight Markers -->\n @for (marker of markersToRender(); track marker.index) {\n <circle\n class=\"talos-sparkline-marker\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.r]=\"markerRadius()\"\n [attr.fill]=\"marker.color || effectiveColor().stroke\"\n [attr.stroke]=\"'#ffffff'\"\n [attr.stroke-width]=\"1.5\"\n (click)=\"onPointClick(marker)\"\n />\n }\n\n <!-- Interactive Hover Crosshair / Cursor Dot (Line/Area only) -->\n @if (type() !== 'bar' && isHovering() && hoveredPoint(); as pt) {\n <line\n class=\"talos-sparkline-cursor-line\"\n [attr.x1]=\"pt.x\"\n [attr.y1]=\"0\"\n [attr.x2]=\"pt.x\"\n [attr.y2]=\"svgHeight()\"\n />\n <circle\n class=\"talos-sparkline-hover-dot-outer\"\n [attr.cx]=\"pt.x\"\n [attr.cy]=\"pt.y\"\n [attr.r]=\"markerRadius() + 2.5\"\n [attr.fill]=\"effectiveColor().stroke\"\n opacity=\"0.25\"\n />\n <circle\n class=\"talos-sparkline-hover-dot\"\n [attr.cx]=\"pt.x\"\n [attr.cy]=\"pt.y\"\n [attr.r]=\"markerRadius() + 0.5\"\n [attr.fill]=\"effectiveColor().stroke\"\n stroke=\"#ffffff\"\n [attr.stroke-width]=\"1.5\"\n />\n }\n</svg>\n\n<!-- Floating Tooltip on Hover -->\n@if (showTooltip() && isHovering() && hoveredPoint(); as pt) {\n <div\n class=\"talos-sparkline-tooltip\"\n [style.left.px]=\"pt.x\"\n >\n @if (pt.label) {\n <span class=\"talos-sparkline-tooltip-label\">{{ pt.label }}</span>\n }\n <span class=\"talos-sparkline-tooltip-value\">{{ valueFormatter()(pt.value) }}</span>\n </div>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;overflow:visible;-webkit-user-select:none;user-select:none}:host.talos-sparkline-xs{width:64px;height:40px}:host.talos-sparkline-sm{width:96px;height:60px}:host.talos-sparkline-md{width:130px;height:80px}:host.talos-sparkline-lg{width:180px;height:110px}:host.talos-sparkline-responsive{display:block;width:100%;height:100%;min-height:48px}:host .talos-sparkline-svg{display:block;width:100%;height:100%;overflow:visible;cursor:crosshair}:host .talos-sparkline-area{transition:d .25s ease,opacity .2s ease}:host .talos-sparkline-line{transition:d .25s ease,stroke .2s ease}:host .talos-sparkline-bar{transition:height .2s ease,y .2s ease,opacity .15s ease,filter .15s ease;cursor:pointer}:host .talos-sparkline-bar:hover,:host .talos-sparkline-bar.talos-sparkline-bar-hovered{opacity:.85;filter:brightness(1.1)}:host .talos-sparkline-reference-line{stroke:var(--talos-border-hover, #94a3b8);stroke-width:1;stroke-dasharray:2 2;opacity:.65}:host .talos-sparkline-cursor-line{stroke:var(--talos-text-muted, #64748b);stroke-width:1;stroke-dasharray:2 2;opacity:.7;pointer-events:none}:host .talos-sparkline-marker{filter:drop-shadow(0 1px 2px rgba(0,0,0,.15));cursor:pointer;transition:transform .15s ease}:host .talos-sparkline-marker:hover{transform:scale(1.2)}:host .talos-sparkline-hover-dot{pointer-events:none;filter:drop-shadow(0 2px 4px rgba(0,0,0,.2))}:host .talos-sparkline-tooltip{position:absolute;bottom:calc(100% + 4px);transform:translate(-50%);pointer-events:none;z-index:30;display:flex;flex-direction:column;align-items:center;padding:2px 6px;border-radius:4px;background:var(--talos-text-color, #0f172a);color:var(--talos-card-bg, #ffffff);font-size:.6875rem;font-weight:600;line-height:1.2;white-space:nowrap;box-shadow:0 4px 6px -1px #00000026,0 2px 4px -2px #0000001a;animation:talosSparklineFadeIn .12s ease-out}:host .talos-sparkline-tooltip .talos-sparkline-tooltip-label{font-size:.625rem;font-weight:400;opacity:.8}:host .talos-sparkline-tooltip .talos-sparkline-tooltip-value{letter-spacing:-.01em}:host .talos-sparkline-tooltip:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border-width:3px;border-style:solid;border-color:var(--talos-text-color, #0f172a) transparent transparent transparent}@keyframes talosSparklineFadeIn{0%{opacity:0;transform:translate(-50%,2px)}to{opacity:1;transform:translate(-50%)}}\n"] });
530
- }
531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSparklineComponent, decorators: [{
532
- type: Component,
533
- args: [{ selector: 'talos-sparkline', host: {
534
- 'class': 'talos-sparkline',
535
- '[class.talos-sparkline-xs]': 'size() === "xs"',
536
- '[class.talos-sparkline-sm]': 'size() === "sm"',
537
- '[class.talos-sparkline-md]': 'size() === "md"',
538
- '[class.talos-sparkline-lg]': 'size() === "lg"',
539
- '[class.talos-sparkline-responsive]': 'size() === "responsive"',
540
- '[style.width]': 'hostWidth()',
541
- '[style.height]': 'hostHeight()',
542
- '[style.aspectRatio]': 'computedAspectRatio()',
543
- '[attr.role]': '"img"',
544
- '[attr.aria-label]': 'computedAriaLabel()'
545
- }, template: "<svg\n class=\"talos-sparkline-svg\"\n [attr.viewBox]=\"'0 0 ' + svgWidth() + ' ' + svgHeight()\"\n (mousemove)=\"onMouseMove($event)\"\n (mouseleave)=\"onMouseLeave()\"\n aria-hidden=\"true\"\n>\n <defs>\n <linearGradient [id]=\"gradientId\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" [attr.stop-color]=\"effectiveColor().fillStart\" />\n <stop offset=\"100%\" [attr.stop-color]=\"effectiveColor().fillEnd\" />\n </linearGradient>\n </defs>\n\n <!-- Reference Baseline (if provided) -->\n @if (referenceLineY() !== null) {\n <line\n class=\"talos-sparkline-reference-line\"\n [attr.x1]=\"0\"\n [attr.y1]=\"referenceLineY()\"\n [attr.x2]=\"svgWidth()\"\n [attr.y2]=\"referenceLineY()\"\n />\n }\n\n <!-- Chart Type: Area / Line -->\n @if (type() === 'area' || type() === 'line') {\n @if (type() === 'area' && areaPath()) {\n <path\n class=\"talos-sparkline-area\"\n [attr.d]=\"areaPath()\"\n [attr.fill]=\"'url(#' + gradientId + ')'\"\n />\n }\n\n @if (linePath()) {\n <path\n class=\"talos-sparkline-line\"\n [attr.d]=\"linePath()\"\n [attr.stroke]=\"effectiveColor().stroke\"\n [attr.stroke-width]=\"strokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n }\n }\n\n <!-- Chart Type: Bar -->\n @if (type() === 'bar') {\n @for (bar of barSegments(); track bar.index) {\n <rect\n class=\"talos-sparkline-bar\"\n [class.talos-sparkline-bar-hovered]=\"isHovering() && hoveredPoint()?.index === bar.index\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [attr.rx]=\"barRadius()\"\n [attr.ry]=\"barRadius()\"\n [attr.fill]=\"bar.color\"\n (click)=\"onPointClick(bar)\"\n />\n }\n }\n\n <!-- Highlight Markers -->\n @for (marker of markersToRender(); track marker.index) {\n <circle\n class=\"talos-sparkline-marker\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.r]=\"markerRadius()\"\n [attr.fill]=\"marker.color || effectiveColor().stroke\"\n [attr.stroke]=\"'#ffffff'\"\n [attr.stroke-width]=\"1.5\"\n (click)=\"onPointClick(marker)\"\n />\n }\n\n <!-- Interactive Hover Crosshair / Cursor Dot (Line/Area only) -->\n @if (type() !== 'bar' && isHovering() && hoveredPoint(); as pt) {\n <line\n class=\"talos-sparkline-cursor-line\"\n [attr.x1]=\"pt.x\"\n [attr.y1]=\"0\"\n [attr.x2]=\"pt.x\"\n [attr.y2]=\"svgHeight()\"\n />\n <circle\n class=\"talos-sparkline-hover-dot-outer\"\n [attr.cx]=\"pt.x\"\n [attr.cy]=\"pt.y\"\n [attr.r]=\"markerRadius() + 2.5\"\n [attr.fill]=\"effectiveColor().stroke\"\n opacity=\"0.25\"\n />\n <circle\n class=\"talos-sparkline-hover-dot\"\n [attr.cx]=\"pt.x\"\n [attr.cy]=\"pt.y\"\n [attr.r]=\"markerRadius() + 0.5\"\n [attr.fill]=\"effectiveColor().stroke\"\n stroke=\"#ffffff\"\n [attr.stroke-width]=\"1.5\"\n />\n }\n</svg>\n\n<!-- Floating Tooltip on Hover -->\n@if (showTooltip() && isHovering() && hoveredPoint(); as pt) {\n <div\n class=\"talos-sparkline-tooltip\"\n [style.left.px]=\"pt.x\"\n >\n @if (pt.label) {\n <span class=\"talos-sparkline-tooltip-label\">{{ pt.label }}</span>\n }\n <span class=\"talos-sparkline-tooltip-value\">{{ valueFormatter()(pt.value) }}</span>\n </div>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;overflow:visible;-webkit-user-select:none;user-select:none}:host.talos-sparkline-xs{width:64px;height:40px}:host.talos-sparkline-sm{width:96px;height:60px}:host.talos-sparkline-md{width:130px;height:80px}:host.talos-sparkline-lg{width:180px;height:110px}:host.talos-sparkline-responsive{display:block;width:100%;height:100%;min-height:48px}:host .talos-sparkline-svg{display:block;width:100%;height:100%;overflow:visible;cursor:crosshair}:host .talos-sparkline-area{transition:d .25s ease,opacity .2s ease}:host .talos-sparkline-line{transition:d .25s ease,stroke .2s ease}:host .talos-sparkline-bar{transition:height .2s ease,y .2s ease,opacity .15s ease,filter .15s ease;cursor:pointer}:host .talos-sparkline-bar:hover,:host .talos-sparkline-bar.talos-sparkline-bar-hovered{opacity:.85;filter:brightness(1.1)}:host .talos-sparkline-reference-line{stroke:var(--talos-border-hover, #94a3b8);stroke-width:1;stroke-dasharray:2 2;opacity:.65}:host .talos-sparkline-cursor-line{stroke:var(--talos-text-muted, #64748b);stroke-width:1;stroke-dasharray:2 2;opacity:.7;pointer-events:none}:host .talos-sparkline-marker{filter:drop-shadow(0 1px 2px rgba(0,0,0,.15));cursor:pointer;transition:transform .15s ease}:host .talos-sparkline-marker:hover{transform:scale(1.2)}:host .talos-sparkline-hover-dot{pointer-events:none;filter:drop-shadow(0 2px 4px rgba(0,0,0,.2))}:host .talos-sparkline-tooltip{position:absolute;bottom:calc(100% + 4px);transform:translate(-50%);pointer-events:none;z-index:30;display:flex;flex-direction:column;align-items:center;padding:2px 6px;border-radius:4px;background:var(--talos-text-color, #0f172a);color:var(--talos-card-bg, #ffffff);font-size:.6875rem;font-weight:600;line-height:1.2;white-space:nowrap;box-shadow:0 4px 6px -1px #00000026,0 2px 4px -2px #0000001a;animation:talosSparklineFadeIn .12s ease-out}:host .talos-sparkline-tooltip .talos-sparkline-tooltip-label{font-size:.625rem;font-weight:400;opacity:.8}:host .talos-sparkline-tooltip .talos-sparkline-tooltip-value{letter-spacing:-.01em}:host .talos-sparkline-tooltip:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border-width:3px;border-style:solid;border-color:var(--talos-text-color, #0f172a) transparent transparent transparent}@keyframes talosSparklineFadeIn{0%{opacity:0;transform:translate(-50%,2px)}to{opacity:1;transform:translate(-50%)}}\n"] }]
546
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], autoColorTrend: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoColorTrend", required: false }] }], smooth: [{ type: i0.Input, args: [{ isSignal: true, alias: "smooth", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], markerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "markerRadius", required: false }] }], referenceValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "referenceValue", required: false }] }], showTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTooltip", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], barGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "barGap", required: false }] }], barRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "barRadius", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], aspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "aspectRatio", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], valueFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormatter", required: false }] }], pointHover: [{ type: i0.Output, args: ["pointHover"] }], pointClick: [{ type: i0.Output, args: ["pointClick"] }] } });
547
-
548
- class TalosSparklineModule {
549
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSparklineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
550
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosSparklineModule, imports: [TalosSparklineComponent], exports: [TalosSparklineComponent] });
551
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSparklineModule });
552
- }
553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSparklineModule, decorators: [{
554
- type: NgModule,
555
- args: [{
556
- imports: [TalosSparklineComponent],
557
- exports: [TalosSparklineComponent]
558
- }]
559
- }] });
560
-
561
- /**
562
- * Generated bundle index. Do not edit.
563
- */
564
-
565
- export { GOLDEN_RATIO, TalosSparklineComponent, TalosSparklineModule };
566
- //# sourceMappingURL=weeehaoooz-talos-ui-data-viz-sparkline.mjs.map