adminator-admin-dashboard 2.8.1 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.md +499 -0
  2. package/CLAUDE.md +126 -154
  3. package/README.md +321 -370
  4. package/dist/2026.js +8751 -0
  5. package/dist/2026.js.map +1 -0
  6. package/dist/404.html +36 -16
  7. package/dist/500.html +36 -16
  8. package/dist/assets/static/images/logo.svg +3 -3
  9. package/dist/basic-table.html +152 -699
  10. package/dist/blank.html +42 -507
  11. package/dist/buttons.html +152 -448
  12. package/dist/calendar.html +246 -658
  13. package/dist/charts.html +124 -658
  14. package/dist/chat.html +209 -706
  15. package/dist/compose.html +141 -618
  16. package/dist/datatable.html +467 -991
  17. package/dist/email.html +430 -943
  18. package/dist/forms.html +208 -733
  19. package/dist/google-maps.html +123 -513
  20. package/dist/index.html +436 -1041
  21. package/dist/runtime.js +1299 -0
  22. package/dist/runtime.js.map +1 -0
  23. package/dist/signin.html +92 -92
  24. package/dist/signup.html +106 -91
  25. package/dist/ui.html +268 -897
  26. package/dist/vector-maps.html +132 -511
  27. package/dist/vendor-chartjs.js +14593 -0
  28. package/dist/vendor-chartjs.js.map +1 -0
  29. package/dist/vendor-fullcalendar.js +14793 -0
  30. package/dist/vendor-fullcalendar.js.map +1 -0
  31. package/dist/vendors.js +3758 -0
  32. package/dist/vendors.js.map +1 -0
  33. package/package.json +50 -52
  34. package/src/404.html +35 -15
  35. package/src/500.html +35 -15
  36. package/src/assets/scripts/2026/Shell.js +312 -0
  37. package/src/assets/scripts/2026/calendar.js +123 -0
  38. package/src/assets/scripts/2026/charts.js +259 -0
  39. package/src/assets/scripts/2026/index.js +35 -0
  40. package/src/assets/scripts/2026/init.js +207 -0
  41. package/src/assets/scripts/2026/maps.js +78 -0
  42. package/src/assets/scripts/2026/palette.js +266 -0
  43. package/src/assets/static/images/logo.svg +3 -3
  44. package/src/assets/styles/2026/_animations.scss +14 -0
  45. package/src/assets/styles/2026/_auth.scss +215 -0
  46. package/src/assets/styles/2026/_base.scss +37 -0
  47. package/src/assets/styles/2026/_calendar.scss +380 -0
  48. package/src/assets/styles/2026/_charts.scss +44 -0
  49. package/src/assets/styles/2026/_chat.scss +350 -0
  50. package/src/assets/styles/2026/_components.scss +140 -0
  51. package/src/assets/styles/2026/_dashboard.scss +520 -0
  52. package/src/assets/styles/2026/_data.scss +130 -0
  53. package/src/assets/styles/2026/_dropdowns.scss +128 -0
  54. package/src/assets/styles/2026/_email.scss +599 -0
  55. package/src/assets/styles/2026/_error.scss +98 -0
  56. package/src/assets/styles/2026/_forms.scss +215 -0
  57. package/src/assets/styles/2026/_fullcalendar.scss +134 -0
  58. package/src/assets/styles/2026/_palette.scss +173 -0
  59. package/src/assets/styles/2026/_responsive.scss +229 -0
  60. package/src/assets/styles/2026/_shell.scss +290 -0
  61. package/src/assets/styles/2026/_tokens.scss +80 -0
  62. package/src/assets/styles/2026/_ui.scss +365 -0
  63. package/src/assets/styles/2026/index.scss +23 -0
  64. package/src/basic-table.html +153 -710
  65. package/src/blank.html +42 -517
  66. package/src/buttons.html +152 -458
  67. package/src/calendar.html +246 -668
  68. package/src/charts.html +124 -668
  69. package/src/chat.html +209 -716
  70. package/src/compose.html +142 -629
  71. package/src/datatable.html +466 -1000
  72. package/src/email.html +429 -952
  73. package/src/forms.html +207 -742
  74. package/src/google-maps.html +128 -523
  75. package/src/index.html +438 -1050
  76. package/src/signin.html +92 -92
  77. package/src/signup.html +106 -91
  78. package/src/ui.html +267 -906
  79. package/src/vector-maps.html +133 -522
  80. package/dist/1e59d2330b4c6deb84b3.ttf +0 -0
  81. package/dist/20fd1704ea223900efa9.woff2 +0 -0
  82. package/dist/29b39089170885ae2967.woff +0 -0
  83. package/dist/8b43027f47b20503057d.eot +0 -0
  84. package/dist/9bad94440d49256265a5.eot +0 -0
  85. package/dist/assets/fontawesome-webfont.svg +0 -2671
  86. package/dist/assets/themify.svg +0 -362
  87. package/dist/eda8b94308c6f538f04a.ttf +0 -0
  88. package/dist/f691f37e57f04c152e23.woff +0 -0
  89. package/dist/main.js +0 -61323
  90. package/dist/main.js.map +0 -1
  91. package/src/assets/scripts/app 2.js +0 -645
  92. package/src/assets/scripts/app.js +0 -645
  93. package/src/assets/scripts/charts/chartJS/index.js +0 -148
  94. package/src/assets/scripts/charts/easyPieChart/index.js +0 -200
  95. package/src/assets/scripts/charts/index.js +0 -3
  96. package/src/assets/scripts/charts/sparkline/index.js +0 -208
  97. package/src/assets/scripts/chat/index.js +0 -11
  98. package/src/assets/scripts/components/Chart.js +0 -1390
  99. package/src/assets/scripts/components/Sidebar.js +0 -241
  100. package/src/assets/scripts/constants/colors.js +0 -274
  101. package/src/assets/scripts/datatable/index.js +0 -379
  102. package/src/assets/scripts/datepicker/index.js +0 -302
  103. package/src/assets/scripts/email/index.js +0 -25
  104. package/src/assets/scripts/fullcalendar/index.js +0 -86
  105. package/src/assets/scripts/googleMaps/index.js +0 -93
  106. package/src/assets/scripts/index.js +0 -18
  107. package/src/assets/scripts/masonry/index.js +0 -14
  108. package/src/assets/scripts/popover/index.js +0 -109
  109. package/src/assets/scripts/scrollbar/index.js +0 -10
  110. package/src/assets/scripts/search/index.js +0 -15
  111. package/src/assets/scripts/sidebar/index.js +0 -140
  112. package/src/assets/scripts/skycons/index.js +0 -52
  113. package/src/assets/scripts/ui/index.js +0 -412
  114. package/src/assets/scripts/utils/date.js +0 -242
  115. package/src/assets/scripts/utils/dom.js +0 -349
  116. package/src/assets/scripts/utils/index.js +0 -45
  117. package/src/assets/scripts/utils/theme.js +0 -107
  118. package/src/assets/scripts/vectorMaps/index.js +0 -277
  119. package/src/assets/styles/index.scss +0 -801
  120. package/src/assets/styles/spec/components/easyPieChart.scss +0 -11
  121. package/src/assets/styles/spec/components/footer.scss +0 -4
  122. package/src/assets/styles/spec/components/forms.scss +0 -288
  123. package/src/assets/styles/spec/components/index.scss +0 -9
  124. package/src/assets/styles/spec/components/loader.scss +0 -46
  125. package/src/assets/styles/spec/components/masonry.scss +0 -1
  126. package/src/assets/styles/spec/components/pageContainer.scss +0 -255
  127. package/src/assets/styles/spec/components/progressBar.scss +0 -6
  128. package/src/assets/styles/spec/components/sidebar.scss +0 -642
  129. package/src/assets/styles/spec/components/topbar.scss +0 -455
  130. package/src/assets/styles/spec/generic/base.scss +0 -102
  131. package/src/assets/styles/spec/generic/index.scss +0 -1
  132. package/src/assets/styles/spec/index.scss +0 -4
  133. package/src/assets/styles/spec/screens/chat.scss +0 -147
  134. package/src/assets/styles/spec/screens/email.scss +0 -108
  135. package/src/assets/styles/spec/screens/index.scss +0 -2
  136. package/src/assets/styles/spec/settings/baseColors.scss +0 -103
  137. package/src/assets/styles/spec/settings/borders.scss +0 -6
  138. package/src/assets/styles/spec/settings/breakpoints.scss +0 -26
  139. package/src/assets/styles/spec/settings/fonts.scss +0 -4
  140. package/src/assets/styles/spec/settings/index.scss +0 -4
  141. package/src/assets/styles/spec/settings/materialColors.scss +0 -550
  142. package/src/assets/styles/spec/tools/index.scss +0 -1
  143. package/src/assets/styles/spec/tools/mixins/clearfix.scss +0 -15
  144. package/src/assets/styles/spec/tools/mixins/index.scss +0 -3
  145. package/src/assets/styles/spec/tools/mixins/mediaQueriesRanges.scss +0 -58
  146. package/src/assets/styles/spec/tools/mixins/placeholder.scss +0 -10
  147. package/src/assets/styles/spec/utils/colors.scss +0 -33
  148. package/src/assets/styles/spec/utils/index.scss +0 -2
  149. package/src/assets/styles/spec/utils/layout/helpers/border.scss +0 -78
  150. package/src/assets/styles/spec/utils/layout/helpers/flex.scss +0 -220
  151. package/src/assets/styles/spec/utils/layout/helpers/index.scss +0 -11
  152. package/src/assets/styles/spec/utils/layout/helpers/layout.scss +0 -137
  153. package/src/assets/styles/spec/utils/layout/helpers/lists.scss +0 -23
  154. package/src/assets/styles/spec/utils/layout/helpers/margin.scss +0 -266
  155. package/src/assets/styles/spec/utils/layout/helpers/objects.scss +0 -91
  156. package/src/assets/styles/spec/utils/layout/helpers/padding.scss +0 -147
  157. package/src/assets/styles/spec/utils/layout/helpers/positions.scss +0 -118
  158. package/src/assets/styles/spec/utils/layout/helpers/pseudo.scss +0 -6
  159. package/src/assets/styles/spec/utils/layout/helpers/sizes.scss +0 -157
  160. package/src/assets/styles/spec/utils/layout/helpers/typography.scss +0 -127
  161. package/src/assets/styles/spec/utils/layout/index.scss +0 -3
  162. package/src/assets/styles/spec/utils/layout/mixins/generateResponsive.scss +0 -25
  163. package/src/assets/styles/spec/utils/layout/mixins/index.scss +0 -2
  164. package/src/assets/styles/spec/utils/layout/mixins/mediaQueryCondition.scss +0 -28
  165. package/src/assets/styles/spec/utils/layout/utils/center.scss +0 -54
  166. package/src/assets/styles/spec/utils/layout/utils/gap.scss +0 -229
  167. package/src/assets/styles/spec/utils/layout/utils/index.scss +0 -5
  168. package/src/assets/styles/spec/utils/layout/utils/layers.scss +0 -5
  169. package/src/assets/styles/spec/utils/layout/utils/peers.scss +0 -35
  170. package/src/assets/styles/utils/mobile.scss +0 -954
  171. package/src/assets/styles/utils/theme.css +0 -97
  172. package/src/assets/styles/vendor/datepicker.scss +0 -183
  173. package/src/assets/styles/vendor/font-awesome.css +0 -2337
  174. package/src/assets/styles/vendor/fullcalendar.scss +0 -217
  175. package/src/assets/styles/vendor/index.scss +0 -8
  176. package/src/assets/styles/vendor/jquery.datatables.scss +0 -162
  177. package/src/assets/styles/vendor/perfectScrollbar.scss +0 -4
  178. package/src/assets/styles/vendor/sparkline.scss +0 -6
  179. package/src/assets/styles/vendor/themify-icons.css +0 -1081
