@linzjs/step-ag-grid 7.5.2 → 7.6.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.
Files changed (38) hide show
  1. package/dist/GridTheme.scss +3 -2
  2. package/dist/index.css +238 -135
  3. package/dist/index.js +93 -93
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/components/Grid.d.ts +1 -0
  6. package/dist/src/components/GridIcon.d.ts +4 -1
  7. package/dist/src/components/GridLoadableCell.d.ts +0 -2
  8. package/dist/src/components/gridForm/GridFormDropDown.d.ts +0 -1
  9. package/dist/src/components/gridForm/GridFormEditBearing.d.ts +0 -1
  10. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +0 -1
  11. package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +0 -1
  12. package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +2 -2
  13. package/dist/src/index.d.ts +1 -0
  14. package/dist/src/utils/deferredPromise.d.ts +5 -0
  15. package/dist/src/utils/util.d.ts +1 -0
  16. package/dist/step-ag-grid.esm.js +92 -93
  17. package/dist/step-ag-grid.esm.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/components/Grid.tsx +40 -22
  20. package/src/components/GridCell.tsx +13 -9
  21. package/src/components/GridIcon.tsx +15 -4
  22. package/src/components/GridLoadableCell.tsx +10 -23
  23. package/src/components/gridForm/GridFormDropDown.tsx +0 -2
  24. package/src/components/gridForm/GridFormEditBearing.tsx +0 -2
  25. package/src/components/gridForm/GridFormMultiSelect.tsx +0 -2
  26. package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +0 -2
  27. package/src/components/gridRender/GridRenderGenericCell.tsx +3 -32
  28. package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +8 -24
  29. package/src/index.ts +1 -0
  30. package/src/stories/grid/GridReadOnly.stories.tsx +16 -3
  31. package/src/styles/Grid.scss +20 -3
  32. package/src/styles/{GridRenderGenericCell.scss → GridIcon.scss} +19 -15
  33. package/src/{components → styles}/GridLoadableCell.scss +5 -4
  34. package/src/{components/gridPopoverEdit → styles}/GridPopoverMenu.scss +1 -1
  35. package/src/styles/GridTheme.scss +3 -2
  36. package/src/styles/index.scss +8 -0
  37. package/src/utils/deferredPromise.ts +34 -0
  38. package/src/utils/util.ts +2 -0
@@ -4,6 +4,7 @@ export interface GridBaseRow {
4
4
  id: string | number;
5
5
  }
