canvasframework 0.5.16 → 0.5.18

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 (112) hide show
  1. package/dist/canvasframework.js +2 -0
  2. package/dist/canvasframework.js.LICENSE.txt +1 -0
  3. package/package.json +18 -17
  4. package/components/Accordion.js +0 -265
  5. package/components/AndroidDatePickerDialog.js +0 -406
  6. package/components/AppBar.js +0 -398
  7. package/components/AudioPlayer.js +0 -611
  8. package/components/Avatar.js +0 -202
  9. package/components/Banner.js +0 -342
  10. package/components/BottomNavigationBar.js +0 -433
  11. package/components/BottomSheet.js +0 -234
  12. package/components/Button.js +0 -360
  13. package/components/Camera.js +0 -644
  14. package/components/Card.js +0 -193
  15. package/components/Chart.js +0 -700
  16. package/components/Checkbox.js +0 -166
  17. package/components/Chip.js +0 -212
  18. package/components/CircularProgress.js +0 -327
  19. package/components/ContextMenu.js +0 -116
  20. package/components/DatePicker.js +0 -298
  21. package/components/Dialog.js +0 -337
  22. package/components/Divider.js +0 -125
  23. package/components/Drawer.js +0 -276
  24. package/components/FAB.js +0 -270
  25. package/components/FileUpload.js +0 -315
  26. package/components/FloatedCamera.js +0 -644
  27. package/components/IOSDatePickerWheel.js +0 -430
  28. package/components/ImageCarousel.js +0 -219
  29. package/components/ImageComponent.js +0 -223
  30. package/components/Input.js +0 -831
  31. package/components/InputDatalist.js +0 -723
  32. package/components/InputTags.js +0 -624
  33. package/components/List.js +0 -95
  34. package/components/ListItem.js +0 -269
  35. package/components/Modal.js +0 -364
  36. package/components/MorphingFAB.js +0 -428
  37. package/components/MultiSelectDialog.js +0 -206
  38. package/components/NumberInput.js +0 -271
  39. package/components/PasswordInput.js +0 -462
  40. package/components/ProgressBar.js +0 -88
  41. package/components/QRCodeReader.js +0 -539
  42. package/components/RadioButton.js +0 -151
  43. package/components/SearchInput.js +0 -315
  44. package/components/SegmentedControl.js +0 -357
  45. package/components/Select.js +0 -199
  46. package/components/SelectDialog.js +0 -255
  47. package/components/Slider.js +0 -113
  48. package/components/SliverAppBar.js +0 -139
  49. package/components/Snackbar.js +0 -243
  50. package/components/SpeedDialFAB.js +0 -397
  51. package/components/Stepper.js +0 -281
  52. package/components/SwipeableListItem.js +0 -327
  53. package/components/Switch.js +0 -147
  54. package/components/Table.js +0 -492
  55. package/components/Tabs.js +0 -423
  56. package/components/Text.js +0 -141
  57. package/components/TextField.js +0 -151
  58. package/components/TimePicker.js +0 -934
  59. package/components/Toast.js +0 -236
  60. package/components/TreeView.js +0 -420
  61. package/components/Video.js +0 -397
  62. package/components/View.js +0 -140
  63. package/components/VirtualList.js +0 -120
  64. package/core/CanvasFramework.js +0 -3034
  65. package/core/Component.js +0 -243
  66. package/core/ThemeManager.js +0 -358
  67. package/core/UIBuilder.js +0 -267
  68. package/core/WebGLCanvasAdapter.js +0 -782
  69. package/features/Column.js +0 -43
  70. package/features/Grid.js +0 -47
  71. package/features/LayoutComponent.js +0 -43
  72. package/features/OpenStreetMap.js +0 -310
  73. package/features/Positioned.js +0 -33
  74. package/features/PullToRefresh.js +0 -328
  75. package/features/Row.js +0 -40
  76. package/features/SignaturePad.js +0 -257
  77. package/features/Skeleton.js +0 -193
  78. package/features/Stack.js +0 -21
  79. package/index.js +0 -119
  80. package/manager/AccessibilityManager.js +0 -107
  81. package/manager/ErrorHandler.js +0 -59
  82. package/manager/FeatureFlags.js +0 -60
  83. package/manager/MemoryManager.js +0 -107
  84. package/manager/PerformanceMonitor.js +0 -84
  85. package/manager/SecurityManager.js +0 -54
  86. package/utils/AnimationEngine.js +0 -734
  87. package/utils/CryptoManager.js +0 -303
  88. package/utils/DataStore.js +0 -403
  89. package/utils/DevTools.js +0 -1618
  90. package/utils/DevToolsConsole.js +0 -201
  91. package/utils/EventBus.js +0 -407
  92. package/utils/FetchClient.js +0 -74
  93. package/utils/FirebaseAuth.js +0 -653
  94. package/utils/FirebaseCore.js +0 -246
  95. package/utils/FirebaseFirestore.js +0 -581
  96. package/utils/FirebaseFunctions.js +0 -97
  97. package/utils/FirebaseRealtimeDB.js +0 -498
  98. package/utils/FirebaseStorage.js +0 -612
  99. package/utils/FormValidator.js +0 -355
  100. package/utils/GeoLocationService.js +0 -62
  101. package/utils/I18n.js +0 -207
  102. package/utils/IndexedDBManager.js +0 -273
  103. package/utils/InspectionOverlay.js +0 -308
  104. package/utils/NotificationManager.js +0 -60
  105. package/utils/OfflineSyncManager.js +0 -342
  106. package/utils/PayPalPayment.js +0 -678
  107. package/utils/QueryBuilder.js +0 -478
  108. package/utils/SafeArea.js +0 -64
  109. package/utils/SecureStorage.js +0 -289
  110. package/utils/StateManager.js +0 -207
  111. package/utils/StripePayment.js +0 -552
  112. package/utils/WebSocketClient.js +0 -66
