@progress/kendo-angular-grid 21.4.1 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/column-menu/column-menu-item-base.d.ts +1 -1
  2. package/columns/column-base.d.ts +1 -1
  3. package/common/toolbar-tool-base.directive.d.ts +1 -1
  4. package/editing/toolbar-editing-tool-base.directive.d.ts +1 -1
  5. package/editing-directives/editing-directive-base.d.ts +1 -1
  6. package/editing-directives/row-editing-directive-base.d.ts +1 -1
  7. package/fesm2022/progress-kendo-angular-grid.mjs +666 -666
  8. package/filtering/base-filter-cell.component.d.ts +1 -1
  9. package/filtering/boolean-filter.component.d.ts +1 -1
  10. package/filtering/date-filter.component.d.ts +1 -1
  11. package/filtering/filter-host.directive.d.ts +1 -1
  12. package/filtering/filter-input-wrapper.component.d.ts +1 -1
  13. package/filtering/numeric-filter.component.d.ts +1 -1
  14. package/filtering/operators/filter-operator.base.d.ts +1 -1
  15. package/filtering/string-filter.component.d.ts +1 -1
  16. package/localization/messages.d.ts +1 -1
  17. package/package.json +28 -36
  18. package/schematics/ngAdd/index.js +7 -7
  19. package/selection/selection-default.d.ts +1 -1
  20. package/esm2022/adaptiveness/adaptive-mode.mjs +0 -5
  21. package/esm2022/adaptiveness/adaptive-renderer.component.mjs +0 -1270
  22. package/esm2022/aggregates/aggregate-types.mjs +0 -5
  23. package/esm2022/aggregates/selection-aggregate.service.mjs +0 -200
  24. package/esm2022/aggregates/status-bar-template.directive.mjs +0 -30
  25. package/esm2022/aggregates/status-bar.component.mjs +0 -70
  26. package/esm2022/column-menu/column-chooser-content.component.mjs +0 -318
  27. package/esm2022/column-menu/column-chooser.component.mjs +0 -230
  28. package/esm2022/column-menu/column-list-kb-nav.service.mjs +0 -40
  29. package/esm2022/column-menu/column-list.component.mjs +0 -478
  30. package/esm2022/column-menu/column-locked-change-event.mjs +0 -19
  31. package/esm2022/column-menu/column-menu-autosize-all.component.mjs +0 -89
  32. package/esm2022/column-menu/column-menu-autosize.component.mjs +0 -97
  33. package/esm2022/column-menu/column-menu-chooser.component.mjs +0 -151
  34. package/esm2022/column-menu/column-menu-container.component.mjs +0 -67
  35. package/esm2022/column-menu/column-menu-expandable-item.interface.mjs +0 -5
  36. package/esm2022/column-menu/column-menu-filter.component.mjs +0 -152
  37. package/esm2022/column-menu/column-menu-item-base.mjs +0 -44
  38. package/esm2022/column-menu/column-menu-item-content-template.directive.mjs +0 -45
  39. package/esm2022/column-menu/column-menu-item.component.mjs +0 -514
  40. package/esm2022/column-menu/column-menu-item.directive.mjs +0 -164
  41. package/esm2022/column-menu/column-menu-lock.component.mjs +0 -118
  42. package/esm2022/column-menu/column-menu-position.component.mjs +0 -196
  43. package/esm2022/column-menu/column-menu-settings.interface.mjs +0 -5
  44. package/esm2022/column-menu/column-menu-sort.component.mjs +0 -119
  45. package/esm2022/column-menu/column-menu-stick.component.mjs +0 -120
  46. package/esm2022/column-menu/column-menu-template.directive.mjs +0 -47
  47. package/esm2022/column-menu/column-menu.component.mjs +0 -839
  48. package/esm2022/column-menu/column-menu.service.mjs +0 -71
  49. package/esm2022/column-menu/column-sticky-change-event.mjs +0 -19
  50. package/esm2022/column-menu/column-visibility-change-event.mjs +0 -19
  51. package/esm2022/column-menu/utils.mjs +0 -52
  52. package/esm2022/column-resizing/column-handle.directive.mjs +0 -499
  53. package/esm2022/column-resizing/column-resize.interface.mjs +0 -5
  54. package/esm2022/column-resizing/column-resizing.service.mjs +0 -214
  55. package/esm2022/column-resizing/table.directive.mjs +0 -141
  56. package/esm2022/columns/cell-rowspan.mjs +0 -5
  57. package/esm2022/columns/checkbox-column.component.mjs +0 -106
  58. package/esm2022/columns/column-base.mjs +0 -432
  59. package/esm2022/columns/column-common.mjs +0 -73
  60. package/esm2022/columns/column-group.component.mjs +0 -135
  61. package/esm2022/columns/column-list.mjs +0 -94
  62. package/esm2022/columns/column.component.mjs +0 -198
  63. package/esm2022/columns/columns-container.mjs +0 -101
  64. package/esm2022/columns/command-column.component.mjs +0 -80
  65. package/esm2022/columns/reorder-column.component.mjs +0 -114
  66. package/esm2022/columns/sort-settings.mjs +0 -18
  67. package/esm2022/columns/span-column.component.mjs +0 -195
  68. package/esm2022/common/adaptiveness.service.mjs +0 -72
  69. package/esm2022/common/cell-click-event-args.interface.mjs +0 -5
  70. package/esm2022/common/clipboard-types.mjs +0 -5
  71. package/esm2022/common/clipboard.directive.mjs +0 -197
  72. package/esm2022/common/clipboard.service.mjs +0 -221
  73. package/esm2022/common/column-info.service.mjs +0 -92
  74. package/esm2022/common/create-form-group.mjs +0 -5
  75. package/esm2022/common/data-layout-mode.mjs +0 -5
  76. package/esm2022/common/default-track-by.mjs +0 -13
  77. package/esm2022/common/dom-events.service.mjs +0 -27
  78. package/esm2022/common/error-messages.mjs +0 -64
  79. package/esm2022/common/event-emitter.mjs +0 -39
  80. package/esm2022/common/fetch-data-callback.mjs +0 -5
  81. package/esm2022/common/field-datatype.mjs +0 -5
  82. package/esm2022/common/filter-descriptor-differ.mjs +0 -69
  83. package/esm2022/common/filter-operator.interface.mjs +0 -5
  84. package/esm2022/common/grid-col-size.mjs +0 -5
  85. package/esm2022/common/id.service.mjs +0 -59
  86. package/esm2022/common/pager-settings.mjs +0 -20
  87. package/esm2022/common/preventable-event.mjs +0 -24
  88. package/esm2022/common/provider.service.mjs +0 -42
  89. package/esm2022/common/remove-confirmation.mjs +0 -5
  90. package/esm2022/common/resizable-settings.mjs +0 -9
  91. package/esm2022/common/single-popup.service.mjs +0 -158
  92. package/esm2022/common/size-options.mjs +0 -5
  93. package/esm2022/common/sort.service.mjs +0 -14
  94. package/esm2022/common/toolbar-tool-base.directive.mjs +0 -85
  95. package/esm2022/constants.mjs +0 -16
  96. package/esm2022/data/change-event-args.interface.mjs +0 -5
  97. package/esm2022/data/change-notification.service.mjs +0 -30
  98. package/esm2022/data/data-item.interface.mjs +0 -5
  99. package/esm2022/data/data-mapping.service.mjs +0 -136
  100. package/esm2022/data/data.collection.mjs +0 -87
  101. package/esm2022/data/data.iterators.mjs +0 -221
  102. package/esm2022/data/grid-item.interface.mjs +0 -5
  103. package/esm2022/data/group-footer-item.interface.mjs +0 -5
  104. package/esm2022/data/group-item.interface.mjs +0 -5
  105. package/esm2022/databinding.directive.mjs +0 -233
  106. package/esm2022/directives.mjs +0 -504
  107. package/esm2022/dragdrop/column-reorder-config.mjs +0 -5
  108. package/esm2022/dragdrop/column-reorder-event.mjs +0 -31
  109. package/esm2022/dragdrop/column-reorder.service.mjs +0 -20
  110. package/esm2022/dragdrop/common.mjs +0 -69
  111. package/esm2022/dragdrop/context-types.mjs +0 -5
  112. package/esm2022/dragdrop/drag-and-drop.service.mjs +0 -65
  113. package/esm2022/dragdrop/drag-hint.service.mjs +0 -137
  114. package/esm2022/dragdrop/draggable-column.directive.mjs +0 -137
  115. package/esm2022/dragdrop/drop-cue.service.mjs +0 -46
  116. package/esm2022/dragdrop/drop-target.directive.mjs +0 -71
  117. package/esm2022/editing/add-command-tool.directive.mjs +0 -59
  118. package/esm2022/editing/add-command.directive.mjs +0 -93
  119. package/esm2022/editing/add-event-args.interface.mjs +0 -5
  120. package/esm2022/editing/cancel-command-tool.directive.mjs +0 -64
  121. package/esm2022/editing/cancel-command.directive.mjs +0 -127
  122. package/esm2022/editing/cancel-event-args.interface.mjs +0 -5
  123. package/esm2022/editing/cell-close-event.mjs +0 -38
  124. package/esm2022/editing/edit-command-tool.directive.mjs +0 -60
  125. package/esm2022/editing/edit-command.directive.mjs +0 -124
  126. package/esm2022/editing/edit-event-args.interface.mjs +0 -5
  127. package/esm2022/editing/edit-row-options.interface.mjs +0 -5
  128. package/esm2022/editing/edit-template.directive.mjs +0 -43
  129. package/esm2022/editing/edit.service.mjs +0 -182
  130. package/esm2022/editing/form/dialog-form.component.mjs +0 -102
  131. package/esm2022/editing/form/form-formfield.component.mjs +0 -188
  132. package/esm2022/editing/form/form.component.mjs +0 -169
  133. package/esm2022/editing/form/index.mjs +0 -8
  134. package/esm2022/editing/form/models.mjs +0 -5
  135. package/esm2022/editing/local-data-changes.service.mjs +0 -18
  136. package/esm2022/editing/remove-command-tool.directive.mjs +0 -61
  137. package/esm2022/editing/remove-command.directive.mjs +0 -123
  138. package/esm2022/editing/remove-event-args.interface.mjs +0 -5
  139. package/esm2022/editing/save-command-tool.directive.mjs +0 -65
  140. package/esm2022/editing/save-command.directive.mjs +0 -126
  141. package/esm2022/editing/save-event-args.interface.mjs +0 -5
  142. package/esm2022/editing/toolbar-editing-tool-base.directive.mjs +0 -99
  143. package/esm2022/editing-directives/create-form-group-args.interface.mjs +0 -5
  144. package/esm2022/editing-directives/edit-service.interface.mjs +0 -5
  145. package/esm2022/editing-directives/editing-directive-base.mjs +0 -167
  146. package/esm2022/editing-directives/external-editing.directive.mjs +0 -151
  147. package/esm2022/editing-directives/in-cell-editing.directive.mjs +0 -97
  148. package/esm2022/editing-directives/local-edit.service.mjs +0 -64
  149. package/esm2022/editing-directives/local-row-edit.service.mjs +0 -13
  150. package/esm2022/editing-directives/reactive-editing.directive.mjs +0 -60
  151. package/esm2022/editing-directives/row-editing-directive-base.mjs +0 -53
  152. package/esm2022/editing-directives/template-editing.directive.mjs +0 -72
  153. package/esm2022/editing-directives/utils.mjs +0 -18
  154. package/esm2022/excel/excel-command-tool.directive.mjs +0 -58
  155. package/esm2022/excel/excel-command.directive.mjs +0 -98
  156. package/esm2022/excel/excel-export-event.mjs +0 -18
  157. package/esm2022/excel/excel.component.mjs +0 -223
  158. package/esm2022/excel/excel.module.mjs +0 -45
  159. package/esm2022/excel/excel.service.mjs +0 -29
  160. package/esm2022/filtering/base-filter-cell.component.mjs +0 -174
  161. package/esm2022/filtering/boolean-filter.component.mjs +0 -83
  162. package/esm2022/filtering/cell/autocomplete-filter-cell.component.mjs +0 -114
  163. package/esm2022/filtering/cell/boolean-filter-cell.component.mjs +0 -113
  164. package/esm2022/filtering/cell/date-filter-cell.component.mjs +0 -141
  165. package/esm2022/filtering/cell/filter-cell-component.factory.mjs +0 -19
  166. package/esm2022/filtering/cell/filter-cell-host.directive.mjs +0 -33
  167. package/esm2022/filtering/cell/filter-cell-operators.component.mjs +0 -242
  168. package/esm2022/filtering/cell/filter-cell-template.directive.mjs +0 -46
  169. package/esm2022/filtering/cell/filter-cell-wrapper.component.mjs +0 -74
  170. package/esm2022/filtering/cell/filter-cell.component.mjs +0 -91
  171. package/esm2022/filtering/cell/numeric-filter-cell.component.mjs +0 -155
  172. package/esm2022/filtering/cell/string-filter-cell.component.mjs +0 -127
  173. package/esm2022/filtering/date-filter.component.mjs +0 -172
  174. package/esm2022/filtering/filter-component.interface.mjs +0 -5
  175. package/esm2022/filtering/filter-host.directive.mjs +0 -58
  176. package/esm2022/filtering/filter-input-wrapper.component.mjs +0 -119
  177. package/esm2022/filtering/filter-input.directive.mjs +0 -123
  178. package/esm2022/filtering/filter-row.component.mjs +0 -131
  179. package/esm2022/filtering/filter.service.mjs +0 -44
  180. package/esm2022/filtering/filterable.mjs +0 -16
  181. package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +0 -167
  182. package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +0 -179
  183. package/esm2022/filtering/menu/date-filter-menu.component.mjs +0 -212
  184. package/esm2022/filtering/menu/filter-menu-component.factory.mjs +0 -19
  185. package/esm2022/filtering/menu/filter-menu-container.component.mjs +0 -418
  186. package/esm2022/filtering/menu/filter-menu-dropdownlist.directive.mjs +0 -44
  187. package/esm2022/filtering/menu/filter-menu-host.directive.mjs +0 -46
  188. package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +0 -158
  189. package/esm2022/filtering/menu/filter-menu-template.directive.mjs +0 -48
  190. package/esm2022/filtering/menu/filter-menu.component.mjs +0 -221
  191. package/esm2022/filtering/menu/filter-radio-button.directive.mjs +0 -34
  192. package/esm2022/filtering/menu/menu-tabbing.service.mjs +0 -22
  193. package/esm2022/filtering/menu/numeric-filter-menu-input.component.mjs +0 -184
  194. package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +0 -230
  195. package/esm2022/filtering/menu/string-filter-menu-input.component.mjs +0 -107
  196. package/esm2022/filtering/menu/string-filter-menu.component.mjs +0 -198
  197. package/esm2022/filtering/multicheckbox-filter.component.mjs +0 -324
  198. package/esm2022/filtering/numeric-filter.component.mjs +0 -145
  199. package/esm2022/filtering/operators/after-eq-filter-operator.component.mjs +0 -72
  200. package/esm2022/filtering/operators/after-filter-operator.component.mjs +0 -72
  201. package/esm2022/filtering/operators/before-eq-filter-operator.component.mjs +0 -72
  202. package/esm2022/filtering/operators/before-filter-operator.component.mjs +0 -72
  203. package/esm2022/filtering/operators/contains-filter-operator.component.mjs +0 -63
  204. package/esm2022/filtering/operators/ends-with-filter-operator.component.mjs +0 -63
  205. package/esm2022/filtering/operators/eq-filter-operator.component.mjs +0 -111
  206. package/esm2022/filtering/operators/filter-operator.base.mjs +0 -101
  207. package/esm2022/filtering/operators/gt-filter-operator.component.mjs +0 -63
  208. package/esm2022/filtering/operators/gte-filter-operator.component.mjs +0 -63
  209. package/esm2022/filtering/operators/is-empty-filter-operator.component.mjs +0 -63
  210. package/esm2022/filtering/operators/is-not-empty-filter-operator.component.mjs +0 -63
  211. package/esm2022/filtering/operators/is-not-null-filter-operator.component.mjs +0 -110
  212. package/esm2022/filtering/operators/isnull-filter-operator.component.mjs +0 -110
  213. package/esm2022/filtering/operators/lt-filter-operator.component.mjs +0 -63
  214. package/esm2022/filtering/operators/lte-filter-operator.component.mjs +0 -63
  215. package/esm2022/filtering/operators/neq-filter-operator.component.mjs +0 -110
  216. package/esm2022/filtering/operators/not-contains-filter-operator.component.mjs +0 -63
  217. package/esm2022/filtering/operators/starts-with-filter-operator.component.mjs +0 -63
  218. package/esm2022/filtering/string-filter.component.mjs +0 -90
  219. package/esm2022/grid.component.mjs +0 -4598
  220. package/esm2022/grid.module.mjs +0 -241
  221. package/esm2022/grouping/group-footer-template.directive.mjs +0 -44
  222. package/esm2022/grouping/group-header-column-template.directive.mjs +0 -45
  223. package/esm2022/grouping/group-header-template.directive.mjs +0 -46
  224. package/esm2022/grouping/group-header.component.mjs +0 -351
  225. package/esm2022/grouping/group-info.service.mjs +0 -43
  226. package/esm2022/grouping/group-key.interface.mjs +0 -5
  227. package/esm2022/grouping/group-panel.component.mjs +0 -487
  228. package/esm2022/grouping/group-rows-args.interface.mjs +0 -5
  229. package/esm2022/grouping/group-settings.mjs +0 -5
  230. package/esm2022/grouping/groups.service.mjs +0 -69
  231. package/esm2022/grouping/utils.mjs +0 -14
  232. package/esm2022/highlight/highlight-item.mjs +0 -5
  233. package/esm2022/highlight/highlight.directive.mjs +0 -132
  234. package/esm2022/index.mjs +0 -221
  235. package/esm2022/layout/browser-support.service.mjs +0 -94
  236. package/esm2022/layout/resizable.directive.mjs +0 -83
  237. package/esm2022/layout/resize.service.mjs +0 -29
  238. package/esm2022/layout/responsive.service.mjs +0 -34
  239. package/esm2022/layout/row-sync.mjs +0 -47
  240. package/esm2022/layout/sizing-options.service.mjs +0 -18
  241. package/esm2022/localization/custom-messages.component.mjs +0 -54
  242. package/esm2022/localization/localized-messages.directive.mjs +0 -39
  243. package/esm2022/localization/messages.mjs +0 -895
  244. package/esm2022/navigation/default-focusable-element.mjs +0 -50
  245. package/esm2022/navigation/focus-group.mjs +0 -73
  246. package/esm2022/navigation/focus-root.mjs +0 -50
  247. package/esm2022/navigation/focusable-element.interface.mjs +0 -5
  248. package/esm2022/navigation/focusable.directive.mjs +0 -150
  249. package/esm2022/navigation/grid-focusable-element.mjs +0 -28
  250. package/esm2022/navigation/item-map.mjs +0 -59
  251. package/esm2022/navigation/logical-cell.directive.mjs +0 -224
  252. package/esm2022/navigation/logical-cell.interface.mjs +0 -5
  253. package/esm2022/navigation/logical-row.directive.mjs +0 -131
  254. package/esm2022/navigation/logical-row.interface.mjs +0 -5
  255. package/esm2022/navigation/navigable-settings.mjs +0 -5
  256. package/esm2022/navigation/navigation-cell.interface.mjs +0 -5
  257. package/esm2022/navigation/navigation-change.interface.mjs +0 -5
  258. package/esm2022/navigation/navigation-cursor.mjs +0 -224
  259. package/esm2022/navigation/navigation-metadata.mjs +0 -35
  260. package/esm2022/navigation/navigation-mode.mjs +0 -5
  261. package/esm2022/navigation/navigation-model.mjs +0 -138
  262. package/esm2022/navigation/navigation-row.interface.mjs +0 -5
  263. package/esm2022/navigation/navigation.service.mjs +0 -998
  264. package/esm2022/navigation/toolbar-tool-name.mjs +0 -18
  265. package/esm2022/package-metadata.mjs +0 -16
  266. package/esm2022/pdf/export-element.mjs +0 -135
  267. package/esm2022/pdf/grid-query.mjs +0 -45
  268. package/esm2022/pdf/pdf-command-tool.directive.mjs +0 -60
  269. package/esm2022/pdf/pdf-command.directive.mjs +0 -98
  270. package/esm2022/pdf/pdf-export-event.mjs +0 -16
  271. package/esm2022/pdf/pdf-margin.component.mjs +0 -38
  272. package/esm2022/pdf/pdf-margin.interface.mjs +0 -5
  273. package/esm2022/pdf/pdf-template.directive.mjs +0 -43
  274. package/esm2022/pdf/pdf.component.mjs +0 -331
  275. package/esm2022/pdf/pdf.module.mjs +0 -47
  276. package/esm2022/pdf/pdf.service.mjs +0 -42
  277. package/esm2022/progress-kendo-angular-grid.mjs +0 -8
  278. package/esm2022/rendering/cell-loading.template.directive.mjs +0 -39
  279. package/esm2022/rendering/cell-template.directive.mjs +0 -44
  280. package/esm2022/rendering/cell.component.mjs +0 -717
  281. package/esm2022/rendering/common/cell-context.mjs +0 -13
  282. package/esm2022/rendering/common/col-group.component.mjs +0 -98
  283. package/esm2022/rendering/common/dom-queries.mjs +0 -162
  284. package/esm2022/rendering/common/field-accessor.pipe.mjs +0 -48
  285. package/esm2022/rendering/common/format.pipe.mjs +0 -37
  286. package/esm2022/rendering/common/loading.component.mjs +0 -60
  287. package/esm2022/rendering/common/row-args.mjs +0 -5
  288. package/esm2022/rendering/common/row-class.mjs +0 -5
  289. package/esm2022/rendering/common/spacer.component.mjs +0 -62
  290. package/esm2022/rendering/constants.mjs +0 -20
  291. package/esm2022/rendering/details/detail-collapse-event.mjs +0 -27
  292. package/esm2022/rendering/details/detail-expand-event.mjs +0 -27
  293. package/esm2022/rendering/details/detail-template.directive.mjs +0 -61
  294. package/esm2022/rendering/details/details.service.mjs +0 -56
  295. package/esm2022/rendering/details-expand.directive.mjs +0 -136
  296. package/esm2022/rendering/footer/footer-template.directive.mjs +0 -48
  297. package/esm2022/rendering/footer/footer.component.mjs +0 -266
  298. package/esm2022/rendering/grid-table.directive.mjs +0 -52
  299. package/esm2022/rendering/groups-expand.directive.mjs +0 -149
  300. package/esm2022/rendering/header/header-template.directive.mjs +0 -45
  301. package/esm2022/rendering/header/header.component.mjs +0 -1055
  302. package/esm2022/rendering/list.component.mjs +0 -1176
  303. package/esm2022/rendering/loading-template.directive.mjs +0 -38
  304. package/esm2022/rendering/no-records-template.directive.mjs +0 -38
  305. package/esm2022/rendering/rowspan.service.mjs +0 -24
  306. package/esm2022/rendering/table-body.component.mjs +0 -1250
  307. package/esm2022/rendering/toolbar/toolbar-focusable.directive.mjs +0 -83
  308. package/esm2022/rendering/toolbar/toolbar-navigation.service.mjs +0 -58
  309. package/esm2022/rendering/toolbar/toolbar-position.mjs +0 -5
  310. package/esm2022/rendering/toolbar/toolbar-template.directive.mjs +0 -55
  311. package/esm2022/rendering/toolbar/toolbar.component.mjs +0 -159
  312. package/esm2022/rendering/toolbar/tools/ai-assistant/ai-assistant.component.mjs +0 -272
  313. package/esm2022/rendering/toolbar/tools/ai-assistant/ai-request-response.service.mjs +0 -624
  314. package/esm2022/rendering/toolbar/tools/ai-assistant/ai-tool.directive.mjs +0 -273
  315. package/esm2022/rendering/toolbar/tools/ai-assistant/models.mjs +0 -43
  316. package/esm2022/rendering/toolbar/tools/ai-assistant/utils.mjs +0 -92
  317. package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +0 -238
  318. package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +0 -219
  319. package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +0 -151
  320. package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +0 -223
  321. package/esm2022/rendering/toolbar/tools/group-command-tool.directive.mjs +0 -208
  322. package/esm2022/rendering/toolbar/tools/group-toolbar-tool.component.mjs +0 -451
  323. package/esm2022/rendering/toolbar/tools/select-all-command-tool.directive.mjs +0 -93
  324. package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +0 -222
  325. package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +0 -245
  326. package/esm2022/row-reordering/drag-handle-template.directive.mjs +0 -44
  327. package/esm2022/row-reordering/drag-hint-template.directive.mjs +0 -42
  328. package/esm2022/row-reordering/row-reorder.service.mjs +0 -280
  329. package/esm2022/row-reordering/types.mjs +0 -5
  330. package/esm2022/row-reordering/utils.mjs +0 -88
  331. package/esm2022/scrolling/content-scroll-event.mjs +0 -5
  332. package/esm2022/scrolling/row-height.service.mjs +0 -55
  333. package/esm2022/scrolling/scroll-bottom-event.mjs +0 -5
  334. package/esm2022/scrolling/scroll-request.service.mjs +0 -24
  335. package/esm2022/scrolling/scroll-sync.service.mjs +0 -80
  336. package/esm2022/scrolling/scroller.service.mjs +0 -254
  337. package/esm2022/scrolling/scrollmode.mjs +0 -5
  338. package/esm2022/scrolling/suspend.service.mjs +0 -17
  339. package/esm2022/selection/cell-selection.service.mjs +0 -349
  340. package/esm2022/selection/marquee.directive.mjs +0 -188
  341. package/esm2022/selection/pair-set.mjs +0 -158
  342. package/esm2022/selection/selectall-checkbox.directive.mjs +0 -143
  343. package/esm2022/selection/selection-checkbox.directive.mjs +0 -132
  344. package/esm2022/selection/selection-default.mjs +0 -208
  345. package/esm2022/selection/selection.directive.mjs +0 -53
  346. package/esm2022/selection/selection.service.mjs +0 -466
  347. package/esm2022/selection/types.mjs +0 -5
  348. package/esm2022/state-management/grid-state.models.mjs +0 -26
  349. package/esm2022/state-management/redo-command-tool.mjs +0 -74
  350. package/esm2022/state-management/undo-command-tool.mjs +0 -74
  351. package/esm2022/state-management/undo-redo.directive.mjs +0 -249
  352. package/esm2022/state-management/undo-redo.service.mjs +0 -21
  353. package/esm2022/state-management/undo-redo.stack.mjs +0 -238
  354. package/esm2022/utils.mjs +0 -216
