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":"rowStylePicker.js","sourceRoot":"","sources":["../../../../../components/grid/config/rowStylePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,MAAM,CAAC;AAClD,OAAO,IAAI,MAAM,kBAAkB,CAAC;A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IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc;oBACtF,6BAAK,KAAK,EAAE,EAAC,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAC;wBACzC,oBAAC,WAAW,IACR,KAAK,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC,EAClB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,EAAE,EACP,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAC/B,QAAQ,EAAE,CAAC,cAAc,EAAE,EAAE;gCACzB,IAAI,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;oCACvD,IAAI,CAAC,QAAQ,CAAC,EAAC,cAAc,EAAE,cAAc,EAAC,CAAC,CAAC;gCACpD,CAAC;4BACL,CAAC,GACH,CACA,CACR,CACP,CAAC;IACR,CAAC;IAEO,QAAQ;QAEZ,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC;IAC/C,CAAC;IAEO,kBAAkB;QAEtB,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC;IACzD,CAAC;IAEO,WAAW;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAkB,CAAC;IAC5D,CAAC;IAEO,iBAAiB;;QACrB,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAwB,mCAAI,6BAA6B,CAAC;IACnG,CAAC;CACJ","sourcesContent":["import React from \"react\";\r\nimport {BgColorsOutlined, BoldOutlined, FontColorsOutlined} from \"@ant-design/icons\";\r\nimport {Button, Divider, InputNumber} from \"antd\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport {ColorResult, RGBColor} from \"react-color\";\r\nimport {RowStyleRule} from \"d2coreui/components/grid/cell/tableDefaultRowStyleRules\";\r\nimport PlatformSpecific from \"../../platformSpecific\";\r\nimport ColorPicker from \"../../color/colorPicker\";\r\nimport {GRID_DEFAULT_ROW_HEIGHT_DELTA} from \"./rowHeightCalculator\";\r\n\r\n\r\ninterface RowStylePickerProps {\r\n rowStyleRule: RowStyleRule\r\n onChange: (rowStyleRule: RowStyleRule) => void\r\n}\r\n\r\ninterface RowStylePickerState {\r\n disableColorEdit: boolean\r\n}\r\n\r\ninterface StyleChange {\r\n color?: ColorResult | null\r\n backgroundColor?: ColorResult | null\r\n fontWeight?: string | null\r\n fontSize?: number | null\r\n rowHeightDelta?: number | null\r\n}\r\n\r\nexport default class RowStylePicker extends React.Component<RowStylePickerProps, RowStylePickerState> {\r\n\r\n constructor(props: Readonly<RowStylePickerProps>) {\r\n super(props);\r\n\r\n this.state = {\r\n disableColorEdit: PlatformSpecific.INSTANCE.configurationChangesDisabled(),\r\n }\r\n\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n onChange(style: StyleChange): void {\r\n const textColor = style.color;\r\n const rowStyleRule = this.props.rowStyleRule;\r\n if (textColor === null) {\r\n delete rowStyleRule.style.color;\r\n } else if (typeof textColor === 'object') {\r\n if (textColor.rgb.r === 0 && textColor.rgb.g === 0 && textColor.rgb.b === 0 && textColor.rgb.a === 0) {\r\n delete rowStyleRule.style.color;\r\n } else if (textColor.rgb.a === 0 || textColor.rgb.a === 1) {\r\n rowStyleRule.style.color = textColor.hex;\r\n } else {\r\n rowStyleRule.style.color = textColor.rgb;\r\n }\r\n } else if (textColor !== undefined) {\r\n rowStyleRule.style.color = textColor;\r\n }\r\n\r\n const backgroundColor = style.backgroundColor;\r\n if (backgroundColor === null) {\r\n delete rowStyleRule.style.backgroundColor;\r\n } else if (typeof backgroundColor === 'object') {\r\n if (backgroundColor.rgb.r === 0 && backgroundColor.rgb.g === 0 && backgroundColor.rgb.b === 0 && backgroundColor.rgb.a === 0) {\r\n delete rowStyleRule.style.backgroundColor;\r\n } else if (backgroundColor.rgb.a === 0 || backgroundColor.rgb.a === 1) {\r\n rowStyleRule.style.backgroundColor = backgroundColor.hex;\r\n } else {\r\n rowStyleRule.style.backgroundColor = backgroundColor.rgb;\r\n }\r\n } else if (backgroundColor !== undefined) {\r\n rowStyleRule.style.backgroundColor = backgroundColor;\r\n }\r\n\r\n\r\n if (style.fontWeight === null) {\r\n delete rowStyleRule.style.fontWeight;\r\n } else if (style.fontWeight !== undefined) {\r\n rowStyleRule.style.fontWeight = style.fontWeight;\r\n }\r\n if (style.fontSize === null) {\r\n delete rowStyleRule.style.fontSize;\r\n } else if (style.fontSize !== undefined) {\r\n rowStyleRule.style.fontSize = style.fontSize;\r\n }\r\n if (style.rowHeightDelta === null) {\r\n delete rowStyleRule.style.rowHeightDelta;\r\n } else if (style.rowHeightDelta !== undefined) {\r\n rowStyleRule.style.rowHeightDelta = style.rowHeightDelta;\r\n }\r\n this.props.onChange(rowStyleRule);\r\n }\r\n\r\n render() {\r\n return <>\r\n {this.props.rowStyleRule.divider &&\r\n <Divider style={{fontSize: 12}}>{i18n(this.props.rowStyleRule.divider)}</Divider>}\r\n <div style={{display: \"flex\"}}>\r\n <div style={{flexGrow: 1}}>\r\n {i18n(this.props.rowStyleRule.name)}\r\n </div>\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.color &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <ColorPicker\r\n title={i18n(\"Background Color\")}\r\n disabled={this.state.disableColorEdit}\r\n placement=\"left\"\r\n color={this.getColor()}\r\n onChangeComplete={color => {\r\n this.onChange({color: color})\r\n }}\r\n onResetColor={() => {\r\n this.onChange({color: null})\r\n }}\r\n badgeIcon={<FontColorsOutlined/>}\r\n transparentColorAllowed\r\n />\r\n </div>\r\n }\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.backgroundColor &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <ColorPicker\r\n title={i18n(\"Background Color\")}\r\n disabled={this.state.disableColorEdit}\r\n placement=\"left\"\r\n color={this.getBackgroundColor()}\r\n onChangeComplete={color => {\r\n this.onChange({backgroundColor: color})\r\n }}\r\n onResetColor={() => {\r\n this.onChange({backgroundColor: null})\r\n }}\r\n badgeIcon={<BgColorsOutlined/>}\r\n transparentColorAllowed\r\n />\r\n </div>\r\n }\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.fontWeight &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <Button icon={<BoldOutlined/>}\r\n disabled={this.state.disableColorEdit}\r\n type={this.props.rowStyleRule.style.fontWeight === \"bold\" ? \"primary\" : \"default\"}\r\n onClick={() => {\r\n this.onChange({fontWeight: this.props.rowStyleRule.style.fontWeight === \"bold\" ? null : \"bold\"})\r\n }}\r\n />\r\n </div>}\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.fontSize &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <InputNumber\r\n style={{width: 70}}\r\n className=\"custom\"\r\n min={10}\r\n max={50}\r\n value={this.getFontSize()}\r\n onChange={(fontSize) => {\r\n if (fontSize && typeof fontSize === \"number\") {\r\n this.onChange({fontSize: fontSize});\r\n }\r\n }}\r\n />\r\n </div>}\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.rowHeightDelta &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <InputNumber\r\n style={{width: 70}}\r\n min={1}\r\n max={28}\r\n value={this.getRowHeightDelta()}\r\n onChange={(rowHeightDelta) => {\r\n if (rowHeightDelta && typeof rowHeightDelta === \"number\") {\r\n this.onChange({rowHeightDelta: rowHeightDelta});\r\n }\r\n }}\r\n />\r\n </div>}\r\n </div>\r\n </>;\r\n }\r\n\r\n private getColor(): string | RGBColor | undefined {\r\n // @ts-ignore\r\n return this.props.rowStyleRule.style.color;\r\n }\r\n\r\n private getBackgroundColor(): string | RGBColor | undefined {\r\n // @ts-ignore\r\n return this.props.rowStyleRule.style.backgroundColor;\r\n }\r\n\r\n private getFontSize(): number {\r\n return this.props.rowStyleRule.style.fontSize as number;\r\n }\r\n\r\n private getRowHeightDelta(): number {\r\n return this.props.rowStyleRule.style.rowHeightDelta as number ?? GRID_DEFAULT_ROW_HEIGHT_DELTA;\r\n }\r\n}"]}
1
+ {"version":3,"file":"rowStylePicker.js","sourceRoot":"","sources":["../../../../../components/grid/config/rowStylePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,MAAM,CAAC;AAClD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAGpC,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AA6BpE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,KAAK,CAAC,SAAmD;IAEjG,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG;YACT,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,4BAA4B,EAAE;SAC7E,CAAA;QAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,KAAkB;QACvB,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAC7C,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC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/C,CAAC;IAEO,kBAAkB;QACtB,aAAa;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC;IACzD,CAAC;IAEO,WAAW;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAkB,CAAC;IAC5D,CAAC;IAEO,iBAAiB;;QACrB,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAwB,mCAAI,6BAA6B,CAAC;IACnG,CAAC;CACJ","sourcesContent":["import React from \"react\";\r\nimport {BgColorsOutlined, BoldOutlined, FontColorsOutlined} from \"@ant-design/icons\";\r\nimport {Button, Divider, InputNumber} from \"antd\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport {ColorResult, RGBColor} from \"react-color\";\r\nimport {RowStyleRule} from \"d2coreui/components/grid/cell/tableDefaultRowStyleRules\";\r\nimport PlatformSpecific from \"../../platformSpecific\";\r\nimport ColorPicker from \"../../color/colorPicker\";\r\nimport {GRID_DEFAULT_ROW_HEIGHT_DELTA} from \"./rowHeightCalculator\";\r\n\r\n\r\n/** Properties of {@link RowStylePicker}. */\r\ninterface RowStylePickerProps {\r\n /** The rule to edit; it is modified in place. */\r\n rowStyleRule: RowStyleRule\r\n /** Called after each edit with the same, modified `rowStyleRule` object. */\r\n onChange: (rowStyleRule: RowStyleRule) => void\r\n}\r\n\r\ninterface RowStylePickerState {\r\n disableColorEdit: boolean\r\n}\r\n\r\n/** Style change passed to {@link RowStylePicker.onChange}: `undefined` leaves a property unchanged, `null` removes it. */\r\ninterface StyleChange {\r\n /** Text color. */\r\n color?: ColorResult | null\r\n /** Background color. */\r\n backgroundColor?: ColorResult | null\r\n /** CSS font weight, e.g. `\"bold\"`. */\r\n fontWeight?: string | null\r\n /** Font size in pixels. */\r\n fontSize?: number | null\r\n /** Vertical padding in pixels above and below the text, see {@link GRID_DEFAULT_ROW_HEIGHT_DELTA}. */\r\n rowHeightDelta?: number | null\r\n}\r\n\r\n/**\r\n * One row of the grid's row styling editor: the localized rule name (preceded by a divider when the rule has\r\n * `divider`) and an editor for each style property enabled in `rowStyleRule.styleEditor` - text color, background\r\n * color, bold, font size (10-50) and line indentation (1-28). The color and bold editors are disabled when\r\n * {@link PlatformSpecific} disallows configuration changes.\r\n */\r\nexport default class RowStylePicker extends React.Component<RowStylePickerProps, RowStylePickerState> {\r\n\r\n constructor(props: Readonly<RowStylePickerProps>) {\r\n super(props);\r\n\r\n this.state = {\r\n disableColorEdit: PlatformSpecific.INSTANCE.configurationChangesDisabled(),\r\n }\r\n\r\n this.onChange = this.onChange.bind(this);\r\n }\r\n\r\n /**\r\n * Applies a style change to `rowStyleRule` and calls `onChange`. A `null` property removes that style, a fully\r\n * transparent black color removes the color, and a color with partial transparency is stored as RGBA, otherwise as hex.\r\n */\r\n onChange(style: StyleChange): void {\r\n const textColor = style.color;\r\n const rowStyleRule = this.props.rowStyleRule;\r\n if (textColor === null) {\r\n delete rowStyleRule.style.color;\r\n } else if (typeof textColor === 'object') {\r\n if (textColor.rgb.r === 0 && textColor.rgb.g === 0 && textColor.rgb.b === 0 && textColor.rgb.a === 0) {\r\n delete rowStyleRule.style.color;\r\n } else if (textColor.rgb.a === 0 || textColor.rgb.a === 1) {\r\n rowStyleRule.style.color = textColor.hex;\r\n } else {\r\n rowStyleRule.style.color = textColor.rgb;\r\n }\r\n } else if (textColor !== undefined) {\r\n rowStyleRule.style.color = textColor;\r\n }\r\n\r\n const backgroundColor = style.backgroundColor;\r\n if (backgroundColor === null) {\r\n delete rowStyleRule.style.backgroundColor;\r\n } else if (typeof backgroundColor === 'object') {\r\n if (backgroundColor.rgb.r === 0 && backgroundColor.rgb.g === 0 && backgroundColor.rgb.b === 0 && backgroundColor.rgb.a === 0) {\r\n delete rowStyleRule.style.backgroundColor;\r\n } else if (backgroundColor.rgb.a === 0 || backgroundColor.rgb.a === 1) {\r\n rowStyleRule.style.backgroundColor = backgroundColor.hex;\r\n } else {\r\n rowStyleRule.style.backgroundColor = backgroundColor.rgb;\r\n }\r\n } else if (backgroundColor !== undefined) {\r\n rowStyleRule.style.backgroundColor = backgroundColor;\r\n }\r\n\r\n\r\n if (style.fontWeight === null) {\r\n delete rowStyleRule.style.fontWeight;\r\n } else if (style.fontWeight !== undefined) {\r\n rowStyleRule.style.fontWeight = style.fontWeight;\r\n }\r\n if (style.fontSize === null) {\r\n delete rowStyleRule.style.fontSize;\r\n } else if (style.fontSize !== undefined) {\r\n rowStyleRule.style.fontSize = style.fontSize;\r\n }\r\n if (style.rowHeightDelta === null) {\r\n delete rowStyleRule.style.rowHeightDelta;\r\n } else if (style.rowHeightDelta !== undefined) {\r\n rowStyleRule.style.rowHeightDelta = style.rowHeightDelta;\r\n }\r\n this.props.onChange(rowStyleRule);\r\n }\r\n\r\n render() {\r\n return <>\r\n {this.props.rowStyleRule.divider &&\r\n <Divider style={{fontSize: 12}}>{i18n(this.props.rowStyleRule.divider)}</Divider>}\r\n <div style={{display: \"flex\"}}>\r\n <div style={{flexGrow: 1}}>\r\n {i18n(this.props.rowStyleRule.name)}\r\n </div>\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.color &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <ColorPicker\r\n title={i18n(\"Background Color\")}\r\n disabled={this.state.disableColorEdit}\r\n placement=\"left\"\r\n color={this.getColor()}\r\n onChangeComplete={color => {\r\n this.onChange({color: color})\r\n }}\r\n onResetColor={() => {\r\n this.onChange({color: null})\r\n }}\r\n badgeIcon={<FontColorsOutlined/>}\r\n transparentColorAllowed\r\n />\r\n </div>\r\n }\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.backgroundColor &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <ColorPicker\r\n title={i18n(\"Background Color\")}\r\n disabled={this.state.disableColorEdit}\r\n placement=\"left\"\r\n color={this.getBackgroundColor()}\r\n onChangeComplete={color => {\r\n this.onChange({backgroundColor: color})\r\n }}\r\n onResetColor={() => {\r\n this.onChange({backgroundColor: null})\r\n }}\r\n badgeIcon={<BgColorsOutlined/>}\r\n transparentColorAllowed\r\n />\r\n </div>\r\n }\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.fontWeight &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <Button icon={<BoldOutlined/>}\r\n disabled={this.state.disableColorEdit}\r\n type={this.props.rowStyleRule.style.fontWeight === \"bold\" ? \"primary\" : \"default\"}\r\n onClick={() => {\r\n this.onChange({fontWeight: this.props.rowStyleRule.style.fontWeight === \"bold\" ? null : \"bold\"})\r\n }}\r\n />\r\n </div>}\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.fontSize &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <InputNumber\r\n style={{width: 70}}\r\n className=\"custom\"\r\n min={10}\r\n max={50}\r\n value={this.getFontSize()}\r\n onChange={(fontSize) => {\r\n if (fontSize && typeof fontSize === \"number\") {\r\n this.onChange({fontSize: fontSize});\r\n }\r\n }}\r\n />\r\n </div>}\r\n {this.props.rowStyleRule.styleEditor && this.props.rowStyleRule.styleEditor.rowHeightDelta &&\r\n <div style={{marginBottom: 8, marginLeft: 16}}>\r\n <InputNumber\r\n style={{width: 70}}\r\n min={1}\r\n max={28}\r\n value={this.getRowHeightDelta()}\r\n onChange={(rowHeightDelta) => {\r\n if (rowHeightDelta && typeof rowHeightDelta === \"number\") {\r\n this.onChange({rowHeightDelta: rowHeightDelta});\r\n }\r\n }}\r\n />\r\n </div>}\r\n </div>\r\n </>;\r\n }\r\n\r\n private getColor(): string | RGBColor | undefined {\r\n // @ts-ignore\r\n return this.props.rowStyleRule.style.color;\r\n }\r\n\r\n private getBackgroundColor(): string | RGBColor | undefined {\r\n // @ts-ignore\r\n return this.props.rowStyleRule.style.backgroundColor;\r\n }\r\n\r\n private getFontSize(): number {\r\n return this.props.rowStyleRule.style.fontSize as number;\r\n }\r\n\r\n private getRowHeightDelta(): number {\r\n return this.props.rowStyleRule.style.rowHeightDelta as number ?? GRID_DEFAULT_ROW_HEIGHT_DELTA;\r\n }\r\n}"]}