handsontable 15.3.0 → 16.0.0-next-f486b48-20250702

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 (277) hide show
  1. package/3rdparty/walkontable/src/core/_base.js +0 -3
  2. package/3rdparty/walkontable/src/core/_base.mjs +0 -3
  3. package/3rdparty/walkontable/src/core/clone.js +0 -1
  4. package/3rdparty/walkontable/src/core/clone.mjs +0 -1
  5. package/3rdparty/walkontable/src/core/core.js +0 -2
  6. package/3rdparty/walkontable/src/core/core.mjs +0 -2
  7. package/3rdparty/walkontable/src/facade/core.js +0 -3
  8. package/3rdparty/walkontable/src/facade/core.mjs +0 -3
  9. package/3rdparty/walkontable/src/index.js +1 -2
  10. package/3rdparty/walkontable/src/overlay/_base.js +1 -3
  11. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -3
  12. package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
  13. package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
  14. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  15. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  16. package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
  17. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
  18. package/3rdparty/walkontable/src/selection/border/border.js +17 -11
  19. package/3rdparty/walkontable/src/selection/border/border.mjs +17 -11
  20. package/3rdparty/walkontable/src/selection/border/utils.js +1 -1
  21. package/3rdparty/walkontable/src/selection/border/utils.mjs +1 -1
  22. package/3rdparty/walkontable/src/settings.js +3 -1
  23. package/3rdparty/walkontable/src/settings.mjs +3 -1
  24. package/3rdparty/walkontable/src/table.js +9 -6
  25. package/3rdparty/walkontable/src/table.mjs +9 -6
  26. package/3rdparty/walkontable/src/types.js +0 -1
  27. package/3rdparty/walkontable/src/types.mjs +0 -1
  28. package/3rdparty/walkontable/src/utils/column.js +1 -1
  29. package/3rdparty/walkontable/src/utils/column.mjs +1 -1
  30. package/3rdparty/walkontable/src/viewport.js +1 -1
  31. package/3rdparty/walkontable/src/viewport.mjs +1 -1
  32. package/CHANGELOG.md +53 -31
  33. package/README.md +10 -4
  34. package/base.js +2 -2
  35. package/base.mjs +2 -2
  36. package/cellTypes/registry.js +2 -3
  37. package/cellTypes/registry.mjs +1 -1
  38. package/core/coordsMapper/rangeToRenderableMapper.js +124 -0
  39. package/core/coordsMapper/rangeToRenderableMapper.mjs +120 -0
  40. package/core/focusCatcher/focusDetector.js +2 -2
  41. package/core/focusCatcher/focusDetector.mjs +2 -2
  42. package/core/hooks/constants.js +259 -1
  43. package/core/hooks/constants.mjs +259 -1
  44. package/core.d.ts +2 -0
  45. package/core.js +202 -58
  46. package/core.mjs +202 -58
  47. package/dataMap/dataMap.js +16 -30
  48. package/dataMap/dataMap.mjs +16 -30
  49. package/dataMap/metaManager/metaSchema.js +58 -0
  50. package/dataMap/metaManager/metaSchema.mjs +58 -0
  51. package/dist/handsontable.css +30 -4
  52. package/dist/handsontable.full.css +30 -4
  53. package/dist/handsontable.full.js +6073 -4352
  54. package/dist/handsontable.full.min.css +3 -3
  55. package/dist/handsontable.full.min.js +206 -206
  56. package/dist/handsontable.js +5751 -4037
  57. package/dist/handsontable.min.css +3 -3
  58. package/dist/handsontable.min.js +41 -41
  59. package/dist/languages/all.min.js +1 -1
  60. package/dist/languages/ar-AR.min.js +1 -1
  61. package/dist/languages/cs-CZ.min.js +1 -1
  62. package/dist/languages/de-CH.min.js +1 -1
  63. package/dist/languages/de-DE.min.js +1 -1
  64. package/dist/languages/en-US.min.js +1 -1
  65. package/dist/languages/es-MX.min.js +1 -1
  66. package/dist/languages/fa-IR.min.js +1 -1
  67. package/dist/languages/fr-FR.min.js +1 -1
  68. package/dist/languages/hr-HR.min.js +1 -1
  69. package/dist/languages/it-IT.min.js +1 -1
  70. package/dist/languages/ja-JP.min.js +1 -1
  71. package/dist/languages/ko-KR.min.js +1 -1
  72. package/dist/languages/lv-LV.min.js +1 -1
  73. package/dist/languages/nb-NO.min.js +1 -1
  74. package/dist/languages/nl-NL.min.js +1 -1
  75. package/dist/languages/pl-PL.min.js +1 -1
  76. package/dist/languages/pt-BR.min.js +1 -1
  77. package/dist/languages/ru-RU.min.js +1 -1
  78. package/dist/languages/sr-SP.min.js +1 -1
  79. package/dist/languages/zh-CN.min.js +1 -1
  80. package/dist/languages/zh-TW.min.js +1 -1
  81. package/editorManager.js +5 -1
  82. package/editorManager.mjs +5 -1
  83. package/editors/autocompleteEditor/autocompleteEditor.d.ts +0 -12
  84. package/editors/autocompleteEditor/autocompleteEditor.js +42 -69
  85. package/editors/autocompleteEditor/autocompleteEditor.mjs +43 -70
  86. package/editors/baseEditor/baseEditor.js +1 -1
  87. package/editors/baseEditor/baseEditor.mjs +1 -1
  88. package/editors/dateEditor/dateEditor.js +2 -8
  89. package/editors/dateEditor/dateEditor.mjs +3 -9
  90. package/editors/handsontableEditor/handsontableEditor.d.ts +8 -0
  91. package/editors/handsontableEditor/handsontableEditor.js +173 -17
  92. package/editors/handsontableEditor/handsontableEditor.mjs +173 -17
  93. package/editors/passwordEditor/passwordEditor.js +2 -0
  94. package/editors/passwordEditor/passwordEditor.mjs +2 -0
  95. package/editors/registry.js +2 -3
  96. package/editors/registry.mjs +1 -1
  97. package/editors/textEditor/textEditor.js +2 -0
  98. package/editors/textEditor/textEditor.mjs +2 -0
  99. package/helpers/a11y.js +2 -0
  100. package/helpers/a11y.mjs +1 -0
  101. package/helpers/dom/element.d.ts +1 -0
  102. package/helpers/dom/element.js +26 -1
  103. package/helpers/dom/element.mjs +25 -1
  104. package/helpers/mixed.js +4 -4
  105. package/helpers/mixed.mjs +4 -4
  106. package/i18n/languages/ar-AR.js +1 -2
  107. package/i18n/languages/cs-CZ.js +1 -2
  108. package/i18n/languages/de-CH.js +1 -2
  109. package/i18n/languages/de-DE.js +1 -2
  110. package/i18n/languages/en-US.js +1 -2
  111. package/i18n/languages/es-MX.js +1 -2
  112. package/i18n/languages/fa-IR.js +1 -2
  113. package/i18n/languages/fr-FR.js +1 -2
  114. package/i18n/languages/hr-HR.js +1 -2
  115. package/i18n/languages/it-IT.js +1 -2
  116. package/i18n/languages/ja-JP.js +1 -2
  117. package/i18n/languages/ko-KR.js +1 -2
  118. package/i18n/languages/lv-LV.js +1 -2
  119. package/i18n/languages/nb-NO.js +1 -2
  120. package/i18n/languages/nl-NL.js +1 -2
  121. package/i18n/languages/pl-PL.js +1 -2
  122. package/i18n/languages/pt-BR.js +1 -2
  123. package/i18n/languages/ru-RU.js +1 -2
  124. package/i18n/languages/sr-SP.js +1 -2
  125. package/i18n/languages/zh-CN.js +1 -2
  126. package/i18n/languages/zh-TW.js +1 -2
  127. package/i18n/phraseFormatters/index.js +2 -2
  128. package/i18n/phraseFormatters/index.mjs +1 -1
  129. package/i18n/registry.js +3 -4
  130. package/i18n/registry.mjs +1 -1
  131. package/index.js +1 -2
  132. package/package.json +10 -4
  133. package/plugins/autoColumnSize/autoColumnSize.js +47 -0
  134. package/plugins/autoColumnSize/autoColumnSize.mjs +47 -0
  135. package/plugins/autoRowSize/autoRowSize.js +45 -0
  136. package/plugins/autoRowSize/autoRowSize.mjs +45 -0
  137. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +13 -0
  138. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +13 -0
  139. package/plugins/collapsibleColumns/collapsibleColumns.js +31 -0
  140. package/plugins/collapsibleColumns/collapsibleColumns.mjs +31 -0
  141. package/plugins/columnSorting/sortService/registry.js +3 -4
  142. package/plugins/columnSorting/sortService/registry.mjs +1 -1
  143. package/plugins/columnSummary/columnSummary.js +33 -0
  144. package/plugins/columnSummary/columnSummary.mjs +33 -0
  145. package/plugins/comments/commentEditor.js +8 -2
  146. package/plugins/comments/commentEditor.mjs +8 -2
  147. package/plugins/comments/comments.js +59 -15
  148. package/plugins/comments/comments.mjs +60 -16
  149. package/plugins/comments/contextMenuItem/addEditComment.js +1 -2
  150. package/plugins/comments/contextMenuItem/readOnlyComment.js +1 -2
  151. package/plugins/comments/contextMenuItem/removeComment.js +1 -2
  152. package/plugins/contextMenu/contextMenu.js +1 -1
  153. package/plugins/contextMenu/contextMenu.mjs +1 -1
  154. package/plugins/contextMenu/menu/menu.js +12 -6
  155. package/plugins/contextMenu/menu/menu.mjs +13 -7
  156. package/plugins/contextMenu/predefinedItems/alignment.js +1 -2
  157. package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -2
  158. package/plugins/contextMenu/predefinedItems/columnLeft.js +1 -2
  159. package/plugins/contextMenu/predefinedItems/columnRight.js +1 -2
  160. package/plugins/contextMenu/predefinedItems/index.js +1 -2
  161. package/plugins/contextMenu/predefinedItems/readOnly.js +1 -2
  162. package/plugins/contextMenu/predefinedItems/redo.js +1 -2
  163. package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -2
  164. package/plugins/contextMenu/predefinedItems/removeRow.js +1 -2
  165. package/plugins/contextMenu/predefinedItems/rowAbove.js +1 -2
  166. package/plugins/contextMenu/predefinedItems/rowBelow.js +1 -2
  167. package/plugins/contextMenu/predefinedItems/undo.js +1 -2
  168. package/plugins/copyPaste/contextMenuItem/cut.js +1 -2
  169. package/plugins/customBorders/contextMenuItem/bottom.js +1 -2
  170. package/plugins/customBorders/contextMenuItem/left.js +1 -2
  171. package/plugins/customBorders/contextMenuItem/noBorders.js +1 -2
  172. package/plugins/customBorders/contextMenuItem/right.js +1 -2
  173. package/plugins/customBorders/contextMenuItem/top.js +1 -2
  174. package/plugins/customBorders/customBorders.js +1 -2
  175. package/plugins/dropdownMenu/dropdownMenu.js +16 -1
  176. package/plugins/dropdownMenu/dropdownMenu.mjs +16 -1
  177. package/plugins/exportFile/exportFile.js +59 -2
  178. package/plugins/exportFile/exportFile.mjs +58 -0
  179. package/plugins/filters/component/actionBar.js +1 -2
  180. package/plugins/filters/component/condition.js +1 -2
  181. package/plugins/filters/component/value.js +1 -2
  182. package/plugins/filters/condition/beginsWith.js +1 -2
  183. package/plugins/filters/condition/between.js +1 -2
  184. package/plugins/filters/condition/contains.js +1 -2
  185. package/plugins/filters/condition/date/after.js +1 -2
  186. package/plugins/filters/condition/date/before.js +1 -2
  187. package/plugins/filters/condition/date/today.js +1 -2
  188. package/plugins/filters/condition/date/tomorrow.js +1 -2
  189. package/plugins/filters/condition/date/yesterday.js +1 -2
  190. package/plugins/filters/condition/empty.js +1 -2
  191. package/plugins/filters/condition/endsWith.js +1 -2
  192. package/plugins/filters/condition/equal.js +1 -2
  193. package/plugins/filters/condition/greaterThan.js +1 -2
  194. package/plugins/filters/condition/greaterThanOrEqual.js +1 -2
  195. package/plugins/filters/condition/lessThan.js +1 -2
  196. package/plugins/filters/condition/lessThanOrEqual.js +1 -2
  197. package/plugins/filters/condition/none.js +1 -2
  198. package/plugins/filters/condition/notBetween.js +1 -2
  199. package/plugins/filters/condition/notContains.js +1 -2
  200. package/plugins/filters/condition/notEmpty.js +1 -2
  201. package/plugins/filters/condition/notEqual.js +1 -2
  202. package/plugins/filters/filters.js +76 -3
  203. package/plugins/filters/filters.mjs +75 -1
  204. package/plugins/filters/logicalOperations/conjunction.js +1 -2
  205. package/plugins/filters/logicalOperations/disjunction.js +1 -2
  206. package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +1 -2
  207. package/plugins/filters/ui/_base.js +1 -2
  208. package/plugins/filters/ui/multipleSelect.js +1 -7
  209. package/plugins/filters/ui/multipleSelect.mjs +0 -5
  210. package/plugins/filters/ui/select.js +1 -2
  211. package/plugins/formulas/engine/register.js +3 -4
  212. package/plugins/formulas/engine/register.mjs +1 -1
  213. package/plugins/formulas/formulas.js +40 -41
  214. package/plugins/formulas/formulas.mjs +39 -40
  215. package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -2
  216. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -2
  217. package/plugins/hiddenColumns/hiddenColumns.js +64 -0
  218. package/plugins/hiddenColumns/hiddenColumns.mjs +64 -0
  219. package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -2
  220. package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -2
  221. package/plugins/hiddenRows/hiddenRows.js +64 -0
  222. package/plugins/hiddenRows/hiddenRows.mjs +64 -0
  223. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -2
  224. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -2
  225. package/plugins/manualRowMove/manualRowMove.js +1 -1
  226. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  227. package/plugins/manualRowResize/manualRowResize.js +1 -1
  228. package/plugins/manualRowResize/manualRowResize.mjs +1 -1
  229. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -2
  230. package/plugins/mergeCells/mergeCells.js +56 -38
  231. package/plugins/mergeCells/mergeCells.mjs +56 -38
  232. package/plugins/mergeCells/utils.js +3 -4
  233. package/plugins/mergeCells/utils.mjs +3 -4
  234. package/plugins/nestedHeaders/nestedHeaders.js +37 -12
  235. package/plugins/nestedHeaders/nestedHeaders.mjs +37 -12
  236. package/plugins/nestedRows/nestedRows.js +12 -12
  237. package/plugins/nestedRows/nestedRows.mjs +12 -12
  238. package/plugins/nestedRows/ui/contextMenu.js +1 -2
  239. package/plugins/nestedRows/ui/headers.js +2 -3
  240. package/plugins/nestedRows/ui/headers.mjs +2 -3
  241. package/plugins/persistentState/persistentState.js +1 -1
  242. package/plugins/persistentState/persistentState.mjs +1 -1
  243. package/plugins/stretchColumns/calculator.js +3 -2
  244. package/plugins/stretchColumns/calculator.mjs +3 -2
  245. package/plugins/stretchColumns/stretchColumns.js +13 -0
  246. package/plugins/stretchColumns/stretchColumns.mjs +13 -0
  247. package/plugins/trimRows/trimRows.js +61 -0
  248. package/plugins/trimRows/trimRows.mjs +61 -0
  249. package/renderers/baseRenderer/baseRenderer.js +4 -0
  250. package/renderers/baseRenderer/baseRenderer.mjs +4 -0
  251. package/renderers/registry.js +2 -3
  252. package/renderers/registry.mjs +1 -1
  253. package/selection/mouseEventHandler.js +48 -13
  254. package/selection/mouseEventHandler.mjs +47 -13
  255. package/selection/range.js +73 -6
  256. package/selection/range.mjs +73 -6
  257. package/selection/selection.js +46 -32
  258. package/selection/selection.mjs +45 -30
  259. package/settings.d.ts +1 -0
  260. package/styles/handsontable.css +131 -55
  261. package/styles/handsontable.min.css +3 -3
  262. package/styles/ht-theme-horizon.css +296 -181
  263. package/styles/ht-theme-horizon.min.css +3 -3
  264. package/styles/ht-theme-main.css +314 -205
  265. package/styles/ht-theme-main.min.css +3 -3
  266. package/tableView.js +9 -20
  267. package/tableView.mjs +9 -20
  268. package/translations/indexMapper.js +9 -5
  269. package/translations/indexMapper.mjs +9 -5
  270. package/utils/paginator.js +13 -0
  271. package/utils/paginator.mjs +13 -0
  272. package/utils/staticRegister.js +24 -2
  273. package/utils/staticRegister.mjs +23 -2
  274. package/{3rdparty/walkontable/src/utils → utils}/stylesHandler.js +16 -30
  275. package/{3rdparty/walkontable/src/utils → utils}/stylesHandler.mjs +16 -30
  276. package/validators/registry.js +2 -3
  277. package/validators/registry.mjs +1 -1
