@linzjs/step-ag-grid 7.5.1 → 7.6.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/GridTheme.scss +3 -2
- package/dist/index.css +238 -135
- package/dist/index.js +97 -97
- package/dist/index.js.map +1 -1
- package/dist/src/components/Grid.d.ts +2 -1
- package/dist/src/components/GridIcon.d.ts +4 -1
- package/dist/src/components/GridLoadableCell.d.ts +0 -2
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +0 -1
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +0 -1
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +0 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +0 -1
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +2 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lui/ActionButton.d.ts +3 -3
- package/dist/src/utils/deferredPromise.d.ts +5 -0
- package/dist/src/utils/util.d.ts +1 -0
- package/dist/step-ag-grid.esm.js +96 -97
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Grid.tsx +42 -24
- package/src/components/GridCell.tsx +13 -9
- package/src/components/GridIcon.tsx +15 -4
- package/src/components/GridLoadableCell.tsx +10 -23
- package/src/components/gridForm/GridFormDropDown.tsx +0 -2
- package/src/components/gridForm/GridFormEditBearing.tsx +0 -2
- package/src/components/gridForm/GridFormMultiSelect.tsx +0 -2
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +0 -2
- package/src/components/gridRender/GridRenderGenericCell.tsx +3 -32
- package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +8 -24
- package/src/index.ts +1 -0
- package/src/lui/ActionButton.scss +20 -8
- package/src/lui/ActionButton.tsx +6 -10
- package/src/stories/components/ActionButton.stories.tsx +9 -1
- package/src/stories/grid/GridPopoutBearing.stories.tsx +1 -0
- package/src/stories/grid/GridReadOnly.stories.tsx +16 -3
- package/src/styles/Grid.scss +20 -3
- package/src/styles/{GridRenderGenericCell.scss → GridIcon.scss} +19 -15
- package/src/{components → styles}/GridLoadableCell.scss +5 -4
- package/src/{components/gridPopoverEdit → styles}/GridPopoverMenu.scss +1 -1
- package/src/styles/GridTheme.scss +3 -2
- package/src/styles/index.scss +8 -0
- package/src/utils/deferredPromise.ts +34 -0
- package/src/utils/util.ts +2 -0
|
@@ -4,8 +4,9 @@ export interface GridBaseRow {
|
|
|
4
4
|
id: string | number;
|
|
5
5
|
}
|
|
6
6
|
export interface GridProps {
|
|
7
|
+
readOnly?: boolean;
|
|
7
8
|
selectable?: boolean;
|
|
8
|
-
|
|
9
|
+
["data-testid"]?: string;
|
|
9
10
|
quickFilter?: boolean;
|
|
10
11
|
quickFilterPlaceholder?: string;
|
|
11
12
|
quickFilterValue?: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IconName } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
|
|
2
|
+
import { IconName, IconSize } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
|
|
3
3
|
export declare const GridIcon: (props: {
|
|
4
4
|
icon: IconName;
|
|
5
5
|
title: string;
|
|
6
|
+
size?: IconSize;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
6
9
|
}) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import "../../styles/GridFormEditBearing.scss";
|
|
3
2
|
import { GridBaseRow } from "../Grid";
|
|
4
3
|
import { CellEditorCommon } from "../GridCell";
|
|
5
4
|
export interface GridFormEditBearingProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import "../../styles/GridRenderGenericCell.scss";
|
|
3
2
|
import { ICellRendererParams } from "ag-grid-community";
|
|
4
3
|
import { GridBaseRow } from "../Grid";
|
|
5
4
|
import { ColDefT } from "../GridCell";
|
|
@@ -11,7 +10,8 @@ export interface GenericCellColDef<RowType extends GridBaseRow> extends ColDefT<
|
|
|
11
10
|
}
|
|
12
11
|
export interface GenericCellRendererParams<RowType extends GridBaseRow> {
|
|
13
12
|
singleClickEdit?: boolean;
|
|
13
|
+
editableIcon?: JSX.Element | undefined;
|
|
14
|
+
editAction?: (selectedRows: RowType[]) => void;
|
|
14
15
|
warning?: (props: RowICellRendererParams<RowType>) => string | boolean | null | undefined;
|
|
15
16
|
info?: (props: RowICellRendererParams<RowType>) => string | boolean | null | undefined;
|
|
16
17
|
}
|
|
17
|
-
export declare const GridRendererGenericCell: <RowType extends GridBaseRow>(props: ICellRendererParams) => JSX.Element;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -37,4 +37,5 @@ export { GridFormSubComponentTextArea } from "./components/gridForm/GridFormSubC
|
|
|
37
37
|
export * from "./lui/ActionButton";
|
|
38
38
|
export * from "./utils/bearing";
|
|
39
39
|
export * from "./utils/util";
|
|
40
|
+
export * from "./utils/deferredPromise";
|
|
40
41
|
export * from "./utils/testUtil";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import "./ActionButton.scss";
|
|
2
|
+
import { CSSProperties } from "react";
|
|
3
3
|
import { IconName } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
|
|
4
4
|
import { LuiButtonProps } from "@linzjs/lui/dist/components/LuiButton/LuiButton";
|
|
5
5
|
export interface ActionButtonProps {
|
|
@@ -11,9 +11,9 @@ export interface ActionButtonProps {
|
|
|
11
11
|
dataTestId?: string;
|
|
12
12
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
|
|
13
13
|
iconPosition?: "left" | "right";
|
|
14
|
-
className?: "ActionButton-fill" | string;
|
|
14
|
+
className?: "ActionButton-fill" | "ActionButton-tight" | string;
|
|
15
15
|
onClick: () => Promise<void> | void;
|
|
16
16
|
level?: LuiButtonProps["level"];
|
|
17
|
-
style?:
|
|
17
|
+
style?: CSSProperties;
|
|
18
18
|
}
|
|
19
19
|
export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, style, className, title, onClick, size, iconPosition, level, "aria-label": ariaLabel, }: ActionButtonProps) => JSX.Element;
|
package/dist/src/utils/util.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare const isFloat: (value: string) => boolean;
|
|
|
4
4
|
export declare const findParentWithClass: (className: string, child: Node) => HTMLElement | null;
|
|
5
5
|
export declare const hasParentClass: (className: string, child: Node) => boolean;
|
|
6
6
|
export declare const stringByteLengthIsInvalid: (str: string, maxBytes: number) => boolean;
|
|
7
|
+
export declare const fnOrVar: (fn: any, param: any) => any;
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -1329,7 +1329,8 @@ var hasParentClass = function (className, child) {
|
|
|
1329
1329
|
};
|
|
1330
1330
|
var stringByteLengthIsInvalid = function (str, maxBytes) {
|
|
1331
1331
|
return new TextEncoder().encode(str).length > maxBytes;
|
|
1332
|
-
};
|
|
1332
|
+
};
|
|
1333
|
+
var fnOrVar = function (fn, param) { return (typeof fn === "function" ? fn(param) : fn); };
|
|
1333
1334
|
|
|
1334
1335
|
var EventHandlersContext = createContext({
|
|
1335
1336
|
handleClick: function () { }
|
|
@@ -2743,6 +2744,11 @@ var Grid = function (params) {
|
|
|
2743
2744
|
synchroniseExternallySelectedItemsToGrid();
|
|
2744
2745
|
}, [synchroniseExternallySelectedItemsToGrid]);
|
|
2745
2746
|
var columnDefs = useMemo(function () {
|
|
2747
|
+
var adjustColDefs = params.columnDefs.map(function (colDef) {
|
|
2748
|
+
return __assign(__assign({}, colDef), { editable: params.readOnly ? false : colDef.editable, cellClassRules: __assign(__assign({}, colDef.cellClassRules), { "GridCell-readonly": function (ccp) {
|
|
2749
|
+
return params.readOnly != null && !params.readOnly && !fnOrVar(colDef.editable, ccp);
|
|
2750
|
+
} }) });
|
|
2751
|
+
});
|
|
2746
2752
|
return params.selectable
|
|
2747
2753
|
? __spreadArray([
|
|
2748
2754
|
{
|
|
@@ -2756,8 +2762,8 @@ var Grid = function (params) {
|
|
|
2756
2762
|
headerComponent: GridHeaderSelect,
|
|
2757
2763
|
onCellClicked: clickSelectorCheckboxWhenContainingCellClicked
|
|
2758
2764
|
}
|
|
2759
|
-
],
|
|
2760
|
-
}, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs, params.selectable]);
|
|
2765
|
+
], adjustColDefs, true) : adjustColDefs;
|
|
2766
|
+
}, [clickSelectorCheckboxWhenContainingCellClicked, params.columnDefs, params.selectable, params.readOnly]);
|
|
2761
2767
|
var onGridReady = useCallback(function (event) {
|
|
2762
2768
|
setGridApi(event.api);
|
|
2763
2769
|
synchroniseExternallySelectedItemsToGrid();
|
|
@@ -2788,8 +2794,16 @@ var Grid = function (params) {
|
|
|
2788
2794
|
}
|
|
2789
2795
|
}, [checkUpdating]);
|
|
2790
2796
|
var onCellDoubleClick = useCallback(function (event) {
|
|
2791
|
-
var _a, _b;
|
|
2792
|
-
|
|
2797
|
+
var _a, _b, _c, _d, _e;
|
|
2798
|
+
var editable = fnOrVar((_a = event.colDef) === null || _a === void 0 ? void 0 : _a.editable, event);
|
|
2799
|
+
if (!editable)
|
|
2800
|
+
return;
|
|
2801
|
+
var editAction = (_c = (_b = event.colDef) === null || _b === void 0 ? void 0 : _b.cellRendererParams) === null || _c === void 0 ? void 0 : _c.editAction;
|
|
2802
|
+
if (editAction) {
|
|
2803
|
+
// Clicked row comes first in selected rows
|
|
2804
|
+
editAction(__spreadArray([event.data], event.api.getSelectedRows().filter(function (row) { return row.id !== event.data.id; }), true));
|
|
2805
|
+
}
|
|
2806
|
+
else if (!((_e = (_d = event.colDef) === null || _d === void 0 ? void 0 : _d.cellRendererParams) === null || _e === void 0 ? void 0 : _e.singleClickEdit)) {
|
|
2793
2807
|
startCellEditing(event);
|
|
2794
2808
|
}
|
|
2795
2809
|
}, [startCellEditing]);
|
|
@@ -2815,7 +2829,7 @@ var Grid = function (params) {
|
|
|
2815
2829
|
sizeColumnsToFit();
|
|
2816
2830
|
}
|
|
2817
2831
|
}, [columnDefs === null || columnDefs === void 0 ? void 0 : columnDefs.length, sizeColumnsToFit]);
|
|
2818
|
-
return (jsxs("div", __assign({ "data-testid": params
|
|
2832
|
+
return (jsxs("div", __assign({ "data-testid": params["data-testid"], className: clsx("Grid-container", "ag-theme-alpine", staleGrid && "Grid-sortIsStale") }, { 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) {
|
|
2819
2833
|
setInternalQuickFilter(event.target.value);
|
|
2820
2834
|
} }) }))), jsx(AgGridReact, { animateRows: params.animateRows, rowClassRules: params.rowClassRules, defaultColDef: params.defaultColDef, getRowId: function (params) { return "".concat(params.data.id); }, suppressRowClickSelection: true, rowSelection: "multiple", suppressBrowserResizeObserver: true, colResizeDefault: "shift", onFirstDataRendered: sizeColumnsToFit, onGridSizeChanged: sizeColumnsToFit, suppressClickEdit: true, onCellKeyPress: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, onCellEditingStarted: refreshSelectedRows, onCellEditingStopped: onCellEditingStopped, domLayout: params.domLayout, columnDefs: columnDefs, rowData: params.rowData, noRowsOverlayComponent: noRowsOverlayComponent, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, postSortRows: (_b = params.postSortRows) !== null && _b !== void 0 ? _b : postSortRows, onSelectionChanged: synchroniseExternalStateToGridSelection })] })));
|
|
2821
2835
|
};
|
|
@@ -2830,66 +2844,15 @@ var GridCellMultiSelectClassRules = {
|
|
|
2830
2844
|
}
|
|
2831
2845
|
};
|
|
2832
2846
|
|
|
2833
|
-
function
|
|
2834
|
-
if ( ref === void 0 ) ref = {};
|
|
2835
|
-
var insertAt = ref.insertAt;
|
|
2836
|
-
|
|
2837
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
2838
|
-
|
|
2839
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
2840
|
-
var style = document.createElement('style');
|
|
2841
|
-
style.type = 'text/css';
|
|
2842
|
-
|
|
2843
|
-
if (insertAt === 'top') {
|
|
2844
|
-
if (head.firstChild) {
|
|
2845
|
-
head.insertBefore(style, head.firstChild);
|
|
2846
|
-
} else {
|
|
2847
|
-
head.appendChild(style);
|
|
2848
|
-
}
|
|
2849
|
-
} else {
|
|
2850
|
-
head.appendChild(style);
|
|
2851
|
-
}
|
|
2852
|
-
|
|
2853
|
-
if (style.styleSheet) {
|
|
2854
|
-
style.styleSheet.cssText = css;
|
|
2855
|
-
} else {
|
|
2856
|
-
style.appendChild(document.createTextNode(css));
|
|
2857
|
-
}
|
|
2858
|
-
}
|
|
2859
|
-
|
|
2860
|
-
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}";
|
|
2861
|
-
styleInject(css_248z$8);
|
|
2862
|
-
|
|
2863
|
-
var css_248z$7 = ".GridLoadableCell-container{align-items:center;display:flex}";
|
|
2864
|
-
styleInject(css_248z$7);
|
|
2865
|
-
|
|
2866
|
-
var GridLoadableCell = function (props) {
|
|
2867
|
-
if (props.isLoading) {
|
|
2868
|
-
return (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: jsx(LuiMiniSpinner, { size: 22, divProps: { role: "status", "aria-label": "Loading", style: { marginBottom: 4 } } }) })));
|
|
2869
|
-
}
|
|
2870
|
-
// only add test id into ONE of the columns in a grid. this way each row will have one unique id :)
|
|
2871
|
-
return (jsx("div", __assign({ "data-testid": props.dataTestId, className: clsx("GridLoadableCell-container", props.className) }, { children: props.children })));
|
|
2872
|
-
};
|
|
2873
|
-
|
|
2874
|
-
var GridIcon = function (props) { return (jsx(LuiIcon, { name: props.icon, title: props.title, alt: props.title, size: "md", className: "AgGridGenericCellRenderer-".concat(props.icon, "Icon") })); };
|
|
2847
|
+
var GridLoadableCell = function (props) { return (jsx("div", __assign({ className: clsx("GridLoadableCell-container", props.className) }, { children: props.isLoading ? (jsx(LuiMiniSpinner, { size: 22, divProps: { role: "status", "aria-label": "Loading", style: { marginBottom: 4 } } })) : (props.children) }))); };
|
|
2875
2848
|
|
|
2876
|
-
var
|
|
2877
|
-
var _a
|
|
2878
|
-
|
|
2879
|
-
var colDef = props.colDef;
|
|
2880
|
-
var cellRendererParams = colDef.cellRendererParams;
|
|
2881
|
-
var warningFn = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.warning;
|
|
2882
|
-
var warningText = warningFn ? warningFn(props) : undefined;
|
|
2883
|
-
var infoFn = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.info;
|
|
2884
|
-
var infoText = infoFn ? infoFn(props) : undefined;
|
|
2885
|
-
var defaultFormatter = function (value) { return value; };
|
|
2886
|
-
var formatter = (_a = props.formatValue) !== null && _a !== void 0 ? _a : defaultFormatter;
|
|
2887
|
-
var formatted = formatter(props.value);
|
|
2888
|
-
return (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: jsxs(Fragment$1, { children: [typeof warningText === "string" && jsx(GridIcon, { icon: "ic_warning", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info", title: infoText }), jsx("span", __assign({ title: formatted }, { children: formatted }))] }) })));
|
|
2849
|
+
var GridIcon = function (props) {
|
|
2850
|
+
var _a;
|
|
2851
|
+
return (jsx(LuiIcon, { name: props.icon, title: props.title, alt: props.title, size: (_a = props.size) !== null && _a !== void 0 ? _a : "md", className: clsx("AgGridGenericCellRenderer-".concat(props.icon, "Icon"), props.className, props.disabled && "GridIcon-disabled") }));
|
|
2889
2852
|
};
|
|
2890
2853
|
|
|
2891
2854
|
var GridCellRenderer = function (props) {
|
|
2892
|
-
var _a, _b, _c;
|
|
2855
|
+
var _a, _b, _c, _d;
|
|
2893
2856
|
var checkUpdating = useContext(GridUpdatingContext).checkUpdating;
|
|
2894
2857
|
var colDef = props.colDef;
|
|
2895
2858
|
var rendererParams = colDef.cellRendererParams;
|
|
@@ -2897,7 +2860,7 @@ var GridCellRenderer = function (props) {
|
|
|
2897
2860
|
var warningText = warningFn ? warningFn(props) : undefined;
|
|
2898
2861
|
var infoFn = rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.info;
|
|
2899
2862
|
var infoText = infoFn ? infoFn(props) : undefined;
|
|
2900
|
-
return (
|
|
2863
|
+
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", title: warningText }), typeof infoText === "string" && jsx(GridIcon, { icon: "ic_info", 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.editableIcon) && (jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: rendererParams === null || rendererParams === void 0 ? void 0 : rendererParams.editableIcon })))] }) })));
|
|
2901
2864
|
};
|
|
2902
2865
|
/*
|
|
2903
2866
|
* All cells should use this
|
|
@@ -3013,30 +2976,11 @@ var useGridPopoverHook = function (props) {
|
|
|
3013
2976
|
};
|
|
3014
2977
|
|
|
3015
2978
|
var GridRenderPopoutMenuCell = function (props) {
|
|
3016
|
-
var _a
|
|
3017
|
-
var
|
|
3018
|
-
|
|
3019
|
-
var editable = (_c = props.colDef) === null || _c === void 0 ? void 0 : _c.editable;
|
|
3020
|
-
var disabled = !(typeof editable === "function"
|
|
3021
|
-
? editable({
|
|
3022
|
-
node: props.node,
|
|
3023
|
-
data: props.data,
|
|
3024
|
-
column: props.column,
|
|
3025
|
-
colDef: props.colDef,
|
|
3026
|
-
api: props.api,
|
|
3027
|
-
columnApi: props.columnApi,
|
|
3028
|
-
context: props.context
|
|
3029
|
-
})
|
|
3030
|
-
: editable);
|
|
3031
|
-
return (jsx(GridLoadableCell, __assign({ isLoading: isLoading, className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }, { children: jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md" }) })));
|
|
2979
|
+
var _a;
|
|
2980
|
+
var disabled = !fnOrVar((_a = props.colDef) === null || _a === void 0 ? void 0 : _a.editable, props);
|
|
2981
|
+
return (jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md", className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }));
|
|
3032
2982
|
};
|
|
3033
2983
|
|
|
3034
|
-
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}";
|
|
3035
|
-
styleInject(css_248z$6);
|
|
3036
|
-
|
|
3037
|
-
var css_248z$5 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:220px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}.GridPopoverEditDropDown-noOptions{justify-content:center}";
|
|
3038
|
-
styleInject(css_248z$5);
|
|
3039
|
-
|
|
3040
2984
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3041
2985
|
|
|
3042
2986
|
function getDefaultExportFromCjs (x) {
|
|
@@ -3135,8 +3079,35 @@ function defer() {
|
|
|
3135
3079
|
return deferred;
|
|
3136
3080
|
}
|
|
3137
3081
|
|
|
3138
|
-
|
|
3139
|
-
|
|
3082
|
+
function styleInject(css, ref) {
|
|
3083
|
+
if ( ref === void 0 ) ref = {};
|
|
3084
|
+
var insertAt = ref.insertAt;
|
|
3085
|
+
|
|
3086
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
3087
|
+
|
|
3088
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
3089
|
+
var style = document.createElement('style');
|
|
3090
|
+
style.type = 'text/css';
|
|
3091
|
+
|
|
3092
|
+
if (insertAt === 'top') {
|
|
3093
|
+
if (head.firstChild) {
|
|
3094
|
+
head.insertBefore(style, head.firstChild);
|
|
3095
|
+
} else {
|
|
3096
|
+
head.appendChild(style);
|
|
3097
|
+
}
|
|
3098
|
+
} else {
|
|
3099
|
+
head.appendChild(style);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
if (style.styleSheet) {
|
|
3103
|
+
style.styleSheet.cssText = css;
|
|
3104
|
+
} else {
|
|
3105
|
+
style.appendChild(document.createTextNode(css));
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
var css_248z$2 = ".helpText{color:#6b6966;font-size:.75rem;font-weight:400}";
|
|
3110
|
+
styleInject(css_248z$2);
|
|
3140
3111
|
|
|
3141
3112
|
var FormError = function (props) {
|
|
3142
3113
|
return (jsxs(Fragment$1, { children: [props.error && (jsx("span", __assign({ className: "LuiTextInput-error", style: { paddingLeft: 0 } }, { children: props.error }))), props.helpText && !props.error && jsx("span", __assign({ className: "helpText" }, { children: props.helpText }))] }));
|
|
@@ -3771,9 +3742,6 @@ var GridPopoutEditMultiSelect = function (colDef, props) {
|
|
|
3771
3742
|
return GridCell(colDef, __assign(__assign({ editor: GridFormMultiSelect }, props), { editorParams: __assign({ className: "GridMultiSelect-containerMedium" }, props.editorParams) }));
|
|
3772
3743
|
};
|
|
3773
3744
|
|
|
3774
|
-
var css_248z$3 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
|
|
3775
|
-
styleInject(css_248z$3);
|
|
3776
|
-
|
|
3777
3745
|
/** Menu configuration types **/
|
|
3778
3746
|
var PopoutMenuSeparator = Object.freeze({ __isMenuSeparator__: true });
|
|
3779
3747
|
/**
|
|
@@ -4002,9 +3970,6 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
4002
3970
|
return dmsString;
|
|
4003
3971
|
};
|
|
4004
3972
|
|
|
4005
|
-
var css_248z$2 = ".GridFormEditBearing-input{width:320px}";
|
|
4006
|
-
styleInject(css_248z$2);
|
|
4007
|
-
|
|
4008
3973
|
var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
4009
3974
|
styleInject(css_248z$1);
|
|
4010
3975
|
|
|
@@ -4334,7 +4299,7 @@ var GridFormSubComponentTextArea = function (props) {
|
|
|
4334
4299
|
return (jsx("div", __assign({ className: clsx("FreeTextInput", props.className) }, { children: jsx(TextAreaInput, { className: "free-text-input", value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), helpText: helpText, autoFocus: true, placeholder: props.placeholder }) })));
|
|
4335
4300
|
};
|
|
4336
4301
|
|
|
4337
|
-
var css_248z = ".ActionButton{align-items:center;display:flex}.ActionButton-minimal{padding-right:38px
|
|
4302
|
+
var css_248z = ".ActionButton{align-items:center;display:flex}.ActionButton-minimal.lui-button-lg.lui-button-icon-right{padding-right:38px}.ActionButton.lui-button-lg.lui-button-icon-right:not(.ActionButton-tight) .LuiIcon{margin:0 4px}.ActionButton.ActionButton-tight.lui-button-lg.lui-button-icon-right .LuiIcon{margin:0}.ActionButton-iconOnly.lui-button-lg.lui-button-icon-right:not(.ActionButton-tight){padding:8px 5px}.ActionButton-iconOnly.lui-button-lg.lui-button-icon-right.ActionButton-tight{padding:0}.ActionButton-minimalArea{position:relative}.ActionButton-minimalAreaDisplay{position:absolute}.ActionButton-minimalAreaExpand{visibility:hidden}.ActionButton-inProgress.lui-button-lg.lui-button-icon-right{background-color:#e2f3f7;color:#007198;cursor:progress}.ActionButton-inProgress.lui-button-lg.lui-button-icon-right svg *{fill:#0000}.ActionButton-fill{justify-content:center;width:100%}";
|
|
4338
4303
|
styleInject(css_248z);
|
|
4339
4304
|
|
|
4340
4305
|
/**
|
|
@@ -4417,7 +4382,7 @@ var ActionButton = function (_a) {
|
|
|
4417
4382
|
inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
|
|
4418
4383
|
}, [inProgress, lastInProgress, setLocalInProgress, setLocalInProgressDeferred]);
|
|
4419
4384
|
var buttonText = (jsxs("span", __assign({ className: "ActionButton-minimalArea" }, { children: [jsx("span", __assign({ className: "ActionButton-minimalAreaDisplay" }, { children: (_b = (localInProgress ? inProgressName : name)) !== null && _b !== void 0 ? _b : name })), jsx("span", __assign({ className: "ActionButton-minimalAreaExpand" }, { children: name }))] })));
|
|
4420
|
-
return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: level, title: (_c = title !== null && title !== void 0 ? title : ariaLabel) !== null && _c !== void 0 ? _c : name, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name, className: clsx("lui-button-icon-right", "ActionButton", className, localInProgress && "ActionButton-inProgress", name != null && !(className === null || className === void 0 ? void 0 : className.includes("ActionButton-fill")) && "ActionButton-minimal"
|
|
4385
|
+
return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: level, title: (_c = title !== null && title !== void 0 ? title : ariaLabel) !== null && _c !== void 0 ? _c : name, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name, className: clsx("lui-button-icon-right", "ActionButton", className, localInProgress && "ActionButton-inProgress", name != null && !(className === null || className === void 0 ? void 0 : className.includes("ActionButton-fill")) && "ActionButton-minimal", name == null && "ActionButton-iconOnly"), size: "lg", style: style, onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
4421
4386
|
var promise, isPromise;
|
|
4422
4387
|
return __generator(this, function (_a) {
|
|
4423
4388
|
switch (_a.label) {
|
|
@@ -4448,7 +4413,41 @@ var ActionButton = function (_a) {
|
|
|
4448
4413
|
},
|
|
4449
4414
|
role: "status",
|
|
4450
4415
|
"aria-label": "Loading"
|
|
4451
|
-
} })) : (jsx(LuiIcon, { name: icon, alt: (_d = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name) !== null && _d !== void 0 ? _d : "", size: size
|
|
4416
|
+
} })) : (jsx(LuiIcon, { name: icon, alt: (_d = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name) !== null && _d !== void 0 ? _d : "", size: size })), iconPosition === "left" && buttonText] })));
|
|
4417
|
+
};
|
|
4418
|
+
|
|
4419
|
+
var useDeferredPromise = function () {
|
|
4420
|
+
var promiseResolve = useRef();
|
|
4421
|
+
var promiseReject = useRef();
|
|
4422
|
+
return {
|
|
4423
|
+
invoke: function () {
|
|
4424
|
+
return new Promise(function (resolve, reject) {
|
|
4425
|
+
promiseResolve.current = resolve;
|
|
4426
|
+
promiseReject.current = reject;
|
|
4427
|
+
});
|
|
4428
|
+
},
|
|
4429
|
+
resolve: function (value) {
|
|
4430
|
+
if (!promiseResolve.current) {
|
|
4431
|
+
console.error("Promise not invoked so can't resolve");
|
|
4432
|
+
return;
|
|
4433
|
+
}
|
|
4434
|
+
var temp = promiseResolve.current;
|
|
4435
|
+
promiseResolve.current = undefined;
|
|
4436
|
+
promiseReject.current = undefined;
|
|
4437
|
+
temp(value);
|
|
4438
|
+
},
|
|
4439
|
+
reject: function () {
|
|
4440
|
+
if (!promiseResolve.current) {
|
|
4441
|
+
console.error("Promise not invoked so can't reject");
|
|
4442
|
+
return;
|
|
4443
|
+
}
|
|
4444
|
+
var reject = promiseReject.current;
|
|
4445
|
+
promiseResolve.current = undefined;
|
|
4446
|
+
promiseReject.current = undefined;
|
|
4447
|
+
if (reject)
|
|
4448
|
+
reject();
|
|
4449
|
+
}
|
|
4450
|
+
};
|
|
4452
4451
|
};
|
|
4453
4452
|
|
|
4454
4453
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -24658,5 +24657,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
|
|
|
24658
24657
|
});
|
|
24659
24658
|
}); };
|
|
24660
24659
|
|
|
24661
|
-
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell,
|
|
24660
|
+
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, 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, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findParentWithClass, findRow, fnOrVar, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useDeferredPromise, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
|
|
24662
24661
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|