6
6
  export interface GridProps {
7
+ readOnly?: boolean;
7
8
  selectable?: boolean;
8
9
  ["data-testid"]?: string;
9
10
  quickFilter?: boolean;
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { IconName } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
2
+ import { IconName, IconSize } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
3
3
  export declare const GridIcon: (props: {
4
4
  icon: IconName;
5
5
  title: string;
6
+ size?: IconSize;
7
+ disabled?: boolean;
8
+ className?: string;
6
9
  }) => JSX.Element;
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- import "./GridLoadableCell.scss";
3
2
  export declare const GridLoadableCell: (props: {
4
3
  isLoading: boolean;
5
- dataTestId?: string;
6
4
  children: JSX.Element | string;
7
5
  className?: string;
8
6
  }) => JSX.Element;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import "../../styles/GridFormDropDown.scss";
3
2
  import { GridBaseRow } from "../Grid";
4
3
  import { CellEditorCommon } from "../GridCell";
5
4
  export interface GridPopoutEditDropDownSelectedItem<RowType> {
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import "../../styles/GridFormEditBearing.scss";
3
2
  import { GridBaseRow } from "../Grid";
4
3
  import { CellEditorCommon } from "../GridCell";
5
4
  export interface GridFormEditBearingProps<RowType extends GridBaseRow> extends CellEditorCommon {
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import "../../styles/GridFormMultiSelect.scss";
3
2
  import { GridBaseRow } from "../Grid";
4
3
  import { CellEditorCommon } from "../GridCell";
5
4
  export interface MultiSelectOption {
@@ -1,4 +1,3 @@
1
- import "./GridPopoverMenu.scss";
2
1
  import { GridBaseRow } from "../Grid";
3
2
  import { ColDefT, GenericCellEditorProps } from "../GridCell";
4
3
  import { GridFormPopoutMenuProps } from "../gridForm/GridFormPopoverMenu";
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import "../../styles/GridRenderGenericCell.scss";
3
2
  import { ICellRendererParams } from "ag-grid-community";
4
3
  import { GridBaseRow } from "../Grid";
5
4
  import { ColDefT } from "../GridCell";
@@ -11,7 +10,8 @@ export interface GenericCellColDef<RowType extends GridBaseRow> extends ColDefT<
11
10
  }
12
11
  export interface GenericCellRendererParams<RowType extends GridBaseRow> {
13
12
  singleClickEdit?: boolean;
13
+ editableIcon?: JSX.Element | undefined;
14
+ editAction?: (selectedRows: RowType[]) => void;
14
15
  warning?: (props: RowICellRendererParams<RowType>) => string | boolean | null | undefined;
15
16
  info?: (props: RowICellRendererParams<RowType>) => string | boolean | null | undefined;
16
17
  }
17
- export declare const GridRendererGenericCell: <RowType extends GridBaseRow>(props: ICellRendererParams) => JSX.Element;
@@ -37,4 +37,5 @@ export { GridFormSubComponentTextArea } from "./components/gridForm/GridFormSubC
37
37
  export * from "./lui/ActionButton";
38
38
  export * from "./utils/bearing";
39
39
  export * from "./utils/util";
40
+ export * from "./utils/deferredPromise";
40
41
  export * from "./utils/testUtil";
@@ -0,0 +1,5 @@
1
+ export declare const useDeferredPromise: <T>() => {
2
+ invoke: () => Promise<T>;
3
+ resolve: (value: T) => void;
4
+ reject: () => void;
5
+ };
@@ -4,3 +4,4 @@ export declare const isFloat: (value: string) => boolean;
4
4
  export declare const findParentWithClass: (className: string, child: Node) => HTMLElement | null;
5
5
  export declare const hasParentClass: (className: string, child: Node) => boolean;
6
6
  export declare const stringByteLengthIsInvalid: (str: string, maxBytes: number) => boolean;
7
+ export declare const fnOrVar: (fn: any, param: any) => any;
@@ -1329,7 +1329,8 @@ var hasParentClass = function (className, child) {
1329
1329
  };
1330
1330
  var stringByteLengthIsInvalid = function (str, maxBytes) {
1331
1331
  return new TextEncoder().encode(str).length > maxBytes;
1332
- };
1332
+ };
1333
+ var fnOrVar = function (fn, param) { return (typeof fn === "function" ? fn(param) : fn); };
1333
1334
 
1334
1335
  var EventHandlersContext = createContext({
1335
1336
  handleClick: function () { }
@@ -2743,6 +2744,11 @@ var Grid = function (params) {
2743
2744
  synchroniseExternallySelectedItemsToGrid();
2744
2745
  }, [synchroniseExternallySelectedItemsToGrid]);
2745
2746
  var columnDefs = useMemo(function () {
2747
+ var adjustColDefs = params.columnDefs.map(function (colDef) {
2748
+ return __assign(__assign({}, colDef), { editable: params.readOnly ? false : colDef.editable, cellClassRules: __assign(__assign({}, colDef.cellClassRules), { "GridCell-readonly": function (ccp) {
2749
+ return params.readOnly != null && !params.readOnly && !fnOrVar(colDef.editable, ccp);
2750
+ } }) });
2751
+ });
2746
2752
  return params.selectable
2747
2753
  ? __spreadArray([
2748
2754
  {
@@ -2756,8 +2762,8 @@ var Grid = function (params) {
2756
2762
  headerComponent: GridHeaderSelect,
2757
2763
  onCellClicked: clickSelectorCheckboxWhenContainingCellClicked
2758
2764
  }
2759
- ], params.columnDefs, true) : __spreadArray([], params.columnDefs, true);
2760
- }, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs, params.selectable]);
2765
+ ], adjustColDefs, true) : adjustColDefs;
2766
+ }, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs, params.selectable, params.readOnly]);
2761
2767
  var onGridReady = useCallback(function (event) {
2762
2768
  setGridApi(event.api);
2763
2769
  synchroniseExternallySelectedItemsToGrid();
@@ -2788,8 +2794,16 @@ var Grid = function (params) {
2788
2794
  }
2789
2795
  }, [checkUpdating]);
