adminator-admin-dashboard 2.7.0

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 (191) hide show
  1. package/CLAUDE.md +162 -0
  2. package/LICENSE +21 -0
  3. package/README.md +376 -0
  4. package/RELEASE_NOTES.md +92 -0
  5. package/dist/1e59d2330b4c6deb84b3.ttf +0 -0
  6. package/dist/20fd1704ea223900efa9.woff2 +0 -0
  7. package/dist/29b39089170885ae2967.woff +0 -0
  8. package/dist/404.html +24 -0
  9. package/dist/500.html +24 -0
  10. package/dist/55b07f26c86c8e3d3754.svg +1 -0
  11. package/dist/8b43027f47b20503057d.eot +0 -0
  12. package/dist/9bad94440d49256265a5.eot +0 -0
  13. package/dist/9fad440d8ee7a949a9a9.svg +1 -0
  14. package/dist/assets/c1e38fd9e0e74ba58f7a2b77ef29fdd3.svg +2671 -0
  15. package/dist/assets/f0fc8c798eac5636249c4ea287832422.svg +362 -0
  16. package/dist/assets/static/fonts/icons/fontawesome/FontAwesome.otf +0 -0
  17. package/dist/assets/static/fonts/icons/fontawesome/fontawesome-webfont.eot +0 -0
  18. package/dist/assets/static/fonts/icons/fontawesome/fontawesome-webfont.svg +2671 -0
  19. package/dist/assets/static/fonts/icons/fontawesome/fontawesome-webfont.ttf +0 -0
  20. package/dist/assets/static/fonts/icons/fontawesome/fontawesome-webfont.woff +0 -0
  21. package/dist/assets/static/fonts/icons/fontawesome/fontawesome-webfont.woff2 +0 -0
  22. package/dist/assets/static/fonts/icons/themify/themify.eot +0 -0
  23. package/dist/assets/static/fonts/icons/themify/themify.svg +362 -0
  24. package/dist/assets/static/fonts/icons/themify/themify.ttf +0 -0
  25. package/dist/assets/static/fonts/icons/themify/themify.woff +0 -0
  26. package/dist/assets/static/images/404.png +0 -0
  27. package/dist/assets/static/images/500.png +0 -0
  28. package/dist/assets/static/images/bg.jpg +0 -0
  29. package/dist/assets/static/images/datatables/sort_asc.png +0 -0
  30. package/dist/assets/static/images/datatables/sort_asc_disabled.png +0 -0
  31. package/dist/assets/static/images/datatables/sort_both.png +0 -0
  32. package/dist/assets/static/images/datatables/sort_desc.png +0 -0
  33. package/dist/assets/static/images/datatables/sort_desc_disabled.png +0 -0
  34. package/dist/assets/static/images/logo-circle.svg +7 -0
  35. package/dist/assets/static/images/logo-gradient.svg +13 -0
  36. package/dist/assets/static/images/logo-outline.svg +7 -0
  37. package/dist/assets/static/images/logo.png +0 -0
  38. package/dist/assets/static/images/logo.svg +5 -0
  39. package/dist/basic-table.html +715 -0
  40. package/dist/blank.html +522 -0
  41. package/dist/buttons.html +467 -0
  42. package/dist/calendar.html +692 -0
  43. package/dist/charts.html +681 -0
  44. package/dist/chat.html +730 -0
  45. package/dist/compose.html +643 -0
  46. package/dist/datatable.html +1009 -0
  47. package/dist/eda8b94308c6f538f04a.ttf +0 -0
  48. package/dist/email.html +992 -0
  49. package/dist/f691f37e57f04c152e23.woff +0 -0
  50. package/dist/forms.html +760 -0
  51. package/dist/google-maps.html +530 -0
  52. package/dist/index.html +1090 -0
  53. package/dist/main.js +61239 -0
  54. package/dist/main.js.map +1 -0
  55. package/dist/signin.html +107 -0
  56. package/dist/signup.html +104 -0
  57. package/dist/test.html +91 -0
  58. package/dist/ui.html +931 -0
  59. package/dist/vector-maps.html +529 -0
  60. package/package.json +112 -0
  61. package/src/404.html +24 -0
  62. package/src/500.html +24 -0
  63. package/src/assets/scripts/app.js +644 -0
  64. package/src/assets/scripts/charts/chartJS/index.js +148 -0
  65. package/src/assets/scripts/charts/easyPieChart/index.js +200 -0
  66. package/src/assets/scripts/charts/index.js +3 -0
  67. package/src/assets/scripts/charts/sparkline/index.js +208 -0
  68. package/src/assets/scripts/chat/index.js +11 -0
  69. package/src/assets/scripts/components/Chart.js +1390 -0
  70. package/src/assets/scripts/components/Sidebar.js +241 -0
  71. package/src/assets/scripts/constants/colors.js +274 -0
  72. package/src/assets/scripts/datatable/index.js +379 -0
  73. package/src/assets/scripts/datepicker/index.js +302 -0
  74. package/src/assets/scripts/email/index.js +25 -0
  75. package/src/assets/scripts/fullcalendar/index.js +86 -0
  76. package/src/assets/scripts/googleMaps/index.js +93 -0
  77. package/src/assets/scripts/index.js +18 -0
  78. package/src/assets/scripts/masonry/index.js +14 -0
  79. package/src/assets/scripts/popover/index.js +109 -0
  80. package/src/assets/scripts/scrollbar/index.js +10 -0
  81. package/src/assets/scripts/search/index.js +15 -0
  82. package/src/assets/scripts/sidebar/index.js +140 -0
  83. package/src/assets/scripts/skycons/index.js +52 -0
  84. package/src/assets/scripts/ui/index.js +412 -0
  85. package/src/assets/scripts/utils/date.js +242 -0
  86. package/src/assets/scripts/utils/dom.js +349 -0
  87. package/src/assets/scripts/utils/index.js +45 -0
  88. package/src/assets/scripts/utils/theme.js +105 -0
  89. package/src/assets/scripts/vectorMaps/index.js +277 -0
  90. package/src/assets/static/fonts/icons/fontawesome/FontAwesome.otf +0 -0
  91. package/src/assets/static/fonts/icons/fontawesome/fontawesome-webfont.eot +0 -0
  92. package/src/assets/static/fonts/icons/fontawesome/fontawesome-webfont.svg +2671 -0
  93. package/src/assets/static/fonts/icons/fontawesome/fontawesome-webfont.ttf +0 -0
  94. package/src/assets/static/fonts/icons/fontawesome/fontawesome-webfont.woff +0 -0
  95. package/src/assets/static/fonts/icons/fontawesome/fontawesome-webfont.woff2 +0 -0
  96. package/src/assets/static/fonts/icons/themify/themify.eot +0 -0
  97. package/src/assets/static/fonts/icons/themify/themify.svg +362 -0
  98. package/src/assets/static/fonts/icons/themify/themify.ttf +0 -0
  99. package/src/assets/static/fonts/icons/themify/themify.woff +0 -0
  100. package/src/assets/static/images/404.png +0 -0
  101. package/src/assets/static/images/500.png +0 -0
  102. package/src/assets/static/images/bg.jpg +0 -0
  103. package/src/assets/static/images/datatables/sort_asc.png +0 -0
  104. package/src/assets/static/images/datatables/sort_asc_disabled.png +0 -0
  105. package/src/assets/static/images/datatables/sort_both.png +0 -0
  106. package/src/assets/static/images/datatables/sort_desc.png +0 -0
  107. package/src/assets/static/images/datatables/sort_desc_disabled.png +0 -0
  108. package/src/assets/static/images/logo-circle.svg +7 -0
  109. package/src/assets/static/images/logo-gradient.svg +13 -0
  110. package/src/assets/static/images/logo-outline.svg +7 -0
  111. package/src/assets/static/images/logo.png +0 -0
  112. package/src/assets/static/images/logo.svg +5 -0
  113. package/src/assets/styles/index.scss +801 -0
  114. package/src/assets/styles/spec/components/easyPieChart.scss +11 -0
  115. package/src/assets/styles/spec/components/footer.scss +4 -0
  116. package/src/assets/styles/spec/components/forms.scss +288 -0
  117. package/src/assets/styles/spec/components/index.scss +9 -0
  118. package/src/assets/styles/spec/components/loader.scss +46 -0
  119. package/src/assets/styles/spec/components/masonry.scss +1 -0
  120. package/src/assets/styles/spec/components/pageContainer.scss +255 -0
  121. package/src/assets/styles/spec/components/progressBar.scss +6 -0
  122. package/src/assets/styles/spec/components/sidebar.scss +642 -0
  123. package/src/assets/styles/spec/components/topbar.scss +455 -0
  124. package/src/assets/styles/spec/generic/base.scss +102 -0
  125. package/src/assets/styles/spec/generic/index.scss +1 -0
  126. package/src/assets/styles/spec/index.scss +4 -0
  127. package/src/assets/styles/spec/screens/chat.scss +147 -0
  128. package/src/assets/styles/spec/screens/email.scss +108 -0
  129. package/src/assets/styles/spec/screens/index.scss +2 -0
  130. package/src/assets/styles/spec/settings/baseColors.scss +103 -0
  131. package/src/assets/styles/spec/settings/borders.scss +6 -0
  132. package/src/assets/styles/spec/settings/breakpoints.scss +26 -0
  133. package/src/assets/styles/spec/settings/fonts.scss +4 -0
  134. package/src/assets/styles/spec/settings/index.scss +4 -0
  135. package/src/assets/styles/spec/settings/materialColors.scss +550 -0
  136. package/src/assets/styles/spec/tools/index.scss +1 -0
  137. package/src/assets/styles/spec/tools/mixins/clearfix.scss +15 -0
  138. package/src/assets/styles/spec/tools/mixins/index.scss +3 -0
  139. package/src/assets/styles/spec/tools/mixins/mediaQueriesRanges.scss +58 -0
  140. package/src/assets/styles/spec/tools/mixins/placeholder.scss +10 -0
  141. package/src/assets/styles/spec/utils/colors.scss +33 -0
  142. package/src/assets/styles/spec/utils/index.scss +2 -0
  143. package/src/assets/styles/spec/utils/layout/helpers/border.scss +78 -0
  144. package/src/assets/styles/spec/utils/layout/helpers/flex.scss +220 -0
  145. package/src/assets/styles/spec/utils/layout/helpers/index.scss +11 -0
  146. package/src/assets/styles/spec/utils/layout/helpers/layout.scss +137 -0
  147. package/src/assets/styles/spec/utils/layout/helpers/lists.scss +23 -0
  148. package/src/assets/styles/spec/utils/layout/helpers/margin.scss +266 -0
  149. package/src/assets/styles/spec/utils/layout/helpers/objects.scss +91 -0
  150. package/src/assets/styles/spec/utils/layout/helpers/padding.scss +147 -0
  151. package/src/assets/styles/spec/utils/layout/helpers/positions.scss +118 -0
  152. package/src/assets/styles/spec/utils/layout/helpers/pseudo.scss +6 -0
  153. package/src/assets/styles/spec/utils/layout/helpers/sizes.scss +157 -0
  154. package/src/assets/styles/spec/utils/layout/helpers/typography.scss +127 -0
  155. package/src/assets/styles/spec/utils/layout/index.scss +3 -0
  156. package/src/assets/styles/spec/utils/layout/mixins/generateResponsive.scss +25 -0
  157. package/src/assets/styles/spec/utils/layout/mixins/index.scss +2 -0
  158. package/src/assets/styles/spec/utils/layout/mixins/mediaQueryCondition.scss +28 -0
  159. package/src/assets/styles/spec/utils/layout/utils/center.scss +54 -0
  160. package/src/assets/styles/spec/utils/layout/utils/gap.scss +229 -0
  161. package/src/assets/styles/spec/utils/layout/utils/index.scss +5 -0
  162. package/src/assets/styles/spec/utils/layout/utils/layers.scss +5 -0
  163. package/src/assets/styles/spec/utils/layout/utils/peers.scss +35 -0
  164. package/src/assets/styles/utils/mobile.scss +954 -0
  165. package/src/assets/styles/utils/theme.css +97 -0
  166. package/src/assets/styles/vendor/datepicker.scss +183 -0
  167. package/src/assets/styles/vendor/font-awesome.css +2337 -0
  168. package/src/assets/styles/vendor/fullcalendar.scss +217 -0
  169. package/src/assets/styles/vendor/index.scss +8 -0
  170. package/src/assets/styles/vendor/jquery.datatables.scss +162 -0
  171. package/src/assets/styles/vendor/perfectScrollbar.scss +4 -0
  172. package/src/assets/styles/vendor/sparkline.scss +6 -0
  173. package/src/assets/styles/vendor/themify-icons.css +1081 -0
  174. package/src/basic-table.html +725 -0
  175. package/src/blank.html +532 -0
  176. package/src/buttons.html +477 -0
  177. package/src/calendar.html +702 -0
  178. package/src/charts.html +691 -0
  179. package/src/chat.html +740 -0
  180. package/src/compose.html +653 -0
  181. package/src/datatable.html +1019 -0
  182. package/src/email.html +1002 -0
  183. package/src/forms.html +770 -0
  184. package/src/google-maps.html +540 -0
  185. package/src/index.html +1100 -0
  186. package/src/signin.html +107 -0
  187. package/src/signup.html +104 -0
  188. package/src/test.html +96 -0
  189. package/src/ui.html +941 -0
  190. package/src/vector-maps.html +539 -0
  191. package/webpack.config.js +3 -0
