@linzjs/step-ag-grid 1.4.1 → 1.4.4
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 +10 -7
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridForm/GridFormPopoutMenu.d.ts +1 -1
- package/dist/step-ag-grid.esm.js +10 -7
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridPopoverHook.tsx +2 -1
- package/src/components/gridForm/GridFormDropDown.tsx +1 -1
- package/src/components/gridForm/GridFormPopoutMenu.tsx +2 -2
- package/src/stories/components/GridPopoutEditDropDown.stories.tsx +45 -2
- package/src/stories/components/GridReadOnly.stories.tsx +3 -3
- package/src/utils/bearing.ts +7 -4
|
@@ -15,7 +15,7 @@ export interface MenuOption<RowType> {
|
|
|
15
15
|
label: JSX.Element | string | MenuSeparatorType;
|
|
16
16
|
action?: (selectedRows: RowType[]) => Promise<boolean>;
|
|
17
17
|
disabled?: string | boolean;
|
|
18
|
-
|
|
18
|
+
supportsMultiEdit: boolean;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* NOTE: If the popout menu doesn't appear on single click when also selecting row it's because
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -3914,7 +3914,7 @@ var useGridPopoverHook = function (props, save) {
|
|
|
3914
3914
|
return function () { };
|
|
3915
3915
|
}, [handleScreenMouseDown, handleScreenMouseEvent, isOpen]);
|
|
3916
3916
|
var popoverWrapper = useCallback(function (children) {
|
|
3917
|
-
return (jsx(Fragment, { children: anchorRef.current && (jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal:
|
|
3917
|
+
return (jsx(Fragment, { children: anchorRef.current && (jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal: isEmpty(document.querySelectorAll(".PopoutWindowContainer")), unmountOnClose: true, anchorRef: anchorRef, menuClassName: "lui-menu", onClose: function (event) { return triggerSave(event.reason).then(); } }, { children: [saving && (jsx("div", { style: {
|
|
3918
3918
|
position: "absolute",
|
|
3919
3919
|
left: 0,
|
|
3920
3920
|
top: 0,
|
|
@@ -4120,7 +4120,7 @@ var GridFormPopoutMenu = function (props) {
|
|
|
4120
4120
|
}); }, [props.field, props.selectedRows, updatingCells]);
|
|
4121
4121
|
var selectedRowCount = props.selectedRows.length;
|
|
4122
4122
|
var filteredOptions = options === null || options === void 0 ? void 0 : options.filter(function (menuOption) {
|
|
4123
|
-
return menuOption.label === MenuSeparator || selectedRowCount === 1 || menuOption.
|
|
4123
|
+
return menuOption.label === MenuSeparator || selectedRowCount === 1 || menuOption.supportsMultiEdit;
|
|
4124
4124
|
});
|
|
4125
4125
|
var popoverWrapper = useGridPopoverHook(props).popoverWrapper;
|
|
4126
4126
|
return popoverWrapper(jsx(ComponentLoadingWrapper, __assign({ loading: !filteredOptions }, { children: jsx("div", __assign({ className: "Grid-popoverContainerList" }, { children: options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
@@ -4153,6 +4153,9 @@ var bearingCorrectionValueFormatter = function (params) {
|
|
|
4153
4153
|
if (value == null) {
|
|
4154
4154
|
return "-";
|
|
4155
4155
|
}
|
|
4156
|
+
if (typeof value === "string") {
|
|
4157
|
+
return convertDDToDMS(bearingNumberParser(value), true, true);
|
|
4158
|
+
}
|
|
4156
4159
|
return convertDDToDMS(value, true, true);
|
|
4157
4160
|
};
|
|
4158
4161
|
var bearingNumberParser = function (value) {
|
|
@@ -4184,10 +4187,10 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
4184
4187
|
if (dd === 0)
|
|
4185
4188
|
addTrailingZeros = false;
|
|
4186
4189
|
// toFixed rounds parts up greater than 60, which has to be corrected below
|
|
4187
|
-
var _a = dd.toFixed(5).split("."), bearingWholeString = _a[0],
|
|
4190
|
+
var _a = dd.toFixed(5).split("."), bearingWholeString = _a[0], bearingDecimalString = _a[1];
|
|
4188
4191
|
var bearingWhole = Math.abs(parseInt(bearingWholeString));
|
|
4189
|
-
var minNumeric = parseInt(
|
|
4190
|
-
var secNumeric = parseInt(
|
|
4192
|
+
var minNumeric = parseInt(bearingDecimalString === null || bearingDecimalString === void 0 ? void 0 : bearingDecimalString.substring(0, 2));
|
|
4193
|
+
var secNumeric = parseInt(bearingDecimalString === null || bearingDecimalString === void 0 ? void 0 : bearingDecimalString.substring(2, 4));
|
|
4191
4194
|
// If the toFixed caused rounding beyond 60 minutes/seconds then apply the carry
|
|
4192
4195
|
if (secNumeric >= 60) {
|
|
4193
4196
|
minNumeric++;
|
|
@@ -4202,7 +4205,7 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
4202
4205
|
}
|
|
4203
4206
|
var minString = minNumeric.toString().padStart(2, "0");
|
|
4204
4207
|
var secString = secNumeric.toString().padStart(2, "0");
|
|
4205
|
-
var deciSecString =
|
|
4208
|
+
var deciSecString = bearingDecimalString === null || bearingDecimalString === void 0 ? void 0 : bearingDecimalString.substring(4, 5);
|
|
4206
4209
|
var dmsString = "".concat(showPositiveSymbol && dd > 0 ? "+" : "").concat(dd < 0 ? "-" : "").concat(bearingWhole, "\u00B0");
|
|
4207
4210
|
if (addTrailingZeros || deciSecString != "0") {
|
|
4208
4211
|
dmsString += "\u00A0".concat(minString, "'\u00A0").concat(secString, ".").concat(deciSecString, "\""); // "\xa0" is here for non-breaking space
|
|
@@ -4432,7 +4435,7 @@ var GridFormDropDown = function (props) {
|
|
|
4432
4435
|
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 = formProps.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); } }) })));
|
|
4433
4436
|
} })), jsx(MenuDivider, {}, "$$divider_filter")] })), jsx(ComponentLoadingWrapper, __assign({ loading: !options }, { children: jsxs(Fragment, { 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) {
|
|
4434
4437
|
var _a;
|
|
4435
|
-
return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : filteredValues.includes(item.value) ? null : (jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function () { return selectItemHandler(item.value); } }, { children: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)) }), "".concat(
|
|
4438
|
+
return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : filteredValues.includes(item.value) ? null : (jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function () { return selectItemHandler(item.value); } }, { children: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)) }), "".concat(props.field, "-").concat(index)));
|
|
4436
4439
|
})] }) }))] }));
|
|
4437
4440
|
};
|
|
4438
4441
|
|