d2coreui 23.0.52 → 23.0.54

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 (280) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +154 -0
  3. package/components/clipboard/clipboardUtils.d.ts +11 -0
  4. package/components/clipboard/clipboardUtils.js +16 -4
  5. package/components/clipboard/clipboardUtils.js.map +1 -1
  6. package/components/codemirror/SyntaxHighlighter.d.ts +13 -0
  7. package/components/codemirror/SyntaxHighlighter.js +6 -1
  8. package/components/codemirror/SyntaxHighlighter.js.map +1 -1
  9. package/components/collapse/expandable.d.ts +10 -0
  10. package/components/collapse/expandable.js +4 -0
  11. package/components/collapse/expandable.js.map +1 -1
  12. package/components/color/colorPicker.d.ts +16 -0
  13. package/components/color/colorPicker.js +4 -0
  14. package/components/color/colorPicker.js.map +1 -1
  15. package/components/color/colorSwatch.d.ts +16 -0
  16. package/components/color/colorSwatch.js +23 -2
  17. package/components/color/colorSwatch.js.map +1 -1
  18. package/components/color/colorUtils.d.ts +9 -0
  19. package/components/color/colorUtils.js +15 -0
  20. package/components/color/colorUtils.js.map +1 -1
  21. package/components/date/dateRangeInput.d.ts +76 -0
  22. package/components/date/dateRangeInput.js +63 -12
  23. package/components/date/dateRangeInput.js.map +1 -1
  24. package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -0
  25. package/components/date/dateRangeInputAdvancedPanel.js +7 -0
  26. package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
  27. package/components/date/dateRangeInputConfirm.d.ts +18 -0
  28. package/components/date/dateRangeInputConfirm.js +12 -0
  29. package/components/date/dateRangeInputConfirm.js.map +1 -1
  30. package/components/date/dateTimeInput.d.ts +99 -0
  31. package/components/date/dateTimeInput.js +78 -6
  32. package/components/date/dateTimeInput.js.map +1 -1
  33. package/components/date/durationInput.d.ts +37 -0
  34. package/components/date/durationInput.js +26 -3
  35. package/components/date/durationInput.js.map +1 -1
  36. package/components/date/savedIntervals.d.ts +63 -0
  37. package/components/date/savedIntervals.js +37 -0
  38. package/components/date/savedIntervals.js.map +1 -1
  39. package/components/date/savedIntervalsDialog.d.ts +13 -0
  40. package/components/date/savedIntervalsDialog.js +7 -2
  41. package/components/date/savedIntervalsDialog.js.map +1 -1
  42. package/components/form/NiceFormItem.d.ts +9 -0
  43. package/components/form/NiceFormItem.js +4 -0
  44. package/components/form/NiceFormItem.js.map +1 -1
  45. package/components/grid/cell/beanAccessor.d.ts +12 -0
  46. package/components/grid/cell/beanAccessor.js +8 -0
  47. package/components/grid/cell/beanAccessor.js.map +1 -1
  48. package/components/grid/cell/bigNumberCellEditor.d.ts +9 -0
  49. package/components/grid/cell/bigNumberCellEditor.js +19 -0
  50. package/components/grid/cell/bigNumberCellEditor.js.map +1 -1
  51. package/components/grid/cell/cellControl.d.ts +4 -0
  52. package/components/grid/cell/cellControl.js +14 -0
  53. package/components/grid/cell/cellControl.js.map +1 -1
  54. package/components/grid/cell/cellEditorUtils.d.ts +6 -0
  55. package/components/grid/cell/cellEditorUtils.js +6 -0
  56. package/components/grid/cell/cellEditorUtils.js.map +1 -1
  57. package/components/grid/cell/customEnumCellEditor.d.ts +6 -0
  58. package/components/grid/cell/customEnumCellEditor.js +10 -0
  59. package/components/grid/cell/customEnumCellEditor.js.map +1 -1
  60. package/components/grid/cell/dataGridCellEditorComponent.d.ts +26 -0
  61. package/components/grid/cell/dataGridCellEditorComponent.js +21 -0
  62. package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -1
  63. package/components/grid/cell/dateCellEditor.d.ts +6 -0
  64. package/components/grid/cell/dateCellEditor.js +10 -0
  65. package/components/grid/cell/dateCellEditor.js.map +1 -1
  66. package/components/grid/cell/dragListenerFeature.d.ts +6 -0
  67. package/components/grid/cell/dragListenerFeature.js +6 -0
  68. package/components/grid/cell/dragListenerFeature.js.map +1 -1
  69. package/components/grid/cell/durationCellEditor.d.ts +6 -0
  70. package/components/grid/cell/durationCellEditor.js +14 -0
  71. package/components/grid/cell/durationCellEditor.js.map +1 -1
  72. package/components/grid/cell/hexaOctetStringCellEditor.d.ts +6 -0
  73. package/components/grid/cell/hexaOctetStringCellEditor.js +14 -0
  74. package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
  75. package/components/grid/cell/hexaValueCellEditor.d.ts +6 -0
  76. package/components/grid/cell/hexaValueCellEditor.js +14 -0
  77. package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
  78. package/components/grid/cell/numberCellEditor.d.ts +6 -0
  79. package/components/grid/cell/numberCellEditor.js +15 -0
  80. package/components/grid/cell/numberCellEditor.js.map +1 -1
  81. package/components/grid/cell/rangeSelector.d.ts +7 -0
  82. package/components/grid/cell/rangeSelector.js +59 -5
  83. package/components/grid/cell/rangeSelector.js.map +1 -1
  84. package/components/grid/cell/simpleStatusTextCellEditor.d.ts +7 -0
  85. package/components/grid/cell/simpleStatusTextCellEditor.js +11 -0
  86. package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
  87. package/components/grid/cell/statusTextCellEditor.d.ts +7 -0
  88. package/components/grid/cell/statusTextCellEditor.js +17 -0
  89. package/components/grid/cell/statusTextCellEditor.js.map +1 -1
  90. package/components/grid/cell/tableDefaultRowStyleRules.d.ts +31 -0
  91. package/components/grid/cell/tableDefaultRowStyleRules.js +5 -0
  92. package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
  93. package/components/grid/cell/textCellEditor.d.ts +6 -0
  94. package/components/grid/cell/textCellEditor.js +15 -0
  95. package/components/grid/cell/textCellEditor.js.map +1 -1
  96. package/components/grid/cell/withAgGridHooks.d.ts +8 -0
  97. package/components/grid/cell/withAgGridHooks.js +8 -0
  98. package/components/grid/cell/withAgGridHooks.js.map +1 -1
  99. package/components/grid/columnUtils.d.ts +10 -1
  100. package/components/grid/columnUtils.js +11 -0
  101. package/components/grid/columnUtils.js.map +1 -1
  102. package/components/grid/config/columnTransfer.d.ts +18 -0
  103. package/components/grid/config/columnTransfer.js +45 -29
  104. package/components/grid/config/columnTransfer.js.map +1 -1
  105. package/components/grid/config/dataGridEditor.d.ts +31 -0
  106. package/components/grid/config/dataGridEditor.js +14 -2
  107. package/components/grid/config/dataGridEditor.js.map +1 -1
  108. package/components/grid/config/rowHeightCalculator.d.ts +11 -0
  109. package/components/grid/config/rowHeightCalculator.js +11 -0
  110. package/components/grid/config/rowHeightCalculator.js.map +1 -1
  111. package/components/grid/config/rowStylePicker.d.ts +19 -0
  112. package/components/grid/config/rowStylePicker.js +12 -0
  113. package/components/grid/config/rowStylePicker.js.map +1 -1
  114. package/components/grid/dataGrid.d.ts +361 -12
  115. package/components/grid/dataGrid.js +201 -28
  116. package/components/grid/dataGrid.js.map +1 -1
  117. package/components/grid/detail/detailHeaderPanel.d.ts +11 -0
  118. package/components/grid/detail/detailHeaderPanel.js +5 -0
  119. package/components/grid/detail/detailHeaderPanel.js.map +1 -1
  120. package/components/grid/export/contextMenu.d.ts +31 -0
  121. package/components/grid/export/contextMenu.js +8 -0
  122. package/components/grid/export/contextMenu.js.map +1 -1
  123. package/components/grid/export/progressPopup.d.ts +21 -0
  124. package/components/grid/export/progressPopup.js +17 -0
  125. package/components/grid/export/progressPopup.js.map +1 -1
  126. package/components/grid/export/worker/pdfExport.js +5 -0
  127. package/components/grid/export/worker/pdfExport.js.map +1 -1
  128. package/components/grid/extendedDataGrid.d.ts +249 -4
  129. package/components/grid/extendedDataGrid.js +160 -19
  130. package/components/grid/extendedDataGrid.js.map +1 -1
  131. package/components/grid/filter/customColumnFilter.d.ts +5 -0
  132. package/components/grid/filter/customColumnFilter.js +5 -0
  133. package/components/grid/filter/customColumnFilter.js.map +1 -1
  134. package/components/grid/filter/dataGridColumnFilter.d.ts +19 -0
  135. package/components/grid/filter/dataGridColumnFilter.js +19 -0
  136. package/components/grid/filter/dataGridColumnFilter.js.map +1 -1
  137. package/components/grid/filter/dateColumnFilter.d.ts +6 -0
  138. package/components/grid/filter/dateColumnFilter.js +6 -0
  139. package/components/grid/filter/dateColumnFilter.js.map +1 -1
  140. package/components/grid/filter/textColumnFilter.d.ts +6 -0
  141. package/components/grid/filter/textColumnFilter.js +6 -0
  142. package/components/grid/filter/textColumnFilter.js.map +1 -1
  143. package/components/grid/filter/wildcardQuickFilterEngine.d.ts +21 -0
  144. package/components/grid/filter/wildcardQuickFilterEngine.js +21 -0
  145. package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -1
  146. package/components/grid/header/simpleHeader.d.ts +17 -0
  147. package/components/grid/header/simpleHeader.js +20 -0
  148. package/components/grid/header/simpleHeader.js.map +1 -1
  149. package/components/grid/panel/dataGridPagination.d.ts +10 -0
  150. package/components/grid/panel/dataGridPagination.js +5 -0
  151. package/components/grid/panel/dataGridPagination.js.map +1 -1
  152. package/components/grid/panel/loadingOverlay.d.ts +5 -0
  153. package/components/grid/panel/loadingOverlay.js +4 -0
  154. package/components/grid/panel/loadingOverlay.js.map +1 -1
  155. package/components/grid/panel/noRecordsOverlay.d.ts +6 -0
  156. package/components/grid/panel/noRecordsOverlay.js +5 -0
  157. package/components/grid/panel/noRecordsOverlay.js.map +1 -1
  158. package/components/grid/panel/tablePagination.d.ts +4 -0
  159. package/components/grid/panel/tablePagination.js +4 -0
  160. package/components/grid/panel/tablePagination.js.map +1 -1
  161. package/components/icons/dropdownArrow.d.ts +3 -0
  162. package/components/icons/dropdownArrow.js +2 -0
  163. package/components/icons/dropdownArrow.js.map +1 -1
  164. package/components/icons/undoIcon.d.ts +2 -0
  165. package/components/icons/undoIcon.js +2 -0
  166. package/components/icons/undoIcon.js.map +1 -1
  167. package/components/input/autoCompleteInput.d.ts +29 -0
  168. package/components/input/autoCompleteInput.js +7 -0
  169. package/components/input/autoCompleteInput.js.map +1 -1
  170. package/components/input/draftUtils.d.ts +7 -0
  171. package/components/input/draftUtils.js +9 -0
  172. package/components/input/draftUtils.js.map +1 -1
  173. package/components/input/hexaFormattedInput.d.ts +9 -0
  174. package/components/input/hexaFormattedInput.js +3 -0
  175. package/components/input/hexaFormattedInput.js.map +1 -1
  176. package/components/input/mask/helpers.d.ts +27 -0
  177. package/components/input/mask/helpers.js +27 -0
  178. package/components/input/mask/helpers.js.map +1 -1
  179. package/components/input/mask/inputMaskCore.d.ts +80 -0
  180. package/components/input/mask/inputMaskCore.js +90 -0
  181. package/components/input/mask/inputMaskCore.js.map +1 -1
  182. package/components/input/mask/pattern.d.ts +24 -0
  183. package/components/input/mask/pattern.js +26 -0
  184. package/components/input/mask/pattern.js.map +1 -1
  185. package/components/input/maskedInput.d.ts +53 -0
  186. package/components/input/maskedInput.js +44 -4
  187. package/components/input/maskedInput.js.map +1 -1
  188. package/components/input/passwordInput.d.ts +7 -0
  189. package/components/input/passwordInput.js +8 -0
  190. package/components/input/passwordInput.js.map +1 -1
  191. package/components/input/simpleAutoComplete.d.ts +6 -0
  192. package/components/input/simpleAutoComplete.js +6 -0
  193. package/components/input/simpleAutoComplete.js.map +1 -1
  194. package/components/input/textarea/extractSpansOfClasses.d.ts +17 -0
  195. package/components/input/textarea/extractSpansOfClasses.js +26 -1
  196. package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
  197. package/components/input/textarea/getRanges.d.ts +7 -0
  198. package/components/input/textarea/getRanges.js +11 -0
  199. package/components/input/textarea/getRanges.js.map +1 -1
  200. package/components/input/textarea/getType.d.ts +5 -0
  201. package/components/input/textarea/getType.js +5 -0
  202. package/components/input/textarea/getType.js.map +1 -1
  203. package/components/input/textarea/highlighedContents.d.ts +4 -0
  204. package/components/input/textarea/highlighedContents.js +5 -0
  205. package/components/input/textarea/highlighedContents.js.map +1 -1
  206. package/components/input/textarea/mentionsWithHighlighting.d.ts +25 -0
  207. package/components/input/textarea/mentionsWithHighlighting.js +14 -0
  208. package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
  209. package/components/keyboard/keyboardUtils.d.ts +6 -0
  210. package/components/keyboard/keyboardUtils.js +6 -0
  211. package/components/keyboard/keyboardUtils.js.map +1 -1
  212. package/components/modal/draggableModalProvider.d.ts +6 -0
  213. package/components/modal/draggableModalProvider.js +7 -0
  214. package/components/modal/draggableModalProvider.js.map +1 -1
  215. package/components/modal/impl/clamp.js +1 -0
  216. package/components/modal/impl/clamp.js.map +1 -1
  217. package/components/modal/impl/draggableModal.d.ts +1 -0
  218. package/components/modal/impl/draggableModal.js +6 -0
  219. package/components/modal/impl/draggableModal.js.map +1 -1
  220. package/components/modal/impl/draggableModalContext.js +1 -0
  221. package/components/modal/impl/draggableModalContext.js.map +1 -1
  222. package/components/modal/impl/draggableModalInner.js +12 -1
  223. package/components/modal/impl/draggableModalInner.js.map +1 -1
  224. package/components/modal/impl/draggableModalReducer.d.ts +7 -1
  225. package/components/modal/impl/draggableModalReducer.js +6 -1
  226. package/components/modal/impl/draggableModalReducer.js.map +1 -1
  227. package/components/modal/impl/draggableModalStyles.d.ts +17 -0
  228. package/components/modal/impl/draggableModalStyles.js +31 -0
  229. package/components/modal/impl/draggableModalStyles.js.map +1 -1
  230. package/components/modal/impl/getWindowSize.js +1 -0
  231. package/components/modal/impl/getWindowSize.js.map +1 -1
  232. package/components/modal/impl/index.js +1 -0
  233. package/components/modal/impl/index.js.map +1 -1
  234. package/components/modal/impl/resizeHandle.d.ts +1 -0
  235. package/components/modal/impl/resizeHandle.js +4 -1
  236. package/components/modal/impl/resizeHandle.js.map +1 -1
  237. package/components/modal/impl/useDrag.js +1 -0
  238. package/components/modal/impl/useDrag.js.map +1 -1
  239. package/components/modal/impl/usePrevious.js +1 -0
  240. package/components/modal/impl/usePrevious.js.map +1 -1
  241. package/components/modal/impl/useResize.js +1 -0
  242. package/components/modal/impl/useResize.js.map +1 -1
  243. package/components/modal/modalDialog.d.ts +85 -0
  244. package/components/modal/modalDialog.js +80 -10
  245. package/components/modal/modalDialog.js.map +1 -1
  246. package/components/picker/enumValuePicker.d.ts +17 -0
  247. package/components/picker/enumValuePicker.js +4 -0
  248. package/components/picker/enumValuePicker.js.map +1 -1
  249. package/components/platformSpecific.d.ts +17 -0
  250. package/components/platformSpecific.js +16 -0
  251. package/components/platformSpecific.js.map +1 -1
  252. package/components/scrollTo/onlyText.d.ts +5 -0
  253. package/components/scrollTo/onlyText.js +5 -0
  254. package/components/scrollTo/onlyText.js.map +1 -1
  255. package/components/scrollTo/scrollTo.d.ts +56 -0
  256. package/components/scrollTo/scrollTo.js +40 -3
  257. package/components/scrollTo/scrollTo.js.map +1 -1
  258. package/components/style/withCss.d.ts +15 -0
  259. package/components/style/withCss.js +6 -0
  260. package/components/style/withCss.js.map +1 -1
  261. package/components/table/dragSortingTable.d.ts +15 -0
  262. package/components/table/dragSortingTable.js +12 -0
  263. package/components/table/dragSortingTable.js.map +1 -1
  264. package/components/text/impl/innerSize.js +2 -0
  265. package/components/text/impl/innerSize.js.map +1 -1
  266. package/components/text/impl/series.d.ts +10 -0
  267. package/components/text/impl/series.js +10 -0
  268. package/components/text/impl/series.js.map +1 -1
  269. package/components/text/impl/shallowEqual.js +1 -0
  270. package/components/text/impl/shallowEqual.js.map +1 -1
  271. package/components/text/impl/whilst.d.ts +7 -0
  272. package/components/text/impl/whilst.js +7 -0
  273. package/components/text/impl/whilst.js.map +1 -1
  274. package/components/text/textFit.d.ts +24 -0
  275. package/components/text/textFit.js +29 -1
  276. package/components/text/textFit.js.map +1 -1
  277. package/i18n/componentsLocaleHolder.d.ts +9 -0
  278. package/i18n/componentsLocaleHolder.js +9 -0
  279. package/i18n/componentsLocaleHolder.js.map +1 -1
  280. package/package.json +66 -65
