aloha-vue 2.59.0 → 2.60.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.
- package/CHANGELOG.md +4 -0
- package/dist/aloha-vue.css +5 -0
- package/dist/aloha-vue.css.map +1 -1
- package/dist/aloha-vue.es.js +9554 -9521
- package/dist/aloha-vue.umd.js +45 -43
- package/package.json +1 -1
- package/scss/components/ATableForm.scss +261 -256
- package/src/ATableForm/ATableForm.js +613 -606
- package/src/ATableForm/ATableFormCellDnd/ATableFormCellDnd.js +182 -176
- package/src/ATableForm/__tests__/ATableForm.DragAndDropAPI.test.js +162 -0
- package/src/ATableForm/compositionAPI/DragAndDropAPI.js +302 -268
- package/src/ATableForm/compositionAPI/TextsAPI.js +35 -34
- package/src/ATableForm/i18n/ar.json +18 -17
- package/src/ATableForm/i18n/de.json +18 -17
- package/src/ATableForm/i18n/en.json +18 -17
- package/src/ATableForm/i18n/es.json +18 -17
- package/src/ATableForm/i18n/fr.json +18 -17
- package/src/ATableForm/i18n/hr.json +18 -17
- package/src/ATableForm/i18n/it.json +18 -17
- package/src/ATableForm/i18n/ru.json +18 -17
|
@@ -1,268 +1,302 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
nextTick,
|
|
4
|
-
ref,
|
|
5
|
-
toRef,
|
|
6
|
-
} from "vue";
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
setFocusToElement,
|
|
10
|
-
} from "../../utils/utilsDOM";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
nextTick,
|
|
4
|
+
ref,
|
|
5
|
+
toRef,
|
|
6
|
+
} from "vue";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
setFocusToElement,
|
|
10
|
+
} from "../../utils/utilsDOM";
|
|
11
|
+
import {
|
|
12
|
+
isFunction,
|
|
13
|
+
} from "lodash-es";
|
|
14
|
+
|
|
15
|
+
export default function DragAndDropAPI(props, { emit }, {
|
|
16
|
+
isDndDisabled = computed(() => false),
|
|
17
|
+
} = {}) {
|
|
18
|
+
const dndDisabledCallback = toRef(props, "dndDisabledCallback");
|
|
19
|
+
const focusAfterMove = toRef(props, "focusAfterMove");
|
|
20
|
+
const id = toRef(props, "id");
|
|
21
|
+
const isDragAndDrop = toRef(props, "isDragAndDrop");
|
|
22
|
+
const rows = toRef(props, "rows");
|
|
23
|
+
|
|
24
|
+
const draggedRowIndex = ref(undefined);
|
|
25
|
+
const dragOverRowIndex = ref(undefined);
|
|
26
|
+
const dragOverPosition = ref(undefined);
|
|
27
|
+
const dragPreviewElement = ref(undefined);
|
|
28
|
+
|
|
29
|
+
const isDndDisabledForRow = rowIndex => {
|
|
30
|
+
if (isDndDisabled.value) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (isFunction(dndDisabledCallback.value)) {
|
|
35
|
+
return !!dndDisabledCallback.value({
|
|
36
|
+
row: rows.value[rowIndex],
|
|
37
|
+
rowIndex,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return false;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const hasDisabledRowBetween = (fromIndex, toIndex) => {
|
|
45
|
+
const indexFrom = Math.min(fromIndex, toIndex);
|
|
46
|
+
const indexTo = Math.max(fromIndex, toIndex);
|
|
47
|
+
|
|
48
|
+
for (let rowIndex = indexFrom; rowIndex <= indexTo; rowIndex++) {
|
|
49
|
+
if (isDndDisabledForRow(rowIndex)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return false;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const removeDragPreview = () => {
|
|
58
|
+
dragPreviewElement.value?.remove();
|
|
59
|
+
dragPreviewElement.value = undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const createDragPreview = $event => {
|
|
63
|
+
const rowElement = $event.target?.closest?.("tr");
|
|
64
|
+
|
|
65
|
+
if (!rowElement) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const rowRect = rowElement.getBoundingClientRect();
|
|
70
|
+
const previewTable = document.createElement("table");
|
|
71
|
+
const previewBody = document.createElement("tbody");
|
|
72
|
+
const previewRow = rowElement.cloneNode(true);
|
|
73
|
+
|
|
74
|
+
previewTable.className = "a_table_form__table";
|
|
75
|
+
previewTable.style.borderCollapse = "collapse";
|
|
76
|
+
previewTable.style.borderSpacing = "0";
|
|
77
|
+
previewTable.style.width = `${ rowRect.width }px`;
|
|
78
|
+
previewTable.style.tableLayout = "fixed";
|
|
79
|
+
|
|
80
|
+
Array.from(rowElement.children).forEach((cell, index) => {
|
|
81
|
+
const previewCell = previewRow.children[index];
|
|
82
|
+
|
|
83
|
+
if (previewCell) {
|
|
84
|
+
const cellStyles = window.getComputedStyle(cell);
|
|
85
|
+
|
|
86
|
+
previewCell.style.width = `${ cell.getBoundingClientRect().width }px`;
|
|
87
|
+
previewCell.style.backgroundColor = cellStyles.backgroundColor;
|
|
88
|
+
previewCell.style.borderTop = cellStyles.borderTop;
|
|
89
|
+
previewCell.style.borderRight = cellStyles.borderRight;
|
|
90
|
+
previewCell.style.borderBottom = cellStyles.borderBottom;
|
|
91
|
+
previewCell.style.borderLeft = cellStyles.borderLeft;
|
|
92
|
+
previewCell.style.color = cellStyles.color;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
previewBody.appendChild(previewRow);
|
|
97
|
+
previewTable.appendChild(previewBody);
|
|
98
|
+
|
|
99
|
+
const previewWrapper = document.createElement("div");
|
|
100
|
+
previewWrapper.className = "a_table_form a_table_form__drag_preview";
|
|
101
|
+
previewWrapper.style.position = "fixed";
|
|
102
|
+
previewWrapper.style.top = "-10000px";
|
|
103
|
+
previewWrapper.style.left = "-10000px";
|
|
104
|
+
previewWrapper.style.pointerEvents = "none";
|
|
105
|
+
previewWrapper.style.zIndex = "9999";
|
|
106
|
+
previewWrapper.appendChild(previewTable);
|
|
107
|
+
|
|
108
|
+
document.body.appendChild(previewWrapper);
|
|
109
|
+
dragPreviewElement.value = previewWrapper;
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
element: previewWrapper,
|
|
113
|
+
offsetX: Math.min($event.offsetX || 0, rowRect.width / 2),
|
|
114
|
+
offsetY: Math.min($event.offsetY || 0, rowRect.height / 2),
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const moveRow = ({ focusId, fromIndex, toIndex, trigger }) => {
|
|
119
|
+
if (!isDragAndDrop.value ||
|
|
120
|
+
isDndDisabled.value ||
|
|
121
|
+
fromIndex === toIndex ||
|
|
122
|
+
fromIndex < 0 ||
|
|
123
|
+
toIndex < 0 ||
|
|
124
|
+
fromIndex >= rows.value.length ||
|
|
125
|
+
toIndex >= rows.value.length ||
|
|
126
|
+
hasDisabledRowBetween(fromIndex, toIndex)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const ROWS_LOCAL = [...rows.value];
|
|
131
|
+
const [movedRow] = ROWS_LOCAL.splice(fromIndex, 1);
|
|
132
|
+
ROWS_LOCAL.splice(toIndex, 0, movedRow);
|
|
133
|
+
|
|
134
|
+
emit("updateRows", { focusId, rows: ROWS_LOCAL, trigger, fromIndex, toIndex });
|
|
135
|
+
emit("moveRow", {
|
|
136
|
+
focusId,
|
|
137
|
+
fromIndex,
|
|
138
|
+
row: movedRow,
|
|
139
|
+
toIndex,
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const moveRowToPosition = ({ fromIndex, rowIndex, position = "before" }) => {
|
|
144
|
+
if (!isDragAndDrop.value ||
|
|
145
|
+
isDndDisabled.value ||
|
|
146
|
+
fromIndex < 0 ||
|
|
147
|
+
rowIndex < 0 ||
|
|
148
|
+
fromIndex >= rows.value.length ||
|
|
149
|
+
rowIndex >= rows.value.length) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let insertIndex = position === "after" ? rowIndex + 1 : rowIndex;
|
|
154
|
+
|
|
155
|
+
if (fromIndex < insertIndex) {
|
|
156
|
+
insertIndex -= 1;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
moveRow({
|
|
160
|
+
fromIndex,
|
|
161
|
+
toIndex: insertIndex,
|
|
162
|
+
trigger: "dnd",
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const setFocusAfterMoveLocal = ({ focusId }) => {
|
|
167
|
+
if (!focusAfterMove.value) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
nextTick().then(
|
|
172
|
+
() => {
|
|
173
|
+
setFocusToElement({ selector: `#${ focusId }` });
|
|
174
|
+
},
|
|
175
|
+
);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const moveRowUp = rowIndex => {
|
|
179
|
+
const focusIndex = Math.max(1, rowIndex - 1);
|
|
180
|
+
const focusId = `${ id.value }_${ focusIndex }_up`;
|
|
181
|
+
moveRow({
|
|
182
|
+
focusId,
|
|
183
|
+
fromIndex: rowIndex,
|
|
184
|
+
toIndex: rowIndex - 1,
|
|
185
|
+
trigger: "moveRowUp",
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
setFocusAfterMoveLocal({ focusId });
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const moveRowDown = rowIndex => {
|
|
192
|
+
const focusIndex = Math.min(rows.value.length - 2, rowIndex + 1);
|
|
193
|
+
const focusId = `${ id.value }_${ focusIndex }_down`;
|
|
194
|
+
moveRow({
|
|
195
|
+
focusId,
|
|
196
|
+
fromIndex: rowIndex,
|
|
197
|
+
toIndex: rowIndex + 1,
|
|
198
|
+
trigger: "moveRowDown",
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
setFocusAfterMoveLocal({ focusId });
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const onDragstart = ($event, rowIndex) => {
|
|
205
|
+
if (!isDragAndDrop.value || isDndDisabledForRow(rowIndex)) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if ($event?.dataTransfer) {
|
|
210
|
+
$event.dataTransfer.effectAllowed = "move";
|
|
211
|
+
$event.dataTransfer.setData("text/plain", `${ rowIndex }`);
|
|
212
|
+
removeDragPreview();
|
|
213
|
+
|
|
214
|
+
const preview = createDragPreview($event);
|
|
215
|
+
if (preview) {
|
|
216
|
+
$event.dataTransfer.setDragImage(preview.element, preview.offsetX, preview.offsetY);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
draggedRowIndex.value = rowIndex;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const onDragover = ($event, rowIndex) => {
|
|
224
|
+
if (!isDragAndDrop.value || isDndDisabledForRow(rowIndex)) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
$event.preventDefault();
|
|
229
|
+
|
|
230
|
+
const rect = $event.currentTarget?.getBoundingClientRect?.();
|
|
231
|
+
if (rect) {
|
|
232
|
+
const middleY = rect.top + rect.height / 2;
|
|
233
|
+
dragOverPosition.value = $event.clientY < middleY ? "before" : "after";
|
|
234
|
+
} else {
|
|
235
|
+
dragOverPosition.value = "after";
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
dragOverRowIndex.value = rowIndex;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const onDragleave = ($event, rowIndex) => {
|
|
242
|
+
if (!isDragAndDrop.value || isDndDisabledForRow(rowIndex)) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const relatedTarget = $event.relatedTarget;
|
|
247
|
+
if ($event.currentTarget?.contains?.(relatedTarget)) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (dragOverRowIndex.value === rowIndex) {
|
|
252
|
+
dragOverRowIndex.value = undefined;
|
|
253
|
+
dragOverPosition.value = undefined;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const onDrop = ($event, rowIndex) => {
|
|
258
|
+
if (!isDragAndDrop.value || isDndDisabledForRow(rowIndex)) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
$event.preventDefault();
|
|
263
|
+
|
|
264
|
+
if (draggedRowIndex.value === undefined) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
moveRowToPosition({
|
|
269
|
+
fromIndex: draggedRowIndex.value,
|
|
270
|
+
position: dragOverPosition.value || "after",
|
|
271
|
+
rowIndex,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
removeDragPreview();
|
|
275
|
+
draggedRowIndex.value = undefined;
|
|
276
|
+
dragOverRowIndex.value = undefined;
|
|
277
|
+
dragOverPosition.value = undefined;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const onDragend = () => {
|
|
281
|
+
removeDragPreview();
|
|
282
|
+
draggedRowIndex.value = undefined;
|
|
283
|
+
dragOverRowIndex.value = undefined;
|
|
284
|
+
dragOverPosition.value = undefined;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
return {
|
|
288
|
+
canMoveRowDown: computed(() => rowIndex => rowIndex < rows.value.length - 1),
|
|
289
|
+
canMoveRowUp: computed(() => rowIndex => rowIndex > 0),
|
|
290
|
+
dragOverPosition,
|
|
291
|
+
dragOverRowIndex,
|
|
292
|
+
draggedRowIndex,
|
|
293
|
+
isDndDisabledForRow,
|
|
294
|
+
onDragleave,
|
|
295
|
+
moveRowDown,
|
|
296
|
+
moveRowUp,
|
|
297
|
+
onDragend,
|
|
298
|
+
onDragover,
|
|
299
|
+
onDragstart,
|
|
300
|
+
onDrop,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
toRef,
|
|
4
|
-
} from "vue";
|
|
5
|
-
|
|
6
|
-
export default function TextsAPI(props) {
|
|
7
|
-
const texts = toRef(props, "texts");
|
|
8
|
-
|
|
9
|
-
const textsLocal = computed(() => {
|
|
10
|
-
return {
|
|
11
|
-
actionsColumn: "_A_TABLE_FORM_ACTIONS_",
|
|
12
|
-
actionAddRow: "_A_TABLE_FORM_ADD_ROW_",
|
|
13
|
-
actionDelete: "_A_TABLE_FORM_DELETE_",
|
|
14
|
-
actionDeleteConfirmBody: "_A_TABLE_FORM_DELETE_CONFIRM_BODY_",
|
|
15
|
-
actionDeleteConfirmClose: "_A_TABLE_FORM_DELETE_CONFIRM_CLOSE_",
|
|
16
|
-
actionDeleteConfirmHeader: "_A_TABLE_FORM_DELETE_CONFIRM_HEADER_",
|
|
17
|
-
actionDeleteConfirmSave: "_A_TABLE_FORM_DELETE_CONFIRM_SAVE_",
|
|
18
|
-
actionEdit: "_A_TABLE_FORM_EDIT_",
|
|
19
|
-
actionEditCancel: "_A_TABLE_FORM_EDIT_CANCEL_",
|
|
20
|
-
actionEditSave: "_A_TABLE_FORM_EDIT_SAVE_",
|
|
21
|
-
editInfoText: undefined,
|
|
22
|
-
emptyText: "_A_TABLE_FORM_EMPTY_",
|
|
23
|
-
reorderColumn: "_A_TABLE_FORM_REORDER_COLUMN_",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
export default function TextsAPI(props) {
|
|
7
|
+
const texts = toRef(props, "texts");
|
|
8
|
+
|
|
9
|
+
const textsLocal = computed(() => {
|
|
10
|
+
return {
|
|
11
|
+
actionsColumn: "_A_TABLE_FORM_ACTIONS_",
|
|
12
|
+
actionAddRow: "_A_TABLE_FORM_ADD_ROW_",
|
|
13
|
+
actionDelete: "_A_TABLE_FORM_DELETE_",
|
|
14
|
+
actionDeleteConfirmBody: "_A_TABLE_FORM_DELETE_CONFIRM_BODY_",
|
|
15
|
+
actionDeleteConfirmClose: "_A_TABLE_FORM_DELETE_CONFIRM_CLOSE_",
|
|
16
|
+
actionDeleteConfirmHeader: "_A_TABLE_FORM_DELETE_CONFIRM_HEADER_",
|
|
17
|
+
actionDeleteConfirmSave: "_A_TABLE_FORM_DELETE_CONFIRM_SAVE_",
|
|
18
|
+
actionEdit: "_A_TABLE_FORM_EDIT_",
|
|
19
|
+
actionEditCancel: "_A_TABLE_FORM_EDIT_CANCEL_",
|
|
20
|
+
actionEditSave: "_A_TABLE_FORM_EDIT_SAVE_",
|
|
21
|
+
editInfoText: undefined,
|
|
22
|
+
emptyText: "_A_TABLE_FORM_EMPTY_",
|
|
23
|
+
reorderColumn: "_A_TABLE_FORM_REORDER_COLUMN_",
|
|
24
|
+
reorderDisabled: "_A_TABLE_FORM_REORDER_DISABLED_",
|
|
25
|
+
reorderDown: "_A_TABLE_FORM_MOVE_DOWN_",
|
|
26
|
+
reorderHandle: "_A_TABLE_FORM_REORDER_",
|
|
27
|
+
reorderUp: "_A_TABLE_FORM_MOVE_UP_",
|
|
28
|
+
...texts.value,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
textsLocal,
|
|
34
|
+
};
|
|
35
|
+
}
|