2790
2796
  var onCellDoubleClick = useCallback(function (event) {
2791
- var _a, _b;
2792
- if (!((_b = (_a = event.colDef) === null || _a === void 0 ? void 0 : _a.cellRendererParams) === null || _b === void 0 ? void 0 : _b.singleClickEdit)) {
2797
+ var _a, _b, _c, _d, _e;
2798
+ var editable = fnOrVar((_a = event.colDef) === null || _a === void 0 ? void 0 : _a.editable, event);
2799
+ if (!editable)
2800
+ return;
2801
+ var editAction = (_c = (_b = event.colDef) === null || _b === void 0 ? void 0 : _b.cellRendererParams) === null || _c === void 0 ? void 0 : _c.editAction;
2802
+ if (editAction) {
2803
+ // Clicked row comes first in selected rows
2804
+ editAction(__spreadArray([event.data], event.api.getSelectedRows().filter(function (row) { return row.id !== event.data.id; }), true));
2805
+ }
2806
+ else if (!((_e = (_d = event.colDef) === null || _d === void 0 ? void 0 : _d.cellRendererParams) === null || _e === void 0 ? void 0 : _e.singleClickEdit)) {
2793
2807
  startCellEditing(event);
2794
2808
  }
2795
2809
  }, [startCellEditing]);
@@ -2830,66 +2844,15 @@ var GridCellMultiSelectClassRules = {
2830
2844
  }
2831
2845
  };
2832
2846
 
2833
- function styleInject(css, ref) {
2834
- if ( ref === void 0 ) ref = {};
2835
- var insertAt = ref.insertAt;
2836
-
2837
- if (!css || typeof document === 'undefined') { return; }
2838
-
2839
- var head = document.head || document.getElementsByTagName('head')[0];
2840
- var style = document.createElement('style');
2841
- style.type = 'text/css';
2842
-
2843
- if (insertAt === 'top') {
2844
- if (head.firstChild) {
2845
- head.insertBefore(style, head.firstChild);
2846
- } else {
2847
- head.appendChild(style);
2848
- }
2849
- } else {
2850
- head.appendChild(style);
2851
- }
2852
-
2853
- if (style.styleSheet) {
2854
- style.styleSheet.cssText = css;
2855
- } else {
2856
- style.appendChild(document.createTextNode(css));
2857
- }
2858
- }
2859
-
2860
- var css_248z$8 = ".AgGridGenericCellRenderer-icon{margin-right:4px}.AgGridGenericCellRenderer-ic_infoIcon{fill:#3a7cdf;margin-right:4px}.AgGridGenericCellRenderer-ic_warningIcon{fill:#ea6a2e;margin-right:4px}";
2861
- styleInject(css_248z$8);
2862
-
2863
- var css_248z$7 = ".GridLoadableCell-container{align-items:center;display:flex}";
2864
- styleInject(css_248z$7);
2865
-
2866
- var GridLoadableCell = function (props) {
2867
- if (props.isLoading) {
2868
- return (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: jsx(LuiMiniSpinner, { size: 22, divProps: { role: "status", "aria-label": "Loading", style: { marginBottom: 4 } } }) })));
2869
- }
2870
- // only add test id into ONE of the columns in a grid. this way each row will have one unique id :)
2871
- return (jsx("div", __assign({ "data-testid": props.dataTestId, className: clsx("GridLoadableCell-container", props.className) }, { children: props.children })));
2872
- };
2873
-
2874
- var GridIcon = function (props) { return (jsx(LuiIcon, { name: props.icon, title: props.title, alt: props.title, size: "md", className: "AgGridGenericCellRenderer-".concat(props.icon, "Icon") })); };
2847
+ var GridLoadableCell = function (props) { return (jsx("div", __assign({ className: clsx("GridLoadableCell-container", props.className) }, { children: props.isLoading ? (jsx(LuiMiniSpinner, { size: 22, divProps: { role: "status", "aria-label": "Loading", style: { marginBottom: 4 } } })) : (props.children) }))); };
2875
2848
 
