@linzjs/step-ag-grid 1.2.0 → 1.3.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.
@@ -6,6 +6,7 @@ export interface GridFormTextAreaProps<RowType extends GridBaseRow> extends Gene
6
6
  required?: boolean;
7
7
  maxlength?: number;
8
8
  width?: string | number;
9
+ validate?: (value: string) => string | null;
9
10
  onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
10
11
  }
11
12
  export declare const GridFormTextArea: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
@@ -6,6 +6,7 @@ export interface GridFormTextInputProps<RowType extends GridBaseRow> extends Gen
6
6
  required?: boolean;
7
7
  maxlength?: number;
8
8
  width?: string | number;
9
+ validate?: (value: string) => string | null;
9
10
  onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
10
11
  }
11
12
  export declare const GridFormTextInput: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { GridBaseRow } from "../Grid";
2
+ import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
3
+ import { GridFormTextAreaProps } from "../gridForm/GridFormTextArea";
4
+ export declare const GridPopoverTextArea: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType, GridFormTextAreaProps<RowType>>) => import("ag-grid-community").ColDef;
@@ -0,0 +1,4 @@
1
+ import { GridBaseRow } from "../Grid";
2
+ import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
3
+ import { GridFormTextInputProps } from "../gridForm/GridFormTextInput";
4
+ export declare const GridPopoverTextInput: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType, GridFormTextInputProps<RowType>>) => import("ag-grid-community").ColDef;
@@ -89221,6 +89221,9 @@ var GridFormTextArea = function (props) {
89221
89221
  if (formProps.maxlength && value.length > formProps.maxlength) {
89222
89222
  return "Text must be no longer than ".concat(formProps.maxlength, " characters");
89223
89223
  }
89224
+ if (formProps.validate) {
89225
+ return formProps.validate(value);
89226
+ }
89224
89227
  return null;
89225
89228
  }, [formProps.maxlength, formProps.required, value.length]);
89226
89229
  var save = react.exports.useCallback(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {
@@ -89261,6 +89264,9 @@ var GridFormTextInput = function (props) {
89261
89264
  if (formProps.maxlength && value.length > formProps.maxlength) {
89262
89265
  return "Text must be no longer than ".concat(formProps.maxlength, " characters");
89263
89266
  }
89267
+ if (formProps.validate) {
89268
+ return formProps.validate(value);
89269
+ }
89264
89270
  return null;
89265
89271
  }, [formProps.maxlength, formProps.required, value.length]);
89266
89272
  var save = react.exports.useCallback(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {