d2coreui 23.0.56 → 23.0.57

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 (29) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/components/date/dateRangeInputAdvancedPanel.js +19 -19
  3. package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
  4. package/components/date/dateTimeInput.d.ts +12 -3
  5. package/components/date/dateTimeInput.js +133 -72
  6. package/components/date/dateTimeInput.js.map +1 -1
  7. package/components/grid/config/dataGridEditor.d.ts +4 -3
  8. package/components/grid/config/dataGridEditor.js +16 -4
  9. package/components/grid/config/dataGridEditor.js.map +1 -1
  10. package/components/grid/dataGrid.d.ts +19 -5
  11. package/components/grid/dataGrid.js +9 -5
  12. package/components/grid/dataGrid.js.map +1 -1
  13. package/components/grid/export/contextMenu.d.ts +3 -2
  14. package/components/grid/export/contextMenu.js.map +1 -1
  15. package/components/grid/extendedDataGrid.d.ts +11 -4
  16. package/components/grid/extendedDataGrid.js +34 -24
  17. package/components/grid/extendedDataGrid.js.map +1 -1
  18. package/components/modal/impl/draggableModalInner.js +22 -10
  19. package/components/modal/impl/draggableModalInner.js.map +1 -1
  20. package/components/modal/impl/draggableModalReducer.d.ts +2 -3
  21. package/components/modal/impl/draggableModalReducer.js +9 -7
  22. package/components/modal/impl/draggableModalReducer.js.map +1 -1
  23. package/components/modal/modalDialog.d.ts +2 -1
  24. package/components/modal/modalDialog.js +2 -1
  25. package/components/modal/modalDialog.js.map +1 -1
  26. package/i18n/components.cs.json +2 -0
  27. package/i18n/components.sk.json +2 -0
  28. package/i18n/components.uk.json +2 -0
  29. package/package.json +1 -1
@@ -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,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B,GAAG,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,EAAE;gBACrG,IAAI,CAAC,KAAK,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
+ {"version":3,"file":"dataGridEditor.js","sourceRoot":"","sources":["../../../../../components/grid/config/dataGridEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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,KAAK,CAAC,oBAAoB,EAAE,CAAC;wBAClC,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;wBACjE,IAAI,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;4BACnC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;wBACpD,CAAC;oBACL,CAAC;gBACL,CAAC,GAAG,CACX;YACD,QAAQ,EAAE,CACN,iCACK,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAClG,CACT;SACJ,CAAC;IACN,CAAC;IAED,oFAAoF;IACpF,kBAAkB,CAAC,YAA0B,EAAE,KAAa;QACxD,OAAO,CACH,oBAAC,cAAc,IAAC,GAAG,EAAE,mBAAmB,GAAG,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,EAAE;gBACrG,IAAI,CAAC,KAAK,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, Select, Space, Switch} from 'antd';\r\nimport i18n from \"d2core/i18n/i18n\"\r\nimport {ResolvedUtcOffsetMode, UtcOffsetMode} from \"d2core/i18n/localeHolder\";\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 /** When date-time columns show the UTC offset. */\r\n showUtcOffset: ResolvedUtcOffsetMode\r\n /** Value of `showUtcOffset` restored by the revert button. */\r\n defaultShowUtcOffset: ResolvedUtcOffsetMode\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// the configuration is stored, and older readers take any string as true\r\nfunction toConfigurationValue(mode: ResolvedUtcOffsetMode): UtcOffsetMode {\r\n if (mode === \"none\") {\r\n return false;\r\n }\r\n return mode === \"offset\" ? true : mode;\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(toConfigurationValue(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 <Select size=\"small\"\r\n popupMatchSelectWidth={false}\r\n value={this.props.showUtcOffset}\r\n options={[\r\n {value: \"none\", label: i18n(\"No\")},\r\n {value: \"hourLetter\", label: i18n(\"A2:00 / B2:00 at the change to winter time\")},\r\n {value: \"offset\", label: i18n(\"Yes\")},\r\n {value: \"offsetInFold\", label: i18n(\"Only at the change to winter time\")},\r\n ]}\r\n onChange={(value: ResolvedUtcOffsetMode) => {\r\n this.props.dataGrid.showUtcOffset(toConfigurationValue(value));\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}"]}
@@ -4,9 +4,19 @@ import { AgGridReact } from "ag-grid-react";
4
4
  import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
