@linzjs/step-ag-grid 3.0.2 → 4.0.1

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 (37) hide show
  1. package/dist/index.js +283 -217
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/GridPopoverHook.d.ts +13 -1
  4. package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +11 -0
  5. package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +8 -8
  6. package/dist/src/components/gridForm/GridFormTextArea.d.ts +3 -4
  7. package/dist/src/components/gridForm/GridFormTextInput.d.ts +3 -4
  8. package/dist/src/index.d.ts +1 -1
  9. package/dist/src/lui/TextAreaInput.d.ts +4 -5
  10. package/dist/src/lui/TextInputFormatted.d.ts +4 -10
  11. package/dist/src/utils/textValidator.d.ts +6 -0
  12. package/dist/step-ag-grid.esm.js +283 -217
  13. package/dist/step-ag-grid.esm.js.map +1 -1
  14. package/package.json +1 -1
  15. package/src/components/Grid.tsx +2 -2
  16. package/src/components/GridCell.tsx +5 -0
  17. package/src/components/GridPopoverHook.tsx +79 -1
  18. package/src/components/gridForm/GridFormDropDown.tsx +63 -56
  19. package/src/components/gridForm/GridFormEditBearing.tsx +7 -8
  20. package/src/components/gridForm/GridFormMultiSelect.tsx +6 -10
  21. package/src/components/gridForm/GridFormPopoverMenu.tsx +7 -10
  22. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +58 -0
  23. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +48 -55
  24. package/src/components/gridForm/GridFormTextArea.tsx +10 -18
  25. package/src/components/gridForm/GridFormTextInput.tsx +12 -25
  26. package/src/contexts/GridPopoverContextProvider.tsx +11 -4
  27. package/src/index.ts +1 -1
  28. package/src/lui/TextAreaInput.tsx +34 -18
  29. package/src/lui/TextInputFormatted.tsx +19 -35
  30. package/src/react-menu3/components/MenuItem.tsx +5 -2
  31. package/src/stories/grid/FormTest.tsx +16 -3
  32. package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +20 -17
  33. package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +2 -2
  34. package/src/stories/grid/GridReadOnly.stories.tsx +15 -3
  35. package/src/utils/textValidator.ts +24 -0
  36. package/dist/src/components/GridSubComponentTextArea.d.ts +0 -10
  37. package/src/components/GridSubComponentTextArea.tsx +0 -62
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { KeyboardEventHandler } from "react";
2
2
  import { GridBaseRow } from "./Grid";
