@syncfusion/ej2-filemanager 29.2.4 → 30.1.37

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.
Files changed (163) hide show
  1. package/.eslintrc.json +2 -0
  2. package/dist/ej2-filemanager.min.js +2 -2
  3. package/dist/ej2-filemanager.umd.min.js +2 -2
  4. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-filemanager.es2015.js +181 -20
  6. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  7. package/dist/es6/ej2-filemanager.es5.js +182 -20
  8. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  9. package/dist/global/ej2-filemanager.min.js +2 -2
  10. package/dist/global/ej2-filemanager.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/dist/ts/file-manager/actions/breadcrumb-bar.d.ts +60 -0
  13. package/dist/ts/file-manager/actions/breadcrumb-bar.ts +423 -0
  14. package/dist/ts/file-manager/actions/index.d.ts +6 -0
  15. package/dist/ts/file-manager/actions/index.ts +6 -0
  16. package/dist/ts/file-manager/actions/toolbar.d.ts +54 -0
  17. package/dist/ts/file-manager/actions/toolbar.ts +609 -0
  18. package/dist/ts/file-manager/actions/virtualization.d.ts +93 -0
  19. package/dist/ts/file-manager/actions/virtualization.ts +324 -0
  20. package/dist/ts/file-manager/base/classes.d.ts +224 -0
  21. package/dist/ts/file-manager/base/classes.ts +225 -0
  22. package/dist/ts/file-manager/base/constant.d.ts +136 -0
  23. package/dist/ts/file-manager/base/constant.ts +137 -0
  24. package/dist/ts/file-manager/base/file-manager-model.d.ts +520 -0
  25. package/dist/ts/file-manager/base/file-manager.d.ts +867 -0
  26. package/dist/ts/file-manager/base/file-manager.ts +2061 -0
  27. package/dist/ts/file-manager/base/index.d.ts +8 -0
  28. package/dist/ts/file-manager/base/index.ts +8 -0
  29. package/dist/ts/file-manager/base/interface.d.ts +952 -0
  30. package/dist/ts/file-manager/base/interface.ts +931 -0
  31. package/dist/ts/file-manager/common/index.d.ts +5 -0
  32. package/dist/ts/file-manager/common/index.ts +5 -0
  33. package/dist/ts/file-manager/common/operations.d.ts +122 -0
  34. package/dist/ts/file-manager/common/operations.ts +1369 -0
  35. package/dist/ts/file-manager/common/utility.d.ts +644 -0
  36. package/dist/ts/file-manager/common/utility.ts +1728 -0
  37. package/dist/ts/file-manager/index.d.ts +9 -0
  38. package/dist/ts/file-manager/index.ts +9 -0
  39. package/dist/ts/file-manager/layout/details-view.d.ts +152 -0
  40. package/dist/ts/file-manager/layout/details-view.ts +1990 -0
  41. package/dist/ts/file-manager/layout/index.d.ts +6 -0
  42. package/dist/ts/file-manager/layout/index.ts +6 -0
  43. package/dist/ts/file-manager/layout/large-icons-view.d.ts +157 -0
  44. package/dist/ts/file-manager/layout/large-icons-view.ts +1684 -0
  45. package/dist/ts/file-manager/layout/navigation-pane.d.ts +104 -0
  46. package/dist/ts/file-manager/layout/navigation-pane.ts +919 -0
  47. package/dist/ts/file-manager/models/ajax-settings-model.d.ts +36 -0
  48. package/dist/ts/file-manager/models/ajax-settings.d.ts +30 -0
  49. package/dist/ts/file-manager/models/ajax-settings.ts +39 -0
  50. package/dist/ts/file-manager/models/column-model.d.ts +155 -0
  51. package/dist/ts/file-manager/models/column.d.ts +179 -0
  52. package/dist/ts/file-manager/models/column.ts +216 -0
  53. package/dist/ts/file-manager/models/contextMenu-settings-model.d.ts +36 -0
  54. package/dist/ts/file-manager/models/contextMenu-settings.d.ts +33 -0
  55. package/dist/ts/file-manager/models/contextMenu-settings.ts +44 -0
  56. package/dist/ts/file-manager/models/default-locale.d.ts +4 -0
  57. package/dist/ts/file-manager/models/default-locale.ts +101 -0
  58. package/dist/ts/file-manager/models/details-view-settings-model.d.ts +30 -0
  59. package/dist/ts/file-manager/models/details-view-settings.d.ts +31 -0
  60. package/dist/ts/file-manager/models/details-view-settings.ts +54 -0
  61. package/dist/ts/file-manager/models/index.d.ts +19 -0
  62. package/dist/ts/file-manager/models/index.ts +19 -0
  63. package/dist/ts/file-manager/models/navigation-pane-settings-model.d.ts +40 -0
  64. package/dist/ts/file-manager/models/navigation-pane-settings.d.ts +34 -0
  65. package/dist/ts/file-manager/models/navigation-pane-settings.ts +42 -0
  66. package/dist/ts/file-manager/models/search-settings-model.d.ts +42 -0
  67. package/dist/ts/file-manager/models/search-settings.d.ts +44 -0
  68. package/dist/ts/file-manager/models/search-settings.ts +53 -0
  69. package/dist/ts/file-manager/models/toolbar-settings-model.d.ts +197 -0
  70. package/dist/ts/file-manager/models/toolbar-settings.d.ts +174 -0
  71. package/dist/ts/file-manager/models/toolbar-settings.ts +198 -0
  72. package/dist/ts/file-manager/models/upload-settings-model.d.ts +70 -0
  73. package/dist/ts/file-manager/models/upload-settings.d.ts +61 -0
  74. package/dist/ts/file-manager/models/upload-settings.ts +75 -0
  75. package/dist/ts/file-manager/pop-up/context-menu.d.ts +64 -0
  76. package/dist/ts/file-manager/pop-up/context-menu.ts +693 -0
  77. package/dist/ts/file-manager/pop-up/dialog.d.ts +31 -0
  78. package/dist/ts/file-manager/pop-up/dialog.ts +1009 -0
  79. package/dist/ts/file-manager/pop-up/index.d.ts +5 -0
  80. package/dist/ts/file-manager/pop-up/index.ts +5 -0
  81. package/dist/ts/index.d.ts +4 -0
  82. package/dist/ts/index.ts +4 -0
  83. package/package.json +16 -17
  84. package/src/file-manager/base/interface.d.ts +10 -0
  85. package/src/file-manager/common/operations.d.ts +18 -1
  86. package/src/file-manager/common/operations.js +59 -0
  87. package/src/file-manager/common/utility.d.ts +3 -3
  88. package/src/file-manager/common/utility.js +20 -6
  89. package/src/file-manager/layout/details-view.js +4 -3
  90. package/src/file-manager/layout/large-icons-view.d.ts +3 -0
  91. package/src/file-manager/layout/large-icons-view.js +67 -9
  92. package/src/file-manager/layout/navigation-pane.js +2 -0
  93. package/src/file-manager/pop-up/dialog.d.ts +3 -3
  94. package/src/file-manager/pop-up/dialog.js +34 -6
  95. package/styles/bds-lite.css +51 -1
  96. package/styles/bds.css +51 -1
  97. package/styles/bootstrap-dark-lite.css +51 -0
  98. package/styles/bootstrap-dark.css +51 -0
  99. package/styles/bootstrap-lite.css +51 -0
  100. package/styles/bootstrap.css +51 -0
  101. package/styles/bootstrap4-lite.css +51 -0
  102. package/styles/bootstrap4.css +51 -0
  103. package/styles/bootstrap5-dark-lite.css +51 -1
  104. package/styles/bootstrap5-dark.css +51 -1
  105. package/styles/bootstrap5-lite.css +51 -1
  106. package/styles/bootstrap5.3-lite.css +51 -0
  107. package/styles/bootstrap5.3.css +51 -0
  108. package/styles/bootstrap5.css +51 -1
  109. package/styles/fabric-dark-lite.css +51 -0
  110. package/styles/fabric-dark.css +51 -0
  111. package/styles/fabric-lite.css +51 -0
  112. package/styles/fabric.css +51 -0
  113. package/styles/file-manager/_bds-definition.scss +1 -0
  114. package/styles/file-manager/_bootstrap5-definition.scss +1 -0
  115. package/styles/file-manager/_layout.scss +46 -4
  116. package/styles/file-manager/_material3-definition.scss +2 -2
  117. package/styles/file-manager/_tailwind-definition.scss +1 -0
  118. package/styles/file-manager/_tailwind3-definition.scss +1 -0
  119. package/styles/file-manager/bds.css +51 -1
  120. package/styles/file-manager/bootstrap-dark.css +51 -0
  121. package/styles/file-manager/bootstrap.css +51 -0
  122. package/styles/file-manager/bootstrap4.css +51 -0
  123. package/styles/file-manager/bootstrap5-dark.css +51 -1
  124. package/styles/file-manager/bootstrap5.3.css +51 -0
  125. package/styles/file-manager/bootstrap5.css +51 -1
  126. package/styles/file-manager/fabric-dark.css +51 -0
  127. package/styles/file-manager/fabric.css +51 -0
  128. package/styles/file-manager/fluent-dark.css +51 -0
  129. package/styles/file-manager/fluent.css +51 -0
  130. package/styles/file-manager/fluent2.css +51 -0
  131. package/styles/file-manager/highcontrast-light.css +51 -0
  132. package/styles/file-manager/highcontrast.css +51 -0
  133. package/styles/file-manager/material-dark.css +51 -0
  134. package/styles/file-manager/material.css +51 -0
  135. package/styles/file-manager/material3-dark.css +53 -2
  136. package/styles/file-manager/material3.css +53 -2
  137. package/styles/file-manager/tailwind-dark.css +51 -1
  138. package/styles/file-manager/tailwind.css +51 -1
  139. package/styles/file-manager/tailwind3.css +51 -0
  140. package/styles/fluent-dark-lite.css +51 -0
  141. package/styles/fluent-dark.css +51 -0
  142. package/styles/fluent-lite.css +51 -0
  143. package/styles/fluent.css +51 -0
  144. package/styles/fluent2-lite.css +51 -0
  145. package/styles/fluent2.css +51 -0
  146. package/styles/highcontrast-light-lite.css +51 -0
  147. package/styles/highcontrast-light.css +51 -0
  148. package/styles/highcontrast-lite.css +51 -0
  149. package/styles/highcontrast.css +51 -0
  150. package/styles/material-dark-lite.css +51 -0
  151. package/styles/material-dark.css +51 -0
  152. package/styles/material-lite.css +51 -0
  153. package/styles/material.css +51 -0
  154. package/styles/material3-dark-lite.css +51 -0
  155. package/styles/material3-dark.css +53 -2
  156. package/styles/material3-lite.css +51 -0
  157. package/styles/material3.css +53 -2
  158. package/styles/tailwind-dark-lite.css +51 -1
  159. package/styles/tailwind-dark.css +51 -1
  160. package/styles/tailwind-lite.css +51 -1
  161. package/styles/tailwind.css +51 -1
  162. package/styles/tailwind3-lite.css +51 -0
  163. package/styles/tailwind3.css +51 -0
@@ -0,0 +1,93 @@
1
+ import { FileManager } from '../base';
2
+ export declare class Virtualization {
3
+ constructor(instance: FileManager);
4
+ private filemanagerInstance;
5
+ private largeIconInstance;
6
+ private itemCount;
7
+ private rowItemCount;
8
+ private items;
9
+ private itemList;
10
+ private scrollPosition;
11
+ private totalHeight;
12
+ private listItemHeight;
13
+ private topElementHeight;
14
+ private bottomElementHeight;
15
+ private renderedCount;
16
+ private lastRowCount;
17
+ private topElement;
18
+ private bottomElement;
19
+ private listDiff;
20
+ /**
21
+ * Sets up UI virtualization for the large icon view.
22
+ *
23
+ * @returns {void}
24
+ */
25
+ setUIVirtualization(): void;
26
+ /**
27
+ * Sets the height of the top and bottom elements that are used for virtualization.
28
+ * These elements are used to give the appearance of an infinitely scrolling list.
29
+ *
30
+ * @returns {void}
31
+ */
32
+ setUlElementHeight(): void;
33
+ /**
34
+ * Calculates the number of items to display in the list based on the available width and height.
35
+ *
36
+ * @param {number} dataSourceLength The length of the data source.
37
+ * @returns {number} The number of items to display.
38
+ */
39
+ private getItemCount;
40
+ /**
41
+ * Wires or un wires the scroll event for the list element.
42
+ *
43
+ * @param {boolean} destroy - Set `true` to unwire the scroll event.
44
+ * @returns {void}
45
+ */
46
+ wireScrollEvent(destroy: boolean): void;
47
+ /**
48
+ * Handles the scroll event for the list element.
49
+ * This method updates the top and bottom elements and the displayed items based on the scroll position.
50
+ *
51
+ * @returns {void}
52
+ * @private
53
+ */
54
+ private onVirtualUiScroll;
55
+ /**
56
+ * Calculates the current scroll position of the list element.
57
+ *
58
+ * @param {number} startingHeight The starting height from which to calculate the scroll position.
59
+ * @returns {number} The current scroll position.
60
+ * @private
61
+ */
62
+ private getscrollerHeight;
63
+ /**
64
+ * This method updates the displayed items and the selection based on the scroll direction.
65
+ *
66
+ * @param {number} listDiff The number of rows to update.
67
+ * @param {boolean} isScrollingDown If set to true, the scroll direction is downward.
68
+ * @returns {void}
69
+ * @private
70
+ */
71
+ private onNormalScroll;
72
+ /**
73
+ * Updates the items in the large icons view.
74
+ *
75
+ * @param {boolean} isScrollingDown - If set to true, the scroll direction is downward.
76
+ * @returns {void}
77
+ * @private
78
+ */
79
+ private updateUI;
80
+ /**
81
+ * For internal use only - Get the module name.
82
+ *
83
+ * @returns {string} - returns the module name.
84
+ * @private
85
+ */
86
+ private getModuleName;
87
+ /**
88
+ * Destroys the component.
89
+ *
90
+ * @returns {void}
91
+ */
92
+ destroy(): void;
93
+ }
@@ -0,0 +1,324 @@
1
+ import { EventHandler, isNullOrUndefined, detach, formatUnit } from '@syncfusion/ej2-base';
2
+ import { FileManager } from '../base';
3
+ import { ListBase } from '@syncfusion/ej2-lists';
4
+ import { createElement, selectAll } from '@syncfusion/ej2-base';
5
+ import * as CLS from '../base/classes';
6
+ import { LargeIconsView } from '../layout';
7
+
8
+ export class Virtualization {
9
+ constructor(instance: FileManager) {
10
+ this.filemanagerInstance = instance;
11
+ this.largeIconInstance = instance.largeiconsviewModule;
12
+ }
13
+
14
+ // The file manager component instance
15
+ private filemanagerInstance: FileManager;
16
+ // The LargeIconsView module
17
+ private largeIconInstance: LargeIconsView;
18
+ // The number of items that can be rendered in the viewport
19
+ private itemCount: number;
20
+ // The number of items that can be rendered per row
21
+ private rowItemCount: number;
22
+ // The rendered items
23
+ private items: Object[];
24
+ // The rendered items element
25
+ private itemList: HTMLElement[];
26
+ // The current scroll position of the view
27
+ private scrollPosition: number;
28
+ // The total height for rendering all items
29
+ private totalHeight: number;
30
+ // The height of each list item
31
+ private listItemHeight: number;
32
+ // The height of the top virtual element
33
+ private topElementHeight: number;
34
+ // The height of the bottom virtual element
35
+ private bottomElementHeight: number;
36
+ // The number of rendered items
37
+ private renderedCount: number;
38
+ // The last row's items
39
+ private lastRowCount: number;
40
+ // The top div element
41
+ private topElement: HTMLElement;
42
+ // The bottom div element
43
+ private bottomElement: HTMLElement;
44
+ // The number of rows scrolled
45
+ private listDiff: number;
46
+
47
+
48
+ /**
49
+ * Sets up UI virtualization for the large icon view.
50
+ *
51
+ * @returns {void}
52
+ */
53
+ public setUIVirtualization(): void {
54
+ // Get the current view data source
55
+ const currentViewItems: { [key: string]: object; }[] = this.largeIconInstance.items as { [key: string]: object; }[];
56
+ // Get the first item in the data source
57
+ const firstItem: { [key: string]: object }[] = currentViewItems.slice(0, 1);
58
+ // Create a list element from the first item in the data source
59
+ const listElements: HTMLElement = ListBase.createListFromJson(createElement, firstItem, this.largeIconInstance.listObj);
60
+ // Get the list items from the list element
61
+ this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, listElements));
62
+ // Append the list element to the large icon element
63
+ this.largeIconInstance.element.appendChild(listElements);
64
+ if (this.itemList.length !== 0 && this.largeIconInstance.element.querySelector('.' + CLS.EMPTY)) {
65
+ this.largeIconInstance.element.removeChild(this.largeIconInstance.element.querySelector('.' + CLS.EMPTY));
66
+ }
67
+ // Get the total number of items
68
+ this.itemCount = this.getItemCount(Object.keys(this.largeIconInstance.allItems).length);
69
+ // Remove the first child element from the large icon element
70
+ this.largeIconInstance.element.firstChild.remove();
71
+ // Set the items for the large icon view to the current view data source, limited to the number of items to display
72
+ this.largeIconInstance.items = currentViewItems.slice(0, this.itemCount);
73
+ }
74
+
75
+ /**
76
+ * Sets the height of the top and bottom elements that are used for virtualization.
77
+ * These elements are used to give the appearance of an infinitely scrolling list.
78
+ *
79
+ * @returns {void}
80
+ */
81
+ public setUlElementHeight(): void {
82
+ // Calculate the number of items in the last row
83
+ this.lastRowCount = (this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount ?
84
+ (this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount : this.rowItemCount;
85
+ // Create top and bottom elements
86
+ this.topElement = this.filemanagerInstance.createElement('div');
87
+ this.topElement.classList.add('e-virtual-top');
88
+ this.largeIconInstance.element.firstElementChild.insertBefore(
89
+ this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
90
+ this.bottomElement = this.filemanagerInstance.createElement('div');
91
+ this.bottomElement.classList.add('e-virtual-bottom');
92
+ this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
93
+ // Get the margin value for list items
94
+ const marginValue: number = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top'), 10) +
95
+ parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-bottom'), 10);
96
+ // Calculate the height of a single list item
97
+ this.listItemHeight = this.largeIconInstance.itemList[0].getBoundingClientRect().height + marginValue;
98
+ // Calculate the total height of the list
99
+ this.totalHeight = (Object.keys(this.largeIconInstance.allItems).length / this.rowItemCount) * this.listItemHeight;
100
+ // Set the initial height of the top and bottom elements
101
+ this.topElement.style.height = 0 + 'px';
102
+ this.bottomElement.style.height = this.totalHeight + 'px';
103
+ // Initialize the top and bottom element heights
104
+ this.topElementHeight = 0;
105
+ this.bottomElementHeight = this.totalHeight;
106
+ // Initialize the list difference variable
107
+ this.listDiff = 0;
108
+ // Set the initial rendered count
109
+ this.renderedCount = this.itemCount;
110
+ }
111
+
112
+ /**
113
+ * Calculates the number of items to display in the list based on the available width and height.
114
+ *
115
+ * @param {number} dataSourceLength The length of the data source.
116
+ * @returns {number} The number of items to display.
117
+ */
118
+ private getItemCount(dataSourceLength: number): number {
119
+ // Get the margin values for list items
120
+ const widthMargin: number = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-right'), 10) +
121
+ parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-left'), 10);
122
+ // Calculate the number of items that can fit in a single row
123
+ this.rowItemCount =
124
+ Math.floor(parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth)) /
125
+ (this.itemList[0].offsetWidth + widthMargin));
126
+ // Calculate the number of items that can fit in the available height
127
+ let itemCount: number =
128
+ this.rowItemCount *
129
+ (Math.round(parseFloat(formatUnit(this.largeIconInstance.element.clientHeight)) / this.itemList[0].offsetHeight));
130
+ // If the calculated item count is greater than the data source length, set the item count to the data source length
131
+ if (itemCount > dataSourceLength || itemCount === 0) {
132
+ itemCount = dataSourceLength;
133
+ }
134
+ return itemCount;
135
+ }
136
+
137
+ /**
138
+ * Wires or un wires the scroll event for the list element.
139
+ *
140
+ * @param {boolean} destroy - Set `true` to unwire the scroll event.
141
+ * @returns {void}
142
+ */
143
+ public wireScrollEvent(destroy: boolean): void {
144
+ if (!destroy) {
145
+ // Wire the scroll event
146
+ EventHandler.add(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll, this);
147
+ } else {
148
+ // Unwire the scroll event
149
+ EventHandler.remove(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll);
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Handles the scroll event for the list element.
155
+ * This method updates the top and bottom elements and the displayed items based on the scroll position.
156
+ *
157
+ * @returns {void}
158
+ * @private
159
+ */
160
+ private onVirtualUiScroll(): void {
161
+ // Set the starting height to 0
162
+ const startingHeight: number = 0;
163
+ // Get the current scroll position
164
+ this.scrollPosition = isNullOrUndefined(this.scrollPosition) ? 0 : this.scrollPosition;
165
+ const scroll: number = this.getscrollerHeight(startingHeight);
166
+ // Calculate the height of the top element
167
+ this.topElementHeight = this.listItemHeight * Math.floor(scroll / this.listItemHeight);
168
+ // Calculate the height of the bottom element
169
+ this.bottomElementHeight = this.totalHeight - this.topElementHeight;
170
+ // If the scroll position is less than or equal to the total height, set the top and bottom element heights.
171
+ // Otherwise, set the top element height to the total height and the bottom element height to 0.
172
+ [this.topElementHeight, this.bottomElementHeight] = scroll <= this.totalHeight ?
173
+ [this.topElementHeight, this.bottomElementHeight] : [this.totalHeight, 0];
174
+ // If the top element height has changed, update the top and bottom element heights and re-render the items.
175
+ if (this.topElementHeight !== parseFloat(this.topElement.style.height)) {
176
+ this.topElement.style.height = this.topElementHeight + 'px';
177
+ this.bottomElement.style.height = this.bottomElementHeight + 'px';
178
+ // Check whether the scroll direction is upward or downward
179
+ if (scroll > this.scrollPosition) {
180
+ // Scrolling is upward
181
+ const listDiff: number = Math.round(((this.topElementHeight / this.listItemHeight) - this.listDiff));
182
+ this.onNormalScroll(listDiff, true);
183
+ } else {
184
+ // Scrolling is downward
185
+ const listDiff: number = Math.round((this.listDiff - (this.topElementHeight / this.listItemHeight)));
186
+ this.onNormalScroll(listDiff, false);
187
+ }
188
+ }
189
+ // Update the list difference and scroll position variables
190
+ this.listDiff = Math.round(this.topElementHeight / this.listItemHeight);
191
+ this.scrollPosition = scroll;
192
+ // Update the list of items and the items property of the largeIconInstance
193
+ this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.largeIconInstance.element));
194
+ this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ?
195
+ this.largeIconInstance.itemList.length : this.itemCount;
196
+ this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
197
+ this.itemCount, this.renderedCount);
198
+ }
199
+
200
+ /**
201
+ * Calculates the current scroll position of the list element.
202
+ *
203
+ * @param {number} startingHeight The starting height from which to calculate the scroll position.
204
+ * @returns {number} The current scroll position.
205
+ * @private
206
+ */
207
+ private getscrollerHeight(startingHeight: number): number {
208
+ // If the scroll position is less than or equal to the starting height, return 0.
209
+ // Otherwise, return the scroll position minus the starting height.
210
+ return ((this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight) <= 0) ? 0 :
211
+ (this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight);
212
+ }
213
+
214
+ /**
215
+ * This method updates the displayed items and the selection based on the scroll direction.
216
+ *
217
+ * @param {number} listDiff The number of rows to update.
218
+ * @param {boolean} isScrollingDown If set to true, the scroll direction is downward.
219
+ * @returns {void}
220
+ * @private
221
+ */
222
+ private onNormalScroll(listDiff: number, isScrollingDown: boolean): void {
223
+ // Update the displayed items
224
+ for (let i: number = 0; i < listDiff; i++) {
225
+ this.updateUI(isScrollingDown);
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Updates the items in the large icons view.
231
+ *
232
+ * @param {boolean} isScrollingDown - If set to true, the scroll direction is downward.
233
+ * @returns {void}
234
+ * @private
235
+ */
236
+ private updateUI(isScrollingDown: boolean): void {
237
+ if (isScrollingDown) {
238
+ // Get the next batch of items to be displayed
239
+ this.items = this.largeIconInstance.allItems.slice(this.renderedCount, this.renderedCount + this.rowItemCount);
240
+ // If there are items to be displayed, create list elements for them and append them to the list
241
+ if (this.items.length > 0) {
242
+ const listElements: HTMLElement = ListBase.createListFromJson(
243
+ createElement, <{ [key: string]: Object; }[]>this.items, this.largeIconInstance.listObj
244
+ );
245
+ this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, listElements));
246
+ this.itemList.forEach((liEle: HTMLElement) => {
247
+ this.largeIconInstance.element.firstElementChild.insertBefore(liEle, this.bottomElement);
248
+ });
249
+ // Update the rendered count variable
250
+ this.renderedCount = (this.largeIconInstance.allItems.length >= this.renderedCount + this.rowItemCount) ?
251
+ this.renderedCount + this.rowItemCount : this.renderedCount + this.lastRowCount;
252
+ // Remove the first batch of items from the list
253
+ for (let i: number = 0; i < this.rowItemCount; i++) {
254
+ detach(this.topElement.nextElementSibling);
255
+ }
256
+ }
257
+ } else {
258
+ // Scrolling up
259
+ let lastItemIndex: number;
260
+ let isAllRendered: boolean;
261
+ if (this.renderedCount === this.largeIconInstance.allItems.length) {
262
+ // Set lastItemIndex to the last item in the last row
263
+ lastItemIndex = this.renderedCount - (this.itemCount - this.rowItemCount + this.lastRowCount);
264
+ // Set renderedCount to the total number of items that have been rendered, except for the items in the last row
265
+ this.renderedCount = ((this.renderedCount - this.lastRowCount) < this.itemCount) ?
266
+ this.itemCount : (this.renderedCount - this.lastRowCount);
267
+ // Set isAllRendered to true to indicate that all items have been rendered
268
+ isAllRendered = true;
269
+ } else {
270
+ // Set lastItemIndex to the last item in the current row
271
+ lastItemIndex = this.renderedCount - this.itemCount;
272
+ // Set renderedCount to the total number of items that have been rendered, except for the items in the current row
273
+ this.renderedCount = ((this.renderedCount - this.rowItemCount) < this.itemCount) ?
274
+ this.itemCount : (this.renderedCount - this.rowItemCount);
275
+ }
276
+ // Set startItemIndex to the first item in the current or previous row
277
+ const startItemIndex: number = (lastItemIndex - this.rowItemCount > 0) ? lastItemIndex - this.rowItemCount : 0;
278
+ // Set the items array to the items in the current or previous row
279
+ this.items = this.largeIconInstance.allItems.slice(startItemIndex, lastItemIndex);
280
+ if (this.items.length > 0) {
281
+ // Create a list of elements from the items array
282
+ const listElements: HTMLElement = ListBase.createListFromJson(
283
+ createElement, <{ [key: string]: Object; }[]>this.items, this.largeIconInstance.listObj
284
+ );
285
+ // Set the itemList array to the list items in the list elements
286
+ this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, listElements));
287
+ // Add the items to the beginning of the list
288
+ for (let len: number = this.itemList.length; len > 0; len--) {
289
+ this.largeIconInstance.element.firstElementChild.insertBefore(
290
+ this.itemList[len - 1], this.topElement.nextElementSibling
291
+ );
292
+ }
293
+ // Remove the last row of items from the list
294
+ for (let i: number = 0; i < ((isAllRendered) ? this.lastRowCount : this.rowItemCount); i++) {
295
+ detach(this.bottomElement.previousElementSibling);
296
+ }
297
+ }
298
+ }
299
+ }
300
+
301
+ /**
302
+ * For internal use only - Get the module name.
303
+ *
304
+ * @returns {string} - returns the module name.
305
+ * @private
306
+ */
307
+ private getModuleName(): string {
308
+ return 'virtualization';
309
+ }
310
+
311
+ /**
312
+ * Destroys the component.
313
+ *
314
+ * @returns {void}
315
+ */
316
+ public destroy(): void {
317
+ // If the file manager has already been destroyed, return immediately
318
+ if (this.filemanagerInstance.isDestroyed) { return; }
319
+ // If the large icon element has a child element, unwire the scroll event
320
+ if (!isNullOrUndefined(this.largeIconInstance.element.firstElementChild)) {
321
+ this.wireScrollEvent(true);
322
+ }
323
+ }
324
+ }
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Specifies the File Manager internal ID's
3
+ */
4
+ /** @hidden */
5
+ export declare const TOOLBAR_ID: string;
6
+ /** @hidden */
7
+ export declare const LAYOUT_ID: string;
8
+ /** @hidden */
9
+ export declare const NAVIGATION_ID: string;
10
+ /** @hidden */
11
+ export declare const TREE_ID: string;
12
+ /** @hidden */
13
+ export declare const GRID_ID: string;
14
+ /** @hidden */
15
+ export declare const LARGEICON_ID: string;
16
+ /** @hidden */
17
+ export declare const DIALOG_ID: string;
18
+ /** @hidden */
19
+ export declare const ALT_DIALOG_ID: string;
20
+ /** @hidden */
21
+ export declare const IMG_DIALOG_ID: string;
22
+ /** @hidden */
23
+ export declare const EXTN_DIALOG_ID: string;
24
+ /** @hidden */
25
+ export declare const UPLOAD_DIALOG_ID: string;
26
+ /** @hidden */
27
+ export declare const RETRY_DIALOG_ID: string;
28
+ /** @hidden */
29
+ export declare const CONTEXT_MENU_ID: string;
30
+ /** @hidden */
31
+ export declare const SORTBY_ID: string;
32
+ /** @hidden */
33
+ export declare const VIEW_ID: string;
34
+ /** @hidden */
35
+ export declare const SPLITTER_ID: string;
36
+ /** @hidden */
37
+ export declare const CONTENT_ID: string;
38
+ /** @hidden */
39
+ export declare const BREADCRUMBBAR_ID: string;
40
+ /** @hidden */
41
+ export declare const UPLOAD_ID: string;
42
+ /** @hidden */
43
+ export declare const RETRY_ID: string;
44
+ /** @hidden */
45
+ export declare const SEARCH_ID: string;
46
+ /**
47
+ * Specifies the File Manager internal class names
48
+ */
49
+ /** @hidden */
50
+ export declare const ROOT: string;
51
+ /** @hidden */
52
+ export declare const CONTROL: string;
53
+ /** @hidden */
54
+ export declare const CHECK_SELECT: string;
55
+ /** @hidden */
56
+ export declare const ROOT_POPUP: string;
57
+ /** @hidden */
58
+ export declare const MOBILE: string;
59
+ /** @hidden */
60
+ export declare const MOB_POPUP: string;
61
+ /** @hidden */
62
+ export declare const MULTI_SELECT: string;
63
+ /** @hidden */
64
+ export declare const FILTER: string;
65
+ /** @hidden */
66
+ export declare const LAYOUT: string;
67
+ /** @hidden */
68
+ export declare const NAVIGATION: string;
69
+ /** @hidden */
70
+ export declare const LAYOUT_CONTENT: string;
71
+ /** @hidden */
72
+ export declare const LARGE_ICONS: string;
73
+ /** @hidden */
74
+ export declare const TB_ITEM: string;
75
+ /** @hidden */
76
+ export declare const LIST_ITEM: string;
77
+ /** @hidden */
78
+ export declare const LIST_TEXT: string;
79
+ /** @hidden */
80
+ export declare const LIST_PARENT: string;
81
+ /** @hidden */
82
+ export declare const TB_OPTION_TICK: string;
83
+ /** @hidden */
84
+ export declare const TB_OPTION_DOT: string;
85
+ /** @hidden */
86
+ export declare const BLUR: string;
87
+ /** @hidden */
88
+ export declare const ACTIVE: string;
89
+ /** @hidden */
90
+ export declare const HOVER: string;
91
+ /** @hidden */
92
+ export declare const FOCUS: string;
93
+ /** @hidden */
94
+ export declare const FOCUSED: string;
95
+ /** @hidden */
96
+ export declare const CHECK: string;
97
+ /** @hidden */
98
+ export declare const FRAME: string;
99
+ /** @hidden */
100
+ export declare const CB_WRAP: string;
101
+ /** @hidden */
102
+ export declare const ROW: string;
103
+ /** @hidden */
104
+ export declare const ROWCELL: string;
105
+ /** @hidden */
106
+ export declare const EMPTY: string;
107
+ /** @hidden */
108
+ export declare const EMPTY_CONTENT: string;
109
+ /** @hidden */
110
+ export declare const EMPTY_INNER_CONTENT: string;
111
+ /** @hidden */
112
+ export declare const CLONE: string;
113
+ /** @hidden */
114
+ export declare const DROP_FOLDER: string;
115
+ /** @hidden */
116
+ export declare const DROP_FILE: string;
117
+ /** @hidden */
118
+ export declare const FOLDER: string;
119
+ /** @hidden */
120
+ export declare const ICON_IMAGE: string;
121
+ /** @hidden */
122
+ export declare const ICON_MUSIC: string;
123
+ /** @hidden */
124
+ export declare const ICON_VIDEO: string;
125
+ /** @hidden */
126
+ export declare const LARGE_ICON: string;
127
+ /** @hidden */
128
+ export declare const LARGE_EMPTY_FOLDER: string;
129
+ /** @hidden */
130
+ export declare const LARGE_EMPTY_FOLDER_TWO: string;
131
+ /** @hidden */
132
+ export declare const LARGE_ICON_FOLDER: string;
133
+ /** @hidden */
134
+ export declare const SELECTED_ITEMS: string;
135
+ /** @hidden */
136
+ export declare const TEXT_CONTENT: string;
137
+ /** @hidden */
138
+ export declare const GRID_HEADER: string;
139
+ /** @hidden */
140
+ export declare const TEMPLATE_CELL: string;
141
+ /** @hidden */
142
+ export declare const TREE_VIEW: string;
143
+ /** @hidden */
144
+ export declare const MENU_ITEM: string;
145
+ /** @hidden */
146
+ export declare const MENU_ICON: string;
147
+ /** @hidden */
148
+ export declare const SUBMENU_ICON: string;
149
+ /** @hidden */
150
+ export declare const GRID_VIEW: string;
151
+ /** @hidden */
152
+ export declare const GRID_CONTENT: string;
153
+ /** @hidden */
154
+ export declare const ICON_VIEW: string;
155
+ /** @hidden */
156
+ export declare const ICON_OPEN: string;
157
+ /** @hidden */
158
+ export declare const ICON_UPLOAD: string;
159
+ /** @hidden */
160
+ export declare const ICON_CUT: string;
161
+ /** @hidden */
162
+ export declare const ICON_COPY: string;
163
+ /** @hidden */
164
+ export declare const ICON_PASTE: string;
165
+ /** @hidden */
166
+ export declare const ICON_DELETE: string;
167
+ /** @hidden */
168
+ export declare const ICON_RENAME: string;
169
+ /** @hidden */
170
+ export declare const ICON_NEWFOLDER: string;
171
+ /** @hidden */
172
+ export declare const ICON_DETAILS: string;
173
+ /** @hidden */
174
+ export declare const ICON_SHORTBY: string;
175
+ /** @hidden */
176
+ export declare const ICON_REFRESH: string;
177
+ /** @hidden */
178
+ export declare const ICON_SELECTALL: string;
179
+ /** @hidden */
180
+ export declare const ICON_DOWNLOAD: string;
181
+ /** @hidden */
182
+ export declare const ICON_OPTIONS: string;
183
+ /** @hidden */
184
+ export declare const ICON_GRID: string;
185
+ /** @hidden */
186
+ export declare const ICON_LARGE: string;
187
+ /** @hidden */
188
+ export declare const ICON_BREADCRUMB: string;
189
+ /** @hidden */
190
+ export declare const ICON_CLEAR: string;
191
+ /** @hidden */
192
+ export declare const ICON_DROP_IN: string;
193
+ /** @hidden */
194
+ export declare const ICON_DROP_OUT: string;
195
+ /** @hidden */
196
+ export declare const ICON_NO_DROP: string;
197
+ /** @hidden */
198
+ export declare const ICONS: string;
199
+ /** @hidden */
200
+ export declare const DETAILS_LABEL: string;
201
+ /** @hidden */
202
+ export declare const ERROR_CONTENT: string;
203
+ /** @hidden */
204
+ export declare const STATUS: string;
205
+ /** @hidden */
206
+ export declare const BREADCRUMBS: string;
207
+ /** @hidden */
208
+ export declare const RTL: string;
209
+ /** @hidden */
210
+ export declare const DISPLAY_NONE: string;
211
+ /** @hidden */
212
+ export declare const COLLAPSED: string;
213
+ /** @hidden */
214
+ export declare const FULLROW: string;
215
+ /** @hidden */
216
+ export declare const ICON_COLLAPSIBLE: string;
217
+ /** @hidden */
218
+ export declare const SPLIT_BAR: string;
219
+ /** @hidden */
220
+ export declare const HEADER_CHECK: string;
221
+ /** @hidden */
222
+ export declare const OVERLAY: string;
223
+ /** @hidden */
224
+ export declare const VALUE: string;