@linzjs/step-ag-grid 8.1.0 → 8.2.1
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.css +19 -5
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -0
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +2 -2
- package/dist/src/utils/bearing.d.ts +2 -0
- package/dist/step-ag-grid.esm.js +46 -46
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +0 -11
- package/src/components/GridCell.tsx +2 -2
- package/src/components/gridForm/GridFormDropDown.tsx +8 -4
- package/src/components/gridForm/GridFormEditBearing.tsx +1 -1
- package/src/components/gridForm/GridFormMultiSelect.tsx +10 -8
- package/src/components/gridForm/GridFormPopoverMenu.tsx +2 -0
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +8 -13
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +3 -3
- package/src/react-menu3/styles/_var.scss +1 -1
- package/src/stories/grid/GridReadOnly.stories.tsx +4 -0
- package/src/stories/grid/gridForm/GridFormDropDown.stories.tsx +2 -6
- package/src/stories/grid/gridForm/GridFormEditBearing.stories.tsx +8 -12
- package/src/stories/grid/gridForm/GridFormEditBearingCorrection.stories.tsx +8 -12
- package/src/stories/grid/gridForm/GridFormMessage.stories.tsx +0 -1
- package/src/stories/grid/gridForm/GridFormMultiSelect.stories.tsx +70 -0
- package/src/stories/grid/gridForm/GridFormTextArea.stories.tsx +44 -0
- package/src/stories/grid/gridForm/GridFormTextInput.stories.tsx +44 -0
- package/src/styles/Grid.scss +1 -1
- package/src/styles/GridFormMultiSelect.scss +4 -0
- package/src/styles/GridIcon.scss +10 -0
- package/src/styles/lui-overrides.scss +1 -1
- package/src/styles/react-menu-customisations.scss +2 -2
- package/src/utils/bearing.test.ts +46 -3
- package/src/utils/bearing.ts +14 -0
package/dist/index.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
.step-ag-grid-react-menu .szh-menu__item,
|
|
24
24
|
.step-ag-grid-react-menu .szh-menu__header {
|
|
25
|
-
padding: 0.375rem
|
|
25
|
+
padding: 0.375rem 0.75rem;
|
|
26
26
|
}
|
|
27
27
|
.step-ag-grid-react-menu .LuiCheckboxInput {
|
|
28
28
|
margin-bottom: 0;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
color: #2a292c;
|
|
58
58
|
font-family: "Open Sans", system-ui, sans-serif;
|
|
59
59
|
font-style: normal;
|
|
60
|
-
font-weight:
|
|
60
|
+
font-weight: normal;
|
|
61
61
|
}
|
|
62
62
|
.step-ag-grid-react-menu.szh-menu div,
|
|
63
63
|
.step-ag-grid-react-menu.szh-menu a[role=menuitem] {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
color: #2a292c;
|
|
66
66
|
font-family: "Open Sans", system-ui, sans-serif;
|
|
67
67
|
font-style: normal;
|
|
68
|
-
font-weight:
|
|
68
|
+
font-weight: normal;
|
|
69
69
|
}
|
|
70
70
|
.step-ag-grid-react-menu.szh-menu li[role=menuitem]:hover {
|
|
71
71
|
background-color: #e2f3f7;
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
}
|
|
236
236
|
.szh-menu__item--disabled {
|
|
237
237
|
cursor: default;
|
|
238
|
-
color: #
|
|
238
|
+
color: #989189;
|
|
239
239
|
}
|
|
240
240
|
.szh-menu__group {
|
|
241
241
|
box-sizing: border-box;
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
.Grid-popoverContainer {
|
|
347
|
-
padding:
|
|
347
|
+
padding: 0.375rem 0.75rem;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
.ag-cell .GridCell-editableIcon {
|
|
@@ -427,6 +427,10 @@
|
|
|
427
427
|
overflow-y: auto;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
+
.GridMultiSelect-noOptions {
|
|
431
|
+
justify-content: center;
|
|
432
|
+
}
|
|
433
|
+
|
|
430
434
|
.GridFormSubComponentTextInput-full-width-input {
|
|
431
435
|
width: 100%;
|
|
432
436
|
padding: 0;
|
|
@@ -441,11 +445,21 @@
|
|
|
441
445
|
fill: #3a7cdf;
|
|
442
446
|
}
|
|
443
447
|
|
|
448
|
+
.AgGridGenericCellRenderer-ic_info_outlineIcon {
|
|
449
|
+
margin-right: 4px;
|
|
450
|
+
fill: #3a7cdf;
|
|
451
|
+
}
|
|
452
|
+
|
|
444
453
|
.AgGridGenericCellRenderer-ic_warningIcon {
|
|
445
454
|
margin-right: 4px;
|
|
446
455
|
fill: #ea6a2e;
|
|
447
456
|
}
|
|
448
457
|
|
|
458
|
+
.AgGridGenericCellRenderer-ic_warning_outlineIcon {
|
|
459
|
+
margin-right: 4px;
|
|
460
|
+
fill: #ea6a2e;
|
|
461
|
+
}
|
|
462
|
+
|
|
449
463
|
.GridIcon-disabled {
|
|
450
464
|
fill: #beb9b4 !important;
|
|
451
465
|
}
|
|
@@ -22,7 +22,7 @@ export declare const MenuHeaderItem: (title: string) => {
|
|
|
22
22
|
value: string;
|
|
23
23
|
};
|
|
24
24
|
export type SelectOption = null | string | FinalSelectOption;
|
|
25
|
-
export interface
|
|
25
|
+
export interface GridFormDropDownProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
26
26
|
className?: "GridPopoverEditDropDown-containerSmall" | "GridPopoverEditDropDown-containerMedium" | "GridPopoverEditDropDown-containerLarge" | "GridPopoverEditDropDown-containerUnlimited" | string | undefined;
|
|
27
27
|
filtered?: "local" | "reload";
|
|
28
28
|
filterDefaultValue?: string;
|
|
@@ -33,5 +33,5 @@ export interface GridFormPopoutDropDownProps<RowType extends GridBaseRow> extend
|
|
|
33
33
|
onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<RowType>) => Promise<void>;
|
|
34
34
|
options: SelectOption[] | ((selectedRows: RowType[], filter?: string) => Promise<SelectOption[] | undefined> | SelectOption[] | undefined) | undefined;
|
|
35
35
|
}
|
|
36
|
-
export declare const GridFormDropDown: <RowType extends GridBaseRow>(props:
|
|
36
|
+
export declare const GridFormDropDown: <RowType extends GridBaseRow>(props: GridFormDropDownProps<RowType>) => JSX.Element;
|
|
37
37
|
export {};
|
|
@@ -19,6 +19,7 @@ export interface GridFormMultiSelectProps<RowType extends GridBaseRow> extends C
|
|
|
19
19
|
filtered?: boolean;
|
|
20
20
|
filterPlaceholder?: string;
|
|
21
21
|
filterHelpText?: string | ((filter: string, options: MultiSelectOption[]) => string | undefined);
|
|
22
|
+
noOptionsMessage?: string;
|
|
22
23
|
onSelectFilter?: (props: {
|
|
23
24
|
filter: string;
|
|
24
25
|
options: MultiSelectOption[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColDefT, GenericCellEditorProps } from "../GridCell";
|
|
2
2
|
import { GridBaseRow } from "../Grid";
|
|
3
|
-
import {
|
|
3
|
+
import { GridFormDropDownProps } from "../gridForm/GridFormDropDown";
|
|
4
4
|
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
5
|
-
export declare const GridPopoverEditDropDown: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType>, props: GenericCellEditorProps<
|
|
5
|
+
export declare const GridPopoverEditDropDown: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType>, props: GenericCellEditorProps<GridFormDropDownProps<RowType>>) => ColDefT<RowType>;
|
|
@@ -3,3 +3,5 @@ export declare const bearingCorrectionValueFormatter: (value: any) => string;
|
|
|
3
3
|
export declare const bearingNumberParser: (value: string) => number | null;
|
|
4
4
|
export declare const bearingStringValidator: (value: string, customInvalid?: ((value: number | null) => string | null) | undefined) => string | null;
|
|
5
5
|
export declare const convertDDToDMS: (dd: number | null, showPositiveSymbol?: boolean, addTrailingZeros?: boolean) => string;
|
|
6
|
+
export declare const bearingRangeValidator: (value: number | null) => "Bearing is required" | "Bearing must be less than 360 degrees" | "Bearing must not be negative" | null;
|
|
7
|
+
export declare const bearingCorrectionRangeValidator: (value: number | null) => "Bearing correction is required" | "Bearing correction must be less than 360 degrees" | "Bearing correction must be greater then -180 degrees" | null;
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2932,12 +2932,6 @@ var Grid = function (params) {
|
|
|
2932
2932
|
startCellEditing(e);
|
|
2933
2933
|
}
|
|
2934
2934
|
}, [startCellEditing]);
|
|
2935
|
-
var onCellEditingStopped = useCallback(function (event) {
|
|
2936
|
-
refreshSelectedRows(event);
|
|
2937
|
-
// The grid loses cell focus after editing
|
|
2938
|
-
var cell = event.api.getFocusedCell();
|
|
2939
|
-
cell && event.api.setFocusedCell(cell.rowIndex, cell.column);
|
|
2940
|
-
}, [refreshSelectedRows]);
|
|
2941
2935
|
// When rows added or removed then resize columns
|
|
2942
2936
|
useEffect(function () {
|
|
2943
2937
|
if (columnDefs === null || columnDefs === void 0 ? void 0 : columnDefs.length) {
|
|
@@ -2946,7 +2940,7 @@ var Grid = function (params) {
|
|
|
2946
2940
|
}, [columnDefs === null || columnDefs === void 0 ? void 0 : columnDefs.length, sizeColumnsToFit]);
|
|
2947
2941
|
return (jsxs("div", __assign({ "data-testid": params["data-testid"], className: clsx("Grid-container", "ag-theme-alpine", staleGrid && "Grid-sortIsStale", gridReady && params.rowData && "Grid-ready") }, { children: [params.quickFilter && (jsx("div", __assign({ className: "Grid-quickFilter" }, { children: jsx("input", { "aria-label": "Search", className: "lui-margin-top-xxs lui-margin-bottom-xxs Grid-quickFilterBox", type: "text", placeholder: (_a = params.quickFilterPlaceholder) !== null && _a !== void 0 ? _a : "Search...", value: internalQuickFilter, onChange: function (event) {
|
|
2948
2942
|
setInternalQuickFilter(event.target.value);
|
|
2949
|
-
} }) }))), jsx(AgGridReact, { animateRows: params.animateRows, rowClassRules: params.rowClassRules, defaultColDef: params.defaultColDef, getRowId: function (params) { return "".concat(params.data.id); }, suppressRowClickSelection: true, rowSelection: (_b = params.rowSelection) !== null && _b !== void 0 ? _b : "multiple", suppressBrowserResizeObserver: true, colResizeDefault: "shift", onFirstDataRendered: sizeColumnsToFit, onGridSizeChanged: sizeColumnsToFit, suppressClickEdit: true, onCellKeyPress: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, onCellEditingStarted: refreshSelectedRows,
|
|
2943
|
+
} }) }))), jsx(AgGridReact, { animateRows: params.animateRows, rowClassRules: params.rowClassRules, defaultColDef: params.defaultColDef, getRowId: function (params) { return "".concat(params.data.id); }, suppressRowClickSelection: true, rowSelection: (_b = params.rowSelection) !== null && _b !== void 0 ? _b : "multiple", suppressBrowserResizeObserver: true, colResizeDefault: "shift", onFirstDataRendered: sizeColumnsToFit, onGridSizeChanged: sizeColumnsToFit, suppressClickEdit: true, onCellKeyPress: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, onCellEditingStarted: refreshSelectedRows, domLayout: params.domLayout, columnDefs: columnDefs, rowData: params.rowData, noRowsOverlayComponent: noRowsOverlayComponent, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, postSortRows: (_c = params.postSortRows) !== null && _c !== void 0 ? _c : postSortRows, onSelectionChanged: synchroniseExternalStateToGridSelection, onColumnMoved: params.onColumnMoved, alwaysShowVerticalScroll: params.alwaysShowVerticalScroll })] })));
|
|
2950
2944
|
};
|
|
2951
2945
|
|
|
2952
2946
|
var GridCellMultiSelectClassRules = {
|
|
@@ -2981,7 +2975,7 @@ var GridCellRenderer = function (props) {
|
|
|
2981
2975
|
var warningText = warningFn ? warningFn(props) : undefined;
|
|
2982
2976
|
var infoFn = rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.info;
|
|
2983
2977
|
var infoText = infoFn ? infoFn(props) : undefined;
|
|
2984
|
-
return (jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((_b = (_a = colDef.field) !== null && _a !== void 0 ? _a : colDef.colId) !== null && _b !== void 0 ? _b : "", props.data.id) }, { children: jsxs(Fragment$1, { children: [typeof warningText === "string" && jsx(GridIcon, { icon: "
|
|
2978
|
+
return (jsx(GridLoadableCell, __assign({ isLoading: checkUpdating((_b = (_a = colDef.field) !== null && _a !== void 0 ? _a : colDef.colId) !== null && _b !== void 0 ? _b : "", props.data.id) }, { children: jsxs(Fragment$1, { children: [typeof warningText === "string" && jsx(GridIcon, { icon: "ic_warning_outline", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info_outline", title: infoText }), jsx("div", __assign({ style: { display: "flex", flex: 1, overflow: "hidden" } }, { children: ((_c = colDef === null || colDef === void 0 ? void 0 : colDef.cellRendererParams) === null || _c === void 0 ? void 0 : _c.originalCellRenderer) ? (jsx(colDef.cellRendererParams.originalCellRenderer, __assign({}, props))) : (jsx("span", __assign({ title: props.valueFormatted }, { children: props.valueFormatted }))) })), fnOrVar((_d = props.colDef) === null || _d === void 0 ? void 0 : _d.editable, props) && (rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.rightHoverElement) && (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.rightHoverElement })))] }) })));
|
|
2985
2979
|
};
|
|
2986
2980
|
var suppressCellKeyboardEvents = function (e) {
|
|
2987
2981
|
var _a, _b, _c, _d;
|
|
@@ -3428,9 +3422,9 @@ var GridFormDropDown = function (props) {
|
|
|
3428
3422
|
} }, { children: function (_a) {
|
|
3429
3423
|
var _b;
|
|
3430
3424
|
var ref = _a.ref;
|
|
3431
|
-
return (jsxs("div", __assign({ style: { display: "flex", flexDirection: "column", width: "100%" } }, { children: [jsx("input", { className: "LuiTextInput-input", ref: ref, type: "text", placeholder: (_b = props.filterPlaceholder) !== null && _b !== void 0 ? _b : "
|
|
3425
|
+
return (jsxs("div", __assign({ style: { display: "flex", flexDirection: "column", width: "100%" } }, { children: [jsx("input", { className: "LuiTextInput-input", ref: ref, type: "text", placeholder: (_b = props.filterPlaceholder) !== null && _b !== void 0 ? _b : "Filter...", "data-testid": "filteredMenu-free-text-input", defaultValue: filter, "data-allowtabtosave": true, "data-disableenterautosave": !props.onSelectFilter &&
|
|
3432
3426
|
!(filteredValues && filteredValues.length === 1 && !filteredValues[0].subComponent), onChange: function (e) { return setFilter(e.target.value); } }), props.filterHelpText && isNotEmpty(filter) && (jsx(FormError, { error: null, helpText: props.filterHelpText }))] })));
|
|
3433
|
-
} })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && (isEmpty(options) || (filteredValues && isEmpty(filteredValues))) && (jsx(MenuItem, __assign({ className: "GridPopoverEditDropDown-noOptions" }, { children: (_b = props.noOptionsMessage) !== null && _b !== void 0 ? _b : "No Options" }), "".concat(fieldToString(field), "-empty"))), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3427
|
+
} })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && (isEmpty(options) || (filteredValues && isEmpty(filteredValues))) && (jsx(MenuItem, __assign({ className: "GridPopoverEditDropDown-noOptions", disabled: true }, { children: (_b = props.noOptionsMessage) !== null && _b !== void 0 ? _b : "No Options" }), "".concat(fieldToString(field), "-empty"))), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3434
3428
|
var _a;
|
|
3435
3429
|
showHeader = null;
|
|
3436
3430
|
if (item.value === MenuSeparatorString) {
|
|
@@ -3637,12 +3631,13 @@ var textMatch = function (text, filter) {
|
|
|
3637
3631
|
};
|
|
3638
3632
|
|
|
3639
3633
|
var GridFormMultiSelect = function (props) {
|
|
3640
|
-
var _a
|
|
3634
|
+
var _a;
|
|
3635
|
+
var _b = useGridPopoverContext(), selectedRows = _b.selectedRows, data = _b.data;
|
|
3641
3636
|
var subComponentIsValidRef = useRef({});
|
|
3642
3637
|
var optionsInitialising = useRef(false);
|
|
3643
|
-
var
|
|
3644
|
-
var
|
|
3645
|
-
var
|
|
3638
|
+
var _c = useState(""), filter = _c[0], setFilter = _c[1];
|
|
3639
|
+
var _d = useState(""), initialValues = _d[0], setInitialValues = _d[1];
|
|
3640
|
+
var _e = useState(), options = _e[0], setOptions = _e[1];
|
|
3646
3641
|
var invalid = useCallback(function () {
|
|
3647
3642
|
if (!options)
|
|
3648
3643
|
return true;
|
|
@@ -3700,7 +3695,7 @@ var GridFormMultiSelect = function (props) {
|
|
|
3700
3695
|
var headerGroups = useMemo(function () {
|
|
3701
3696
|
if (!options)
|
|
3702
3697
|
return undefined;
|
|
3703
|
-
var result = groupBy(options.filter(function (o) { return textMatch(o.label, filter) && o.value; }), "filter");
|
|
3698
|
+
var result = groupBy(options.filter(function (o) { return textMatch(o.label, filter) && o.value != null; }), "filter");
|
|
3704
3699
|
// remove leading/trailing/duplicate dividers
|
|
3705
3700
|
return fromPairs(toPairs(result).map(function (_a) {
|
|
3706
3701
|
var key = _a[0], arr = _a[1];
|
|
@@ -3726,12 +3721,15 @@ var GridFormMultiSelect = function (props) {
|
|
|
3726
3721
|
}));
|
|
3727
3722
|
}, [filter, options]);
|
|
3728
3723
|
var headers = useMemo(function () { var _a; return (_a = props.headers) !== null && _a !== void 0 ? _a : [{ header: "" }]; }, [props.headers]);
|
|
3729
|
-
var
|
|
3724
|
+
var _f = useGridPopoverHook({
|
|
3730
3725
|
className: props.className,
|
|
3731
3726
|
invalid: invalid,
|
|
3732
3727
|
save: save
|
|
3733
|
-
}), popoverWrapper =
|
|
3734
|
-
return popoverWrapper(jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormMultiSelect-container" }, { children: options && (jsxs(Fragment$1, { children: [props.filtered && (jsx(FilterInput, __assign({}, { headerGroups: headerGroups, options: options, setOptions: setOptions, filter: filter, setFilter: setFilter, triggerSave: triggerSave }, { filterHelpText: props.filterHelpText, onSelectFilter: props.onSelectFilter, filterPlaceholder: props.filterPlaceholder }))), headerGroups && (
|
|
3728
|
+
}), popoverWrapper = _f.popoverWrapper, triggerSave = _f.triggerSave;
|
|
3729
|
+
return popoverWrapper(jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormMultiSelect-container" }, { children: options && (jsxs(Fragment$1, { children: [props.filtered && (jsx(FilterInput, __assign({}, { headerGroups: headerGroups, options: options, setOptions: setOptions, filter: filter, setFilter: setFilter, triggerSave: triggerSave }, { filterHelpText: props.filterHelpText, onSelectFilter: props.onSelectFilter, filterPlaceholder: props.filterPlaceholder }))), headerGroups && (isEmpty(headerGroups) || !toPairs(headerGroups).some(function (_a) {
|
|
3730
|
+
_a[0]; var options = _a[1];
|
|
3731
|
+
return !isEmpty(options);
|
|
3732
|
+
})) && (jsx(MenuItem, __assign({ className: "GridMultiSelect-noOptions", disabled: true }, { children: (_a = props.noOptionsMessage) !== null && _a !== void 0 ? _a : "No Options" }), "noOptions")), headerGroups && !isEmpty(headerGroups) && (jsx("div", __assign({ className: "GridFormMultiSelect-options" }, { children: headers.map(function (header, index) {
|
|
3735
3733
|
var subOptions = headerGroups["".concat(header.filter)];
|
|
3736
3734
|
return (!isEmpty(subOptions) && (jsxs(Fragment, { children: [header.header && jsx(MenuHeader, { children: header.header }), subOptions.map(function (item, index) {
|
|
3737
3735
|
return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "div_".concat(index))) : (jsxs(Fragment, { children: [jsx(MenuRadioItem, { item: item, options: options, setOptions: setOptions }), item.checked && item.subComponent && (jsx(MenuSubComponent, __assign({}, { item: item, options: options, setOptions: setOptions, data: data, triggerSave: triggerSave }, { subComponentIsValid: subComponentIsValidRef.current })))] }, "val_".concat(item.value)));
|
|
@@ -3812,10 +3810,7 @@ var FilterInput = function (props) {
|
|
|
3812
3810
|
lastKeyWasEnter.current = false;
|
|
3813
3811
|
}
|
|
3814
3812
|
}, [addCustomFilterValue, filter, onSelectFilter, setFilter, toggleSelectAllVisible, triggerSave]);
|
|
3815
|
-
return (jsxs(Fragment$1, { children: [jsx(FocusableItem, __assign({ className: "filter-item" }, { children: function (_) { return (jsxs("div", __assign({ style: { width: "100%" }, className: "GridFormMultiSelect-filter" }, { children: [jsx("input", { className: "LuiTextInput-input", type: "text", placeholder: filterPlaceholder !== null && filterPlaceholder !== void 0 ? filterPlaceholder : "
|
|
3816
|
-
_a[0]; var options = _a[1];
|
|
3817
|
-
return !isEmpty(options);
|
|
3818
|
-
}) && (jsx("div", __assign({ className: "szh-menu__item GridPopoverEditDropDown-noOptions" }, { children: "No Options" })))] }));
|
|
3813
|
+
return (jsxs(Fragment$1, { children: [jsx(FocusableItem, __assign({ className: "filter-item" }, { children: function (_) { return (jsxs("div", __assign({ style: { width: "100%" }, className: "GridFormMultiSelect-filter" }, { children: [jsx("input", { className: "LuiTextInput-input", type: "text", placeholder: filterPlaceholder !== null && filterPlaceholder !== void 0 ? filterPlaceholder : "Filter...", "data-testid": "filteredMenu-free-text-input", value: filter, "data-disableenterautosave": true, "data-allowtabtosave": true, onChange: function (e) { return setFilter(e.target.value); }, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }), filterHelpText && (jsx(FormError, { error: null, helpText: typeof filterHelpText === "function" ? filterHelpText(filter.trim(), options) : filterHelpText }))] }))); } }), "filter"), jsx(MenuDivider, {}, "$$divider_filter")] }));
|
|
3819
3814
|
};
|
|
3820
3815
|
var MenuRadioItem = function (props) {
|
|
3821
3816
|
var _a, _b;
|
|
@@ -3830,7 +3825,7 @@ var MenuRadioItem = function (props) {
|
|
|
3830
3825
|
e.keepOpen = true;
|
|
3831
3826
|
toggleValue(item);
|
|
3832
3827
|
}
|
|
3833
|
-
} }, { children: jsx(LuiCheckboxInput, { isChecked: (_a = item.checked) !== null && _a !== void 0 ? _a : false, value: "".concat(item.value), label: jsxs(Fragment$1, { children: [item.warning && jsx(GridIcon, { icon: "
|
|
3828
|
+
} }, { children: jsx(LuiCheckboxInput, { isChecked: (_a = item.checked) !== null && _a !== void 0 ? _a : false, value: "".concat(item.value), label: jsxs(Fragment$1, { children: [item.warning && jsx(GridIcon, { icon: "ic_warning_outline", title: item.warning }), (_b = item.label) !== null && _b !== void 0 ? _b : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value))] }), inputProps: {
|
|
3834
3829
|
onClick: function (e) {
|
|
3835
3830
|
// Click is handled by MenuItem onClick
|
|
3836
3831
|
e.preventDefault();
|
|
@@ -3954,9 +3949,12 @@ var GridFormPopoverMenu = function (props) {
|
|
|
3954
3949
|
setSubComponentSelected(subComponentSelected === item ? null : item);
|
|
3955
3950
|
e.keepOpen = true;
|
|
3956
3951
|
return [3 /*break*/, 3];
|
|
3957
|
-
case 1:
|
|
3958
|
-
|
|
3959
|
-
|
|
3952
|
+
case 1:
|
|
3953
|
+
subComponentIsValid.current = true;
|
|
3954
|
+
setSubSelectedValue(null);
|
|
3955
|
+
return [4 /*yield*/, updateValue(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
3956
|
+
return [2 /*return*/, actionClick(item)];
|
|
3957
|
+
}); }); }, e.key === "Tab" ? (e.shiftKey ? -1 : 1) : 0)];
|
|
3960
3958
|
case 2:
|
|
3961
3959
|
_a.sent();
|
|
3962
3960
|
_a.label = 3;
|
|
@@ -4090,6 +4088,24 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
4090
4088
|
dmsString += "\u00A0".concat(minString, "'");
|
|
4091
4089
|
}
|
|
4092
4090
|
return dmsString;
|
|
4091
|
+
};
|
|
4092
|
+
var bearingRangeValidator = function (value) {
|
|
4093
|
+
if (value === null)
|
|
4094
|
+
return "Bearing is required";
|
|
4095
|
+
if (value >= 360)
|
|
4096
|
+
return "Bearing must be less than 360 degrees";
|
|
4097
|
+
if (value < 0)
|
|
4098
|
+
return "Bearing must not be negative";
|
|
4099
|
+
return null;
|
|
4100
|
+
};
|
|
4101
|
+
var bearingCorrectionRangeValidator = function (value) {
|
|
4102
|
+
if (value === null)
|
|
4103
|
+
return "Bearing correction is required";
|
|
4104
|
+
if (value >= 360)
|
|
4105
|
+
return "Bearing correction must be less than 360 degrees";
|
|
4106
|
+
if (value <= -180)
|
|
4107
|
+
return "Bearing correction must be greater then -180 degrees";
|
|
4108
|
+
return null;
|
|
4093
4109
|
};
|
|
4094
4110
|
|
|
4095
4111
|
var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
@@ -4140,7 +4156,7 @@ var GridFormEditBearing = function (props) {
|
|
|
4140
4156
|
invalid: invalid,
|
|
4141
4157
|
save: save
|
|
4142
4158
|
}).popoverWrapper;
|
|
4143
|
-
return popoverWrapper(jsx("div", __assign({ className: "GridFormEditBearing-input
|
|
4159
|
+
return popoverWrapper(jsx("div", __assign({ className: "GridFormEditBearing-input" }, { children: jsx(TextInputFormatted, { value: defaultValue, onChange: function (e) {
|
|
4144
4160
|
setValue(e.target.value.trim());
|
|
4145
4161
|
}, autoFocus: true, placeholder: props.placeHolder, formatted: bearingStringValidator(value, props.range) || !props.formatValue
|
|
4146
4162
|
? "?"
|
|
@@ -4153,15 +4169,7 @@ var GridPopoverEditBearingLike = function (colDef, props) {
|
|
|
4153
4169
|
var GridPopoverEditBearingEditorParams = {
|
|
4154
4170
|
placeHolder: "Enter bearing",
|
|
4155
4171
|
formatValue: bearingValueFormatter,
|
|
4156
|
-
range:
|
|
4157
|
-
if (value === null)
|
|
4158
|
-
return "Bearing is required";
|
|
4159
|
-
if (value >= 360)
|
|
4160
|
-
return "Bearing must be less than 360 degrees";
|
|
4161
|
-
if (value < 0)
|
|
4162
|
-
return "Bearing must not be negative";
|
|
4163
|
-
return null;
|
|
4164
|
-
}
|
|
4172
|
+
range: bearingRangeValidator
|
|
4165
4173
|
};
|
|
4166
4174
|
var GridPopoverEditBearing = function (colDef, props) {
|
|
4167
4175
|
return GridPopoverEditBearingLike(colDef, {
|
|
@@ -4172,15 +4180,7 @@ var GridPopoverEditBearing = function (colDef, props) {
|
|
|
4172
4180
|
var GridPopoverEditBearingCorrectionEditorParams = {
|
|
4173
4181
|
placeHolder: "Enter bearing correction",
|
|
4174
4182
|
formatValue: bearingCorrectionValueFormatter,
|
|
4175
|
-
range:
|
|
4176
|
-
if (value === null)
|
|
4177
|
-
return "Bearing correction is required";
|
|
4178
|
-
if (value >= 360)
|
|
4179
|
-
return "Bearing correction must be less than 360 degrees";
|
|
4180
|
-
if (value <= -180)
|
|
4181
|
-
return "Bearing correction must be greater then -180 degrees";
|
|
4182
|
-
return null;
|
|
4183
|
-
}
|
|
4183
|
+
range: bearingCorrectionRangeValidator
|
|
4184
4184
|
};
|
|
4185
4185
|
var GridPopoverEditBearingCorrection = function (colDef, props) {
|
|
4186
4186
|
return GridPopoverEditBearingLike(colDef, {
|
|
@@ -24935,5 +24935,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
|
|
|
24935
24935
|
});
|
|
24936
24936
|
}); };
|
|
24937
24937
|
|
|
24938
|
-
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, closePopover, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findOpenPopover, findParentWithClass, findRow, fnOrVar, getMultiSelectOptions, hasParentClass, isCellReadOnly, isFloat, isNotEmpty, openAndClickMenuOption, openAndFindMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, suppressCellKeyboardEvents, typeInputByLabel, typeInputByPlaceholder, typeOnlyInput, typeOtherInput, typeOtherTextArea, useDeferredPromise, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, validateMenuOptions, wait$2 as wait };
|
|
24938
|
+
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, closePopover, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findOpenPopover, findParentWithClass, findRow, fnOrVar, getMultiSelectOptions, hasParentClass, isCellReadOnly, isFloat, isNotEmpty, openAndClickMenuOption, openAndFindMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, suppressCellKeyboardEvents, typeInputByLabel, typeInputByPlaceholder, typeOnlyInput, typeOtherInput, typeOtherTextArea, useDeferredPromise, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, validateMenuOptions, wait$2 as wait };
|
|
24939
24939
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|