5
5
  import { ContextMenuProps, PageOrientation } from "d2coreui/components/grid/export/contextMenu";
6
6
  import { CellClassParams, CellFocusedEvent, CellMouseDownEvent, CellMouseOverEvent, ColDef, ColTypeDef, ColGroupDef, Column, ColumnEvent, NewColumnsLoadedEvent, ColumnState, FilterChangedEvent, FilterModifiedEvent, GridApi, GridOptions, GridReadyEvent, IRowNode, PaginationChangedEvent, RowClassParams, RowPinnedType, RowStyle, ViewportChangedEvent } from "ag-grid-community";
7
+ import { UtcOffsetMode } from "d2core/i18n/localeHolder";
7
8
  import { GridRowStyle, RowStyleRule } from "d2coreui/components/grid/cell/tableDefaultRowStyleRules";
8
9
  import ProgressPopup from "d2coreui/components/grid/export/progressPopup";
9
10
  import WildcardQuickFilterEngine from "./filter/wildcardQuickFilterEngine";
11
+ declare module "antd/es/theme/interface/alias" {
12
+ interface AliasToken {
13
+ /**
14
+ * Background of the odd rows of `DataGrid` / `ExtendedDataGrid` with the default theme, set through
15
+ * `ConfigProvider` `theme.token`. Unset, odd rows have `colorBgContainer` like the even ones (no striping).
16
+ */
17
+ gridOddRowBg?: string;
18
+ }
19
+ }
10
20
  /**
11
21
  * Separator for joining several parts into one cell value (e.g. name and status).
12
22
  * When a string cell value contains it (after the first character), clipboard copy of several rows and export
@@ -282,15 +292,19 @@ export interface DataGridProps<TData = any> extends Omit<GridOptions<TData>, "co
282
292
  * `hideYear`. Update `hideYear` and then call `callback` so the grid re-renders its rows.
283
293
  */
284
294
  onShowYear?(show: boolean, callback: () => void): void;
285
- /** Shows the UTC offset in date-time columns (controlled, see {@link DataGridProps.onShowUtcOffset}). */
286
- showUtcOffset?: boolean;
295
+ /**
296
+ * How date-time columns tell apart the instants of the hour repeated at the end of the daylight saving time - see
297
+ * `UtcOffsetMode` of `d2core/i18n/localeHolder`; without it the global mode of `LocaleHolder.setUtcOffsetMode`
298
+ * applies (controlled, see {@link DataGridProps.onShowUtcOffset}).
299
+ */
300
+ showUtcOffset?: UtcOffsetMode;
287
301
  /** Value of `showUtcOffset` restored when the table configuration is reset to defaults. */
288
- defaultShowUtcOffset?: boolean;
302
+ defaultShowUtcOffset?: UtcOffsetMode;
289
303
  /**
290
304
  * Called when the user toggles the UTC offset in the table configuration panel. Update `showUtcOffset` and then
291
305
  * call `callback` so the grid re-renders its rows.
292
306
  */
293
- onShowUtcOffset?(show: boolean, callback: () => void): void;
307
+ onShowUtcOffset?(show: UtcOffsetMode, callback: () => void): void;
294
308
  /** Toolbar export menu customization; the built-in items export all displayed rows to TXT, CSV, PDF or the clipboard. */
