@linzjs/step-ag-grid 1.1.1 → 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 GridBaseRow {
6
6
  id: string | number;
7
7
  }
8
8
  export interface GridProps {
9
+ selectable?: boolean;
9
10
  dataTestId?: string;
10
11
  quickFilter?: boolean;
11
12
  quickFilterPlaceholder?: string;
@@ -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;
@@ -45589,19 +45589,22 @@ var Grid = function (params) {
45589
45589
  react.exports.useEffect(function () {
45590
45590
  synchroniseExternallySelectedItemsToGrid();
45591
45591
  }, [synchroniseExternallySelectedItemsToGrid]);
45592
- var columnDefs = react.exports.useMemo(function () { return __spreadArray$1([
45593
- {
45594
- colId: "selection",
45595
- editable: false,
45596
- initialWidth: 35,
45597
- minWidth: 35,
45598
- maxWidth: 35,
45599
- suppressSizeToFit: true,
45600
- checkboxSelection: true,
45601
- headerComponent: GridHeaderSelect,
45602
- onCellClicked: clickSelectorCheckboxWhenContainingCellClicked
45603
- }
45604
- ], params.columnDefs, true); }, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs]);
45592
+ var columnDefs = react.exports.useMemo(function () {
45593
+ return params.selectable
45594
+ ? __spreadArray$1([
45595
+ {
45596
+ colId: "selection",
45597
+ editable: false,
45598
+ initialWidth: 35,
45599
+ minWidth: 35,
45600
+ maxWidth: 35,
45601
+ suppressSizeToFit: true,
45602
+ checkboxSelection: true,
45603
+ headerComponent: GridHeaderSelect,
45604
+ onCellClicked: clickSelectorCheckboxWhenContainingCellClicked
45605
+ }
45606
+ ], params.columnDefs, true) : __spreadArray$1([], params.columnDefs, true);
45607
+ }, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs, params.selectable]);
45605
45608
  var onGridReady = react.exports.useCallback(function (event) {
45606
45609
  setGridApi(event.api);
45607
45610
  params.onGridReady && params.onGridReady(event);
@@ -89218,6 +89221,9 @@ var GridFormTextArea = function (props) {
89218
89221
  if (formProps.maxlength && value.length > formProps.maxlength) {
89219
89222
  return "Text must be no longer than ".concat(formProps.maxlength, " characters");
89220
89223
  }
89224
+ if (formProps.validate) {
89225
+ return formProps.validate(value);
89226
+ }
89221
89227
  return null;
89222
89228
  }, [formProps.maxlength, formProps.required, value.length]);
89223
89229
  var save = react.exports.useCallback(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {
@@ -89258,6 +89264,9 @@ var GridFormTextInput = function (props) {
89258
89264
  if (formProps.maxlength && value.length > formProps.maxlength) {
89259
89265
  return "Text must be no longer than ".concat(formProps.maxlength, " characters");
89260
89266
  }
89267
+ if (formProps.validate) {
89268
+ return formProps.validate(value);
89269
+ }
89261
89270
  return null;
89262
89271
  }, [formProps.maxlength, formProps.required, value.length]);
89263
89272
  var save = react.exports.useCallback(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {