@linzjs/step-ag-grid 4.0.3 → 5.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 (47) hide show
  1. package/dist/index.js +278 -239
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/GridPopoverHook.d.ts +1 -13
  4. package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
  5. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -1
  6. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +0 -1
  7. package/dist/src/contexts/GridContext.d.ts +1 -0
  8. package/dist/src/contexts/GridPopoverContext.d.ts +1 -1
  9. package/dist/src/contexts/GridUpdatingContext.d.ts +3 -2
  10. package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
  11. package/dist/src/lui/FormError.d.ts +6 -0
  12. package/dist/src/react-menu3/components/MenuItem.d.ts +1 -1
  13. package/dist/src/react-menu3/components/SubMenu.d.ts +1 -1
  14. package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
  15. package/dist/src/react-menu3/types.d.ts +18 -17
  16. package/dist/src/react-menu3/utils/constants.d.ts +4 -0
  17. package/dist/src/react-menu3/utils/utils.d.ts +1 -1
  18. package/dist/step-ag-grid.esm.js +279 -240
  19. package/dist/step-ag-grid.esm.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/components/GridPopoverHook.tsx +11 -80
  22. package/src/components/gridForm/GridFormDropDown.tsx +49 -43
  23. package/src/components/gridForm/GridFormEditBearing.tsx +1 -2
  24. package/src/components/gridForm/GridFormMultiSelect.tsx +12 -4
  25. package/src/components/gridForm/GridFormPopoverMenu.tsx +25 -22
  26. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +1 -14
  27. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +1 -18
  28. package/src/components/gridForm/GridFormTextArea.tsx +3 -2
  29. package/src/components/gridForm/GridFormTextInput.tsx +4 -7
  30. package/src/contexts/GridContext.tsx +4 -0
  31. package/src/contexts/GridContextProvider.tsx +8 -0
  32. package/src/contexts/GridPopoverContext.tsx +1 -1
  33. package/src/contexts/GridPopoverContextProvider.tsx +7 -4
  34. package/src/contexts/GridUpdatingContext.tsx +7 -1
  35. package/src/contexts/GridUpdatingContextProvider.tsx +17 -6
  36. package/src/lui/FormError.tsx +29 -0
  37. package/src/lui/TextAreaInput.tsx +2 -18
  38. package/src/lui/TextInputFormatted.tsx +2 -17
  39. package/src/react-menu3/components/ControlledMenu.tsx +121 -13
  40. package/src/react-menu3/components/MenuItem.tsx +19 -2
  41. package/src/react-menu3/types.ts +2 -0
  42. package/src/react-menu3/utils/constants.ts +4 -0
  43. package/src/stories/grid/FormTest.tsx +25 -25
  44. package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +10 -0
  45. package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +1 -1
  46. package/src/stories/grid/GridReadOnly.stories.tsx +11 -11
  47. package/src/styles/GridFormDropDown.scss +1 -1
@@ -1,4 +1,4 @@
1
- import { KeyboardEventHandler } from "react";
1
+ /// <reference types="react" />
2
2
  import { GridBaseRow } from "./Grid";