295
309
  exportMenu?: {
296
310
  /** Transforms the default menu items, e.g. to add or remove entries. */
@@ -480,7 +494,7 @@ export default class DataGrid<TData extends {
480
494
  /** Requests showing/hiding the year via `props.onShowYear` and redraws the rows once the parent calls back. */
481
495
  showYear(showYear: boolean): void;
482
496
  /** Requests showing/hiding the UTC offset via `props.onShowUtcOffset` and redraws the rows once the parent calls back. */
483
- showUtcOffset(showUtcOffset: boolean): void;
497
+ showUtcOffset(showUtcOffset: UtcOffsetMode): void;
484
498
  /**
485
499
  * Applies a new row height (and header/floating filter height derived from `fontSize`, unless given in props),
486
500
  * redraws the grid (reloading an infinite datasource) and calls `props.onRowHeightChanged`.
@@ -1581,7 +1581,8 @@ class DataGrid extends React.Component {
1581
1581
  style.color = `rgba(${style.color.r},${style.color.g},${style.color.b},${style.color.a})`;
1582
1582
  }
1583
1583
  if (!style.backgroundColor) {
1584
- style.backgroundColor = "inherit";
1584
+ // "" removes a stale inline color (ag-grid skips null) without overriding the theme's odd-row background
1585
+ style.backgroundColor = "";
1585
1586
  }
1586
1587
  else if (typeof style.backgroundColor === "object") {
1587
1588
  style.backgroundColor = `rgba(${style.backgroundColor.r},${style.backgroundColor.g},${style.backgroundColor.b},${style.backgroundColor.a})`;
@@ -1692,7 +1693,7 @@ class DataGrid extends React.Component {
1692
1693
  React.createElement(Dropdown, { trigger: ["click"], menu: getContextMenu({
1693
1694
  showMilliseconds: !!this.props.showMilliseconds,
1694
1695
  showYear: !this.props.hideYear,
1695
- showUtcOffset: !!this.props.showUtcOffset,
1696
+ showUtcOffset: LocaleHolder.resolveUtcOffsetMode(this.props.showUtcOffset),
1696
1697
  renderer: (_b = this.props.exportMenu) === null || _b === void 0 ? void 0 : _b.renderer,
1697
1698
  onClick: (_c = this.props.exportMenu) === null || _c === void 0 ? void 0 : _c.onClick,
1698
1699
  onExported: (_d = this.props.exportMenu) === null || _d === void 0 ? void 0 : _d.onExported,
@@ -1834,7 +1835,7 @@ class DataGrid extends React.Component {
1834
1835
  }
1835
1836
  ;
1836
1837
  render() {
1837
- const _a = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, rowStyleRules, onChangeRowStyleRules, defaultShowMilliseconds, onShowMilliseconds, defaultHideYear, onShowYear, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _a, passedProperties = __rest(_a, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "rowStyleRules", "onChangeRowStyleRules", "defaultShowMilliseconds", "onShowMilliseconds", "defaultHideYear", "onShowYear", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1838
+ const _a = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, onLoadData, rowStyleRules, defaultRowStyleRules, onChangeRowStyleRules, showMilliseconds, defaultShowMilliseconds, onShowMilliseconds, hideYear, defaultHideYear, onShowYear, showUtcOffset, defaultShowUtcOffset, onShowUtcOffset, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _a, passedProperties = __rest(_a, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "onLoadData", "rowStyleRules", "defaultRowStyleRules", "onChangeRowStyleRules", "showMilliseconds", "defaultShowMilliseconds", "onShowMilliseconds", "hideYear", "defaultHideYear", "onShowYear", "showUtcOffset", "defaultShowUtcOffset", "onShowUtcOffset", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1838
1839
  let key;
1839
1840
  let paginationPageSize = undefined;
1840
1841
  if (paging.pageSize > 0) {
@@ -1889,7 +1890,7 @@ class DataGrid extends React.Component {
1889
1890
  onlySelectedNodes: true,
1890
1891
  showMilliseconds: !!this.props.showMilliseconds,
1891
1892
  showYear: !this.props.hideYear,
1892
- showUtcOffset: !!this.props.showUtcOffset,
1893
+ showUtcOffset: LocaleHolder.resolveUtcOffsetMode(this.props.showUtcOffset),
1893
1894
  renderer: (_a = this.props.contextMenu) === null || _a === void 0 ? void 0 : _a.renderer,
1894
1895
  onClick: (_b = this.props.contextMenu) === null || _b === void 0 ? void 0 : _b.onClick,
1895
1896
  getExportContent: this.getExportContent,
@@ -1917,7 +1918,7 @@ class DataGrid extends React.Component {
1917
1918
  }), tableOverlayRenderer === null || tableOverlayRenderer === void 0 ? void 0 :
1918
1919
  tableOverlayRenderer())),
1919
1920
  !!this.gridApi && !!this.gridApi && this.state.pageSize !== null &&
1920
- React.createElement(DataGridEditor, { dataGrid: this, gridApi: this.gridApi, columnDefinitions: leafColumnDefs, columnModel: this.state.columnModel, visible: !!this.props.tableConfigVisible, onTableConfigVisible: this.showTableConfiguration, paginationPageSize: paging.pageSize, paginationDefaultPageSize: paging.defaultPageSize, currentPageSize: this.state.pageSize, showMilliseconds: !!this.props.showMilliseconds, defaultShowMilliseconds: !!this.props.defaultShowMilliseconds, showYear: !this.props.hideYear, defaultShowYear: !this.props.defaultHideYear, showUtcOffset: !!this.props.showUtcOffset, defaultShowUtcOffset: !!this.props.defaultShowUtcOffset, rowStyleRules: this.props.rowStyleRules, defaultRowStyleRules: this.props.defaultRowStyleRules, onChangeRowStyleRules: onChangeRowStyleRules }),
1921
+ React.createElement(DataGridEditor, { dataGrid: this, gridApi: this.gridApi, columnDefinitions: leafColumnDefs, columnModel: this.state.columnModel, visible: !!this.props.tableConfigVisible, onTableConfigVisible: this.showTableConfiguration, paginationPageSize: paging.pageSize, paginationDefaultPageSize: paging.defaultPageSize, currentPageSize: this.state.pageSize, showMilliseconds: !!this.props.showMilliseconds, defaultShowMilliseconds: !!this.props.defaultShowMilliseconds, showYear: !this.props.hideYear, defaultShowYear: !this.props.defaultHideYear, showUtcOffset: LocaleHolder.resolveUtcOffsetMode(this.props.showUtcOffset), defaultShowUtcOffset: LocaleHolder.resolveUtcOffsetMode(this.props.defaultShowUtcOffset), rowStyleRules: this.props.rowStyleRules, defaultRowStyleRules: this.props.defaultRowStyleRules, onChangeRowStyleRules: onChangeRowStyleRules }),
1921
1922
  !!this.gridApi && React.createElement(ModalDialog, { mode: "OK_CANCEL" /* ModalDialogMode.OK_CANCEL */, open: this.state.columnsConfigVisible, initialWidth: 700, initialHeight: this.state.columnTransferHeight, title: React.createElement("span", null,
1922
1923
  React.createElement(ControlOutlined, { style: {
1923
1924
  color: "#faad14",
@@ -1950,11 +1951,13 @@ DataGrid.defaultProps = {
1950
1951
  DataGrid.EMPTY_STYLE = {};
1951
1952
  export default DataGrid;
1952
1953
  function getAgGridThemeFromAntd(algorithm, token) {
1954
+ var _a;
1953
1955
  const isDark = algorithm === theme.darkAlgorithm;
1954
1956
  let agTheme = isDark ? themeBalham.withPart(colorSchemeDark) : themeBalham;
1955
1957
  return agTheme.withParams({
1956
1958
  accentColor: token.colorPrimary,
1957
1959
  backgroundColor: token.colorBgContainer,
1960
+ oddRowBackgroundColor: (_a = token.gridOddRowBg) !== null && _a !== void 0 ? _a : token.colorBgContainer,
1958
1961
  foregroundColor: token.colorText,
1959
1962
  selectedRowBackgroundColor: token.controlItemBgActive,
1960
1963
  rowHoverColor: token.controlItemBgHover,
@@ -1971,6 +1974,7 @@ function agThemeEquals(newArgs, lastArgs) {
1971
1974
  // Only compare the tokens you actually use in your function
1972
1975
  return (newToken.colorPrimary === lastToken.colorPrimary &&
1973
1976
  newToken.colorBgContainer === lastToken.colorBgContainer &&
1977
+ newToken.gridOddRowBg === lastToken.gridOddRowBg &&
1974
1978
  newToken.colorText === lastToken.colorText &&
1975
1979
  newToken.controlItemBgActive === lastToken.controlItemBgActive &&
1976
1980
  newToken.controlItemBgHover === lastToken.controlItemBgHover &&