3
3
  export interface GridPopoverHookProps<RowType> {
4
4
  className: string | undefined;
@@ -7,4 +7,16 @@ export interface GridPopoverHookProps<RowType> {
7
7
  export declare const useGridPopoverHook: <RowType extends GridBaseRow>(props: GridPopoverHookProps<RowType>) => {
8
8
  popoverWrapper: (children: JSX.Element) => JSX.Element;
9
9
  triggerSave: (reason?: string) => Promise<void>;
10
+ onlyInputKeyboardEventHandlers: {
11
+ onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
12
+ onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
13
+ };
14
+ firstInputKeyboardEventHandlers: {
15
+ onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
16
+ onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
17
+ };
18
+ lastInputKeyboardEventHandlers: {
19
+ onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
20
+ onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
21
+ };
10
22
  };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { CellEditorCommon } from "../GridCell";
3
+ import { TextInputValidatorProps } from "../../utils/textValidator";
4
+ export interface GridSubComponentTextAreaProps extends TextInputValidatorProps, CellEditorCommon {
5
+ placeholder?: string;
6
+ width?: string | number;
7
+ defaultValue: string;
8
+ className?: string;
9
+ helpText?: string;
10
+ }
11
+ export declare const GridFormSubComponentTextArea: (props: GridSubComponentTextAreaProps) => JSX.Element;
@@ -1,10 +1,10 @@
1
- import "../../styles/GridFormSubComponentTextInput.scss";
2
- import { KeyboardEvent } from "react";
3
- export interface GridFormSubComponentTextInput {
4
- setValue: (value: string) => void;
5
- keyDown: (key: string, event: KeyboardEvent<HTMLInputElement>) => void;
1
+ /// <reference types="react" />
2
+ import { TextInputValidatorProps } from "../../utils/textValidator";
3
+ import { CellEditorCommon } from "../GridCell";
4
+ export interface GridFormSubComponentTextInputProps extends TextInputValidatorProps, CellEditorCommon {
6
5
  placeholder?: string;
7
- className?: string;
8
- customHelpText?: string;
6
+ width?: string | number;
7
+ defaultValue: string;
8
+ helpText?: string;
9
9
  }
10
- export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue, className, customHelpText, }: GridFormSubComponentTextInput) => JSX.Element;
10
+ export declare const GridFormSubComponentTextInput: (props: GridFormSubComponentTextInputProps) => JSX.Element;
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { GridBaseRow } from "../Grid";
3
3
  import { CellEditorCommon } from "../GridCell";
4
- export interface GridFormTextAreaProps<RowType extends GridBaseRow> extends CellEditorCommon {
4
+ import { TextInputValidatorProps } from "../../utils/textValidator";
5
+ export interface GridFormTextAreaProps<RowType extends GridBaseRow> extends TextInputValidatorProps, CellEditorCommon {
5
6
  placeholder?: string;
6
- required?: boolean;
7
- maxLength?: number;
8
7
  width?: string | number;
9
- validate?: (value: string) => string | null;
10
8
  onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
9
+ helpText?: string;
11
10
  }
12
11
  export declare const GridFormTextArea: <RowType extends GridBaseRow>(props: GridFormTextAreaProps<RowType>) => JSX.Element;
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { GridBaseRow } from "../Grid";
3
3
  import { CellEditorCommon } from "../GridCell";
4
- export interface GridFormTextInputProps<RowType extends GridBaseRow> extends CellEditorCommon {
4
+ import { TextInputValidatorProps } from "../../utils/textValidator";
5
+ export interface GridFormTextInputProps<RowType extends GridBaseRow> extends TextInputValidatorProps, CellEditorCommon {
5
6
  placeholder?: string;
6
7
  units?: string;
7
- required?: boolean;
8
- maxLength?: number;
9
8
  width?: string | number;
10
- validate?: (value: string, data: RowType) => string | null;
11
9
  onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
10
+ helpText?: string;
12
11
  }
13
12
  export declare const GridFormTextInput: <RowType extends GridBaseRow>(props: GridFormTextInputProps<RowType>) => JSX.Element;
@@ -33,7 +33,7 @@ export * from "./components/gridForm/GridFormPopoverMenu";
33
33
  export { GridHeaderSelect } from "./components/gridHeader/GridHeaderSelect";
34
34
  export { TextAreaInput } from "./lui/TextAreaInput";
35
35
  export { TextInputFormatted } from "./lui/TextInputFormatted";
36
- export { GridSubComponentTextArea } from "./components/GridSubComponentTextArea";
36
+ export { GridFormSubComponentTextArea } from "./components/gridForm/GridFormSubComponentTextArea";
37
37
  export * from "./lui/ActionButton";
38
38
  export * from "./utils/bearing";
39
39
  export * from "./utils/util";
@@ -1,11 +1,10 @@
1
- import { ChangeEventHandler, InputHTMLAttributes } from "react";
1
+ import { InputHTMLAttributes } from "react";
2
2
  export declare const useGenerateOrDefaultId: (idFromProps?: string) => string;
3
- export interface LuiTextAreaInputProps {
3
+ export interface LuiTextAreaInputProps extends InputHTMLAttributes<HTMLTextAreaElement> {
4
+ value: string;
4
5
  label?: JSX.Element | string;
5
6
  mandatory?: boolean;
6
- inputProps?: InputHTMLAttributes<HTMLTextAreaElement>;
7
- onChange?: ChangeEventHandler<HTMLTextAreaElement>;
8
- value: string;
7
+ helpText?: string;
9
8
  error?: string | boolean | null;
10
9
  }
11
10
  export declare const TextAreaInput: (props: LuiTextAreaInputProps) => JSX.Element;
@@ -1,15 +1,9 @@
1
1
  import "./TextInputFormatted.scss";
2
- import { ChangeEventHandler, DetailedHTMLProps, FocusEventHandler, InputHTMLAttributes, MouseEventHandler } from "react";
3
- export interface LuiTextInputProps {
4
- onChange?: ChangeEventHandler<HTMLInputElement>;
5
- onFocus?: FocusEventHandler<HTMLInputElement>;
6
- onClick?: MouseEventHandler<HTMLInputElement>;
7
- inputProps?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
8
- error?: string | boolean | null;
9
- warning?: string | boolean | null;
10
- className?: string;
2
+ import { DetailedHTMLProps, InputHTMLAttributes } from "react";
3
+ export interface LuiTextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
11
4
  value: string;
12
- placeholder?: string;
5
+ helpText?: string;
6
+ error?: string | boolean | null;
13
7
  formatted?: string;
14
8
  }
15
9
  export declare const TextInputFormatted: (props: LuiTextInputProps) => JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface TextInputValidatorProps {
2
+ required?: boolean;
3
+ maxLength?: number;
4
+ validate?: (value: string) => string | null;
5
+ }
6
+ export declare const TextInputValidator: (props: TextInputValidatorProps, value: string | null) => string | null;