@@ -1,148 +0,0 @@
1
- import Chart from 'chart.js/auto';
2
- import { COLORS } from '../../constants/colors';
3
-
4
- export default (function () {
5
- // ------------------------------------------------------
6
- // @Line Charts
7
- // ------------------------------------------------------
8
-
9
- const lineChartBox = document.getElementById('line-chart');
10
-
11
- if (lineChartBox) {
12
- const lineCtx = lineChartBox.getContext('2d');
13
- lineChartBox.height = 80;
14
-
15
- new Chart(lineCtx, {
16
- type: 'line',
17
- data: {
18
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
19
- datasets: [{
20
- label : 'Series A',
21
- backgroundColor : 'rgba(237, 231, 246, 0.5)',
22
- borderColor : COLORS['deep-purple-500'],
23
- pointBackgroundColor : COLORS['deep-purple-700'],
24
- borderWidth : 2,
25
- data : [60, 50, 70, 60, 50, 70, 60],
26
- }, {
27
- label : 'Series B',
28
- backgroundColor : 'rgba(232, 245, 233, 0.5)',
29
- borderColor : COLORS['blue-500'],
30
- pointBackgroundColor : COLORS['blue-700'],
31
- borderWidth : 2,
32
- data : [70, 75, 85, 70, 75, 85, 70],
33
- }],
34
- },
35
-
36
- options: {
37
- legend: {
38
- display: false,
39
- },
40
- },
41
-
42
- });
43
- }
44
-
45
- // ------------------------------------------------------
46
- // @Bar Charts
47
- // ------------------------------------------------------
48
-
49
- const barChartBox = document.getElementById('bar-chart');
50
-
51
- if (barChartBox) {
52
- const barCtx = barChartBox.getContext('2d');
53
-
54
- new Chart(barCtx, {
55
- type: 'bar',
56
- data: {
57
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
58
- datasets: [{
59
- label : 'Dataset 1',
60
- backgroundColor : COLORS['deep-purple-500'],
61
- borderColor : COLORS['deep-purple-800'],
62
- borderWidth : 1,
63
- data : [10, 50, 20, 40, 60, 30, 70],
64
- }, {
65
- label : 'Dataset 2',
66
- backgroundColor : COLORS['light-blue-500'],
67
- borderColor : COLORS['light-blue-800'],
68
- borderWidth : 1,
69
- data : [10, 50, 20, 40, 60, 30, 70],
70
- }],
71
- },
72
-
73
- options: {
74
- responsive: true,
75
- legend: {
76
- position: 'bottom',
77
- },
78
- },
79
- });
80
- }
81
-
82
- // ------------------------------------------------------
83
- // @Area Charts
84
- // ------------------------------------------------------
85
-
86
- const areaChartBox = document.getElementById('area-chart');
87
-
88
- if (areaChartBox) {
89
- const areaCtx = areaChartBox.getContext('2d');
90
-
91
- new Chart(areaCtx, {
92
- type: 'line',
93
- data: {
94
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
95
- datasets: [{
96
- backgroundColor : 'rgba(3, 169, 244, 0.5)',
97
- borderColor : COLORS['light-blue-800'],
98
- data : [10, 50, 20, 40, 60, 30, 70],
99
- label : 'Dataset',
100
- fill : 'start',
101
- }],
102
- },
103
- });
104
- }
105
-
106
- // ------------------------------------------------------
107
- // @Scatter Charts
108
- // ------------------------------------------------------
109
-
110
- const scatterChartBox = document.getElementById('scatter-chart');
111
-
112
- if (scatterChartBox) {
113
- const scatterCtx = scatterChartBox.getContext('2d');
114
-
115
- new Chart(scatterCtx, {
116
- type: 'scatter',
117
- data: {
118
- datasets: [{
119
- label : 'My First dataset',
120
- borderColor : COLORS['red-500'],
121
- backgroundColor : COLORS['red-500'],
122
- data: [
123
- { x: 10, y: 20 },
124
- { x: 30, y: 40 },
125
- { x: 50, y: 60 },
126
- { x: 70, y: 80 },
127
- { x: 90, y: 100 },
128
- { x: 110, y: 120 },
129
- { x: 130, y: 140 },
130
- ],
131
- }, {
132
- label : 'My Second dataset',
133
- borderColor : COLORS['green-500'],
134
- backgroundColor : COLORS['green-500'],
135
- data: [
136
- { x: 150, y: 160 },
137
- { x: 170, y: 180 },
138
- { x: 190, y: 200 },
139
- { x: 210, y: 220 },
140
- { x: 230, y: 240 },
141
- { x: 250, y: 260 },
142
- { x: 270, y: 280 },
143
- ],
144
- }],
145
- },
146
- });
147
- }
148
- }())
@@ -1,200 +0,0 @@
1
- import Theme from '../../utils/theme.js';
2
-
3
- export default (function () {
4
-
5
- // Vanilla JS Pie Chart implementation using SVG
6
- class VanillaPieChart {
7
- constructor(element, options = {}) {
8
- this.element = element;
9
- this.options = {
10
- size: 110,
11
- lineWidth: 3,
12
- lineCap: 'round',
13
- trackColor: '#f2f2f2',
14
- barColor: '#ef1e25',
15
- scaleColor: false,
16
- animate: 1000,
17
- onStep: null,
18
- ...options,
19
- };
20
-
21
- this.percentage = parseInt(element.dataset.percent || 0);
22
- this.init();
23
- }
24
-
25
- init() {
26
- this.createSVG();
27
- this.animate();
28
- }
29
-
30
- createSVG() {
31
- const size = this.options.size;
32
- const lineWidth = this.options.lineWidth;
33
- const radius = (size - lineWidth) / 2;
34
- const circumference = 2 * Math.PI * radius;
35
-
36
- // Create SVG element
37
- const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
38
- svg.setAttribute('width', size);
39
- svg.setAttribute('height', size);
40
- svg.style.transform = 'rotate(-90deg)';
41
-
42
- // Create track (background circle)
43
- const track = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
44
- track.setAttribute('cx', size / 2);
45
- track.setAttribute('cy', size / 2);
46
- track.setAttribute('r', radius);
47
- track.setAttribute('fill', 'none');
48
- track.setAttribute('stroke', this.options.trackColor);
49
- track.setAttribute('stroke-width', lineWidth);
50
-
51
- // Create bar (progress circle)
52
- const bar = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
53
- bar.setAttribute('cx', size / 2);
54
- bar.setAttribute('cy', size / 2);
55
- bar.setAttribute('r', radius);
56
- bar.setAttribute('fill', 'none');
57
- bar.setAttribute('stroke', this.options.barColor);
58
- bar.setAttribute('stroke-width', lineWidth);
59
- bar.setAttribute('stroke-linecap', this.options.lineCap);
60
- bar.setAttribute('stroke-dasharray', circumference);
61
- bar.setAttribute('stroke-dashoffset', circumference);
62
-
63
- // Add elements to SVG
64
- svg.appendChild(track);
65
- svg.appendChild(bar);
66
-
67
- // Clear element and add SVG
68
- this.element.innerHTML = '';
69
- this.element.appendChild(svg);
70
-
71
- // Add percentage text
72
- const textElement = document.createElement('div');
73
- textElement.style.position = 'absolute';
74
- textElement.style.top = '50%';
75
- textElement.style.left = '50%';
76
- textElement.style.transform = 'translate(-50%, -50%)';
77
- textElement.style.fontSize = '14px';
78
- textElement.style.fontWeight = 'bold';
79
- textElement.style.color = Theme.getCSSVar('--c-text-base') || '#333';
80
- textElement.textContent = '0%';
81
-
82
- this.element.style.position = 'relative';
83
- this.element.appendChild(textElement);
84
-
85
- // Store references
86
- this.svg = svg;
87
- this.bar = bar;
88
- this.textElement = textElement;
89
- this.circumference = circumference;
90
- }
91
-
92
- animate() {
93
- const targetOffset = this.circumference - (this.percentage / 100) * this.circumference;
94
- const duration = this.options.animate;
95
- const startTime = Date.now();
96
- const startOffset = this.circumference;
97
-
98
- const animateStep = () => {
99
- const elapsed = Date.now() - startTime;
100
- const progress = Math.min(elapsed / duration, 1);
101
-
102
- // Easing function (easeOutCubic)
103
- const easeProgress = 1 - Math.pow(1 - progress, 3);
104
-
105
- const currentOffset = startOffset - (startOffset - targetOffset) * easeProgress;
106
- const currentPercent = ((this.circumference - currentOffset) / this.circumference) * 100;
107
-
108
- this.bar.setAttribute('stroke-dashoffset', currentOffset);
109
- this.textElement.textContent = `${Math.round(currentPercent)}%`;
110
-
111
- // Call onStep callback if provided
112
- if (this.options.onStep) {
113
- this.options.onStep.call(this, 0, this.percentage, currentPercent);
114
- }
115
-
116
- if (progress < 1) {
117
- requestAnimationFrame(animateStep);
118
- }
119
- };
120
-
121
- requestAnimationFrame(animateStep);
122
- }
123
-
124
- update(percentage) {
125
- this.percentage = percentage;
126
- this.animate();
127
- }
128
-
129
- destroy() {
130
- if (this.element) {
131
- this.element.innerHTML = '';
132
- }
133
- }
134
- }
135
-
136
- // Initialize all pie charts
137
- const initializePieCharts = () => {
138
- const pieChartElements = document.querySelectorAll('.easy-pie-chart');
139
-
140
- pieChartElements.forEach(element => {
141
- // Skip if already initialized
142
- if (element.pieChartInstance) {
143
- element.pieChartInstance.destroy();
144
- }
145
-
146
- // Get theme colors
147
- const isDark = Theme.current() === 'dark';
148
- const barColor = element.dataset.barColor || (isDark ? '#4f46e5' : '#ef4444');
149
- const trackColor = element.dataset.trackColor || (isDark ? '#374151' : '#f3f4f6');
150
-
151
- // Create pie chart instance
152
- const pieChart = new VanillaPieChart(element, {
153
- size: parseInt(element.dataset.size || 110),
154
- lineWidth: parseInt(element.dataset.lineWidth || 3),
155
- barColor,
156
- trackColor,
157
- animate: parseInt(element.dataset.animate || 1000),
158
- onStep(from, to, percent) {
159
- // Update the percentage display
160
- const textElement = this.element.querySelector('div');
161
- if (textElement) {
162
- textElement.innerHTML = `${Math.round(percent)}%`;
163
- }
164
- },
165
- });
166
-
167
- // Store instance for cleanup
168
- element.pieChartInstance = pieChart;
169
- });
170
- };
171
-
172
- // Initialize on load
173
- initializePieCharts();
174
-
175
- // Reinitialize on theme change
176
- window.addEventListener('adminator:themeChanged', () => {
177
- setTimeout(initializePieCharts, 100);
178
- });
179
-
180
- // Reinitialize on window resize
181
- window.addEventListener('resize', () => {
182
- setTimeout(initializePieCharts, 100);
183
- });
184
-
185
- // Cleanup on page unload
186
- window.addEventListener('beforeunload', () => {
187
- const pieChartElements = document.querySelectorAll('.easy-pie-chart');
188
- pieChartElements.forEach(element => {
189
- if (element.pieChartInstance) {
190
- element.pieChartInstance.destroy();
191
- }
192
- });
193
- });
194
-
195
- // Return public API
196
- return {
197
- init: initializePieCharts,
198
- VanillaPieChart,
199
- };
200
- }());
@@ -1,3 +0,0 @@
1
- import './chartJS';
2
- import './easyPieChart';
3
- import './sparkline';
@@ -1,208 +0,0 @@
1
- import { Chart, registerables } from 'chart.js';
2
- import { debounce } from 'lodash';
3
- import { COLORS } from '../../constants/colors';
4
- import Theme from '../../utils/theme.js';
5
-
6
- // Register Chart.js components
7
- Chart.register(...registerables);
8
-
9
- export default (function () {
10
- // Store chart instances for cleanup
11
- let chartInstances = [];
12
-
13
- // ------------------------------------------------------
14
- // @Sparkline Chart Creation Helpers
15
- // ------------------------------------------------------
16
-
17
- const createSparklineChart = (elementId, data, color, type = 'bar') => {
18
- const element = document.getElementById(elementId);
19
- if (!element) return null;
20
-
21
- // Clear existing chart
22
- const existingChart = chartInstances.find(chart => chart.canvas.id === elementId);
23
- if (existingChart) {
24
- existingChart.destroy();
25
- chartInstances = chartInstances.filter(chart => chart.canvas.id !== elementId);
26
- }
27
-
28
- // Create canvas if it doesn't exist
29
- let canvas = element.querySelector('canvas');
30
- if (!canvas) {
31
- canvas = document.createElement('canvas');
32
- canvas.id = `${elementId }-canvas`;
33
- element.appendChild(canvas);
34
- }
35
-
36
- // Set canvas size
37
- canvas.width = element.offsetWidth || 100;
38
- canvas.height = 20;
39
-
40
- const ctx = canvas.getContext('2d');
41
-
42
- const chartConfig = {
43
- type,
44
- data: {
45
- labels: data.map((_, index) => index),
46
- datasets: [{
47
- data,
48
- backgroundColor: color,
49
- borderColor: color,
50
- borderWidth: type === 'line' ? 2 : 0,
51
- barThickness: 3,
52
- categoryPercentage: 1.0,
53
- barPercentage: 0.8,
54
- fill: false,
55
- pointRadius: 0,
56
- pointHoverRadius: 0,
57
- }],
58
- },
59
- options: {
60
- responsive: true,
61
- maintainAspectRatio: false,
62
- plugins: {
63
- legend: {
64
- display: false,
65
- },
66
- tooltip: {
67
- enabled: false,
68
- },
69
- },
70
- scales: {
71
- x: {
72
- display: false,
73
- grid: {
74
- display: false,
75
- },
76
- },
77
- y: {
78
- display: false,
79
- grid: {
80
- display: false,
81
- },
82
- },
83
- },
84
- elements: {
85
- bar: {
86
- borderRadius: 0,
87
- },
88
- line: {
89
- tension: 0.1,
90
- },
91
- },
92
- layout: {
93
- padding: 0,
94
- },
95
- },
96
- };
97
-
98
- const chart = new Chart(ctx, chartConfig);
99
- chartInstances.push(chart);
100
- return chart;
101
- };
102
-
103
- const createSparklineForElements = (selector, data, color, type = 'bar') => {
104
- const elements = document.querySelectorAll(selector);
105
- elements.forEach((element, index) => {
106
- const elementId = element.id || `sparkline-${selector.replace(/[^a-zA-Z0-9]/g, '')}-${index}`;
107
- if (!element.id) element.id = elementId;
108
- createSparklineChart(elementId, data, color, type);
109
- });
110
- };
111
-
112
- // ------------------------------------------------------
113
- // @Dashboard Sparklines
114
- // ------------------------------------------------------
115
-
116
- const drawSparklines = () => {
117
- const sparkColors = Theme.getSparklineColors();
118
- const data = [0, 5, 6, 10, 9, 12, 4, 9];
119
-
120
- // Dashboard sparklines
121
- createSparklineChart('sparklinedash', data, sparkColors.success);
122
- createSparklineChart('sparklinedash2', data, sparkColors.purple);
123
- createSparklineChart('sparklinedash3', data, sparkColors.info);
124
- createSparklineChart('sparklinedash4', data, sparkColors.danger);
125
- };
126
-
127
- // ------------------------------------------------------
128
- // @Other Sparklines
129
- // ------------------------------------------------------
130
-
131
- const drawOtherSparklines = () => {
132
- const sparkColors = Theme.getSparklineColors();
133
-
134
- // Line sparklines
135
- createSparklineChart('sparkline', [5, 6, 7, 9, 9, 5, 3, 2, 2, 4, 6, 7], COLORS['red-500'], 'line');
136
-
137
- // Composite bar - simplified implementation
138
- createSparklineChart('compositebar', [4, 1, 5, 7, 9, 9, 8, 7, 6, 6, 4, 7, 8, 4, 3, 2, 2, 5, 6, 7], sparkColors.light);
139
-
140
- // Normal line
141
- createSparklineChart('normalline', [5, 6, 7, 9, 9, 5, 3, 2, 2, 4, 6, 7], sparkColors.info, 'line');
142
-
143
- // Various sparkline types for elements with classes
144
- const values = [5, 4, 5, -2, 0, 3, -5, 6, 7, 9, 9, 5, -3, -2, 2, -4];
145
- const valuesAlt = [1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1];
146
-
147
- // Line sparklines
148
- createSparklineForElements('.sparkline', values, COLORS['red-500'], 'line');
149
-
150
- // Bar sparklines
151
- createSparklineForElements('.sparkbar', values, COLORS['deep-purple-500'], 'bar');
152
-
153
- // Tristate sparklines (simplified as bar charts)
154
- createSparklineForElements('.sparktri', valuesAlt, COLORS['light-blue-500'], 'bar');
155
- createSparklineForElements('.sparktristate', valuesAlt, sparkColors.info, 'bar');
156
- createSparklineForElements('.sparktristatecols', valuesAlt, '#fa7', 'bar');
157
-
158
- // Discrete sparklines (as line charts)
159
- createSparklineForElements('.sparkdisc', values, '#9f0', 'line');
160
-
161
- // Bullet sparklines (simplified as bar charts)
162
- createSparklineForElements('.sparkbull', values, COLORS['amber-500'], 'bar');
163
-
164
- // Box sparklines (simplified as bar charts)
165
- createSparklineForElements('.sparkbox', values, '#9f0', 'bar');
166
- };
167
-
168
- // ------------------------------------------------------
169
- // @Initialization
170
- // ------------------------------------------------------
171
-
172
- const initializeSparklines = () => {
173
- drawSparklines();
174
- drawOtherSparklines();
175
- };
176
-
177
- // Initial draw
178
- initializeSparklines();
179
-
180
- // Redraw sparklines on window resize
181
- window.addEventListener('resize', debounce(initializeSparklines, 150));
182
-
183
- // Listen for theme changes
184
- window.addEventListener('adminator:themeChanged', debounce(initializeSparklines, 150));
185
-
186
- // Cleanup function for chart instances
187
- window.addEventListener('beforeunload', () => {
188
- chartInstances.forEach(chart => {
189
- if (chart && typeof chart.destroy === 'function') {
190
- chart.destroy();
191
- }
192
- });
193
- chartInstances = [];
194
- });
195
-
196
- // Export for external access
197
- return {
198
- redraw: initializeSparklines,
199
- destroy: () => {
200
- chartInstances.forEach(chart => {
201
- if (chart && typeof chart.destroy === 'function') {
202
- chart.destroy();
203
- }
204
- });
205
- chartInstances = [];
206
- },
207
- };
208
- }());
@@ -1,11 +0,0 @@
1
- export default (function () {
2
- const chatSidebarToggle = document.getElementById('chat-sidebar-toggle');
3
- const chatSidebar = document.getElementById('chat-sidebar');
4
-
5
- if (chatSidebarToggle && chatSidebar) {
6
- chatSidebarToggle.addEventListener('click', e => {
7
- chatSidebar.classList.toggle('open');
8
- e.preventDefault();
9
- });
10
- }
11
- }())