@motifx-community/ui 0.1.0-beta.13 → 0.1.0-beta.14

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 (459) hide show
  1. package/CHANGELOG.md +379 -0
  2. package/README.md +2 -0
  3. package/dist/components/chart/Chart.d.ts +6 -4
  4. package/dist/components/chart/ChartPlot.d.ts +2 -1
  5. package/dist/components/chart/plot-view.d.ts +10 -2
  6. package/dist/components/chat/Chat.d.ts +276 -0
  7. package/dist/components/chat/ChatComposer.d.ts +172 -0
  8. package/dist/components/chat/ChatReply.d.ts +53 -0
  9. package/dist/components/chat/ChatWriter.d.ts +119 -0
  10. package/dist/components/chat/chat-ask-form.d.ts +64 -0
  11. package/dist/components/chat/chat-asked-entry.d.ts +21 -0
  12. package/dist/components/chat/chat-attachment-entry.d.ts +18 -0
  13. package/dist/components/chat/chat-choices-view.d.ts +40 -0
  14. package/dist/components/chat/chat-command.d.ts +7 -0
  15. package/dist/components/chat/chat-compaction-entry.d.ts +19 -0
  16. package/dist/components/chat/chat-composer-props.d.ts +63 -0
  17. package/dist/components/chat/chat-context-changed-event-args.d.ts +8 -0
  18. package/dist/components/chat/chat-context-item.d.ts +14 -0
  19. package/dist/components/chat/chat-copy-button.d.ts +11 -0
  20. package/dist/components/chat/chat-entry.d.ts +20 -0
  21. package/dist/components/chat/chat-flow-view.d.ts +32 -0
  22. package/dist/components/chat/chat-form-entry.d.ts +24 -0
  23. package/dist/components/chat/chat-form-view.d.ts +48 -0
  24. package/dist/components/chat/chat-history-event-args.d.ts +31 -0
  25. package/dist/components/chat/chat-load-older-event-args.d.ts +17 -0
  26. package/dist/components/chat/chat-look.d.ts +33 -0
  27. package/dist/components/chat/chat-mention.d.ts +21 -0
  28. package/dist/components/chat/chat-message-status.d.ts +2 -0
  29. package/dist/components/chat/chat-message.d.ts +23 -0
  30. package/dist/components/chat/chat-notice-entry.d.ts +20 -0
  31. package/dist/components/chat/chat-option.d.ts +7 -0
  32. package/dist/components/chat/chat-part.d.ts +110 -0
  33. package/dist/components/chat/chat-plan-entry.d.ts +25 -0
  34. package/dist/components/chat/chat-props.d.ts +70 -0
  35. package/dist/components/chat/chat-question-view.d.ts +41 -0
  36. package/dist/components/chat/chat-request.d.ts +173 -0
  37. package/dist/components/chat/chat-role.d.ts +2 -0
  38. package/dist/components/chat/chat-search-bar.d.ts +27 -0
  39. package/dist/components/chat/chat-search.d.ts +33 -0
  40. package/dist/components/chat/chat-send-event-args.d.ts +12 -0
  41. package/dist/components/chat/chat-sources-entry.d.ts +22 -0
  42. package/dist/components/chat/chat-text-entry.d.ts +20 -0
  43. package/dist/components/chat/chat-text-part.d.ts +5 -0
  44. package/dist/components/chat/chat-thinking-entry.d.ts +32 -0
  45. package/dist/components/chat/chat-todo-entry.d.ts +15 -0
  46. package/dist/components/chat/chat-tool-entry.d.ts +66 -0
  47. package/dist/components/chat/chat-tool-init.d.ts +18 -0
  48. package/dist/components/chat/chat-turn-view.d.ts +53 -0
  49. package/dist/components/chat/chat-turn.d.ts +8 -0
  50. package/dist/components/chat/chat-value-changed-event-args.d.ts +6 -0
  51. package/dist/components/chat/index.d.ts +22 -0
  52. package/dist/components/contextmenu/ContextMenu.d.ts +4 -0
  53. package/dist/components/contextmenu/context-menu-props.d.ts +6 -0
  54. package/dist/components/datagrid/DataGrid.d.ts +0 -12
  55. package/dist/components/datagrid/column-type.d.ts +2 -1
  56. package/dist/components/datagrid/grid-column.d.ts +4 -1
  57. package/dist/components/datagrid/grid-date-interval.d.ts +2 -1
  58. package/dist/components/datagrid/grid-filter-value.d.ts +2 -7
  59. package/dist/components/datagrid/grid-header-filter-interval.d.ts +2 -2
  60. package/dist/components/datagrid/grid-settings.d.ts +6 -3
  61. package/dist/components/datagrid/grid-sheet-cell.d.ts +3 -6
  62. package/dist/components/datagrid/grid-sheet-column.d.ts +2 -9
  63. package/dist/components/datagrid/grid-sheet-merge.d.ts +2 -7
  64. package/dist/components/datagrid/grid-sheet-row.d.ts +2 -5
  65. package/dist/components/datagrid/grid-sheet.d.ts +3 -2
  66. package/dist/components/datagrid/grid-summary-item.d.ts +5 -2
  67. package/dist/components/datagrid/grid-summary-texts.d.ts +2 -0
  68. package/dist/components/datagrid/grid-summary-type.d.ts +5 -2
  69. package/dist/components/datagrid/grid-summary.d.ts +3 -2
  70. package/dist/components/datagrid/list-option.d.ts +2 -4
  71. package/dist/components/datagrid/model/ColumnModel.d.ts +21 -3
  72. package/dist/components/datagrid/model/FilterValues.d.ts +15 -7
  73. package/dist/components/datagrid/model/GridExport.d.ts +1 -1
  74. package/dist/components/datagrid/model/GridModel.d.ts +2 -2
  75. package/dist/components/datagrid/model/LookupTexts.d.ts +1 -1
  76. package/dist/components/datagrid/view/CellEditor.d.ts +1 -1
  77. package/dist/components/datagrid/view/ColumnStyles.d.ts +1 -1
  78. package/dist/components/datagrid/view/GridBody.d.ts +1 -1
  79. package/dist/components/datagrid/view/HeaderRow.d.ts +3 -1
  80. package/dist/components/draggable/Draggable.d.ts +14 -3
  81. package/dist/components/form/MxForm.d.ts +1 -1
  82. package/dist/components/markdown/Markdown.d.ts +87 -0
  83. package/dist/components/markdown/code-block.d.ts +57 -0
  84. package/dist/components/markdown/code-colorer.d.ts +11 -0
  85. package/dist/components/markdown/code-highlighter.d.ts +9 -0
  86. package/dist/components/markdown/code-run.d.ts +6 -0
  87. package/dist/components/markdown/diagram-renderer.d.ts +21 -0
  88. package/dist/components/markdown/entities.d.ts +2 -0
  89. package/dist/components/markdown/index.d.ts +8 -0
  90. package/dist/components/markdown/inline-writer.d.ts +85 -0
  91. package/dist/components/markdown/markdown-context.d.ts +53 -0
  92. package/dist/components/markdown/markdown-link-click-event-args.d.ts +9 -0
  93. package/dist/components/markdown/markdown-props.d.ts +40 -0
  94. package/dist/components/markdown/markdown-writer.d.ts +95 -0
  95. package/dist/components/markdown/math-block.d.ts +22 -0
  96. package/dist/components/markdown/math-renderer.d.ts +18 -0
  97. package/dist/components/markdown/safe-href.d.ts +5 -0
  98. package/dist/components/markdown/text-run.d.ts +7 -0
  99. package/dist/components/menubar/MenuBar.d.ts +4 -0
  100. package/dist/components/menubar/menu-bar-props.d.ts +6 -0
  101. package/dist/components/pivotgrid/PivotGrid.d.ts +415 -0
  102. package/dist/components/pivotgrid/index.d.ts +44 -0
  103. package/dist/components/pivotgrid/model/PivotArrangement.d.ts +29 -0
  104. package/dist/components/pivotgrid/model/PivotAxisWindow.d.ts +169 -0
  105. package/dist/components/pivotgrid/model/PivotCellRanges.d.ts +63 -0
  106. package/dist/components/pivotgrid/model/PivotCellWindow.d.ts +47 -0
  107. package/dist/components/pivotgrid/model/PivotChart.d.ts +49 -0
  108. package/dist/components/pivotgrid/model/PivotDisplay.d.ts +61 -0
  109. package/dist/components/pivotgrid/model/PivotDrill.d.ts +19 -0
  110. package/dist/components/pivotgrid/model/PivotExpansion.d.ts +44 -0
  111. package/dist/components/pivotgrid/model/PivotFields.d.ts +55 -0
  112. package/dist/components/pivotgrid/model/PivotFilterValues.d.ts +36 -0
  113. package/dist/components/pivotgrid/model/PivotLayout.d.ts +75 -0
  114. package/dist/components/pivotgrid/model/PivotLoader.d.ts +29 -0
  115. package/dist/components/pivotgrid/model/PivotSheet.d.ts +44 -0
  116. package/dist/components/pivotgrid/model/PivotStateStore.d.ts +19 -0
  117. package/dist/components/pivotgrid/model/PivotTable.d.ts +78 -0
  118. package/dist/components/pivotgrid/model/PivotTexts.d.ts +47 -0
  119. package/dist/components/pivotgrid/model/PivotWindows.d.ts +120 -0
  120. package/dist/components/pivotgrid/model/pivot-copy.d.ts +26 -0
  121. package/dist/components/pivotgrid/model/pivot-csv.d.ts +9 -0
  122. package/dist/components/pivotgrid/model/pivot-header-cell.d.ts +19 -0
  123. package/dist/components/pivotgrid/model/pivot-line-key.d.ts +17 -0
  124. package/dist/components/pivotgrid/model/pivot-line.d.ts +14 -0
  125. package/dist/components/pivotgrid/pivot-grid-area.d.ts +2 -0
  126. package/dist/components/pivotgrid/pivot-grid-cell-click-event-args.d.ts +5 -0
  127. package/dist/components/pivotgrid/pivot-grid-cell-context.d.ts +19 -0
  128. package/dist/components/pivotgrid/pivot-grid-cell-dbl-click-event-args.d.ts +5 -0
  129. package/dist/components/pivotgrid/pivot-grid-cell-range.d.ts +16 -0
  130. package/dist/components/pivotgrid/pivot-grid-cell-selection-changed-event-args.d.ts +6 -0
  131. package/dist/components/pivotgrid/pivot-grid-chart-data.d.ts +15 -0
  132. package/dist/components/pivotgrid/pivot-grid-chart-options.d.ts +19 -0
  133. package/dist/components/pivotgrid/pivot-grid-column-resized-event-args.d.ts +8 -0
  134. package/dist/components/pivotgrid/pivot-grid-column-resizing.d.ts +15 -0
  135. package/dist/components/pivotgrid/pivot-grid-column.d.ts +19 -0
  136. package/dist/components/pivotgrid/pivot-grid-content-ready-event-args.d.ts +6 -0
  137. package/dist/components/pivotgrid/pivot-grid-context-menu-preparing-event-args.d.ts +22 -0
  138. package/dist/components/pivotgrid/pivot-grid-copying-event-args.d.ts +10 -0
  139. package/dist/components/pivotgrid/pivot-grid-custom-summary-info.d.ts +15 -0
  140. package/dist/components/pivotgrid/pivot-grid-data-error-event-args.d.ts +5 -0
  141. package/dist/components/pivotgrid/pivot-grid-drill-down.d.ts +14 -0
  142. package/dist/components/pivotgrid/pivot-grid-expanded-event-args.d.ts +6 -0
  143. package/dist/components/pivotgrid/pivot-grid-expanding-event-args.d.ts +9 -0
  144. package/dist/components/pivotgrid/pivot-grid-export-cell.d.ts +21 -0
  145. package/dist/components/pivotgrid/pivot-grid-export-options.d.ts +16 -0
  146. package/dist/components/pivotgrid/pivot-grid-export.d.ts +17 -0
  147. package/dist/components/pivotgrid/pivot-grid-exported-event-args.d.ts +9 -0
  148. package/dist/components/pivotgrid/pivot-grid-exporting-event-args.d.ts +17 -0
  149. package/dist/components/pivotgrid/pivot-grid-field-chooser.d.ts +20 -0
  150. package/dist/components/pivotgrid/pivot-grid-field-panel.d.ts +16 -0
  151. package/dist/components/pivotgrid/pivot-grid-field.d.ts +110 -0
  152. package/dist/components/pivotgrid/pivot-grid-fields-changed-event-args.d.ts +8 -0
  153. package/dist/components/pivotgrid/pivot-grid-filter-value.d.ts +4 -0
  154. package/dist/components/pivotgrid/pivot-grid-group-interval.d.ts +7 -0
  155. package/dist/components/pivotgrid/pivot-grid-header-filter-items-request.d.ts +9 -0
  156. package/dist/components/pivotgrid/pivot-grid-header-filter-items.d.ts +7 -0
  157. package/dist/components/pivotgrid/pivot-grid-load-panel.d.ts +11 -0
  158. package/dist/components/pivotgrid/pivot-grid-props.d.ts +121 -0
  159. package/dist/components/pivotgrid/pivot-grid-sheet-options.d.ts +14 -0
  160. package/dist/components/pivotgrid/pivot-grid-sheet.d.ts +19 -0
  161. package/dist/components/pivotgrid/pivot-grid-state.d.ts +54 -0
  162. package/dist/components/pivotgrid/pivot-grid-summary-cell.d.ts +29 -0
  163. package/dist/components/pivotgrid/pivot-grid-summary-display-mode.d.ts +5 -0
  164. package/dist/components/pivotgrid/pivot-grid-summary-type.d.ts +5 -0
  165. package/dist/components/pivotgrid/view/PivotFieldChooser.d.ts +71 -0
  166. package/dist/components/pivotgrid/view/PivotFieldPanel.d.ts +92 -0
  167. package/dist/components/pivotgrid/view/PivotView.d.ts +263 -0
  168. package/dist/components/resizable/Resizable.d.ts +2 -0
  169. package/dist/components/ribbonmenu/RibbonKeyHints.d.ts +4 -0
  170. package/dist/components/ribbonmenu/RibbonMenu.d.ts +4 -1
  171. package/dist/components/ribbonmenu/ribbon-menu-custom-menu-opening-event-args.d.ts +8 -4
  172. package/dist/components/ribbonmenu/ribbon-menu-props.d.ts +6 -0
  173. package/dist/components/scheduler/view/TimeView.d.ts +2 -0
  174. package/dist/components/scrollview/ScrollView.d.ts +48 -1
  175. package/dist/components/scrollview/index.d.ts +1 -0
  176. package/dist/components/scrollview/scroll-end-changed-event-args.d.ts +7 -0
  177. package/dist/components/scrollview/scroll-view-props.d.ts +9 -0
  178. package/dist/components/splitter/Splitter.d.ts +1 -3
  179. package/dist/components/tabdocs/TabDocumentManager.d.ts +3 -2
  180. package/dist/components/textarea/TextArea.d.ts +11 -0
  181. package/dist/components/textarea/text-area-props.d.ts +12 -1
  182. package/dist/components/textbox/TextBox.d.ts +3 -0
  183. package/dist/components/textbox/text-box-props.d.ts +3 -0
  184. package/dist/components/toolbar/Toolbar.d.ts +70 -1
  185. package/dist/components/toolbar/index.d.ts +5 -0
  186. package/dist/components/toolbar/toolbar-added-item.d.ts +9 -0
  187. package/dist/components/toolbar/toolbar-custom-menu-opening-event-args.d.ts +23 -0
  188. package/dist/components/toolbar/toolbar-customization.d.ts +18 -0
  189. package/dist/components/toolbar/toolbar-customized-event-args.d.ts +7 -0
  190. package/dist/components/toolbar/toolbar-item-display.d.ts +2 -0
  191. package/dist/components/toolbar/toolbar-item.d.ts +11 -1
  192. package/dist/components/toolbar/toolbar-props.d.ts +26 -0
  193. package/dist/components/toolbar/toolbar-targets.d.ts +22 -0
  194. package/dist/core/clipboard.d.ts +11 -0
  195. package/dist/core/enter-key-hint.d.ts +2 -0
  196. package/dist/core/look-watch.d.ts +2 -2
  197. package/dist/core/measure/look.d.ts +1 -1
  198. package/dist/core/measure/on-layout.d.ts +1 -1
  199. package/dist/core/measure/scroll.d.ts +3 -1
  200. package/dist/core/save-text.d.ts +2 -0
  201. package/dist/core/ui-strings.d.ts +190 -0
  202. package/dist/excel/excel-pivot-customize-cell-args.d.ts +8 -0
  203. package/dist/excel/excel-pivot-export-options.d.ts +44 -0
  204. package/dist/excel/excel-pivot-export-result.d.ts +6 -0
  205. package/dist/excel/export-pivot-grid.d.ts +35 -0
  206. package/dist/excel/index.d.ts +4 -0
  207. package/dist/excel/index.js +190 -56
  208. package/dist/excel/index.js.map +1 -1
  209. package/dist/excel/write-sheet.d.ts +16 -0
  210. package/dist/{formula-guard-NYlpoA-t.js → formula-guard-Bx48S0u3.js} +2 -2
  211. package/dist/formula-guard-Bx48S0u3.js.map +1 -0
  212. package/dist/generated/tokens.d.ts +7527 -4097
  213. package/dist/index.d.ts +6 -0
  214. package/dist/index.js +65982 -49896
  215. package/dist/index.js.map +1 -1
  216. package/dist/locales/en.json +179 -1
  217. package/dist/locales/tr.json +179 -1
  218. package/dist/parts/customizer/Customizer.d.ts +12 -6
  219. package/dist/parts/customizer/customizer-display.d.ts +2 -0
  220. package/dist/parts/customizer/customizer-node.d.ts +5 -0
  221. package/dist/parts/customizer/customizer-source.d.ts +15 -3
  222. package/dist/parts/item-layout/layout-added-item.d.ts +2 -2
  223. package/dist/parts/menu/MenuList.d.ts +5 -0
  224. package/dist/parts/popup/Popup.d.ts +2 -0
  225. package/dist/{components/datagrid/model → parts/table}/CellFormatter.d.ts +8 -8
  226. package/dist/{components/datagrid/view → parts/table}/HeaderFilter.d.ts +16 -11
  227. package/dist/parts/table/OffsetList.d.ts +21 -0
  228. package/dist/parts/table/ScaledOffsets.d.ts +32 -0
  229. package/dist/{components/datagrid/model → parts/table}/ValueIntervals.d.ts +12 -5
  230. package/dist/{components/datagrid/model → parts/table}/ValueListAdapter.d.ts +4 -4
  231. package/dist/parts/table/date-interval.d.ts +2 -0
  232. package/dist/parts/table/date-type.d.ts +3 -0
  233. package/dist/{components/datagrid/model → parts/table}/filter-tree-node.d.ts +3 -1
  234. package/dist/parts/table/filter-value.d.ts +9 -0
  235. package/dist/parts/table/format-column.d.ts +14 -0
  236. package/dist/parts/table/header-filter-host.d.ts +27 -0
  237. package/dist/parts/table/option-of.d.ts +6 -0
  238. package/dist/parts/table/slice-sheet.d.ts +8 -0
  239. package/dist/parts/table/table-sheet-cell.d.ts +13 -0
  240. package/dist/parts/table/table-sheet-column.d.ts +11 -0
  241. package/dist/parts/table/table-sheet-merge.d.ts +9 -0
  242. package/dist/parts/table/table-sheet-row.d.ts +8 -0
  243. package/dist/parts/table/table-sheet.d.ts +24 -0
  244. package/dist/parts/table/value-interval.d.ts +6 -0
  245. package/dist/{components/datagrid/model → parts/table}/value-list.d.ts +7 -2
  246. package/dist/parts/table/value-loader.d.ts +8 -0
  247. package/dist/parts/table/value-option.d.ts +5 -0
  248. package/dist/parts/table/value-type.d.ts +5 -0
  249. package/dist/parts/table/values-result.d.ts +6 -0
  250. package/dist/parts/window/follow-pointer.d.ts +9 -3
  251. package/dist/parts/window-list/WindowList.d.ts +105 -0
  252. package/dist/parts/window-list/window-list-source.d.ts +10 -0
  253. package/dist/pdf/export-pivot-grid.d.ts +21 -0
  254. package/dist/pdf/index.d.ts +3 -0
  255. package/dist/pdf/index.js +143 -16
  256. package/dist/pdf/index.js.map +1 -1
  257. package/dist/pdf/pdf-customize-cell-args.d.ts +1 -1
  258. package/dist/pdf/pdf-pivot-cell-args.d.ts +25 -0
  259. package/dist/pdf/pdf-pivot-export-options.d.ts +61 -0
  260. package/dist/pdf/pdf-table.d.ts +38 -6
  261. package/dist/slice-sheet-C116M42H.js +43 -0
  262. package/dist/slice-sheet-C116M42H.js.map +1 -0
  263. package/dist/styles.css +4484 -177
  264. package/dist/tokens/index.d.ts +7527 -4097
  265. package/dist/tokens/index.js +7527 -4097
  266. package/dist/tokens/index.js.map +1 -1
  267. package/dist/{tr-BvKE8jSF.js → tr-BGbF9uCs.js} +359 -3
  268. package/dist/tr-BGbF9uCs.js.map +1 -0
  269. package/docs/accordion.md +1 -1
  270. package/docs/actionsheet.md +1 -1
  271. package/docs/appbar.md +1 -1
  272. package/docs/appmenu-api.md +1 -1
  273. package/docs/appmenu-programmatic.md +1 -1
  274. package/docs/appmenu-search.md +1 -1
  275. package/docs/appmenu.md +1 -1
  276. package/docs/avatar.md +1 -1
  277. package/docs/badge.md +1 -1
  278. package/docs/bar-gauge-angles.md +1 -1
  279. package/docs/bar-gauge-data.md +1 -1
  280. package/docs/bar-gauge-labels.md +1 -1
  281. package/docs/bar-gauge.md +1 -1
  282. package/docs/barcode.md +1 -1
  283. package/docs/bottomnavigation.md +1 -1
  284. package/docs/bottomsheet.md +1 -1
  285. package/docs/breadcrumb.md +1 -1
  286. package/docs/button.md +1 -1
  287. package/docs/buttongroup.md +1 -1
  288. package/docs/buttons.md +1 -1
  289. package/docs/calendar.md +1 -1
  290. package/docs/card.md +1 -1
  291. package/docs/chart-bars.md +1 -1
  292. package/docs/chart-candles.md +1 -1
  293. package/docs/chart-funnel.md +1 -1
  294. package/docs/chart-heatmap.md +1 -1
  295. package/docs/chart-lines.md +1 -1
  296. package/docs/chart-live.md +1 -1
  297. package/docs/chart-pie.md +1 -1
  298. package/docs/chart-radar.md +1 -1
  299. package/docs/chart-ranges.md +1 -1
  300. package/docs/chart-references.md +1 -1
  301. package/docs/chart-scatter.md +1 -1
  302. package/docs/chart-waterfall.md +1 -1
  303. package/docs/chart-zoom.md +1 -1
  304. package/docs/chart.md +1 -1
  305. package/docs/chat.md +1512 -0
  306. package/docs/checkbox.md +1 -1
  307. package/docs/chip.md +2 -2
  308. package/docs/choice.md +1 -1
  309. package/docs/colorbox.md +1 -1
  310. package/docs/combobox.md +1 -1
  311. package/docs/commands.md +1 -1
  312. package/docs/control.md +1 -1
  313. package/docs/data.md +1 -1
  314. package/docs/datagrid-api.md +3 -3
  315. package/docs/datagrid-bands.md +1 -1
  316. package/docs/datagrid-drag-select.md +1 -1
  317. package/docs/datagrid-drag.md +1 -1
  318. package/docs/datagrid-editing.md +1 -1
  319. package/docs/datagrid-filtering.md +2 -2
  320. package/docs/datagrid-forms.md +1 -1
  321. package/docs/datagrid-grouping.md +7 -7
  322. package/docs/datagrid-layout.md +2 -2
  323. package/docs/datagrid-lookups.md +1 -1
  324. package/docs/datagrid-master-detail.md +1 -1
  325. package/docs/datagrid-scrolling.md +1 -1
  326. package/docs/datagrid-selection.md +1 -1
  327. package/docs/datagrid.md +1 -1
  328. package/docs/datebox.md +1 -1
  329. package/docs/daterangebox.md +1 -1
  330. package/docs/display.md +1 -1
  331. package/docs/draggable.md +2 -2
  332. package/docs/drawer.md +1 -1
  333. package/docs/dropdown.md +1 -1
  334. package/docs/editors.md +1 -1
  335. package/docs/feedback.md +1 -1
  336. package/docs/fileuploader.md +1 -1
  337. package/docs/filterbuilder.md +1 -1
  338. package/docs/formlayout.md +1 -1
  339. package/docs/foundations.md +1 -1
  340. package/docs/gallery.md +1 -1
  341. package/docs/gauge-base.md +1 -1
  342. package/docs/gauge-circular.md +1 -1
  343. package/docs/gauge-dashboards.md +1 -1
  344. package/docs/gauge-linear.md +1 -1
  345. package/docs/gauge-markers.md +1 -1
  346. package/docs/gauge-marks.md +1 -1
  347. package/docs/gauge-ranges.md +1 -1
  348. package/docs/gauge-scales.md +1 -1
  349. package/docs/gauge.md +1 -1
  350. package/docs/home.md +1 -1
  351. package/docs/keyboard.md +1 -1
  352. package/docs/language.md +1 -1
  353. package/docs/layout.md +1 -1
  354. package/docs/listbox.md +1 -1
  355. package/docs/loadpanel.md +1 -1
  356. package/docs/lookup.md +1 -1
  357. package/docs/markdown.md +343 -0
  358. package/docs/menus-api.md +3 -1
  359. package/docs/menus-context.md +2 -1
  360. package/docs/menus-customization.md +5 -1
  361. package/docs/menus-merging.md +1 -1
  362. package/docs/menus-programmatic.md +1 -1
  363. package/docs/menus.md +1 -1
  364. package/docs/multiview.md +1 -1
  365. package/docs/navigation.md +1 -1
  366. package/docs/numberbox.md +1 -1
  367. package/docs/otpinput.md +1 -1
  368. package/docs/pagination.md +1 -1
  369. package/docs/pivotgrid-api.md +180 -0
  370. package/docs/pivotgrid-chart.md +132 -0
  371. package/docs/pivotgrid-drilldown.md +142 -0
  372. package/docs/pivotgrid-export.md +207 -0
  373. package/docs/pivotgrid-fields.md +245 -0
  374. package/docs/pivotgrid-keyboard.md +223 -0
  375. package/docs/pivotgrid-layout.md +663 -0
  376. package/docs/pivotgrid-panel.md +223 -0
  377. package/docs/pivotgrid-remote.md +397 -0
  378. package/docs/pivotgrid-sorting.md +379 -0
  379. package/docs/pivotgrid-state.md +245 -0
  380. package/docs/pivotgrid-summaries.md +330 -0
  381. package/docs/pivotgrid.md +295 -0
  382. package/docs/popover.md +1 -1
  383. package/docs/progress.md +1 -1
  384. package/docs/qrcode.md +1 -1
  385. package/docs/radiogroup.md +1 -1
  386. package/docs/rating.md +1 -1
  387. package/docs/resizable.md +1 -1
  388. package/docs/ribbonmenu-api.md +2 -1
  389. package/docs/ribbonmenu-commands.md +1 -1
  390. package/docs/ribbonmenu-customization.md +3 -2
  391. package/docs/ribbonmenu-display.md +1 -1
  392. package/docs/ribbonmenu-layouts.md +1 -1
  393. package/docs/ribbonmenu-programmatic.md +1 -1
  394. package/docs/ribbonmenu.md +3 -1
  395. package/docs/scheduler-agenda.md +1 -1
  396. package/docs/scheduler-big-data.md +1 -1
  397. package/docs/scheduler-editing.md +1 -1
  398. package/docs/scheduler-form.md +1 -1
  399. package/docs/scheduler-icalendar.md +1 -1
  400. package/docs/scheduler-mobile.md +1 -1
  401. package/docs/scheduler-recurrence.md +1 -1
  402. package/docs/scheduler-resources.md +1 -1
  403. package/docs/scheduler-timeline.md +1 -1
  404. package/docs/scheduler.md +1 -1
  405. package/docs/scrollview.md +1 -1
  406. package/docs/shortcuteditor.md +1 -1
  407. package/docs/showcase-home.md +1 -1
  408. package/docs/showcase-mail.md +39 -0
  409. package/docs/showcase.md +1 -1
  410. package/docs/signature.md +1 -1
  411. package/docs/skeleton.md +1 -1
  412. package/docs/slider.md +1 -1
  413. package/docs/sortable.md +3 -6
  414. package/docs/sparkline.md +1 -1
  415. package/docs/speeddial.md +1 -1
  416. package/docs/splitter.md +1 -1
  417. package/docs/stepper.md +1 -1
  418. package/docs/switch.md +1 -1
  419. package/docs/tabdocs-dock.md +1 -1
  420. package/docs/tabdocs-drag.md +1 -1
  421. package/docs/tabdocs-menus.md +1 -1
  422. package/docs/tabdocs-mobile.md +1 -1
  423. package/docs/tabdocs-tabs.md +1 -1
  424. package/docs/tabdocs-windows.md +1 -1
  425. package/docs/tabdocs-workspace.md +1 -1
  426. package/docs/tabdocs.md +1 -1
  427. package/docs/tabs.md +1 -1
  428. package/docs/tagbox.md +1 -1
  429. package/docs/textarea.md +4 -1
  430. package/docs/textbox.md +2 -1
  431. package/docs/tileview.md +1 -1
  432. package/docs/timeline.md +1 -1
  433. package/docs/toast.md +1 -1
  434. package/docs/tokens.md +687 -1
  435. package/docs/toolbar-api.md +80 -0
  436. package/docs/toolbar-customization.md +261 -0
  437. package/docs/toolbar.md +4 -52
  438. package/docs/tooltip.md +1 -1
  439. package/docs/treeview.md +1 -1
  440. package/docs/validationsummary.md +1 -1
  441. package/docs/window.md +1 -1
  442. package/docs/wizard.md +1 -1
  443. package/llms-full.txt +18989 -12344
  444. package/llms.txt +29 -2
  445. package/package.json +2 -2
  446. package/dist/components/datagrid/model/date-type.d.ts +0 -3
  447. package/dist/components/datagrid/model/option-of.d.ts +0 -6
  448. package/dist/components/datagrid/model/value-loader.d.ts +0 -8
  449. package/dist/formula-guard-NYlpoA-t.js.map +0 -1
  450. package/dist/tr-BvKE8jSF.js.map +0 -1
  451. /package/dist/{components/datagrid/model → core}/text-ranges.d.ts +0 -0
  452. /package/dist/{components/datagrid/model → parts/table}/ExtraHeights.d.ts +0 -0
  453. /package/dist/{components/datagrid/model → parts/table}/ScrollGeometry.d.ts +0 -0
  454. /package/dist/{components/datagrid/model → parts/table}/cell-list.d.ts +0 -0
  455. /package/dist/{components/datagrid/model → parts/table}/date-like.d.ts +0 -0
  456. /package/dist/{components/datagrid/view → parts/table}/editor-value.d.ts +0 -0
  457. /package/dist/{components/datagrid/model → parts/table}/formula-guard.d.ts +0 -0
  458. /package/dist/{components/datagrid/model → parts/table}/parse-date-text.d.ts +0 -0
  459. /package/dist/{components/datagrid/model → parts/table}/same-value.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Alignment","Cell","Worksheet","GridSheet","GridSheetCell","GridSheetColumn","guardFormula","CellRange","excelDateFormat","ExcelExportOptions","excelNumberFormat","DIGIT_WIDTH","MAX_WIDTH","MAX_LEVEL","RowType","ColumnWriter","number","Intl","NumberFormat","date","numbers","Map","exportDataGrid","options","T","Promise","reject","TypeError","component","worksheet","exportSheet","start","topLeft","topLeftCell","format","selectedRowsOnly","headers","groups","summaries","pageSize","onProgress","signal","loadPanel","sheet","write","given","row","column","cell","getCell","Number","col","cols","columns","range","from","to","Math","max","length","properties","outlineProperties","summaryBelow","summaryRight","keepColumnWidths","forEach","j","width","getColumn","min","floor","formats","numberFormats","writers","map","numberFormat","locale","dateFormat","DateTimeFormat","rows","i","excelRow","getRow","rowType","outline","outlineLevel","level","cells","excelCell","writeCell","rtl","customizeCell","gridCell","encodeExecutableContent","value","view","views","rightToLeft","headerRows","frozenHeader","Object","assign","state","ySplit","autoFilterEnabled","autoFilter","keys","mergeHeaders","m","merges","mergeCells","index","writer","Date","excelDate","booleanText","text","header","groupText","font","bold","align","alignment","Partial","horizontal","vertical","includes","wrapText","numFmt","numberFormatOf","test","shown","formatToParts","abs","key","find","p","type","has","set","get","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds"],"sources":["../../src/excel/date-format.ts","../../src/excel/number-format.ts","../../src/excel/export-data-grid.ts"],"sourcesContent":["/** A day whose parts can be told apart: month 2, day 3, hour 4 (one digit each unless padded). */\r\nconst SAMPLE = new Date(2009, 1, 3, 4, 5, 6, 789);\r\n\r\n/**\r\n * The Excel number format that displays a date as `format` (an `Intl.DateTimeFormat`) writes it, in\r\n * the same order and with the same separators: `dd.mm.yyyy`, `m/d/yy h:mm AM/PM`, `d mmmm yyyy`. Month\r\n * and day names are Excel's own, in the language of the computer that opens the file.\r\n */\r\nexport function excelDateFormat(format: Intl.DateTimeFormat): string {\r\n const locale = format.resolvedOptions().locale;\r\n const longMonth = new Intl.DateTimeFormat(locale, { month: 'long' }).format(SAMPLE);\r\n const longDay = new Intl.DateTimeFormat(locale, { weekday: 'long' }).format(SAMPLE);\r\n return format\r\n .formatToParts(SAMPLE)\r\n .map((p) => {\r\n const v = p.value;\r\n switch (p.type) {\r\n case 'year':\r\n return v.length === 2 ? 'yy' : 'yyyy';\r\n case 'month':\r\n if (/^\\d+$/.test(v)) return v.length === 1 ? 'm' : 'mm';\r\n return v === longMonth ? 'mmmm' : [...v].length === 1 ? 'mmmmm' : 'mmm';\r\n case 'day':\r\n return v.length === 1 ? 'd' : 'dd';\r\n case 'weekday':\r\n return v === longDay ? 'dddd' : 'ddd';\r\n case 'hour':\r\n return v.length === 1 ? 'h' : 'hh';\r\n case 'minute':\r\n return 'mm';\r\n case 'second':\r\n return 'ss';\r\n case 'fractionalSecond':\r\n return '0'.repeat(v.length);\r\n case 'dayPeriod':\r\n return 'AM/PM';\r\n case 'literal':\r\n return [...v].map((ch) => (ch === ' ' ? ' ' : `\\\\${ch}`)).join('');\r\n default:\r\n // Eras and time zone names have no Excel code.\r\n return '';\r\n }\r\n })\r\n .join('');\r\n}\r\n","const NUMBER_PARTS = new Set(['integer', 'group', 'decimal', 'fraction', 'exponentSeparator', 'exponentMinusSign', 'exponentInteger', 'nan', 'infinity']);\r\n\r\n/** Text Excel shows as it is in a number format. */\r\nfunction formatLiteral(text: string): string {\r\n if (text === '') return '';\r\n return text.includes('\"') ? [...text].map((ch) => `\\\\${ch}`).join('') : `\"${text}\"`;\r\n}\r\n\r\n/**\r\n * The Excel number format that displays `value` as `format` (an `Intl.NumberFormat`) writes it: the\r\n * grouping, the fraction digits the value shows, a percent, a currency symbol where the locale puts\r\n * it, and a scientific exponent. Returns `undefined` for what Excel cannot write (compact notation, units).\r\n */\r\nexport function excelNumberFormat(format: Intl.NumberFormat, value: number): string | undefined {\r\n if (!Number.isFinite(value)) return undefined;\r\n const o = format.resolvedOptions();\r\n if (o.notation === 'compact' || o.style === 'unit') return undefined;\r\n const positive = section(format.formatToParts(Math.abs(value)), o);\r\n const negative = format.formatToParts(-Math.abs(value) || -1);\r\n // Excel puts a minus in front by itself; a second section only when the locale writes it otherwise.\r\n if (negative[0]?.type === 'minusSign' && section(negative.slice(1), o) === positive) return positive;\r\n return `${positive};${section(negative, o)}`;\r\n}\r\n\r\nfunction section(parts: readonly Intl.NumberFormatPart[], o: Intl.ResolvedNumberFormatOptions): string {\r\n const first = parts.findIndex((p) => NUMBER_PARTS.has(p.type));\r\n let last = -1;\r\n parts.forEach((p, i) => {\r\n if (NUMBER_PARTS.has(p.type)) last = i;\r\n });\r\n if (first < 0) return 'General';\r\n const fraction = parts.find((p) => p.type === 'fraction')?.value.length ?? 0;\r\n const grouping = (o.useGrouping as unknown) !== false && (o.useGrouping as unknown) !== 'false';\r\n const digits = Math.max(1, o.minimumIntegerDigits ?? 1);\r\n const integer = grouping && digits <= 3 ? `#,${'#'.repeat(3 - digits)}${'0'.repeat(digits)}` : '0'.repeat(digits);\r\n let core = integer + (fraction ? `.${'0'.repeat(fraction)}` : '');\r\n if (o.notation === 'scientific' || o.notation === 'engineering') core = `${'0'.repeat(digits)}${fraction ? `.${'0'.repeat(fraction)}` : ''}E+00`;\r\n return around(parts.slice(0, first)) + core + around(parts.slice(last + 1));\r\n}\r\n\r\n/** The parts before or after the number: a percent sign as Excel's `%`, the rest as quoted text. */\r\nfunction around(parts: readonly Intl.NumberFormatPart[]): string {\r\n let out = '';\r\n let text = '';\r\n for (const p of parts) {\r\n if (p.type !== 'percentSign') {\r\n text += p.value;\r\n continue;\r\n }\r\n out += `${formatLiteral(text)}%`;\r\n text = '';\r\n }\r\n return out + formatLiteral(text);\r\n}\r\n","import type { Alignment, Cell, Worksheet } from 'exceljs';\r\nimport type { GridSheet } from '../components/datagrid/grid-sheet';\r\nimport type { GridSheetCell } from '../components/datagrid/grid-sheet-cell';\r\nimport type { GridSheetColumn } from '../components/datagrid/grid-sheet-column';\r\nimport { guardFormula } from '../components/datagrid/model/formula-guard';\r\nimport type { CellRange } from './cell-range';\r\nimport { excelDateFormat } from './date-format';\r\nimport type { ExcelExportOptions } from './excel-export-options';\r\nimport { excelNumberFormat } from './number-format';\r\n\r\n/** Pixels of one character of Excel's default font (Calibri 11), which column widths count in. */\r\nconst DIGIT_WIDTH = 7;\r\n/** Excel's widest column, in characters. */\r\nconst MAX_WIDTH = 255;\r\n/** Excel's deepest outline. */\r\nconst MAX_LEVEL = 7;\r\n\r\ntype RowType = GridSheet['rows'][number]['rowType'];\r\n\r\n/** How a column's cells are written: its number and date formats. */\r\ninterface ColumnWriter {\r\n number: Intl.NumberFormat | null;\r\n date: string | null;\r\n /** Number formats by the fraction digits a value shows. */\r\n numbers: Map<string, string | undefined>;\r\n}\r\n\r\n/**\r\n * Writes a DataGrid to an ExcelJS worksheet: the header row, the group rows (\"Column: value\", with\r\n * their summaries) with outline levels, the data rows in the grid's order with its filter, search and\r\n * grouping (every matching row, loaded in parts from a server), the group footers and the totals.\r\n * Numbers stay numbers with a number format created from the column's `Intl` format, dates stay dates,\r\n * yes/no cells are `TRUE` / `FALSE`, and lookup and list cells hold their text. Provide your own ExcelJS:\r\n * create the workbook and the worksheet, then save the workbook when the promise resolves with the cells written.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'xlsx') return;\r\n * const workbook = new ExcelJS.Workbook();\r\n * exportDataGrid({ component: e.component, worksheet: workbook.addWorksheet('Orders'), selectedRowsOnly: e.selectedRowsOnly })\r\n * .then(() => workbook.xlsx.writeBuffer())\r\n * .then((buffer) => saveFile(new Blob([buffer]), 'Orders.xlsx'));\r\n * }}\r\n */\r\nexport function exportDataGrid<T = any>(options: ExcelExportOptions<T>): Promise<CellRange> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportDataGrid needs an options object.'));\r\n const { component, worksheet } = options;\r\n if (!component || typeof component.exportSheet !== 'function') return Promise.reject(new TypeError('exportDataGrid: `component` must be a DataGrid.'));\r\n if (!worksheet || typeof worksheet !== 'object') return Promise.reject(new TypeError('exportDataGrid: `worksheet` must be an ExcelJS worksheet.'));\r\n const start = topLeft(worksheet, options.topLeftCell);\r\n return component.exportSheet(\r\n {\r\n format: 'xlsx',\r\n selectedRowsOnly: options.selectedRowsOnly,\r\n headers: options.headers,\r\n groups: options.groups,\r\n summaries: options.summaries,\r\n pageSize: options.pageSize,\r\n onProgress: options.onProgress,\r\n signal: options.signal,\r\n loadPanel: options.loadPanel ?? true,\r\n },\r\n (sheet) => write(sheet, worksheet, start, options),\r\n );\r\n}\r\n\r\nfunction topLeft(worksheet: Worksheet, given: ExcelExportOptions['topLeftCell']): { row: number; column: number } {\r\n if (typeof given === 'string') {\r\n const cell = worksheet.getCell(given);\r\n return { row: Number(cell.row), column: Number(cell.col) };\r\n }\r\n return { row: given?.row ?? 1, column: given?.column ?? 1 };\r\n}\r\n\r\nfunction write<T>(sheet: GridSheet<T>, worksheet: Worksheet, start: { row: number; column: number }, options: ExcelExportOptions<T>): CellRange {\r\n const cols = sheet.columns;\r\n const range: CellRange = { from: { ...start }, to: { row: start.row, column: start.column + Math.max(0, cols.length - 1) } };\r\n worksheet.properties.outlineProperties = { summaryBelow: false, summaryRight: false };\r\n if (options.keepColumnWidths !== false) {\r\n cols.forEach((col, j) => {\r\n if (col.width > 0) worksheet.getColumn(start.column + j).width = Math.min(MAX_WIDTH, Math.floor((col.width / DIGIT_WIDTH) * 100) / 100);\r\n });\r\n }\r\n const formats = options.numberFormats !== false;\r\n const writers = cols.map(\r\n (col): ColumnWriter => ({\r\n number: formats && col.numberFormat ? new Intl.NumberFormat(sheet.locale, col.numberFormat) : null,\r\n date: formats && col.dateFormat ? excelDateFormat(new Intl.DateTimeFormat(sheet.locale, col.dateFormat)) : null,\r\n numbers: new Map(),\r\n }),\r\n );\r\n sheet.rows.forEach((row, i) => {\r\n const excelRow = worksheet.getRow(start.row + i);\r\n if (row.rowType !== 'header' && options.outline !== false) excelRow.outlineLevel = Math.min(MAX_LEVEL, row.level);\r\n row.cells.forEach((cell, j) => {\r\n const excelCell = excelRow.getCell(start.column + j);\r\n writeCell(excelCell, cell, row.rowType, j, cols[j], writers[j], sheet.rtl, options);\r\n options.customizeCell?.({ gridCell: cell.gridCell, excelCell });\r\n if (options.encodeExecutableContent && typeof excelCell.value === 'string') excelCell.value = guardFormula(excelCell.value);\r\n });\r\n range.to.row = start.row + i;\r\n });\r\n const view = { ...(worksheet.views[0] ?? {}) };\r\n if (sheet.rtl) view.rightToLeft = true;\r\n if (sheet.headerRows > 0) {\r\n if (options.frozenHeader !== false && !('state' in view)) Object.assign(view, { state: 'frozen', ySplit: start.row + sheet.headerRows - 1 });\r\n if (options.autoFilterEnabled && !worksheet.autoFilter && sheet.rows.length > 0) worksheet.autoFilter = { from: { row: start.row + sheet.headerRows - 1, column: start.column }, to: { ...range.to } };\r\n }\r\n if (Object.keys(view).length) worksheet.views = [view];\r\n // A band's title over its columns, a column's title down the band rows above it.\r\n if (options.mergeHeaders !== false) {\r\n for (const m of sheet.merges ?? []) worksheet.mergeCells(start.row + m.row, start.column + m.column, start.row + m.row + m.rows - 1, start.column + m.column + m.columns - 1);\r\n }\r\n return range;\r\n}\r\n\r\nfunction writeCell<T>(excelCell: Cell, cell: GridSheetCell<T>, rowType: RowType, index: number, col: GridSheetColumn<T>, writer: ColumnWriter, rtl: boolean, options: ExcelExportOptions<T>) {\r\n const value = cell.value;\r\n if (value instanceof Date) excelCell.value = excelDate(value);\r\n else if (typeof value === 'boolean' && options.booleanText) excelCell.value = cell.text;\r\n else excelCell.value = value;\r\n if (value === null) return;\r\n const header = rowType === 'header';\r\n const groupText = rowType === 'group' && index === 0;\r\n // Header, group and summary cells are bold; the header centered, a group's text at the start.\r\n if (rowType !== 'data') excelCell.font = { ...excelCell.font, bold: true };\r\n const align = header ? 'center' : groupText ? 'start' : col.align;\r\n const alignment: Partial<Alignment> = { ...excelCell.alignment, horizontal: align === 'center' ? 'center' : (align === 'end') !== rtl ? 'right' : 'left', vertical: 'top' };\r\n if (typeof value === 'string' && value.includes('\\n')) alignment.wrapText = true;\r\n excelCell.alignment = alignment;\r\n if (rowType !== 'data') return;\r\n if (typeof value === 'number' && writer.number) {\r\n const numFmt = numberFormatOf(writer, value);\r\n if (numFmt) excelCell.numFmt = numFmt;\r\n } else if (value instanceof Date && writer.date) {\r\n excelCell.numFmt = writer.date;\r\n } else if (typeof value === 'string' && /^[@=+-]/.test(value)) {\r\n // Text, so Excel does not read it as a formula when the cell is edited.\r\n excelCell.numFmt = '@';\r\n }\r\n}\r\n\r\nfunction numberFormatOf(writer: ColumnWriter, value: number): string | undefined {\r\n // The format depends only on the fraction digits a value shows: calculated once per count.\r\n const shown = writer.number!.formatToParts(Math.abs(value));\r\n const key = `${shown.find((p) => p.type === 'fraction')?.value.length ?? 0}`;\r\n if (!writer.numbers.has(key)) writer.numbers.set(key, excelNumberFormat(writer.number!, value));\r\n return writer.numbers.get(key);\r\n}\r\n\r\n/** ExcelJS writes a date as UTC: the local day and time are moved there, so Excel shows what the grid shows. */\r\nfunction excelDate(date: Date): Date {\r\n return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\r\n}\r\n"],"mappings":";;;AACA,IAAM,SAAS,IAAI,KAAK,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;;;;;;AAOhD,SAAgB,gBAAgB,QAAqC;CACnE,MAAM,SAAS,OAAO,gBAAgB,CAAC,CAAC;CACxC,MAAM,YAAY,IAAI,KAAK,eAAe,QAAQ,EAAE,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM;CAClF,MAAM,UAAU,IAAI,KAAK,eAAe,QAAQ,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM;CAClF,OAAO,OACJ,cAAc,MAAM,CAAC,CACrB,KAAK,MAAM;EACV,MAAM,IAAI,EAAE;EACZ,QAAQ,EAAE,MAAV;GACE,KAAK,QACH,OAAO,EAAE,WAAW,IAAI,OAAO;GACjC,KAAK;IACH,IAAI,QAAQ,KAAK,CAAC,GAAG,OAAO,EAAE,WAAW,IAAI,MAAM;IACnD,OAAO,MAAM,YAAY,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,UAAU;GACpE,KAAK,OACH,OAAO,EAAE,WAAW,IAAI,MAAM;GAChC,KAAK,WACH,OAAO,MAAM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GAAG7H,KAAK8H,SAAS,GAAG9H,KAAK+H,WAAW,GAAG/H,KAAKgI,WAAW,GAAGhI,KAAKiI,gBAAgB,CAAC,CAAC;AAC9J"}
1
+ {"version":3,"file":"index.js","names":["Worksheet","CellRange","ExcelExportOptions","writeSheet","exportDataGrid","options","T","Promise","reject","TypeError","component","worksheet","exportSheet","start","topLeft","topLeftCell","format","selectedRowsOnly","headers","groups","summaries","pageSize","onProgress","signal","loadPanel","sheet","customizeCell","cell","excelCell","gridCell","given","row","column","getCell","Number","col","topLeft","Cell","Worksheet","PivotGridSheet","PivotGridSheetCell","sliceSheet","CellRange","ExcelPivotExportOptions","ExcelPivotExportResult","writeSheet","ExcelSheetOptions","EXCEL_LIMITS","rows","columns","NAME_LENGTH","exportPivotGrid","options","T","Promise","reject","TypeError","component","worksheet","exportSheet","chartData","start","topLeft","topLeftCell","format","headers","onProgress","signal","loadPanel","sheet","tree","rowHeaderLayout","customize","cell","excelCell","p","pivotCell","area","kind","path","length","alignment","indent","customizeCell","writePivotSheets","autoFilterEnabled","booleanText","first","row","column","limits","head","headerRows","side","headerColumns","rowsEach","columnsEach","RangeError","rowParts","Math","max","ceil","columnParts","worksheets","range","r","c","addSheet","part","written","push","n","workbook","named","k","name","slice","String","getWorksheet","addWorksheet","given","getCell","Number","col"],"sources":["../../src/excel/date-format.ts","../../src/excel/number-format.ts","../../src/excel/write-sheet.ts","../../src/excel/export-data-grid.ts","../../src/excel/export-pivot-grid.ts"],"sourcesContent":["/** A day whose parts can be told apart: month 2, day 3, hour 4 (one digit each unless padded). */\r\nconst SAMPLE = new Date(2009, 1, 3, 4, 5, 6, 789);\r\n\r\n/**\r\n * The Excel number format that displays a date as `format` (an `Intl.DateTimeFormat`) writes it, in\r\n * the same order and with the same separators: `dd.mm.yyyy`, `m/d/yy h:mm AM/PM`, `d mmmm yyyy`. Month\r\n * and day names are Excel's own, in the language of the computer that opens the file.\r\n */\r\nexport function excelDateFormat(format: Intl.DateTimeFormat): string {\r\n const locale = format.resolvedOptions().locale;\r\n const longMonth = new Intl.DateTimeFormat(locale, { month: 'long' }).format(SAMPLE);\r\n const longDay = new Intl.DateTimeFormat(locale, { weekday: 'long' }).format(SAMPLE);\r\n return format\r\n .formatToParts(SAMPLE)\r\n .map((p) => {\r\n const v = p.value;\r\n switch (p.type) {\r\n case 'year':\r\n return v.length === 2 ? 'yy' : 'yyyy';\r\n case 'month':\r\n if (/^\\d+$/.test(v)) return v.length === 1 ? 'm' : 'mm';\r\n return v === longMonth ? 'mmmm' : [...v].length === 1 ? 'mmmmm' : 'mmm';\r\n case 'day':\r\n return v.length === 1 ? 'd' : 'dd';\r\n case 'weekday':\r\n return v === longDay ? 'dddd' : 'ddd';\r\n case 'hour':\r\n return v.length === 1 ? 'h' : 'hh';\r\n case 'minute':\r\n return 'mm';\r\n case 'second':\r\n return 'ss';\r\n case 'fractionalSecond':\r\n return '0'.repeat(v.length);\r\n case 'dayPeriod':\r\n return 'AM/PM';\r\n case 'literal':\r\n return [...v].map((ch) => (ch === ' ' ? ' ' : `\\\\${ch}`)).join('');\r\n default:\r\n // Eras and time zone names have no Excel code.\r\n return '';\r\n }\r\n })\r\n .join('');\r\n}\r\n","const NUMBER_PARTS = new Set(['integer', 'group', 'decimal', 'fraction', 'exponentSeparator', 'exponentMinusSign', 'exponentInteger', 'nan', 'infinity']);\r\n\r\n/** Text Excel shows as it is in a number format. */\r\nfunction formatLiteral(text: string): string {\r\n if (text === '') return '';\r\n return text.includes('\"') ? [...text].map((ch) => `\\\\${ch}`).join('') : `\"${text}\"`;\r\n}\r\n\r\n/**\r\n * The Excel number format that displays `value` as `format` (an `Intl.NumberFormat`) writes it: the\r\n * grouping, the fraction digits the value shows, a percent, a currency symbol where the locale puts\r\n * it, and a scientific exponent. Returns `undefined` for what Excel cannot write (compact notation, units).\r\n */\r\nexport function excelNumberFormat(format: Intl.NumberFormat, value: number): string | undefined {\r\n if (!Number.isFinite(value)) return undefined;\r\n const o = format.resolvedOptions();\r\n if (o.notation === 'compact' || o.style === 'unit') return undefined;\r\n const positive = section(format.formatToParts(Math.abs(value)), o);\r\n const negative = format.formatToParts(-Math.abs(value) || -1);\r\n // Excel puts a minus in front by itself; a second section only when the locale writes it otherwise.\r\n if (negative[0]?.type === 'minusSign' && section(negative.slice(1), o) === positive) return positive;\r\n return `${positive};${section(negative, o)}`;\r\n}\r\n\r\nfunction section(parts: readonly Intl.NumberFormatPart[], o: Intl.ResolvedNumberFormatOptions): string {\r\n const first = parts.findIndex((p) => NUMBER_PARTS.has(p.type));\r\n let last = -1;\r\n parts.forEach((p, i) => {\r\n if (NUMBER_PARTS.has(p.type)) last = i;\r\n });\r\n if (first < 0) return 'General';\r\n const fraction = parts.find((p) => p.type === 'fraction')?.value.length ?? 0;\r\n const grouping = (o.useGrouping as unknown) !== false && (o.useGrouping as unknown) !== 'false';\r\n const digits = Math.max(1, o.minimumIntegerDigits ?? 1);\r\n const integer = grouping && digits <= 3 ? `#,${'#'.repeat(3 - digits)}${'0'.repeat(digits)}` : '0'.repeat(digits);\r\n let core = integer + (fraction ? `.${'0'.repeat(fraction)}` : '');\r\n if (o.notation === 'scientific' || o.notation === 'engineering') core = `${'0'.repeat(digits)}${fraction ? `.${'0'.repeat(fraction)}` : ''}E+00`;\r\n return around(parts.slice(0, first)) + core + around(parts.slice(last + 1));\r\n}\r\n\r\n/** The parts before or after the number: a percent sign as Excel's `%`, the rest as quoted text. */\r\nfunction around(parts: readonly Intl.NumberFormatPart[]): string {\r\n let out = '';\r\n let text = '';\r\n for (const p of parts) {\r\n if (p.type !== 'percentSign') {\r\n text += p.value;\r\n continue;\r\n }\r\n out += `${formatLiteral(text)}%`;\r\n text = '';\r\n }\r\n return out + formatLiteral(text);\r\n}\r\n","import type { Alignment, Cell, Worksheet } from 'exceljs';\r\nimport { guardFormula } from '../parts/table/formula-guard';\r\nimport type { TableSheet } from '../parts/table/table-sheet';\r\nimport type { TableSheetCell } from '../parts/table/table-sheet-cell';\r\nimport type { TableSheetColumn } from '../parts/table/table-sheet-column';\r\nimport type { TableSheetRow } from '../parts/table/table-sheet-row';\r\nimport type { CellRange } from './cell-range';\r\nimport { excelDateFormat } from './date-format';\r\nimport type { ExcelExportOptions } from './excel-export-options';\r\nimport { excelNumberFormat } from './number-format';\r\n\r\n/** What the writer reads of an export's options. */\r\nexport type ExcelSheetOptions = Pick<ExcelExportOptions, 'keepColumnWidths' | 'numberFormats' | 'outline' | 'encodeExecutableContent' | 'frozenHeader' | 'autoFilterEnabled' | 'mergeHeaders' | 'booleanText'>;\r\n\r\n/** Pixels of one character of Excel's default font (Calibri 11), which column widths count in. */\r\nconst DIGIT_WIDTH = 7;\r\n/** Excel's widest column, in characters. */\r\nconst MAX_WIDTH = 255;\r\n/** Excel's deepest outline. */\r\nconst MAX_LEVEL = 7;\r\n\r\ntype RowType = TableSheetRow['rowType'];\r\n\r\n/** How a column's cells are written: its number and date formats. */\r\ninterface ColumnWriter {\r\n number: Intl.NumberFormat | null;\r\n date: string | null;\r\n /** Number formats by the fraction digits a value shows. */\r\n numbers: Map<string, string | undefined>;\r\n}\r\n\r\n/**\r\n * Writes a sheet to an ExcelJS worksheet from `start`: the rows with their outline levels, numbers and dates with\r\n * formats made from their column's `Intl` options, the header frozen and merged as the sheet says. `customize` is\r\n * called for every written cell. The export functions of the components write their sheets with it.\r\n */\r\nexport function writeSheet<C extends TableSheetCell>(sheet: TableSheet<C>, worksheet: Worksheet, start: { row: number; column: number }, options: ExcelSheetOptions, customize?: (cell: C, excelCell: Cell) => void): CellRange {\r\n const cols = sheet.columns;\r\n const range: CellRange = { from: { ...start }, to: { row: start.row, column: start.column + Math.max(0, cols.length - 1) } };\r\n worksheet.properties.outlineProperties = { summaryBelow: false, summaryRight: false };\r\n if (options.keepColumnWidths !== false) {\r\n cols.forEach((col, j) => {\r\n if (col.width > 0) worksheet.getColumn(start.column + j).width = Math.min(MAX_WIDTH, Math.floor((col.width / DIGIT_WIDTH) * 100) / 100);\r\n });\r\n }\r\n const formats = options.numberFormats !== false;\r\n const writers = cols.map(\r\n (col): ColumnWriter => ({\r\n number: formats && col.numberFormat ? new Intl.NumberFormat(sheet.locale, col.numberFormat) : null,\r\n date: formats && col.dateFormat ? excelDateFormat(new Intl.DateTimeFormat(sheet.locale, col.dateFormat)) : null,\r\n numbers: new Map(),\r\n }),\r\n );\r\n // A cell with formats of its own has a writer per set of them.\r\n const own = new Map<string, ColumnWriter>();\r\n const writerOf = (cell: C, j: number): ColumnWriter => {\r\n if (!formats || (!cell.numberFormat && !cell.dateFormat)) return writers[j];\r\n const key = JSON.stringify([cell.numberFormat ?? null, cell.dateFormat ?? null]);\r\n let writer = own.get(key);\r\n if (!writer) {\r\n writer = { number: cell.numberFormat ? new Intl.NumberFormat(sheet.locale, cell.numberFormat) : null, date: cell.dateFormat ? excelDateFormat(new Intl.DateTimeFormat(sheet.locale, cell.dateFormat)) : null, numbers: new Map() };\r\n own.set(key, writer);\r\n }\r\n return writer;\r\n };\r\n sheet.rows.forEach((row, i) => {\r\n const excelRow = worksheet.getRow(start.row + i);\r\n if (row.rowType !== 'header' && options.outline !== false) excelRow.outlineLevel = Math.min(MAX_LEVEL, row.level);\r\n row.cells.forEach((cell, j) => {\r\n const excelCell = excelRow.getCell(start.column + j);\r\n writeCell(excelCell, cell, row.rowType, j, cols[j], writerOf(cell, j), sheet.rtl, options);\r\n customize?.(cell, excelCell);\r\n if (options.encodeExecutableContent && typeof excelCell.value === 'string') excelCell.value = guardFormula(excelCell.value);\r\n });\r\n range.to.row = start.row + i;\r\n });\r\n const view = { ...(worksheet.views[0] ?? {}) };\r\n if (sheet.rtl) view.rightToLeft = true;\r\n // The columns of row headers stay in view beside the header rows.\r\n const headerColumns = sheet.headerColumns ?? 0;\r\n if (headerColumns > 0 && options.frozenHeader !== false && !('state' in view)) {\r\n Object.assign(view, { state: 'frozen', xSplit: start.column + headerColumns - 1, ...(sheet.headerRows > 0 ? { ySplit: start.row + sheet.headerRows - 1 } : {}) });\r\n }\r\n if (sheet.headerRows > 0) {\r\n if (options.frozenHeader !== false && !('state' in view)) Object.assign(view, { state: 'frozen', ySplit: start.row + sheet.headerRows - 1 });\r\n if (options.autoFilterEnabled && !worksheet.autoFilter && sheet.rows.length > 0) worksheet.autoFilter = { from: { row: start.row + sheet.headerRows - 1, column: start.column }, to: { ...range.to } };\r\n }\r\n if (Object.keys(view).length) worksheet.views = [view];\r\n // A band's title over its columns, a column's title down the band rows above it.\r\n if (options.mergeHeaders !== false) {\r\n for (const m of sheet.merges ?? []) worksheet.mergeCells(start.row + m.row, start.column + m.column, start.row + m.row + m.rows - 1, start.column + m.column + m.columns - 1);\r\n }\r\n return range;\r\n}\r\n\r\nfunction writeCell(excelCell: Cell, cell: TableSheetCell, rowType: RowType, index: number, col: TableSheetColumn, writer: ColumnWriter, rtl: boolean, options: ExcelSheetOptions) {\r\n const value = cell.value;\r\n if (value instanceof Date) excelCell.value = excelDate(value);\r\n else if (typeof value === 'boolean' && options.booleanText) excelCell.value = cell.text;\r\n else excelCell.value = value;\r\n if (value === null) return;\r\n const header = rowType === 'header';\r\n const groupText = rowType === 'group' && index === 0;\r\n // Header, group, summary and total cells are bold; the header centered, a group's text at the start.\r\n if (rowType !== 'data' || cell.strong) excelCell.font = { ...excelCell.font, bold: true };\r\n const align = header ? 'center' : groupText ? 'start' : col.align;\r\n const alignment: Partial<Alignment> = { ...excelCell.alignment, horizontal: align === 'center' ? 'center' : (align === 'end') !== rtl ? 'right' : 'left', vertical: 'top' };\r\n if (typeof value === 'string' && value.includes('\\n')) alignment.wrapText = true;\r\n excelCell.alignment = alignment;\r\n if (rowType !== 'data') return;\r\n if (typeof value === 'number' && writer.number) {\r\n const numFmt = numberFormatOf(writer, value);\r\n if (numFmt) excelCell.numFmt = numFmt;\r\n } else if (value instanceof Date && writer.date) {\r\n excelCell.numFmt = writer.date;\r\n } else if (typeof value === 'string' && /^[@=+-]/.test(value)) {\r\n // Text, so Excel does not read it as a formula when the cell is edited.\r\n excelCell.numFmt = '@';\r\n }\r\n}\r\n\r\nfunction numberFormatOf(writer: ColumnWriter, value: number): string | undefined {\r\n // The format depends only on the fraction digits a value shows: calculated once per count.\r\n const shown = writer.number!.formatToParts(Math.abs(value));\r\n const key = `${shown.find((p) => p.type === 'fraction')?.value.length ?? 0}`;\r\n if (!writer.numbers.has(key)) writer.numbers.set(key, excelNumberFormat(writer.number!, value));\r\n return writer.numbers.get(key);\r\n}\r\n\r\n/** ExcelJS writes a date as UTC: the local day and time are moved there, so Excel shows what the grid shows. */\r\nfunction excelDate(date: Date): Date {\r\n return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\r\n}\r\n","import type { Worksheet } from 'exceljs';\r\nimport type { CellRange } from './cell-range';\r\nimport type { ExcelExportOptions } from './excel-export-options';\r\nimport { writeSheet } from './write-sheet';\r\n\r\n/**\r\n * Writes a DataGrid to an ExcelJS worksheet: the header row, the group rows (\"Column: value\", with\r\n * their summaries) with outline levels, the data rows in the grid's order with its filter, search and\r\n * grouping (every matching row, loaded in parts from a server), the group footers and the totals.\r\n * Numbers stay numbers with a number format created from the column's `Intl` format, dates stay dates,\r\n * yes/no cells are `TRUE` / `FALSE`, and lookup and list cells hold their text. Provide your own ExcelJS:\r\n * create the workbook and the worksheet, then save the workbook when the promise resolves with the cells written.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'xlsx') return;\r\n * const workbook = new ExcelJS.Workbook();\r\n * exportDataGrid({ component: e.component, worksheet: workbook.addWorksheet('Orders'), selectedRowsOnly: e.selectedRowsOnly })\r\n * .then(() => workbook.xlsx.writeBuffer())\r\n * .then((buffer) => saveFile(new Blob([buffer]), 'Orders.xlsx'));\r\n * }}\r\n */\r\nexport function exportDataGrid<T = any>(options: ExcelExportOptions<T>): Promise<CellRange> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportDataGrid needs an options object.'));\r\n const { component, worksheet } = options;\r\n if (!component || typeof component.exportSheet !== 'function') return Promise.reject(new TypeError('exportDataGrid: `component` must be a DataGrid.'));\r\n if (!worksheet || typeof worksheet !== 'object') return Promise.reject(new TypeError('exportDataGrid: `worksheet` must be an ExcelJS worksheet.'));\r\n const start = topLeft(worksheet, options.topLeftCell);\r\n return component.exportSheet(\r\n {\r\n format: 'xlsx',\r\n selectedRowsOnly: options.selectedRowsOnly,\r\n headers: options.headers,\r\n groups: options.groups,\r\n summaries: options.summaries,\r\n pageSize: options.pageSize,\r\n onProgress: options.onProgress,\r\n signal: options.signal,\r\n loadPanel: options.loadPanel ?? true,\r\n },\r\n (sheet) => writeSheet(sheet, worksheet, start, options, options.customizeCell && ((cell, excelCell) => options.customizeCell!({ gridCell: cell.gridCell, excelCell }))),\r\n );\r\n}\r\n\r\nfunction topLeft(worksheet: Worksheet, given: ExcelExportOptions['topLeftCell']): { row: number; column: number } {\r\n if (typeof given === 'string') {\r\n const cell = worksheet.getCell(given);\r\n return { row: Number(cell.row), column: Number(cell.col) };\r\n }\r\n return { row: given?.row ?? 1, column: given?.column ?? 1 };\r\n}\r\n","import type { Cell, Worksheet } from 'exceljs';\r\nimport type { PivotGridSheet, PivotGridSheetCell } from '../components/pivotgrid/pivot-grid-sheet';\r\nimport { sliceSheet } from '../parts/table/slice-sheet';\r\nimport type { CellRange } from './cell-range';\r\nimport type { ExcelPivotExportOptions } from './excel-pivot-export-options';\r\nimport type { ExcelPivotExportResult } from './excel-pivot-export-result';\r\nimport { writeSheet, type ExcelSheetOptions } from './write-sheet';\r\n\r\n/** Excel's rows and columns in a worksheet. */\r\nconst EXCEL_LIMITS = { rows: 1_048_576, columns: 16_384 };\r\n/** Excel's longest worksheet name. */\r\nconst NAME_LENGTH = 31;\r\n\r\n/**\r\n * Writes a PivotGrid to an ExcelJS worksheet: the rows of column headers (merged over the columns they cover) and the\r\n * corner, then a row per line of the table with its row headers (merged down the lines they cover), every open member's\r\n * (read whole where the pivot is read in parts). Numbers stay numbers with the format their cells show them with, totals\r\n * are bold, and the headers stay in view. A table larger than a worksheet (1,048,576 rows, 16,384 columns) goes on in\r\n * worksheets added after it, each with the rows of column headers and the columns of row headers again. Provide your own\r\n * ExcelJS: create the workbook and the worksheet, then save the workbook when the promise resolves.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'xlsx') return;\r\n * const workbook = new ExcelJS.Workbook();\r\n * exportPivotGrid({ component: e.component, worksheet: workbook.addWorksheet('Sales') })\r\n * .then(() => workbook.xlsx.writeBuffer())\r\n * .then((buffer) => saveFile(new Blob([buffer]), 'Sales.xlsx'));\r\n * }}\r\n */\r\nexport function exportPivotGrid<T = any>(options: ExcelPivotExportOptions<T>): Promise<ExcelPivotExportResult> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportPivotGrid needs an options object.'));\r\n const { component, worksheet } = options;\r\n if (!component || typeof component.exportSheet !== 'function' || typeof component.chartData !== 'function') return Promise.reject(new TypeError('exportPivotGrid: `component` must be a PivotGrid.'));\r\n if (!worksheet || typeof worksheet !== 'object') return Promise.reject(new TypeError('exportPivotGrid: `worksheet` must be an ExcelJS worksheet.'));\r\n const start = topLeft(worksheet, options.topLeftCell);\r\n return component.exportSheet({ format: 'xlsx', headers: options.headers, onProgress: options.onProgress, signal: options.signal, loadPanel: options.loadPanel ?? true }, (sheet) => {\r\n const tree = sheet.rowHeaderLayout === 'tree';\r\n const customize = (cell: PivotGridSheetCell<T>, excelCell: Cell) => {\r\n // A member's header in the tree layout is indented by its level, as the pivot shows it.\r\n const p = cell.pivotCell;\r\n if (tree && p.area === 'row' && p.kind !== 'dataField' && (p.path?.length ?? 0) > 1) excelCell.alignment = { ...excelCell.alignment, indent: p.path!.length - 1 };\r\n options.customizeCell?.({ pivotCell: p, excelCell });\r\n };\r\n return writePivotSheets(sheet, worksheet, start, { ...options, autoFilterEnabled: false, booleanText: false }, customize);\r\n });\r\n}\r\n\r\n/**\r\n * Writes a pivot's sheet from `start` on a worksheet, and where it does not fit in one (`limits`), on worksheets added\r\n * after it: the rows by as many as fit, then the columns, each part under the rows of column headers and after the\r\n * columns of row headers again.\r\n */\r\nexport function writePivotSheets<T>(\r\n sheet: PivotGridSheet<T>,\r\n first: Worksheet,\r\n start: { row: number; column: number },\r\n options: ExcelSheetOptions,\r\n customize: (cell: PivotGridSheetCell<T>, excelCell: Cell) => void,\r\n limits: { rows: number; columns: number } = EXCEL_LIMITS,\r\n): ExcelPivotExportResult {\r\n const head = sheet.headerRows;\r\n const side = sheet.headerColumns;\r\n const rowsEach = limits.rows - (start.row - 1) - head;\r\n const columnsEach = limits.columns - (start.column - 1) - side;\r\n if (rowsEach < 1 || columnsEach < 1) throw new RangeError('exportPivotGrid: the headers do not fit in a worksheet from `topLeftCell`.');\r\n const rowParts = Math.max(1, Math.ceil((sheet.rows.length - head) / rowsEach));\r\n const columnParts = Math.max(1, Math.ceil((sheet.columns.length - side) / columnsEach));\r\n const worksheets: Worksheet[] = [];\r\n let range: CellRange | null = null;\r\n for (let r = 0; r < rowParts; r++) {\r\n for (let c = 0; c < columnParts; c++) {\r\n const worksheet = worksheets.length ? addSheet(first, worksheets.length + 1) : first;\r\n const part = sliceSheet<PivotGridSheetCell<T>, PivotGridSheet<T>>(sheet, head + r * rowsEach, head + (r + 1) * rowsEach, side + c * columnsEach, side + (c + 1) * columnsEach);\r\n const written = writeSheet(part, worksheet, start, options, customize);\r\n range ??= written;\r\n worksheets.push(worksheet);\r\n }\r\n }\r\n return { ...range!, worksheets };\r\n}\r\n\r\n/** A worksheet after the first, named after it with its number: \"Sales (2)\". */\r\nfunction addSheet(first: Worksheet, n: number): Worksheet {\r\n const workbook = first.workbook;\r\n const named = (k: number) => `${first.name.slice(0, NAME_LENGTH - String(k).length - 3)} (${k})`;\r\n let k = n;\r\n while (workbook.getWorksheet(named(k))) k++;\r\n return workbook.addWorksheet(named(k));\r\n}\r\n\r\nfunction topLeft(worksheet: Worksheet, given: ExcelPivotExportOptions['topLeftCell']): { row: number; column: number } {\r\n if (typeof given === 'string') {\r\n const cell = worksheet.getCell(given);\r\n return { row: Number(cell.row), column: Number(cell.col) };\r\n }\r\n return { row: given?.row ?? 1, column: given?.column ?? 1 };\r\n}\r\n"],"mappings":";;;;AACA,IAAM,SAAS,IAAI,KAAK,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;;;;;;AAOhD,SAAgB,gBAAgB,QAAqC;CACnE,MAAM,SAAS,OAAO,gBAAgB,CAAC,CAAC;CACxC,MAAM,YAAY,IAAI,KAAK,eAAe,QAAQ,EAAE,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM;CAClF,MAAM,UAAU,IAAI,KAAK,eAAe,QAAQ,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM;CAClF,OAAO,OACJ,cAAc,MAAM,CAAC,CACrB,KAAK,MAAM;EACV,MAAM,IAAI,EAAE;EACZ,QAAQ,EAAE,MAAV;GACE,KAAK,QACH,OAAO,EAAE,WAAW,IAAI,OAAO;GACjC,KAAK;IACH,IAAI,QAAQ,KAAK,CAAC,GAAG,OAAO,EAAE,WAAW,IAAI,MAAM;IACnD,OAAO,MAAM,YAAY,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,UAAU;GACpE,KAAK,OACH,OAAO,EAAE,WAAW,IAAI,MAAM;GAChC,KAAK,WACH,OAAO,MAAM,UAAU,SAAS;GAClC,KAAK,QACH,OAAO,EAAE,WAAW,IAAI,MAAM;GAChC,KAAK,UACH,OAAO;GACT,KAAK,UACH,OAAO;GACT,KAAK,oBACH,OAAO,IAAI,OAAO,EAAE,MAAM;GAC5B,KAAK,aACH,OAAO;GACT,KAAK,WACH,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAQ,OAAO,MAAM,MAAM,KAAK,IAAK,CAAC,CAAC,KAAK,EAAE;GACnE,SAEE,OAAO;EACX;CACF,CAAC,CAAC,CACD,KAAK,EAAE;AACZ;;;AC5CA,IAA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AaN,MAAMC,CAAC,CAAC;AACvC;AAEA,SAASpD,QAAQJ,WAAsB8D,OAAgF;CACrH,IAAI,OAAOA,UAAU,UAAU;EAC7B,MAAM/C,OAAOf,UAAU+D,QAAQD,KAAK;EACpC,OAAO;GAAEhC,KAAKkC,OAAOjD,KAAKe,GAAG;GAAGC,QAAQiC,OAAOjD,KAAKkD,GAAG;EAAE;CAC3D;CACA,OAAO;EAAEnC,KAAKgC,OAAOhC,OAAO;EAAGC,QAAQ+B,OAAO/B,UAAU;CAAE;AAC5D"}
@@ -0,0 +1,16 @@
1
+ import type { Cell, Worksheet } from 'exceljs';
2
+ import type { TableSheet } from '../parts/table/table-sheet';
3
+ import type { TableSheetCell } from '../parts/table/table-sheet-cell';
4
+ import type { CellRange } from './cell-range';
5
+ import type { ExcelExportOptions } from './excel-export-options';
6
+ /** What the writer reads of an export's options. */
7
+ export type ExcelSheetOptions = Pick<ExcelExportOptions, 'keepColumnWidths' | 'numberFormats' | 'outline' | 'encodeExecutableContent' | 'frozenHeader' | 'autoFilterEnabled' | 'mergeHeaders' | 'booleanText'>;
8
+ /**
9
+ * Writes a sheet to an ExcelJS worksheet from `start`: the rows with their outline levels, numbers and dates with
10
+ * formats made from their column's `Intl` options, the header frozen and merged as the sheet says. `customize` is
11
+ * called for every written cell. The export functions of the components write their sheets with it.
12
+ */
13
+ export declare function writeSheet<C extends TableSheetCell>(sheet: TableSheet<C>, worksheet: Worksheet, start: {
14
+ row: number;
15
+ column: number;
16
+ }, options: ExcelSheetOptions, customize?: (cell: C, excelCell: Cell) => void): CellRange;
@@ -1,4 +1,4 @@
1
- //#region src/components/datagrid/model/formula-guard.ts
1
+ //#region src/parts/table/formula-guard.ts
2
2
  var FORMULA_START = /^[=+\-@\t\r]/;
3
3
  /** Text a spreadsheet would run as a formula (it starts with `=`, `+`, `-`, `@`, a tab or a return) with a `'` in front, so it stays text. */
4
4
  function guardFormula(text) {
@@ -7,4 +7,4 @@ function guardFormula(text) {
7
7
  //#endregion
8
8
  export { guardFormula as t };
9
9
 
10
- //# sourceMappingURL=formula-guard-NYlpoA-t.js.map
10
+ //# sourceMappingURL=formula-guard-Bx48S0u3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-guard-Bx48S0u3.js","names":[],"sources":["../src/parts/table/formula-guard.ts"],"sourcesContent":["const FORMULA_START = /^[=+\\-@\\t\\r]/;\r\n\r\n/** Text a spreadsheet would run as a formula (it starts with `=`, `+`, `-`, `@`, a tab or a return) with a `'` in front, so it stays text. */\r\nexport function guardFormula(text: string): string {\r\n return FORMULA_START.test(text) ? `'${text}` : text;\r\n}\r\n"],"mappings":";AAAA,IAAM,gBAAgB;;AAGtB,SAAgB,aAAa,MAAsB;CACjD,OAAO,cAAc,KAAK,IAAI,IAAI,IAAI,SAAS;AACjD"}