aloha-vue 2.57.2 → 2.57.3
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/CHANGELOG.md +5 -0
- package/dist/aloha-vue.es.js +4267 -4234
- package/dist/aloha-vue.umd.js +49 -49
- package/package.json +1 -1
- package/src/ATableForm/ATableForm.js +28 -24
- package/src/ATableForm/ATableFormCellAction/ATableFormCellAction.js +16 -7
- package/src/ATableForm/ATableFormRow/ATableFormRow.js +26 -20
- package/src/ATableForm/compositionAPI/ClassesAPI.js +23 -23
- package/src/ui/AInputCurrency/compositionAPI/InputEventsAPI.js +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aloha-vue",
|
|
3
|
-
"version": "2.57.
|
|
3
|
+
"version": "2.57.3",
|
|
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",
|
|
@@ -361,22 +361,23 @@ export default {
|
|
|
361
361
|
}, [
|
|
362
362
|
h(ATableFormRow, {
|
|
363
363
|
id: this.id,
|
|
364
|
+
actionsClasses: this.actionsClasses,
|
|
365
|
+
actionsDisabledCallback: this.actionsDisabledCallback,
|
|
366
|
+
actionsHideCallback: this.actionsHideCallback,
|
|
367
|
+
actionsTitleCallback: this.actionsTitleCallback,
|
|
364
368
|
allColumnsLength: this.allColumnsLength,
|
|
365
369
|
canMoveRowDown: this.canMoveRowDown,
|
|
366
370
|
canMoveRowUp: this.canMoveRowUp,
|
|
367
371
|
cellTag: "th",
|
|
368
372
|
changeModel: this.changeModel,
|
|
369
|
-
actionsClasses: this.actionsClasses,
|
|
370
373
|
columns: this.columns,
|
|
371
374
|
columnsStylesGrow: this.columnsStylesGrow,
|
|
372
375
|
draggedRowIndex: this.draggedRowIndex,
|
|
376
|
+
extra: this.extra,
|
|
373
377
|
hasActionsColumn: this.hasActionsColumn,
|
|
374
378
|
hasActiveEditRow: false,
|
|
375
|
-
isActiveEditMode: false,
|
|
376
379
|
isActionsSticky: this.isActionsSticky,
|
|
377
|
-
|
|
378
|
-
actionsHideCallback: this.actionsHideCallback,
|
|
379
|
-
actionsTitleCallback: this.actionsTitleCallback,
|
|
380
|
+
isActiveEditMode: false,
|
|
380
381
|
isDeletable: this.isDeletable,
|
|
381
382
|
isDeletableConfirm: this.isDeletableConfirm,
|
|
382
383
|
isDndDisabled: this.hasActiveEditRow,
|
|
@@ -395,8 +396,8 @@ export default {
|
|
|
395
396
|
rows: this.rows,
|
|
396
397
|
saveRow: this.saveRow,
|
|
397
398
|
texts: this.textsLocal,
|
|
398
|
-
widths: this.widthsLocal,
|
|
399
399
|
trClass: "a_table_form__row a_table_form__row_head",
|
|
400
|
+
widths: this.widthsLocal,
|
|
400
401
|
}, this.$slots),
|
|
401
402
|
]),
|
|
402
403
|
h("tbody", {
|
|
@@ -410,31 +411,32 @@ export default {
|
|
|
410
411
|
});
|
|
411
412
|
|
|
412
413
|
return h(ATableFormRow, {
|
|
414
|
+
key: rowKey,
|
|
413
415
|
id: this.id,
|
|
416
|
+
actionsClasses: this.actionsClasses,
|
|
417
|
+
actionsDisabledCallback: this.actionsDisabledCallback,
|
|
418
|
+
actionsHideCallback: this.actionsHideCallback,
|
|
419
|
+
actionsTitleCallback: this.actionsTitleCallback,
|
|
414
420
|
allColumnsLength: this.allColumnsLength,
|
|
415
421
|
canMoveRowDown: this.canMoveRowDown,
|
|
416
422
|
canMoveRowUp: this.canMoveRowUp,
|
|
417
423
|
changeModel: this.changeModel,
|
|
418
|
-
actionsClasses: this.actionsClasses,
|
|
419
424
|
columns: this.columns,
|
|
420
425
|
columnsStylesGrow: this.columnsStylesGrow,
|
|
421
426
|
draggedRowIndex: this.draggedRowIndex,
|
|
422
427
|
editModel: this.activeEditRowKey === rowKey ? this.activeEditModel : undefined,
|
|
423
428
|
errorIcon: this.errorIcon,
|
|
429
|
+
extra: this.extra,
|
|
424
430
|
hasActionsColumn: this.hasActionsColumn,
|
|
425
431
|
hasActiveEditRow: this.hasActiveEditRow,
|
|
426
|
-
isActiveEditMode: this.activeEditRowKey === rowKey,
|
|
427
432
|
isActionsSticky: this.isActionsSticky,
|
|
428
|
-
|
|
429
|
-
actionsHideCallback: this.actionsHideCallback,
|
|
430
|
-
actionsTitleCallback: this.actionsTitleCallback,
|
|
433
|
+
isActiveEditMode: this.activeEditRowKey === rowKey,
|
|
431
434
|
isCreateMode: false,
|
|
432
435
|
isDeletable: this.isDeletable,
|
|
433
436
|
isDeletableConfirm: this.isDeletableConfirm,
|
|
434
437
|
isDndDisabled: this.hasActiveEditRow,
|
|
435
438
|
isDragAndDrop: this.isDragAndDrop,
|
|
436
439
|
isEditable: this.isEditable,
|
|
437
|
-
key: rowKey,
|
|
438
440
|
moveRowDown: this.moveRowDown,
|
|
439
441
|
moveRowUp: this.moveRowUp,
|
|
440
442
|
onCancelEditRow: this.onCancelEditRow,
|
|
@@ -467,23 +469,24 @@ export default {
|
|
|
467
469
|
}),
|
|
468
470
|
this.isAddRowActive && h(ATableFormRow, {
|
|
469
471
|
id: this.id,
|
|
472
|
+
actionsClasses: this.actionsClasses,
|
|
473
|
+
actionsDisabledCallback: this.actionsDisabledCallback,
|
|
474
|
+
actionsHideCallback: this.actionsHideCallback,
|
|
475
|
+
actionsTitleCallback: this.actionsTitleCallback,
|
|
470
476
|
allColumnsLength: this.allColumnsLength,
|
|
471
477
|
canMoveRowDown: this.canMoveRowDown,
|
|
472
478
|
canMoveRowUp: this.canMoveRowUp,
|
|
473
479
|
changeModel: this.changeModel,
|
|
474
|
-
actionsClasses: this.actionsClasses,
|
|
475
480
|
columns: this.columns,
|
|
476
481
|
columnsStylesGrow: this.columnsStylesGrow,
|
|
482
|
+
draggedRowIndex: this.draggedRowIndex,
|
|
477
483
|
editModel: this.activeEditModel,
|
|
478
484
|
errorIcon: this.errorIcon,
|
|
479
|
-
|
|
485
|
+
extra: this.extra,
|
|
480
486
|
hasActionsColumn: this.hasActionsColumn,
|
|
481
487
|
hasActiveEditRow: this.hasActiveEditRow,
|
|
482
|
-
isActiveEditMode: true,
|
|
483
488
|
isActionsSticky: this.isActionsSticky,
|
|
484
|
-
|
|
485
|
-
actionsHideCallback: this.actionsHideCallback,
|
|
486
|
-
actionsTitleCallback: this.actionsTitleCallback,
|
|
489
|
+
isActiveEditMode: true,
|
|
487
490
|
isCreateMode: true,
|
|
488
491
|
isDeletable: false,
|
|
489
492
|
isDeletableConfirm: false,
|
|
@@ -507,8 +510,8 @@ export default {
|
|
|
507
510
|
rows: this.rows,
|
|
508
511
|
saveRow: this.addRow,
|
|
509
512
|
texts: this.textsLocal,
|
|
510
|
-
widths: this.widthsLocal,
|
|
511
513
|
trClass: "a_table_form__row a_table_form__row_create",
|
|
514
|
+
widths: this.widthsLocal,
|
|
512
515
|
}, this.$slots),
|
|
513
516
|
] :
|
|
514
517
|
[h("tr", {
|
|
@@ -529,21 +532,22 @@ export default {
|
|
|
529
532
|
}, this.rowsFooter.map((row, rowIndex) => {
|
|
530
533
|
return h(ATableFormRow, {
|
|
531
534
|
id: this.id,
|
|
535
|
+
actionsClasses: this.actionsClasses,
|
|
536
|
+
actionsDisabledCallback: this.actionsDisabledCallback,
|
|
537
|
+
actionsHideCallback: this.actionsHideCallback,
|
|
538
|
+
actionsTitleCallback: this.actionsTitleCallback,
|
|
532
539
|
allColumnsLength: this.allColumnsLength,
|
|
533
540
|
canMoveRowDown: this.canMoveRowDown,
|
|
534
541
|
canMoveRowUp: this.canMoveRowUp,
|
|
535
542
|
changeModel: this.changeModel,
|
|
536
|
-
actionsClasses: this.actionsClasses,
|
|
537
543
|
columns: this.columns,
|
|
538
544
|
columnsStylesGrow: this.columnsStylesGrow,
|
|
539
545
|
draggedRowIndex: this.draggedRowIndex,
|
|
546
|
+
extra: this.extra,
|
|
540
547
|
hasActionsColumn: this.hasActionsColumn,
|
|
541
548
|
hasActiveEditRow: this.hasActiveEditRow,
|
|
542
|
-
isActiveEditMode: false,
|
|
543
549
|
isActionsSticky: this.isActionsSticky,
|
|
544
|
-
|
|
545
|
-
actionsHideCallback: this.actionsHideCallback,
|
|
546
|
-
actionsTitleCallback: this.actionsTitleCallback,
|
|
550
|
+
isActiveEditMode: false,
|
|
547
551
|
isDeletable: this.isDeletable,
|
|
548
552
|
isDeletableConfirm: this.isDeletableConfirm,
|
|
549
553
|
isDndDisabled: this.hasActiveEditRow,
|
|
@@ -20,11 +20,6 @@ import XLg from "aloha-svg/dist/js/bootstrap/XLg";
|
|
|
20
20
|
export default {
|
|
21
21
|
name: "ATableFormCellAction",
|
|
22
22
|
props: {
|
|
23
|
-
hasActiveEditRow: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
required: false,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
23
|
actionsClasses: {
|
|
29
24
|
type: Object,
|
|
30
25
|
required: false,
|
|
@@ -45,16 +40,26 @@ export default {
|
|
|
45
40
|
required: false,
|
|
46
41
|
default: () => ({}),
|
|
47
42
|
},
|
|
43
|
+
extra: {
|
|
44
|
+
type: Object,
|
|
45
|
+
required: false,
|
|
46
|
+
default: undefined,
|
|
47
|
+
},
|
|
48
|
+
hasActiveEditRow: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
48
53
|
id: {
|
|
49
54
|
type: String,
|
|
50
55
|
required: true,
|
|
51
56
|
},
|
|
52
|
-
|
|
57
|
+
isActionsSticky: {
|
|
53
58
|
type: Boolean,
|
|
54
59
|
required: false,
|
|
55
60
|
default: false,
|
|
56
61
|
},
|
|
57
|
-
|
|
62
|
+
isActiveEditMode: {
|
|
58
63
|
type: Boolean,
|
|
59
64
|
required: false,
|
|
60
65
|
default: false,
|
|
@@ -199,6 +204,7 @@ export default {
|
|
|
199
204
|
this.actionsClasses.editCancel,
|
|
200
205
|
],
|
|
201
206
|
disabled: this.isSaving,
|
|
207
|
+
extra: this.extra,
|
|
202
208
|
iconLeft: XLg,
|
|
203
209
|
title: this.texts.actionEditCancel,
|
|
204
210
|
textScreenReader: this.texts.actionEditCancel,
|
|
@@ -213,6 +219,7 @@ export default {
|
|
|
213
219
|
this.actionsClasses.editSave,
|
|
214
220
|
],
|
|
215
221
|
disabled: this.isSaving,
|
|
222
|
+
extra: this.extra,
|
|
216
223
|
iconLeft: Floppy2Fill,
|
|
217
224
|
title: this.texts.actionEditSave,
|
|
218
225
|
textScreenReader: this.texts.actionEditSave,
|
|
@@ -230,6 +237,7 @@ export default {
|
|
|
230
237
|
this.actionsClasses.delete,
|
|
231
238
|
],
|
|
232
239
|
disabled: this.isDeleteDisabled,
|
|
240
|
+
extra: this.extra,
|
|
233
241
|
iconLeft: Trash,
|
|
234
242
|
title: this.deleteTitle,
|
|
235
243
|
textScreenReader: this.deleteTitle,
|
|
@@ -241,6 +249,7 @@ export default {
|
|
|
241
249
|
this.actionsClasses.edit,
|
|
242
250
|
],
|
|
243
251
|
disabled: this.isEditDisabled,
|
|
252
|
+
extra: this.extra,
|
|
244
253
|
iconLeft: PencilFill,
|
|
245
254
|
title: this.editTitle,
|
|
246
255
|
textScreenReader: this.editTitle,
|
|
@@ -30,6 +30,21 @@ export default {
|
|
|
30
30
|
required: false,
|
|
31
31
|
default: () => ({}),
|
|
32
32
|
},
|
|
33
|
+
actionsDisabledCallback: {
|
|
34
|
+
type: Object,
|
|
35
|
+
required: false,
|
|
36
|
+
default: () => ({}),
|
|
37
|
+
},
|
|
38
|
+
actionsHideCallback: {
|
|
39
|
+
type: Object,
|
|
40
|
+
required: false,
|
|
41
|
+
default: () => ({}),
|
|
42
|
+
},
|
|
43
|
+
actionsTitleCallback: {
|
|
44
|
+
type: Object,
|
|
45
|
+
required: false,
|
|
46
|
+
default: () => ({}),
|
|
47
|
+
},
|
|
33
48
|
allColumnsLength: {
|
|
34
49
|
type: Number,
|
|
35
50
|
required: true,
|
|
@@ -61,21 +76,6 @@ export default {
|
|
|
61
76
|
required: false,
|
|
62
77
|
default: () => ({}),
|
|
63
78
|
},
|
|
64
|
-
actionsDisabledCallback: {
|
|
65
|
-
type: Object,
|
|
66
|
-
required: false,
|
|
67
|
-
default: () => ({}),
|
|
68
|
-
},
|
|
69
|
-
actionsHideCallback: {
|
|
70
|
-
type: Object,
|
|
71
|
-
required: false,
|
|
72
|
-
default: () => ({}),
|
|
73
|
-
},
|
|
74
|
-
actionsTitleCallback: {
|
|
75
|
-
type: Object,
|
|
76
|
-
required: false,
|
|
77
|
-
default: () => ({}),
|
|
78
|
-
},
|
|
79
79
|
draggedRowIndex: {
|
|
80
80
|
type: Number,
|
|
81
81
|
required: false,
|
|
@@ -91,6 +91,11 @@ export default {
|
|
|
91
91
|
required: false,
|
|
92
92
|
default: undefined,
|
|
93
93
|
},
|
|
94
|
+
extra: {
|
|
95
|
+
type: Object,
|
|
96
|
+
required: false,
|
|
97
|
+
default: undefined,
|
|
98
|
+
},
|
|
94
99
|
hasActionsColumn: {
|
|
95
100
|
type: Boolean,
|
|
96
101
|
required: false,
|
|
@@ -105,12 +110,12 @@ export default {
|
|
|
105
110
|
type: String,
|
|
106
111
|
required: true,
|
|
107
112
|
},
|
|
108
|
-
|
|
113
|
+
isActionsSticky: {
|
|
109
114
|
type: Boolean,
|
|
110
115
|
required: false,
|
|
111
116
|
default: false,
|
|
112
117
|
},
|
|
113
|
-
|
|
118
|
+
isActiveEditMode: {
|
|
114
119
|
type: Boolean,
|
|
115
120
|
required: false,
|
|
116
121
|
default: false,
|
|
@@ -386,13 +391,15 @@ export default {
|
|
|
386
391
|
}),
|
|
387
392
|
this.hasActionsColumn ?
|
|
388
393
|
h(ATableFormCellAction, {
|
|
394
|
+
id: this.idTr,
|
|
389
395
|
actionsClasses: this.actionsClasses,
|
|
390
396
|
actionsDisabledCallback: this.actionsDisabledCallback,
|
|
391
397
|
actionsHideCallback: this.actionsHideCallback,
|
|
392
|
-
|
|
398
|
+
actionsTitleCallback: this.actionsTitleCallback,
|
|
399
|
+
extra: this.extra,
|
|
393
400
|
hasActiveEditRow: this.hasActiveEditRow,
|
|
394
|
-
isActiveEditMode: this.isActiveEditMode,
|
|
395
401
|
isActionsSticky: this.isActionsSticky,
|
|
402
|
+
isActiveEditMode: this.isActiveEditMode,
|
|
396
403
|
isDeletable: this.isDeletable,
|
|
397
404
|
isDeletableConfirm: this.isDeletableConfirm,
|
|
398
405
|
isEditable: this.isEditable,
|
|
@@ -406,7 +413,6 @@ export default {
|
|
|
406
413
|
row: this.row,
|
|
407
414
|
rowIndex: this.rowIndex,
|
|
408
415
|
texts: this.texts,
|
|
409
|
-
actionsTitleCallback: this.actionsTitleCallback,
|
|
410
416
|
widths: this.widths,
|
|
411
417
|
}) :
|
|
412
418
|
null,
|
|
@@ -1,23 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -60,6 +60,10 @@ export default function InputEventsAPI(props, {
|
|
|
60
60
|
return `${ value.slice(0, start) }${ replacement }${ value.slice(end) }`;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
const isZeroIntegerPart = value => {
|
|
64
|
+
return value === "0" || value === "-0";
|
|
65
|
+
};
|
|
66
|
+
|
|
63
67
|
const setValueLocal = ({ value, updateOutside, trigger, triggerDetails }) => {
|
|
64
68
|
setCurrentValue({ value, updateOutside, trigger, triggerDetails });
|
|
65
69
|
};
|
|
@@ -381,6 +385,7 @@ export default function InputEventsAPI(props, {
|
|
|
381
385
|
const keyCode = $event.keyCode;
|
|
382
386
|
const keyValue = $event.key;
|
|
383
387
|
const keyIsNumber = keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105;
|
|
388
|
+
const keyIsZero = keyCode === 48 || keyCode === 96;
|
|
384
389
|
const keyIsDecimalDivider = keyValue === decimalDivider.value && !!decimalPartLength.value;
|
|
385
390
|
const decimalDividerIndex = $event.target.value.indexOf(decimalDivider.value);
|
|
386
391
|
const hasDecimalDivider = decimalDividerIndex !== -1;
|
|
@@ -512,6 +517,11 @@ export default function InputEventsAPI(props, {
|
|
|
512
517
|
}
|
|
513
518
|
} else {
|
|
514
519
|
const intValWithoutDivider = intVal.replaceAll(thousandDivider.value, "");
|
|
520
|
+
if (keyIsZero && isZeroIntegerPart(intValWithoutDivider) && !hasSelection) {
|
|
521
|
+
$event.preventDefault();
|
|
522
|
+
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
515
525
|
if (intValWithoutDivider.length >= integerPartMaxLength.value && !hasSelection) {
|
|
516
526
|
$event.preventDefault();
|
|
517
527
|
|
|
@@ -520,6 +530,11 @@ export default function InputEventsAPI(props, {
|
|
|
520
530
|
}
|
|
521
531
|
} else {
|
|
522
532
|
const intValWithoutDivider = value.replaceAll(thousandDivider.value, "");
|
|
533
|
+
if (keyIsZero && isZeroIntegerPart(intValWithoutDivider) && !hasSelection) {
|
|
534
|
+
$event.preventDefault();
|
|
535
|
+
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
523
538
|
if (intValWithoutDivider.length >= integerPartMaxLength.value && !hasSelection) {
|
|
524
539
|
$event.preventDefault();
|
|
525
540
|
|
|
@@ -540,7 +555,7 @@ export default function InputEventsAPI(props, {
|
|
|
540
555
|
$event.preventDefault();
|
|
541
556
|
}
|
|
542
557
|
|
|
543
|
-
if (
|
|
558
|
+
if (keyIsNumber && !$event.ctrlKey && $event.keyCode) {
|
|
544
559
|
if (cursorPosition === 0 && value.length && value[0] === "0") {
|
|
545
560
|
$event.preventDefault();
|
|
546
561
|
const newVal = `${ keyValue }${ value.slice(1) }`;
|