d2coreui 23.0.51 → 23.0.53
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.
- package/CHANGELOG.md +27 -0
- package/README.md +154 -0
- package/components/clipboard/clipboardUtils.d.ts +11 -0
- package/components/clipboard/clipboardUtils.js +16 -4
- package/components/clipboard/clipboardUtils.js.map +1 -1
- package/components/codemirror/SyntaxHighlighter.d.ts +13 -0
- package/components/codemirror/SyntaxHighlighter.js +6 -1
- package/components/codemirror/SyntaxHighlighter.js.map +1 -1
- package/components/collapse/expandable.d.ts +10 -0
- package/components/collapse/expandable.js +4 -0
- package/components/collapse/expandable.js.map +1 -1
- package/components/color/colorPicker.d.ts +16 -0
- package/components/color/colorPicker.js +4 -0
- package/components/color/colorPicker.js.map +1 -1
- package/components/color/colorSwatch.d.ts +16 -0
- package/components/color/colorSwatch.js +23 -2
- package/components/color/colorSwatch.js.map +1 -1
- package/components/color/colorUtils.d.ts +9 -0
- package/components/color/colorUtils.js +15 -0
- package/components/color/colorUtils.js.map +1 -1
- package/components/date/dateRangeInput.d.ts +76 -0
- package/components/date/dateRangeInput.js +63 -12
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -0
- package/components/date/dateRangeInputAdvancedPanel.js +7 -0
- package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
- package/components/date/dateRangeInputConfirm.d.ts +18 -0
- package/components/date/dateRangeInputConfirm.js +12 -0
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +99 -0
- package/components/date/dateTimeInput.js +78 -6
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/date/durationInput.d.ts +37 -0
- package/components/date/durationInput.js +26 -3
- package/components/date/durationInput.js.map +1 -1
- package/components/date/savedIntervals.d.ts +63 -0
- package/components/date/savedIntervals.js +37 -0
- package/components/date/savedIntervals.js.map +1 -1
- package/components/date/savedIntervalsDialog.d.ts +13 -0
- package/components/date/savedIntervalsDialog.js +7 -2
- package/components/date/savedIntervalsDialog.js.map +1 -1
- package/components/form/NiceFormItem.d.ts +9 -0
- package/components/form/NiceFormItem.js +4 -0
- package/components/form/NiceFormItem.js.map +1 -1
- package/components/grid/cell/beanAccessor.d.ts +12 -0
- package/components/grid/cell/beanAccessor.js +8 -0
- package/components/grid/cell/beanAccessor.js.map +1 -1
- package/components/grid/cell/bigNumberCellEditor.d.ts +9 -0
- package/components/grid/cell/bigNumberCellEditor.js +19 -0
- package/components/grid/cell/bigNumberCellEditor.js.map +1 -1
- package/components/grid/cell/cellControl.d.ts +4 -0
- package/components/grid/cell/cellControl.js +14 -0
- package/components/grid/cell/cellControl.js.map +1 -1
- package/components/grid/cell/cellEditorUtils.d.ts +6 -0
- package/components/grid/cell/cellEditorUtils.js +6 -0
- package/components/grid/cell/cellEditorUtils.js.map +1 -1
- package/components/grid/cell/customEnumCellEditor.d.ts +6 -0
- package/components/grid/cell/customEnumCellEditor.js +10 -0
- package/components/grid/cell/customEnumCellEditor.js.map +1 -1
- package/components/grid/cell/dataGridCellEditorComponent.d.ts +26 -0
- package/components/grid/cell/dataGridCellEditorComponent.js +21 -0
- package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -1
- package/components/grid/cell/dateCellEditor.d.ts +6 -0
- package/components/grid/cell/dateCellEditor.js +10 -0
- package/components/grid/cell/dateCellEditor.js.map +1 -1
- package/components/grid/cell/dragListenerFeature.d.ts +6 -0
- package/components/grid/cell/dragListenerFeature.js +6 -0
- package/components/grid/cell/dragListenerFeature.js.map +1 -1
- package/components/grid/cell/durationCellEditor.d.ts +6 -0
- package/components/grid/cell/durationCellEditor.js +14 -0
- package/components/grid/cell/durationCellEditor.js.map +1 -1
- package/components/grid/cell/hexaOctetStringCellEditor.d.ts +6 -0
- package/components/grid/cell/hexaOctetStringCellEditor.js +14 -0
- package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
- package/components/grid/cell/hexaValueCellEditor.d.ts +6 -0
- package/components/grid/cell/hexaValueCellEditor.js +14 -0
- package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
- package/components/grid/cell/numberCellEditor.d.ts +6 -0
- package/components/grid/cell/numberCellEditor.js +15 -0
- package/components/grid/cell/numberCellEditor.js.map +1 -1
- package/components/grid/cell/rangeSelector.d.ts +7 -0
- package/components/grid/cell/rangeSelector.js +59 -5
- package/components/grid/cell/rangeSelector.js.map +1 -1
- package/components/grid/cell/simpleStatusTextCellEditor.d.ts +7 -0
- package/components/grid/cell/simpleStatusTextCellEditor.js +11 -0
- package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
- package/components/grid/cell/statusTextCellEditor.d.ts +7 -0
- package/components/grid/cell/statusTextCellEditor.js +17 -0
- package/components/grid/cell/statusTextCellEditor.js.map +1 -1
- package/components/grid/cell/tableDefaultRowStyleRules.d.ts +31 -0
- package/components/grid/cell/tableDefaultRowStyleRules.js +5 -0
- package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
- package/components/grid/cell/textCellEditor.d.ts +6 -0
- package/components/grid/cell/textCellEditor.js +15 -0
- package/components/grid/cell/textCellEditor.js.map +1 -1
- package/components/grid/cell/withAgGridHooks.d.ts +8 -0
- package/components/grid/cell/withAgGridHooks.js +8 -0
- package/components/grid/cell/withAgGridHooks.js.map +1 -1
- package/components/grid/columnUtils.d.ts +7 -0
- package/components/grid/columnUtils.js +7 -0
- package/components/grid/columnUtils.js.map +1 -1
- package/components/grid/config/columnTransfer.d.ts +18 -0
- package/components/grid/config/columnTransfer.js +14 -3
- package/components/grid/config/columnTransfer.js.map +1 -1
- package/components/grid/config/dataGridEditor.d.ts +31 -0
- package/components/grid/config/dataGridEditor.js +14 -2
- package/components/grid/config/dataGridEditor.js.map +1 -1
- package/components/grid/config/rowHeightCalculator.d.ts +11 -0
- package/components/grid/config/rowHeightCalculator.js +11 -0
- package/components/grid/config/rowHeightCalculator.js.map +1 -1
- package/components/grid/config/rowStylePicker.d.ts +19 -0
- package/components/grid/config/rowStylePicker.js +12 -0
- package/components/grid/config/rowStylePicker.js.map +1 -1
- package/components/grid/dataGrid.d.ts +331 -0
- package/components/grid/dataGrid.js +168 -11
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/detail/detailHeaderPanel.d.ts +11 -0
- package/components/grid/detail/detailHeaderPanel.js +5 -0
- package/components/grid/detail/detailHeaderPanel.js.map +1 -1
- package/components/grid/export/contextMenu.d.ts +31 -0
- package/components/grid/export/contextMenu.js +8 -0
- package/components/grid/export/contextMenu.js.map +1 -1
- package/components/grid/export/progressPopup.d.ts +21 -0
- package/components/grid/export/progressPopup.js +17 -0
- package/components/grid/export/progressPopup.js.map +1 -1
- package/components/grid/export/worker/pdfExport.js +5 -0
- package/components/grid/export/worker/pdfExport.js.map +1 -1
- package/components/grid/extendedDataGrid.d.ts +241 -0
- package/components/grid/extendedDataGrid.js +121 -2
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/grid/filter/customColumnFilter.d.ts +5 -0
- package/components/grid/filter/customColumnFilter.js +5 -0
- package/components/grid/filter/customColumnFilter.js.map +1 -1
- package/components/grid/filter/dataGridColumnFilter.d.ts +19 -0
- package/components/grid/filter/dataGridColumnFilter.js +19 -0
- package/components/grid/filter/dataGridColumnFilter.js.map +1 -1
- package/components/grid/filter/dateColumnFilter.d.ts +6 -0
- package/components/grid/filter/dateColumnFilter.js +6 -0
- package/components/grid/filter/dateColumnFilter.js.map +1 -1
- package/components/grid/filter/textColumnFilter.d.ts +6 -0
- package/components/grid/filter/textColumnFilter.js +6 -0
- package/components/grid/filter/textColumnFilter.js.map +1 -1
- package/components/grid/filter/wildcardQuickFilterEngine.d.ts +21 -0
- package/components/grid/filter/wildcardQuickFilterEngine.js +21 -0
- package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -1
- package/components/grid/header/simpleHeader.d.ts +17 -0
- package/components/grid/header/simpleHeader.js +20 -0
- package/components/grid/header/simpleHeader.js.map +1 -1
- package/components/grid/panel/dataGridPagination.d.ts +10 -0
- package/components/grid/panel/dataGridPagination.js +5 -0
- package/components/grid/panel/dataGridPagination.js.map +1 -1
- package/components/grid/panel/loadingOverlay.d.ts +5 -0
- package/components/grid/panel/loadingOverlay.js +4 -0
- package/components/grid/panel/loadingOverlay.js.map +1 -1
- package/components/grid/panel/noRecordsOverlay.d.ts +6 -0
- package/components/grid/panel/noRecordsOverlay.js +5 -0
- package/components/grid/panel/noRecordsOverlay.js.map +1 -1
- package/components/grid/panel/tablePagination.d.ts +4 -0
- package/components/grid/panel/tablePagination.js +4 -0
- package/components/grid/panel/tablePagination.js.map +1 -1
- package/components/icons/dropdownArrow.d.ts +3 -0
- package/components/icons/dropdownArrow.js +2 -0
- package/components/icons/dropdownArrow.js.map +1 -1
- package/components/icons/undoIcon.d.ts +2 -0
- package/components/icons/undoIcon.js +2 -0
- package/components/icons/undoIcon.js.map +1 -1
- package/components/input/autoCompleteInput.d.ts +29 -0
- package/components/input/autoCompleteInput.js +7 -0
- package/components/input/autoCompleteInput.js.map +1 -1
- package/components/input/draftUtils.d.ts +7 -0
- package/components/input/draftUtils.js +9 -0
- package/components/input/draftUtils.js.map +1 -1
- package/components/input/hexaFormattedInput.d.ts +9 -0
- package/components/input/hexaFormattedInput.js +3 -0
- package/components/input/hexaFormattedInput.js.map +1 -1
- package/components/input/mask/helpers.d.ts +27 -0
- package/components/input/mask/helpers.js +27 -0
- package/components/input/mask/helpers.js.map +1 -1
- package/components/input/mask/inputMaskCore.d.ts +80 -0
- package/components/input/mask/inputMaskCore.js +90 -0
- package/components/input/mask/inputMaskCore.js.map +1 -1
- package/components/input/mask/pattern.d.ts +24 -0
- package/components/input/mask/pattern.js +26 -0
- package/components/input/mask/pattern.js.map +1 -1
- package/components/input/maskedInput.d.ts +53 -0
- package/components/input/maskedInput.js +44 -4
- package/components/input/maskedInput.js.map +1 -1
- package/components/input/passwordInput.d.ts +7 -0
- package/components/input/passwordInput.js +8 -0
- package/components/input/passwordInput.js.map +1 -1
- package/components/input/simpleAutoComplete.d.ts +6 -0
- package/components/input/simpleAutoComplete.js +6 -0
- package/components/input/simpleAutoComplete.js.map +1 -1
- package/components/input/textarea/extractSpansOfClasses.d.ts +17 -0
- package/components/input/textarea/extractSpansOfClasses.js +26 -1
- package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
- package/components/input/textarea/getRanges.d.ts +7 -0
- package/components/input/textarea/getRanges.js +11 -0
- package/components/input/textarea/getRanges.js.map +1 -1
- package/components/input/textarea/getType.d.ts +5 -0
- package/components/input/textarea/getType.js +5 -0
- package/components/input/textarea/getType.js.map +1 -1
- package/components/input/textarea/highlighedContents.d.ts +4 -0
- package/components/input/textarea/highlighedContents.js +5 -0
- package/components/input/textarea/highlighedContents.js.map +1 -1
- package/components/input/textarea/mentionsWithHighlighting.d.ts +25 -0
- package/components/input/textarea/mentionsWithHighlighting.js +14 -0
- package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
- package/components/keyboard/keyboardUtils.d.ts +6 -0
- package/components/keyboard/keyboardUtils.js +6 -0
- package/components/keyboard/keyboardUtils.js.map +1 -1
- package/components/modal/draggableModalProvider.d.ts +6 -0
- package/components/modal/draggableModalProvider.js +7 -0
- package/components/modal/draggableModalProvider.js.map +1 -1
- package/components/modal/impl/clamp.js +1 -0
- package/components/modal/impl/clamp.js.map +1 -1
- package/components/modal/impl/draggableModal.d.ts +1 -0
- package/components/modal/impl/draggableModal.js +6 -0
- package/components/modal/impl/draggableModal.js.map +1 -1
- package/components/modal/impl/draggableModalContext.js +1 -0
- package/components/modal/impl/draggableModalContext.js.map +1 -1
- package/components/modal/impl/draggableModalInner.js +12 -1
- package/components/modal/impl/draggableModalInner.js.map +1 -1
- package/components/modal/impl/draggableModalReducer.d.ts +7 -1
- package/components/modal/impl/draggableModalReducer.js +6 -1
- package/components/modal/impl/draggableModalReducer.js.map +1 -1
- package/components/modal/impl/draggableModalStyles.d.ts +17 -0
- package/components/modal/impl/draggableModalStyles.js +157 -126
- package/components/modal/impl/draggableModalStyles.js.map +1 -1
- package/components/modal/impl/getWindowSize.js +1 -0
- package/components/modal/impl/getWindowSize.js.map +1 -1
- package/components/modal/impl/index.js +1 -0
- package/components/modal/impl/index.js.map +1 -1
- package/components/modal/impl/resizeHandle.d.ts +1 -0
- package/components/modal/impl/resizeHandle.js +4 -1
- package/components/modal/impl/resizeHandle.js.map +1 -1
- package/components/modal/impl/useDrag.js +1 -0
- package/components/modal/impl/useDrag.js.map +1 -1
- package/components/modal/impl/usePrevious.js +1 -0
- package/components/modal/impl/usePrevious.js.map +1 -1
- package/components/modal/impl/useResize.js +1 -0
- package/components/modal/impl/useResize.js.map +1 -1
- package/components/modal/modalDialog.d.ts +85 -0
- package/components/modal/modalDialog.js +80 -10
- package/components/modal/modalDialog.js.map +1 -1
- package/components/picker/enumValuePicker.d.ts +17 -0
- package/components/picker/enumValuePicker.js +4 -0
- package/components/picker/enumValuePicker.js.map +1 -1
- package/components/platformSpecific.d.ts +17 -0
- package/components/platformSpecific.js +16 -0
- package/components/platformSpecific.js.map +1 -1
- package/components/scrollTo/onlyText.d.ts +5 -0
- package/components/scrollTo/onlyText.js +5 -0
- package/components/scrollTo/onlyText.js.map +1 -1
- package/components/scrollTo/scrollTo.d.ts +56 -0
- package/components/scrollTo/scrollTo.js +40 -3
- package/components/scrollTo/scrollTo.js.map +1 -1
- package/components/style/withCss.d.ts +15 -0
- package/components/style/withCss.js +6 -0
- package/components/style/withCss.js.map +1 -1
- package/components/table/dragSortingTable.d.ts +15 -0
- package/components/table/dragSortingTable.js +12 -0
- package/components/table/dragSortingTable.js.map +1 -1
- package/components/text/impl/innerSize.js +2 -0
- package/components/text/impl/innerSize.js.map +1 -1
- package/components/text/impl/series.d.ts +10 -0
- package/components/text/impl/series.js +10 -0
- package/components/text/impl/series.js.map +1 -1
- package/components/text/impl/shallowEqual.js +1 -0
- package/components/text/impl/shallowEqual.js.map +1 -1
- package/components/text/impl/whilst.d.ts +7 -0
- package/components/text/impl/whilst.js +7 -0
- package/components/text/impl/whilst.js.map +1 -1
- package/components/text/textFit.d.ts +24 -0
- package/components/text/textFit.js +29 -1
- package/components/text/textFit.js.map +1 -1
- package/i18n/componentsLocaleHolder.d.ts +9 -0
- package/i18n/componentsLocaleHolder.js +9 -0
- package/i18n/componentsLocaleHolder.js.map +1 -1
- package/package.json +4 -3
- package/style/index.less +240 -240
|
@@ -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"
|
|
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,KAA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AAC;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\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,KAA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K,CAAC,aAAa,CAAC,KAAK,CAAC,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() {
|
|
@@ -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,W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E,QAAQ,EAAC,CAAC,CAAC;gCACxC,CAAC;4BACL,CAAC,GACH,CACA;gBACT,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,S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;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC;IAC/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}"]}
|