@@ -127,6 +127,53 @@ const COLUMN_SIZE_MAP_NAME = 'autoColumnSize';
127
127
  * }
128
128
  * ```
129
129
  * :::
130
+ *
131
+ * ::: only-for angular
132
+ *
133
+ * ```ts
134
+ * import { AfterViewInit, Component, ViewChild } from "@angular/core";
135
+ * import {
136
+ * GridSettings,
137
+ * HotTableModule,
138
+ * HotTableComponent,
139
+ * } from "@handsontable/angular-wrapper";
140
+ *
141
+ * `@Component`({
142
+ * selector: "app-example",
143
+ * standalone: true,
144
+ * imports: [HotTableModule],
145
+ * template: ` <div>
146
+ * <hot-table themeName="ht-theme-main" [settings]="gridSettings" />
147
+ * </div>`,
148
+ * })
149
+ * export class ExampleComponent implements AfterViewInit {
150
+ * `@ViewChild`(HotTableComponent, { static: false })
151
+ * readonly hotTable!: HotTableComponent;
152
+ *
153
+ * readonly gridSettings = <GridSettings>{
154
+ * data: this.getData(),
155
+ * autoColumnSize: true,
156
+ * };
157
+ *
158
+ * ngAfterViewInit(): void {
159
+ * // Access to plugin instance:
160
+ * const hot = this.hotTable.hotInstance;
161
+ * const plugin = hot.getPlugin("autoColumnSize");
162
+ *
163
+ * plugin.getColumnWidth(4);
164
+ *
165
+ * if (plugin.isEnabled()) {
166
+ * // code...
167
+ * }
168
+ * }
169
+ *
170
+ * private getData(): any[] {
171
+ * //get some data
172
+ * }
173
+ * }
174
+ * ```
175
+ *
176
+ * :::
130
177
  */
131
178
  /* eslint-enable jsdoc/require-description-complete-sentence */
132
179
  var _isInitialized = /*#__PURE__*/new WeakMap();
@@ -123,6 +123,53 @@ const COLUMN_SIZE_MAP_NAME = 'autoColumnSize';
123
123
  * }
124
124
  * ```
