@linzjs/step-ag-grid 2.4.1 → 2.4.3

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.
@@ -3,5 +3,6 @@ export interface GridFormSubComponentTextInput {
3
3
  setValue: (value: string) => void;
4
4
  keyDown: (key: string) => void;
5
5
  placeholder?: string;
6
+ className?: string;
6
7
  }
7
- export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue }: GridFormSubComponentTextInput) => JSX.Element;
8
+ export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue, className, }: GridFormSubComponentTextInput) => JSX.Element;
@@ -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) {
@@ -3660,10 +3659,11 @@ var GridPopoverTextInput = function (colDef, params) {
3660
3659
  };
3661
3660
 
3662
3661
  var GridFormSubComponentTextInput = function (_a) {
3663
- var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue;
3662
+ var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue, className = _a.className;
3664
3663
  var placeholderText = placeholder || "Other...";
3664
+ var inputClass = className || "";
3665
3665
  var _b = useState(""), inputValue = _b[0], setInputValue = _b[1];
3666
- return (jsx(Fragment$1, { children: jsx(TextInputFormatted, { value: inputValue, onChange: function (e) {
3666
+ return (jsx(Fragment$1, { children: jsx(TextInputFormatted, { className: inputClass, value: inputValue, onChange: function (e) {
3667
3667
  var value = e.target.value;
3668
3668
  setValue(value);
3669
3669
  setInputValue(value);
@@ -3674,6 +3674,9 @@ var GridFormSubComponentTextInput = function (_a) {
3674
3674
  if (document.activeElement != e.currentTarget) {
3675
3675
  e.currentTarget.focus();
3676
3676
  }
3677
+ },
3678
+ style: {
3679
+ width: "100%"
3677
3680
  }
3678
3681
  } }) }));
3679
3682
  };
@@ -3794,15 +3797,30 @@ var minimumInProgressTimeMs = 950;
3794
3797
  var ActionButton = function (_a) {
3795
3798
  var _b;
3796
3799
  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;
3800
+ 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;
3801
+ var _e = useState(false), inProgress = _e[0], setInProgress = _e[1];
3798
3802
  var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
3799
- var _e = useStateDeferred(!!inProgress), localInProgress = _e[0], setLocalInProgress = _e[1], setLocalInProgressDeferred = _e[2];
3803
+ var _f = useStateDeferred(inProgress), localInProgress = _f[0], setLocalInProgress = _f[1], setLocalInProgressDeferred = _f[2];
3800
3804
  useEffect(function () {
3801
3805
  if (inProgress == lastInProgress)
3802
3806
  return;
3803
3807
  inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
3804
3808
  }, [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 = {
3809
+ 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 () {
3810
+ return __generator(this, function (_a) {
3811
+ switch (_a.label) {
3812
+ case 0:
3813
+ setInProgress(true);
3814
+ externalSetInProgress && setInProgress(true);
3815
+ return [4 /*yield*/, onAction()];
3816
+ case 1:
3817
+ _a.sent();
3818
+ externalSetInProgress && setInProgress(false);
3819
+ setInProgress(false);
3820
+ return [2 /*return*/];
3821
+ }
3822
+ });
3823
+ }); }, disabled: localInProgress }, { children: [localInProgress ? (jsx(LuiMiniSpinner, { size: 16, divProps: (_b = {
3806
3824
  "data-testid": "loading-spinner",
3807
3825
  style: { padding: 0, margin: 0, paddingRight: 8 },
3808
3826
  role: "status"