@@ -1 +1 @@
1
- {"version":3,"file":"columnTransfer.js","sourceRoot":"","sources":["../../../../../components/grid/config/columnTransfer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAe,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,gBAAgB,MAAM,4CAA4C,CAAC;AAI1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reeDataNode} from 'antd'\r\nimport _head from \"lodash/head\";\r\nimport i18n from \"d2core/i18n/i18n\"\r\nimport DragSortingTable from \"d2coreui/components/table/dragSortingTable\";\r\nimport {ColDef, ColumnState, GridApi} from \"ag-grid-community\";\r\nimport {TableRowSelection} from \"antd/es/table/interface\";\r\nimport {TransferItem} from \"antd/lib/transfer\";\r\nimport difference from \"lodash/difference\";\r\n\r\n// Customize ColumnNode Transfer\r\nconst isChecked = (selectedKeys: React.Key[], eventKey: string) => {\r\n return selectedKeys.indexOf(eventKey) !== -1;\r\n};\r\n\r\ntype TreeNodeType = TreeDataNode & ColumnNode;\r\n\r\nfunction generateTree(treeNodes: ColumnNode[] = [], checkedKeys: string[] = []): TreeNodeType[] {\r\n return treeNodes.map(({children, ...props}): TreeNodeType => ({\r\n ...props,\r\n key: props.key as string,\r\n disabled: checkedKeys.includes(props.key as string),\r\n children: generateTree(children, checkedKeys),\r\n }));\r\n}\r\n\r\nfunction generateSimpleTree(treeNodes: ColumnNode[] = []): TreeNodeType[] {\r\n return treeNodes.map(({children, ...props}) => ({\r\n ...props,\r\n key: props.key as string,\r\n children: generateSimpleTree(children)\r\n }));\r\n}\r\n\r\nfunction getColumns(columnDefinitions: ColDef[]): ColumnNode[] {\r\n // noinspection UnnecessaryLocalVariableJS\r\n const columns = columnDefinitions.map((columnDef) => {\r\n const id = columnDef.colId ? columnDef.colId : (columnDef.field ? columnDef.field : \"\");\r\n const group = (columnDef as any).group;\r\n return {\r\n key: id,\r\n title: columnDef.headerName ? columnDef.headerName : \"unknown\",\r\n description: columnDef.headerTooltip,\r\n group: group\r\n };\r\n });\r\n return columns;\r\n}\r\n\r\nfunction getColumnsTree(columns: ColumnNode[], filteredItems: ColumnNode[] | undefined = undefined): ColumnNode[] {\r\n const columnsDefinitionTree: ColumnNode[] = [];\r\n columns.forEach((column) => {\r\n const itemPresent = filteredItems ? (filteredItems.filter((filteredItem) => {\r\n return filteredItem.key === column.key\r\n }).length > 0) : true;\r\n if (!itemPresent) {\r\n return;\r\n }\r\n let parent = _head(columnsDefinitionTree.filter((parentNode) => parentNode.key === (\"_group_\" + column.group)));\r\n if (!parent) {\r\n parent = {key: \"_group_\" + column.group, title: column.group ? column.group : \"unknown\"};\r\n columnsDefinitionTree.push(parent)\r\n }\r\n if (!parent.children) {\r\n parent.children = [];\r\n }\r\n parent.children.push({key: column.key, title: column.title});\r\n });\r\n return columnsDefinitionTree;\r\n}\r\n\r\ninterface ColumnNode extends TransferItem {\r\n group?: string\r\n children?: ColumnNode[]\r\n}\r\n\r\nexport const enum ColumnTransferType {\r\n SIMPLE = \"simple\",\r\n FULL = \"full\"\r\n}\r\n\r\nexport interface ColumnTransferProps {\r\n columnDefinitions: ColDef[]\r\n columnModel: ColumnState[]\r\n gridApi: GridApi\r\n type?: ColumnTransferType,\r\n height?: number\r\n}\r\n\r\nexport default class ColumnTransfer extends React.Component<ColumnTransferProps> {\r\n public static defaultProps = {\r\n type: ColumnTransferType.FULL\r\n };\r\n\r\n constructor(props: Readonly<ColumnTransferProps>) {\r\n super(props);\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n onChange(_: React.Key[], direction: string, moveKeys: React.Key[]) {\r\n moveKeys.forEach((columnKey) => {\r\n if (typeof columnKey === \"string\") {\r\n if (columnKey.indexOf(\"_group_\") >= 0) {\r\n const columnsTree: ColumnNode[] = getColumnsTree(getColumns(this.props.columnDefinitions));\r\n const columnGroup: ColumnNode | undefined = _head(columnsTree.filter((columnGroup) => {\r\n return columnGroup.key === columnKey;\r\n }));\r\n if (columnGroup && columnGroup.children) {\r\n columnGroup.children.forEach((column) => {\r\n this.props.gridApi.setColumnsVisible([column.key as string], direction === \"right\");\r\n });\r\n }\r\n } else {\r\n this.props.gridApi.setColumnsVisible([columnKey], direction === \"right\");\r\n }\r\n }\r\n });\r\n };\r\n\r\n render() {\r\n const {columnDefinitions, columnModel, gridApi, type, ...restProps} = this.props;\r\n const columns = getColumns(columnDefinitions);\r\n const visibleColumnIds = columnModel.filter((column) => !column.hide).map((column) => column.colId) as string[];\r\n if (type === ColumnTransferType.SIMPLE) {\r\n const columnsTree = getColumnsTree(columns);\r\n return (<Tree<TreeNodeType>\r\n blockNode\r\n checkable\r\n defaultExpandAll\r\n checkedKeys={visibleColumnIds}\r\n onCheck={(selectedKeys, {node,},) => {\r\n const selectedColumnId: string = (node as any).props?.eventKey ? (node as any).props.eventKey : \"\";\r\n const visible = Array.isArray(selectedKeys) && selectedKeys.indexOf(selectedColumnId) >= 0;\r\n if (selectedColumnId.indexOf(\"_group_\") >= 0) {\r\n const columnGroup: ColumnNode | undefined = _head(columnsTree.filter((columnGroup) => {\r\n return columnGroup.key === selectedColumnId;\r\n }));\r\n if (columnGroup && columnGroup.children) {\r\n columnGroup.children.forEach((column) => {\r\n this.props.gridApi.setColumnsVisible([column.key as string], visible);\r\n });\r\n }\r\n } else {\r\n this.props.gridApi.setColumnsVisible([selectedColumnId], visible);\r\n }\r\n }}\r\n treeData={generateSimpleTree(columnsTree)}\r\n />);\r\n } else {\r\n const titles = [<b>{i18n(\"Hidden Columns\")}:</b>, <b>{i18n(\"Shown Columns\")}:</b>] as unknown as string[]; // special hack to overcome typescript titles attribute in Transfer component could be also [ReactElement, ReactElement]\r\n return (\r\n <Transfer {...restProps}\r\n style={{height: this.props.height, minHeight: 100}}\r\n locale={{\r\n itemUnit: \"\",\r\n itemsUnit: \"\",\r\n notFoundContent: i18n('The column list is empty'),\r\n searchPlaceholder: i18n('Column Name')\r\n }}\r\n targetKeys={visibleColumnIds}\r\n dataSource={columns}\r\n className=\"tree-transfer\"\r\n render={item => item.title ? item.title : null}\r\n showSelectAll={true}\r\n titles={titles}\r\n filterOption={(inputValue, item) => !!item.title && item.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1}\r\n showSearch\r\n onChange={this.onChange}>\r\n {({direction, onItemSelect, selectedKeys, filteredItems, onItemSelectAll}) => {\r\n if (direction === 'left') {\r\n const checkedKeys = [...selectedKeys];\r\n const columnsTree = getColumnsTree(columns, filteredItems);\r\n return (\r\n <div style={{\r\n overflowY: \"auto\",\r\n height: (this.props.height ? this.props.height : 100) - 100\r\n }}>\r\n <Tree<TreeNodeType>\r\n blockNode\r\n checkable\r\n defaultExpandAll\r\n checkedKeys={checkedKeys}\r\n onCheck={(_, {node,},) => {\r\n if ((node as any).props?.eventKey) {\r\n onItemSelect((node as any).props.eventKey, !isChecked(checkedKeys, (node as any).props.eventKey));\r\n }\r\n }}\r\n onSelect={(_, {node},) => {\r\n if ((node as any).props?.eventKey) {\r\n onItemSelect((node as any).props.eventKey, !isChecked(checkedKeys, (node as any).props.eventKey));\r\n }\r\n }}\r\n treeData={generateTree(columnsTree, visibleColumnIds)}\r\n />\r\n </div>\r\n );\r\n } else {\r\n const rowSelection: TableRowSelection<ColumnNode> = {\r\n getCheckboxProps: item => {\r\n return {disabled: !!item.disabled};\r\n },\r\n onSelectAll(selected, selectedRows) {\r\n const treeSelectedKeys = selectedRows\r\n .filter(item => !item.disabled)\r\n .map(({key}) => key);\r\n let diffKeys: any;\r\n if (selected) {\r\n diffKeys = difference(treeSelectedKeys, selectedKeys);\r\n } else {\r\n diffKeys = difference(selectedKeys, treeSelectedKeys);\r\n }\r\n onItemSelectAll(diffKeys, selected);\r\n },\r\n onSelect({key}, selected) {\r\n onItemSelect(key as string, selected);\r\n },\r\n selectedRowKeys: selectedKeys,\r\n };\r\n\r\n return (\r\n <div style={{\r\n overflowY: \"auto\",\r\n height: (this.props.height ? this.props.height : 100) - 100\r\n }}>\r\n <DragSortingTable<ColumnNode>\r\n showHeader={false}\r\n pagination={false}\r\n rowSelection={rowSelection}\r\n columns={[\r\n {\r\n dataIndex: 'title',\r\n title: 'Name',\r\n },\r\n ]}\r\n dataSource={filteredItems}\r\n size=\"small\"\r\n onRow={({key, disabled: itemDisabled}) => ({\r\n onClick: () => {\r\n if (itemDisabled) {\r\n return;\r\n }\r\n onItemSelect(key as string, !selectedKeys.includes(key as string));\r\n },\r\n })}\r\n onMoveRow={(column: ColumnNode, _: number, toIndex: number) => {\r\n this.props.gridApi.moveColumns([column.key as string], toIndex);\r\n }}\r\n />\r\n </div>\r\n );\r\n }\r\n }}\r\n </Transfer>\r\n );\r\n }\r\n };\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"columnTransfer.js","sourceRoot":"","sources":["../../../../../components/grid/config/columnTransfer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAe,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,gBAAgB,MAAM,4CAA4C,CAAC;AAI1E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,gCAAgC;AAChC,MAAM,SAAS,GAAG,CAAC,YAAyB,EAAE,QAAgB,EAAE,EAAE;IAC9D,OAAO,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAIF,SAAS,YAAY,CAAC,YAA0B,EAAE,EAAE,cAAwB,EAAE;IAC1E,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAoB,EAAgB,EAAE;YAAtC,EAAC,QAAQ,OAAW,EAAN,KAAK,cAAnB,YAAoB,CAAD;QAAoB,OAAA,iCACtD,KAAK,KACR,GAAG,EAAE,KAAK,CAAC,GAAa,EACxB,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAa,CAAC,EACnD,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,IAC/C,CAAA;KAAA,CAAC,CAAC;AACR,CAAC;AAED,SAAS,kBAAkB,CAAC,YAA0B,EAAE;IACpD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAoB,EAAE,EAAE;YAAxB,EAAC,QAAQ,OAAW,EAAN,KAAK,cA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AAvKY,2BAAY,GAAG;IACzB,IAAI,sCAAyB;CAChC,CAAC;eAHe,cAAc","sourcesContent":["import React from \"react\";\r\nimport {Transfer, Tree, TreeDataNode} from 'antd'\r\nimport _head from \"lodash/head\";\r\nimport i18n from \"d2core/i18n/i18n\"\r\nimport DragSortingTable from \"d2coreui/components/table/dragSortingTable\";\r\nimport {ColDef, ColumnState, GridApi} from \"ag-grid-community\";\r\nimport {TableRowSelection} from \"antd/es/table/interface\";\r\nimport {TransferItem} from \"antd/lib/transfer\";\r\nimport difference from \"lodash/difference\";\r\n\r\n// Customize ColumnNode Transfer\r\nconst isChecked = (selectedKeys: React.Key[], eventKey: string) => {\r\n return selectedKeys.indexOf(eventKey) !== -1;\r\n};\r\n\r\ntype TreeNodeType = TreeDataNode & ColumnNode;\r\n\r\nfunction generateTree(treeNodes: ColumnNode[] = [], checkedKeys: string[] = []): TreeNodeType[] {\r\n return treeNodes.map(({children, ...props}): TreeNodeType => ({\r\n ...props,\r\n key: props.key as string,\r\n disabled: checkedKeys.includes(props.key as string),\r\n children: generateTree(children, checkedKeys),\r\n }));\r\n}\r\n\r\nfunction generateSimpleTree(treeNodes: ColumnNode[] = []): TreeNodeType[] {\r\n return treeNodes.map(({children, ...props}) => ({\r\n ...props,\r\n key: props.key as string,\r\n children: generateSimpleTree(children)\r\n }));\r\n}\r\n\r\nfunction getColumns(columnDefinitions: ColDef[], gridApi: GridApi): ColumnNode[] {\r\n // noinspection UnnecessaryLocalVariableJS\r\n const columns = columnDefinitions.map((columnDef) => {\r\n const id = columnDef.colId ? columnDef.colId : (columnDef.field ? columnDef.field : \"\");\r\n const group = (columnDef as any).group;\r\n const column = id ? gridApi.getColumn(id) : null;\r\n return {\r\n key: id,\r\n title: (column && gridApi.getDisplayNameForColumn(column, \"columnToolPanel\")) || columnDef.headerName || id,\r\n description: columnDef.headerTooltip,\r\n group: group\r\n };\r\n });\r\n return columns;\r\n}\r\n\r\nfunction getColumnsTree(columns: ColumnNode[], filteredItems: ColumnNode[] | undefined = undefined): ColumnNode[] {\r\n const columnsDefinitionTree: ColumnNode[] = [];\r\n columns.forEach((column) => {\r\n const itemPresent = filteredItems ? (filteredItems.filter((filteredItem) => {\r\n return filteredItem.key === column.key\r\n }).length > 0) : true;\r\n if (!itemPresent) {\r\n return;\r\n }\r\n if (!column.group) {\r\n columnsDefinitionTree.push({key: column.key, title: column.title});\r\n return;\r\n }\r\n let parent = _head(columnsDefinitionTree.filter((parentNode) => parentNode.key === (\"_group_\" + column.group)));\r\n if (!parent) {\r\n parent = {key: \"_group_\" + column.group, title: column.group};\r\n columnsDefinitionTree.push(parent)\r\n }\r\n if (!parent.children) {\r\n parent.children = [];\r\n }\r\n parent.children.push({key: column.key, title: column.title});\r\n });\r\n return columnsDefinitionTree;\r\n}\r\n\r\ninterface ColumnNode extends TransferItem {\r\n group?: string\r\n children?: ColumnNode[]\r\n}\r\n\r\n/** Layout of {@link ColumnTransfer}. */\r\nexport const enum ColumnTransferType {\r\n /** Checkable tree of columns grouped by `DataGridColDef.group`; checking a column shows it. Column order cannot be changed. */\r\n SIMPLE = \"simple\",\r\n /** Two-list transfer: hidden columns as a grouped tree on the left, shown columns on the right, where they can be reordered by drag and drop. */\r\n FULL = \"full\"\r\n}\r\n\r\n/** Properties of {@link ColumnTransfer}. */\r\nexport interface ColumnTransferProps {\r\n /** Column definitions of the grid; a column is identified by `colId`, or by `field` when `colId` is not set, and grouped by its `group` (see `DataGridColDef`). */\r\n columnDefinitions: ColDef[]\r\n /** Current column state of the grid; columns without `hide` are shown as visible. */\r\n columnModel: ColumnState[]\r\n /** API of the grid whose columns are edited; every change is applied to it immediately. */\r\n gridApi: GridApi\r\n /**\r\n * Layout of the editor.\r\n * @default ColumnTransferType.FULL\r\n */\r\n type?: ColumnTransferType,\r\n /** Height in pixels of the {@link ColumnTransferType.FULL} layout; the lists get 100 pixels less. Also forwarded to the antd `Transfer`. */\r\n height?: number\r\n}\r\n\r\n/**\r\n * Editor of the visibility and order of ag-grid columns, used by the grid's column configuration dialog and settings drawer.\r\n * It does not keep its own copy of the changes: showing, hiding and moving a column is applied to `gridApi` at once,\r\n * so the caller re-renders it with the new `columnModel` (e.g. from ag-grid column events).\r\n */\r\nexport default class ColumnTransfer extends React.Component<ColumnTransferProps> {\r\n public static defaultProps = {\r\n type: ColumnTransferType.FULL\r\n };\r\n\r\n constructor(props: Readonly<ColumnTransferProps>) {\r\n super(props);\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n /** antd `Transfer` change handler: shows (`direction` `\"right\"`) or hides the moved columns; a moved group key applies to all columns of the group. */\r\n onChange(_: React.Key[], direction: string, moveKeys: React.Key[]) {\r\n moveKeys.forEach((columnKey) => {\r\n if (typeof columnKey === \"string\") {\r\n if (columnKey.indexOf(\"_group_\") >= 0) {\r\n const columnsTree: ColumnNode[] = getColumnsTree(getColumns(this.props.columnDefinitions, this.props.gridApi));\r\n const columnGroup: ColumnNode | undefined = _head(columnsTree.filter((columnGroup) => {\r\n return columnGroup.key === columnKey;\r\n }));\r\n if (columnGroup && columnGroup.children) {\r\n columnGroup.children.forEach((column) => {\r\n this.props.gridApi.setColumnsVisible([column.key as string], direction === \"right\");\r\n });\r\n }\r\n } else {\r\n this.props.gridApi.setColumnsVisible([columnKey], direction === \"right\");\r\n }\r\n }\r\n });\r\n };\r\n\r\n render() {\r\n const {columnDefinitions, columnModel, gridApi, type, ...restProps} = this.props;\r\n const columns = getColumns(columnDefinitions, gridApi);\r\n const visibleColumnIds = columnModel.filter((column) => !column.hide).map((column) => column.colId) as string[];\r\n if (type === ColumnTransferType.SIMPLE) {\r\n const columnsTree = getColumnsTree(columns);\r\n return (<Tree<TreeNodeType>\r\n blockNode\r\n checkable\r\n defaultExpandAll\r\n checkedKeys={visibleColumnIds}\r\n onCheck={(selectedKeys, {node,},) => {\r\n const selectedColumnId: string = (node as any).props?.eventKey ? (node as any).props.eventKey : \"\";\r\n const visible = Array.isArray(selectedKeys) && selectedKeys.indexOf(selectedColumnId) >= 0;\r\n if (selectedColumnId.indexOf(\"_group_\") >= 0) {\r\n const columnGroup: ColumnNode | undefined = _head(columnsTree.filter((columnGroup) => {\r\n return columnGroup.key === selectedColumnId;\r\n }));\r\n if (columnGroup && columnGroup.children) {\r\n columnGroup.children.forEach((column) => {\r\n this.props.gridApi.setColumnsVisible([column.key as string], visible);\r\n });\r\n }\r\n } else {\r\n this.props.gridApi.setColumnsVisible([selectedColumnId], visible);\r\n }\r\n }}\r\n treeData={generateSimpleTree(columnsTree)}\r\n />);\r\n } else {\r\n const titles = [<b>{i18n(\"Hidden Columns\")}:</b>, <b>{i18n(\"Shown Columns\")}:</b>] as unknown as string[]; // special hack to overcome typescript titles attribute in Transfer component could be also [ReactElement, ReactElement]\r\n return (\r\n <Transfer {...restProps}\r\n style={{height: this.props.height, minHeight: 100}}\r\n locale={{\r\n itemUnit: \"\",\r\n itemsUnit: \"\",\r\n notFoundContent: i18n('The column list is empty'),\r\n searchPlaceholder: i18n('Column Name')\r\n }}\r\n targetKeys={visibleColumnIds}\r\n dataSource={columns}\r\n className=\"tree-transfer\"\r\n render={item => item.title ? item.title : null}\r\n showSelectAll={true}\r\n titles={titles}\r\n filterOption={(inputValue, item) => !!item.title && item.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1}\r\n showSearch\r\n onChange={this.onChange}>\r\n {({direction, onItemSelect, selectedKeys, filteredItems, onItemSelectAll}) => {\r\n if (direction === 'left') {\r\n const checkedKeys = [...selectedKeys];\r\n const columnsTree = getColumnsTree(columns, filteredItems);\r\n const selectNode = (node: ColumnNode, checked: boolean) => {\r\n if (node.children?.length) {\r\n onItemSelectAll(node.children.map((child) => child.key as string), checked);\r\n } else {\r\n onItemSelect(node.key as string, checked);\r\n }\r\n };\r\n return (\r\n <div style={{\r\n overflowY: \"auto\",\r\n height: (this.props.height ? this.props.height : 100) - 100\r\n }}>\r\n <Tree<TreeNodeType>\r\n key={columnsTree.filter((node) => node.children).map((node) => node.key).join()}\r\n blockNode\r\n checkable\r\n defaultExpandAll\r\n checkedKeys={checkedKeys}\r\n onCheck={(_, {node, checked}) => {\r\n selectNode(node, checked);\r\n }}\r\n onSelect={(_, {node}) => {\r\n const keys = node.children?.length ? node.children.map((child) => child.key as string) : [node.key as string];\r\n selectNode(node, !keys.every((key) => isChecked(checkedKeys, key)));\r\n }}\r\n treeData={generateTree(columnsTree, visibleColumnIds)}\r\n />\r\n </div>\r\n );\r\n } else {\r\n const rowSelection: TableRowSelection<ColumnNode> = {\r\n getCheckboxProps: item => {\r\n return {disabled: !!item.disabled};\r\n },\r\n onChange(selectedRowKeys) {\r\n const addedKeys = difference(selectedRowKeys, selectedKeys) as string[];\r\n const removedKeys = difference(selectedKeys, selectedRowKeys) as string[];\r\n if (addedKeys.length > 0) {\r\n onItemSelectAll(addedKeys, true);\r\n }\r\n if (removedKeys.length > 0) {\r\n onItemSelectAll(removedKeys, false);\r\n }\r\n },\r\n preserveSelectedRowKeys: true,\r\n selectedRowKeys: selectedKeys,\r\n };\r\n\r\n return (\r\n <div style={{\r\n overflowY: \"auto\",\r\n height: (this.props.height ? this.props.height : 100) - 100\r\n }}>\r\n <DragSortingTable<ColumnNode>\r\n showHeader={false}\r\n pagination={false}\r\n rowSelection={rowSelection}\r\n columns={[\r\n {\r\n dataIndex: 'title',\r\n title: 'Name',\r\n },\r\n ]}\r\n dataSource={filteredItems}\r\n size=\"small\"\r\n onRow={({key, disabled: itemDisabled}) => ({\r\n onClick: () => {\r\n if (itemDisabled) {\r\n return;\r\n }\r\n onItemSelect(key as string, !selectedKeys.includes(key as string));\r\n },\r\n })}\r\n onMoveRow={(column: ColumnNode, _: number, toIndex: number) => {\r\n this.props.gridApi.moveColumns([column.key as string], toIndex);\r\n }}\r\n />\r\n </div>\r\n );\r\n }\r\n }}\r\n </Transfer>\r\n );\r\n }\r\n };\r\n}\r\n\r\n"]}
@@ -3,24 +3,43 @@ import { CollapseProps } from 'antd';
3
3
  import { RowStyleRule } from "d2coreui/components/grid/cell/tableDefaultRowStyleRules";