125
125
  * :::
126
+ *
127
+ * ::: only-for angular
128
+ *
129
+ * ```ts
130
+ * import { AfterViewInit, Component, ViewChild } from "@angular/core";
131
+ * import {
132
+ * GridSettings,
133
+ * HotTableModule,
134
+ * HotTableComponent,
135
+ * } from "@handsontable/angular-wrapper";
136
+ *
137
+ * `@Component`({
138
+ * selector: "app-example",
139
+ * standalone: true,
140
+ * imports: [HotTableModule],
141
+ * template: ` <div>
142
+ * <hot-table themeName="ht-theme-main" [settings]="gridSettings" />
143
+ * </div>`,
144
+ * })
145
+ * export class ExampleComponent implements AfterViewInit {
146
+ * `@ViewChild`(HotTableComponent, { static: false })
147
+ * readonly hotTable!: HotTableComponent;
148
+ *
149
+ * readonly gridSettings = <GridSettings>{
150
+ * data: this.getData(),
151
+ * autoColumnSize: true,
152
+ * };
153
+ *
154
+ * ngAfterViewInit(): void {
155
+ * // Access to plugin instance:
156
+ * const hot = this.hotTable.hotInstance;
157
+ * const plugin = hot.getPlugin("autoColumnSize");
158
+ *
159
+ * plugin.getColumnWidth(4);
160
+ *
161
+ * if (plugin.isEnabled()) {
162
+ * // code...
163
+ * }
164
+ * }
165
+ *
166
+ * private getData(): any[] {
167
+ * //get some data
168
+ * }
169
+ * }
170
+ * ```
171
+ *
172
+ * :::
126
173
  */