@@ -1,406 +0,0 @@
1
- import Component from '../core/Component.js';
2
- /**
3
- * Dialog de sélection de date Android
4
- * @class
5
- * @extends Component
6
- * @property {Date} selectedDate - Date sélectionnée
7
- * @property {Function} onChange - Callback au changement
8
- * @property {number} currentMonth - Mois courant
9
- * @property {number} currentYear - Année courante
10
- * @property {number|null} hoveredDay - Jour survolé
11
- * @property {number} dialogWidth - Largeur du dialog
12
- * @property {number} dialogHeight - Hauteur du dialog
13
- * @property {number} headerHeight - Hauteur de l'en-tête
14
- * @property {number} daySize - Taille d'un jour
15
- * @property {number} opacity - Opacité
16
- * @property {boolean} isVisible - Visibilité
17
- */
18
- class AndroidDatePickerDialog extends Component {
19
- /**
20
- * Crée une instance de AndroidDatePickerDialog
21
- * @param {CanvasFramework} framework - Framework parent
22
- * @param {Object} [options={}] - Options de configuration
23
- * @param {Date} [options.selectedDate=new Date()] - Date initiale
24
- * @param {Function} [options.onChange] - Callback au changement
25
- */
26
- constructor(framework, options = {}) {
27
- super(framework, {
28
- x: 0,
29
- y: 0,
30
- width: framework.width,
31
- height: framework.height,
32
- visible: false
33
- });
34
-
35
- this.selectedDate = options.selectedDate || new Date();
36
- this.onChange = options.onChange;
37
- this.currentMonth = this.selectedDate.getMonth();
38
- this.currentYear = this.selectedDate.getFullYear();
39
- this.hoveredDay = null;
40
-
41
- // Options de personnalisation
42
- this.headerBgColor = options.headerBgColor || '#6200EE';
43
- this.selectedColor = options.selectedColor || '#6200EE';
44
- this.buttonColor = options.buttonColor || '#6200EE';
45
- this.todayColor = options.todayColor || '#6200EE';
46
- this.textColor = options.textColor || '#000000';
47
- this.dayNamesColor = options.dayNamesColor || '#666666';
48
-
49
- this.dialogWidth = Math.min(320, framework.width - 40);
50
- this.dialogHeight = 420;
51
- this.headerHeight = 100;
52
- this.daySize = (this.dialogWidth - 40) / 7;
53
-
54
- this.opacity = 0;
55
- this.isVisible = false;
56
-
57
- this.onPress = this.handlePress.bind(this);
58
- }
59
-
60
- /**
61
- * Affiche le dialog
62
- */
63
- show() {
64
- this.isVisible = true;
65
- this.visible = true;
66
- const fadeIn = () => {
67
- this.opacity += 0.1;
68
- if (this.opacity < 1) requestAnimationFrame(fadeIn);
69
- };
70
- fadeIn();
71
- }
72
-
73
- /**
74
- * Cache le dialog
75
- */
76
- hide() {
77
- const fadeOut = () => {
78
- this.opacity -= 0.1;
79
- if (this.opacity > 0) {
80
- requestAnimationFrame(fadeOut);
81
- } else {
82
- this.isVisible = false;
83
- this.visible = false;
84
- this.framework.remove(this);
85
- }
86
- };
87
- fadeOut();
88
- }
89
-
90
- /**
91
- * Obtient le nombre de jours dans un mois
92
- * @param {number} month - Mois (0-11)
93
- * @param {number} year - Année
94
- * @returns {number} Nombre de jours
95
- * @private
96
- */
97
- getDaysInMonth(month, year) {
98
- return new Date(year, month + 1, 0).getDate();
99
- }
100
-
101
- /**
102
- * Obtient le premier jour de la semaine d'un mois
103
- * @param {number} month - Mois (0-11)
104
- * @param {number} year - Année
105
- * @returns {number} Jour de la semaine (0-6)
106
- * @private
107
- */
108
- getFirstDayOfMonth(month, year) {
109
- return new Date(year, month, 1).getDay();
110
- }
111
-
112
- /**
113
- * Passe au mois précédent
114
- * @private
115
- */
116
- previousMonth() {
117
- this.currentMonth--;
118
- if (this.currentMonth < 0) {
119
- this.currentMonth = 11;
120
- this.currentYear--;
121
- }
122
- }
123
-
124
- /**
125
- * Passe au mois suivant
126
- * @private
127
- */
128
- nextMonth() {
129
- this.currentMonth++;
130
- if (this.currentMonth > 11) {
131
- this.currentMonth = 0;
132
- this.currentYear++;
133
- }
134
- }
135
-
136
- /**
137
- * Sélectionne un jour
138
- * @param {number} day - Jour à sélectionner
139
- * @private
140
- */
141
- selectDate(day) {
142
- this.selectedDate = new Date(this.currentYear, this.currentMonth, day);
143
- }
144
-
145
- /**
146
- * Dessine le dialog
147
- * @param {CanvasRenderingContext2D} ctx - Contexte de dessin
148
- */
149
- draw(ctx) {
150
- if (this.opacity <= 0 || !this.isVisible) return;
151
-
152
- ctx.save();
153
- ctx.globalAlpha = this.opacity;
154
-
155
- // Overlay
156
- ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
157
- ctx.fillRect(0, 0, this.framework.width, this.framework.height);
158
-
159
- const dialogX = (this.framework.width - this.dialogWidth) / 2;
160
- const dialogY = (this.framework.height - this.dialogHeight) / 2;
161
-
162
- // Dialog background
163
- ctx.fillStyle = '#FFFFFF';
164
- ctx.shadowColor = 'rgba(0, 0, 0, 0.3)';
165
- ctx.shadowBlur = 20;
166
- ctx.beginPath();
167
- this.roundRect(ctx, dialogX, dialogY, this.dialogWidth, this.dialogHeight, 4);
168
- ctx.fill();
169
-
170
- ctx.shadowColor = 'transparent';
171
-
172
- // Header coloré
173
- ctx.fillStyle = this.headerBgColor;
174
- ctx.beginPath();
175
- this.roundRect(ctx, dialogX, dialogY, this.dialogWidth, this.headerHeight, 4);
176
- ctx.rect(dialogX, dialogY + this.headerHeight - 4, this.dialogWidth, 4);
177
- ctx.fill();
178
-
179
- // Année (petit)
180
- ctx.fillStyle = 'rgba(255, 255, 255, 0.7)';
181
- ctx.font = '16px Roboto, sans-serif';
182
- ctx.textAlign = 'left';
183
- ctx.textBaseline = 'top';
184
- ctx.fillText(this.currentYear.toString(), dialogX + 20, dialogY + 20);
185
-
186
- // Date sélectionnée (grand)
187
- const monthNames = ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin',
188
- 'Juil', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'];
189
- const dayNames = ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'];
190
- const selectedDay = dayNames[this.selectedDate.getDay()];
191
- const selectedMonth = monthNames[this.selectedDate.getMonth()];
192
- const selectedDayNum = this.selectedDate.getDate();
193
-
194
- ctx.fillStyle = '#ffffff';
195
- ctx.font = 'bold 32px Roboto, sans-serif';
196
- ctx.textBaseline = 'middle';
197
- ctx.fillText(`${selectedDay}, ${selectedMonth} ${selectedDayNum}`,
198
- dialogX + 20, dialogY + this.headerHeight / 2 + 15);
199
-
200
- // Navigation mois
201
- const navY = dialogY + this.headerHeight + 20;
202
-
203
- // Bouton mois précédent
204
- ctx.fillStyle = '#666666';
205
- ctx.font = '20px sans-serif';
206
- ctx.textAlign = 'center';
207
- ctx.fillText('◀', dialogX + 30, navY);
208
-
209
- // Mois et année actuel
210
- const monthNamesLong = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
211
- 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'];
212
- ctx.font = 'bold 16px Roboto, sans-serif';
213
- ctx.fillText(`${monthNamesLong[this.currentMonth]} ${this.currentYear}`,
214
- dialogX + this.dialogWidth / 2, navY);
215
-
216
- // Bouton mois suivant
217
- ctx.fillText('▶', dialogX + this.dialogWidth - 30, navY);
218
-
219
- // Jours de la semaine
220
- const dayNamesShort = ['D', 'L', 'M', 'M', 'J', 'V', 'S'];
221
- ctx.fillStyle = '#666666';
222
- ctx.font = 'bold 12px Roboto, sans-serif';
223
-
224
- for (let i = 0; i < 7; i++) {
225
- const dayX = dialogX + 20 + i * this.daySize + this.daySize / 2;
226
- const dayY = navY + 40;
227
- ctx.fillText(dayNamesShort[i], dayX, dayY);
228
- }
229
-
230
- // Grille de jours
231
- const daysInMonth = this.getDaysInMonth(this.currentMonth, this.currentYear);
232
- const firstDay = this.getFirstDayOfMonth(this.currentMonth, this.currentYear);
233
-
234
- let dayNumber = 1;
235
- const startY = navY + 60;
236
-
237
- for (let week = 0; week < 6; week++) {
238
- for (let day = 0; day < 7; day++) {
239
- const index = week * 7 + day;
240
-
241
- if (index >= firstDay && dayNumber <= daysInMonth) {
242
- const dayX = dialogX + 20 + day * this.daySize;
243
- const dayY = startY + week * this.daySize;
244
-
245
- const isSelected = this.selectedDate.getDate() === dayNumber &&
246
- this.selectedDate.getMonth() === this.currentMonth &&
247
- this.selectedDate.getFullYear() === this.currentYear;
248
-
249
- const today = new Date();
250
- const isToday = dayNumber === today.getDate() &&
251
- this.currentMonth === today.getMonth() &&
252
- this.currentYear === today.getFullYear();
253
-
254
- // Cercle sélectionné
255
- if (isSelected) {
256
- ctx.fillStyle = '#6200EE';
257
- ctx.beginPath();
258
- ctx.arc(dayX + this.daySize / 2, dayY + this.daySize / 2,
259
- this.daySize / 2 - 2, 0, Math.PI * 2);
260
- ctx.fill();
261
- }
262
-
263
- // Cercle aujourd'hui
264
- if (isToday && !isSelected) {
265
- ctx.strokeStyle = '#6200EE';
266
- ctx.lineWidth = 2;
267
- ctx.beginPath();
268
- ctx.arc(dayX + this.daySize / 2, dayY + this.daySize / 2,
269
- this.daySize / 2 - 2, 0, Math.PI * 2);
270
- ctx.stroke();
271
- }
272
-
273
- // Numéro
274
- ctx.fillStyle = isSelected ? '#FFFFFF' : '#212121';
275
- ctx.font = '14px Roboto, sans-serif';
276
- ctx.textAlign = 'center';
277
- ctx.textBaseline = 'middle';
278
- ctx.fillText(dayNumber.toString(), dayX + this.daySize / 2, dayY + this.daySize / 2);
279
-
280
- dayNumber++;
281
- }
282
- }
283
-
284
- if (dayNumber > daysInMonth) break;
285
- }
286
-
287
- // Boutons d'action
288
- const btnY = dialogY + this.dialogHeight - 30;
289
-
290
- // Annuler
291
- ctx.fillStyle = '#6200EE';
292
- ctx.font = 'bold 14px Roboto, sans-serif';
293
- ctx.textAlign = 'right';
294
- ctx.fillText('ANNULER', dialogX + this.dialogWidth - 120, btnY);
295
-
296
- // OK
297
- ctx.fillText('OK', dialogX + this.dialogWidth - 20, btnY);
298
-
299
- ctx.restore();
300
- }
301
-
302
- /**
303
- * Gère la pression (clic)
304
- * @param {number} x - Coordonnée X
305
- * @param {number} y - Coordonnée Y
306
- * @private
307
- */
308
- handlePress(x, y) {
309
- const dialogX = (this.framework.width - this.dialogWidth) / 2;
310
- const dialogY = (this.framework.height - this.dialogHeight) / 2;
311
-
312
- // Boutons navigation
313
- const navY = dialogY + this.headerHeight + 20;
314
-
315
- if (y >= navY - 15 && y <= navY + 15) {
316
- if (x >= dialogX + 10 && x <= dialogX + 50) {
317
- this.previousMonth();
318
- return;
319
- }
320
- if (x >= dialogX + this.dialogWidth - 50 && x <= dialogX + this.dialogWidth - 10) {
321
- this.nextMonth();
322
- return;
323
- }
324
- }
325
-
326
- // Sélection d'un jour
327
- const startY = navY + 60;
328
- const daysInMonth = this.getDaysInMonth(this.currentMonth, this.currentYear);
329
- const firstDay = this.getFirstDayOfMonth(this.currentMonth, this.currentYear);
330
-
331
- let dayNumber = 1;
332
- for (let week = 0; week < 6; week++) {
333
- for (let day = 0; day < 7; day++) {
334
- const index = week * 7 + day;
335
- if (index >= firstDay && dayNumber <= daysInMonth) {
336
- const dayX = dialogX + 20 + day * this.daySize;
337
- const dayY = startY + week * this.daySize;
338
-
339
- if (x >= dayX && x <= dayX + this.daySize &&
340
- y >= dayY && y <= dayY + this.daySize) {
341
- this.selectDate(dayNumber);
342
- return;
343
- }
344
- dayNumber++;
345
- }
346
- }
347
- if (dayNumber > daysInMonth) break;
348
- }
349
-
350
- // Boutons d'action
351
- const btnY = dialogY + this.dialogHeight - 30;
352
- if (y >= btnY - 20 && y <= btnY + 20) {
353
- // Annuler
354
- if (x >= dialogX + this.dialogWidth - 180 && x <= dialogX + this.dialogWidth - 80) {
355
- this.hide();
356
- return;
357
- }
358
- // OK
359
- if (x >= dialogX + this.dialogWidth - 70 && x <= dialogX + this.dialogWidth) {
360
- if (this.onChange) this.onChange(this.selectedDate);
361
- this.hide();
362
- return;
363
- }
364
- }
365
-
366
- // Clic sur overlay pour fermer
367
- if (x < dialogX || x > dialogX + this.dialogWidth ||
368
- y < dialogY || y > dialogY + this.dialogHeight) {
369
- this.hide();
370
- }
371
- }
372
-
373
- /**
374
- * Dessine un rectangle avec coins arrondis
375
- * @param {CanvasRenderingContext2D} ctx - Contexte de dessin
376
- * @param {number} x - Position X
377
- * @param {number} y - Position Y
378
- * @param {number} width - Largeur
379
- * @param {number} height - Hauteur
380
- * @param {number} radius - Rayon des coins
381
- * @private
382
- */
383
- roundRect(ctx, x, y, width, height, radius) {
384
- ctx.beginPath();
385
- ctx.moveTo(x + radius, y);
386
- ctx.lineTo(x + width - radius, y);
387
- ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
388
- ctx.lineTo(x + width, y + height - radius);
389
- ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
390
- ctx.lineTo(x + radius, y + height);
391
- ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
392
- ctx.lineTo(x, y + radius);
393
- ctx.quadraticCurveTo(x, y, x + radius, y);
394
- ctx.closePath();
395
- }
396
-
397
- /**
398
- * Vérifie si un point est dans les limites
399
- * @returns {boolean} True si visible
400
- */
401
- isPointInside() {
402
- return this.isVisible;
403
- }
404
- }
405
-
406
- export default AndroidDatePickerDialog;