@linzjs/step-ag-grid 8.3.2 → 8.4.0

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.
@@ -27,6 +27,6 @@ export interface GenericCellRendererParams<RowType extends GridBaseRow> {
27
27
  rightHoverElement?: JSX.Element | undefined;
28
28
  editAction?: (selectedRows: RowType[]) => void;
29
29
  shortcutKeys?: Record<string, ((params: SuppressKeyboardEventParams) => boolean | void) | undefined>;
30
- warning?: (props: RowICellRendererParams<RowType>) => string | boolean | null | undefined;
31
- info?: (props: RowICellRendererParams<RowType>) => string | boolean | null | undefined;
30
+ warning?: (props: RowICellRendererParams<RowType>) => string | string[] | boolean | null | undefined;
31
+ info?: (props: RowICellRendererParams<RowType>) => string | string[] | boolean | null | undefined;
32
32
  }
@@ -3003,7 +3003,11 @@ var GridCellRenderer = function (props) {
3003
3003
  var warningText = warningFn ? warningFn(props) : undefined;
3004
3004
  var infoFn = rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.info;
3005
3005
  var infoText = infoFn ? infoFn(props) : undefined;
3006
- return (jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((_b = (_a = colDef.field) !== null && _a !== void 0 ? _a : colDef.colId) !== null && _b !== void 0 ? _b : "", props.data.id) }, { children: jsxs(Fragment$1, { children: [typeof warningText === "string" && jsx(GridIcon, { icon: "ic_warning_outline", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info_outline", title: infoText }), jsx("div", __assign({ style: { display: "flex", flex: 1, overflow: "hidden" } }, { children: ((_c = colDef === null || colDef === void 0 ? void 0 : colDef.cellRendererParams) === null || _c === void 0 ? void 0 : _c.originalCellRenderer) ? (jsx(colDef.cellRendererParams.originalCellRenderer, __assign({}, props))) : (jsx("span", __assign({ title: props.valueFormatted }, { children: props.valueFormatted }))) })), fnOrVar((_d = props.colDef) === null || _d === void 0 ? void 0 : _d.editable, props) && (rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.rightHoverElement) && (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.rightHoverElement })))] }) })));
3006
+ if (Array.isArray(warningText))
3007
+ warningText = warningText.join("\n");
3008
+ if (Array.isArray(infoText))
3009
+ infoText = infoText.join("\n");
3010
+ return (jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((_b = (_a = colDef.field) !== null && _a !== void 0 ? _a : colDef.colId) !== null && _b !== void 0 ? _b : "", props.data.id) }, { children: jsxs(Fragment$1, { children: [!!warningText && (jsx(GridIcon, { icon: "ic_warning_outline", title: typeof warningText === "string" ? warningText : "Warning" })), !!infoText && jsx(GridIcon, { icon: "ic_info_outline", title: typeof infoText === "string" ? infoText : "Info" }), jsx("div", __assign({ style: { display: "flex", flex: 1, overflow: "hidden" } }, { children: ((_c = colDef === null || colDef === void 0 ? void 0 : colDef.cellRendererParams) === null || _c === void 0 ? void 0 : _c.originalCellRenderer) ? (jsx(colDef.cellRendererParams.originalCellRenderer, __assign({}, props))) : (jsx("span", __assign({ title: props.valueFormatted }, { children: props.valueFormatted }))) })), fnOrVar((_d = props.colDef) === null || _d === void 0 ? void 0 : _d.editable, props) && (rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.rightHoverElement) && (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.rightHoverElement })))] }) })));
3007
3011
  };
3008
3012
  var suppressCellKeyboardEvents = function (e) {
3009
3013
  var _a, _b, _c, _d;
@@ -3022,12 +3026,15 @@ var suppressCellKeyboardEvents = function (e) {
3022
3026
  */
3023
3027
  var GridCell = function (props, custom) {
3024
3028
  var _a, _b;
3025
- return __assign(__assign(__assign(__assign(__assign(__assign({ colId: props.field, sortable: !!((props === null || props === void 0 ? void 0 : props.field) || (props === null || props === void 0 ? void 0 : props.valueGetter)), resizable: true, editable: (_a = props.editable) !== null && _a !== void 0 ? _a : false }, ((custom === null || custom === void 0 ? void 0 : custom.editor) && {
3029
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign({ colId: props.field, sortable: !!((props === null || props === void 0 ? void 0 : props.field) || (props === null || props === void 0 ? void 0 : props.valueGetter)), resizable: true, editable: (_a = props.editable) !== null && _a !== void 0 ? _a : false }, ((custom === null || custom === void 0 ? void 0 : custom.editor) && {
3026
3030
  cellClassRules: GridCellMultiSelectClassRules,
3027
3031
  editable: (_b = props.editable) !== null && _b !== void 0 ? _b : true,
3028
3032
  cellEditor: GenericCellEditorComponentWrapper(custom === null || custom === void 0 ? void 0 : custom.editor)
3029
3033
  })), { suppressKeyboardEvent: suppressCellKeyboardEvents }), ((custom === null || custom === void 0 ? void 0 : custom.editorParams) && {
3030
3034
  cellEditorParams: __assign(__assign({}, custom.editorParams), { multiEdit: custom.multiEdit })
3035
+ })), (props.valueFormatter &&
3036
+ !props.filterValueGetter && {
3037
+ filterValueGetter: props.valueFormatter
3031
3038
  })), {
3032
3039
  // Default value formatter, otherwise react freaks out on objects
3033
3040
  valueFormatter: function (params) {
@@ -3494,7 +3501,7 @@ var GridFormDropDown = function (props) {
3494
3501
  setValue: function (value) {
3495
3502
  setSubSelectedValue(value);
3496
3503
  if (subComponentInitialValue.current === null) {
3497
- // copy the default value of the subcomponent so we can change detect on save
3504
+ // copy the default value of the subcomponent, so we can change detect on save
3498
3505
  subComponentInitialValue.current = JSON.stringify(value);
3499
3506
  }
3500
3507
  },