127
174
  /* eslint-enable jsdoc/require-description-complete-sentence */
128
175
  var _isInitialized = /*#__PURE__*/new WeakMap();
@@ -110,6 +110,51 @@ const ROW_WIDTHS_MAP_NAME = 'autoRowSize';
110
110
  * }
111
111
  * ```
112
112
  * :::
113
+ *
114
+ * ::: only-for angular
115
+ * ```ts
116
+ * import { AfterViewInit, Component, ViewChild } from "@angular/core";
117
+ * import {
118
+ * GridSettings,
119
+ * HotTableModule,
120
+ * HotTableComponent,
121
+ * } from "@handsontable/angular-wrapper";
122
+ *
123
+ * `@Component`({
124
+ * selector: "app-example",
125
+ * standalone: true,
126
+ * imports: [HotTableModule],
127
+ * template: ` <div>
128
+ * <hot-table themeName="ht-theme-main" [settings]="gridSettings" />
129
+ * </div>`,
130
+ * })
131
+ * export class ExampleComponent implements AfterViewInit {
132
+ * `@ViewChild`(HotTableComponent, { static: false })
133
+ * readonly hotTable!: HotTableComponent;
134
+ *
135
+ * readonly gridSettings = <GridSettings>{
136
+ * data: this.getData(),
137
+ * autoRowSize: true,
138
+ * };
139
+ *
140
+ * ngAfterViewInit(): void {
141
+ * // Access to plugin instance:
142
+ * const hot = this.hotTable.hotInstance;
143
+ * const plugin = hot.getPlugin("autoRowSize");
144
+ *
145
+ * plugin.getRowHeight(4);
146
+ *
147
+ * if (plugin.isEnabled()) {
148
+ * // code...
149
+ * }
150
+ * }
151
+ *
152
+ * private getData(): any[] {
153
+ * // get some data
154
+ * }
155
+ * }
156
+ * ```
157
+ * :::
113
158
  */
114
159
  /* eslint-enable jsdoc/require-description-complete-sentence */
115
160
  var _visualRowsToRefresh = /*#__PURE__*/new WeakMap();
@@ -106,6 +106,51 @@ const ROW_WIDTHS_MAP_NAME = 'autoRowSize';
106
106
  * }
107
107
  * ```
