@linzjs/step-ag-grid 22.1.1 → 22.2.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.
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +12 -0
- package/dist/src/components/gridPopoverEdit/index.d.ts +1 -0
- package/dist/step-ag-grid.cjs.js +36 -0
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +36 -1
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridPopoverEdit/GridButton.tsx +63 -0
- package/src/components/gridPopoverEdit/index.ts +1 -0
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +21 -1
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +1 -1
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -4433,6 +4433,41 @@ const GridFormTextInput = (props) => {
|
|
|
4433
4433
|
return popoverWrapper(jsx("div", { style: { display: "flex", flexDirection: "row" }, className: "FormTest subComponent", children: jsx(TextInputFormatted, { value: value, onChange: (e) => setValue(e.target.value), error: invalid(), formatted: props.units, style: { width: props.width ?? 240 }, placeholder: props.placeholder ?? "Type here", helpText: helpText }) }));
|
|
4434
4434
|
};
|
|
4435
4435
|
|
|
4436
|
+
const ButtonCellRenderer = (props) => {
|
|
4437
|
+
const { data, node, column, colDef, api } = props;
|
|
4438
|
+
const inputRef = useRef(null);
|
|
4439
|
+
useEffect(() => {
|
|
4440
|
+
const checkFocus = (event) => {
|
|
4441
|
+
if (event.rowIndex === node.rowIndex && event.column === column) {
|
|
4442
|
+
inputRef.current?.focus();
|
|
4443
|
+
}
|
|
4444
|
+
};
|
|
4445
|
+
api.addEventListener("cellFocused", checkFocus);
|
|
4446
|
+
return () => {
|
|
4447
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
4448
|
+
};
|
|
4449
|
+
}, [api, column, node.rowIndex]);
|
|
4450
|
+
return (jsx(LuiButton, { ref: inputRef, className: "lui-button-icon-only", size: "sm", level: "text", onClick: () => {
|
|
4451
|
+
const selectedRows = [data];
|
|
4452
|
+
const selectedRowIds = selectedRows.map((r) => r.id);
|
|
4453
|
+
colDef?.cellEditorParams.onClick?.({ selectedRows, selectedRowIds });
|
|
4454
|
+
}, style: { display: colDef?.cellEditorParams?.visible?.(props) !== false ? "" : "none" }, children: jsx(LuiIcon, { name: "ic_redo", alt: "revert", size: "md" }) }));
|
|
4455
|
+
};
|
|
4456
|
+
const GridButton = (colDef, editor) => {
|
|
4457
|
+
return GridCell({
|
|
4458
|
+
minWidth: 72,
|
|
4459
|
+
maxWidth: 72,
|
|
4460
|
+
resizable: false,
|
|
4461
|
+
headerClass: "GridHeaderAlignCenter",
|
|
4462
|
+
cellClass: "GridCellAlignCenter",
|
|
4463
|
+
cellRenderer: ButtonCellRenderer,
|
|
4464
|
+
cellEditorParams: {
|
|
4465
|
+
...editor,
|
|
4466
|
+
},
|
|
4467
|
+
...colDef,
|
|
4468
|
+
});
|
|
4469
|
+
};
|
|
4470
|
+
|
|
4436
4471
|
const BooleanCellRenderer = (props) => {
|
|
4437
4472
|
const { onValueChange, value, api, node, column, colDef, data } = props;
|
|
4438
4473
|
const inputRef = useRef(null);
|
|
@@ -5335,5 +5370,5 @@ const useDeferredPromise = () => {
|
|
|
5335
5370
|
};
|
|
5336
5371
|
};
|
|
5337
5372
|
|
|
5338
|
-
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, clickInputWhenContainingCellClicked, convertDDToDMS, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
|
|
5373
|
+
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, clickInputWhenContainingCellClicked, convertDDToDMS, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
|
|
5339
5374
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|