4
4
  import { ColumnState, GridApi } from "ag-grid-community";
5
5
  import { DataGridColDef } from "../dataGrid";
6
+ /** Properties of {@link DataGridEditor}. */
6
7
  interface DataGridEditorProps {
8
+ /** The owning `DataGrid`; its `changePagination`, `showMilliseconds`, `showYear` and `showUtcOffset` methods apply the general settings. */
7
9
  dataGrid: any;
10
+ /** API of the grid; column changes and the column revert are applied to it directly. */
8
11
  gridApi: GridApi;
12
+ /** Column definitions of the grid, listed in the columns section. */
9
13
  columnDefinitions: DataGridColDef[];
14
+ /** Current column state of the grid, determines which columns are checked as visible. */
10
15
  columnModel: ColumnState[];
16
+ /** Number of rows per page currently displayed; the fixed page size shown in the editor. Its value at mount is used when switching from automatic to fixed paging (20 if it is not greater than 1). */
11
17
  currentPageSize: number;
18
+ /** Configured page size: `-1` no paging, `0` automatic, a positive number fixed. */
12
19
  paginationPageSize: number;
20
+ /** Page size restored by the revert button of the general section; `0` (automatic) when not set. */
13
21
  paginationDefaultPageSize?: number;
22
+ /** Whether date-time columns show milliseconds. */
14
23
  showMilliseconds: boolean;
24
+ /** Value of `showMilliseconds` restored by the revert button. */
15
25
  defaultShowMilliseconds: boolean;
26
+ /** Whether date columns show the year. */
16
27
  showYear: boolean;
28
+ /** Value of `showYear` restored by the revert button. */
17
29
  defaultShowYear: boolean;
30
+ /** Whether date-time columns show the UTC offset. */
18
31
  showUtcOffset: boolean;
32
+ /** Value of `showUtcOffset` restored by the revert button. */
19
33
  defaultShowUtcOffset: boolean;
34
+ /** Row style rules restored (as a deep copy) by the revert button of the row styling section; without them the button does nothing. */
20
35
  defaultRowStyleRules?: RowStyleRule[];
36
+ /** Row style rules edited in the row styling section, one {@link RowStylePicker} per rule. */
21
37
  rowStyleRules: RowStyleRule[];
38
+ /** Called after a rule was edited, with the same `rowStyleRules` array modified in place, or with a copy of `defaultRowStyleRules` on revert. */
22
39
  onChangeRowStyleRules?(rowStyleRules: RowStyleRule[]): void;
40
+ /** Whether the drawer is open. */
23
41
  visible: boolean;
42
+ /** Called with `false` when the user closes the drawer. */
24
43
  onTableConfigVisible(visible: boolean): void;
25
44
  }
