@progress/kendo-vue-data-tools 3.5.0 → 3.5.1-dev.202208150613
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/dist/cdn/js/kendo-vue-data-tools.js +1 -1
- package/dist/es/filter/FieldSettings.js +1 -0
- package/dist/es/filter/GroupToolbar.js +8 -12
- package/dist/es/filter/operators.js +12 -10
- package/dist/es/filteringCells/FilterCellProps.js +1 -0
- package/dist/es/filteringCells/FilterComponentProps.js +1 -0
- package/dist/es/filteringCells/FilterOperator.js +1 -0
- package/dist/es/navigation/TableKeyboardNavigation.js +7 -11
- package/dist/es/navigation/TableKeyboardNavigationContextType.js +1 -0
- package/dist/es/navigation/TableKeyboardNavigationStateType.js +1 -0
- package/dist/es/navigation/constants.js +8 -12
- package/dist/es/navigation/utils.d.ts +32 -4
- package/dist/es/navigation/utils.js +10 -10
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/pager/Page.js +1 -0
- package/dist/es/pager/PagerInput.js +1 -1
- package/dist/es/virtualization/columns.js +9 -7
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/filter/Expression.d.ts +73 -0
- package/dist/esm/filter/Expression.js +495 -0
- package/dist/esm/filter/FieldSettings.d.ts +22 -0
- package/dist/esm/filter/FieldSettings.js +1 -0
- package/dist/esm/filter/Filter.d.ts +83 -0
- package/dist/esm/filter/Filter.js +169 -0
- package/dist/esm/filter/GroupFilters.d.ts +72 -0
- package/dist/esm/filter/GroupFilters.js +166 -0
- package/dist/esm/filter/GroupToolbar.d.ts +74 -0
- package/dist/esm/filter/GroupToolbar.js +586 -0
- package/dist/esm/filter/filters/BooleanFilter.d.ts +61 -0
- package/dist/esm/filter/filters/BooleanFilter.js +75 -0
- package/dist/esm/filter/filters/DateFilter.d.ts +49 -0
- package/dist/esm/filter/filters/DateFilter.js +73 -0
- package/dist/esm/filter/filters/EnumFilter.d.ts +59 -0
- package/dist/esm/filter/filters/EnumFilter.js +102 -0
- package/dist/esm/filter/filters/NumericFilter.d.ts +48 -0
- package/dist/esm/filter/filters/NumericFilter.js +73 -0
- package/dist/esm/filter/filters/TextFilter.d.ts +60 -0
- package/dist/esm/filter/filters/TextFilter.js +72 -0
- package/dist/esm/filter/filters/index.d.ts +5 -0
- package/dist/esm/filter/filters/index.js +5 -0
- package/dist/esm/filter/index.d.ts +6 -0
- package/dist/esm/filter/index.js +6 -0
- package/dist/esm/filter/operators.d.ts +73 -0
- package/dist/esm/filter/operators.js +150 -0
- package/dist/esm/filteringCells/FilterCellProps.d.ts +35 -0
- package/dist/esm/filteringCells/FilterCellProps.js +1 -0
- package/dist/esm/filteringCells/FilterComponentProps.d.ts +11 -0
- package/dist/esm/filteringCells/FilterComponentProps.js +1 -0
- package/dist/esm/filteringCells/FilterOperator.d.ts +13 -0
- package/dist/esm/filteringCells/FilterOperator.js +1 -0
- package/dist/esm/filteringCells/index.d.ts +3 -0
- package/dist/esm/filteringCells/index.js +8 -0
- package/dist/esm/header/HeaderThElement.d.ts +42 -0
- package/dist/esm/header/HeaderThElement.js +110 -0
- package/dist/esm/main.d.ts +18 -0
- package/dist/esm/main.js +17 -0
- package/dist/esm/messages/index.d.ts +315 -0
- package/dist/esm/messages/index.js +316 -0
- package/dist/esm/navigation/TableKeyboardNavigation.d.ts +41 -0
- package/dist/esm/navigation/TableKeyboardNavigation.js +371 -0
- package/dist/esm/navigation/TableKeyboardNavigationContextType.d.ts +7 -0
- package/dist/esm/navigation/TableKeyboardNavigationContextType.js +1 -0
- package/dist/esm/navigation/TableKeyboardNavigationStateType.d.ts +10 -0
- package/dist/esm/navigation/TableKeyboardNavigationStateType.js +1 -0
- package/dist/esm/navigation/constants.d.ts +54 -0
- package/dist/esm/navigation/constants.js +75 -0
- package/dist/esm/navigation/utils.d.ts +161 -0
- package/dist/esm/navigation/utils.js +212 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pager/GridPagerSettings.d.ts +62 -0
- package/dist/esm/pager/GridPagerSettings.js +22 -0
- package/dist/esm/pager/Page.d.ts +13 -0
- package/dist/esm/pager/Page.js +1 -0
- package/dist/esm/pager/Pager.d.ts +98 -0
- package/dist/esm/pager/Pager.js +398 -0
- package/dist/esm/pager/PagerInfo.d.ts +51 -0
- package/dist/esm/pager/PagerInfo.js +59 -0
- package/dist/esm/pager/PagerInput.d.ts +50 -0
- package/dist/esm/pager/PagerInput.js +101 -0
- package/dist/esm/pager/PagerNavigationButton.d.ts +50 -0
- package/dist/esm/pager/PagerNavigationButton.js +67 -0
- package/dist/esm/pager/PagerNumericButtons.d.ts +50 -0
- package/dist/esm/pager/PagerNumericButtons.js +147 -0
- package/dist/esm/pager/PagerPageSizes.d.ts +51 -0
- package/dist/esm/pager/PagerPageSizes.js +85 -0
- package/dist/esm/virtualization/columns.d.ts +15 -0
- package/dist/esm/virtualization/columns.js +75 -0
- package/dist/esm/virtualization/index.d.ts +1 -0
- package/dist/esm/virtualization/index.js +1 -0
- package/dist/npm/filter/Expression.js +5 -5
- package/dist/npm/filter/Filter.js +1 -1
- package/dist/npm/filter/GroupFilters.js +1 -1
- package/dist/npm/filter/GroupToolbar.js +10 -14
- package/dist/npm/filter/filters/EnumFilter.js +1 -1
- package/dist/npm/filter/filters/index.js +6 -2
- package/dist/npm/filter/index.js +6 -2
- package/dist/npm/filter/operators.js +16 -12
- package/dist/npm/filteringCells/index.js +6 -2
- package/dist/npm/header/HeaderThElement.js +1 -1
- package/dist/npm/main.js +7 -3
- package/dist/npm/messages/index.js +2 -1
- package/dist/npm/navigation/TableKeyboardNavigation.js +15 -19
- package/dist/npm/navigation/constants.js +8 -12
- package/dist/npm/navigation/utils.d.ts +32 -4
- package/dist/npm/navigation/utils.js +53 -33
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/pager/GridPagerSettings.js +2 -1
- package/dist/npm/pager/Pager.js +1 -1
- package/dist/npm/pager/PagerInfo.js +2 -2
- package/dist/npm/pager/PagerInput.js +3 -3
- package/dist/npm/pager/PagerPageSizes.js +1 -1
- package/dist/npm/virtualization/columns.js +9 -7
- package/dist/npm/virtualization/index.js +6 -2
- package/package.json +16 -10
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
}; // @ts-ignore
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import * as Vue from 'vue';
|
|
13
|
+
var allVue = Vue;
|
|
14
|
+
var gh = allVue.h;
|
|
15
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
16
|
+
var ref = allVue.ref;
|
|
17
|
+
var provide = allVue.provide;
|
|
18
|
+
import { guid, Keys, getDefaultSlots } from '@progress/kendo-vue-common';
|
|
19
|
+
import { KEYBOARD_NAV_DATA_ID, KEYBOARD_NAV_DATA_LEVEL } from './constants.js';
|
|
20
|
+
import { findId, findNextIdByCellIndex, findNextIdByRowIndex, getBodyElement, getHeaderElement, getNavigatableId, tableKeyboardNavigationTools as navigationTools } from './utils.js';
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var TableKeyboardNavigationProviderVue2 = {
|
|
26
|
+
name: 'KendoTableKeyboardNavigationProvider',
|
|
27
|
+
props: {
|
|
28
|
+
navigatable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
id: String
|
|
33
|
+
},
|
|
34
|
+
data: function data() {
|
|
35
|
+
return {
|
|
36
|
+
scope: undefined,
|
|
37
|
+
kbContext: undefined,
|
|
38
|
+
navigation: undefined
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
// watch: {
|
|
42
|
+
// language: function (this: TableKeyboardNavigationProviderAll, newLanguage: string) {
|
|
43
|
+
// this.$data.kendoLocalizationService.language = newLanguage ;
|
|
44
|
+
// }
|
|
45
|
+
// },
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
setup: !isV3 ? undefined : function () {
|
|
48
|
+
var v3 = !!isV3; // const localizationService = ref(new LocalizationService(props.language));
|
|
49
|
+
// provide('kendoLocalizationService', localizationService);
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
v3: v3
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
provide: function provide() {
|
|
56
|
+
return {
|
|
57
|
+
getKeyboardNavigationAttributes: this.getKeyboardNavigationAttributes,
|
|
58
|
+
onNavMount: this.onComponentDidMount,
|
|
59
|
+
onGetSnapshotBeforeUpdate: this.onGetSnapshotBeforeUpdate,
|
|
60
|
+
onComponentDidUpdate: this.onComponentDidUpdate,
|
|
61
|
+
onNavFocus: this.onFocus,
|
|
62
|
+
onNavKeyDown: this.onKeyDown,
|
|
63
|
+
generateMatrix: this.generateMatrix,
|
|
64
|
+
kbContext: this.kbContext,
|
|
65
|
+
navigation: this.navigation
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
created: function created() {
|
|
69
|
+
var _a = this.$props,
|
|
70
|
+
navigatable = _a.navigatable,
|
|
71
|
+
id = _a.id; // v.2: check if nested navigation
|
|
72
|
+
|
|
73
|
+
if (navigatable) {
|
|
74
|
+
this.kbContext = {
|
|
75
|
+
activeId: '',
|
|
76
|
+
level: 0
|
|
77
|
+
};
|
|
78
|
+
this.navigation = {
|
|
79
|
+
activeElementIsFocused: false,
|
|
80
|
+
prevNavigationIndexes: undefined,
|
|
81
|
+
idPrefix: id || guid(),
|
|
82
|
+
navigationMatrix: [],
|
|
83
|
+
lastHeaderIndex: -1
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
getKeyboardNavigationAttributes: function getKeyboardNavigationAttributes(elementId) {
|
|
89
|
+
var _a;
|
|
90
|
+
|
|
91
|
+
if (!elementId || this.$props.navigatable === false) {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return _a = {
|
|
96
|
+
tabIndex: this.kbContext.activeId && this.kbContext.activeId === elementId ? 0 : -1
|
|
97
|
+
}, _a[KEYBOARD_NAV_DATA_LEVEL] = this.kbContext.level, _a[KEYBOARD_NAV_DATA_ID] = elementId, _a;
|
|
98
|
+
},
|
|
99
|
+
onComponentDidMount: function onComponentDidMount(options) {
|
|
100
|
+
var _a = options.scope,
|
|
101
|
+
scope = _a === void 0 ? this.scope : _a;
|
|
102
|
+
|
|
103
|
+
if (this.kbContext && this.navigation && scope) {
|
|
104
|
+
this.scope = scope;
|
|
105
|
+
this.generateMatrix(options);
|
|
106
|
+
var firstId = this.navigation.navigationMatrix[0][0];
|
|
107
|
+
var firstIdElement = navigationTools.getActiveElement(scope, firstId);
|
|
108
|
+
|
|
109
|
+
if (firstId && firstIdElement) {
|
|
110
|
+
this.kbContext.activeId = firstId;
|
|
111
|
+
firstIdElement.setAttribute('tabIndex', '0');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
onGetSnapshotBeforeUpdate: function onGetSnapshotBeforeUpdate(options) {
|
|
116
|
+
var _a = options.kbContext,
|
|
117
|
+
kbContext = _a === void 0 ? this.kbContext : _a,
|
|
118
|
+
_b = options.navigation,
|
|
119
|
+
navigation = _b === void 0 ? this.navigation : _b,
|
|
120
|
+
document = options.document;
|
|
121
|
+
|
|
122
|
+
if (kbContext && navigation && document) {
|
|
123
|
+
var activeElement = document.activeElement;
|
|
124
|
+
var activeId = navigationTools.getNavigatableId(activeElement);
|
|
125
|
+
|
|
126
|
+
if (activeId && activeId === kbContext.activeId) {
|
|
127
|
+
navigation.activeElementIsFocused = true;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
onComponentDidUpdate: function onComponentDidUpdate(options) {
|
|
132
|
+
var scope = options.scope;
|
|
133
|
+
this.generateMatrix(options); // check if nested navigation
|
|
134
|
+
|
|
135
|
+
if (this.kbContext && this.navigation && scope) {
|
|
136
|
+
var activeElement = navigationTools.getActiveElement(scope, this.kbContext.activeId);
|
|
137
|
+
|
|
138
|
+
if (!activeElement) {
|
|
139
|
+
var firstId = this.navigation.navigationMatrix[0][0];
|
|
140
|
+
var firstIdElement = navigationTools.getActiveElement(scope, firstId);
|
|
141
|
+
|
|
142
|
+
if (firstId && firstIdElement) {
|
|
143
|
+
this.kbContext.activeId = firstId;
|
|
144
|
+
firstIdElement.setAttribute('tabIndex', '0');
|
|
145
|
+
|
|
146
|
+
if (this.navigation.activeElementIsFocused) {
|
|
147
|
+
firstIdElement.focus();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
this.navigation.activeElementIsFocused = false;
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
onFocus: function onFocus(event) {
|
|
156
|
+
var kbContext = this.kbContext;
|
|
157
|
+
|
|
158
|
+
if (event.defaultPrevented) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (!kbContext) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var focusedElement = event.target;
|
|
167
|
+
var activeId = navigationTools.getNavigatableId(focusedElement);
|
|
168
|
+
|
|
169
|
+
if (activeId && activeId !== kbContext.activeId) {
|
|
170
|
+
var scope = navigationTools.getClosestScope(focusedElement);
|
|
171
|
+
|
|
172
|
+
if (!scope) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
var prevElement = navigationTools.getActiveElement(scope, kbContext.activeId);
|
|
177
|
+
|
|
178
|
+
if (prevElement) {
|
|
179
|
+
prevElement.setAttribute('tabIndex', '-1');
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
focusedElement.setAttribute('tabIndex', '0');
|
|
183
|
+
kbContext.activeId = activeId;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
onKeyDown: function onKeyDown(event, options) {
|
|
187
|
+
var _a = options.kbContext,
|
|
188
|
+
kbContext = _a === void 0 ? this.kbContext : _a,
|
|
189
|
+
_b = options.navigation,
|
|
190
|
+
navigation = _b === void 0 ? this.navigation : _b,
|
|
191
|
+
onNavigationAction = options.onNavigationAction;
|
|
192
|
+
|
|
193
|
+
if (event.defaultPrevented) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (!kbContext || !navigation) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (event.keyCode === Keys.esc) {
|
|
202
|
+
// activate navigation
|
|
203
|
+
var elementForFocus = navigationTools.getClosestNavigatableElement(event.target);
|
|
204
|
+
navigationTools.focusElement({
|
|
205
|
+
elementForFocus: elementForFocus,
|
|
206
|
+
event: event,
|
|
207
|
+
kbContext: kbContext
|
|
208
|
+
});
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var element = event.target;
|
|
213
|
+
var elementId = navigationTools.getNavigatableId(element);
|
|
214
|
+
var dataLevel = navigationTools.getNavigatableLevel(element);
|
|
215
|
+
var scope = navigationTools.getClosestScope(element);
|
|
216
|
+
var matrix = navigation.navigationMatrix;
|
|
217
|
+
|
|
218
|
+
if (dataLevel !== undefined && scope) {
|
|
219
|
+
if (event.keyCode === Keys.enter) {
|
|
220
|
+
// activate nested navigation or focus focusable element
|
|
221
|
+
var navigatableElement = navigationTools.getNavigatableElement(element, {
|
|
222
|
+
level: dataLevel + 1
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
if (navigatableElement) {
|
|
226
|
+
navigationTools.focusElement({
|
|
227
|
+
elementForFocus: navigatableElement,
|
|
228
|
+
event: event,
|
|
229
|
+
kbContext: kbContext,
|
|
230
|
+
prevElement: element
|
|
231
|
+
});
|
|
232
|
+
return;
|
|
233
|
+
} else {
|
|
234
|
+
var elementForFocus = navigationTools.getFocusableElements(element)[0];
|
|
235
|
+
navigationTools.focusElement({
|
|
236
|
+
elementForFocus: elementForFocus,
|
|
237
|
+
event: event,
|
|
238
|
+
kbContext: kbContext,
|
|
239
|
+
prevElement: element
|
|
240
|
+
});
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (event.keyCode === Keys.up || event.keyCode === Keys.down || event.keyCode === Keys.left || event.keyCode === Keys.right) {
|
|
246
|
+
var isReverse = event.keyCode === Keys.up || event.keyCode === Keys.left;
|
|
247
|
+
var isVertical = event.keyCode === Keys.up || event.keyCode === Keys.down;
|
|
248
|
+
var currentIdIndexes = void 0;
|
|
249
|
+
|
|
250
|
+
if (navigation && navigation.prevNavigationIndexes) {
|
|
251
|
+
var _c = navigation.prevNavigationIndexes,
|
|
252
|
+
rowIndex = _c[0],
|
|
253
|
+
cellIndex = _c[1];
|
|
254
|
+
|
|
255
|
+
if (matrix[rowIndex][cellIndex] === elementId) {
|
|
256
|
+
currentIdIndexes = navigation.prevNavigationIndexes;
|
|
257
|
+
} else {
|
|
258
|
+
currentIdIndexes = findId(matrix, elementId);
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
currentIdIndexes = findId(matrix, elementId);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (currentIdIndexes) {
|
|
265
|
+
var rowIndex = currentIdIndexes[0],
|
|
266
|
+
cellIndex = currentIdIndexes[1];
|
|
267
|
+
|
|
268
|
+
var _d = isVertical ? findNextIdByRowIndex(rowIndex, cellIndex, elementId, matrix, isReverse) : findNextIdByCellIndex(rowIndex, cellIndex, elementId, matrix, isReverse),
|
|
269
|
+
idForFocus = _d[0],
|
|
270
|
+
currentIndexes = _d[1];
|
|
271
|
+
|
|
272
|
+
if (idForFocus) {
|
|
273
|
+
var elementForFocus = navigationTools.getActiveElement(scope, idForFocus); // emit event
|
|
274
|
+
|
|
275
|
+
navigationTools.focusElement({
|
|
276
|
+
elementForFocus: elementForFocus,
|
|
277
|
+
event: event,
|
|
278
|
+
kbContext: kbContext,
|
|
279
|
+
prevElement: element
|
|
280
|
+
});
|
|
281
|
+
navigation.prevNavigationIndexes = currentIndexes;
|
|
282
|
+
|
|
283
|
+
if (onNavigationAction) {
|
|
284
|
+
onNavigationAction({
|
|
285
|
+
focusElement: elementForFocus,
|
|
286
|
+
event: event
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
generateMatrix: function generateMatrix(options) {
|
|
295
|
+
var _a = options.navigation,
|
|
296
|
+
navigation = _a === void 0 ? this.navigation : _a,
|
|
297
|
+
scope = options.scope;
|
|
298
|
+
|
|
299
|
+
if (!navigation || !scope) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
var matrix = [];
|
|
304
|
+
var thead = getHeaderElement(scope);
|
|
305
|
+
var tbody = getBodyElement(scope);
|
|
306
|
+
|
|
307
|
+
if (!thead || !tbody) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
var headerRows = Array.from(thead.children);
|
|
312
|
+
var bodyRows = Array.from(tbody.children);
|
|
313
|
+
|
|
314
|
+
__spreadArray(__spreadArray([], headerRows, true), bodyRows, true).forEach(function (row, rowIndex) {
|
|
315
|
+
Array.from(row.children).forEach(function (cell) {
|
|
316
|
+
var cellId = getNavigatableId(cell);
|
|
317
|
+
|
|
318
|
+
if (!cellId) {
|
|
319
|
+
return;
|
|
320
|
+
} // cell is not navigatable
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
var rowSpan = cell.rowSpan || 1;
|
|
324
|
+
var cellSpan = cell.colSpan || 1;
|
|
325
|
+
var cellIndex;
|
|
326
|
+
|
|
327
|
+
for (var depth = rowIndex, maxDepth = rowIndex + rowSpan; depth < maxDepth; depth++) {
|
|
328
|
+
if (!matrix[depth]) {
|
|
329
|
+
matrix[depth] = [];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (cellIndex === undefined) {
|
|
333
|
+
var freeSlotIndex = matrix[depth].findIndex(function (mi) {
|
|
334
|
+
return !mi;
|
|
335
|
+
});
|
|
336
|
+
cellIndex = freeSlotIndex > -1 ? freeSlotIndex : matrix[depth].length;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
matrix[depth][cellIndex] = cellId || '';
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
for (var depth = cellIndex + 1, maxDepth = cellIndex + cellSpan; depth < maxDepth; depth++) {
|
|
343
|
+
matrix[rowIndex][depth] = cellId || '';
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
navigation.navigationMatrix = matrix.filter(function (row) {
|
|
349
|
+
return !!row;
|
|
350
|
+
});
|
|
351
|
+
navigation.lastHeaderIndex = headerRows.length - 1;
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @hidden
|
|
357
|
+
*/
|
|
358
|
+
// @ts-ignore
|
|
359
|
+
render: function render(createElement) {
|
|
360
|
+
// @ts-ignore
|
|
361
|
+
var h = gh || createElement;
|
|
362
|
+
var defaultSlot = getDefaultSlots(this);
|
|
363
|
+
return defaultSlot[0];
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* @hidden
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
var TableKeyboardNavigationProvider = TableKeyboardNavigationProviderVue2;
|
|
371
|
+
export { TableKeyboardNavigationProvider, TableKeyboardNavigationProviderVue2 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export declare const KEYBOARD_NAV_DATA_LEVEL = "data-keyboardnavlevel";
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const KEYBOARD_NAV_DATA_SCOPE = "data-keyboardnavscope";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const KEYBOARD_NAV_DATA_HEADER = "data-keyboardnavheader";
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare const KEYBOARD_NAV_DATA_BODY = "data-keyboardnavbody";
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare const KEYBOARD_NAV_DATA_ID = "data-keyboardnavid";
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export declare const KEYBOARD_NAV_DATA_ZONE = "data-keyboardnavzone";
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export declare const KEYBOARD_NAV_FILTER_COL_SUFFIX = "_filter";
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export declare const FOCUSABLE_ELEMENTS: string[];
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export declare const TABBABLE_ELEMENTS: string[];
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export declare const tableKeyboardNavigationScopeAttributes: {
|
|
41
|
+
"data-keyboardnavscope": boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
export declare const tableKeyboardNavigationHeaderAttributes: {
|
|
47
|
+
"data-keyboardnavheader": boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export declare const tableKeyboardNavigationBodyAttributes: {
|
|
53
|
+
"data-keyboardnavbody": boolean;
|
|
54
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export var KEYBOARD_NAV_DATA_LEVEL = 'data-keyboardnavlevel';
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export var KEYBOARD_NAV_DATA_SCOPE = 'data-keyboardnavscope';
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export var KEYBOARD_NAV_DATA_HEADER = 'data-keyboardnavheader';
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export var KEYBOARD_NAV_DATA_BODY = 'data-keyboardnavbody';
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export var KEYBOARD_NAV_DATA_ID = 'data-keyboardnavid';
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export var KEYBOARD_NAV_DATA_ZONE = 'data-keyboardnavzone';
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export var KEYBOARD_NAV_FILTER_COL_SUFFIX = '_filter';
|
|
48
|
+
var FOCUSABLE_ELEMENTS_BASE = ['input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'a[href]', 'area[href]', 'summary', 'iframe', 'object', 'embed', 'audio[controls]', 'video[controls]', '[contenteditable]'];
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
export var FOCUSABLE_ELEMENTS = __spreadArray(__spreadArray([], FOCUSABLE_ELEMENTS_BASE, true), ['[tabindex]'], false);
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
export var TABBABLE_ELEMENTS = __spreadArray(__spreadArray([], FOCUSABLE_ELEMENTS_BASE, true), ['[tabindex]'], false).map(function (selector) {
|
|
59
|
+
return selector + ':not([tabindex="-1"])';
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
export var tableKeyboardNavigationScopeAttributes = (_a = {}, _a[KEYBOARD_NAV_DATA_SCOPE] = true, _a);
|
|
66
|
+
/**
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
export var tableKeyboardNavigationHeaderAttributes = (_b = {}, _b[KEYBOARD_NAV_DATA_HEADER] = true, _b);
|
|
71
|
+
/**
|
|
72
|
+
* @hidden
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export var tableKeyboardNavigationBodyAttributes = (_c = {}, _c[KEYBOARD_NAV_DATA_BODY] = true, _c);
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { TableKeyboardNavigationContextType } from './TableKeyboardNavigationContextType';
|
|
2
|
+
import { TableKeyboardNavigationStateType } from './TableKeyboardNavigationStateType';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export declare const generateNavigatableId: (navigationId: string, idPrefix: string, type?: 'column' | 'cell') => string;
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNavigatableLevel: (element: Element | null) => number;
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export declare const getNavigatableId: (element: Element | null) => string;
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export declare const isNavigatable: (element: Element | null) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export declare const getNavigatableElement: (scope: HTMLElement, options?: {
|
|
23
|
+
level: number;
|
|
24
|
+
}) => HTMLElement;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export declare const getClosestNavigatableElement: (target: HTMLElement) => Element;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export declare const getActiveElement: (scope: HTMLElement, activeId?: string) => HTMLElement;
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export declare const getClosestScope: (target: HTMLElement) => Element;
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
export declare const getHeaderElement: (scope: HTMLElement) => Element;
|
|
41
|
+
/**
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
export declare const getBodyElement: (scope: HTMLElement) => Element;
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
export declare const getFocusableElements: (scope: HTMLElement, options?: {
|
|
49
|
+
focusable: boolean;
|
|
50
|
+
}) => Element[];
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
export declare const getNavigatableElements: (scope: HTMLElement | null, options?: {
|
|
55
|
+
level: number;
|
|
56
|
+
}) => any[];
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
export declare const filterNavigatableElements: (options?: {
|
|
61
|
+
level: number;
|
|
62
|
+
}) => (element: HTMLElement) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* @hidden
|
|
65
|
+
*/
|
|
66
|
+
export declare const focusElement: (options: {
|
|
67
|
+
elementForFocus: HTMLElement;
|
|
68
|
+
prevElement?: HTMLElement;
|
|
69
|
+
kbContext?: TableKeyboardNavigationContextType;
|
|
70
|
+
event: any;
|
|
71
|
+
}) => void;
|
|
72
|
+
/**
|
|
73
|
+
* @hidden
|
|
74
|
+
*/
|
|
75
|
+
export declare const getIdPrefix: (navigation?: TableKeyboardNavigationStateType) => string;
|
|
76
|
+
/**
|
|
77
|
+
* @hidden
|
|
78
|
+
*/
|
|
79
|
+
export declare const findNextIdByRowIndex: (initialRowIndex: number, cellIndex: number, elementId: string | undefined, matrix: string[][], isReverse: boolean) => [
|
|
80
|
+
string,
|
|
81
|
+
[
|
|
82
|
+
number,
|
|
83
|
+
number
|
|
84
|
+
]
|
|
85
|
+
] | [
|
|
86
|
+
];
|
|
87
|
+
/**
|
|
88
|
+
* @hidden
|
|
89
|
+
*/
|
|
90
|
+
export declare const findNextIdByCellIndex: (rowIndex: number, initialCellIndex: number, elementId: string | undefined, matrix: string[][], isReverse: boolean) => [
|
|
91
|
+
string,
|
|
92
|
+
[
|
|
93
|
+
number,
|
|
94
|
+
number
|
|
95
|
+
]
|
|
96
|
+
] | [
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
*/
|
|
101
|
+
export declare const findId: (navigationMatrix: string[][], cellId?: string) => number[] | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* @hidden
|
|
104
|
+
*/
|
|
105
|
+
export declare const getNextNavigationIndex: (navigation?: TableKeyboardNavigationStateType) => number;
|
|
106
|
+
/**
|
|
107
|
+
* @hidden
|
|
108
|
+
*/
|
|
109
|
+
export declare const getFilterColumnId: (columnId: string) => string;
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
export declare const tableKeyboardNavigationTools: {
|
|
114
|
+
generateNavigatableId: (navigationId: string, idPrefix: string, type?: 'column' | 'cell') => string;
|
|
115
|
+
getNavigatableId: (element: Element | null) => string;
|
|
116
|
+
getNavigatableLevel: (element: Element | null) => number;
|
|
117
|
+
getNavigatableElement: (scope: HTMLElement, options?: {
|
|
118
|
+
level: number;
|
|
119
|
+
}) => HTMLElement;
|
|
120
|
+
getClosestNavigatableElement: (target: HTMLElement) => Element;
|
|
121
|
+
getActiveElement: (scope: HTMLElement, activeId?: string) => HTMLElement;
|
|
122
|
+
getClosestScope: (target: HTMLElement) => Element;
|
|
123
|
+
getHeaderElement: (scope: HTMLElement) => Element;
|
|
124
|
+
getBodyElement: (scope: HTMLElement) => Element;
|
|
125
|
+
getFocusableElements: (scope: HTMLElement, options?: {
|
|
126
|
+
focusable: boolean;
|
|
127
|
+
}) => Element[];
|
|
128
|
+
getNavigatableElements: (scope: HTMLElement | null, options?: {
|
|
129
|
+
level: number;
|
|
130
|
+
}) => any[];
|
|
131
|
+
filterNavigatableElements: (options?: {
|
|
132
|
+
level: number;
|
|
133
|
+
}) => (element: HTMLElement) => boolean;
|
|
134
|
+
focusElement: (options: {
|
|
135
|
+
elementForFocus: HTMLElement;
|
|
136
|
+
prevElement?: HTMLElement;
|
|
137
|
+
kbContext?: TableKeyboardNavigationContextType;
|
|
138
|
+
event: any;
|
|
139
|
+
}) => void;
|
|
140
|
+
getIdPrefix: (navigation?: TableKeyboardNavigationStateType) => string;
|
|
141
|
+
isNavigatable: (element: Element | null) => boolean;
|
|
142
|
+
findNextIdByRowIndex: (initialRowIndex: number, cellIndex: number, elementId: string | undefined, matrix: string[][], isReverse: boolean) => [
|
|
143
|
+
string,
|
|
144
|
+
[
|
|
145
|
+
number,
|
|
146
|
+
number
|
|
147
|
+
]
|
|
148
|
+
] | [
|
|
149
|
+
];
|
|
150
|
+
findNextIdByCellIndex: (rowIndex: number, initialCellIndex: number, elementId: string | undefined, matrix: string[][], isReverse: boolean) => [
|
|
151
|
+
string,
|
|
152
|
+
[
|
|
153
|
+
number,
|
|
154
|
+
number
|
|
155
|
+
]
|
|
156
|
+
] | [
|
|
157
|
+
];
|
|
158
|
+
findId: (navigationMatrix: string[][], cellId?: string) => number[] | undefined;
|
|
159
|
+
getNextNavigationIndex: (navigation?: TableKeyboardNavigationStateType) => number;
|
|
160
|
+
getFilterColumnId: (columnId: string) => string;
|
|
161
|
+
};
|