aloha-vue 2.57.0 → 2.57.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
- "version": "2.57.0",
3
+ "version": "2.57.2",
4
4
  "description": "Aloha-vue is a JavaScript library that provides a wide range of accessible components and directives for Vue.js. Accessibility is of paramount importance to us, and we have designed all our components to meet accessibility compliance criteria. This library is a valuable tool for frontend developers and has already been used in three projects, including two large-scale ones",
5
5
  "keywords": [
6
6
  "accessibility compliance criteria",
@@ -11,6 +11,7 @@ import ARequired from "../ui/ARequired/ARequired";
11
11
  import ATableFormRow from "./ATableFormRow/ATableFormRow";
12
12
  import ATranslation from "../ATranslation/ATranslation";
13
13
 
14
+ import ClassesAPI from "./compositionAPI/ClassesAPI";
14
15
  import ColumnsAPI from "./compositionAPI/ColumnsAPI";
15
16
  import ColumnsGrowAPI from "./compositionAPI/ColumnsGrowAPI";
16
17
  import DeleteAPI from "./compositionAPI/DeleteAPI";
@@ -31,6 +32,11 @@ import {
31
32
  export default {
32
33
  name: "ATableForm",
33
34
  props: {
35
+ actionsClasses: {
36
+ type: Object,
37
+ required: false,
38
+ default: () => ({}),
39
+ },
34
40
  actionsDisabledCallback: {
35
41
  type: Object,
36
42
  required: false,
@@ -55,21 +61,21 @@ export default {
55
61
  type: Array,
56
62
  required: true,
57
63
  },
58
- columnsDefaultValue: {
59
- type: [String, Number],
60
- required: false,
61
- default: "",
62
- },
63
- changeModel: {
64
- type: Function,
65
- required: false,
66
- default: undefined,
67
- },
68
- errorIcon: {
69
- type: String,
70
- required: false,
71
- default: ExclamationCircleFill,
72
- },
64
+ columnsDefaultValue: {
65
+ type: [String, Number],
66
+ required: false,
67
+ default: "",
68
+ },
69
+ changeModel: {
70
+ type: Function,
71
+ required: false,
72
+ default: undefined,
73
+ },
74
+ errorIcon: {
75
+ type: String,
76
+ required: false,
77
+ default: ExclamationCircleFill,
78
+ },
73
79
  extra: {
74
80
  type: Object,
75
81
  required: false,
@@ -140,20 +146,20 @@ export default {
140
146
  required: false,
141
147
  default: "h2",
142
148
  },
143
- prepareEditModel: {
144
- type: Function,
145
- required: false,
146
- default: undefined,
147
- },
148
- rowClass: {
149
- type: [String, Object, Array, Function],
150
- required: false,
151
- default: undefined,
152
- },
153
- rows: {
154
- type: Array,
155
- required: false,
156
- default: () => [],
149
+ prepareEditModel: {
150
+ type: Function,
151
+ required: false,
152
+ default: undefined,
153
+ },
154
+ rowClass: {
155
+ type: [String, Object, Array, Function],
156
+ required: false,
157
+ default: undefined,
158
+ },
159
+ rows: {
160
+ type: Array,
161
+ required: false,
162
+ default: () => [],
157
163
  },
158
164
  rowsFooter: {
159
165
  type: Array,
@@ -208,6 +214,10 @@ export default {
208
214
  iconsLocal,
209
215
  } = IconsAPI(props);
210
216
 
217
+ const {
218
+ classesLocal,
219
+ } = ClassesAPI(props);
220
+
211
221
  const {
212
222
  columnsStylesGrow,
213
223
  destroyColumnsGrowObserver,
@@ -292,6 +302,7 @@ export default {
292
302
  canAddRow,
293
303
  canMoveRowDown,
294
304
  canMoveRowUp,
305
+ classesLocal,
295
306
  columnsStylesGrow,
296
307
  draggedRowIndex,
297
308
  dragOverPosition,
@@ -348,14 +359,15 @@ export default {
348
359
  h("thead", {
349
360
  class: "a_table_form__head",
350
361
  }, [
351
- h(ATableFormRow, {
352
- id: this.id,
353
- allColumnsLength: this.allColumnsLength,
354
- canMoveRowDown: this.canMoveRowDown,
355
- canMoveRowUp: this.canMoveRowUp,
356
- cellTag: "th",
357
- changeModel: this.changeModel,
358
- columns: this.columns,
362
+ h(ATableFormRow, {
363
+ id: this.id,
364
+ allColumnsLength: this.allColumnsLength,
365
+ canMoveRowDown: this.canMoveRowDown,
366
+ canMoveRowUp: this.canMoveRowUp,
367
+ cellTag: "th",
368
+ changeModel: this.changeModel,
369
+ actionsClasses: this.actionsClasses,
370
+ columns: this.columns,
359
371
  columnsStylesGrow: this.columnsStylesGrow,
360
372
  draggedRowIndex: this.draggedRowIndex,
361
373
  hasActionsColumn: this.hasActionsColumn,
@@ -397,13 +409,14 @@ export default {
397
409
  rowIndex,
398
410
  });
399
411
 
400
- return h(ATableFormRow, {
401
- id: this.id,
402
- allColumnsLength: this.allColumnsLength,
403
- canMoveRowDown: this.canMoveRowDown,
404
- canMoveRowUp: this.canMoveRowUp,
405
- changeModel: this.changeModel,
406
- columns: this.columns,
412
+ return h(ATableFormRow, {
413
+ id: this.id,
414
+ allColumnsLength: this.allColumnsLength,
415
+ canMoveRowDown: this.canMoveRowDown,
416
+ canMoveRowUp: this.canMoveRowUp,
417
+ changeModel: this.changeModel,
418
+ actionsClasses: this.actionsClasses,
419
+ columns: this.columns,
407
420
  columnsStylesGrow: this.columnsStylesGrow,
408
421
  draggedRowIndex: this.draggedRowIndex,
409
422
  editModel: this.activeEditRowKey === rowKey ? this.activeEditModel : undefined,
@@ -431,13 +444,13 @@ export default {
431
444
  onDragover: this.onDragover,
432
445
  onDragstart: this.onDragstart,
433
446
  onDrop: this.onDrop,
434
- onEditRow: this.onEditRow,
435
- row,
436
- rowClass: this.rowClass,
437
- rowIndex,
438
- rows: this.rows,
439
- saveRow: this.saveRow,
440
- texts: this.textsLocal,
447
+ onEditRow: this.onEditRow,
448
+ row,
449
+ rowClass: this.rowClass,
450
+ rowIndex,
451
+ rows: this.rows,
452
+ saveRow: this.saveRow,
453
+ texts: this.textsLocal,
441
454
  widths: this.widthsLocal,
442
455
  trClass: [
443
456
  "a_table_form__row",
@@ -452,13 +465,14 @@ export default {
452
465
  ],
453
466
  }, this.$slots);
454
467
  }),
455
- this.isAddRowActive && h(ATableFormRow, {
456
- id: this.id,
457
- allColumnsLength: this.allColumnsLength,
458
- canMoveRowDown: this.canMoveRowDown,
459
- canMoveRowUp: this.canMoveRowUp,
460
- changeModel: this.changeModel,
461
- columns: this.columns,
468
+ this.isAddRowActive && h(ATableFormRow, {
469
+ id: this.id,
470
+ allColumnsLength: this.allColumnsLength,
471
+ canMoveRowDown: this.canMoveRowDown,
472
+ canMoveRowUp: this.canMoveRowUp,
473
+ changeModel: this.changeModel,
474
+ actionsClasses: this.actionsClasses,
475
+ columns: this.columns,
462
476
  columnsStylesGrow: this.columnsStylesGrow,
463
477
  editModel: this.activeEditModel,
464
478
  errorIcon: this.errorIcon,
@@ -486,13 +500,13 @@ export default {
486
500
  onDragover: this.onDragover,
487
501
  onDragstart: this.onDragstart,
488
502
  onDrop: this.onDrop,
489
- onEditRow: this.onEditRow,
490
- row: {},
491
- rowClass: this.rowClass,
492
- rowIndex: this.rows.length,
493
- rows: this.rows,
494
- saveRow: this.addRow,
495
- texts: this.textsLocal,
503
+ onEditRow: this.onEditRow,
504
+ row: {},
505
+ rowClass: this.rowClass,
506
+ rowIndex: this.rows.length,
507
+ rows: this.rows,
508
+ saveRow: this.addRow,
509
+ texts: this.textsLocal,
496
510
  widths: this.widthsLocal,
497
511
  trClass: "a_table_form__row a_table_form__row_create",
498
512
  }, this.$slots),
@@ -513,13 +527,14 @@ export default {
513
527
  this.hasRowsFooter && h("tfoot", {
514
528
  class: "a_table_form__foot",
515
529
  }, this.rowsFooter.map((row, rowIndex) => {
516
- return h(ATableFormRow, {
517
- id: this.id,
518
- allColumnsLength: this.allColumnsLength,
519
- canMoveRowDown: this.canMoveRowDown,
520
- canMoveRowUp: this.canMoveRowUp,
521
- changeModel: this.changeModel,
522
- columns: this.columns,
530
+ return h(ATableFormRow, {
531
+ id: this.id,
532
+ allColumnsLength: this.allColumnsLength,
533
+ canMoveRowDown: this.canMoveRowDown,
534
+ canMoveRowUp: this.canMoveRowUp,
535
+ changeModel: this.changeModel,
536
+ actionsClasses: this.actionsClasses,
537
+ columns: this.columns,
523
538
  columnsStylesGrow: this.columnsStylesGrow,
524
539
  draggedRowIndex: this.draggedRowIndex,
525
540
  hasActionsColumn: this.hasActionsColumn,
@@ -546,13 +561,13 @@ export default {
546
561
  onDeleteRow: this.onDeleteRow,
547
562
  onDragend: this.onDragend,
548
563
  onDragstart: this.onDragstart,
549
- onEditRow: this.onEditRow,
550
- row,
551
- rowClass: this.rowClass,
552
- rowIndex,
553
- rows: this.rowsFooter,
554
- saveRow: this.saveRow,
555
- texts: this.textsLocal,
564
+ onEditRow: this.onEditRow,
565
+ row,
566
+ rowClass: this.rowClass,
567
+ rowIndex,
568
+ rows: this.rowsFooter,
569
+ saveRow: this.saveRow,
570
+ texts: this.textsLocal,
556
571
  widths: this.widthsLocal,
557
572
  trClass: "a_table_form__row a_table_form__row_footer",
558
573
  }, this.$slots);
@@ -563,7 +578,7 @@ export default {
563
578
  class: "a_mt_3 a_text_right",
564
579
  }, [
565
580
  h(AButton, {
566
- class: "a_btn a_btn_outline_primary",
581
+ class: this.classesLocal.addRow,
567
582
  disabled: this.isAddDisabled,
568
583
  extra: this.extra,
569
584
  iconLeft: this.iconsLocal.actionAddRow,
@@ -25,6 +25,11 @@ export default {
25
25
  required: false,
26
26
  default: false,
27
27
  },
28
+ actionsClasses: {
29
+ type: Object,
30
+ required: false,
31
+ default: () => ({}),
32
+ },
28
33
  actionsDisabledCallback: {
29
34
  type: Object,
30
35
  required: false,
@@ -189,7 +194,10 @@ export default {
189
194
  }, this.isActiveEditMode ?
190
195
  [
191
196
  h(AButton, {
192
- class: "a_btn a_btn_transparent_primary a_table_form__action_button",
197
+ class: [
198
+ "a_table_form__action_button",
199
+ this.actionsClasses.editCancel,
200
+ ],
193
201
  disabled: this.isSaving,
194
202
  iconLeft: XLg,
195
203
  title: this.texts.actionEditCancel,
@@ -200,7 +208,10 @@ export default {
200
208
  }),
201
209
  }),
202
210
  h(AButton, {
203
- class: "a_btn a_btn_transparent_primary a_table_form__action_button",
211
+ class: [
212
+ "a_table_form__action_button",
213
+ this.actionsClasses.editSave,
214
+ ],
204
215
  disabled: this.isSaving,
205
216
  iconLeft: Floppy2Fill,
206
217
  title: this.texts.actionEditSave,
@@ -214,7 +225,10 @@ export default {
214
225
  [
215
226
  (this.isDeletable || this.isDeletableConfirm) && !this.isDeleteHidden && h(AButton, {
216
227
  id: this.idBtnDelete,
217
- class: "a_btn a_btn_transparent_danger a_table_form__action_button",
228
+ class: [
229
+ "a_table_form__action_button",
230
+ this.actionsClasses.delete,
231
+ ],
218
232
  disabled: this.isDeleteDisabled,
219
233
  iconLeft: Trash,
220
234
  title: this.deleteTitle,
@@ -222,7 +236,10 @@ export default {
222
236
  onClick: this.onDeleteClick,
223
237
  }),
224
238
  this.isEditable && !this.isEditHidden && h(AButton, {
225
- class: "a_btn a_btn_transparent_primary a_table_form__action_button",
239
+ class: [
240
+ "a_table_form__action_button",
241
+ this.actionsClasses.edit,
242
+ ],
226
243
  disabled: this.isEditDisabled,
227
244
  iconLeft: PencilFill,
228
245
  title: this.editTitle,
@@ -25,6 +25,11 @@ import {
25
25
  export default {
26
26
  name: "ATableFormRow",
27
27
  props: {
28
+ actionsClasses: {
29
+ type: Object,
30
+ required: false,
31
+ default: () => ({}),
32
+ },
28
33
  allColumnsLength: {
29
34
  type: Number,
30
35
  required: true,
@@ -37,20 +42,20 @@ export default {
37
42
  type: Function,
38
43
  required: true,
39
44
  },
40
- cellTag: {
41
- type: String,
42
- required: false,
43
- default: undefined,
44
- },
45
- changeModel: {
46
- type: Function,
47
- required: false,
48
- default: undefined,
49
- },
50
- columns: {
51
- type: Array,
52
- required: true,
53
- },
45
+ cellTag: {
46
+ type: String,
47
+ required: false,
48
+ default: undefined,
49
+ },
50
+ changeModel: {
51
+ type: Function,
52
+ required: false,
53
+ default: undefined,
54
+ },
55
+ columns: {
56
+ type: Array,
57
+ required: true,
58
+ },
54
59
  columnsStylesGrow: {
55
60
  type: Object,
56
61
  required: false,
@@ -353,13 +358,13 @@ export default {
353
358
  }) :
354
359
  null,
355
360
  ...this.columns.map((column, columnIndex) => {
356
- if (this.isHeader) {
357
- return h(ATableFormTh, {
358
- column,
359
- columnStyle: this.columnsStylesGrow[column.id],
360
- isEditable: this.isEditable,
361
- }, this.$slots);
362
- }
361
+ if (this.isHeader) {
362
+ return h(ATableFormTh, {
363
+ column,
364
+ columnStyle: this.columnsStylesGrow[column.id],
365
+ isEditable: this.isEditable,
366
+ }, this.$slots);
367
+ }
363
368
 
364
369
  return h(ATableFormCell, {
365
370
  id: this.idTr,
@@ -381,6 +386,7 @@ export default {
381
386
  }),
382
387
  this.hasActionsColumn ?
383
388
  h(ATableFormCellAction, {
389
+ actionsClasses: this.actionsClasses,
384
390
  actionsDisabledCallback: this.actionsDisabledCallback,
385
391
  actionsHideCallback: this.actionsHideCallback,
386
392
  id: this.idTr,
@@ -0,0 +1,23 @@
1
+ import {
2
+ computed,
3
+ toRef,
4
+ } from "vue";
5
+
6
+ export default function ClassesAPI(props) {
7
+ const classes = toRef(props, "actionsClasses");
8
+
9
+ const classesLocal = computed(() => {
10
+ return {
11
+ delete: "a_btn a_btn_transparent_danger",
12
+ edit: "a_btn a_btn_transparent_primary",
13
+ editCancel: "a_btn a_btn_transparent_primary",
14
+ editSave: "a_btn a_btn_transparent_primary",
15
+ addRow: "a_btn a_btn_outline_primary",
16
+ ...classes.value,
17
+ };
18
+ });
19
+
20
+ return {
21
+ classesLocal,
22
+ };
23
+ }