26
45
  interface DataGridEditorState {
@@ -29,15 +48,27 @@ interface DataGridEditorState {
29
48
  windowName: string;
30
49
  configurationChangesDisabled: boolean;
31
50
  }
51
+ /**
52
+ * Advanced settings drawer of `DataGrid`, opened from its settings menu. Its collapsible sections let the user
53
+ * save, export or revert the window configuration (through {@link PlatformSpecific}), switch paging and date-time
54
+ * formatting, show/hide columns (a {@link ColumnTransfer}) and edit the row style rules. Changes are applied immediately;
55
+ * saving the window configuration is disabled when {@link PlatformSpecific} disallows configuration changes.
56
+ */
32
57
  export default class DataGridEditor extends React.Component<DataGridEditorProps, DataGridEditorState> {
33
58
  constructor(props: Readonly<DataGridEditorProps>);
34
59
  componentDidMount(): void;
60
+ /** Stores the given keys in the component state; not used by the rendered UI. */
35
61
  onChange(targetKeys: string[]): void;
36
62
  render(): React.JSX.Element;
63
+ /** Returns the window configuration section (save, export, revert to predefined or factory state). */
37
64
  getWindowSettingsPanel(): NonNullable<CollapseProps['items']>[number];
65
+ /** Returns the general table section (paging, year, milliseconds and UTC offset in date-time values). */
38
66
  renderTableGeneralSettingsPanel(): NonNullable<CollapseProps['items']>[number];
67
+ /** Returns the column visibility section; its revert button resets the ag-grid column state. */
39
68
  renderTableColumnSettingsPanel(): NonNullable<CollapseProps['items']>[number];
69
+ /** Returns the row styling section. */
40
70
  renderRowsPanel(): NonNullable<CollapseProps['items']>[number];
71
+ /** Renders the {@link RowStylePicker} of the rule at `index` of `rowStyleRules`. */
41
72
  renderRowStyleRule(rowStyleRule: RowStyleRule, index: number): React.JSX.Element;
42
73
  }
43
74
  export {};
@@ -9,6 +9,12 @@ import { ModalDialog } from "d2coreui/components/modal/modalDialog";
9
9
  import { UndoIcon } from "d2coreui/components/icons/undoIcon";
10
10
  import PlatformSpecific from "d2coreui/components/platformSpecific";
11
11
  const REVERT_BUTTON_STYLE = { marginTop: -5 };
12
+ /**
13
+ * Advanced settings drawer of `DataGrid`, opened from its settings menu. Its collapsible sections let the user
14
+ * save, export or revert the window configuration (through {@link PlatformSpecific}), switch paging and date-time
15
+ * formatting, show/hide columns (a {@link ColumnTransfer}) and edit the row style rules. Changes are applied immediately;
16
+ * saving the window configuration is disabled when {@link PlatformSpecific} disallows configuration changes.
17
+ */
12
18
  export default class DataGridEditor extends React.Component {
13
19
  constructor(props) {
14
20
  super(props);
@@ -26,6 +32,7 @@ export default class DataGridEditor extends React.Component {
26
32
  windowName: PlatformSpecific.INSTANCE.getCurrentWindowName()
27
33
  });
28
34
  }
35
+ /** Stores the given keys in the component state; not used by the rendered UI. */
29
36
  onChange(targetKeys) {
30
37
  this.setState({ targetKeys });
31
38
  }
@@ -47,6 +54,7 @@ export default class DataGridEditor extends React.Component {
47
54
  this.props.rowStyleRules && this.renderRowsPanel(),
48
55
  ] })));
