@linzjs/step-ag-grid 2.4.7 → 2.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.js +53 -38
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +3 -1
- package/dist/step-ag-grid.esm.js +53 -38
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +16 -10
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +20 -3
- package/src/contexts/GridContextProvider.tsx +2 -1
- package/src/styles/GridFormSubComponentTextInput.scss +4 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import "../../styles/GridFormSubComponentTextInput.scss";
|
|
2
3
|
export interface GridFormSubComponentTextInput {
|
|
3
4
|
setValue: (value: string) => void;
|
|
4
5
|
keyDown: (key: string) => void;
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
className?: string;
|
|
8
|
+
customHelpText?: string;
|
|
7
9
|
}
|
|
8
|
-
export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue, className, }: GridFormSubComponentTextInput) => JSX.Element;
|
|
10
|
+
export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue, className, customHelpText, }: GridFormSubComponentTextInput) => JSX.Element;
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2073,7 +2073,8 @@ var GridContextProvider = function (props) {
|
|
|
2073
2073
|
*/
|
|
2074
2074
|
var sizeColumnsToFit = function () {
|
|
2075
2075
|
gridApiOp(function (gridApi) {
|
|
2076
|
-
|
|
2076
|
+
// Hide size columns to fit errors in tests
|
|
2077
|
+
document.body.clientWidth && gridApi.sizeColumnsToFit();
|
|
2077
2078
|
});
|
|
2078
2079
|
};
|
|
2079
2080
|
var stopEditing = function () { return gridApiOp(function (gridApi) { return gridApi.stopEditing(); }); };
|
|
@@ -2585,11 +2586,11 @@ function styleInject(css, ref) {
|
|
|
2585
2586
|
}
|
|
2586
2587
|
}
|
|
2587
2588
|
|
|
2588
|
-
var css_248z$
|
|
2589
|
-
styleInject(css_248z$
|
|
2589
|
+
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}";
|
|
2590
|
+
styleInject(css_248z$8);
|
|
2590
2591
|
|
|
2591
|
-
var css_248z$
|
|
2592
|
-
styleInject(css_248z$
|
|
2592
|
+
var css_248z$7 = ".GridLoadableCell-container{align-items:center;display:flex}";
|
|
2593
|
+
styleInject(css_248z$7);
|
|
2593
2594
|
|
|
2594
2595
|
var GridLoadableCell = function (props) {
|
|
2595
2596
|
if (props.isLoading) {
|
|
@@ -2813,11 +2814,11 @@ var GridRenderPopoutMenuCell = function (props) {
|
|
|
2813
2814
|
return (jsx(GridLoadableCell, __assign({ isLoading: isLoading, className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }, { children: jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md" }) })));
|
|
2814
2815
|
};
|
|
2815
2816
|
|
|
2816
|
-
var css_248z$
|
|
2817
|
-
styleInject(css_248z$
|
|
2817
|
+
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}";
|
|
2818
|
+
styleInject(css_248z$6);
|
|
2818
2819
|
|
|
2819
|
-
var css_248z$
|
|
2820
|
-
styleInject(css_248z$
|
|
2820
|
+
var css_248z$5 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:200px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}";
|
|
2821
|
+
styleInject(css_248z$5);
|
|
2821
2822
|
|
|
2822
2823
|
/* global setTimeout, clearTimeout */
|
|
2823
2824
|
|
|
@@ -2976,7 +2977,11 @@ var GridFormDropDown = function (_props) {
|
|
|
2976
2977
|
case 2:
|
|
2977
2978
|
optionsList = optionsConf === null || optionsConf === void 0 ? void 0 : optionsConf.map(function (item) {
|
|
2978
2979
|
if (item == null || typeof item == "string" || typeof item == "number") {
|
|
2979
|
-
item = {
|
|
2980
|
+
item = {
|
|
2981
|
+
value: item,
|
|
2982
|
+
label: item,
|
|
2983
|
+
disabled: false
|
|
2984
|
+
};
|
|
2980
2985
|
}
|
|
2981
2986
|
return item;
|
|
2982
2987
|
});
|
|
@@ -3058,9 +3063,9 @@ var GridFormDropDown = function (_props) {
|
|
|
3058
3063
|
var _b;
|
|
3059
3064
|
var ref = _a.ref;
|
|
3060
3065
|
return (jsx("div", __assign({ style: { display: "flex", width: "100%" } }, { children: jsx("input", { autoFocus: true, className: "free-text-input", style: { border: "0px" }, ref: ref, type: "text", placeholder: (_b = props.filterPlaceholder) !== null && _b !== void 0 ? _b : "Placeholder", "data-testid": "filteredMenu-free-text-input", defaultValue: filter, onChange: function (e) { return setFilter(e.target.value.toLowerCase()); }, onKeyDown: function (e) { return onFilterKeyDown(e); } }) })));
|
|
3061
|
-
} })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && jsx(MenuItem, { children: "[Empty]" }), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3066
|
+
} })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && (jsx(MenuItem, { children: "[Empty]" }, "".concat(props.field, "-empty"))), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3062
3067
|
var _a;
|
|
3063
|
-
return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsx(MenuHeader, { children: item.label })) : filteredValues.includes(item.value) ? null : (jsx(
|
|
3068
|
+
return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsx("div", { children: !item.subComponent ? (jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function () {
|
|
3064
3069
|
selectItemHandler(item.value);
|
|
3065
3070
|
} }, { children: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)) }), "".concat(props.field, "-").concat(index))) : (jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) {
|
|
3066
3071
|
return item.subComponent &&
|
|
@@ -3087,13 +3092,14 @@ var GridFormDropDown = function (_props) {
|
|
|
3087
3092
|
var optionValue = _a.optionValue;
|
|
3088
3093
|
return optionValue === item.value;
|
|
3089
3094
|
});
|
|
3090
|
-
if (key === "Enter" && subComponentItem) {
|
|
3095
|
+
if ((key === "Enter" || key === "Tab") && subComponentItem) {
|
|
3091
3096
|
selectItemHandler(item.value, subComponentItem.subComponentValue);
|
|
3092
3097
|
ref.closeMenu();
|
|
3093
3098
|
}
|
|
3094
|
-
}
|
|
3099
|
+
},
|
|
3100
|
+
key: "".concat(props.field, "-").concat(index, "_subcomponent_inner")
|
|
3095
3101
|
}, ref);
|
|
3096
|
-
} }), "".concat(props.field, "-").concat(index, "_subcomponent"))) }));
|
|
3102
|
+
} }), "".concat(props.field, "-").concat(index, "_subcomponent"))) }, "menu-wrapper-".concat(index)));
|
|
3097
3103
|
})] }) }))] }));
|
|
3098
3104
|
};
|
|
3099
3105
|
|
|
@@ -3259,8 +3265,8 @@ var GridPopoutEditMultiSelect = function (colDef, props) {
|
|
|
3259
3265
|
return GridCell(colDef, __assign(__assign({ editor: GridFormMultiSelect }, props), { editorParams: __assign({ className: "GridMultiSelect-containerMedium" }, props.editorParams) }));
|
|
3260
3266
|
};
|
|
3261
3267
|
|
|
3262
|
-
var css_248z$
|
|
3263
|
-
styleInject(css_248z$
|
|
3268
|
+
var css_248z$4 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
|
|
3269
|
+
styleInject(css_248z$4);
|
|
3264
3270
|
|
|
3265
3271
|
/** Menu configuration types **/
|
|
3266
3272
|
var PopoutMenuSeparator = Object.freeze({ __isMenuSeparator__: true });
|
|
@@ -3422,11 +3428,11 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
3422
3428
|
return dmsString;
|
|
3423
3429
|
};
|
|
3424
3430
|
|
|
3425
|
-
var css_248z$
|
|
3426
|
-
styleInject(css_248z$
|
|
3431
|
+
var css_248z$3 = ".GridFormEditBearing-input{width:320px}";
|
|
3432
|
+
styleInject(css_248z$3);
|
|
3427
3433
|
|
|
3428
|
-
var css_248z$
|
|
3429
|
-
styleInject(css_248z$
|
|
3434
|
+
var css_248z$2 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
3435
|
+
styleInject(css_248z$2);
|
|
3430
3436
|
|
|
3431
3437
|
var TextInputFormatted = function (props) {
|
|
3432
3438
|
return (jsxs("div", __assign({ className: clsx("LuiTextInput Grid-popoverContainer", props.error && "hasError", props.warning && "hasWarning", props.className) }, { children: [jsxs("span", __assign({ className: "LuiTextInput-inputWrapper" }, { children: [jsx("input", __assign({ type: "text", className: "LuiTextInput-input", min: "0", spellCheck: true, defaultValue: props.value, onChange: props.onChange }, props.inputProps)), jsx("span", __assign({ className: "LuiTextInput-formatted" }, { children: props.formatted }))] })), props.error && (jsxs("span", __assign({ className: "LuiTextInput-error" }, { children: [jsx(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }), props.error] }))), props.warning && (jsxs("span", __assign({ className: "LuiTextInput-warning" }, { children: [jsx(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextInput-warning-icon", size: "sm", status: "warning" }), props.warning] })))] })));
|
|
@@ -3723,27 +3729,36 @@ var GridPopoverTextInput = function (colDef, params) {
|
|
|
3723
3729
|
return GridCell(colDef, __assign({ editor: GridFormTextInput }, params));
|
|
3724
3730
|
};
|
|
3725
3731
|
|
|
3732
|
+
var css_248z$1 = ".GridFormSubComponentTextInput-full-width-input{padding:0;width:100%}";
|
|
3733
|
+
styleInject(css_248z$1);
|
|
3734
|
+
|
|
3726
3735
|
var GridFormSubComponentTextInput = function (_a) {
|
|
3727
|
-
var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue, className = _a.className;
|
|
3736
|
+
var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue, className = _a.className, customHelpText = _a.customHelpText;
|
|
3728
3737
|
var placeholderText = placeholder || "Other...";
|
|
3729
|
-
var
|
|
3738
|
+
var helpText = customHelpText || "Press enter or tab to save";
|
|
3739
|
+
var inputClass = className || "GridFormSubComponentTextInput-full-width-input";
|
|
3730
3740
|
var _b = useState(""), inputValue = _b[0], setInputValue = _b[1];
|
|
3731
|
-
return (
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
+
return (jsxs("div", __assign({ style: {
|
|
3742
|
+
display: "flex",
|
|
3743
|
+
flexDirection: "column"
|
|
3744
|
+
} }, { children: [jsx(TextInputFormatted, { className: inputClass, value: inputValue, onChange: function (e) {
|
|
3745
|
+
var value = e.target.value;
|
|
3746
|
+
setValue(value);
|
|
3747
|
+
setInputValue(value);
|
|
3748
|
+
}, inputProps: {
|
|
3749
|
+
onKeyDown: function (k) { return keyDown(k.key); },
|
|
3750
|
+
placeholder: placeholderText,
|
|
3751
|
+
onMouseEnter: function (e) {
|
|
3752
|
+
if (document.activeElement != e.currentTarget) {
|
|
3753
|
+
e.currentTarget.focus();
|
|
3754
|
+
}
|
|
3755
|
+
},
|
|
3756
|
+
style: {
|
|
3757
|
+
width: "100%"
|
|
3741
3758
|
}
|
|
3742
|
-
},
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
}
|
|
3746
|
-
} }) }));
|
|
3759
|
+
} }), jsx("span", __assign({ style: {
|
|
3760
|
+
fontSize: "0.75rem"
|
|
3761
|
+
} }, { children: helpText }))] })));
|
|
3747
3762
|
};
|
|
3748
3763
|
|
|
3749
3764
|
var GridSubComponentTextArea = function (props) {
|