@@ -0,0 +1,379 @@
1
+ // DataTable implementation
2
+
3
+ export default (function () {
4
+
5
+ // Vanilla JS DataTable implementation
6
+ class VanillaDataTable {
7
+ constructor(element, options = {}) {
8
+ this.element = element;
9
+ this.options = {
10
+ sortable: true,
11
+ searchable: true,
12
+ pagination: true,
13
+ pageSize: 10,
14
+ ...options,
15
+ };
16
+
17
+ this.originalData = [];
18
+ this.filteredData = [];
19
+ this.currentPage = 1;
20
+ this.sortColumn = null;
21
+ this.sortDirection = 'asc';
22
+
23
+ this.init();
24
+ }
25
+
26
+ init() {
27
+ this.extractData();
28
+ this.createControls();
29
+ this.applyStyles();
30
+ this.bindEvents();
31
+ this.render();
32
+ }
33
+
34
+ extractData() {
35
+ const rows = this.element.querySelectorAll('tbody tr');
36
+ this.originalData = Array.from(rows).map(row => {
37
+ const cells = row.querySelectorAll('td');
38
+ return Array.from(cells).map(cell => cell.textContent.trim());
39
+ });
40
+ this.filteredData = [...this.originalData];
41
+ }
42
+
43
+ createControls() {
44
+ const wrapper = document.createElement('div');
45
+ wrapper.className = 'datatable-wrapper';
46
+
47
+ // Create search input
48
+ if (this.options.searchable) {
49
+ const searchWrapper = document.createElement('div');
50
+ searchWrapper.className = 'datatable-search';
51
+ searchWrapper.innerHTML = `
52
+ <label>
53
+ Search:
54
+ <input type="text" class="form-control" placeholder="Search...">
55
+ </label>
56
+ `;
57
+ wrapper.appendChild(searchWrapper);
58
+ }
59
+
60
+ // Create pagination info
61
+ if (this.options.pagination) {
62
+ const infoWrapper = document.createElement('div');
63
+ infoWrapper.className = 'datatable-info';
64
+ wrapper.appendChild(infoWrapper);
65
+ }
66
+
67
+ // Wrap the table
68
+ this.element.parentNode.insertBefore(wrapper, this.element);
69
+ wrapper.appendChild(this.element);
70
+
71
+ // Create pagination controls
72
+ if (this.options.pagination) {
73
+ const paginationWrapper = document.createElement('div');
74
+ paginationWrapper.className = 'datatable-pagination';
75
+ wrapper.appendChild(paginationWrapper);
76
+ }
77
+
78
+ this.wrapper = wrapper;
79
+ }
80
+
81
+ applyStyles() {
82
+ // Apply Bootstrap-like styles
83
+ this.element.classList.add('table', 'table-striped', 'table-bordered');
84
+
85
+ // Add custom styles
86
+ const style = document.createElement('style');
87
+ style.textContent = `
88
+ .datatable-wrapper {
89
+ margin: 20px 0;
90
+ }
91
+
92
+ .datatable-search {
93
+ margin-bottom: 15px;
94
+ }
95
+
96
+ .datatable-search input {
97
+ width: 250px;
98
+ display: inline-block;
99
+ margin-left: 5px;
100
+ }
101
+
102
+ .datatable-info {
103
+ margin-top: 15px;
104
+ color: var(--c-text-muted, #6c757d);
105
+ font-size: 14px;
106
+ }
107
+
108
+ .datatable-pagination {
109
+ margin-top: 15px;
110
+ display: flex;
111
+ justify-content: center;
112
+ }
113
+
114
+ .datatable-pagination button {
115
+ background: var(--c-bkg-card, #fff);
116
+ border: 1px solid var(--c-border, #dee2e6);
117
+ color: var(--c-text-base, #333);
118
+ padding: 6px 12px;
119
+ margin: 0 2px;
120
+ cursor: pointer;
121
+ border-radius: 4px;
122
+ }
123
+
124
+ .datatable-pagination button:hover {
125
+ background: var(--c-primary, #007bff);
126
+ color: white;
127
+ }
128
+
129
+ .datatable-pagination button.active {
130
+ background: var(--c-primary, #007bff);
131
+ color: white;
132
+ }
133
+
134
+ .datatable-pagination button:disabled {
135
+ opacity: 0.6;
136
+ cursor: not-allowed;
137
+ }
138
+
139
+ .datatable-sort {
140
+ cursor: pointer;
141
+ user-select: none;
142
+ position: relative;
143
+ }
144
+
145
+ .datatable-sort:hover {
146
+ background: var(--c-bkg-card, #f8f9fa);
147
+ }
148
+
149
+ .datatable-sort::after {
150
+ content: '↕';
151
+ position: absolute;
152
+ right: 8px;
153
+ opacity: 0.5;
154
+ }
155
+
156
+ .datatable-sort.asc::after {
157
+ content: '↑';
158
+ opacity: 1;
159
+ }
160
+
161
+ .datatable-sort.desc::after {
162
+ content: '↓';
163
+ opacity: 1;
164
+ }
165
+ `;
166
+ document.head.appendChild(style);
167
+ }
168
+
169
+ bindEvents() {
170
+ // Search functionality
171
+ if (this.options.searchable) {
172
+ const searchInput = this.wrapper.querySelector('.datatable-search input');
173
+ searchInput.addEventListener('input', (e) => {
174
+ this.search(e.target.value);
175
+ });
176
+ }
177
+
178
+ // Sorting functionality
179
+ if (this.options.sortable) {
180
+ const headers = this.element.querySelectorAll('thead th');
181
+ headers.forEach((header, index) => {
182
+ header.classList.add('datatable-sort');
183
+ header.addEventListener('click', () => {
184
+ this.sort(index);
185
+ });
186
+ });
187
+ }
188
+ }
189
+
190
+ search(query) {
191
+ if (!query) {
192
+ this.filteredData = [...this.originalData];
193
+ } else {
194
+ this.filteredData = this.originalData.filter(row =>
195
+ row.some(cell =>
196
+ cell.toLowerCase().includes(query.toLowerCase())
197
+ )
198
+ );
199
+ }
200
+ this.currentPage = 1;
201
+ this.render();
202
+ }
203
+
204
+ sort(columnIndex) {
205
+ if (this.sortColumn === columnIndex) {
206
+ this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
207
+ } else {
208
+ this.sortColumn = columnIndex;
209
+ this.sortDirection = 'asc';
210
+ }
211
+
212
+ this.filteredData.sort((a, b) => {
213
+ const aVal = a[columnIndex];
214
+ const bVal = b[columnIndex];
215
+
216
+ // Try to parse as numbers
217
+ const aNum = parseFloat(aVal);
218
+ const bNum = parseFloat(bVal);
219
+
220
+ let comparison = 0;
221
+ if (!isNaN(aNum) && !isNaN(bNum)) {
222
+ comparison = aNum - bNum;
223
+ } else {
224
+ comparison = aVal.localeCompare(bVal);
225
+ }
226
+
227
+ return this.sortDirection === 'asc' ? comparison : -comparison;
228
+ });
229
+
230
+ this.updateSortHeaders();
231
+ this.render();
232
+ }
233
+
234
+ updateSortHeaders() {
235
+ const headers = this.element.querySelectorAll('thead th');
236
+ headers.forEach((header, index) => {
237
+ header.classList.remove('asc', 'desc');
238
+ if (index === this.sortColumn) {
239
+ header.classList.add(this.sortDirection);
240
+ }
241
+ });
242
+ }
243
+
244
+ render() {
245
+ const tbody = this.element.querySelector('tbody');
246
+ const startIndex = (this.currentPage - 1) * this.options.pageSize;
247
+ const endIndex = startIndex + this.options.pageSize;
248
+ const pageData = this.filteredData.slice(startIndex, endIndex);
249
+
250
+ // Clear tbody
251
+ tbody.innerHTML = '';
252
+
253
+ // Add rows
254
+ pageData.forEach(rowData => {
255
+ const row = document.createElement('tr');
256
+ rowData.forEach(cellData => {
257
+ const cell = document.createElement('td');
258
+ cell.textContent = cellData;
259
+ row.appendChild(cell);
260
+ });
261
+ tbody.appendChild(row);
262
+ });
263
+
264
+ // Update pagination
265
+ if (this.options.pagination) {
266
+ this.updatePagination();
267
+ }
268
+
269
+ // Update info
270
+ this.updateInfo();
271
+ }
272
+
273
+ updatePagination() {
274
+ const totalPages = Math.ceil(this.filteredData.length / this.options.pageSize);
275
+ const paginationWrapper = this.wrapper.querySelector('.datatable-pagination');
276
+
277
+ paginationWrapper.innerHTML = '';
278
+
279
+ if (totalPages <= 1) return;
280
+
281
+ // Previous button
282
+ const prevBtn = document.createElement('button');
283
+ prevBtn.textContent = 'Previous';
284
+ prevBtn.disabled = this.currentPage === 1;
285
+ prevBtn.addEventListener('click', () => {
286
+ if (this.currentPage > 1) {
287
+ this.currentPage--;
288
+ this.render();
289
+ }
290
+ });
291
+ paginationWrapper.appendChild(prevBtn);
292
+
293
+ // Page numbers
294
+ for (let i = 1; i <= totalPages; i++) {
295
+ const pageBtn = document.createElement('button');
296
+ pageBtn.textContent = i;
297
+ pageBtn.classList.toggle('active', i === this.currentPage);
298
+ pageBtn.addEventListener('click', () => {
299
+ this.currentPage = i;
300
+ this.render();
301
+ });
302
+ paginationWrapper.appendChild(pageBtn);
303
+ }
304
+
305
+ // Next button
306
+ const nextBtn = document.createElement('button');
307
+ nextBtn.textContent = 'Next';
308
+ nextBtn.disabled = this.currentPage === totalPages;
309
+ nextBtn.addEventListener('click', () => {
310
+ if (this.currentPage < totalPages) {
311
+ this.currentPage++;
312
+ this.render();
313
+ }
314
+ });
315
+ paginationWrapper.appendChild(nextBtn);
316
+ }
317
+
318
+ updateInfo() {
319
+ const infoWrapper = this.wrapper.querySelector('.datatable-info');
320
+ if (!infoWrapper) return;
321
+
322
+ const startIndex = (this.currentPage - 1) * this.options.pageSize + 1;
323
+ const endIndex = Math.min(startIndex + this.options.pageSize - 1, this.filteredData.length);
324
+ const total = this.filteredData.length;
325
+
326
+ infoWrapper.textContent = `Showing ${startIndex} to ${endIndex} of ${total} entries`;
327
+ }
328
+
329
+ destroy() {
330
+ if (this.wrapper && this.wrapper.parentNode) {
331
+ this.wrapper.parentNode.replaceChild(this.element, this.wrapper);
332
+ }
333
+ }
334
+ }
335
+
336
+ // Initialize DataTable
337
+ const initializeDataTable = () => {
338
+ const tableElement = document.getElementById('dataTable');
339
+ if (tableElement) {
340
+ // Clean up existing instance
341
+ if (tableElement.dataTableInstance) {
342
+ tableElement.dataTableInstance.destroy();
343
+ }
344
+
345
+ // Create new instance
346
+ const dataTable = new VanillaDataTable(tableElement, {
347
+ sortable: true,
348
+ searchable: true,
349
+ pagination: true,
350
+ pageSize: 10,
351
+ });
352
+
353
+ // Store instance for cleanup
354
+ tableElement.dataTableInstance = dataTable;
355
+ }
356
+ };
357
+
358
+ // Initialize on load
359
+ initializeDataTable();
360
+
361
+ // Reinitialize on theme change
362
+ window.addEventListener('adminator:themeChanged', () => {
363
+ setTimeout(initializeDataTable, 100);
364
+ });
365
+
366
+ // Cleanup on page unload
367
+ window.addEventListener('beforeunload', () => {
368
+ const tableElement = document.getElementById('dataTable');
369
+ if (tableElement && tableElement.dataTableInstance) {
370
+ tableElement.dataTableInstance.destroy();
371
+ }
372
+ });
373
+
374
+ // Return public API
375
+ return {
376
+ init: initializeDataTable,
377
+ VanillaDataTable,
378
+ };
379
+ }());
@@ -0,0 +1,302 @@
1
+ import DateUtils from '../utils/date.js';
2
+
3
+ export default (function () {
4
+
5
+ // Enhanced HTML5 date picker with vanilla JS
6
+ class VanillaDatePicker {
7
+ constructor(element, options = {}) {
8
+ this.element = element;
9
+ this.options = {
10
+ format: 'yyyy-mm-dd',
11
+ autoclose: true,
12
+ todayHighlight: true,
13
+ ...options,
14
+ };
15
+
16
+ this.init();
17
+ }
18
+
19
+ init() {
20
+ this.convertToHTML5();
21
+ this.enhanceInput();
22
+ this.applyStyles();
23
+ this.bindEvents();
24
+ }
25
+
26
+ convertToHTML5() {
27
+ // Convert input to HTML5 date type
28
+ this.element.type = 'date';
29
+ this.element.classList.add('form-control', 'vanilla-datepicker');
30
+
31
+ // Remove placeholder since HTML5 date inputs don't need it
32
+ this.element.removeAttribute('placeholder');
33
+
34
+ // Set default value to today if no value is set
35
+ if (!this.element.value) {
36
+ this.element.value = DateUtils.form.toInputValue(DateUtils.now());
37
+ }
38
+
39
+ // Ensure proper styling
40
+ this.element.style.minHeight = '38px';
41
+ this.element.style.lineHeight = '1.5';
42
+ this.element.style.cursor = 'pointer';
43
+ }
44
+
45
+ enhanceInput() {
46
+ // Create wrapper for enhanced functionality
47
+ const wrapper = document.createElement('div');
48
+ wrapper.className = 'vanilla-datepicker-wrapper';
49
+ wrapper.style.position = 'relative';
50
+
51
+ // Wrap the input
52
+ this.element.parentNode.insertBefore(wrapper, this.element);
53
+ wrapper.appendChild(this.element);
54
+
55
+ // Add calendar icon if input is in an input group
56
+ const inputGroup = this.element.closest('.input-group');
57
+ if (inputGroup) {
58
+ const calendarIcon = inputGroup.querySelector('.input-group-text i.ti-calendar');
59
+ if (calendarIcon) {
60
+ calendarIcon.addEventListener('click', (e) => {
61
+ e.preventDefault();
62
+ e.stopPropagation();
63
+ this.openPicker();
64
+ });
65
+ }
66
+ }
67
+
68
+ this.wrapper = wrapper;
69
+ }
70
+
71
+ applyStyles() {
72
+ // Add custom styles for enhanced appearance
73
+ const style = document.createElement('style');
74
+ style.textContent = `
75
+ .vanilla-datepicker-wrapper {
76
+ position: relative;
77
+ }
78
+
79
+ .vanilla-datepicker {
80
+ width: 100%;
81
+ padding: 6px 12px;
82
+ border: 1px solid var(--c-border, #ced4da);
83
+ border-radius: 4px;
84
+ background-color: var(--c-bkg-card, #fff);
85
+ color: var(--c-text-base, #495057);
86
+ font-size: 14px;
87
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
88
+ }
89
+
90
+ .vanilla-datepicker:focus {
91
+ outline: none;
92
+ border-color: var(--c-primary, #007bff);
93
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
94
+ }
95
+
96
+ .vanilla-datepicker::-webkit-calendar-picker-indicator {
97
+ cursor: pointer;
98
+ border-radius: 4px;
99
+ margin-right: 2px;
100
+ opacity: 0.6;
101
+ transition: opacity 0.15s ease-in-out;
102
+ }
103
+
104
+ .vanilla-datepicker::-webkit-calendar-picker-indicator:hover {
105
+ opacity: 1;
106
+ }
107
+
108
+ .vanilla-datepicker::-webkit-datetime-edit-fields-wrapper {
109
+ padding: 0;
110
+ }
111
+
112
+ .vanilla-datepicker::-webkit-datetime-edit-month-field,
113
+ .vanilla-datepicker::-webkit-datetime-edit-day-field,
114
+ .vanilla-datepicker::-webkit-datetime-edit-year-field {
115
+ color: var(--c-text-base, #495057);
116
+ }
117
+
118
+ .vanilla-datepicker::-webkit-datetime-edit-text {
119
+ color: var(--c-text-muted, #6c757d);
120
+ }
121
+
122
+ /* Dark mode support */
123
+ [data-theme="dark"] .vanilla-datepicker {
124
+ background-color: var(--c-bkg-card, #1f2937);
125
+ color: var(--c-text-base, #f9fafb);
126
+ border-color: var(--c-border, #374151);
127
+ }
128
+
129
+ [data-theme="dark"] .vanilla-datepicker::-webkit-calendar-picker-indicator {
130
+ filter: invert(1);
131
+ }
132
+
133
+ .datepicker-today-indicator {
134
+ position: absolute;
135
+ top: 2px;
136
+ right: 8px;
137
+ width: 6px;
138
+ height: 6px;
139
+ background-color: var(--c-primary, #007bff);
140
+ border-radius: 50%;
141
+ opacity: 0.8;
142
+ pointer-events: none;
143
+ }
144
+
145
+ .datepicker-animation {
146
+ animation: datepicker-highlight 0.3s ease-in-out;
147
+ }
148
+
149
+ @keyframes datepicker-highlight {
150
+ 0% { transform: scale(1); }
151
+ 50% { transform: scale(1.02); }
152
+ 100% { transform: scale(1); }
153
+ }
154
+ `;
155
+
156
+ // Only add the style if it doesn't exist
157
+ if (!document.querySelector('style[data-vanilla-datepicker-styles]')) {
158
+ style.setAttribute('data-vanilla-datepicker-styles', 'true');
159
+ document.head.appendChild(style);
160
+ }
161
+ }
162
+
163
+ bindEvents() {
164
+ // Handle click events
165
+ this.element.addEventListener('click', () => {
166
+ this.openPicker();
167
+ });
168
+
169
+ // Handle keyboard events
170
+ this.element.addEventListener('keydown', (e) => {
171
+ if (e.key === 'Enter' || e.key === ' ') {
172
+ this.openPicker();
173
+ }
174
+ });
175
+
176
+ // Handle change events
177
+ this.element.addEventListener('change', (e) => {
178
+ this.handleDateChange(e);
179
+ });
180
+
181
+ // Handle focus events
182
+ this.element.addEventListener('focus', () => {
183
+ this.element.classList.add('datepicker-animation');
184
+ setTimeout(() => {
185
+ this.element.classList.remove('datepicker-animation');
186
+ }, 300);
187
+ });
188
+ }
189
+
190
+ openPicker() {
191
+ this.element.focus();
192
+
193
+ // Try to open the native date picker
194
+ if (this.element.showPicker && typeof this.element.showPicker === 'function') {
195
+ try {
196
+ this.element.showPicker();
197
+ } catch {
198
+ // Fallback for browsers that don't support showPicker
199
+ }
200
+ }
201
+ }
202
+
203
+ handleDateChange(e) {
204
+ const selectedDate = e.target.value;
205
+
206
+ if (selectedDate) {
207
+ // Add visual feedback
208
+ this.element.classList.add('datepicker-animation');
209
+ setTimeout(() => {
210
+ this.element.classList.remove('datepicker-animation');
211
+ }, 300);
212
+
213
+ // Trigger custom event
214
+ const changeEvent = new CustomEvent('datepicker:change', {
215
+ detail: {
216
+ date: selectedDate,
217
+ formattedDate: this.formatDate(selectedDate),
218
+ },
219
+ });
220
+ this.element.dispatchEvent(changeEvent);
221
+ }
222
+ }
223
+
224
+ formatDate(dateString) {
225
+ const date = new Date(dateString);
226
+ return DateUtils.format(date, this.options.format);
227
+ }
228
+
229
+ setDate(dateString) {
230
+ this.element.value = dateString;
231
+ this.handleDateChange({ target: this.element });
232
+ }
233
+
234
+ getDate() {
235
+ return this.element.value;
236
+ }
237
+
238
+ destroy() {
239
+ if (this.wrapper && this.wrapper.parentNode) {
240
+ this.wrapper.parentNode.replaceChild(this.element, this.wrapper);
241
+ }
242
+ }
243
+ }
244
+
245
+ // Initialize date pickers
246
+ const initializeDatePickers = () => {
247
+ // Start date pickers
248
+ const startDateElements = document.querySelectorAll('.start-date');
249
+ startDateElements.forEach(element => {
250
+ if (element.vanillaDatePicker) {
251
+ element.vanillaDatePicker.destroy();
252
+ }
253
+
254
+ const datePicker = new VanillaDatePicker(element, {
255
+ format: 'yyyy-mm-dd',
256
+ autoclose: true,
257
+ todayHighlight: true,
258
+ });
259
+
260
+ element.vanillaDatePicker = datePicker;
261
+ });
262
+
263
+ // End date pickers
264
+ const endDateElements = document.querySelectorAll('.end-date');
265
+ endDateElements.forEach(element => {
266
+ if (element.vanillaDatePicker) {
267
+ element.vanillaDatePicker.destroy();
268
+ }
269
+
270
+ const datePicker = new VanillaDatePicker(element, {
271
+ format: 'yyyy-mm-dd',
272
+ autoclose: true,
273
+ todayHighlight: true,
274
+ });
275
+
276
+ element.vanillaDatePicker = datePicker;
277
+ });
278
+ };
279
+
280
+ // Initialize on load
281
+ initializeDatePickers();
282
+
283
+ // Reinitialize on theme change
284
+ window.addEventListener('adminator:themeChanged', () => {
285
+ setTimeout(initializeDatePickers, 100);
286
+ });
287
+
288
+ // Cleanup on page unload
289
+ window.addEventListener('beforeunload', () => {
290
+ document.querySelectorAll('.start-date, .end-date').forEach(element => {
291
+ if (element.vanillaDatePicker) {
292
+ element.vanillaDatePicker.destroy();
293
+ }
294
+ });
295
+ });
296
+
297
+ // Return public API
298
+ return {
299
+ init: initializeDatePickers,
300
+ VanillaDatePicker,
301
+ };
302
+ }());
@@ -0,0 +1,25 @@
1
+ export default (function () {
2
+ // Email side toggle functionality
3
+ const emailSideToggle = document.querySelector('.email-side-toggle');
4
+ const emailApp = document.querySelector('.email-app');
5
+
6
+ if (emailSideToggle && emailApp) {
7
+ emailSideToggle.addEventListener('click', e => {
8
+ emailApp.classList.toggle('side-active');
9
+ e.preventDefault();
10
+ });
11
+ }
12
+
13
+ // Email list item and back to mailbox functionality
14
+ const emailListItems = document.querySelectorAll('.email-list-item, .back-to-mailbox');
15
+ const emailContent = document.querySelector('.email-content');
16
+
17
+ if (emailListItems.length > 0 && emailContent) {
18
+ emailListItems.forEach(item => {
19
+ item.addEventListener('click', e => {
20
+ emailContent.classList.toggle('open');
21
+ e.preventDefault();
22
+ });
23
+ });
24
+ }
25
+ }())