@linzjs/step-ag-grid 2.4.1 → 2.4.2

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,4 +6,4 @@ import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
6
6
  /**
7
7
  * Popout burger menu
8
8
  */
9
- export declare const GridPopoverMenu: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType>, props: GenericCellEditorProps<GridFormPopoutMenuProps<RowType>>) => ColDefT<RowType>;
9
+ export declare const GridPopoverMenu: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType>, custom: GenericCellEditorProps<GridFormPopoutMenuProps<RowType>>) => ColDefT<RowType>;
@@ -9,7 +9,7 @@ export interface ActionButtonProps {
9
9
  dataTestId?: string;
10
10
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
11
11
  className?: string;
12
- onClick?: () => void;
13
- inProgress?: boolean;
12
+ onAction: () => Promise<void>;
13
+ externalSetInProgress?: () => void;
14
14
  }
15
- export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, inProgress, className, title, onClick, size, }: ActionButtonProps) => JSX.Element;
15
+ export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, className, title, onAction, externalSetInProgress, size, }: ActionButtonProps) => JSX.Element;
@@ -3272,12 +3272,11 @@ var GridFormPopoutMenu = function (_props) {
3272
3272
  /**
3273
3273
  * Popout burger menu
3274
3274
  */
3275
- var GridPopoverMenu = function (colDef, props) {
3276
- var _a;
3277
- return GridCell(__assign(__assign({ maxWidth: 64, editable: colDef.editable != null ? colDef.editable : true, cellRenderer: GridRenderPopoutMenuCell, cellClass: ((_a = colDef === null || colDef === void 0 ? void 0 : colDef.cellEditorParams) === null || _a === void 0 ? void 0 : _a.multiEdit) !== false ? GenericMultiEditCellClass : undefined }, colDef), { cellRendererParams: {
3275
+ var GridPopoverMenu = function (colDef, custom) {
3276
+ return GridCell(__assign(__assign({ maxWidth: 64, editable: colDef.editable != null ? colDef.editable : true, cellRenderer: GridRenderPopoutMenuCell, cellClass: (custom === null || custom === void 0 ? void 0 : custom.multiEdit) ? GenericMultiEditCellClass : undefined }, colDef), { cellRendererParams: {
3278
3277
  // Menus open on single click, this parameter is picked up in Grid.tsx
3279
3278
  singleClickEdit: true
3280
- } }), __assign({ editor: GridFormPopoutMenu }, props));
3279
+ } }), __assign({ editor: GridFormPopoutMenu }, custom));
3281
3280
  };
3282
3281
 
3283
3282
  var bearingValueFormatter = function (params) {
@@ -3794,15 +3793,30 @@ var minimumInProgressTimeMs = 950;
3794
3793
  var ActionButton = function (_a) {
3795
3794
  var _b;
3796
3795
  var _c;
3797
- var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, inProgress = _a.inProgress, className = _a.className, title = _a.title, onClick = _a.onClick, _d = _a.size, size = _d === void 0 ? "sm" : _d;
3796
+ var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, className = _a.className, title = _a.title, onAction = _a.onAction, externalSetInProgress = _a.externalSetInProgress, _d = _a.size, size = _d === void 0 ? "sm" : _d;
3797
+ var _e = useState(false), inProgress = _e[0], setInProgress = _e[1];
3798
3798
  var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
3799
- var _e = useStateDeferred(!!inProgress), localInProgress = _e[0], setLocalInProgress = _e[1], setLocalInProgressDeferred = _e[2];
3799
+ var _f = useStateDeferred(inProgress), localInProgress = _f[0], setLocalInProgress = _f[1], setLocalInProgressDeferred = _f[2];
3800
3800
  useEffect(function () {
3801
3801
  if (inProgress == lastInProgress)
3802
3802
  return;
3803
3803
  inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
3804
3804
  }, [inProgress, lastInProgress, setLocalInProgress, setLocalInProgressDeferred]);
3805
- return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: "tertiary", title: title !== null && title !== void 0 ? title : name, "aria-label": name, className: clsx("lui-button-icon", "ActionButton", className, localInProgress && "ActionButton-inProgress"), size: "lg", onClick: onClick, disabled: localInProgress }, { children: [localInProgress ? (jsx(LuiMiniSpinner, { size: 16, divProps: (_b = {
3805
+ return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: "tertiary", title: title !== null && title !== void 0 ? title : name, "aria-label": name, className: clsx("lui-button-icon", "ActionButton", className, localInProgress && "ActionButton-inProgress"), size: "lg", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
3806
+ return __generator(this, function (_a) {
3807
+ switch (_a.label) {
3808
+ case 0:
3809
+ setInProgress(true);
3810
+ externalSetInProgress && setInProgress(true);
3811
+ return [4 /*yield*/, onAction()];
3812
+ case 1:
3813
+ _a.sent();
3814
+ externalSetInProgress && setInProgress(false);
3815
+ setInProgress(false);
3816
+ return [2 /*return*/];
3817
+ }
3818
+ });
3819
+ }); }, disabled: localInProgress }, { children: [localInProgress ? (jsx(LuiMiniSpinner, { size: 16, divProps: (_b = {
3806
3820
  "data-testid": "loading-spinner",
3807
3821
  style: { padding: 0, margin: 0, paddingRight: 8 },
3808
3822
  role: "status"