3
3
  export interface GridPopoverHookProps<RowType> {
4
4
  className: string | undefined;
@@ -8,16 +8,4 @@ export interface GridPopoverHookProps<RowType> {
8
8
  export declare const useGridPopoverHook: <RowType extends GridBaseRow>(props: GridPopoverHookProps<RowType>) => {
9
9
  popoverWrapper: (children: JSX.Element) => JSX.Element;
10
10
  triggerSave: (reason?: string) => Promise<void>;
11
- onlyInputKeyboardEventHandlers: {
12
- onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
13
- onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
14
- };
15
- firstInputKeyboardEventHandlers: {
16
- onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
17
- onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
18
- };
19
- lastInputKeyboardEventHandlers: {
20
- onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
21
- onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
22
- };
23
11
  };
@@ -22,7 +22,7 @@ export declare const MenuHeaderItem: (title: string) => {
22
22
  label: string;
23
23
  value: string;
24
24
  };
25
- export declare type SelectOption<ValueType> = ValueType | FinalSelectOption<ValueType>;
25
+ export type SelectOption<ValueType> = ValueType | FinalSelectOption<ValueType>;
26
26
  export interface GridFormPopoutDropDownProps<RowType extends GridBaseRow, ValueType> extends CellEditorCommon {
27
27
  className?: "GridPopoverEditDropDown-containerSmall" | "GridPopoverEditDropDown-containerMedium" | "GridPopoverEditDropDown-containerLarge" | "GridPopoverEditDropDown-containerUnlimited" | string | undefined;
28
28
  filtered?: "local" | "reload";
@@ -7,7 +7,7 @@ interface MultiFinalSelectOption<ValueType> {
7
7
  label?: JSX.Element | string;
8
8
  subComponent?: (props: any) => JSX.Element;
9
9
  }
10
- export declare type MultiSelectOption<ValueType> = ValueType | MultiFinalSelectOption<ValueType>;
10
+ export type MultiSelectOption<ValueType> = ValueType | MultiFinalSelectOption<ValueType>;
11
11
  export interface SelectedOptionResult<ValueType> extends MultiFinalSelectOption<ValueType> {
12
12
  subValue?: any;
13
13
  }
@@ -19,7 +19,6 @@ export interface MenuOption<RowType extends GridBaseRow> {
19
19
  label: JSX.Element | string | MenuSeparatorType;
20
20
  action?: (selectedRows: RowType[], menuOption: SelectedMenuOptionResult<RowType>) => Promise<void>;
21
21
  disabled?: string | boolean;
22
- supportsMultiEdit: boolean;
23
22
  hidden?: boolean;
24
23
  subComponent?: (props: any) => JSX.Element;
25
24
  }
@@ -23,5 +23,6 @@ export interface GridContextType {
23
23
  field?: string;
24
24
  }, fnUpdate: (selectedRows: any[]) => Promise<boolean>, setSaving?: (saving: boolean) => void) => Promise<boolean>;
25
25
  redrawRows: (rowNodes?: RowNode[]) => void;
26
+ selectNextCell: (tabDirection: -1 | 0 | 1) => void;
26
27
  }
27
28
  export declare const GridContext: import("react").Context<GridContextType>;
@@ -15,7 +15,7 @@ export interface GridPopoverContextType<RowType extends GridBaseRow> {
15
15
  value: any;
16
16
  data: RowType;
17
17
  selectedRows: RowType[];
18
- updateValue: (saveFn: (selectedRows: any[]) => Promise<boolean>) => Promise<boolean>;
18
+ updateValue: (saveFn: (selectedRows: any[]) => Promise<boolean>, tabDirection: 1 | 0 | -1) => Promise<boolean>;
19
19
  }
20
20
  export declare const GridPopoverContext: import("react").Context<GridPopoverContextType<any>>;
21
21
  export declare const useGridPopoverContext: <RowType extends GridBaseRow>() => GridPopoverContextType<RowType>;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare type GridUpdatingContextType = {
2
+ export type GridUpdatingContextType = {
3
3
  checkUpdating: (fields: string | string[], id: number | string) => boolean;
4
- modifyUpdating: (field: string, ids: (number | string)[], fn: () => void | Promise<void>) => Promise<void>;
4
+ modifyUpdating: (fields: string | string[], ids: (number | string)[], fn: () => void | Promise<void>) => Promise<void>;
5
+ updatedDep: number;
5
6
  };
6
7
  export declare const GridUpdatingContext: import("react").Context<GridUpdatingContextType>;
@@ -2,6 +2,6 @@ import { ReactNode } from "react";
2
2
  interface UpdatingContextProviderProps {
3
3
  children: ReactNode;
4
4
  }
5
- export declare type GridUpdatingContextStatus = Record<string, (number | string)[] | undefined>;
5
+ export type GridUpdatingContextStatus = Record<string, (number | string)[] | undefined>;
6
6
  export declare const GridUpdatingContextProvider: (props: UpdatingContextProviderProps) => JSX.Element;
7
7
  export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface FormErrorProps {
3
+ helpText?: string;
4
+ error?: string | boolean | null;
5
+ }
6
+ export declare const FormError: (props: FormErrorProps) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { BaseProps, ClickEvent, EventHandler, Hoverable, MenuItemTypeProp, RenderProp } from "../types";
2
- export declare type MenuItemModifiers = Readonly<{
2
+ export type MenuItemModifiers = Readonly<{
3
3
  /**
4
4
  * 'radio' for radio item, 'checkbox' for checkbox item, or `undefined` for other items.
5
5
  */
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties, ReactNode } from "react";
2
2
  import { BaseProps, ClassNameProp, Hoverable, MenuAlign, MenuArrowModifiers, MenuDirection, MenuModifiers, MenuOverflow, MenuPosition, RenderProp, UncontrolledMenuProps } from "../types";
3
3
  import { withHoveringResultProps } from "../utils/withHovering";
4
- export declare type SubMenuItemModifiers = Readonly<{
4
+ export type SubMenuItemModifiers = Readonly<{
5
5
  /**
6
6
  * Indicates if the submenu is open.
7
7
  */
@@ -1,5 +1,5 @@
1
1
  import { ClassNameProp } from "../types";
2
- declare type useBemModifiers = Record<string, boolean | string | undefined>;
2
+ type useBemModifiers = Record<string, boolean | string | undefined>;
3
3
  interface useBemProps {
4
4
  block: string;
5
5
  element?: string;
@@ -1,21 +1,21 @@
1
1
  import { ForwardedRef, MutableRefObject } from "react";
2
- export declare type MenuState = "opening" | "open" | "closing" | "closed";
3
- export declare type MenuAlign = "start" | "center" | "end";
4
- export declare type MenuDirection = "left" | "right" | "top" | "bottom";
5
- export declare type MenuPosition = "auto" | "anchor" | "initial";
6
- export declare type MenuOverflow = "auto" | "visible" | "hidden";
7
- export declare type MenuReposition = "auto" | "initial";
8
- export declare type MenuViewScroll = "auto" | "close" | "initial";
9
- export declare type MenuItemTypeProp = "checkbox" | "radio";
10
- export declare type CloseReason = "click" | "cancel" | "blur" | "scroll";
2
+ export type MenuState = "opening" | "open" | "closing" | "closed";
3
+ export type MenuAlign = "start" | "center" | "end";
4
+ export type MenuDirection = "left" | "right" | "top" | "bottom";
5
+ export type MenuPosition = "auto" | "anchor" | "initial";
6
+ export type MenuOverflow = "auto" | "visible" | "hidden";
7
+ export type MenuReposition = "auto" | "initial";
8
+ export type MenuViewScroll = "auto" | "close" | "initial";
9
+ export type MenuItemTypeProp = "checkbox" | "radio";
10
+ export type CloseReason = "click" | "cancel" | "blur" | "scroll";
11
11
  /**
12
12
  * - `'first'` focus the first item in the menu.
13
13
  * - `'last'` focus the last item in the menu.
14
14
  * - `number` focus item at the specific position (zero-based).
15
15
  */
16
- export declare type FocusPosition = "first" | "last" | number;
17
- export declare type ClassNameProp<M = undefined> = string | ((modifiers: M) => string);
18
- export declare type RenderProp<M, R = React.ReactNode> = R | ((modifiers: M) => R);
16
+ export type FocusPosition = "first" | "last" | number;
17
+ export type ClassNameProp<M = undefined> = string | ((modifiers: M) => string);
18
+ export type RenderProp<M, R = React.ReactNode> = R | ((modifiers: M) => R);
19
19
  export interface BaseProps<M = undefined> extends Omit<React.HTMLAttributes<HTMLElement>, "className" | "children"> {
20
20
  ref?: React.Ref<any>;
21
21
  /**
@@ -40,6 +40,7 @@ export interface Event {
40
40
  * Indicates the key if the event is triggered by keyboard. Can be 'Enter', ' '(Space) or 'Escape'.
41
41
  */
42
42
  key?: string;
43
+ shiftKey?: boolean;
43
44
  }
44
45
  export interface MenuCloseEvent extends Event {
45
46
  /**
@@ -66,7 +67,7 @@ export interface RectElement {
66
67
  height: number;
67
68
  };
68
69
  }
69
- export declare type MenuModifiers = Readonly<{
70
+ export type MenuModifiers = Readonly<{
70
71
  /**
71
72
  * Indicates the state of menu.
72
73
  */
@@ -76,7 +77,7 @@ export declare type MenuModifiers = Readonly<{
76
77
  */
77
78
  dir: MenuDirection;
78
79
  }>;
79
- export declare type MenuArrowModifiers = Readonly<{
80
+ export type MenuArrowModifiers = Readonly<{
80
81
  /**
81
82
  * Computed direction in which the menu expands.
82
83
  *
@@ -84,7 +85,7 @@ export declare type MenuArrowModifiers = Readonly<{
84
85
  */
85
86
  dir: MenuDirection;
86
87
  }>;
87
- export declare type TransitionFieldType = boolean | {
88
+ export type TransitionFieldType = boolean | {
88
89
  open?: boolean;
89
90
  close?: boolean;
90
91
  item?: boolean;
@@ -200,7 +201,7 @@ interface BaseMenuProps extends Omit<BaseProps, "style"> {
200
201
  setDownOverflow?: boolean;
201
202
  children?: React.ReactNode;
202
203
  }
203
- export declare type MenuButtonModifiers = Readonly<{
204
+ export type MenuButtonModifiers = Readonly<{
204
205
  /**
205
206
  * Indicates if the associated menu is open.
206
207
  */
@@ -254,7 +255,7 @@ export interface ClickEvent extends RadioChangeEvent {
254
255
  */
255
256
  checked?: boolean;
256
257
  }
257
- export declare type PortalFieldType = boolean | {
258
+ export type PortalFieldType = boolean | {
258
259
  /**
259
260
  * A DOM node under which menu will be rendered.
260
261
  */
@@ -15,9 +15,11 @@ export interface RMEvent {
15
15
  checked?: boolean;
16
16
  name?: string;
17
17
  key?: string;
18
+ shiftKey?: boolean;
18
19
  }
19
20
  export declare const Keys: Readonly<{
20
21
  ENTER: "Enter";
22
+ TAB: "Tab";
21
23
  ESC: "Escape";
22
24
  SPACE: " ";
23
25
  HOME: "Home";
@@ -42,6 +44,8 @@ export declare const CloseReason: Readonly<{
42
44
  CANCEL: "cancel";
43
45
  BLUR: "blur";
44
46
  SCROLL: "scroll";
47
+ TAB_FORWARD: "tab_forward";
48
+ TAB_BACKWARD: "tab_backward";
45
49
  }>;
46
50
  export declare const FocusPositions: Readonly<{
47
51
  FIRST: "first";
@@ -11,7 +11,7 @@ export declare const values: {
11
11
  (o: {}): any[];
12
12
  };
13
13
  export declare const floatEqual: (a: number, b: number, diff?: number) => boolean;
14
- export declare type TransitionMap = {
14
+ export type TransitionMap = {
15
15
  open?: boolean;
16
16
  close?: boolean;
17
17
  item?: boolean;