108
108
  * :::
109
+ *
110
+ * ::: only-for angular
111
+ * ```ts
112
+ * import { AfterViewInit, Component, ViewChild } from "@angular/core";
113
+ * import {
114
+ * GridSettings,
115
+ * HotTableModule,
116
+ * HotTableComponent,
117
+ * } from "@handsontable/angular-wrapper";
118
+ *
119
+ * `@Component`({
120
+ * selector: "app-example",
121
+ * standalone: true,
122
+ * imports: [HotTableModule],
123
+ * template: ` <div>
124
+ * <hot-table themeName="ht-theme-main" [settings]="gridSettings" />
125
+ * </div>`,
126
+ * })
127
+ * export class ExampleComponent implements AfterViewInit {
128
+ * `@ViewChild`(HotTableComponent, { static: false })
129
+ * readonly hotTable!: HotTableComponent;
130
+ *
131
+ * readonly gridSettings = <GridSettings>{
132
+ * data: this.getData(),
133
+ * autoRowSize: true,
134
+ * };
135
+ *
136
+ * ngAfterViewInit(): void {
137
+ * // Access to plugin instance:
138
+ * const hot = this.hotTable.hotInstance;
139
+ * const plugin = hot.getPlugin("autoRowSize");
140
+ *
141
+ * plugin.getRowHeight(4);
142
+ *
143
+ * if (plugin.isEnabled()) {
144
+ * // code...
145
+ * }
146
+ * }
147
+ *
148
+ * private getData(): any[] {
149
+ * // get some data
150
+ * }
151
+ * }
152
+ * ```
153
+ * :::
109
154
  */
110
155
  /* eslint-enable jsdoc/require-description-complete-sentence */
111
156
  var _visualRowsToRefresh = /*#__PURE__*/new WeakMap();