2876
- var GridRendererGenericCell = function (props) {
2877
- var _a, _b, _c;
2878
- var checkUpdating = useContext(GridUpdatingContext).checkUpdating;
2879
- var colDef = props.colDef;
2880
- var cellRendererParams = colDef.cellRendererParams;
2881
- var warningFn = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.warning;
2882
- var warningText = warningFn ? warningFn(props) : undefined;
2883
- var infoFn = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.info;
2884
- var infoText = infoFn ? infoFn(props) : undefined;
2885
- var defaultFormatter = function (value) { return value; };
2886
- var formatter = (_a = props.formatValue) !== null && _a !== void 0 ? _a : defaultFormatter;
2887
- var formatted = formatter(props.value);
2888
- return (jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((_c = (_b = colDef.field) !== null && _b !== void 0 ? _b : colDef.colId) !== null && _c !== void 0 ? _c : "", props.data.id) }, { children: jsxs(Fragment$1, { children: [typeof warningText === "string" && jsx(GridIcon, { icon: "ic_warning", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info", title: infoText }), jsx("span", __assign({ title: formatted }, { children: formatted }))] }) })));
2849
+ var GridIcon = function (props) {
2850
+ var _a;
2851
+ return (jsx(LuiIcon, { name: props.icon, title: props.title, alt: props.title, size: (_a = props.size) !== null && _a !== void 0 ? _a : "md", className: clsx("AgGridGenericCellRenderer-".concat(props.icon, "Icon"), props.className, props.disabled && "GridIcon-disabled") }));
2889
2852
  };
2890
2853
 
2891
2854
  var GridCellRenderer = function (props) {
2892
- var _a, _b, _c;
2855
+ var _a, _b, _c, _d;
2893
2856
  var checkUpdating = useContext(GridUpdatingContext).checkUpdating;
2894
2857
  var colDef = props.colDef;
2895
2858
  var rendererParams = colDef.cellRendererParams;
@@ -2897,7 +2860,7 @@ var GridCellRenderer = function (props) {
2897
2860
  var warningText = warningFn ? warningFn(props) : undefined;
2898
2861
  var infoFn = rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.info;
2899
2862
  var infoText = infoFn ? infoFn(props) : undefined;
2900
- return ((_a = colDef === null || colDef === void 0 ? void 0 : colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.originalCellRenderer) ? (jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((_c = (_b = colDef.field) !== null && _b !== void 0 ? _b : colDef.colId) !== null && _c !== void 0 ? _c : "", props.data.id) }, { children: jsxs(Fragment$1, { children: [typeof warningText === "string" && jsx(GridIcon, { icon: "ic_warning", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info", title: infoText }), jsx(colDef.cellRendererParams.originalCellRenderer, __assign({}, props))] }) }))) : (jsx(GridRendererGenericCell, __assign({}, props)));
2863
+ 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", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info", 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.editableIcon) && (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.editableIcon })))] }) })));
2901
2864
  };
2902
2865
  /*
2903
2866
  * All cells should use this
@@ -3013,30 +2976,11 @@ var useGridPopoverHook = function (props) {
3013
2976
  };
3014
2977
 
3015
2978
  var GridRenderPopoutMenuCell = function (props) {
3016
- var _a, _b, _c;
3017
- var checkUpdating = useContext(GridUpdatingContext).checkUpdating;
3018
- var isLoading = checkUpdating((_b = (_a = props.colDef) === null || _a === void 0 ? void 0 : _a.field) !== null && _b !== void 0 ? _b : "", props.data.id);
3019
- var editable = (_c = props.colDef) === null || _c === void 0 ? void 0 : _c.editable;
3020
- var disabled = !(typeof editable === "function"
3021
- ? editable({
3022
- node: props.node,
3023
- data: props.data,
3024
- column: props.column,
3025
- colDef: props.colDef,
3026
- api: props.api,
3027
- columnApi: props.columnApi,
3028
- context: props.context
3029
- })
3030
- : editable);
3031
- return (jsx(GridLoadableCell, __assign({ isLoading: isLoading, className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }, { children: jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md" }) })));
2979
+ var _a;
2980
+ var disabled = !fnOrVar((_a = props.colDef) === null || _a === void 0 ? void 0 : _a.editable, props);
2981
+ return (jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md", className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }));
3032
2982
  };
3033
2983
 
3034
- var css_248z$6 = ".GridMultiSelect-containerSmall .GridFormMultiSelect-options{max-height:130px;overflow-y:auto}.GridMultiSelect-containerMedium .GridFormMultiSelect-options{max-height:190px;overflow-y:auto}.GridMultiSelect-containerLarge .GridFormMultiSelect-options{max-height:320px;overflow-y:auto}.GridMultiSelect-containerUnlimited .GridFormMultiSelect-options{overflow-y:auto}";
3035
- styleInject(css_248z$6);
3036
-
3037
- var css_248z$5 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:220px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}.GridPopoverEditDropDown-noOptions{justify-content:center}";
3038
- styleInject(css_248z$5);
3039
-
3040
2984
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3041
2985
 
3042
2986
  function getDefaultExportFromCjs (x) {
@@ -3135,8 +3079,35 @@ function defer() {
3135
3079
  return deferred;
3136
3080
  }
3137
3081
 
3138
- var css_248z$4 = ".helpText{color:#6b6966;font-size:.75rem;font-weight:400}";
3139
- styleInject(css_248z$4);
3082
+ function styleInject(css, ref) {
3083
+ if ( ref === void 0 ) ref = {};
3084
+ var insertAt = ref.insertAt;
3085
+
3086
+ if (!css || typeof document === 'undefined') { return; }
3087
+
3088
+ var head = document.head || document.getElementsByTagName('head')[0];
3089
+ var style = document.createElement('style');
3090
+ style.type = 'text/css';
3091
+
3092
+ if (insertAt === 'top') {
3093
+ if (head.firstChild) {
3094
+ head.insertBefore(style, head.firstChild);
3095
+ } else {
3096
+ head.appendChild(style);
3097
+ }
3098
+ } else {
3099
+ head.appendChild(style);
3100
+ }
3101
+
3102
+ if (style.styleSheet) {
3103
+ style.styleSheet.cssText = css;
3104
+ } else {
3105
+ style.appendChild(document.createTextNode(css));
3106
+ }
3107
+ }
3108
+
3109
+ var css_248z$2 = ".helpText{color:#6b6966;font-size:.75rem;font-weight:400}";
3110
+ styleInject(css_248z$2);
3140
3111
 
3141
3112
  var FormError = function (props) {
3142
3113
  return (jsxs(Fragment$1, { children: [props.error && (jsx("span", __assign({ className: "LuiTextInput-error", style: { paddingLeft: 0 } }, { children: props.error }))), props.helpText && !props.error && jsx("span", __assign({ className: "helpText" }, { children: props.helpText }))] }));
@@ -3771,9 +3742,6 @@ var GridPopoutEditMultiSelect = function (colDef, props) {
3771
3742
  return GridCell(colDef, __assign(__assign({ editor: GridFormMultiSelect }, props), { editorParams: __assign({ className: "GridMultiSelect-containerMedium" }, props.editorParams) }));
3772
3743
  };
3773
3744
 
3774
- var css_248z$3 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
3775
- styleInject(css_248z$3);
3776
-
3777
3745
  /** Menu configuration types **/
3778
3746
  var PopoutMenuSeparator = Object.freeze({ __isMenuSeparator__: true });
3779
3747
  /**
@@ -4002,9 +3970,6 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
4002
3970
  return dmsString;
4003
3971
  };
4004
3972
 
4005
- var css_248z$2 = ".GridFormEditBearing-input{width:320px}";
4006
- styleInject(css_248z$2);
4007
-
4008
3973
  var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
4009
3974
  styleInject(css_248z$1);
4010
3975
 
@@ -4451,6 +4416,40 @@ var ActionButton = function (_a) {
4451
4416
  } })) : (jsx(LuiIcon, { name: icon, alt: (_d = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name) !== null && _d !== void 0 ? _d : "", size: size })), iconPosition === "left" && buttonText] })));
4452
4417
  };
4453
4418
 
4419
+ var useDeferredPromise = function () {
4420
+ var promiseResolve = useRef();
4421
+ var promiseReject = useRef();
4422
+ return {
4423
+ invoke: function () {
4424
+ return new Promise(function (resolve, reject) {
4425
+ promiseResolve.current = resolve;
4426
+ promiseReject.current = reject;
4427
+ });
4428
+ },
4429
+ resolve: function (value) {
4430
+ if (!promiseResolve.current) {
4431
+ console.error("Promise not invoked so can't resolve");
4432
+ return;
4433
+ }
4434
+ var temp = promiseResolve.current;
4435
+ promiseResolve.current = undefined;
4436
+ promiseReject.current = undefined;
4437
+ temp(value);
4438
+ },
4439
+ reject: function () {
4440
+ if (!promiseResolve.current) {
4441
+ console.error("Promise not invoked so can't reject");
4442
+ return;
4443
+ }
4444
+ var reject = promiseReject.current;
4445
+ promiseResolve.current = undefined;
4446
+ promiseReject.current = undefined;
4447
+ if (reject)
4448
+ reject();
4449
+ }
4450
+ };
4451
+ };
4452
+
4454
4453
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
4455
4454
  try {
4456
4455
  var info = gen[key](arg);
@@ -24658,5 +24657,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
24658
24657
  });
24659
24658
  }); };
24660
24659
 
24661
- export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridRendererGenericCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findParentWithClass, findRow, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
24660
+ export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findParentWithClass, findRow, fnOrVar, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useDeferredPromise, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
24662
24661
  //# sourceMappingURL=step-ag-grid.esm.js.map