d2coreui 23.0.25 → 23.0.26

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.
@@ -49,6 +49,8 @@ export interface DataGridSearchProps {
49
49
  searchButtonClassName?: string;
50
50
  searchButtonDisabled?: boolean;
51
51
  searchButtonHidden?: boolean;
52
+ searchButtonIcon?: React.ReactNode;
53
+ searchButtonDanger?: boolean;
52
54
  hidden?: boolean;
53
55
  searchRenderer?(): React.ReactNode;
54
56
  stringFormatter?(rawString: string): string;
@@ -103,6 +105,7 @@ export interface DataGridProps extends Omit<GridOptions, "columnDefs" | "paginat
103
105
  exportMenu?: {
104
106
  renderer?(menuElements: MenuElement[]): MenuElement[];
105
107
  onClick?(key: string): void;
108
+ onExported?(rowCount: number, destination: string): void;
106
109
  };
107
110
  settingsMenu?: {
108
111
  renderer?(menuElements: MenuElement[]): MenuElement[];
@@ -199,6 +199,16 @@ class DataGrid extends React.Component {
199
199
  return "";
200
200
  }
201
201
  },
202
+ valueFormatter: (params) => {
203
+ var _a, _b;
204
+ const value = DataGrid.getCellValue(params);
205
+ if (value !== undefined && value !== null) {
206
+ return LocaleHolder.formatNumber(value, (_b = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.cellRendererParams) === null || _b === void 0 ? void 0 : _b.fractionDigits);
207
+ }
208
+ else {
209
+ return "";
210
+ }
211
+ },
202
212
  filterParams: {
203
213
  textCustomComparator: this.textCustomComparator
204
214
  },
@@ -1434,7 +1444,7 @@ class DataGrid extends React.Component {
1434
1444
  _c.extraContent));
1435
1445
  }
1436
1446
  renderToolBarWithSearch() {
1437
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1447
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1438
1448
  return (React.createElement(Space.Compact, { key: "filter-panel", className: "datagrid-autocomplete-input-group", style: { whiteSpace: "nowrap", flexGrow: 1, display: "flex" } }, (_a = this.props.toolbar) === null || _a === void 0 ? void 0 :
1439
1449
  _a.toolbarButtons,
1440
1450
  React.createElement(Dropdown, { trigger: ["click"], menu: getContextMenu({
@@ -1442,6 +1452,7 @@ class DataGrid extends React.Component {
1442
1452
  showYear: !this.props.hideYear,
1443
1453
  renderer: (_b = this.props.exportMenu) === null || _b === void 0 ? void 0 : _b.renderer,
1444
1454
  onClick: (_c = this.props.exportMenu) === null || _c === void 0 ? void 0 : _c.onClick,
1455
+ onExported: (_d = this.props.exportMenu) === null || _d === void 0 ? void 0 : _d.onExported,
1445
1456
  getExportContent: this.getExportContent,
1446
1457
  pageOrientation: this.state.pageOrientation,
1447
1458
  exporting: this.state.exporting,
@@ -1453,15 +1464,15 @@ class DataGrid extends React.Component {
1453
1464
  React.createElement(Dropdown, { trigger: ["click"], menu: this.getSettingsMenu() },
1454
1465
  React.createElement(Button, { title: i18n("Extended table features"), disabled: this.state.loading },
1455
1466
  React.createElement(TableOutlined, null))),
1456
- !((_d = this.props.search) === null || _d === void 0 ? void 0 : _d.hidden) && !((_e = this.props.search) === null || _e === void 0 ? void 0 : _e.searchRenderer) && React.createElement(AutoCompleteInput, { style: { minWidth: 100, flexGrow: 1 }, placeholder: this.props.search ? this.props.search.placeholder : undefined, stringFormatter: this.props.search ? this.props.search.stringFormatter : undefined, value: this.props.search ? this.props.search.searchString : undefined, options: this.props.search ? this.props.search.searchHistory : undefined, onChange: this.props.search ? this.props.search.onChange : undefined, onSearch: this.props.search ? this.props.search.onSearch : undefined, disabled: this.state.loading || (this.props.filter && this.props.filter.columnSearchVisible) }), (_g = (_f = this.props.search) === null || _f === void 0 ? void 0 : _f.searchRenderer) === null || _g === void 0 ? void 0 :
1457
- _g.call(_f),
1458
- !((_h = this.props.search) === null || _h === void 0 ? void 0 : _h.searchButtonHidden) &&
1459
- React.createElement(Button, { title: ((_j = this.props.search) === null || _j === void 0 ? void 0 : _j.hidden) ? i18n("Refresh") : i18n("Search"), className: "search-btn " + (this.props.search && this.props.search.searchButtonClassName ? this.props.search.searchButtonClassName : ""), disabled: (_k = this.props.search) === null || _k === void 0 ? void 0 : _k.searchButtonDisabled, type: "primary", onClick: () => {
1467
+ !((_e = this.props.search) === null || _e === void 0 ? void 0 : _e.hidden) && !((_f = this.props.search) === null || _f === void 0 ? void 0 : _f.searchRenderer) && React.createElement(AutoCompleteInput, { style: { minWidth: 100, flexGrow: 1 }, placeholder: this.props.search ? this.props.search.placeholder : undefined, stringFormatter: this.props.search ? this.props.search.stringFormatter : undefined, value: this.props.search ? this.props.search.searchString : undefined, options: this.props.search ? this.props.search.searchHistory : undefined, onChange: this.props.search ? this.props.search.onChange : undefined, onSearch: this.props.search ? this.props.search.onSearch : undefined, disabled: this.state.loading || (this.props.filter && this.props.filter.columnSearchVisible) }), (_h = (_g = this.props.search) === null || _g === void 0 ? void 0 : _g.searchRenderer) === null || _h === void 0 ? void 0 :
1468
+ _h.call(_g),
1469
+ !((_j = this.props.search) === null || _j === void 0 ? void 0 : _j.searchButtonHidden) &&
1470
+ React.createElement(Button, { title: ((_k = this.props.search) === null || _k === void 0 ? void 0 : _k.hidden) ? i18n("Refresh") : i18n("Search"), className: "search-btn " + (this.props.search && this.props.search.searchButtonClassName ? this.props.search.searchButtonClassName : ""), disabled: (_l = this.props.search) === null || _l === void 0 ? void 0 : _l.searchButtonDisabled, type: "primary", danger: (_m = this.props.search) === null || _m === void 0 ? void 0 : _m.searchButtonDanger, onClick: () => {
1460
1471
  if (this.props.search && this.props.search.onSearch) {
1461
1472
  this.props.search.onSearch();
1462
1473
  }
1463
- } }, this.state.loading ? React.createElement(LoadingOutlined, null) : (((_l = this.props.search) === null || _l === void 0 ? void 0 : _l.hidden) ? React.createElement(ReloadOutlined, null) :
1464
- React.createElement(SearchOutlined, null)))));
1474
+ } }, this.state.loading ? React.createElement(LoadingOutlined, null) : ((_p = (_o = this.props.search) === null || _o === void 0 ? void 0 : _o.searchButtonIcon) !== null && _p !== void 0 ? _p : (((_q = this.props.search) === null || _q === void 0 ? void 0 : _q.hidden) ? React.createElement(ReloadOutlined, null) :
1475
+ React.createElement(SearchOutlined, null))))));
1465
1476
  }
1466
1477
  getSettingsMenu() {
1467
1478
  var _a;