@linzjs/step-ag-grid 1.4.7 → 1.4.9
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/index.d.ts +1 -0
- package/dist/index.js +34 -11
- package/dist/index.js.map +1 -1
- package/dist/src/components/GridCell.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormPopoutMenu.d.ts +1 -0
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +2 -2
- package/dist/step-ag-grid.esm.js +34 -12
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridCell.tsx +27 -14
- package/src/components/gridForm/GridFormPopoutMenu.tsx +11 -8
- package/src/components/gridRender/GridRenderGenericCell.tsx +6 -5
- package/src/stories/components/GridReadOnly.stories.tsx +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { GridFormTextArea } from "./src/components/gridForm/GridFormTextArea";
|
|
|
31
31
|
export { GridFormTextInput } from "./src/components/gridForm/GridFormTextInput";
|
|
32
32
|
export { TextAreaInput } from "./src/lui/TextAreaInput";
|
|
33
33
|
export { TextInputFormatted } from "./src/lui/TextInputFormatted";
|
|
34
|
+
export { GridSubComponentTextArea } from "./src/components/GridSubComponentTextArea";
|
|
34
35
|
export * from "./src/utils/bearing";
|
|
35
36
|
export * from "./src/utils/util";
|
|
36
37
|
export * from "./src/react-menu3/index";
|
package/dist/index.js
CHANGED
|
@@ -876,39 +876,53 @@ var GridLoadableCell = function (props) {
|
|
|
876
876
|
var GridIcon = function (props) { return (jsxRuntime.jsx(lui.LuiIcon, { name: props.icon, title: props.title, alt: props.title, size: "md", className: "AgGridGenericCellRenderer-".concat(props.icon, "Icon") })); };
|
|
877
877
|
|
|
878
878
|
var GridRendererGenericCell = function (props) {
|
|
879
|
-
var _a, _b, _c
|
|
879
|
+
var _a, _b, _c;
|
|
880
880
|
var checkUpdating = react.useContext(UpdatingContext).checkUpdating;
|
|
881
|
-
var
|
|
881
|
+
var colDef = props.colDef;
|
|
882
|
+
var cellRendererParams = colDef.cellRendererParams;
|
|
882
883
|
var warningFn = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.warning;
|
|
883
884
|
var warningText = warningFn ? warningFn(props) : undefined;
|
|
884
885
|
var infoFn = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.info;
|
|
885
886
|
var infoText = infoFn ? infoFn(props) : undefined;
|
|
886
887
|
var defaultFormatter = function (props) { return props.value; };
|
|
887
|
-
var formatter = (
|
|
888
|
+
var formatter = (_a = colDef.valueFormatter) !== null && _a !== void 0 ? _a : defaultFormatter;
|
|
888
889
|
if (typeof formatter === "string") {
|
|
889
890
|
console.error("valueFormatter must be a function");
|
|
890
891
|
return jsxRuntime.jsx("span", { children: "valueFormatter must be a function" });
|
|
891
892
|
}
|
|
892
893
|
var formatted = formatter(props);
|
|
893
|
-
return (jsxRuntime.jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((
|
|
894
|
+
return (jsxRuntime.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: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [typeof warningText === "string" && jsxRuntime.jsx(GridIcon, { icon: "ic_warning", title: warningText }), typeof infoText === "string" && jsxRuntime.jsx(GridIcon, { icon: "ic_info", title: infoText }), jsxRuntime.jsx("span", __assign({ title: formatted }, { children: formatted }))] }) })));
|
|
894
895
|
};
|
|
895
896
|
|
|
896
|
-
var GridCellRenderer = function (
|
|
897
|
-
var _a, _b, _c
|
|
897
|
+
var GridCellRenderer = function (props) {
|
|
898
|
+
var _a, _b, _c;
|
|
898
899
|
var checkUpdating = react.useContext(UpdatingContext).checkUpdating;
|
|
899
|
-
var colDef =
|
|
900
|
-
|
|
900
|
+
var colDef = props.colDef;
|
|
901
|
+
var rendererParams = colDef.cellRendererParams;
|
|
902
|
+
var warningFn = rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.warning;
|
|
903
|
+
var warningText = warningFn ? warningFn(props) : undefined;
|
|
904
|
+
var infoFn = rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.info;
|
|
905
|
+
var infoText = infoFn ? infoFn(props) : undefined;
|
|
906
|
+
return ((_a = colDef === null || colDef === void 0 ? void 0 : colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.originalCellRenderer) ? (jsxRuntime.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: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [typeof warningText === "string" && jsxRuntime.jsx(GridIcon, { icon: "ic_warning", title: warningText }), typeof infoText === "string" && jsxRuntime.jsx(GridIcon, { icon: "ic_info", title: infoText }), jsxRuntime.jsx(colDef.cellRendererParams.originalCellRenderer, __assign({}, props))] }) }))) : (jsxRuntime.jsx(GridRendererGenericCell, __assign({}, props)));
|
|
901
907
|
};
|
|
902
908
|
/**
|
|
903
909
|
* For editing a text area.
|
|
904
910
|
*/
|
|
905
911
|
var GridCell = function (props) {
|
|
906
912
|
var _a;
|
|
907
|
-
return __assign(__assign(__assign({
|
|
913
|
+
return __assign(__assign(__assign(__assign({ sortable: !!((props === null || props === void 0 ? void 0 : props.field) || (props === null || props === void 0 ? void 0 : props.valueGetter)), resizable: true }, (props.cellEditorParams && {
|
|
908
914
|
cellClass: ((_a = props === null || props === void 0 ? void 0 : props.cellEditorParams) === null || _a === void 0 ? void 0 : _a.multiEdit) ? GenericMultiEditCellClass : undefined,
|
|
909
915
|
editable: true,
|
|
910
916
|
cellEditor: GenericCellEditorComponent
|
|
911
|
-
})),
|
|
917
|
+
})), {
|
|
918
|
+
// Default value formatter, otherwise react freaks out on objects
|
|
919
|
+
valueFormatter: function (params) {
|
|
920
|
+
var types = ["number", "undefined", "boolean", "string"];
|
|
921
|
+
if (types.includes(typeof params.value))
|
|
922
|
+
return params.value;
|
|
923
|
+
else
|
|
924
|
+
return JSON.stringify(params.value);
|
|
925
|
+
} }), props), { cellRenderer: GridCellRenderer, cellRendererParams: __assign({ originalCellRenderer: props.cellRenderer }, props.cellRendererParams) });
|
|
912
926
|
};
|
|
913
927
|
var GenericCellEditorComponentFr = function (props, _) {
|
|
914
928
|
var _a, _b, _c;
|
|
@@ -2733,7 +2747,7 @@ var GridFormPopoutMenu = function (props) {
|
|
|
2733
2747
|
});
|
|
2734
2748
|
var popoverWrapper = useGridPopoverHook(props).popoverWrapper;
|
|
2735
2749
|
return popoverWrapper(jsxRuntime.jsx(ComponentLoadingWrapper, __assign({ loading: !filteredOptions }, { children: jsxRuntime.jsx("div", __assign({ className: "Grid-popoverContainerList" }, { children: options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
2736
|
-
return item.label === MenuSeparator ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : (jsxRuntime.jsx(MenuItem, __assign({ onClick: function () { return actionClick(item); }, disabled: !!item.disabled || !(filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.includes(item)), title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "" }, { children: item.label }), "".concat(item.label)));
|
|
2750
|
+
return item.label === MenuSeparator ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : (!item.hidden && (jsxRuntime.jsx(MenuItem, __assign({ onClick: function () { return actionClick(item); }, disabled: !!item.disabled || !(filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.includes(item)), title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "" }, { children: item.label }), "".concat(item.label))));
|
|
2737
2751
|
}) })) })));
|
|
2738
2752
|
};
|
|
2739
2753
|
|
|
@@ -3200,6 +3214,14 @@ var GridPopoverTextInput = function (colDef) {
|
|
|
3200
3214
|
})));
|
|
3201
3215
|
};
|
|
3202
3216
|
|
|
3217
|
+
var GridSubComponentTextArea = function (props) {
|
|
3218
|
+
var _a = react.useState(""), value = _a[0], setValue = _a[1];
|
|
3219
|
+
react.useEffect(function () {
|
|
3220
|
+
props.setValue(value);
|
|
3221
|
+
}, [props, value]);
|
|
3222
|
+
return (jsxRuntime.jsx("div", __assign({ className: "FreeTextInput LuiDeprecatedForms" }, { children: jsxRuntime.jsx("textarea", { autoFocus: true, maxLength: 10000, spellCheck: true, className: "free-text-input", onChange: function (e) { return setValue(e.target.value); }, defaultValue: value }) })));
|
|
3223
|
+
};
|
|
3224
|
+
|
|
3203
3225
|
exports.ComponentLoadingWrapper = ComponentLoadingWrapper;
|
|
3204
3226
|
exports.ControlledMenu = ControlledMenu;
|
|
3205
3227
|
exports.FocusableItem = FocusableItem;
|
|
@@ -3228,6 +3250,7 @@ exports.GridPopoverTextArea = GridPopoverTextArea;
|
|
|
3228
3250
|
exports.GridPopoverTextInput = GridPopoverTextInput;
|
|
3229
3251
|
exports.GridRenderPopoutMenuCell = GridRenderPopoutMenuCell;
|
|
3230
3252
|
exports.GridRendererGenericCell = GridRendererGenericCell;
|
|
3253
|
+
exports.GridSubComponentTextArea = GridSubComponentTextArea;
|
|
3231
3254
|
exports.Menu = Menu;
|
|
3232
3255
|
exports.MenuButton = MenuButton;
|
|
3233
3256
|
exports.MenuDivider = MenuDivider;
|