49
56
  }
57
+ /** Returns the window configuration section (save, export, revert to predefined or factory state). */
50
58
  getWindowSettingsPanel() {
51
59
  return {
52
60
  key: "window-settings",
@@ -60,7 +68,7 @@ export default class DataGridEditor extends React.Component {
60
68
  React.createElement("div", { style: { paddingRight: 16, paddingLeft: 16, paddingBottom: 8 } },
61
69
  React.createElement(Button, { type: "primary", style: { width: "100%" }, disabled: this.state.configurationChangesDisabled, title: i18n("Save current window configuration for current user"), onClick: () => {
62
70
  ModalDialog.confirm({
63
- mode: "YES_NO",
71
+ mode: "YES_NO" /* ModalDialogMode.YES_NO */,
64
72
  title: React.createElement("span", { style: { whiteSpace: "nowrap" } }, i18n("Save Window Configuration") + "?"),
65
73
  width: 400,
66
74
  onOk: () => {
@@ -87,6 +95,7 @@ export default class DataGridEditor extends React.Component {
87
95
  i18n("Revert to factory configuration")))))
88
96
  };
89
97
  }
98
+ /** Returns the general table section (paging, year, milliseconds and UTC offset in date-time values). */
90
99
  renderTableGeneralSettingsPanel() {
91
100
  const paginationEnabled = this.props.paginationPageSize >= 0;
92
101
  const automaticPagination = this.props.paginationPageSize === 0;
@@ -148,6 +157,7 @@ export default class DataGridEditor extends React.Component {
148
157
  } })))))
149
158
  };
150
159
  }
160
+ /** Returns the column visibility section; its revert button resets the ag-grid column state. */
151
161
  renderTableColumnSettingsPanel() {
152
162
  return {
153
163
  key: "columns",
@@ -157,9 +167,10 @@ export default class DataGridEditor extends React.Component {
157
167
  e.nativeEvent.stopImmediatePropagation();
158
168
  this.props.gridApi.resetColumnState();
159
169
  } })),
160
- children: (React.createElement(ColumnTransfer, { columnDefinitions: this.props.columnDefinitions, columnModel: this.props.columnModel, type: "simple", gridApi: this.props.gridApi }))
170
+ children: (React.createElement(ColumnTransfer, { columnDefinitions: this.props.columnDefinitions, columnModel: this.props.columnModel, type: "simple" /* ColumnTransferType.SIMPLE */, gridApi: this.props.gridApi }))
161
171
  };
162
172
  }