@@ -48,6 +48,19 @@ const bindTypeToMapStrategy = new Map([['loose', _looseBindsMap.default], ['stri
48
48
  * />
49
49
  * ```
50
50
  * :::
51
+ *
52
+ * ::: only-for angular
53
+ * ```ts
54
+ * settings = {
55
+ * data: getData(),
56
+ * bindRowsWithHeaders: true,
57
+ * };
58
+ * ```
59
+ *
60
+ * ```html
61
+ * <hot-table [settings]="settings" />
62
+ * ```
63
+ * :::
51
64
  */
52
65
  var _BindRowsWithHeaders_brand = /*#__PURE__*/new WeakSet();
53
66
  class BindRowsWithHeaders extends _base.BasePlugin {
@@ -44,6 +44,19 @@ const bindTypeToMapStrategy = new Map([['loose', LooseBindsMap], ['strict', Stri
44
44
  * />
45
45
  * ```
46
46
  * :::
47
+ *
48
+ * ::: only-for angular
49
+ * ```ts
50
+ * settings = {
51
+ * data: getData(),
52
+ * bindRowsWithHeaders: true,
53
+ * };
54
+ * ```
55
+ *
56
+ * ```html
57
+ * <hot-table [settings]="settings" />
58
+ * ```
59
+ * :::
47
60
  */
48
61
  var _BindRowsWithHeaders_brand = /*#__PURE__*/new WeakSet();
49
62
  export class BindRowsWithHeaders extends BasePlugin {
@@ -105,6 +105,37 @@ const actionDictionary = new Map([['collapse', {
105
105
  * />
106
106
  * ```
107
107
  * :::
108
+ *
109
+ * ::: only-for angular
110
+ * ```ts
111
+ * // Enable the collapsibleColumns plugin
112
+ * settings = {
113
+ * data: generateDataObj(),
114
+ * colHeaders: true,
115
+ * rowHeaders: true,
116
+ * nestedHeaders: true,
117
+ * // enable plugin
118
+ * collapsibleColumns: true,
119
+ * };
120
+ *
121
+ * // Or enable and configure specific collapsible columns
122
+ * settings = {
123
+ * data: generateDataObj(),
124
+ * colHeaders: true,
125
+ * rowHeaders: true,
126
+ * nestedHeaders: true,
127
+ * // enable and configure which columns can be collapsed
128
+ * collapsibleColumns: [
129
+ * { row: -4, col: 1, collapsible: true },
130
+ * { row: -3, col: 5, collapsible: true },
131
+ * ],
132
+ * };
133
+ * ```
134
+ *
135
+ * ```html
136
+ * <hot-table [settings]="settings"></hot-table>
137
+ * ```
138
+ * :::
108
139
  */
109
140
  var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
110
141
  var _CollapsibleColumns_brand = /*#__PURE__*/new WeakSet();
@@ -102,6 +102,37 @@ const actionDictionary = new Map([['collapse', {
102
102
  * />
103
103
  * ```
104
104
  * :::
105
+ *
106
+ * ::: only-for angular
107
+ * ```ts
108
+ * // Enable the collapsibleColumns plugin
109
+ * settings = {
110
+ * data: generateDataObj(),
111
+ * colHeaders: true,
112
+ * rowHeaders: true,
113
+ * nestedHeaders: true,
114
+ * // enable plugin
115
+ * collapsibleColumns: true,
116
+ * };
117
+ *
118
+ * // Or enable and configure specific collapsible columns
119
+ * settings = {
120
+ * data: generateDataObj(),
121
+ * colHeaders: true,
122
+ * rowHeaders: true,
123
+ * nestedHeaders: true,
124
+ * // enable and configure which columns can be collapsed
125
+ * collapsibleColumns: [
126
+ * { row: -4, col: 1, collapsible: true },
127
+ * { row: -3, col: 5, collapsible: true },
128
+ * ],
129
+ * };
130
+ * ```
131
+ *
132
+ * ```html
133
+ * <hot-table [settings]="settings"></hot-table>
134
+ * ```
135
+ * :::
105
136
  */
106
137
  var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
107
138
  var _CollapsibleColumns_brand = /*#__PURE__*/new WeakSet();
@@ -7,17 +7,16 @@ var _numeric = require("../sortFunction/numeric");
7
7
  var _checkbox = require("../sortFunction/checkbox");
8
8
  var _date = require("../sortFunction/date");
9
9
  var _time = require("../sortFunction/time");
10
- var _staticRegister = _interopRequireDefault(require("../../../utils/staticRegister"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ var _staticRegister = require("../../../utils/staticRegister");
12
11
  const {
13
12
  register: registerCompareFunctionFactory,
14
13
  getItem: getGloballyCompareFunctionFactory,
15
14
  hasItem: hasGloballyCompareFunctionFactory
16
- } = (0, _staticRegister.default)('sorting.compareFunctionFactory');
15
+ } = (0, _staticRegister.staticRegister)('sorting.compareFunctionFactory');
17
16
  const {
18
17
  register: registerRootComparator,
19
18
  getItem: getRootComparator
20
- } = (0, _staticRegister.default)('sorting.mainSortComparator');
19
+ } = (0, _staticRegister.staticRegister)('sorting.mainSortComparator');
21
20
 
22
21
  /**
23
22
  * Gets sort function for the particular column basing on it's data type.
@@ -3,7 +3,7 @@ import { compareFunctionFactory as numericSort, COLUMN_DATA_TYPE as NUMERIC_DATA
3
3
  import { compareFunctionFactory as checkboxSort, COLUMN_DATA_TYPE as CHECKBOX_DATA_TYPE } from "../sortFunction/checkbox.mjs";
4
4
  import { compareFunctionFactory as dateSort, COLUMN_DATA_TYPE as DATE_DATA_TYPE } from "../sortFunction/date.mjs";
5
5
  import { compareFunctionFactory as timeSort, COLUMN_DATA_TYPE as TIME_DATA_TYPE } from "../sortFunction/time.mjs";
6
- import staticRegister from "../../../utils/staticRegister.mjs";
6
+ import { staticRegister } from "../../../utils/staticRegister.mjs";
7
7
  const {
8
8
  register: registerCompareFunctionFactory,
9
9
  getItem: getGloballyCompareFunctionFactory,
@@ -104,6 +104,39 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 220;
104
104
  * />
105
105
  * ```
106
106
  * :::
107
+ *
108
+ * ::: only-for angular
109
+ * ```ts
110
+ * settings = {
111
+ * data: getData(),
112
+ * colHeaders: true,
113
+ * rowHeaders: true,
114
+ * columnSummary: [
115
+ * {
116
+ * type: "min",
117
+ * destinationRow: 4,
118
+ * destinationColumn: 1,
119
+ * },
120
+ * {
121
+ * type: "max",
122
+ * destinationRow: 0,
123
+ * destinationColumn: 3,
124
+ * reversedRowCoords: true,
125
+ * },
126
+ * {
127
+ * type: "sum",
128
+ * destinationRow: 4,
129
+ * destinationColumn: 5,
130
+ * forceNumeric: true,
131
+ * },
132
+ * ],
133
+ * };
134
+ * ```
135
+ *
136
+ * ```html
137
+ * <hot-table [settings]="settings"></hot-table>
138
+ * ```
139
+ * :::
107
140
  */
108
141
  var _ColumnSummary_brand = /*#__PURE__*/new WeakSet();
109
142
  class ColumnSummary extends _base.BasePlugin {
@@ -100,6 +100,39 @@ export const PLUGIN_PRIORITY = 220;
100
100
  * />
101
101
  * ```
102
102
  * :::
103
+ *
104
+ * ::: only-for angular
105
+ * ```ts
106
+ * settings = {
107
+ * data: getData(),
108
+ * colHeaders: true,
109
+ * rowHeaders: true,
110
+ * columnSummary: [
111
+ * {
112
+ * type: "min",
113
+ * destinationRow: 4,
114
+ * destinationColumn: 1,
115
+ * },
116
+ * {
117
+ * type: "max",
118
+ * destinationRow: 0,
119
+ * destinationColumn: 3,
120
+ * reversedRowCoords: true,
121
+ * },
122
+ * {
123
+ * type: "sum",
124
+ * destinationRow: 4,
125
+ * destinationColumn: 5,
126
+ * forceNumeric: true,
127
+ * },
128
+ * ],
129
+ * };
130
+ * ```
131
+ *
132
+ * ```html
133
+ * <hot-table [settings]="settings"></hot-table>
134
+ * ```
135
+ * :::
103
136
  */
104
137
  var _ColumnSummary_brand = /*#__PURE__*/new WeakSet();
105
138
  export class ColumnSummary extends BasePlugin {
@@ -19,6 +19,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
19
19
  * @class CommentEditor
20
20
  */
21
21
  var _rootDocument = /*#__PURE__*/new WeakMap();
22
+ var _rootPortalElement = /*#__PURE__*/new WeakMap();
22
23
  var _isRtl = /*#__PURE__*/new WeakMap();
23
24
  var _container = /*#__PURE__*/new WeakMap();
24
25
  var _editor = /*#__PURE__*/new WeakMap();
@@ -43,9 +44,13 @@ class CommentEditor {
43
44
  * @type {Document}
44
45
  */
45
46
 
46
- constructor(rootDocument, isRtl) {
47
+ constructor(rootDocument, isRtl, rootPortalElement) {
47
48
  var _this = this;
48
49
  _classPrivateFieldInitSpec(this, _rootDocument, void 0);
50
+ /**
51
+ * @type {HTMLElement}
52
+ */
53
+ _classPrivateFieldInitSpec(this, _rootPortalElement, void 0);
49
54
  /**
50
55
  * @type {boolean}
51
56
  */
@@ -71,6 +76,7 @@ class CommentEditor {
71
76
  */
72
77
  _classPrivateFieldInitSpec(this, _resizeObserver, new _editorResizeObserver.EditorResizeObserver());
73
78
  _classPrivateFieldSet(_rootDocument, this, rootDocument);
79
+ _classPrivateFieldSet(_rootPortalElement, this, rootPortalElement);
74
80
  _classPrivateFieldSet(_isRtl, this, isRtl);
75
81
  _classPrivateFieldSet(_editor, this, this.createEditor());
76
82
  _classPrivateFieldSet(_editorStyle, this, _classPrivateFieldGet(_editor, this).style);
@@ -223,7 +229,7 @@ class CommentEditor {
223
229
  _classPrivateFieldSet(_container, this, _classPrivateFieldGet(_rootDocument, this).createElement('div'));
224
230
  _classPrivateFieldGet(_container, this).setAttribute('dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr');
225
231
  (0, _element.addClass)(_classPrivateFieldGet(_container, this), CommentEditor.CLASS_EDITOR_CONTAINER);
226
- _classPrivateFieldGet(_rootDocument, this).body.appendChild(_classPrivateFieldGet(_container, this));
232
+ _classPrivateFieldGet(_rootPortalElement, this).appendChild(_classPrivateFieldGet(_container, this));
227
233
  (0, _element.addClass)(editor, CommentEditor.CLASS_EDITOR);
228
234
  (0, _element.addClass)(textarea, CommentEditor.CLASS_INPUT);
229
235
  textarea.setAttribute('data-hot-input', true);
@@ -15,6 +15,7 @@ import { EditorResizeObserver } from "./editorResizeObserver.mjs";
15
15
  * @class CommentEditor
16
16
  */
17
17
  var _rootDocument = /*#__PURE__*/new WeakMap();
18
+ var _rootPortalElement = /*#__PURE__*/new WeakMap();
18
19
  var _isRtl = /*#__PURE__*/new WeakMap();
19
20
  var _container = /*#__PURE__*/new WeakMap();
20
21
  var _editor = /*#__PURE__*/new WeakMap();
@@ -39,9 +40,13 @@ class CommentEditor {
39
40
  * @type {Document}
40
41
  */
41
42
 
42
- constructor(rootDocument, isRtl) {
43
+ constructor(rootDocument, isRtl, rootPortalElement) {
43
44
  var _this = this;
44
45
  _classPrivateFieldInitSpec(this, _rootDocument, void 0);
46
+ /**
47
+ * @type {HTMLElement}
48
+ */
49
+ _classPrivateFieldInitSpec(this, _rootPortalElement, void 0);
45
50
  /**
46
51
  * @type {boolean}
47
52
  */
@@ -67,6 +72,7 @@ class CommentEditor {
67
72
  */
68
73
  _classPrivateFieldInitSpec(this, _resizeObserver, new EditorResizeObserver());
69
74
  _classPrivateFieldSet(_rootDocument, this, rootDocument);
75
+ _classPrivateFieldSet(_rootPortalElement, this, rootPortalElement);
70
76
  _classPrivateFieldSet(_isRtl, this, isRtl);
71
77
  _classPrivateFieldSet(_editor, this, this.createEditor());
72
78
  _classPrivateFieldSet(_editorStyle, this, _classPrivateFieldGet(_editor, this).style);
@@ -219,7 +225,7 @@ class CommentEditor {
219
225
  _classPrivateFieldSet(_container, this, _classPrivateFieldGet(_rootDocument, this).createElement('div'));
220
226
  _classPrivateFieldGet(_container, this).setAttribute('dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr');
221
227
  addClass(_classPrivateFieldGet(_container, this), CommentEditor.CLASS_EDITOR_CONTAINER);
222
- _classPrivateFieldGet(_rootDocument, this).body.appendChild(_classPrivateFieldGet(_container, this));
228
+ _classPrivateFieldGet(_rootPortalElement, this).appendChild(_classPrivateFieldGet(_container, this));
223
229
  addClass(editor, CommentEditor.CLASS_EDITOR);
224
230
  addClass(textarea, CommentEditor.CLASS_INPUT);
225
231
  textarea.setAttribute('data-hot-input', true);
@@ -121,6 +121,59 @@ const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
121
121
  * commentsPlugin.removeComment();
122
122
  * ```
123
123
  * :::
124
+ *
125
+ * ::: only-for angular
126
+ * ```ts
127
+ * import { AfterViewInit, Component, ViewChild } from "@angular/core";
128
+ * import {
129
+ * GridSettings,
130
+ * HotTableModule,
131
+ * HotTableComponent,
132
+ * } from "@handsontable/angular-wrapper";
133
+ *
134
+ * `@Component`({
135
+ * selector: "app-example",
136
+ * standalone: true,
137
+ * imports: [HotTableModule],
138
+ * template: ` <div>
139
+ * <hot-table themeName="ht-theme-main" [settings]="gridSettings" />
140
+ * </div>`,
141
+ * })
142
+ * export class ExampleComponent implements AfterViewInit {
143
+ * `@ViewChild`(HotTableComponent, { static: false })
144
+ * readonly hotTable!: HotTableComponent;
145
+ *
146
+ * readonly gridSettings = <GridSettings>{
147
+ * data: this.getData(),
148
+ * comments: true,
149
+ * cell: [
150
+ * { row: 1, col: 1, comment: { value: "Foo" } },
151
+ * { row: 2, col: 2, comment: { value: "Bar" } },
152
+ * ],
153
+ * };
154
+ *
155
+ * ngAfterViewInit(): void {
156
+ * // Access to plugin instance:
157
+ * const hot = this.hotTable.hotInstance;
158
+ * const commentsPlugin = hot.getPlugin("comments");
159
+ *
160
+ * // Manage comments programmatically:
161
+ * commentsPlugin.setCommentAtCell(1, 6, "Comment contents");
162
+ * commentsPlugin.showAtCell(1, 6);
163
+ * commentsPlugin.removeCommentAtCell(1, 6);
164
+ *
165
+ * // You can also set range once and use proper methods:
166
+ * commentsPlugin.setRange({ from: { row: 1, col: 6 } });
167
+ * commentsPlugin.setComment("Comment contents");
168
+ * commentsPlugin.show();
169
+ * }
170
+ *
171
+ * private getData(): any[] {
172
+ * // get some data
173
+ * }
174
+ * }
175
+ * ```
176
+ * :::
124
177
  */
125
178
  var _editor = /*#__PURE__*/new WeakMap();
126
179
  var _displaySwitch = /*#__PURE__*/new WeakMap();
@@ -218,13 +271,18 @@ class Comments extends _base.BasePlugin {
218
271
  return;
219
272
  }
220
273
  if (!_classPrivateFieldGet(_editor, this)) {
221
- _classPrivateFieldSet(_editor, this, new _commentEditor.default(this.hot.rootDocument, this.hot.isRtl()));
274
+ _classPrivateFieldSet(_editor, this, new _commentEditor.default(this.hot.rootDocument, this.hot.isRtl(), this.hot.rootPortalElement));
222
275
  _classPrivateFieldGet(_editor, this).addLocalHook('resize', function () {
223
276
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
224
277
  args[_key] = arguments[_key];
225
278
  }
226
279
  return _assertClassBrand(_Comments_brand, _this, _onEditorResize).call(_this, ...args);
227
280
  });
281
+ this.hot.addHook('afterSetTheme', (themeName, firstRun) => {
282
+ if (!firstRun) {
283
+ this.hide();
284
+ }
285
+ });
228
286
  }
229
287
  if (!_classPrivateFieldGet(_displaySwitch, this)) {
230
288
  _classPrivateFieldSet(_displaySwitch, this, new _displaySwitch2.default(this.getSetting('displayDelay')));
@@ -235,12 +293,6 @@ class Comments extends _base.BasePlugin {
235
293
  this.addHook('afterBeginEditing', () => this.hide());
236
294
  this.addHook('afterDocumentKeyDown', event => _assertClassBrand(_Comments_brand, this, _onAfterDocumentKeyDown).call(this, event));
237
295
  this.addHook('beforeCompositionStart', event => _assertClassBrand(_Comments_brand, this, _onAfterDocumentKeyDown).call(this, event));
238
- this.addHook('afterSetTheme', function () {
239
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
240
- args[_key2] = arguments[_key2];
241
- }
242
- return _assertClassBrand(_Comments_brand, _this, _updateEditorThemeClassName).call(_this, ...args);
243
- });
244
296
  _classPrivateFieldGet(_displaySwitch, this).addLocalHook('hide', () => this.hide());
245
297
  _classPrivateFieldGet(_displaySwitch, this).addLocalHook('show', (row, col) => this.showAtCell(row, col));
246
298
  this.registerShortcuts();
@@ -816,12 +868,4 @@ function _onAfterScroll() {
816
868
  if (!_classPrivateFieldGet(_preventEditorHiding, this)) {
817
869
  this.hide();
818
870
  }
819
- }
820
- /**
821
- * Updates the editor theme class name.
822
- */
823
- function _updateEditorThemeClassName() {
824
- const editorElement = _classPrivateFieldGet(_editor, this).getEditorElement();
825
- (0, _element.removeClass)(editorElement, /ht-theme-.*/g);
826
- (0, _element.addClass)(editorElement, this.hot.getCurrentThemeName());
827
871
  }