@@ -1,998 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { ChangeDetectorRef, EventEmitter, Injectable, NgZone, Optional } from '@angular/core';
6
- import { from, interval, Subscription } from 'rxjs';
7
- import { filter, switchMap, switchMapTo, take, takeUntil, map } from 'rxjs/operators';
8
- import { FocusRoot } from './focus-root';
9
- import { FocusableDirective } from './focusable.directive';
10
- import { GridFocusableElement } from './grid-focusable-element';
11
- import { NavigationCursor } from './navigation-cursor';
12
- import { NavigationModel } from './navigation-model';
13
- import { DomEventsService } from '../common/dom-events.service';
14
- import { hasClasses, isDocumentAvailable, isPresent, Keys, normalizeKeys } from '@progress/kendo-angular-common';
15
- import { EditService } from '../editing/edit.service';
16
- import { GroupsService } from '../grouping/groups.service';
17
- import { PagerContextService } from '@progress/kendo-angular-pager';
18
- import { closest, contains, findFocusableChild, isVisible, matchesNodeName } from '../rendering/common/dom-queries';
19
- import { DetailsService } from '../rendering/details/details.service';
20
- import { ScrollRequestService } from '../scrolling/scroll-request.service';
21
- import { ContextService } from '../common/provider.service';
22
- import { ColumnResizingService } from '../column-resizing/column-resizing.service';
23
- import * as i0 from "@angular/core";
24
- import * as i1 from "../common/dom-events.service";
25
- import * as i2 from "@progress/kendo-angular-pager";
26
- import * as i3 from "../scrolling/scroll-request.service";
27
- import * as i4 from "../grouping/groups.service";
28
- import * as i5 from "../rendering/details/details.service";
29
- import * as i6 from "./focus-root";
30
- import * as i7 from "../editing/edit.service";
31
- import * as i8 from "../common/provider.service";
32
- import * as i9 from "../column-resizing/column-resizing.service";
33
- import * as i10 from "./focusable.directive";
34
- const isInSameGrid = (element, gridElement) => closest(element, matchesNodeName('kendo-grid')) === gridElement;
35
- const matchHeaderCell = matchesNodeName('th');
36
- const matchDataCell = matchesNodeName('td');
37
- const matchFooterCell = matchesNodeName('.k-grid-footer td');
38
- const matchCell = (element) => matchDataCell(element) || matchHeaderCell(element) || matchFooterCell(element);
39
- const gridCell = (element, gridElement) => {
40
- let target = closest(element, matchCell);
41
- while (target && !isInSameGrid(target, gridElement)) {
42
- target = closest(target.parentElement, matchCell);
43
- }
44
- return target;
45
- };
46
- const targetCell = (target, gridElement) => {
47
- const cell = gridCell(target, gridElement);
48
- const row = closest(cell, matchesNodeName('tr'));
49
- if (cell && row) {
50
- let rowIndex = row.getAttribute('aria-rowindex') || row.getAttribute('data-kendo-grid-row-index');
51
- rowIndex = rowIndex ? parseInt(rowIndex, 10) - 1 : null;
52
- let colIndex = cell.getAttribute('aria-colindex');
53
- colIndex = colIndex ? parseInt(colIndex, 10) - 1 : null;
54
- if (rowIndex !== null && colIndex !== null) {
55
- return { colIndex, rowIndex, element: cell };
56
- }
57
- }
58
- };
59
- const isArrowKey = keyCode => keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight ||
60
- keyCode === Keys.ArrowUp || keyCode === Keys.ArrowDown;
61
- const isNavigationKey = keyCode => isArrowKey(keyCode) ||
62
- keyCode === Keys.PageUp || keyCode === Keys.PageDown ||
63
- keyCode === Keys.Home || keyCode === Keys.End;
64
- const isInput = matchesNodeName('input');
65
- const isTextInput = element => element && isInput(element) && element.type.toLowerCase() === 'text';
66
- const isPrintableCharacter = (str) => str.length === 1 && str.match(/\S/);
67
- const resizeStep = 10;
68
- /**
69
- * @hidden
70
- */
71
- export class NavigationViewport {
72
- firstItemIndex;
73
- lastItemIndex;
74
- constructor(firstItemIndex, lastItemIndex) {
75
- this.firstItemIndex = firstItemIndex;
76
- this.lastItemIndex = lastItemIndex;
77
- }
78
- containsRow(dataRowIndex) {
79
- const headerRow = dataRowIndex < 0;
80
- return headerRow || (dataRowIndex >= this.firstItemIndex && dataRowIndex <= this.lastItemIndex);
81
- }
82
- intersects(start, end) {
83
- return (start <= this.firstItemIndex && this.lastItemIndex <= end) ||
84
- (this.firstItemIndex <= start && start <= this.lastItemIndex) ||
85
- (this.firstItemIndex <= end && end <= this.lastItemIndex);
86
- }
87
- }
88
- /**
89
- * @hidden
90
- */
91
- export class NavigationService {
92
- zone;
93
- domEvents;
94
- pagerContextService;
95
- scrollRequestService;
96
- groupsService;
97
- detailsService;
98
- focusRoot;
99
- editService;
100
- cd;
101
- ctx;
102
- resizeService;
103
- focusableParent;
104
- changes;
105
- cellKeydown = new EventEmitter();
106
- set metadata(value) {
107
- this.meta = value;
108
- this.cursor.metadata = value;
109
- }
110
- get metadata() {
111
- return this.meta;
112
- }
113
- get enabled() {
114
- return this.alive;
115
- }
116
- get pagerEnabled() {
117
- return this.alive && this.pagerIsNavigable;
118
- }
119
- get tableEnabled() {
120
- return this.alive && this.tableIsNavigable;
121
- }
122
- get toolbarEnabled() {
123
- return this.alive && this.toolbarIsNavigable;
124
- }
125
- get activeCell() {
126
- if (this.mode !== 0 /* NavigationMode.Standby */) {
127
- return this.cursor.cell;
128
- }
129
- }
130
- get activeRow() {
131
- if (this.mode !== 0 /* NavigationMode.Standby */) {
132
- return Object.assign({}, this.cursor.row, {
133
- cells: this.cursor.row?.cells.toArray()
134
- });
135
- }
136
- }
137
- get isColumnResizable() {
138
- const allColumns = Array.from(this.ctx.grid.columnsContainer.allColumns);
139
- const column = allColumns.find((col) => col.level === this.activeCell.rowIndex && col.leafIndex === this.activeCell.colIndex);
140
- if (!column.parent) {
141
- if (column.isColumnGroup) {
142
- return this.activeCell.colIndex + this.activeCell.colSpan !== this.ctx.grid.columnsContainer.leafColumnsToRender.length;
143
- }
144
- else {
145
- return this.activeCell.colIndex !== this.ctx.grid.columnsContainer.leafColumnsToRender.length - 1;
146
- }
147
- }
148
- else {
149
- const columnGroup = column.parent;
150
- const columnGroupChildren = Array.from(columnGroup.children).sort((a, b) => a.orderIndex - b.orderIndex);
151
- const columnIndexInsideGroup = columnGroupChildren.indexOf(column);
152
- if (column.isReordered || column.orderIndex > 0 || (column.isReordered && column.orderIndex === 0)) {
153
- return (column.orderIndex - columnGroupChildren[0]['orderIndex']) !== columnGroupChildren.length - 1;
154
- }
155
- return columnIndexInsideGroup !== columnGroupChildren.length - 1;
156
- }
157
- }
158
- preventScroll = false;
159
- viewport;
160
- columnViewport;
161
- activeRowIndex = 0;
162
- alive = false;
163
- active = true;
164
- mode = 0 /* NavigationMode.Standby */;
165
- model = new NavigationModel();
166
- cursor = new NavigationCursor(this.model);
167
- meta;
168
- subs;
169
- pendingRowIndex;
170
- virtualCell;
171
- pagerIsNavigable = false;
172
- tableIsNavigable = false;
173
- toolbarIsNavigable = false;
174
- lastCellRowIndex;
175
- isShiftPressed = false;
176
- currentSelection = [];
177
- get activeDataRow() {
178
- return Math.min(Math.max(0, this.activeRowIndex - this.meta.headerRows), this.meta.maxLogicalRowIndex);
179
- }
180
- constructor(zone, domEvents, pagerContextService, scrollRequestService, groupsService, detailsService, focusRoot, editService, cd, ctx, resizeService, focusableParent) {
181
- this.zone = zone;
182
- this.domEvents = domEvents;
183
- this.pagerContextService = pagerContextService;
184
- this.scrollRequestService = scrollRequestService;
185
- this.groupsService = groupsService;
186
- this.detailsService = detailsService;
187
- this.focusRoot = focusRoot;
188
- this.editService = editService;
189
- this.cd = cd;
190
- this.ctx = ctx;
191
- this.resizeService = resizeService;
192
- this.focusableParent = focusableParent;
193
- this.changes = this.cursor.changes;
194
- }
195
- init(meta, navigableOptions) {
196
- this.setActiveSections(navigableOptions);
197
- this.alive = true;
198
- this.focusRoot.active = true;
199
- this.metadata = meta;
200
- const onStableSubscriber = (...operators) => (args) => this.zone.isStable ?
201
- from([true]).pipe(map(() => args)) :
202
- this.zone.onStable.pipe(take(1), map(() => args), ...operators);
203
- const onStable = onStableSubscriber();
204
- this.subs = new Subscription();
205
- this.subs.add(this.cursor.changes.subscribe(args => this.onCursorChanges(args)));
206
- this.subs.add(this.domEvents.focus.pipe(switchMap(onStable))
207
- .subscribe((args) => this.navigateTo(args.target)));
208
- this.subs.add(this.domEvents.focusOut.pipe(filter(() => this.mode !== 0 /* NavigationMode.Standby */), switchMap(onStableSubscriber(takeUntil(this.domEvents.focus))))
209
- .subscribe(args => this.onFocusOut(args)));
210
- this.subs.add(this.domEvents.windowBlur.pipe(filter(() => this.mode !== 0 /* NavigationMode.Standby */))
211
- .subscribe(() => this.onWindowBlur()));
212
- this.subs.add(
213
- // Closing the editor will not always trigger focusout in Firefox.
214
- // To get around this, we ensure that the cell is closed after editing.
215
- this.editService.changes.pipe(filter(e => e.action !== 'edit' && this.mode === 2 /* NavigationMode.Content */), filter((e) => e.action === 'cellClose' && !e.prevented), switchMap(onStable))
216
- .subscribe((e) => {
217
- const isInStackedCell = closest(e.originalEvent?.target, (el) => hasClasses(el, 'k-grid-stack-content'));
218
- if (!isInStackedCell) {
219
- this.leaveCell();
220
- }
221
- }));
222
- this.subs.add(this.pagerContextService.pageChange
223
- .subscribe(() => this.cursor.reset(0, 0)));
224
- this.subs.add(this.domEvents.keydown
225
- .subscribe(args => this.onKeydown(args)));
226
- this.subs.add(this.domEvents.shiftKeyup
227
- .subscribe(() => {
228
- this.isShiftPressed = false;
229
- }));
230
- this.subs.add(this.domEvents.keydown.pipe(filter(args => args.code === Keys.Tab && this.mode === 2 /* NavigationMode.Content */), switchMapTo(this.domEvents.focusOut.pipe(takeUntil(
231
- // Timeout if focusOut doesn't fire very soon
232
- interval(0).pipe(take(1))))))
233
- .subscribe(() => this.onTabout()));
234
- this.subs.add(this.domEvents.cellClick
235
- .subscribe(() => {
236
- if (this.isStackedMode) {
237
- const stackedCells = this.activeCell?.focusGroup?.focusableChildren;
238
- if (!isPresent(stackedCells) || stackedCells.length === 0) {
239
- return;
240
- }
241
- const currFocusedIndex = stackedCells.findIndex(el => el.hasFocus() || el.hostElement?.nativeElement === document.activeElement);
242
- currFocusedIndex > -1 && (this.stackedFocusedCellIndex = currFocusedIndex);
243
- }
244
- }));
245
- if (this.focusableParent) {
246
- const element = new GridFocusableElement(this);
247
- this.focusableParent.registerElement(element);
248
- }
249
- this.deactivateElements();
250
- }
251
- ngOnDestroy() {
252
- if (this.subs) {
253
- this.subs.unsubscribe();
254
- }
255
- this.alive = false;
256
- }
257
- registerCell(cell) {
258
- if (cell.logicalRowIndex !== this.pendingRowIndex) {
259
- const modelCell = this.model.registerCell(cell);
260
- if (this.virtualCell && this.cursor.activateVirtualCell(modelCell)) {
261
- this.virtualCell = false;
262
- }
263
- }
264
- }
265
- registerCellOnCurrentRow(cell) {
266
- if (cell.logicalRowIndex === this.pendingRowIndex) {
267
- this.model.registerCell(cell);
268
- }
269
- }
270
- unregisterCell(index, rowIndex, cell) {
271
- this.model.unregisterCell(index, rowIndex, cell);
272
- }
273
- registerRow(row) {
274
- this.model.registerRow(row);
275
- this.pendingRowIndex = row.logicalRowIndex;
276
- }
277
- updateRow(row) {
278
- this.model.updateRow(row);
279
- }
280
- unregisterRow(index, row) {
281
- this.model.unregisterRow(index, row);
282
- const lastRow = this.model.lastRow;
283
- if (lastRow && this.mode === 0 /* NavigationMode.Standby */) {
284
- const maxIndex = (this.needsViewport() && this.viewport) ? this.viewport.lastItemIndex : lastRow.index;
285
- if (this.activeRowIndex > maxIndex) {
286
- this.cursor.reset(0, 0);
287
- }
288
- }
289
- }
290
- isCellFocusable(cell) {
291
- return this.alive &&
292
- this.active &&
293
- this.mode !== 2 /* NavigationMode.Content */ &&
294
- this.cursor.isActive(cell.logicalRowIndex, cell.logicalColIndex);
295
- }
296
- isCellFocused(cell) {
297
- return this.mode === 1 /* NavigationMode.Cursor */ && this.isCellFocusable(cell);
298
- }
299
- navigateTo(el) {
300
- if (!this.alive || !isDocumentAvailable()) {
301
- return;
302
- }
303
- const cell = targetCell(el, this.meta.gridElement.nativeElement);
304
- if (!cell) {
305
- return;
306
- }
307
- const oldMode = this.mode;
308
- const focusInCell = contains(cell.element, document.activeElement);
309
- const focusInActiveRowContent = this.mode === 2 /* NavigationMode.Content */ &&
310
- this.activeRowIndex === cell.rowIndex &&
311
- el !== cell.element;
312
- if (focusInCell) {
313
- this.mode = 2 /* NavigationMode.Content */;
314
- this.cursor.reset(cell.rowIndex, cell.colIndex);
315
- this.activateRow();
316
- }
317
- else if (!focusInActiveRowContent) {
318
- this.mode = 1 /* NavigationMode.Cursor */;
319
- this.deactivateElements();
320
- const alreadyActive = this.cursor.isActive(cell.rowIndex, cell.colIndex);
321
- const isCursor = oldMode === 1 /* NavigationMode.Cursor */ && alreadyActive;
322
- if (!isCursor) {
323
- this.cursor.reset(cell.rowIndex, cell.colIndex);
324
- }
325
- }
326
- }
327
- tryFocus(el) {
328
- this.activateElements();
329
- const focusable = findFocusableChild(el);
330
- if (focusable) {
331
- const cell = targetCell(focusable, this.meta.gridElement.nativeElement);
332
- if (cell) {
333
- this.cursor.reset(cell.rowIndex, cell.colIndex);
334
- this.deactivateElements();
335
- this.enterCell();
336
- }
337
- this.zone.runOutsideAngular(() => {
338
- setTimeout(() => {
339
- focusable.focus();
340
- });
341
- });
342
- }
343
- else {
344
- this.deactivateElements();
345
- }
346
- return !!focusable;
347
- }
348
- needsViewport() {
349
- return this.meta && this.meta.isVirtual;
350
- }
351
- setViewport(firstItemIndex, lastItemIndex) {
352
- this.viewport = new NavigationViewport(firstItemIndex, lastItemIndex);
353
- if (this.meta && this.meta.isVirtual && this.activeDataRow > -1) {
354
- const dataRowIndex = this.activeDataRow;
355
- const ahead = firstItemIndex - dataRowIndex;
356
- const behind = dataRowIndex - lastItemIndex;
357
- if (ahead > 0) {
358
- this.cursor.reset(firstItemIndex + this.meta.headerRows);
359
- }
360
- else if (behind > 0) {
361
- this.cursor.reset(lastItemIndex - this.meta.headerRows);
362
- }
363
- }
364
- }
365
- setColumnViewport(firstItemIndex, lastItemIndex) {
366
- this.columnViewport = new NavigationViewport(firstItemIndex, lastItemIndex);
367
- if (this.meta && this.meta.isVirtual && this.activeDataRow > -1) {
368
- const activeColumnIndex = this.cursor.cell ? this.cursor.cell.colIndex : 0;
369
- const ahead = firstItemIndex - activeColumnIndex;
370
- const behind = activeColumnIndex - lastItemIndex;
371
- if (ahead > 0) {
372
- this.cursor.reset(undefined, firstItemIndex, false);
373
- }
374
- else if (behind > 0) {
375
- this.cursor.reset(undefined, lastItemIndex, false);
376
- }
377
- }
378
- }
379
- focusCell(rowIndex = undefined, colIndex = undefined) {
380
- this.mode = 1 /* NavigationMode.Cursor */;
381
- this.cursor.reset(rowIndex, colIndex);
382
- return this.activeCell;
383
- }
384
- focusCellByElement(el) {
385
- const cell = targetCell(el, this.meta.gridElement.nativeElement);
386
- if (cell) {
387
- return this.focusCell(cell.rowIndex, cell.colIndex);
388
- }
389
- }
390
- focusNextCell(wrap = true) {
391
- return this.focusAdjacentCell(true, wrap);
392
- }
393
- focusPrevCell(wrap = true) {
394
- return this.focusAdjacentCell(false, wrap);
395
- }
396
- toggle(active) {
397
- this.active = active;
398
- this.cursor.announce();
399
- }
400
- hasFocus() {
401
- return this.mode === 1 /* NavigationMode.Cursor */ || this.mode === 2 /* NavigationMode.Content */;
402
- }
403
- autoFocusCell(start, end) {
404
- return !this.meta.virtualColumns || end < this.meta.columns.lockedLeafColumns.length || this.columnViewport.intersects(start, end);
405
- }
406
- setActiveSections(navigableOptions) {
407
- this.pagerIsNavigable = navigableOptions.includes('pager');
408
- this.tableIsNavigable = navigableOptions.includes('table');
409
- this.toolbarIsNavigable = navigableOptions.includes('toolbar');
410
- }
411
- focusAdjacentCell(fwd, wrap) {
412
- this.focusCell();
413
- let success = fwd ? this.moveCursorFwd() : this.moveCursorBwd();
414
- if (wrap && !success) {
415
- success = fwd ? this.cursor.moveDown(1) : this.cursor.moveUp(1);
416
- if (success) {
417
- const row = this.cursor.row;
418
- const colIdx = fwd || this.isStackedMode ? 0 : this.cursor.lastCellIndex(row);
419
- this.cursor.reset(row.index, colIdx);
420
- }
421
- }
422
- if (success) {
423
- return this.activeCell;
424
- }
425
- else {
426
- this.mode = 0 /* NavigationMode.Standby */;
427
- this.cursor.announce();
428
- }
429
- return null;
430
- }
431
- enterCell() {
432
- const cell = this.cursor.cell;
433
- if (!cell) {
434
- return;
435
- }
436
- if (this.tableCellEntered && this.isStackedMode) {
437
- this.stackedCellEntered = true;
438
- }
439
- else {
440
- this.tableCellEntered = true;
441
- }
442
- const group = cell.focusGroup;
443
- const focusable = group && group.canFocus();
444
- this.mode = focusable ? 2 /* NavigationMode.Content */ : 1 /* NavigationMode.Cursor */;
445
- this.cursor.announce();
446
- if (focusable) {
447
- this.activateRow();
448
- group.focus();
449
- if (this.isStackedMode && this.stackedFocusedCellIndex === -1) {
450
- this.stackedFocusedCellIndex = 0;
451
- }
452
- }
453
- }
454
- leaveCell() {
455
- const cell = this.cursor.cell;
456
- if (!cell) {
457
- return;
458
- }
459
- if (this.tableCellEntered) {
460
- if (this.stackedCellEntered) {
461
- this.stackedCellEntered = false;
462
- }
463
- else {
464
- this.tableCellEntered = false;
465
- }
466
- }
467
- const group = cell.focusGroup;
468
- const focusable = group && group.canFocus();
469
- if (!focusable) {
470
- this.deactivateElements();
471
- }
472
- if (this.isStackedMode && this.stackedFocusedCellIndex > -1) {
473
- this.stackedFocusedCellIndex = -1;
474
- }
475
- this.mode = 1 /* NavigationMode.Cursor */;
476
- this.cursor.announce();
477
- }
478
- activateElements() {
479
- this.focusRoot.activate();
480
- }
481
- deactivateElements() {
482
- this.focusRoot.deactivate();
483
- }
484
- activateRow() {
485
- this.cursor.row.cells
486
- .forEach(cell => cell.focusGroup && cell.focusGroup.activate());
487
- }
488
- moveCursorFwd() {
489
- this.lastCellRowIndex = this.activeCell?.rowIndex;
490
- return this.ctx.localization.rtl ? this.cursor.moveLeft() : this.cursor.moveRight();
491
- }
492
- moveCursorBwd() {
493
- this.lastCellRowIndex = this.activeCell?.rowIndex;
494
- return this.ctx.localization.rtl ? this.cursor.moveRight() : this.cursor.moveLeft();
495
- }
496
- onCursorKeydown(args) {
497
- let preventDefault = false;
498
- const modifier = args.ctrlKey || args.metaKey;
499
- let step = modifier ? 5 : 1;
500
- const rowspan = +args.target?.getAttribute('rowspan');
501
- let rowspanOffset = 0;
502
- let startNewSelection = false;
503
- const allowMultipleRanges = (this.ctx.grid.selectionService.active && this.ctx.grid.selectableSettings?.multipleRanges) ||
504
- (this.ctx.grid.cellSelectionService.active && this.ctx.grid.cellSelectionService?.options?.multipleRanges);
505
- if (!allowMultipleRanges) {
506
- this.currentSelection = [];
507
- }
508
- if (!this.onCellKeydown(args)) {
509
- return;
510
- }
511
- const row = this.cursor.row;
512
- // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
513
- const code = normalizeKeys(args);
514
- // Handle row reordering keyboard shortcuts (Ctrl/Cmd + Shift + Up/Down Arrow)
515
- if (modifier && args.shiftKey && (code === Keys.ArrowUp || code === Keys.ArrowDown)) {
516
- if (this.handleRowReorderKeyboard(args, code, row)) {
517
- args.preventDefault();
518
- return;
519
- }
520
- }
521
- const dir = code === Keys.ArrowDown ? 'Down' : 'Up';
522
- const right = code === Keys.ArrowRight;
523
- const isArrowKey = code === Keys.ArrowDown || code === Keys.ArrowUp || code === Keys.ArrowLeft || code === Keys.ArrowRight;
524
- if (!this.isShiftPressed && args.shiftKey && isArrowKey) {
525
- startNewSelection = true;
526
- this.isShiftPressed = true;
527
- }
528
- const cellElement = args.target;
529
- const isDragCell = cellElement ? closest(cellElement, (el) => hasClasses(el, 'k-drag-cell')) : false;
530
- const isRowReorderable = this.ctx.grid.rowReorderable;
531
- switch (code) {
532
- case Keys.ArrowDown:
533
- case Keys.ArrowUp:
534
- if (rowspan > 1) {
535
- rowspanOffset = this.calculateRowspanOffset(dir, rowspan);
536
- step += rowspanOffset;
537
- }
538
- if (args.shiftKey && !(isDragCell && isRowReorderable)) {
539
- if (this.ctx.grid.blockArrowSelection) {
540
- return;
541
- }
542
- preventDefault = this.cursor[`move${dir}`](step);
543
- const preserveCurrentSelection = startNewSelection && allowMultipleRanges;
544
- if (this.activeRow?.dataItem) {
545
- const sign = dir === 'Down' ? 1 : -1;
546
- this.handleVerticalArrowSelection(sign * step, preserveCurrentSelection);
547
- }
548
- }
549
- else {
550
- preventDefault = this.cursor[`move${dir}`](step);
551
- }
552
- this.lastCellRowIndex = this.activeRowIndex;
553
- break;
554
- case Keys.ArrowRight:
555
- case Keys.ArrowLeft:
556
- if (args.altKey && this.ctx.grid.resizable && this.isColumnResizable) {
557
- this.columnResize(right);
558
- break;
559
- }
560
- if (args.shiftKey) {
561
- if (this.ctx.grid.blockArrowSelection) {
562
- return;
563
- }
564
- preventDefault = this[`moveCursor${right ? 'Fwd' : 'Bwd'}`]();
565
- const preserveCurrentSelection = startNewSelection && allowMultipleRanges;
566
- this.handleHorizontalArrowSelection(args, preserveCurrentSelection);
567
- }
568
- else {
569
- preventDefault = this[`moveCursor${right ? 'Fwd' : 'Bwd'}`]();
570
- }
571
- break;
572
- case Keys.PageDown:
573
- if (this.metadata.isVirtual && this.viewport) {
574
- let nextItemIndex = this.meta.headerRows + this.viewport.lastItemIndex + 1;
575
- if (this.metadata.hasDetailTemplate) {
576
- nextItemIndex++;
577
- }
578
- nextItemIndex = Math.min(this.meta.maxLogicalRowIndex, nextItemIndex);
579
- this.cursor.reset(nextItemIndex);
580
- preventDefault = true;
581
- }
582
- else if (this.metadata.hasPager) {
583
- this.zone.run(() => this.pagerContextService.nextPage());
584
- preventDefault = true;
585
- }
586
- break;
587
- case Keys.PageUp:
588
- if (this.metadata.isVirtual && this.viewport) {
589
- const viewportSize = this.viewport.lastItemIndex - this.viewport.firstItemIndex;
590
- const firstItemIndex = this.viewport.firstItemIndex;
591
- const nextItemIndex = Math.max(this.meta.headerRows, firstItemIndex - viewportSize - 1);
592
- this.cursor.reset(nextItemIndex);
593
- preventDefault = true;
594
- }
595
- else if (this.metadata.hasPager) {
596
- this.zone.run(() => this.pagerContextService.prevPage());
597
- preventDefault = true;
598
- }
599
- break;
600
- case Keys.Home:
601
- if (modifier) {
602
- if (this.meta.isVirtual) {
603
- this.cursor.reset(this.meta.headerRows, 0, false);
604
- }
605
- else {
606
- this.cursor.reset(this.model.firstRow.index, 0, false);
607
- }
608
- }
609
- else {
610
- let firstColumnIndex = 0;
611
- if (this.meta.hasDetailTemplate && row.index < this.meta.headerRows) {
612
- firstColumnIndex = 1;
613
- }
614
- this.cursor.reset(row.index, firstColumnIndex, false);
615
- }
616
- preventDefault = true;
617
- break;
618
- case Keys.End:
619
- if (modifier) {
620
- if (this.meta.isVirtual) {
621
- let lastRowIndex = this.meta.maxLogicalRowIndex;
622
- if (this.meta.hasDetailTemplate) {
623
- lastRowIndex--;
624
- }
625
- this.cursor.reset(lastRowIndex, this.cursor.lastCellIndex(), false);
626
- }
627
- else {
628
- this.cursor.reset(this.model.lastRow.index, this.cursor.lastCellIndex(this.model.lastRow), false);
629
- }
630
- }
631
- else {
632
- const lastIndex = this.cursor.lastCellIndex(row);
633
- const cell = this.model.findCell(lastIndex, row);
634
- if (cell) {
635
- this.cursor.reset(cell.rowIndex, cell.colIndex);
636
- }
637
- else {
638
- this.cursor.reset(row.index, lastIndex);
639
- }
640
- }
641
- preventDefault = true;
642
- break;
643
- case Keys.Enter:
644
- case Keys.F2: {
645
- if (this.stackedCellEntered) {
646
- if (code === Keys.F2 && row.dataRowIndex > -1) {
647
- this.zone.run(() => {
648
- this.editService.beginEdit(row.dataRowIndex);
649
- });
650
- this.enterCell();
651
- }
652
- break;
653
- }
654
- const groupItem = row.groupItem;
655
- if (groupItem) {
656
- this.zone.run(() => this.groupsService.toggleRow(groupItem));
657
- }
658
- else if (this.cursor.cell.detailExpandCell) {
659
- this.zone.run(() => this.detailsService.toggleRow(row.dataRowIndex, row.dataItem));
660
- }
661
- else {
662
- if (code === Keys.F2 && row.dataRowIndex > -1) {
663
- this.zone.run(() => {
664
- this.editService.beginEdit(row.dataRowIndex);
665
- });
666
- }
667
- this.enterCell();
668
- if (!this.cursor.cell.focusGroup.isNavigable()) {
669
- preventDefault = true;
670
- }
671
- }
672
- break;
673
- }
674
- case Keys.Backspace:
675
- case Keys.Delete:
676
- if (this.activeRow && this.activeRow.dataRowIndex >= 0 && this.activeRow.dataItem) {
677
- if (!row.groupItem && !this.cursor.cell.detailExpandCell) {
678
- this.zone.run(() => {
679
- this.editService.remove(this.activeRow.dataRowIndex);
680
- });
681
- preventDefault = true;
682
- }
683
- }
684
- break;
685
- default:
686
- if (!args.ctrlKey && !args.altKey && isPrintableCharacter(args.key)) {
687
- this.enterCell();
688
- }
689
- }
690
- if (preventDefault) {
691
- args.preventDefault();
692
- }
693
- }
694
- columnResize(onRightArrow) {
695
- const column = this.ctx.grid.columnsContainer.allColumns.find((col) => col.level === this.activeCell.rowIndex && col.leafIndex === this.activeCell.colIndex);
696
- this.resizeService.start(column);
697
- this.resizeService.resizeColumns(onRightArrow ? resizeStep : -1 * resizeStep);
698
- if (this.resizeService.resizeColumns.length > 0) {
699
- this.resizeService.end();
700
- }
701
- }
702
- onContentKeydown(args) {
703
- if (!this.onCellKeydown(args)) {
704
- return;
705
- }
706
- // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
707
- const code = normalizeKeys(args);
708
- const confirm = !args.defaultPrevented && code === Keys.Enter && isTextInput(args.target);
709
- if (code === Keys.Escape || code === Keys.F2 || confirm) {
710
- if (this.tableCellEntered && code === Keys.F2 && this.activeRow.dataRowIndex > -1) {
711
- this.zone.run(() => {
712
- this.editService.beginEdit(this.activeRow.dataRowIndex);
713
- });
714
- this.enterCell();
715
- return;
716
- }
717
- this.leaveCell();
718
- this.cursor.reset();
719
- args.stopPropagation();
720
- }
721
- else if (isNavigationKey(code) && this.cursor.cell.focusGroup.isNavigable()) {
722
- this.onCursorKeydown(args);
723
- if (args.defaultPrevented) {
724
- this.leaveCell();
725
- }
726
- }
727
- }
728
- onCellKeydown(args) {
729
- if (this.editService.isEditingCell()) {
730
- // on some keyboards arrow keys, PageUp/Down, and Home/End are mapped to Numpad keys
731
- const code = normalizeKeys(args);
732
- const confirm = code === Keys.Enter;
733
- const cancel = code === Keys.Escape;
734
- const navigate = isNavigationKey(code);
735
- if (confirm) {
736
- this.editService.closeCell(args);
737
- }
738
- else if (cancel) {
739
- this.editService.closeCell(args);
740
- this.cd.detectChanges();
741
- }
742
- else if (navigate) {
743
- return false;
744
- }
745
- }
746
- this.cellKeydown.emit(args);
747
- return true;
748
- }
749
- onCursorChanges(args) {
750
- this.activeRowIndex = args.rowIndex;
751
- const dataRowIndex = this.activeDataRow;
752
- if (this.meta && (this.meta.isVirtual &&
753
- args.rowIndex >= this.meta.headerRows &&
754
- args.rowIndex <= this.meta.maxLogicalRowIndex - this.meta.footerRow &&
755
- this.viewport &&
756
- !this.viewport.containsRow(dataRowIndex) &&
757
- dataRowIndex > -1)) {
758
- this.scrollRequestService.scrollTo({ row: dataRowIndex });
759
- }
760
- if (this.meta.virtualColumns && args.colIndex >= this.meta.columns.lockedLeafColumns.length) {
761
- const cell = this.activeCell;
762
- const { start, end } = this.model.cellRange(cell);
763
- if (!cell) {
764
- this.virtualCell = true;
765
- }
766
- if ((!cell && this.mode !== 0 /* NavigationMode.Standby */) || (cell && !this.columnViewport.intersects(start, end))) {
767
- this.scrollRequestService.scrollTo({ column: args.colIndex - (this.metadata.hasDetailTemplate ? 1 : 0) });
768
- }
769
- }
770
- }
771
- onFocusOut(args) {
772
- if (isVisible(args.target)) {
773
- this.mode = 0 /* NavigationMode.Standby */;
774
- }
775
- else {
776
- // Focused target is no longer visible,
777
- // reset to cursor mode and recapture focus.
778
- this.mode = 1 /* NavigationMode.Cursor */;
779
- }
780
- this.deactivateElements();
781
- this.cursor.announce();
782
- }
783
- onWindowBlur() {
784
- this.mode = 0 /* NavigationMode.Standby */;
785
- this.deactivateElements();
786
- this.cursor.announce();
787
- }
788
- onKeydown(args) {
789
- if (this.isStackedMode) {
790
- this.handleStackedKeydown(args);
791
- if (args.defaultPrevented) {
792
- return;
793
- }
794
- }
795
- if (this.mode === 1 /* NavigationMode.Cursor */) {
796
- this.onCursorKeydown(args);
797
- }
798
- else if (this.mode === 2 /* NavigationMode.Content */) {
799
- this.onContentKeydown(args);
800
- }
801
- }
802
- onTabout() {
803
- // Tabbed out of the last focusable content element
804
- // reset to cursor mode and recapture focus.
805
- if (this.cursor.cell?.focusGroup.isNavigable()) {
806
- // Unless the cell has a single focusable element,
807
- // otherwise we'd return to Content mode and enter an endless loop
808
- return;
809
- }
810
- this.leaveCell();
811
- this.cursor.reset();
812
- }
813
- handleVerticalArrowSelection(args, preserveSelection) {
814
- const cellSelectionEnabled = this.ctx.grid.cellSelectionService.active;
815
- const rowSelectionEnabled = this.ctx.grid.selectionService.active && !this.ctx.grid.selectableSettings.checkboxOnly;
816
- if (cellSelectionEnabled || rowSelectionEnabled) {
817
- const selectionService = this.ctx.grid[cellSelectionEnabled ? 'cellSelectionService' : 'selectionService'];
818
- const colIdx = this.cursor.cell ? this.cursor.cell.colIndex : 0;
819
- const rowIdx = this.activeRow.dataRowIndex - this.ctx.grid.skip;
820
- const dataItem = selectionService.settings.view.at(rowIdx);
821
- const item = { index: this.activeRow.dataRowIndex, data: dataItem, column: this.ctx.grid.columnsContainer.leafColumnsToRender[colIdx] };
822
- if (selectionService.options.mode === 'multiple') {
823
- const startRowIndex = this.activeRow.dataRowIndex - args;
824
- cellSelectionEnabled ? this.handleMultipleArrowCellSelection(item, preserveSelection, startRowIndex, colIdx) : this.handleMultipleArrowRowSelection(item, preserveSelection, startRowIndex);
825
- }
826
- else {
827
- selectionService.handleClick(item, args);
828
- }
829
- }
830
- }
831
- handleHorizontalArrowSelection(args, preserveSelection) {
832
- const cellSelectionEnabled = this.ctx.grid.cellSelectionService.active;
833
- if (cellSelectionEnabled) {
834
- const selectionService = this.ctx.grid[cellSelectionEnabled ? 'cellSelectionService' : 'selectionService'];
835
- const row = this.activeRow;
836
- const colIdx = this.cursor.cell ? this.cursor.cell.colIndex : 0;
837
- const dataItem = selectionService.settings.view.at(row.dataRowIndex - this.ctx.grid.skip);
838
- const item = { index: row.dataRowIndex, data: dataItem, column: this.ctx.grid.columnsContainer.leafColumnsToRender[colIdx] };
839
- if (!isPresent(dataItem) || !isPresent(item.column)) {
840
- return;
841
- }
842
- if (selectionService.options.mode === 'multiple') {
843
- const startColumnIndex = args.key === 'ArrowRight' ? colIdx - 1 : colIdx + 1;
844
- this.handleMultipleArrowCellSelection(item, preserveSelection, row.dataRowIndex, startColumnIndex);
845
- }
846
- else {
847
- selectionService.handleClick(item, args);
848
- }
849
- }
850
- }
851
- handleMultipleArrowCellSelection(item, preserveSelection, startRow, startColumn) {
852
- const cellSelectionService = this.ctx.grid.cellSelectionService;
853
- const startRowIndex = preserveSelection ? startRow : Math.min(cellSelectionService.lastSelectionItemRowIndex, item.index);
854
- const startColIndex = preserveSelection ? startColumn : Math.min(cellSelectionService.lastSelectionItemColIndex, item.column.leafIndex);
855
- const endRowIndex = preserveSelection ? item.index : Math.max(cellSelectionService.lastSelectionItemRowIndex, item.index);
856
- const endColIndex = preserveSelection ? item.column.leafIndex : Math.max(cellSelectionService.lastSelectionItemColIndex, item.column.leafIndex);
857
- if (preserveSelection) {
858
- cellSelectionService.lastSelectionItemRowIndex = startRow;
859
- cellSelectionService.lastSelectionItemColIndex = startColumn;
860
- this.currentSelection = cellSelectionService.currentSelection;
861
- }
862
- const ev = cellSelectionService.selectRange(startRowIndex, startColIndex, endRowIndex, endColIndex, preserveSelection, this.currentSelection);
863
- cellSelectionService.changes.emit(ev);
864
- }
865
- handleMultipleArrowRowSelection(item, preserveSelection, startRow) {
866
- const rowSelectionService = this.ctx.grid.selectionService;
867
- const startRowIndex = preserveSelection ? startRow : Math.min(rowSelectionService.lastSelectionStartIndex, item.index);
868
- const endRowIndex = preserveSelection ? item.index : Math.max(rowSelectionService.lastSelectionStartIndex, item.index);
869
- if (preserveSelection) {
870
- rowSelectionService.lastSelectionStartIndex = startRow;
871
- this.currentSelection = rowSelectionService.currentSelection;
872
- }
873
- const ev = rowSelectionService.selectRange(startRowIndex, endRowIndex, preserveSelection, this.currentSelection);
874
- rowSelectionService.changes.emit(ev);
875
- }
876
- calculateRowspanOffset(direction, cellRowspan) {
877
- if (!isPresent(this.lastCellRowIndex)) {
878
- return 0;
879
- }
880
- const offset = direction === 'Up' ? Math.abs(this.lastCellRowIndex - this.activeRowIndex) : (this.activeRowIndex + cellRowspan - this.lastCellRowIndex - 1);
881
- return offset;
882
- }
883
- get isStackedMode() {
884
- return this.ctx?.grid?.isStacked;
885
- }
886
- handleRowReorderKeyboard(args, code, row) {
887
- if (!this.ctx.grid.rowReorderable || !this.activeCell) {
888
- return false;
889
- }
890
- const cell = this.activeCell;
891
- const cellElement = args.target;
892
- if (!cellElement) {
893
- return false;
894
- }
895
- const dragCell = closest(cellElement, (el) => hasClasses(el, 'k-drag-cell'));
896
- if (!dragCell || row.dataRowIndex < 0 || !row.dataItem) {
897
- return false;
898
- }
899
- const isUpArrow = code === Keys.ArrowUp;
900
- const currentRowIndex = row.dataRowIndex;
901
- const data = this.ctx.grid.flatData;
902
- if (!data || data.length === 0) {
903
- return false;
904
- }
905
- const targetRowIndex = currentRowIndex + (isUpArrow ? -1 : 1);
906
- if (targetRowIndex < 0 || targetRowIndex >= data.length) {
907
- return false;
908
- }
909
- const dropPosition = isUpArrow ? 'before' : 'after';
910
- this.zone.run(() => {
911
- const skip = this.ctx.grid.skip || 0;
912
- this.ctx.grid.rowReorderService.reorderViaKeyboard(currentRowIndex + skip, targetRowIndex + skip, dropPosition, data);
913
- // Move focus to follow the reordered row
914
- // After reordering, the row will be at the target position
915
- this.zone.onStable.pipe(take(1)).subscribe(() => {
916
- const newRowIndex = this.meta.headerRows + targetRowIndex;
917
- this.cursor.reset(newRowIndex, cell.colIndex);
918
- });
919
- });
920
- return true;
921
- }
922
- handleStackedKeydown(args) {
923
- const target = args.target;
924
- const stackedCell = closest(target, (el) => hasClasses(el, 'k-grid-stack-cell'));
925
- const tableCell = closest(target, (el) => hasClasses(el, 'k-table-td'));
926
- const isInStackedCell = closest(target, (el) => hasClasses(el, 'k-grid-stack-content'));
927
- const isInCommandCell = closest(target, (el) => hasClasses(el, 'k-command-cell'));
928
- if (!stackedCell || !tableCell) {
929
- return;
930
- }
931
- if (args.code === Keys.Tab) {
932
- this.handleStackedTabNavigation(args);
933
- }
934
- else if (args.code === Keys.Backspace || args.code === Keys.Delete) {
935
- if (this.stackedCellEntered || this.editService.isEditing()) {
936
- return;
937
- }
938
- if (this.activeRow && this.activeRow.dataRowIndex >= 0 && this.activeRow.dataItem) {
939
- const row = this.cursor.row;
940
- if (!row.groupItem && !this.cursor.cell.detailExpandCell) {
941
- this.zone.run(() => {
942
- this.editService.remove(this.activeRow.dataRowIndex);
943
- });
944
- args.preventDefault();
945
- }
946
- }
947
- }
948
- else if (isInStackedCell && (args.code === Keys.Enter || args.code === Keys.NumpadEnter || args.code === Keys.Escape)) {
949
- this.editService.closeCell(args);
950
- this.activeCell.focusGroup.activate();
951
- this.activeCell.focusGroup.focusableChildren[this.stackedFocusedCellIndex]?.focus();
952
- if (!isInCommandCell) {
953
- args.preventDefault();
954
- }
955
- }
956
- }
957
- stackedFocusedCellIndex = -1;
958
- tableCellEntered = false;
959
- stackedCellEntered = false;
960
- handleStackedTabNavigation(args) {
961
- if (!isPresent(this.activeCell?.focusGroup)) {
962
- return;
963
- }
964
- if (this.stackedFocusedCellIndex === -1) {
965
- return;
966
- }
967
- const stackedCells = this.activeCell?.focusGroup?.focusableChildren;
968
- if (!isPresent(stackedCells) || stackedCells.length === 0) {
969
- return;
970
- }
971
- const currFocusedIndex = stackedCells.findIndex(el => el.hasFocus() || el.hostElement?.nativeElement === document.activeElement);
972
- if (args.shiftKey) {
973
- if (currFocusedIndex === 0) {
974
- args.stopImmediatePropagation();
975
- args.preventDefault();
976
- }
977
- else {
978
- this.stackedFocusedCellIndex = currFocusedIndex - 1;
979
- }
980
- }
981
- else {
982
- if (currFocusedIndex === stackedCells.length - 1) {
983
- args.stopImmediatePropagation();
984
- args.preventDefault();
985
- }
986
- else {
987
- this.stackedFocusedCellIndex = currFocusedIndex + 1;
988
- }
989
- }
990
- }
991
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, deps: [{ token: i0.NgZone }, { token: i1.DomEventsService }, { token: i2.PagerContextService }, { token: i3.ScrollRequestService }, { token: i4.GroupsService }, { token: i5.DetailsService }, { token: i6.FocusRoot }, { token: i7.EditService }, { token: i0.ChangeDetectorRef }, { token: i8.ContextService }, { token: i9.ColumnResizingService }, { token: i10.FocusableDirective, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
992
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService });
993
- }
994
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, decorators: [{
995
- type: Injectable
996
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: i1.DomEventsService }, { type: i2.PagerContextService }, { type: i3.ScrollRequestService }, { type: i4.GroupsService }, { type: i5.DetailsService }, { type: i6.FocusRoot }, { type: i7.EditService }, { type: i0.ChangeDetectorRef }, { type: i8.ContextService }, { type: i9.ColumnResizingService }, { type: i10.FocusableDirective, decorators: [{
997
- type: Optional
998
- }] }] });