173
+ /** Returns the row styling section. */
163
174
  renderRowsPanel() {
164
175
  return {
165
176
  key: "rows",
@@ -177,6 +188,7 @@ export default class DataGridEditor extends React.Component {
177
188
  children: (React.createElement("div", null, this.props.rowStyleRules.map((rowStyleRule, index) => this.renderRowStyleRule(rowStyleRule, index))))
178
189
  };
179
190
  }
191
+ /** Renders the {@link RowStylePicker} of the rule at `index` of `rowStyleRules`. */
180
192
  renderRowStyleRule(rowStyleRule, index) {
181
193
  return (React.createElement(RowStylePicker, { key: "row-style-picker-" + index, rowStyleRule: rowStyleRule, onChange: (rowStyleRule) => {
182
194
  this.props.rowStyleRules[index] = rowStyleRule;
@@ -1 +1 @@
1
- {"version":3,"file":"dataGridEditor.js","sourceRoot":"","sources":["../../../../../components/grid/config/dataGridEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAiB,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM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AAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBAC/D,CAAC;YACL,CAAC,GAAG,CACP,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from \"react\";\r\nimport {DownloadOutlined, SaveOutlined, SettingOutlined} from \"@ant-design/icons\";\r\nimport {Button, Collapse, CollapseProps, Drawer, InputNumber, notification, Space, Switch} from 'antd';\r\nimport i18n from \"d2core/i18n/i18n\"\r\nimport ColumnTransfer, {ColumnTransferType} from \"./columnTransfer\";\r\nimport RowStylePicker from \"./rowStylePicker\";\r\nimport cloneDeep from \"lodash/cloneDeep\"\r\nimport {RowStyleRule} from \"d2coreui/components/grid/cell/tableDefaultRowStyleRules\";\r\nimport {ColDef, ColumnState, GridApi} from \"ag-grid-community\";\r\nimport {DataGridColDef} from \"../dataGrid\";\r\nimport {ModalDialog, ModalDialogMode} from \"d2coreui/components/modal/modalDialog\";\r\nimport {UndoIcon} from \"d2coreui/components/icons/undoIcon\";\r\nimport PlatformSpecific from \"d2coreui/components/platformSpecific\";\r\n\r\nconst REVERT_BUTTON_STYLE = {marginTop: -5};\r\n\r\ninterface DataGridEditorProps {\r\n dataGrid: any\r\n gridApi: GridApi\r\n columnDefinitions: DataGridColDef[]\r\n columnModel: ColumnState[]\r\n\r\n currentPageSize: number\r\n paginationPageSize: number\r\n paginationDefaultPageSize?: number\r\n showMilliseconds: boolean\r\n defaultShowMilliseconds: boolean\r\n showYear: boolean\r\n defaultShowYear: boolean\r\n showUtcOffset: boolean\r\n defaultShowUtcOffset: boolean\r\n\r\n defaultRowStyleRules?: RowStyleRule[]\r\n rowStyleRules: RowStyleRule[]\r\n\r\n onChangeRowStyleRules?(rowStyleRules: RowStyleRule[]): void\r\n\r\n visible: boolean\r\n\r\n onTableConfigVisible(visible: boolean): void\r\n}\r\n\r\ninterface DataGridEditorState {\r\n targetKeys: string[]\r\n initialPageSize: number\r\n windowName: string\r\n configurationChangesDisabled: boolean\r\n}\r\n\r\nexport default class DataGridEditor extends React.Component<DataGridEditorProps, DataGridEditorState> {\r\n constructor(props: Readonly<DataGridEditorProps>) {\r\n super(props);\r\n this.state = {\r\n targetKeys: [],\r\n initialPageSize: props.currentPageSize,\r\n windowName: \"\",\r\n configurationChangesDisabled: PlatformSpecific.INSTANCE.configurationChangesDisabled()\r\n };\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n initialPageSize: this.props.currentPageSize,\r\n windowName: PlatformSpecific.INSTANCE.getCurrentWindowName()\r\n });\r\n }\r\n\r\n onChange(targetKeys: string[]) {\r\n this.setState({targetKeys});\r\n };\r\n\r\n render() {\r\n return (\r\n <Drawer\r\n title={<div style={{width: \"100%\", paddingRight: 24}}>\r\n <SettingOutlined/> {i18n(\"Advanced Settings\")}\r\n </div>}\r\n placement=\"right\"\r\n closable={true}\r\n mask={true}\r\n width={340}\r\n onClose={() => {\r\n this.props.onTableConfigVisible(false);\r\n }}\r\n open={this.props.visible}\r\n style={{borderTop: \"1px solid #ddd\"}}\r\n styles={{\r\n body: {padding: 0},\r\n mask: {background: \"transparent\"}\r\n }}\r\n >\r\n <Collapse defaultActiveKey={[]}\r\n bordered={false}\r\n items={[\r\n this.getWindowSettingsPanel(),\r\n this.renderTableGeneralSettingsPanel(),\r\n this.renderTableColumnSettingsPanel(),\r\n this.props.rowStyleRules && this.renderRowsPanel(),\r\n ]} />\r\n </Drawer>\r\n );\r\n }\r\n\r\n getWindowSettingsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n return {\r\n key: \"window-settings\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Window\") + \" \\\"\" + this.state.windowName + \" \\\"\"}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>} key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n PlatformSpecific.INSTANCE.reloadPageInPredefinedState();\r\n }}/>\r\n ),\r\n children: (\r\n <>\r\n <div style={{paddingRight: 16, paddingLeft: 16, paddingBottom: 8}}>\r\n <Button type=\"primary\" style={{width: \"100%\"}}\r\n disabled={this.state.configurationChangesDisabled}\r\n title={i18n(\"Save current window configuration for current user\")}\r\n onClick={() => {\r\n ModalDialog.confirm({\r\n mode: ModalDialogMode.YES_NO,\r\n title: <span\r\n style={{whiteSpace: \"nowrap\"}}>{i18n(\"Save Window Configuration\") + \"?\"}</span>,\r\n width: 400,\r\n onOk: () => {\r\n PlatformSpecific.INSTANCE.saveWindowConfiguration();\r\n notification['success']({\r\n message: i18n(\"Window configuration saved successfully\"),\r\n })\r\n },\r\n });\r\n\r\n }}>\r\n <SaveOutlined/>{i18n(\"Save Window Configuration\")}\r\n </Button>\r\n </div>\r\n <div style={{paddingRight: 16, paddingLeft: 16, paddingBottom: 8}}>\r\n <Button style={{width: \"100%\"}}\r\n title={i18n(\"Export current window configuration to file\")}\r\n onClick={() => {\r\n PlatformSpecific.INSTANCE.exportWindowConfiguration();\r\n }}>\r\n <DownloadOutlined/>{i18n(\"Export Window Configuration\")}\r\n </Button>\r\n </div>\r\n <div style={{paddingRight: 16, paddingLeft: 16, paddingBottom: 8}}>\r\n <Button danger ghost\r\n style={{width: \"100%\"}}\r\n onClick={() => {\r\n PlatformSpecific.INSTANCE.reloadPageInFactoryState();\r\n }}>\r\n <UndoIcon/>{i18n(\"Revert to factory configuration\")}\r\n </Button>\r\n </div>\r\n </>\r\n )\r\n };\r\n }\r\n\r\n renderTableGeneralSettingsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n const paginationEnabled = this.props.paginationPageSize >= 0;\r\n const automaticPagination = this.props.paginationPageSize === 0;\r\n return {\r\n key: \"general\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Table - General Settings\")}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>}\r\n key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n if (this.props.paginationDefaultPageSize !== undefined) {\r\n this.props.dataGrid.changePagination(this.props.paginationDefaultPageSize);\r\n } else {\r\n this.props.dataGrid.changePagination(0);\r\n }\r\n this.props.dataGrid.showMilliseconds(this.props.defaultShowMilliseconds);\r\n this.props.dataGrid.showYear(this.props.defaultShowYear);\r\n this.props.dataGrid.showUtcOffset(this.props.defaultShowUtcOffset);\r\n }}/>\r\n ),\r\n children: (\r\n <Space direction=\"vertical\" style={{width: \"100%\"}}>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Pagination\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Enabled\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"Disabled\"))}\r\n checked={paginationEnabled}\r\n onChange={(checked) => {\r\n this.props.dataGrid.changePagination(checked ? 0 : -1);\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Page Size\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <InputNumber\r\n size=\"small\"\r\n style={{\r\n width: 70,\r\n display: !paginationEnabled || automaticPagination ? \"none\" : \"\",\r\n marginLeft: 8\r\n }}\r\n placeholder=\"size\"\r\n className=\"custom\"\r\n value={this.props.currentPageSize}\r\n onChange={(pageSize) => {\r\n if (pageSize) {\r\n this.props.dataGrid.changePagination(pageSize);\r\n }\r\n }}\r\n />\r\n <Switch disabled={!paginationEnabled}\r\n style={{minWidth: 100}}\r\n checkedChildren={i18n(\"Automatic\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"Fixed\"))}\r\n checked={!paginationEnabled || automaticPagination}\r\n onChange={(checked) => {\r\n this.props.dataGrid.changePagination(checked ? 0 : (this.state.initialPageSize > 1 ? this.state.initialPageSize : 20));\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Show time with year\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Yes\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"No\"))}\r\n checked={this.props.showYear}\r\n onChange={(checked) => {\r\n this.props.dataGrid.showYear(checked);\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Show time with milliseconds\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Yes\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"No\"))}\r\n checked={this.props.showMilliseconds}\r\n onChange={(checked) => {\r\n this.props.dataGrid.showMilliseconds(checked);\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Show time with time zone\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Yes\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"No\"))}\r\n checked={this.props.showUtcOffset}\r\n onChange={(checked) => {\r\n this.props.dataGrid.showUtcOffset(checked);\r\n }}/>\r\n </span>\r\n </div>\r\n </Space>\r\n )\r\n };\r\n }\r\n\r\n renderTableColumnSettingsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n return {\r\n key: \"columns\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Table - Columns\")}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>}\r\n key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n this.props.gridApi.resetColumnState();\r\n }}/>\r\n ),\r\n children: (\r\n <ColumnTransfer\r\n columnDefinitions={this.props.columnDefinitions as ColDef[]}\r\n columnModel={this.props.columnModel}\r\n type={ColumnTransferType.SIMPLE}\r\n gridApi={this.props.gridApi}\r\n />\r\n )\r\n };\r\n }\r\n\r\n renderRowsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n return {\r\n key: \"rows\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Table - Rows Styling\")}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>}\r\n key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n if (this.props.defaultRowStyleRules) {\r\n const rowStyleRules = cloneDeep(this.props.defaultRowStyleRules);\r\n if (this.props.onChangeRowStyleRules) {\r\n this.props.onChangeRowStyleRules(rowStyleRules);\r\n }\r\n }\r\n }}/>\r\n ),\r\n children: (\r\n <div>\r\n {this.props.rowStyleRules.map((rowStyleRule, index) => this.renderRowStyleRule(rowStyleRule, index))}\r\n </div>\r\n )\r\n };\r\n }\r\n\r\n renderRowStyleRule(rowStyleRule: RowStyleRule, index: number) {\r\n return (\r\n <RowStylePicker key={\"row-style-picker-\" + index} rowStyleRule={rowStyleRule} onChange={(rowStyleRule) => {\r\n this.props.rowStyleRules[index] = rowStyleRule;\r\n if (this.props.onChangeRowStyleRules) {\r\n this.props.onChangeRowStyleRules(this.props.rowStyleRules);\r\n }\r\n }}/>\r\n );\r\n }\r\n}"]}
1
+ {"version":3,"file":"dataGridEditor.js","sourceRoot":"","sources":["../../../../../components/grid/config/dataGridEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAiB,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM,MAAM,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GAAG,YAAY,CAAC;gBAC/C,IAAI,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;oBACnC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBAC/D,CAAC;YACL,CAAC,GAAG,CACP,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from \"react\";\r\nimport {DownloadOutlined, SaveOutlined, SettingOutlined} from \"@ant-design/icons\";\r\nimport {Button, Collapse, CollapseProps, Drawer, InputNumber, notification, Space, Switch} from 'antd';\r\nimport i18n from \"d2core/i18n/i18n\"\r\nimport ColumnTransfer, {ColumnTransferType} from \"./columnTransfer\";\r\nimport RowStylePicker from \"./rowStylePicker\";\r\nimport cloneDeep from \"lodash/cloneDeep\"\r\nimport {RowStyleRule} from \"d2coreui/components/grid/cell/tableDefaultRowStyleRules\";\r\nimport {ColDef, ColumnState, GridApi} from \"ag-grid-community\";\r\nimport {DataGridColDef} from \"../dataGrid\";\r\nimport {ModalDialog, ModalDialogMode} from \"d2coreui/components/modal/modalDialog\";\r\nimport {UndoIcon} from \"d2coreui/components/icons/undoIcon\";\r\nimport PlatformSpecific from \"d2coreui/components/platformSpecific\";\r\n\r\nconst REVERT_BUTTON_STYLE = {marginTop: -5};\r\n\r\n/** Properties of {@link DataGridEditor}. */\r\ninterface DataGridEditorProps {\r\n /** The owning `DataGrid`; its `changePagination`, `showMilliseconds`, `showYear` and `showUtcOffset` methods apply the general settings. */\r\n dataGrid: any\r\n /** API of the grid; column changes and the column revert are applied to it directly. */\r\n gridApi: GridApi\r\n /** Column definitions of the grid, listed in the columns section. */\r\n columnDefinitions: DataGridColDef[]\r\n /** Current column state of the grid, determines which columns are checked as visible. */\r\n columnModel: ColumnState[]\r\n\r\n /** Number of rows per page currently displayed; the fixed page size shown in the editor. Its value at mount is used when switching from automatic to fixed paging (20 if it is not greater than 1). */\r\n currentPageSize: number\r\n /** Configured page size: `-1` no paging, `0` automatic, a positive number fixed. */\r\n paginationPageSize: number\r\n /** Page size restored by the revert button of the general section; `0` (automatic) when not set. */\r\n paginationDefaultPageSize?: number\r\n /** Whether date-time columns show milliseconds. */\r\n showMilliseconds: boolean\r\n /** Value of `showMilliseconds` restored by the revert button. */\r\n defaultShowMilliseconds: boolean\r\n /** Whether date columns show the year. */\r\n showYear: boolean\r\n /** Value of `showYear` restored by the revert button. */\r\n defaultShowYear: boolean\r\n /** Whether date-time columns show the UTC offset. */\r\n showUtcOffset: boolean\r\n /** Value of `showUtcOffset` restored by the revert button. */\r\n defaultShowUtcOffset: boolean\r\n\r\n /** Row style rules restored (as a deep copy) by the revert button of the row styling section; without them the button does nothing. */\r\n defaultRowStyleRules?: RowStyleRule[]\r\n /** Row style rules edited in the row styling section, one {@link RowStylePicker} per rule. */\r\n rowStyleRules: RowStyleRule[]\r\n\r\n /** Called after a rule was edited, with the same `rowStyleRules` array modified in place, or with a copy of `defaultRowStyleRules` on revert. */\r\n onChangeRowStyleRules?(rowStyleRules: RowStyleRule[]): void\r\n\r\n /** Whether the drawer is open. */\r\n visible: boolean\r\n\r\n /** Called with `false` when the user closes the drawer. */\r\n onTableConfigVisible(visible: boolean): void\r\n}\r\n\r\ninterface DataGridEditorState {\r\n targetKeys: string[]\r\n initialPageSize: number\r\n windowName: string\r\n configurationChangesDisabled: boolean\r\n}\r\n\r\n/**\r\n * Advanced settings drawer of `DataGrid`, opened from its settings menu. Its collapsible sections let the user\r\n * save, export or revert the window configuration (through {@link PlatformSpecific}), switch paging and date-time\r\n * formatting, show/hide columns (a {@link ColumnTransfer}) and edit the row style rules. Changes are applied immediately;\r\n * saving the window configuration is disabled when {@link PlatformSpecific} disallows configuration changes.\r\n */\r\nexport default class DataGridEditor extends React.Component<DataGridEditorProps, DataGridEditorState> {\r\n constructor(props: Readonly<DataGridEditorProps>) {\r\n super(props);\r\n this.state = {\r\n targetKeys: [],\r\n initialPageSize: props.currentPageSize,\r\n windowName: \"\",\r\n configurationChangesDisabled: PlatformSpecific.INSTANCE.configurationChangesDisabled()\r\n };\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n initialPageSize: this.props.currentPageSize,\r\n windowName: PlatformSpecific.INSTANCE.getCurrentWindowName()\r\n });\r\n }\r\n\r\n /** Stores the given keys in the component state; not used by the rendered UI. */\r\n onChange(targetKeys: string[]) {\r\n this.setState({targetKeys});\r\n };\r\n\r\n render() {\r\n return (\r\n <Drawer\r\n title={<div style={{width: \"100%\", paddingRight: 24}}>\r\n <SettingOutlined/> {i18n(\"Advanced Settings\")}\r\n </div>}\r\n placement=\"right\"\r\n closable={true}\r\n mask={true}\r\n width={340}\r\n onClose={() => {\r\n this.props.onTableConfigVisible(false);\r\n }}\r\n open={this.props.visible}\r\n style={{borderTop: \"1px solid #ddd\"}}\r\n styles={{\r\n body: {padding: 0},\r\n mask: {background: \"transparent\"}\r\n }}\r\n >\r\n <Collapse defaultActiveKey={[]}\r\n bordered={false}\r\n items={[\r\n this.getWindowSettingsPanel(),\r\n this.renderTableGeneralSettingsPanel(),\r\n this.renderTableColumnSettingsPanel(),\r\n this.props.rowStyleRules && this.renderRowsPanel(),\r\n ]} />\r\n </Drawer>\r\n );\r\n }\r\n\r\n /** Returns the window configuration section (save, export, revert to predefined or factory state). */\r\n getWindowSettingsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n return {\r\n key: \"window-settings\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Window\") + \" \\\"\" + this.state.windowName + \" \\\"\"}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>} key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n PlatformSpecific.INSTANCE.reloadPageInPredefinedState();\r\n }}/>\r\n ),\r\n children: (\r\n <>\r\n <div style={{paddingRight: 16, paddingLeft: 16, paddingBottom: 8}}>\r\n <Button type=\"primary\" style={{width: \"100%\"}}\r\n disabled={this.state.configurationChangesDisabled}\r\n title={i18n(\"Save current window configuration for current user\")}\r\n onClick={() => {\r\n ModalDialog.confirm({\r\n mode: ModalDialogMode.YES_NO,\r\n title: <span\r\n style={{whiteSpace: \"nowrap\"}}>{i18n(\"Save Window Configuration\") + \"?\"}</span>,\r\n width: 400,\r\n onOk: () => {\r\n PlatformSpecific.INSTANCE.saveWindowConfiguration();\r\n notification['success']({\r\n message: i18n(\"Window configuration saved successfully\"),\r\n })\r\n },\r\n });\r\n\r\n }}>\r\n <SaveOutlined/>{i18n(\"Save Window Configuration\")}\r\n </Button>\r\n </div>\r\n <div style={{paddingRight: 16, paddingLeft: 16, paddingBottom: 8}}>\r\n <Button style={{width: \"100%\"}}\r\n title={i18n(\"Export current window configuration to file\")}\r\n onClick={() => {\r\n PlatformSpecific.INSTANCE.exportWindowConfiguration();\r\n }}>\r\n <DownloadOutlined/>{i18n(\"Export Window Configuration\")}\r\n </Button>\r\n </div>\r\n <div style={{paddingRight: 16, paddingLeft: 16, paddingBottom: 8}}>\r\n <Button danger ghost\r\n style={{width: \"100%\"}}\r\n onClick={() => {\r\n PlatformSpecific.INSTANCE.reloadPageInFactoryState();\r\n }}>\r\n <UndoIcon/>{i18n(\"Revert to factory configuration\")}\r\n </Button>\r\n </div>\r\n </>\r\n )\r\n };\r\n }\r\n\r\n /** Returns the general table section (paging, year, milliseconds and UTC offset in date-time values). */\r\n renderTableGeneralSettingsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n const paginationEnabled = this.props.paginationPageSize >= 0;\r\n const automaticPagination = this.props.paginationPageSize === 0;\r\n return {\r\n key: \"general\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Table - General Settings\")}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>}\r\n key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n if (this.props.paginationDefaultPageSize !== undefined) {\r\n this.props.dataGrid.changePagination(this.props.paginationDefaultPageSize);\r\n } else {\r\n this.props.dataGrid.changePagination(0);\r\n }\r\n this.props.dataGrid.showMilliseconds(this.props.defaultShowMilliseconds);\r\n this.props.dataGrid.showYear(this.props.defaultShowYear);\r\n this.props.dataGrid.showUtcOffset(this.props.defaultShowUtcOffset);\r\n }}/>\r\n ),\r\n children: (\r\n <Space direction=\"vertical\" style={{width: \"100%\"}}>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Pagination\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Enabled\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"Disabled\"))}\r\n checked={paginationEnabled}\r\n onChange={(checked) => {\r\n this.props.dataGrid.changePagination(checked ? 0 : -1);\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Page Size\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <InputNumber\r\n size=\"small\"\r\n style={{\r\n width: 70,\r\n display: !paginationEnabled || automaticPagination ? \"none\" : \"\",\r\n marginLeft: 8\r\n }}\r\n placeholder=\"size\"\r\n className=\"custom\"\r\n value={this.props.currentPageSize}\r\n onChange={(pageSize) => {\r\n if (pageSize) {\r\n this.props.dataGrid.changePagination(pageSize);\r\n }\r\n }}\r\n />\r\n <Switch disabled={!paginationEnabled}\r\n style={{minWidth: 100}}\r\n checkedChildren={i18n(\"Automatic\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"Fixed\"))}\r\n checked={!paginationEnabled || automaticPagination}\r\n onChange={(checked) => {\r\n this.props.dataGrid.changePagination(checked ? 0 : (this.state.initialPageSize > 1 ? this.state.initialPageSize : 20));\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Show time with year\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Yes\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"No\"))}\r\n checked={this.props.showYear}\r\n onChange={(checked) => {\r\n this.props.dataGrid.showYear(checked);\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Show time with milliseconds\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Yes\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"No\"))}\r\n checked={this.props.showMilliseconds}\r\n onChange={(checked) => {\r\n this.props.dataGrid.showMilliseconds(checked);\r\n }}/>\r\n </span>\r\n </div>\r\n <div style={{width: \"100%\"}}>\r\n <span>{i18n(\"Show time with time zone\")}</span>\r\n <span style={{float: \"right\"}}>\r\n <Switch checkedChildren={i18n(\"Yes\") + \" \"}\r\n unCheckedChildren={i18n(\" \" + i18n(\"No\"))}\r\n checked={this.props.showUtcOffset}\r\n onChange={(checked) => {\r\n this.props.dataGrid.showUtcOffset(checked);\r\n }}/>\r\n </span>\r\n </div>\r\n </Space>\r\n )\r\n };\r\n }\r\n\r\n /** Returns the column visibility section; its revert button resets the ag-grid column state. */\r\n renderTableColumnSettingsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n return {\r\n key: \"columns\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Table - Columns\")}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>}\r\n key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n this.props.gridApi.resetColumnState();\r\n }}/>\r\n ),\r\n children: (\r\n <ColumnTransfer\r\n columnDefinitions={this.props.columnDefinitions as ColDef[]}\r\n columnModel={this.props.columnModel}\r\n type={ColumnTransferType.SIMPLE}\r\n gridApi={this.props.gridApi}\r\n />\r\n )\r\n };\r\n }\r\n\r\n /** Returns the row styling section. */\r\n renderRowsPanel(): NonNullable<CollapseProps['items']>[number] {\r\n return {\r\n key: \"rows\",\r\n label: <span style={{fontWeight: 500}}>{i18n(\"Table - Rows Styling\")}</span>,\r\n extra: (\r\n <Button\r\n title={i18n(\"Revert configuration to predefined state\")} icon={<UndoIcon/>}\r\n key=\"revert\"\r\n style={REVERT_BUTTON_STYLE}\r\n danger\r\n ghost\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n e.nativeEvent.stopImmediatePropagation();\r\n if (this.props.defaultRowStyleRules) {\r\n const rowStyleRules = cloneDeep(this.props.defaultRowStyleRules);\r\n if (this.props.onChangeRowStyleRules) {\r\n this.props.onChangeRowStyleRules(rowStyleRules);\r\n }\r\n }\r\n }}/>\r\n ),\r\n children: (\r\n <div>\r\n {this.props.rowStyleRules.map((rowStyleRule, index) => this.renderRowStyleRule(rowStyleRule, index))}\r\n </div>\r\n )\r\n };\r\n }\r\n\r\n /** Renders the {@link RowStylePicker} of the rule at `index` of `rowStyleRules`. */\r\n renderRowStyleRule(rowStyleRule: RowStyleRule, index: number) {\r\n return (\r\n <RowStylePicker key={\"row-style-picker-\" + index} rowStyleRule={rowStyleRule} onChange={(rowStyleRule) => {\r\n this.props.rowStyleRules[index] = rowStyleRule;\r\n if (this.props.onChangeRowStyleRules) {\r\n this.props.onChangeRowStyleRules(this.props.rowStyleRules);\r\n }\r\n }}/>\r\n );\r\n }\r\n}"]}
@@ -1,8 +1,19 @@
1
1
  import { RGBColor } from "react-color";
2
+ /** Default vertical padding in pixels above and below the text of a grid row (the "Line Indentation" row style). */
2
3
  export declare const GRID_DEFAULT_ROW_HEIGHT_DELTA = 8;
4
+ /** Default grid font size in pixels. */
3
5
  export declare const GRID_DEFAULT_FONT_SIZE = 12;
6
+ /**
7
+ * Returns the grid row height in pixels: `fontSize + 2 * rowHeightDelta`.
8
+ * Arguments that are not non-zero numbers (row style values may also be strings or colors) fall back to
9
+ * {@link GRID_DEFAULT_FONT_SIZE} and {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}.
10
+ */
4
11
  export declare const calculateRowHeight: (fontSize: string | number | RGBColor | null, rowHeightDelta: string | number | RGBColor | null) => number;
12
+ /** Returns the CSS line height for a row of the given style: {@link calculateRowHeight} minus 2 pixels. */
5
13
  export declare const calculateLineHeight: (fontSize: string | number | RGBColor | null, rowHeightDelta: string | number | RGBColor | null) => number;
14
+ /** Returns the CSS line height for a row of the given height (2 pixels less). */
6
15
  export declare const getLineHeight: (rowHeight: number) => number;
16
+ /** Returns `fontSize` if it is a non-zero number, otherwise {@link GRID_DEFAULT_FONT_SIZE}. */
7
17
  export declare const getFontSize: (fontSize: string | number | RGBColor) => number;
18
+ /** Returns `rowHeightDelta` if it is a non-zero number, otherwise {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}. */
8
19
  export declare const getRowHeightDelta: (rowHeightDelta: string | number | RGBColor) => number;
@@ -1,19 +1,30 @@
1
+ /** Default vertical padding in pixels above and below the text of a grid row (the "Line Indentation" row style). */
1
2
  export const GRID_DEFAULT_ROW_HEIGHT_DELTA = 8;
3
+ /** Default grid font size in pixels. */
2
4
  export const GRID_DEFAULT_FONT_SIZE = 12;
5
+ /**
6
+ * Returns the grid row height in pixels: `fontSize + 2 * rowHeightDelta`.
7
+ * Arguments that are not non-zero numbers (row style values may also be strings or colors) fall back to
8
+ * {@link GRID_DEFAULT_FONT_SIZE} and {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}.
9
+ */
3
10
  export const calculateRowHeight = (fontSize, rowHeightDelta) => {
4
11
  const currentFontSize = fontSize && typeof fontSize === "number" ? fontSize : GRID_DEFAULT_FONT_SIZE;
5
12
  const currentRowHeightDelta = rowHeightDelta && typeof rowHeightDelta === "number" ? rowHeightDelta : GRID_DEFAULT_ROW_HEIGHT_DELTA;
6
13
  return currentFontSize + 2 * currentRowHeightDelta;
7
14
  };
15
+ /** Returns the CSS line height for a row of the given style: {@link calculateRowHeight} minus 2 pixels. */
8
16
  export const calculateLineHeight = (fontSize, rowHeightDelta) => {
9
17
  return calculateRowHeight(fontSize, rowHeightDelta) - 2;
10
18
  };
19
+ /** Returns the CSS line height for a row of the given height (2 pixels less). */
11
20
  export const getLineHeight = (rowHeight) => {
12
21
  return rowHeight - 2;
13
22
  };
23
+ /** Returns `fontSize` if it is a non-zero number, otherwise {@link GRID_DEFAULT_FONT_SIZE}. */
14
24
  export const getFontSize = (fontSize) => {
15
25
  return fontSize && typeof fontSize === "number" ? fontSize : GRID_DEFAULT_FONT_SIZE;
16
26
  };
27
+ /** Returns `rowHeightDelta` if it is a non-zero number, otherwise {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}. */
17
28
  export const getRowHeightDelta = (rowHeightDelta) => {
18
29
  return rowHeightDelta && typeof rowHeightDelta === "number" ? rowHeightDelta : GRID_DEFAULT_ROW_HEIGHT_DELTA;
19
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rowHeightCalculator.js","sourceRoot":"","sources":["../../../../../components/grid/config/rowHeightCalculator.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA2C,EAAE,cAAiD,EAAE,EAAE;IACjI,MAAM,eAAe,GAAW,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAC7G,MAAM,qBAAqB,GAAW,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAC5I,OAAO,eAAe,GAAG,CAAC,GAAG,qBAAqB,CAAC;AACvD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAA2C,EAAE,cAAiD,EAAE,EAAE;IAClI,OAAO,kBAAkB,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/C,OAAO,SAAS,GAAG,CAAC,CAAC;AACzB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAoC,EAAE,EAAE;IAChE,OAAO,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC;AACxF,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,cAA0C,EAAE,EAAE;IAC5E,OAAO,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,6BAA6B,CAAC;AACjH,CAAC,CAAA","sourcesContent":["import {RGBColor} from \"react-color\";\r\n\r\nexport const GRID_DEFAULT_ROW_HEIGHT_DELTA = 8;\r\n\r\nexport const GRID_DEFAULT_FONT_SIZE = 12;\r\n\r\nexport const calculateRowHeight = (fontSize: string | number | RGBColor | null, rowHeightDelta: string | number | RGBColor | null) => {\r\n const currentFontSize: number = fontSize && typeof fontSize === \"number\" ? fontSize : GRID_DEFAULT_FONT_SIZE;\r\n const currentRowHeightDelta: number = rowHeightDelta && typeof rowHeightDelta === \"number\" ? rowHeightDelta : GRID_DEFAULT_ROW_HEIGHT_DELTA;\r\n return currentFontSize + 2 * currentRowHeightDelta;\r\n}\r\n\r\nexport const calculateLineHeight = (fontSize: string | number | RGBColor | null, rowHeightDelta: string | number | RGBColor | null) => {\r\n return calculateRowHeight(fontSize, rowHeightDelta) - 2;\r\n}\r\n\r\nexport const getLineHeight = (rowHeight: number) => {\r\n return rowHeight - 2;\r\n}\r\n\r\nexport const getFontSize = (fontSize: string | number | RGBColor) => {\r\n return fontSize && typeof fontSize === \"number\" ? fontSize : GRID_DEFAULT_FONT_SIZE;\r\n}\r\n\r\nexport const getRowHeightDelta = (rowHeightDelta: string | number | RGBColor) => {\r\n return rowHeightDelta && typeof rowHeightDelta === \"number\" ? rowHeightDelta : GRID_DEFAULT_ROW_HEIGHT_DELTA;\r\n}\r\n\r\n\r\n"]}
1
+ {"version":3,"file":"rowHeightCalculator.js","sourceRoot":"","sources":["../../../../../components/grid/config/rowHeightCalculator.tsx"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAE/C,wCAAwC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA2C,EAAE,cAAiD,EAAE,EAAE;IACjI,MAAM,eAAe,GAAW,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAC7G,MAAM,qBAAqB,GAAW,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,6BAA6B,CAAC;IAC5I,OAAO,eAAe,GAAG,CAAC,GAAG,qBAAqB,CAAC;AACvD,CAAC,CAAA;AAED,2GAA2G;AAC3G,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAA2C,EAAE,cAAiD,EAAE,EAAE;IAClI,OAAO,kBAAkB,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC,CAAA;AAED,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/C,OAAO,SAAS,GAAG,CAAC,CAAC;AACzB,CAAC,CAAA;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAoC,EAAE,EAAE;IAChE,OAAO,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC;AACxF,CAAC,CAAA;AAED,4GAA4G;AAC5G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,cAA0C,EAAE,EAAE;IAC5E,OAAO,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,6BAA6B,CAAC;AACjH,CAAC,CAAA","sourcesContent":["import {RGBColor} from \"react-color\";\r\n\r\n/** Default vertical padding in pixels above and below the text of a grid row (the \"Line Indentation\" row style). */\r\nexport const GRID_DEFAULT_ROW_HEIGHT_DELTA = 8;\r\n\r\n/** Default grid font size in pixels. */\r\nexport const GRID_DEFAULT_FONT_SIZE = 12;\r\n\r\n/**\r\n * Returns the grid row height in pixels: `fontSize + 2 * rowHeightDelta`.\r\n * Arguments that are not non-zero numbers (row style values may also be strings or colors) fall back to\r\n * {@link GRID_DEFAULT_FONT_SIZE} and {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}.\r\n */\r\nexport const calculateRowHeight = (fontSize: string | number | RGBColor | null, rowHeightDelta: string | number | RGBColor | null) => {\r\n const currentFontSize: number = fontSize && typeof fontSize === \"number\" ? fontSize : GRID_DEFAULT_FONT_SIZE;\r\n const currentRowHeightDelta: number = rowHeightDelta && typeof rowHeightDelta === \"number\" ? rowHeightDelta : GRID_DEFAULT_ROW_HEIGHT_DELTA;\r\n return currentFontSize + 2 * currentRowHeightDelta;\r\n}\r\n\r\n/** Returns the CSS line height for a row of the given style: {@link calculateRowHeight} minus 2 pixels. */\r\nexport const calculateLineHeight = (fontSize: string | number | RGBColor | null, rowHeightDelta: string | number | RGBColor | null) => {\r\n return calculateRowHeight(fontSize, rowHeightDelta) - 2;\r\n}\r\n\r\n/** Returns the CSS line height for a row of the given height (2 pixels less). */\r\nexport const getLineHeight = (rowHeight: number) => {\r\n return rowHeight - 2;\r\n}\r\n\r\n/** Returns `fontSize` if it is a non-zero number, otherwise {@link GRID_DEFAULT_FONT_SIZE}. */\r\nexport const getFontSize = (fontSize: string | number | RGBColor) => {\r\n return fontSize && typeof fontSize === \"number\" ? fontSize : GRID_DEFAULT_FONT_SIZE;\r\n}\r\n\r\n/** Returns `rowHeightDelta` if it is a non-zero number, otherwise {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}. */\r\nexport const getRowHeightDelta = (rowHeightDelta: string | number | RGBColor) => {\r\n return rowHeightDelta && typeof rowHeightDelta === \"number\" ? rowHeightDelta : GRID_DEFAULT_ROW_HEIGHT_DELTA;\r\n}\r\n\r\n\r\n"]}
@@ -1,22 +1,41 @@
1
1
  import React from "react";
2
2
  import { ColorResult } from "react-color";
3
3
  import { RowStyleRule } from "d2coreui/components/grid/cell/tableDefaultRowStyleRules";
4
+ /** Properties of {@link RowStylePicker}. */
4
5
  interface RowStylePickerProps {
6
+ /** The rule to edit; it is modified in place. */
5
7
  rowStyleRule: RowStyleRule;
8
+ /** Called after each edit with the same, modified `rowStyleRule` object. */
6
9
  onChange: (rowStyleRule: RowStyleRule) => void;
7
10
  }
8
11
  interface RowStylePickerState {
9
12
  disableColorEdit: boolean;
10
13
  }
14
+ /** Style change passed to {@link RowStylePicker.onChange}: `undefined` leaves a property unchanged, `null` removes it. */
11
15
  interface StyleChange {
16
+ /** Text color. */
12
17
  color?: ColorResult | null;
18
+ /** Background color. */
13
19
  backgroundColor?: ColorResult | null;
20
+ /** CSS font weight, e.g. `"bold"`. */
14
21
  fontWeight?: string | null;
22
+ /** Font size in pixels. */
15
23
  fontSize?: number | null;
24
+ /** Vertical padding in pixels above and below the text, see {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}. */
16
25
  rowHeightDelta?: number | null;
17
26
  }
27
+ /**
28
+ * One row of the grid's row styling editor: the localized rule name (preceded by a divider when the rule has
29
+ * `divider`) and an editor for each style property enabled in `rowStyleRule.styleEditor` - text color, background
30
+ * color, bold, font size (10-50) and line indentation (1-28). The color and bold editors are disabled when
31
+ * {@link PlatformSpecific} disallows configuration changes.
32
+ */
18
33
  export default class RowStylePicker extends React.Component<RowStylePickerProps, RowStylePickerState> {
19
34
  constructor(props: Readonly<RowStylePickerProps>);
35
+ /**
36
+ * Applies a style change to `rowStyleRule` and calls `onChange`. A `null` property removes that style, a fully
37
+ * transparent black color removes the color, and a color with partial transparency is stored as RGBA, otherwise as hex.
38
+ */
20
39
  onChange(style: StyleChange): void;
21
40
  render(): React.JSX.Element;
22
41
  private getColor;
@@ -5,6 +5,12 @@ import i18n from "d2core/i18n/i18n";
5
5
  import PlatformSpecific from "../../platformSpecific";
6
6
  import ColorPicker from "../../color/colorPicker";
7
7
  import { GRID_DEFAULT_ROW_HEIGHT_DELTA } from "./rowHeightCalculator";
8
+ /**
9
+ * One row of the grid's row styling editor: the localized rule name (preceded by a divider when the rule has
10
+ * `divider`) and an editor for each style property enabled in `rowStyleRule.styleEditor` - text color, background
11
+ * color, bold, font size (10-50) and line indentation (1-28). The color and bold editors are disabled when
12
+ * {@link PlatformSpecific} disallows configuration changes.
13
+ */
8
14
  export default class RowStylePicker extends React.Component {
9
15
  constructor(props) {
10
16
  super(props);
@@ -13,6 +19,10 @@ export default class RowStylePicker extends React.Component {
13
19
  };
14
20
  this.onChange = this.onChange.bind(this);
15
21
  }
22
+ /**
23
+ * Applies a style change to `rowStyleRule` and calls `onChange`. A `null` property removes that style, a fully
24
+ * transparent black color removes the color, and a color with partial transparency is stored as RGBA, otherwise as hex.
25
+ */
16
26
  onChange(style) {
17
27
  const textColor = style.color;
18
28
  const rowStyleRule = this.props.rowStyleRule;
@@ -112,9 +122,11 @@ export default class RowStylePicker extends React.Component {
112
122
  } }))));
113
123
  }
114
124
  getColor() {
125
+ // @ts-ignore
115
126
  return this.props.rowStyleRule.style.color;
116
127
  }
117
128
  getBackgroundColor() {
129
+ // @ts-ignore
118
130
  return this.props.rowStyleRule.style.backgroundColor;
119
131
  }
120
132
  getFontSize() {