@syncfusion/ej2-filemanager 19.4.56 → 20.1.52-10459
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/.eslintrc.json +20 -3
- package/README.md +54 -43
- package/dist/ej2-filemanager.min.js +1 -0
- package/dist/ej2-filemanager.umd.min.js +1 -10
- package/dist/ej2-filemanager.umd.min.js.map +1 -1
- package/dist/es6/ej2-filemanager.es2015.js +2371 -664
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +2440 -714
- package/dist/es6/ej2-filemanager.es5.js.map +1 -1
- package/dist/global/ej2-filemanager.min.js +1 -10
- package/dist/global/ej2-filemanager.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/helpers/e2e/filemanagerHelper.js +183 -166
- package/package.json +71 -71
- package/src/file-manager/actions/breadcrumb-bar.js +1 -5
- package/src/file-manager/actions/index.d.ts +1 -0
- package/src/file-manager/actions/index.js +1 -0
- package/src/file-manager/actions/toolbar.d.ts +1 -0
- package/src/file-manager/actions/toolbar.js +135 -20
- package/src/file-manager/actions/virtualization.d.ts +93 -0
- package/src/file-manager/actions/virtualization.js +279 -0
- package/src/file-manager/base/file-manager-model.d.ts +161 -28
- package/src/file-manager/base/file-manager.d.ts +182 -28
- package/src/file-manager/base/file-manager.js +254 -29
- package/src/file-manager/base/interface.d.ts +329 -3
- package/src/file-manager/base/interface.js +0 -1
- package/src/file-manager/common/operations.d.ts +7 -0
- package/src/file-manager/common/operations.js +830 -185
- package/src/file-manager/common/utility.d.ts +46 -3
- package/src/file-manager/common/utility.js +249 -73
- package/src/file-manager/index.d.ts +1 -0
- package/src/file-manager/index.js +1 -0
- package/src/file-manager/layout/details-view.d.ts +10 -0
- package/src/file-manager/layout/details-view.js +204 -94
- package/src/file-manager/layout/large-icons-view.d.ts +4 -2
- package/src/file-manager/layout/large-icons-view.js +122 -73
- package/src/file-manager/layout/navigation-pane.d.ts +2 -0
- package/src/file-manager/layout/navigation-pane.js +97 -73
- package/src/file-manager/models/column-model.d.ts +23 -5
- package/src/file-manager/models/column.d.ts +21 -2
- package/src/file-manager/models/column.js +6 -0
- package/src/file-manager/models/default-locale.js +0 -1
- package/src/file-manager/models/details-view-settings-model.d.ts +1 -1
- package/src/file-manager/models/details-view-settings.js +8 -3
- package/src/file-manager/models/navigation-pane-settings.d.ts +8 -8
- package/src/file-manager/models/search-settings.d.ts +5 -0
- package/src/file-manager/models/toolbar-settings-model.d.ts +177 -2
- package/src/file-manager/models/toolbar-settings.d.ts +157 -2
- package/src/file-manager/models/toolbar-settings.js +64 -2
- package/src/file-manager/models/upload-settings-model.d.ts +13 -0
- package/src/file-manager/models/upload-settings.d.ts +12 -0
- package/src/file-manager/models/upload-settings.js +3 -0
- package/src/file-manager/pop-up/context-menu.d.ts +2 -1
- package/src/file-manager/pop-up/context-menu.js +111 -36
- package/src/file-manager/pop-up/dialog.d.ts +1 -2
- package/src/file-manager/pop-up/dialog.js +19 -40
- package/src/global.js +1 -1
- package/styles/bootstrap-dark-lite.css +1058 -0
- package/styles/bootstrap-dark-lite.scss +16 -0
- package/styles/bootstrap-dark.css +371 -665
- package/styles/bootstrap-dark.scss +17 -1
- package/styles/bootstrap-lite.css +1040 -0
- package/styles/bootstrap-lite.scss +16 -0
- package/styles/bootstrap.css +353 -644
- package/styles/bootstrap.scss +17 -1
- package/styles/bootstrap4-lite.css +1068 -0
- package/styles/bootstrap4-lite.scss +16 -0
- package/styles/bootstrap4.css +381 -680
- package/styles/bootstrap4.scss +17 -1
- package/styles/bootstrap5-dark-lite.css +1078 -0
- package/styles/bootstrap5-dark-lite.scss +16 -0
- package/styles/bootstrap5-dark.css +377 -695
- package/styles/bootstrap5-dark.scss +17 -1
- package/styles/bootstrap5-lite.css +1078 -0
- package/styles/bootstrap5-lite.scss +16 -0
- package/styles/bootstrap5.3-lite.css +1035 -0
- package/styles/bootstrap5.3-lite.scss +16 -0
- package/styles/bootstrap5.3.css +1603 -0
- package/styles/bootstrap5.3.scss +17 -0
- package/styles/bootstrap5.css +377 -695
- package/styles/bootstrap5.scss +17 -1
- package/styles/fabric-dark-lite.css +1039 -0
- package/styles/fabric-dark-lite.scss +16 -0
- package/styles/fabric-dark.css +358 -642
- package/styles/fabric-dark.scss +17 -1
- package/styles/fabric-lite.css +1039 -0
- package/styles/fabric-lite.scss +16 -0
- package/styles/fabric.css +357 -641
- package/styles/fabric.scss +17 -1
- package/styles/file-manager/_all.scss +1 -1
- package/styles/file-manager/_bds-definition.scss +236 -0
- package/styles/file-manager/_bigger.scss +758 -0
- package/styles/file-manager/_bootstrap-dark-definition.scss +6 -2
- package/styles/file-manager/_bootstrap-definition.scss +6 -2
- package/styles/file-manager/_bootstrap4-definition.scss +6 -2
- package/styles/file-manager/_bootstrap5-definition.scss +21 -16
- package/styles/file-manager/_bootstrap5.3-definition.scss +242 -0
- package/styles/file-manager/_fabric-dark-definition.scss +6 -2
- package/styles/file-manager/_fabric-definition.scss +6 -2
- package/styles/file-manager/_fluent-dark-definition.scss +1 -0
- package/styles/file-manager/_fluent-definition.scss +26 -22
- package/styles/file-manager/_fluent2-definition.scss +255 -0
- package/styles/file-manager/_fusionnew-definition.scss +241 -0
- package/styles/file-manager/_highcontrast-definition.scss +6 -2
- package/styles/file-manager/_highcontrast-light-definition.scss +6 -2
- package/styles/file-manager/_layout.scss +373 -912
- package/styles/file-manager/_material-dark-definition.scss +7 -2
- package/styles/file-manager/_material-definition.scss +7 -2
- package/styles/file-manager/_material3-dark-definition.scss +1 -0
- package/styles/file-manager/_material3-definition.scss +235 -0
- package/styles/file-manager/_tailwind-definition.scss +20 -16
- package/styles/file-manager/_theme.scss +130 -99
- package/styles/file-manager/bootstrap-dark.css +371 -665
- package/styles/file-manager/bootstrap-dark.scss +2 -1
- package/styles/file-manager/bootstrap.css +353 -644
- package/styles/file-manager/bootstrap.scss +2 -1
- package/styles/file-manager/bootstrap4.css +381 -680
- package/styles/file-manager/bootstrap4.scss +2 -1
- package/styles/file-manager/bootstrap5-dark.css +377 -695
- package/styles/file-manager/bootstrap5-dark.scss +2 -1
- package/styles/file-manager/bootstrap5.3.css +1603 -0
- package/styles/file-manager/bootstrap5.3.scss +17 -0
- package/styles/file-manager/bootstrap5.css +377 -695
- package/styles/file-manager/bootstrap5.scss +2 -1
- package/styles/file-manager/fabric-dark.css +358 -642
- package/styles/file-manager/fabric-dark.scss +2 -1
- package/styles/file-manager/fabric.css +357 -641
- package/styles/file-manager/fabric.scss +2 -1
- package/styles/file-manager/fluent-dark.css +1616 -0
- package/styles/file-manager/fluent-dark.scss +17 -0
- package/styles/file-manager/fluent.css +1615 -0
- package/styles/file-manager/fluent.scss +17 -0
- package/styles/file-manager/fluent2.css +1886 -0
- package/styles/file-manager/fluent2.scss +17 -0
- package/styles/file-manager/highcontrast-light.css +354 -644
- package/styles/file-manager/highcontrast-light.scss +2 -1
- package/styles/file-manager/highcontrast.css +377 -647
- package/styles/file-manager/highcontrast.scss +2 -1
- package/styles/file-manager/icons/_bds.scss +235 -0
- package/styles/file-manager/icons/_bootstrap.scss +0 -1
- package/styles/file-manager/icons/_bootstrap4.scss +0 -1
- package/styles/file-manager/icons/_bootstrap5.3.scss +235 -0
- package/styles/file-manager/icons/_fabric-dark.scss +0 -1
- package/styles/file-manager/icons/_fabric.scss +0 -1
- package/styles/file-manager/icons/_fluent-dark.scss +1 -0
- package/styles/file-manager/icons/_fluent.scss +19 -19
- package/styles/file-manager/icons/_fluent2.scss +235 -0
- package/styles/file-manager/icons/_fusionnew.scss +235 -0
- package/styles/file-manager/icons/_material3-dark.scss +1 -0
- package/styles/file-manager/icons/_material3.scss +235 -0
- package/styles/file-manager/icons/_tailwind.scss +49 -49
- package/styles/file-manager/material-dark.css +392 -671
- package/styles/file-manager/material-dark.scss +2 -1
- package/styles/file-manager/material.css +391 -654
- package/styles/file-manager/material.scss +2 -1
- package/styles/file-manager/material3-dark.css +1633 -0
- package/styles/file-manager/material3-dark.scss +18 -0
- package/styles/file-manager/material3.css +1635 -0
- package/styles/file-manager/material3.scss +18 -0
- package/styles/file-manager/tailwind-dark.css +369 -686
- package/styles/file-manager/tailwind-dark.scss +2 -1
- package/styles/file-manager/tailwind.css +369 -686
- package/styles/file-manager/tailwind.scss +2 -1
- package/styles/fluent-dark-lite.css +1037 -0
- package/styles/fluent-dark-lite.scss +16 -0
- package/styles/fluent-dark.css +1616 -0
- package/styles/fluent-dark.scss +17 -0
- package/styles/fluent-lite.css +1036 -0
- package/styles/fluent-lite.scss +16 -0
- package/styles/fluent.css +1615 -0
- package/styles/fluent.scss +17 -0
- package/styles/fluent2-lite.css +1272 -0
- package/styles/fluent2-lite.scss +16 -0
- package/styles/fluent2.css +1886 -0
- package/styles/fluent2.scss +17 -0
- package/styles/highcontrast-light-lite.css +1039 -0
- package/styles/highcontrast-light-lite.scss +16 -0
- package/styles/highcontrast-light.css +354 -644
- package/styles/highcontrast-light.scss +17 -1
- package/styles/highcontrast-lite.css +1059 -0
- package/styles/highcontrast-lite.scss +16 -0
- package/styles/highcontrast.css +377 -647
- package/styles/highcontrast.scss +17 -1
- package/styles/material-dark-lite.css +1092 -0
- package/styles/material-dark-lite.scss +16 -0
- package/styles/material-dark.css +392 -671
- package/styles/material-dark.scss +17 -1
- package/styles/material-lite.css +1097 -0
- package/styles/material-lite.scss +16 -0
- package/styles/material.css +391 -654
- package/styles/material.scss +17 -1
- package/styles/material3-dark-lite.css +1090 -0
- package/styles/material3-dark-lite.scss +16 -0
- package/styles/material3-dark.css +1633 -0
- package/styles/material3-dark.scss +19 -0
- package/styles/material3-lite.css +1092 -0
- package/styles/material3-lite.scss +16 -0
- package/styles/material3.css +1635 -0
- package/styles/material3.scss +19 -0
- package/styles/tailwind-dark-lite.css +1060 -0
- package/styles/tailwind-dark-lite.scss +16 -0
- package/styles/tailwind-dark.css +369 -686
- package/styles/tailwind-dark.scss +17 -1
- package/styles/tailwind-lite.css +1060 -0
- package/styles/tailwind-lite.scss +16 -0
- package/styles/tailwind.css +369 -686
- package/styles/tailwind.scss +17 -1
- package/CHANGELOG.md +0 -466
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Grid, Resize, ContextMenu, Sort, VirtualScroll } from '@syncfusion/ej2-grids';
|
2
2
|
import { select, KeyboardEvents, EventHandler, getValue, isNullOrUndefined } from '@syncfusion/ej2-base';
|
3
3
|
import { isNullOrUndefined as isNOU, Touch, setValue, addClass, removeClass } from '@syncfusion/ej2-base';
|
4
|
-
import { Internationalization, closest, Draggable } from '@syncfusion/ej2-base';
|
4
|
+
import { Internationalization, closest, Draggable, initializeCSPTemplate, extend, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
5
5
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
6
6
|
import { hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
7
7
|
import * as events from '../base/constant';
|
@@ -14,6 +14,7 @@ import { cutFiles, addBlur, openSearchFolder, copyFiles, removeActive, pasteHand
|
|
14
14
|
import { hasReadAccess, hasEditAccess, hasDownloadAccess, doRename, getAccessClass, createDeniedDialog, rename } from '../common/index';
|
15
15
|
import { createVirtualDragElement, dragStopHandler, dragStartHandler, draggingHandler, getModule, getFullPath } from '../common/index';
|
16
16
|
import { getDirectoryPath, updateRenamingData, getItemName, doDeleteFiles, doDownloadFiles } from '../common/index';
|
17
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
17
18
|
/**
|
18
19
|
* DetailsView module
|
19
20
|
*/
|
@@ -71,15 +72,16 @@ var DetailsView = /** @class */ (function () {
|
|
71
72
|
home: 'home',
|
72
73
|
moveUp: 'uparrow',
|
73
74
|
del: 'delete',
|
74
|
-
ctrlX: 'ctrl+x',
|
75
|
-
ctrlC: 'ctrl+c',
|
76
|
-
ctrlV: 'ctrl+v',
|
75
|
+
ctrlX: this.parent.isMac ? 'cmd+x' : 'ctrl+x',
|
76
|
+
ctrlC: this.parent.isMac ? 'cmd+c' : 'ctrl+c',
|
77
|
+
ctrlV: this.parent.isMac ? 'cmd+v' : 'ctrl+v',
|
77
78
|
ctrlShiftN: 'ctrl+shift+n',
|
78
79
|
shiftdel: 'shift+delete',
|
79
80
|
ctrlD: 'ctrl+d',
|
80
81
|
f2: 'f2',
|
81
82
|
ctrlA: 'ctrl+a',
|
82
|
-
enter: 'enter'
|
83
|
+
enter: 'enter',
|
84
|
+
back: 'backspace'
|
83
85
|
};
|
84
86
|
}
|
85
87
|
/* istanbul ignore next */
|
@@ -87,7 +89,6 @@ var DetailsView = /** @class */ (function () {
|
|
87
89
|
showSpinner(this.parent.element);
|
88
90
|
if (this.parent.view === 'Details') {
|
89
91
|
removeClass([this.parent.element], CLS.MULTI_SELECT);
|
90
|
-
// eslint-disable-next-line
|
91
92
|
var items = getSortedData(this.parent, args.files);
|
92
93
|
this.checkNameWidth();
|
93
94
|
var columns = this.getColumns();
|
@@ -114,6 +115,9 @@ var DetailsView = /** @class */ (function () {
|
|
114
115
|
},
|
115
116
|
enableRtl: this.parent.enableRtl,
|
116
117
|
pageSettings: { pageSize: 20 },
|
118
|
+
enableVirtualization: this.parent.enableVirtualization,
|
119
|
+
enablePersistence: this.parent.enablePersistence,
|
120
|
+
enableVirtualMaskRow: true,
|
117
121
|
sortSettings: { allowUnsort: false, columns: sortSettings },
|
118
122
|
columns: columns,
|
119
123
|
recordDoubleClick: this.DblClickEvents.bind(this),
|
@@ -123,13 +127,18 @@ var DetailsView = /** @class */ (function () {
|
|
123
127
|
actionBegin: this.onActionBegin.bind(this),
|
124
128
|
headerCellInfo: this.onHeaderCellInfo.bind(this),
|
125
129
|
width: '100%',
|
130
|
+
height: (this.parent.enableVirtualization) ? this.getGridHeight() : 'auto',
|
126
131
|
beforeCopy: function (args) { args.cancel = true; },
|
127
|
-
|
128
|
-
load: function (args) {
|
132
|
+
load: function () {
|
129
133
|
this.focusModule.destroy();
|
130
134
|
},
|
131
135
|
locale: this.parent.locale
|
132
136
|
});
|
137
|
+
if (this.parent.isReact) {
|
138
|
+
this.gridObj.isReact = true;
|
139
|
+
this.gridObj.portals = [];
|
140
|
+
this.gridObj.on('reactTemplateRender', this.reactTemplateRender, this);
|
141
|
+
}
|
133
142
|
this.gridObj.isStringTemplate = true;
|
134
143
|
this.gridObj.appendTo('#' + this.parent.element.id + CLS.GRID_ID);
|
135
144
|
this.wireEvents();
|
@@ -137,6 +146,30 @@ var DetailsView = /** @class */ (function () {
|
|
137
146
|
this.emptyArgs = args;
|
138
147
|
}
|
139
148
|
};
|
149
|
+
DetailsView.prototype.reactTemplateRender = function (args) {
|
150
|
+
this.parent['portals'] = args;
|
151
|
+
if (this.parent.portals && this.parent.toolbarModule && this.parent.toolbarModule.toolbarObj &&
|
152
|
+
this.parent.toolbarModule.toolbarObj.portals) {
|
153
|
+
this.parent['portals'] = this.parent['portals'].concat(this.parent.toolbarModule.toolbarObj.portals);
|
154
|
+
}
|
155
|
+
this.parent.notify('renderReactTemplate', this.parent['portals']);
|
156
|
+
this.parent['renderReactTemplates']();
|
157
|
+
};
|
158
|
+
/**
|
159
|
+
* Gets the grid height.
|
160
|
+
*
|
161
|
+
* @returns {number} - The grid height.
|
162
|
+
* @private
|
163
|
+
*/
|
164
|
+
DetailsView.prototype.getGridHeight = function () {
|
165
|
+
// Get the content pane and breadcrumb bar elements
|
166
|
+
var pane = select('#' + this.parent.element.id + CLS.CONTENT_ID, this.parent.element);
|
167
|
+
var bar = select('#' + this.parent.element.id + CLS.BREADCRUMBBAR_ID, this.parent.element);
|
168
|
+
// The maximum height of the header is 36
|
169
|
+
var headerMaxHeight = 36;
|
170
|
+
// Calculate and return the grid height
|
171
|
+
return (pane.offsetHeight - bar.offsetHeight - headerMaxHeight);
|
172
|
+
};
|
140
173
|
DetailsView.prototype.checkNameWidth = function () {
|
141
174
|
var initialColumn = this.parent.detailsViewSettings.columns;
|
142
175
|
this.isNameWidth = false;
|
@@ -166,30 +199,48 @@ var DetailsView = /** @class */ (function () {
|
|
166
199
|
};
|
167
200
|
DetailsView.prototype.getColumns = function () {
|
168
201
|
var columns;
|
202
|
+
var enableHtmlSanitizer = this.parent.enableHtmlSanitizer;
|
169
203
|
if (this.parent.isMobile) {
|
170
204
|
columns = [
|
171
205
|
{
|
172
206
|
field: 'name', headerText: getLocaleText(this.parent, 'Name'), width: 'auto', minWidth: 120, headerTextAlign: 'Left',
|
173
|
-
template:
|
174
|
-
|
207
|
+
template: initializeCSPTemplate(function (data) {
|
208
|
+
var name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
|
209
|
+
return "<div class=\"e-fe-text\">" + name + "</div><div class=\"e-fe-date\">" + data._fm_modified + "</div><span class=\"e-fe-size\">" + data.size + "</span>";
|
210
|
+
})
|
175
211
|
}
|
176
212
|
];
|
177
213
|
}
|
178
214
|
else {
|
179
|
-
columns =
|
215
|
+
columns = extend([], this.parent.detailsViewSettings.columns, null, true);
|
180
216
|
this.adjustWidth(columns, 'name');
|
217
|
+
var _loop_1 = function (i, len) {
|
218
|
+
columns[i].headerText = getLocaleText(this_1.parent, columns[i].headerText);
|
219
|
+
if (columns[i].field === 'name' && !isNOU(columns[i].template) && !(typeof columns[i].template === 'function')) {
|
220
|
+
var template_1 = columns[i].template;
|
221
|
+
columns[i].template = initializeCSPTemplate(function (data) {
|
222
|
+
var name = enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(data.name) : data.name;
|
223
|
+
return template_1.replace(/\${name}/g, name);
|
224
|
+
});
|
225
|
+
}
|
226
|
+
};
|
227
|
+
var this_1 = this;
|
181
228
|
for (var i = 0, len = columns.length; i < len; i++) {
|
182
|
-
|
229
|
+
_loop_1(i, len);
|
183
230
|
}
|
184
231
|
}
|
185
232
|
var iWidth = ((this.parent.isMobile || this.parent.isBigger) ? '54' : '46');
|
186
233
|
var icon = {
|
187
|
-
field: 'type', width: iWidth, minWidth: iWidth,
|
188
|
-
|
189
|
-
|
234
|
+
field: 'type', width: iWidth, minWidth: iWidth,
|
235
|
+
template: initializeCSPTemplate(function (data) {
|
236
|
+
return "<span class=\"e-fe-icon " + data._fm_iconClass + "\"></span>";
|
237
|
+
}), allowResizing: false, allowSorting: true, customAttributes: { class: 'e-fe-grid-icon' },
|
238
|
+
headerTemplate: initializeCSPTemplate(function () {
|
239
|
+
return '<span class=\'e-fe-icon e-fe-folder\'></span>';
|
240
|
+
})
|
190
241
|
};
|
191
242
|
columns.unshift(icon);
|
192
|
-
if (this.parent.
|
243
|
+
if (this.parent.showItemCheckBoxes) {
|
193
244
|
var cWidth = (this.parent.isBigger ? '36' : '26');
|
194
245
|
var cBox = {
|
195
246
|
type: 'checkbox', width: cWidth, minWidth: cWidth, customAttributes: { class: 'e-fe-checkbox' },
|
@@ -205,6 +256,10 @@ var DetailsView = /** @class */ (function () {
|
|
205
256
|
for (var i = 0, len = columns.length; i < len; i++) {
|
206
257
|
columns[i].disableHtmlEncode = !this.parent.enableHtmlSanitizer;
|
207
258
|
}
|
259
|
+
if (this.parent.enableRangeSelection) {
|
260
|
+
var HiddenName = { field: 'name', visible: false, customAttributes: { class: 'e-drag-text' } };
|
261
|
+
columns.push(HiddenName);
|
262
|
+
}
|
208
263
|
return columns;
|
209
264
|
};
|
210
265
|
DetailsView.prototype.adjustHeight = function () {
|
@@ -244,7 +299,8 @@ var DetailsView = /** @class */ (function () {
|
|
244
299
|
}
|
245
300
|
}
|
246
301
|
if (!this.parent.showFileExtension && getValue('isFile', args.data)) {
|
247
|
-
var
|
302
|
+
var text = getValue('name', args.data);
|
303
|
+
var textEle = args.row.querySelector('[title= "' + text + '"]');
|
248
304
|
if (textEle) {
|
249
305
|
var name_1 = getValue('name', args.data);
|
250
306
|
var type = getValue('type', args.data);
|
@@ -260,7 +316,15 @@ var DetailsView = /** @class */ (function () {
|
|
260
316
|
else {
|
261
317
|
var sizeValue = getValue('size', args.data);
|
262
318
|
var intl = new Internationalization(this.parent.locale);
|
263
|
-
var
|
319
|
+
var sizeFormat = void 0;
|
320
|
+
var columns = this.parent.detailsViewSettings.columns;
|
321
|
+
for (var i = 0; i < columns.length; i++) {
|
322
|
+
if (columns[i].field === 'size') {
|
323
|
+
sizeFormat = !isNullOrUndefined(columns[i].format) ? columns[i].format.toString() : 'n';
|
324
|
+
break;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
var value = intl.formatNumber((sizeValue / 1024), { format: sizeFormat });
|
264
328
|
modifiedSize = value + ' ' + getLocaleText(this.parent, 'KB');
|
265
329
|
}
|
266
330
|
sizeEle.innerHTML = modifiedSize;
|
@@ -270,7 +334,6 @@ var DetailsView = /** @class */ (function () {
|
|
270
334
|
var dateEle = args.row.querySelector('.e-fe-date');
|
271
335
|
var intl = new Internationalization(this.parent.locale);
|
272
336
|
var columns = this.parent.detailsViewSettings.columns;
|
273
|
-
// eslint-disable-next-line
|
274
337
|
var format = void 0;
|
275
338
|
for (var i = 0; i < columns.length; i++) {
|
276
339
|
if (columns[i].field === 'dateModified') {
|
@@ -306,7 +369,6 @@ var DetailsView = /** @class */ (function () {
|
|
306
369
|
var len = rows.length;
|
307
370
|
this.sortSelectedNodes = [];
|
308
371
|
while (len > 0) {
|
309
|
-
// eslint-disable-next-line
|
310
372
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
311
373
|
this.sortSelectedNodes.push(getValue(this.parent.hasId ? 'id' : 'name', data));
|
312
374
|
len--;
|
@@ -322,15 +384,22 @@ var DetailsView = /** @class */ (function () {
|
|
322
384
|
}
|
323
385
|
};
|
324
386
|
DetailsView.prototype.onBeforeDataBound = function (args) {
|
387
|
+
var _this = this;
|
325
388
|
showSpinner(this.parent.element);
|
326
|
-
|
327
|
-
|
328
|
-
|
389
|
+
var nameColumn = this.parent.detailsViewSettings.columns.find(function (column) { return column.field === _this.parent.sortBy; });
|
390
|
+
if (nameColumn && !('sortComparer' in nameColumn)) {
|
391
|
+
var items = getSortedData(this.parent, (this.parent.enableVirtualization)
|
392
|
+
? args.result
|
393
|
+
: this.gridObj.dataSource);
|
394
|
+
args.result = items;
|
395
|
+
}
|
329
396
|
};
|
330
397
|
/* istanbul ignore next */
|
331
398
|
DetailsView.prototype.onDataBound = function () {
|
332
399
|
this.createDragObj();
|
333
|
-
if (this.parent.selectedItems.length !== 0)
|
400
|
+
if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
|
401
|
+
((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
|
402
|
+
this.element.querySelector('.e-content').scrollTop === 0))) {
|
334
403
|
this.selectRecords(this.parent.selectedItems);
|
335
404
|
}
|
336
405
|
if (this.isPasteOperation === true) {
|
@@ -403,7 +472,6 @@ var DetailsView = /** @class */ (function () {
|
|
403
472
|
this.isLoaded = false;
|
404
473
|
};
|
405
474
|
DetailsView.prototype.selectRecords = function (nodes) {
|
406
|
-
// eslint-disable-next-line
|
407
475
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
408
476
|
var sRecords = [];
|
409
477
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
@@ -411,24 +479,26 @@ var DetailsView = /** @class */ (function () {
|
|
411
479
|
if (nodes.indexOf(node) !== -1) {
|
412
480
|
sRecords.push(i);
|
413
481
|
}
|
482
|
+
else if (!this.parent.showFileExtension && !this.parent.hasId && node.includes('.')) {
|
483
|
+
var Str2 = node.split('.').slice(0, -1).join('.');
|
484
|
+
if (nodes.indexOf(Str2) !== -1) {
|
485
|
+
sRecords.push(i);
|
486
|
+
}
|
487
|
+
}
|
414
488
|
}
|
415
489
|
if (sRecords.length !== 0) {
|
416
490
|
this.gridObj.selectRows(sRecords);
|
417
491
|
this.addFocus(this.gridObj.selectedRowIndex);
|
418
492
|
}
|
419
493
|
};
|
420
|
-
// eslint-disable-next-line
|
421
494
|
DetailsView.prototype.addSelection = function (data) {
|
422
|
-
// eslint-disable-next-line
|
423
495
|
var items = this.gridObj.getCurrentViewRecords();
|
424
|
-
// eslint-disable-next-line
|
425
496
|
var rData = [];
|
426
497
|
if (this.parent.hasId) {
|
427
498
|
rData = new DataManager(items).
|
428
499
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
429
500
|
}
|
430
501
|
else {
|
431
|
-
// eslint-disable-next-line
|
432
502
|
var nData = new DataManager(items).
|
433
503
|
executeLocal(new Query().where('name', 'equal', getValue('name', data), false));
|
434
504
|
if (nData.length > 0) {
|
@@ -446,9 +516,11 @@ var DetailsView = /** @class */ (function () {
|
|
446
516
|
this.gridObj.sortModule.sortColumn(this.parent.sortBy, this.parent.sortOrder);
|
447
517
|
}
|
448
518
|
else {
|
449
|
-
// eslint-disable-next-line
|
450
519
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
451
520
|
}
|
521
|
+
if (this.element.querySelector('.e-content').scrollTop !== 0) {
|
522
|
+
this.gridObj.freezeRefresh();
|
523
|
+
}
|
452
524
|
};
|
453
525
|
DetailsView.prototype.onPropertyChanged = function (e) {
|
454
526
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
@@ -486,6 +558,7 @@ var DetailsView = /** @class */ (function () {
|
|
486
558
|
}
|
487
559
|
else if (!isNOU(this.gridObj)) {
|
488
560
|
this.gridObj.clearSelection();
|
561
|
+
this.interaction = true;
|
489
562
|
}
|
490
563
|
break;
|
491
564
|
case 'showFileExtension':
|
@@ -512,7 +585,9 @@ var DetailsView = /** @class */ (function () {
|
|
512
585
|
};
|
513
586
|
DetailsView.prototype.onPathChanged = function (args) {
|
514
587
|
this.parent.isCut = false;
|
515
|
-
|
588
|
+
var pathField = this.parent.detailsViewSettings.columns.find(function (column) { return column.field === 'filterPath'; });
|
589
|
+
if ((this.parent.breadcrumbbarModule.searchObj.element.value.trim() === '' && this.gridObj) ||
|
590
|
+
(!isNullOrUndefined(pathField) && !isNullOrUndefined(pathField.hideAtMedia) && pathField.hideAtMedia !== '')) {
|
516
591
|
this.parent.searchedItems = [];
|
517
592
|
if (!this.parent.isFiltered) {
|
518
593
|
this.removePathColumn(false);
|
@@ -528,6 +603,10 @@ var DetailsView = /** @class */ (function () {
|
|
528
603
|
showSpinner(this.parent.element);
|
529
604
|
this.parent.setProperties({ selectedItems: [] }, true);
|
530
605
|
this.gridObj.dataSource = getSortedData(this.parent, args.files);
|
606
|
+
this.gridObj.freezeRefresh();
|
607
|
+
if (this.parent.isReact) {
|
608
|
+
this.gridObj.on('reactTemplateRender', this.reactTemplateRender, this);
|
609
|
+
}
|
531
610
|
}
|
532
611
|
this.emptyArgs = args;
|
533
612
|
};
|
@@ -546,7 +625,6 @@ var DetailsView = /** @class */ (function () {
|
|
546
625
|
}
|
547
626
|
};
|
548
627
|
DetailsView.prototype.checkEmptyDiv = function (args) {
|
549
|
-
// eslint-disable-next-line
|
550
628
|
var items = getSortedData(this.parent, args.files);
|
551
629
|
if (items.length === 0 && !isNOU(this.element.querySelector('.' + CLS.GRID_VIEW))) {
|
552
630
|
createEmptyElement(this.parent, this.element, args);
|
@@ -563,21 +641,18 @@ var DetailsView = /** @class */ (function () {
|
|
563
641
|
};
|
564
642
|
DetailsView.prototype.onOpenInit = function () {
|
565
643
|
if (this.parent.activeModule === 'detailsview') {
|
566
|
-
// eslint-disable-next-line
|
567
644
|
var data = this.gridObj.getSelectedRecords()[0];
|
568
645
|
this.openContent(data);
|
569
646
|
}
|
570
647
|
};
|
571
648
|
DetailsView.prototype.DblClickEvents = function (args) {
|
572
649
|
this.gridObj.selectRows([args.rowIndex]);
|
573
|
-
// eslint-disable-next-line
|
574
650
|
var data;
|
575
651
|
if (args.rowData) {
|
576
652
|
data = JSON.parse(JSON.stringify(args.rowData));
|
577
653
|
this.openContent(data);
|
578
654
|
}
|
579
655
|
};
|
580
|
-
// eslint-disable-next-line
|
581
656
|
DetailsView.prototype.openContent = function (data) {
|
582
657
|
var _this = this;
|
583
658
|
if (!hasReadAccess(data)) {
|
@@ -599,6 +674,7 @@ var DetailsView = /** @class */ (function () {
|
|
599
674
|
var val = _this.parent.breadcrumbbarModule.searchObj.element.value;
|
600
675
|
if (val === '' && !_this.parent.isFiltered) {
|
601
676
|
var id = getValue('id', data);
|
677
|
+
_this.parent.oldPath = _this.parent.path;
|
602
678
|
var newPath = _this.parent.path + (isNOU(id) ? name_2 : id) + '/';
|
603
679
|
_this.parent.setProperties({ path: newPath }, true);
|
604
680
|
_this.parent.pathNames.push(name_2);
|
@@ -612,12 +688,18 @@ var DetailsView = /** @class */ (function () {
|
|
612
688
|
_this.parent.isFiltered = false;
|
613
689
|
}
|
614
690
|
_this.element.focus();
|
691
|
+
if (_this.parent.enableVirtualization) {
|
692
|
+
_this.parent.element.querySelector('#' + _this.parent.element.id + CLS.IMG_DIALOG_ID).focus();
|
693
|
+
}
|
615
694
|
}
|
616
695
|
});
|
617
696
|
};
|
618
697
|
/* istanbul ignore next */
|
619
698
|
DetailsView.prototype.onLayoutChange = function (args) {
|
620
699
|
if (this.parent.view === 'Details') {
|
700
|
+
if (this.parent.enableVirtualization) {
|
701
|
+
this.parent.setProperties({ selectedItems: [] }, true);
|
702
|
+
}
|
621
703
|
if (!this.gridObj) {
|
622
704
|
this.render(args);
|
623
705
|
}
|
@@ -662,12 +744,11 @@ var DetailsView = /** @class */ (function () {
|
|
662
744
|
var columnData = JSON.parse(JSON.stringify(this.gridObj.columns));
|
663
745
|
if (columnData[len - 1].field && (columnData[len - 1].field === 'filterPath')) {
|
664
746
|
/* istanbul ignore next */
|
665
|
-
if (this.gridObj.sortSettings.columns[0].field === 'filterPath') {
|
747
|
+
if (!isNullOrUndefined(this.gridObj.sortSettings.columns[0]) && this.gridObj.sortSettings.columns[0].field === 'filterPath') {
|
666
748
|
if (this.parent.sortOrder !== 'None') {
|
667
749
|
this.gridObj.sortColumn('name', this.parent.sortOrder);
|
668
750
|
}
|
669
751
|
else {
|
670
|
-
// eslint-disable-next-line
|
671
752
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
672
753
|
}
|
673
754
|
this.parent.notify(events.sortByChange, {});
|
@@ -856,7 +937,6 @@ var DetailsView = /** @class */ (function () {
|
|
856
937
|
this.parent.off(events.updateSelectionData, this.onUpdateSelectionData);
|
857
938
|
};
|
858
939
|
DetailsView.prototype.onActionFailure = function () { this.interaction = true; };
|
859
|
-
// eslint-disable-next-line
|
860
940
|
DetailsView.prototype.onMenuItemData = function (args) {
|
861
941
|
if (this.parent.activeModule === this.getModuleName()) {
|
862
942
|
this.parent.itemData = [this.gridObj.getRowInfo(args.target).rowData];
|
@@ -884,14 +964,19 @@ var DetailsView = /** @class */ (function () {
|
|
884
964
|
if (!dragLi) {
|
885
965
|
return null;
|
886
966
|
}
|
887
|
-
var name
|
967
|
+
var name;
|
968
|
+
if (dragLi.getElementsByClassName('e-fe-text')[0]) {
|
969
|
+
name = this.parent.hasId ? this.gridObj.getRowInfo(dragLi).rowData.id : dragLi.getElementsByClassName('e-fe-text')[0].innerText;
|
970
|
+
}
|
971
|
+
else if (dragLi.getElementsByClassName('e-rowcell e-templatecell')[0].nextElementSibling) {
|
972
|
+
name = this.parent.hasId ? this.gridObj.getRowInfo(dragLi).rowData.id : dragLi.getElementsByClassName('e-rowcell e-templatecell')[0].nextElementSibling.innerText;
|
973
|
+
}
|
888
974
|
if (dragLi && !dragLi.querySelector('.e-active')) {
|
889
975
|
this.selectRecords([name]);
|
890
976
|
}
|
891
977
|
getModule(this.parent, dragLi);
|
892
978
|
this.parent.activeElements = [];
|
893
979
|
this.parent.dragData = [];
|
894
|
-
// eslint-disable-next-line
|
895
980
|
this.parent.dragData = this.gridObj.getSelectedRecords();
|
896
981
|
var dragRow;
|
897
982
|
if (this.parent.dragData.length === 0 && dragLi) {
|
@@ -952,11 +1037,8 @@ var DetailsView = /** @class */ (function () {
|
|
952
1037
|
};
|
953
1038
|
DetailsView.prototype.createDragObj = function () {
|
954
1039
|
var _this = this;
|
955
|
-
if (
|
956
|
-
if (this.parent.allowDragAndDrop) {
|
957
|
-
if (this.dragObj) {
|
958
|
-
this.dragObj.destroy();
|
959
|
-
}
|
1040
|
+
if (this.gridObj) {
|
1041
|
+
if (this.parent.allowDragAndDrop && isNullOrUndefined(this.dragObj)) {
|
960
1042
|
this.dragObj = new Draggable(this.gridObj.element, {
|
961
1043
|
cursorAt: this.parent.dragCursorPosition,
|
962
1044
|
distance: 5,
|
@@ -968,28 +1050,26 @@ var DetailsView = /** @class */ (function () {
|
|
968
1050
|
dragStartHandler(_this.parent, args, _this.dragObj);
|
969
1051
|
},
|
970
1052
|
dragStop: dragStopHandler.bind(this, this.parent),
|
971
|
-
enableAutoScroll:
|
1053
|
+
enableAutoScroll: false,
|
972
1054
|
helper: this.dragHelper.bind(this)
|
973
1055
|
});
|
974
1056
|
}
|
975
1057
|
else if (!this.parent.allowDragAndDrop && this.dragObj) {
|
976
1058
|
this.dragObj.destroy();
|
1059
|
+
this.dragObj = null;
|
977
1060
|
}
|
978
1061
|
}
|
979
1062
|
};
|
980
1063
|
DetailsView.prototype.onDropInit = function (args) {
|
981
1064
|
if (this.parent.targetModule === this.getModuleName()) {
|
982
1065
|
/* istanbul ignore next */
|
983
|
-
// eslint-disable-next-line
|
984
1066
|
var cwdData = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feParent);
|
985
1067
|
if (!args.target.closest('tr')) {
|
986
1068
|
this.parent.dropPath = this.parent.path;
|
987
1069
|
this.parent.dropData = cwdData;
|
988
1070
|
}
|
989
1071
|
else {
|
990
|
-
// eslint-disable-next-line
|
991
1072
|
var info = null;
|
992
|
-
// eslint-disable-next-line
|
993
1073
|
info = this.gridObj.getRowInfo(args.target).rowData;
|
994
1074
|
this.parent.dropPath = info.isFile ? this.parent.path : getFullPath(this.parent, info, this.parent.path);
|
995
1075
|
this.parent.dropData = info.isFile ? cwdData : info;
|
@@ -1005,7 +1085,8 @@ var DetailsView = /** @class */ (function () {
|
|
1005
1085
|
DetailsView.prototype.onpasteEnd = function (args) {
|
1006
1086
|
if (this.parent.view === 'Details') {
|
1007
1087
|
this.isPasteOperation = true;
|
1008
|
-
if (this.parent.path === this.parent.destinationPath ||
|
1088
|
+
if (this.parent.path === this.parent.destinationPath ||
|
1089
|
+
this.parent.path === getDirectoryPath(this.parent, args) || this.parent.hasId) {
|
1009
1090
|
this.onPathChanged(args);
|
1010
1091
|
}
|
1011
1092
|
}
|
@@ -1031,6 +1112,9 @@ var DetailsView = /** @class */ (function () {
|
|
1031
1112
|
}
|
1032
1113
|
this.removeEventListener();
|
1033
1114
|
if (this.gridObj) {
|
1115
|
+
if (this.parent.isReact) {
|
1116
|
+
this.gridObj.off('reactTemplateRender', this.reactTemplateRender);
|
1117
|
+
}
|
1034
1118
|
this.unWireEvents();
|
1035
1119
|
this.gridObj.destroy();
|
1036
1120
|
}
|
@@ -1084,8 +1168,10 @@ var DetailsView = /** @class */ (function () {
|
|
1084
1168
|
}
|
1085
1169
|
}
|
1086
1170
|
var len = rows.length;
|
1087
|
-
if (
|
1088
|
-
|
1171
|
+
if (this.parent.enableVirtualization) {
|
1172
|
+
this.parent.currentItemText = getValue('name', args.data);
|
1173
|
+
}
|
1174
|
+
else if (len > 0) {
|
1089
1175
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
1090
1176
|
this.parent.currentItemText = getValue('name', data);
|
1091
1177
|
}
|
@@ -1098,11 +1184,9 @@ var DetailsView = /** @class */ (function () {
|
|
1098
1184
|
}
|
1099
1185
|
}
|
1100
1186
|
this.parent.visitedItem = args.row;
|
1101
|
-
if (this.parent.
|
1102
|
-
|
1103
|
-
checkItem.focus();
|
1187
|
+
if ((!this.parent.enableVirtualization) || (!args.isHeaderCheckboxClicked)) {
|
1188
|
+
this.addFocus(this.gridObj.selectedRowIndex);
|
1104
1189
|
}
|
1105
|
-
this.addFocus(this.gridObj.selectedRowIndex);
|
1106
1190
|
if (!this.parent.isLayoutChange) {
|
1107
1191
|
this.isInteracted = true;
|
1108
1192
|
}
|
@@ -1117,7 +1201,6 @@ var DetailsView = /** @class */ (function () {
|
|
1117
1201
|
};
|
1118
1202
|
DetailsView.prototype.selectedRecords = function () {
|
1119
1203
|
this.parent.setProperties({ selectedItems: [] }, true);
|
1120
|
-
// eslint-disable-next-line
|
1121
1204
|
var selectedRecords = this.gridSelectNodes();
|
1122
1205
|
var selectSize = 0;
|
1123
1206
|
while (selectSize < selectedRecords.length) {
|
@@ -1171,36 +1254,37 @@ var DetailsView = /** @class */ (function () {
|
|
1171
1254
|
eventName: 'keydown'
|
1172
1255
|
});
|
1173
1256
|
EventHandler.add(this.gridObj.element, 'blur', this.removeFocus, this);
|
1257
|
+
EventHandler.add(this.parent.element, 'focusout', this.onBlur, this);
|
1174
1258
|
};
|
1175
1259
|
DetailsView.prototype.unWireEvents = function () {
|
1176
1260
|
this.wireClickEvent(false);
|
1177
1261
|
this.keyboardModule.destroy();
|
1178
1262
|
this.keyboardDownModule.destroy();
|
1179
1263
|
EventHandler.remove(this.gridObj.element, 'blur', this.removeFocus);
|
1264
|
+
EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
|
1180
1265
|
};
|
1181
1266
|
DetailsView.prototype.wireClickEvent = function (toBind) {
|
1267
|
+
var _this = this;
|
1182
1268
|
if (toBind) {
|
1183
|
-
// eslint-disable-next-line
|
1184
|
-
var proxy_1 = this;
|
1185
1269
|
var ele = this.gridObj.getContent();
|
1186
1270
|
this.clickObj = new Touch(ele, {
|
1187
1271
|
tap: function (eve) {
|
1188
1272
|
if (eve.tapCount === 1 && eve.originalEvent.target.classList.contains('e-content')) {
|
1189
|
-
|
1273
|
+
_this.onClearAllInit();
|
1190
1274
|
}
|
1191
1275
|
},
|
1192
1276
|
tapHold: function (e) {
|
1193
|
-
if (
|
1277
|
+
if (_this.parent.isDevice) {
|
1194
1278
|
e.originalEvent.preventDefault();
|
1195
|
-
if (
|
1196
|
-
setValue('enableSelectMultiTouch',
|
1197
|
-
addClass([
|
1279
|
+
if (_this.parent.allowMultiSelection) {
|
1280
|
+
setValue('enableSelectMultiTouch', _this.parent.allowMultiSelection, _this.gridObj.selectionModule);
|
1281
|
+
addClass([_this.parent.element], CLS.MULTI_SELECT);
|
1198
1282
|
}
|
1199
1283
|
var target = e.originalEvent.target;
|
1200
1284
|
if (target) {
|
1201
1285
|
var row = closest(target, '.' + CLS.ROW);
|
1202
|
-
var index =
|
1203
|
-
|
1286
|
+
var index = _this.gridObj.getRows().indexOf(row);
|
1287
|
+
_this.gridObj.selectRow(index);
|
1204
1288
|
}
|
1205
1289
|
}
|
1206
1290
|
}
|
@@ -1226,12 +1310,24 @@ var DetailsView = /** @class */ (function () {
|
|
1226
1310
|
DetailsView.prototype.removeFocus = function () {
|
1227
1311
|
this.addFocus(null);
|
1228
1312
|
};
|
1313
|
+
DetailsView.prototype.onBlur = function (e) {
|
1314
|
+
if ((e.relatedTarget !== null && closest(e.relatedTarget, '.e-grid') !== e.relatedTarget)) {
|
1315
|
+
return;
|
1316
|
+
}
|
1317
|
+
if (!isNOU(this.gridObj.element)) {
|
1318
|
+
var thElements = this.gridObj.element.querySelectorAll('th');
|
1319
|
+
for (var i = 0; i < thElements.length; i++) {
|
1320
|
+
if (thElements[i].classList.contains('e-focus')) {
|
1321
|
+
this.addFocus(null);
|
1322
|
+
}
|
1323
|
+
}
|
1324
|
+
}
|
1325
|
+
};
|
1229
1326
|
DetailsView.prototype.getFocusedItemIndex = function () {
|
1230
1327
|
return (!isNOU(this.getFocusedItem())) ?
|
1231
|
-
parseInt(this.getFocusedItem().getAttribute('
|
1328
|
+
parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
|
1232
1329
|
};
|
1233
1330
|
/* istanbul ignore next */
|
1234
|
-
// eslint:disable-next-line
|
1235
1331
|
DetailsView.prototype.keydownHandler = function (e) {
|
1236
1332
|
if (!this.isRendered) {
|
1237
1333
|
return;
|
@@ -1267,6 +1363,7 @@ var DetailsView = /** @class */ (function () {
|
|
1267
1363
|
case 'f2':
|
1268
1364
|
case 'moveDown':
|
1269
1365
|
case 'moveUp':
|
1366
|
+
case 'ctrlD':
|
1270
1367
|
e.preventDefault();
|
1271
1368
|
break;
|
1272
1369
|
default:
|
@@ -1274,26 +1371,23 @@ var DetailsView = /** @class */ (function () {
|
|
1274
1371
|
}
|
1275
1372
|
};
|
1276
1373
|
/* istanbul ignore next */
|
1277
|
-
// eslint:disable-next-line
|
1278
1374
|
DetailsView.prototype.keyupHandler = function (e) {
|
1279
1375
|
if (!this.isRendered) {
|
1280
1376
|
return;
|
1281
1377
|
}
|
1282
1378
|
e.preventDefault();
|
1283
1379
|
var action = e.action;
|
1284
|
-
// eslint-disable-next-line
|
1285
1380
|
var gridItems = getSortedData(this.parent, this.gridObj.dataSource);
|
1286
1381
|
var gridLength = gridItems.length;
|
1287
|
-
var focItem = this.getFocusedItem();
|
1288
1382
|
var focIndex = this.getFocusedItemIndex();
|
1289
1383
|
var selIndex = this.gridObj.selectedRowIndex;
|
1290
1384
|
var selRowIndeces = this.gridObj.getSelectedRowIndexes();
|
1291
|
-
// eslint-disable-next-line
|
1292
1385
|
var rowData;
|
1293
1386
|
var firstItem;
|
1294
1387
|
var lastItem;
|
1295
1388
|
switch (action) {
|
1296
1389
|
case 'altEnter':
|
1390
|
+
this.parent.notify(events.detailsInit, {});
|
1297
1391
|
GetDetails(this.parent, this.parent.selectedItems, this.parent.path, 'details');
|
1298
1392
|
break;
|
1299
1393
|
case 'esc':
|
@@ -1304,12 +1398,19 @@ var DetailsView = /** @class */ (function () {
|
|
1304
1398
|
this.performDelete();
|
1305
1399
|
break;
|
1306
1400
|
case 'enter':
|
1307
|
-
if (this.gridObj.selectedRowIndex === -1) {
|
1401
|
+
if (this.gridObj.selectedRowIndex === -1 && this.gridObj.allowSorting === true) {
|
1402
|
+
if (!e.target.classList.contains('e-fe-grid-icon')) {
|
1403
|
+
var direction = !e.target.getElementsByClassName('e-ascending').length ? 'Ascending' : 'Descending';
|
1404
|
+
var currentField = this.gridObj.getColumnByUid(e.target.querySelector('.e-headercelldiv').getAttribute('e-mappinguid')).field;
|
1405
|
+
this.gridObj.sortColumn(currentField, direction);
|
1406
|
+
if (!isNOU(this.getFocusedItem().nextSibling)) {
|
1407
|
+
this.getFocusedItem().nextSibling.setAttribute('tabindex', '0');
|
1408
|
+
}
|
1409
|
+
}
|
1308
1410
|
break;
|
1309
1411
|
}
|
1310
1412
|
rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
|
1311
1413
|
if (rowData) {
|
1312
|
-
// eslint-disable-next-line
|
1313
1414
|
var data = JSON.parse(JSON.stringify(rowData));
|
1314
1415
|
this.openContent(data);
|
1315
1416
|
}
|
@@ -1352,7 +1453,7 @@ var DetailsView = /** @class */ (function () {
|
|
1352
1453
|
return;
|
1353
1454
|
}
|
1354
1455
|
else {
|
1355
|
-
this.
|
1456
|
+
this.addHeaderFocus(e);
|
1356
1457
|
}
|
1357
1458
|
}
|
1358
1459
|
break;
|
@@ -1424,16 +1525,17 @@ var DetailsView = /** @class */ (function () {
|
|
1424
1525
|
this.parent.setProperties({ selectedItems: lastItem }, true);
|
1425
1526
|
this.selectRecords(lastItem);
|
1426
1527
|
break;
|
1528
|
+
case 'back':
|
1529
|
+
this.parent.traverseBackward();
|
1530
|
+
break;
|
1427
1531
|
}
|
1428
1532
|
};
|
1429
|
-
// eslint-disable-next-line
|
1430
1533
|
DetailsView.prototype.gridSelectNodes = function () {
|
1431
1534
|
return this.gridObj.getSelectedRecords();
|
1432
1535
|
};
|
1433
1536
|
DetailsView.prototype.doDownload = function () {
|
1434
1537
|
if (this.parent.selectedItems.length !== 0) {
|
1435
1538
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
1436
|
-
// eslint-disable-next-line
|
1437
1539
|
var items = this.parent.itemData;
|
1438
1540
|
for (var i = 0; i < items.length; i++) {
|
1439
1541
|
if (!hasDownloadAccess(items[i])) {
|
@@ -1447,7 +1549,6 @@ var DetailsView = /** @class */ (function () {
|
|
1447
1549
|
DetailsView.prototype.performDelete = function () {
|
1448
1550
|
if (this.parent.selectedItems && this.parent.selectedItems.length > 0) {
|
1449
1551
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
1450
|
-
// eslint-disable-next-line
|
1451
1552
|
var items = this.parent.itemData;
|
1452
1553
|
for (var i = 0; i < items.length; i++) {
|
1453
1554
|
if (!hasEditAccess(items[i])) {
|
@@ -1465,11 +1566,9 @@ var DetailsView = /** @class */ (function () {
|
|
1465
1566
|
}
|
1466
1567
|
};
|
1467
1568
|
DetailsView.prototype.updateRenameData = function () {
|
1468
|
-
// eslint-disable-next-line
|
1469
1569
|
var data = this.gridSelectNodes()[0];
|
1470
1570
|
updateRenamingData(this.parent, data);
|
1471
1571
|
};
|
1472
|
-
// eslint-disable-next-line
|
1473
1572
|
DetailsView.prototype.shiftMoveMethod = function (gridItems, selIndex, focIndex, selRowIndeces, e) {
|
1474
1573
|
if (!this.parent.allowMultiSelection) {
|
1475
1574
|
this.moveFunction(gridItems, e, selIndex);
|
@@ -1487,7 +1586,6 @@ var DetailsView = /** @class */ (function () {
|
|
1487
1586
|
}
|
1488
1587
|
}
|
1489
1588
|
};
|
1490
|
-
// eslint-disable-next-line
|
1491
1589
|
DetailsView.prototype.moveFunction = function (selectedItems, e, rowIndex) {
|
1492
1590
|
if (!isNOU(this.getFocusedItem()) && this.parent.allowMultiSelection) {
|
1493
1591
|
if (e.action === 'moveDown') {
|
@@ -1534,7 +1632,6 @@ var DetailsView = /** @class */ (function () {
|
|
1534
1632
|
this.gridObj.selectRow(selIndex);
|
1535
1633
|
}
|
1536
1634
|
};
|
1537
|
-
// eslint-disable-next-line
|
1538
1635
|
DetailsView.prototype.ctrlMoveFunction = function (items, e, rowIndex) {
|
1539
1636
|
var nextItem;
|
1540
1637
|
if (!isNOU(this.getFocusedItem())) {
|
@@ -1553,7 +1650,6 @@ var DetailsView = /** @class */ (function () {
|
|
1553
1650
|
}
|
1554
1651
|
this.addFocus(nextItem);
|
1555
1652
|
};
|
1556
|
-
// eslint-disable-next-line
|
1557
1653
|
DetailsView.prototype.checkRowsKey = function (items, indexValue, focIndex, e) {
|
1558
1654
|
if (this.gridObj.checkAllRows === 'Uncheck' || this.gridObj.checkAllRows === 'Intermediate') {
|
1559
1655
|
if (e.action !== 'csHome' && e.action !== 'csEnd') {
|
@@ -1639,6 +1735,31 @@ var DetailsView = /** @class */ (function () {
|
|
1639
1735
|
addClass([itemElement], [CLS.FOCUS, CLS.FOCUSED]);
|
1640
1736
|
}
|
1641
1737
|
};
|
1738
|
+
DetailsView.prototype.addHeaderFocus = function (e) {
|
1739
|
+
var treeFocus = select('.e-row', this.element);
|
1740
|
+
this.gridObj.element.setAttribute('tabindex', '-1');
|
1741
|
+
var nameFocus;
|
1742
|
+
if (!isNOU(e.target) && e.target.classList.contains('e-defaultcursor')) {
|
1743
|
+
this.addFocus(0);
|
1744
|
+
nameFocus = e.target.nextElementSibling;
|
1745
|
+
}
|
1746
|
+
else if (!isNOU(this.gridObj.element.querySelector('.e-focus')) && (this.gridObj.element.querySelector('.e-focus').tagName === 'TH')) {
|
1747
|
+
nameFocus = this.gridObj.element.querySelector('.e-focus').nextElementSibling;
|
1748
|
+
this.addFocus(0);
|
1749
|
+
}
|
1750
|
+
else {
|
1751
|
+
nameFocus = select('th.e-fe-grid-icon', this.element);
|
1752
|
+
}
|
1753
|
+
if (!isNOU(nameFocus)) {
|
1754
|
+
nameFocus.setAttribute('tabindex', '0');
|
1755
|
+
nameFocus.focus();
|
1756
|
+
addClass([nameFocus], [CLS.FOCUS, CLS.FOCUSED]);
|
1757
|
+
treeFocus.setAttribute('tabindex', '0');
|
1758
|
+
if (treeFocus.tabIndex === 0 && nameFocus.tabIndex === 0) {
|
1759
|
+
removeClass([treeFocus], [CLS.FOCUS, CLS.FOCUSED]);
|
1760
|
+
}
|
1761
|
+
}
|
1762
|
+
};
|
1642
1763
|
DetailsView.prototype.getFocusedItem = function () {
|
1643
1764
|
return select('.' + CLS.FOCUSED, this.element);
|
1644
1765
|
};
|
@@ -1652,7 +1773,6 @@ var DetailsView = /** @class */ (function () {
|
|
1652
1773
|
}
|
1653
1774
|
return check;
|
1654
1775
|
};
|
1655
|
-
// eslint-disable-next-line
|
1656
1776
|
DetailsView.prototype.shiftSelectedItem = function (selIndex, selRowIndexes, gridItems, e) {
|
1657
1777
|
if (selIndex === -1) {
|
1658
1778
|
this.gridObj.selectRow(0);
|
@@ -1701,7 +1821,6 @@ var DetailsView = /** @class */ (function () {
|
|
1701
1821
|
}
|
1702
1822
|
}
|
1703
1823
|
};
|
1704
|
-
// eslint-disable-next-line
|
1705
1824
|
DetailsView.prototype.onMethodCall = function (e) {
|
1706
1825
|
if (this.parent.view !== 'Details') {
|
1707
1826
|
return;
|
@@ -1734,11 +1853,8 @@ var DetailsView = /** @class */ (function () {
|
|
1734
1853
|
break;
|
1735
1854
|
}
|
1736
1855
|
};
|
1737
|
-
// eslint-disable-next-line
|
1738
1856
|
DetailsView.prototype.getRecords = function (nodes) {
|
1739
|
-
// eslint-disable-next-line
|
1740
1857
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
1741
|
-
// eslint-disable-next-line
|
1742
1858
|
var records = [];
|
1743
1859
|
var hasFilter = (this.parent.breadcrumbbarModule.searchObj.element.value !== '' || this.parent.isFiltered) ? true : false;
|
1744
1860
|
var filter = this.parent.hasId ? 'id' : 'name';
|
@@ -1765,12 +1881,10 @@ var DetailsView = /** @class */ (function () {
|
|
1765
1881
|
this.performDelete();
|
1766
1882
|
return;
|
1767
1883
|
}
|
1768
|
-
// eslint-disable-next-line
|
1769
1884
|
var records = this.getRecords(ids);
|
1770
1885
|
if (records.length === 0) {
|
1771
1886
|
return;
|
1772
1887
|
}
|
1773
|
-
// eslint-disable-next-line
|
1774
1888
|
var data = [];
|
1775
1889
|
var newIds = [];
|
1776
1890
|
for (var i = 0; i < records.length; i++) {
|
@@ -1784,12 +1898,10 @@ var DetailsView = /** @class */ (function () {
|
|
1784
1898
|
this.doDownload();
|
1785
1899
|
return;
|
1786
1900
|
}
|
1787
|
-
// eslint-disable-next-line
|
1788
1901
|
var dRecords = this.getRecords(ids);
|
1789
1902
|
if (dRecords.length === 0) {
|
1790
1903
|
return;
|
1791
1904
|
}
|
1792
|
-
// eslint-disable-next-line
|
1793
1905
|
var data = [];
|
1794
1906
|
var newIds = [];
|
1795
1907
|
for (var i = 0; i < dRecords.length; i++) {
|
@@ -1802,7 +1914,6 @@ var DetailsView = /** @class */ (function () {
|
|
1802
1914
|
if (isNOU(id)) {
|
1803
1915
|
return;
|
1804
1916
|
}
|
1805
|
-
// eslint-disable-next-line
|
1806
1917
|
var records = this.getRecords([id]);
|
1807
1918
|
if (records.length > 0) {
|
1808
1919
|
this.openContent(records[0]);
|
@@ -1814,7 +1925,6 @@ var DetailsView = /** @class */ (function () {
|
|
1814
1925
|
this.performRename();
|
1815
1926
|
return;
|
1816
1927
|
}
|
1817
|
-
// eslint-disable-next-line
|
1818
1928
|
var records = this.getRecords([id]);
|
1819
1929
|
if (records.length > 0) {
|
1820
1930
|
updateRenamingData(this.parent, records[0]);
|