@linzjs/step-ag-grid 3.0.1 → 4.0.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/index.js +390 -320
- package/dist/index.js.map +1 -1
- package/dist/src/components/GridPopoverHook.d.ts +13 -1
- package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +11 -0
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +8 -8
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +3 -4
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +3 -4
- package/dist/src/index.d.ts +6 -3
- package/dist/src/lui/TextAreaInput.d.ts +4 -5
- package/dist/src/lui/TextInputFormatted.d.ts +4 -10
- package/dist/src/utils/textValidator.d.ts +6 -0
- package/dist/step-ag-grid.esm.js +387 -321
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +2 -2
- package/src/components/GridCell.tsx +5 -0
- package/src/components/GridPopoverHook.tsx +79 -1
- package/src/components/gridForm/GridFormDropDown.tsx +63 -56
- package/src/components/gridForm/GridFormEditBearing.tsx +7 -8
- package/src/components/gridForm/GridFormMultiSelect.tsx +6 -10
- package/src/components/gridForm/GridFormPopoverMenu.tsx +7 -10
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +58 -0
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +48 -55
- package/src/components/gridForm/GridFormTextArea.tsx +10 -18
- package/src/components/gridForm/GridFormTextInput.tsx +12 -25
- package/src/contexts/GridPopoverContextProvider.tsx +11 -4
- package/src/index.ts +6 -3
- package/src/lui/TextAreaInput.tsx +34 -18
- package/src/lui/TextInputFormatted.tsx +19 -35
- package/src/react-menu3/components/MenuItem.tsx +5 -2
- package/src/stories/grid/FormTest.tsx +16 -3
- package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +20 -17
- package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +2 -2
- package/src/stories/grid/GridReadOnly.stories.tsx +15 -3
- package/src/utils/textValidator.ts +24 -0
- package/dist/src/components/GridSubComponentTextArea.d.ts +0 -10
- package/src/components/GridSubComponentTextArea.tsx +0 -62
package/dist/index.js
CHANGED
|
@@ -1687,7 +1687,10 @@ var MenuItemFr = function (_a) {
|
|
|
1687
1687
|
safeCall(radioGroup.onRadioChange, event);
|
|
1688
1688
|
eventHandlers.handleClick(event, isCheckBox || isRadio);
|
|
1689
1689
|
};
|
|
1690
|
-
|
|
1690
|
+
/**
|
|
1691
|
+
* Keyboard events are triggered on up, otherwise sub-components get spaces and enters typed in them
|
|
1692
|
+
*/
|
|
1693
|
+
var handleKeyUp = function (e) {
|
|
1691
1694
|
if (!isHovering)
|
|
1692
1695
|
return;
|
|
1693
1696
|
switch (e.key) {
|
|
@@ -1709,7 +1712,7 @@ var MenuItemFr = function (_a) {
|
|
|
1709
1712
|
checked: isChecked,
|
|
1710
1713
|
anchor: isAnchor
|
|
1711
1714
|
}); }, [type, isDisabled, isHovering, isChecked, isAnchor]);
|
|
1712
|
-
var mergedProps = mergeProps(__assign(__assign({}, restStateProps), { onPointerDown: setHover,
|
|
1715
|
+
var mergedProps = mergeProps(__assign(__assign({}, restStateProps), { onPointerDown: setHover, onKeyUp: handleKeyUp, onClick: handleClick }), restProps);
|
|
1713
1716
|
// Order of props overriding (same in all components):
|
|
1714
1717
|
// 1. Preset props adhering to WAI-ARIA Authoring Practices.
|
|
1715
1718
|
// 2. Merged outer and local props
|
|
@@ -1784,54 +1787,6 @@ var MenuRadioGroupFr = function (_a, externalRef) {
|
|
|
1784
1787
|
};
|
|
1785
1788
|
var MenuRadioGroup = react.forwardRef(MenuRadioGroupFr);
|
|
1786
1789
|
|
|
1787
|
-
var GridUpdatingContext = react.createContext({
|
|
1788
|
-
checkUpdating: function () {
|
|
1789
|
-
console.error("Missing GridUpdatingContext");
|
|
1790
|
-
return false;
|
|
1791
|
-
},
|
|
1792
|
-
modifyUpdating: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1793
|
-
return __generator(this, function (_a) {
|
|
1794
|
-
console.error("Missing GridUpdatingContext");
|
|
1795
|
-
return [2 /*return*/];
|
|
1796
|
-
});
|
|
1797
|
-
}); }
|
|
1798
|
-
});
|
|
1799
|
-
|
|
1800
|
-
var GridUpdatingContextProvider = function (props) {
|
|
1801
|
-
var updatingBlocks = react.useRef({});
|
|
1802
|
-
var updating = react.useRef({});
|
|
1803
|
-
var resetUpdating = function () {
|
|
1804
|
-
var mergedUpdatingBlocks = {};
|
|
1805
|
-
for (var key in updatingBlocks.current) {
|
|
1806
|
-
mergedUpdatingBlocks[key] = lodashEs.flatten(updatingBlocks.current[key]);
|
|
1807
|
-
}
|
|
1808
|
-
updating.current = mergedUpdatingBlocks;
|
|
1809
|
-
};
|
|
1810
|
-
var modifyUpdating = function (field, ids, fn) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1811
|
-
var fieldUpdatingIds, idRef;
|
|
1812
|
-
var _a;
|
|
1813
|
-
return __generator(this, function (_b) {
|
|
1814
|
-
switch (_b.label) {
|
|
1815
|
-
case 0:
|
|
1816
|
-
fieldUpdatingIds = (_a = updatingBlocks.current[field]) !== null && _a !== void 0 ? _a : (updatingBlocks.current[field] = []);
|
|
1817
|
-
idRef = __spreadArray([], ids, true);
|
|
1818
|
-
fieldUpdatingIds.push(idRef);
|
|
1819
|
-
resetUpdating();
|
|
1820
|
-
return [4 /*yield*/, fn()];
|
|
1821
|
-
case 1:
|
|
1822
|
-
_b.sent();
|
|
1823
|
-
lodashEs.remove(fieldUpdatingIds, function (idList) { return idList === idRef; });
|
|
1824
|
-
resetUpdating();
|
|
1825
|
-
return [2 /*return*/];
|
|
1826
|
-
}
|
|
1827
|
-
});
|
|
1828
|
-
}); };
|
|
1829
|
-
var checkUpdating = function (fields, id) {
|
|
1830
|
-
return lodashEs.castArray(fields).some(function (f) { var _a; return (_a = updating.current[f]) === null || _a === void 0 ? void 0 : _a.includes(id); });
|
|
1831
|
-
};
|
|
1832
|
-
return (jsxRuntime.jsx(GridUpdatingContext.Provider, __assign({ value: { modifyUpdating: modifyUpdating, checkUpdating: checkUpdating } }, { children: props.children })));
|
|
1833
|
-
};
|
|
1834
|
-
|
|
1835
1790
|
var GridContext = react.createContext({
|
|
1836
1791
|
gridReady: function () {
|
|
1837
1792
|
console.error("no context provider for gridReady");
|
|
@@ -1905,6 +1860,19 @@ var GridContext = react.createContext({
|
|
|
1905
1860
|
}
|
|
1906
1861
|
});
|
|
1907
1862
|
|
|
1863
|
+
var GridUpdatingContext = react.createContext({
|
|
1864
|
+
checkUpdating: function () {
|
|
1865
|
+
console.error("Missing GridUpdatingContext");
|
|
1866
|
+
return false;
|
|
1867
|
+
},
|
|
1868
|
+
modifyUpdating: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1869
|
+
return __generator(this, function (_a) {
|
|
1870
|
+
console.error("Missing GridUpdatingContext");
|
|
1871
|
+
return [2 /*return*/];
|
|
1872
|
+
});
|
|
1873
|
+
}); }
|
|
1874
|
+
});
|
|
1875
|
+
|
|
1908
1876
|
/**
|
|
1909
1877
|
* Context for AgGrid operations.
|
|
1910
1878
|
* Make sure you wrap AgGrid in this.
|
|
@@ -2184,6 +2152,114 @@ var GridContextProvider = function (props) {
|
|
|
2184
2152
|
} }, { children: props.children })));
|
|
2185
2153
|
};
|
|
2186
2154
|
|
|
2155
|
+
var GridUpdatingContextProvider = function (props) {
|
|
2156
|
+
var updatingBlocks = react.useRef({});
|
|
2157
|
+
var updating = react.useRef({});
|
|
2158
|
+
var resetUpdating = function () {
|
|
2159
|
+
var mergedUpdatingBlocks = {};
|
|
2160
|
+
for (var key in updatingBlocks.current) {
|
|
2161
|
+
mergedUpdatingBlocks[key] = lodashEs.flatten(updatingBlocks.current[key]);
|
|
2162
|
+
}
|
|
2163
|
+
updating.current = mergedUpdatingBlocks;
|
|
2164
|
+
};
|
|
2165
|
+
var modifyUpdating = function (field, ids, fn) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2166
|
+
var fieldUpdatingIds, idRef;
|
|
2167
|
+
var _a;
|
|
2168
|
+
return __generator(this, function (_b) {
|
|
2169
|
+
switch (_b.label) {
|
|
2170
|
+
case 0:
|
|
2171
|
+
fieldUpdatingIds = (_a = updatingBlocks.current[field]) !== null && _a !== void 0 ? _a : (updatingBlocks.current[field] = []);
|
|
2172
|
+
idRef = __spreadArray([], ids, true);
|
|
2173
|
+
fieldUpdatingIds.push(idRef);
|
|
2174
|
+
resetUpdating();
|
|
2175
|
+
return [4 /*yield*/, fn()];
|
|
2176
|
+
case 1:
|
|
2177
|
+
_b.sent();
|
|
2178
|
+
lodashEs.remove(fieldUpdatingIds, function (idList) { return idList === idRef; });
|
|
2179
|
+
resetUpdating();
|
|
2180
|
+
return [2 /*return*/];
|
|
2181
|
+
}
|
|
2182
|
+
});
|
|
2183
|
+
}); };
|
|
2184
|
+
var checkUpdating = function (fields, id) {
|
|
2185
|
+
return lodashEs.castArray(fields).some(function (f) { var _a; return (_a = updating.current[f]) === null || _a === void 0 ? void 0 : _a.includes(id); });
|
|
2186
|
+
};
|
|
2187
|
+
return (jsxRuntime.jsx(GridUpdatingContext.Provider, __assign({ value: { modifyUpdating: modifyUpdating, checkUpdating: checkUpdating } }, { children: props.children })));
|
|
2188
|
+
};
|
|
2189
|
+
|
|
2190
|
+
var GridPopoverContext = react.createContext({
|
|
2191
|
+
anchorRef: { current: null },
|
|
2192
|
+
saving: false,
|
|
2193
|
+
setSaving: function () { },
|
|
2194
|
+
field: "",
|
|
2195
|
+
value: null,
|
|
2196
|
+
data: {},
|
|
2197
|
+
selectedRows: [],
|
|
2198
|
+
updateValue: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2199
|
+
return [2 /*return*/, false];
|
|
2200
|
+
}); }); }
|
|
2201
|
+
});
|
|
2202
|
+
var useGridPopoverContext = function () {
|
|
2203
|
+
return react.useContext(GridPopoverContext);
|
|
2204
|
+
};
|
|
2205
|
+
|
|
2206
|
+
var GridPopoverContextProvider = function (_a) {
|
|
2207
|
+
var _b, _c, _d;
|
|
2208
|
+
var props = _a.props, children = _a.children;
|
|
2209
|
+
var _e = react.useContext(GridContext), getSelectedRows = _e.getSelectedRows, updatingCells = _e.updatingCells, stopEditing = _e.stopEditing;
|
|
2210
|
+
var anchorRef = react.useRef(props.eGridCell);
|
|
2211
|
+
var _f = react.useState(false), saving = _f[0], setSaving = _f[1];
|
|
2212
|
+
var colDef = props.colDef;
|
|
2213
|
+
var cellEditorParams = colDef.cellEditorParams;
|
|
2214
|
+
var multiEdit = (_b = cellEditorParams === null || cellEditorParams === void 0 ? void 0 : cellEditorParams.multiEdit) !== null && _b !== void 0 ? _b : false;
|
|
2215
|
+
// Then item that is clicked on will always be first in the list
|
|
2216
|
+
var selectedRows = react.useMemo(function () { return (multiEdit ? lodashEs.sortBy(getSelectedRows(), function (row) { return row.id !== props.data.id; }) : [props.data]); }, [getSelectedRows, multiEdit, props.data]);
|
|
2217
|
+
var field = (_d = (_c = props.colDef) === null || _c === void 0 ? void 0 : _c.field) !== null && _d !== void 0 ? _d : "";
|
|
2218
|
+
var updateValue = react.useCallback(function (saveFn) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2219
|
+
var result;
|
|
2220
|
+
return __generator(this, function (_a) {
|
|
2221
|
+
switch (_a.label) {
|
|
2222
|
+
case 0:
|
|
2223
|
+
result = false;
|
|
2224
|
+
if (!!saving) return [3 /*break*/, 2];
|
|
2225
|
+
return [4 /*yield*/, updatingCells({ selectedRows: selectedRows, field: field }, saveFn, setSaving)];
|
|
2226
|
+
case 1:
|
|
2227
|
+
result = _a.sent();
|
|
2228
|
+
if (result)
|
|
2229
|
+
stopEditing();
|
|
2230
|
+
_a.label = 2;
|
|
2231
|
+
case 2: return [2 /*return*/, result];
|
|
2232
|
+
}
|
|
2233
|
+
});
|
|
2234
|
+
}); }, [field, saving, selectedRows, stopEditing, updatingCells]);
|
|
2235
|
+
return (jsxRuntime.jsx(GridPopoverContext.Provider, __assign({ value: {
|
|
2236
|
+
anchorRef: anchorRef,
|
|
2237
|
+
saving: saving,
|
|
2238
|
+
setSaving: setSaving,
|
|
2239
|
+
selectedRows: selectedRows,
|
|
2240
|
+
field: field,
|
|
2241
|
+
data: props.data,
|
|
2242
|
+
value: props.value,
|
|
2243
|
+
updateValue: updateValue
|
|
2244
|
+
} }, { children: children })));
|
|
2245
|
+
};
|
|
2246
|
+
|
|
2247
|
+
var GridSubComponentContext = react.createContext({
|
|
2248
|
+
value: "GridSubComponentContext value no context",
|
|
2249
|
+
setValue: function () {
|
|
2250
|
+
console.error("GridSubComponentContext setValue no context");
|
|
2251
|
+
},
|
|
2252
|
+
setValid: function () {
|
|
2253
|
+
console.error("GridSubComponentContext setValid no context");
|
|
2254
|
+
},
|
|
2255
|
+
triggerSave: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2256
|
+
return __generator(this, function (_a) {
|
|
2257
|
+
console.error("GridSubComponentContext triggerSave no context");
|
|
2258
|
+
return [2 /*return*/];
|
|
2259
|
+
});
|
|
2260
|
+
}); }
|
|
2261
|
+
});
|
|
2262
|
+
|
|
2187
2263
|
function toVal(mix) {
|
|
2188
2264
|
var k, y, str='';
|
|
2189
2265
|
if (mix) {
|
|
@@ -2554,7 +2630,7 @@ var Grid = function (params) {
|
|
|
2554
2630
|
startCellEditing(event);
|
|
2555
2631
|
}
|
|
2556
2632
|
}, [startCellEditing]);
|
|
2557
|
-
var
|
|
2633
|
+
var onCellKeyPress = react.useCallback(function (e) {
|
|
2558
2634
|
if (e.event.key === "Enter")
|
|
2559
2635
|
startCellEditing(e);
|
|
2560
2636
|
}, [startCellEditing]);
|
|
@@ -2572,7 +2648,7 @@ var Grid = function (params) {
|
|
|
2572
2648
|
}, [columnDefs === null || columnDefs === void 0 ? void 0 : columnDefs.length, sizeColumnsToFit]);
|
|
2573
2649
|
return (jsxRuntime.jsxs("div", __assign({ "data-testid": params.dataTestId, className: clsx("Grid-container", "ag-theme-alpine", staleGrid && "Grid-sortIsStale") }, { children: [params.quickFilter && (jsxRuntime.jsx("div", __assign({ className: "Grid-quickFilter" }, { children: jsxRuntime.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) {
|
|
2574
2650
|
setInternalQuickFilter(event.target.value);
|
|
2575
|
-
} }) }))), jsxRuntime.jsx(agGridReact.AgGridReact, { getRowId: function (params) { return "".concat(params.data.id); }, suppressRowClickSelection: true, rowSelection: "multiple", suppressBrowserResizeObserver: true, colResizeDefault: "shift", onFirstDataRendered: sizeColumnsToFit, onGridSizeChanged: sizeColumnsToFit, suppressClickEdit: true,
|
|
2651
|
+
} }) }))), jsxRuntime.jsx(agGridReact.AgGridReact, { 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 })] })));
|
|
2576
2652
|
};
|
|
2577
2653
|
|
|
2578
2654
|
var GenericMultiEditCellClass = function (props) {
|
|
@@ -2615,12 +2691,12 @@ function styleInject(css, ref) {
|
|
|
2615
2691
|
}
|
|
2616
2692
|
}
|
|
2617
2693
|
|
|
2618
|
-
var css_248z$
|
|
2619
|
-
styleInject(css_248z$8);
|
|
2620
|
-
|
|
2621
|
-
var css_248z$7 = ".GridLoadableCell-container{align-items:center;display:flex}";
|
|
2694
|
+
var css_248z$7 = ".AgGridGenericCellRenderer-icon{margin-right:4px}.AgGridGenericCellRenderer-ic_infoIcon{fill:#3a7cdf;margin-right:4px}.AgGridGenericCellRenderer-ic_warningIcon{fill:#ea6a2e;margin-right:4px}";
|
|
2622
2695
|
styleInject(css_248z$7);
|
|
2623
2696
|
|
|
2697
|
+
var css_248z$6 = ".GridLoadableCell-container{align-items:center;display:flex}";
|
|
2698
|
+
styleInject(css_248z$6);
|
|
2699
|
+
|
|
2624
2700
|
var GridLoadableCell = function (props) {
|
|
2625
2701
|
if (props.isLoading) {
|
|
2626
2702
|
return (jsxRuntime.jsx("div", __assign({ style: { display: "flex", alignItems: "center" } }, { children: jsxRuntime.jsx(lui.LuiMiniSpinner, { size: 22, divProps: { role: "status", "aria-label": "Loading", style: { marginBottom: 4 } } }) })));
|
|
@@ -2650,58 +2726,6 @@ var GridRendererGenericCell = function (props) {
|
|
|
2650
2726
|
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 }))] }) })));
|
|
2651
2727
|
};
|
|
2652
2728
|
|
|
2653
|
-
var GridPopoverContext = react.createContext({
|
|
2654
|
-
anchorRef: { current: null },
|
|
2655
|
-
saving: false,
|
|
2656
|
-
setSaving: function () { },
|
|
2657
|
-
field: "",
|
|
2658
|
-
value: null,
|
|
2659
|
-
data: {},
|
|
2660
|
-
selectedRows: [],
|
|
2661
|
-
updateValue: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2662
|
-
return [2 /*return*/, false];
|
|
2663
|
-
}); }); }
|
|
2664
|
-
});
|
|
2665
|
-
var useGridPopoverContext = function () {
|
|
2666
|
-
return react.useContext(GridPopoverContext);
|
|
2667
|
-
};
|
|
2668
|
-
|
|
2669
|
-
var GridPopoverContextProvider = function (_a) {
|
|
2670
|
-
var _b, _c, _d;
|
|
2671
|
-
var props = _a.props, children = _a.children;
|
|
2672
|
-
var _e = react.useContext(GridContext), getSelectedRows = _e.getSelectedRows, updatingCells = _e.updatingCells;
|
|
2673
|
-
var anchorRef = react.useRef(props.eGridCell);
|
|
2674
|
-
var _f = react.useState(false), saving = _f[0], setSaving = _f[1];
|
|
2675
|
-
var colDef = props.colDef;
|
|
2676
|
-
var cellEditorParams = colDef.cellEditorParams;
|
|
2677
|
-
var multiEdit = (_b = cellEditorParams === null || cellEditorParams === void 0 ? void 0 : cellEditorParams.multiEdit) !== null && _b !== void 0 ? _b : false;
|
|
2678
|
-
// Then item that is clicked on will always be first in the list
|
|
2679
|
-
var selectedRows = react.useMemo(function () { return (multiEdit ? lodashEs.sortBy(getSelectedRows(), function (row) { return row.id !== props.data.id; }) : [props.data]); }, [getSelectedRows, multiEdit, props.data]);
|
|
2680
|
-
var field = (_d = (_c = props.colDef) === null || _c === void 0 ? void 0 : _c.field) !== null && _d !== void 0 ? _d : "";
|
|
2681
|
-
var updateValue = react.useCallback(function (saveFn) { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
|
|
2682
|
-
switch (_b.label) {
|
|
2683
|
-
case 0:
|
|
2684
|
-
_a = !saving;
|
|
2685
|
-
if (!_a) return [3 /*break*/, 2];
|
|
2686
|
-
return [4 /*yield*/, updatingCells({ selectedRows: selectedRows, field: field }, saveFn, setSaving)];
|
|
2687
|
-
case 1:
|
|
2688
|
-
_a = (_b.sent());
|
|
2689
|
-
_b.label = 2;
|
|
2690
|
-
case 2: return [2 /*return*/, _a];
|
|
2691
|
-
}
|
|
2692
|
-
}); }); }, [field, saving, selectedRows, updatingCells]);
|
|
2693
|
-
return (jsxRuntime.jsx(GridPopoverContext.Provider, __assign({ value: {
|
|
2694
|
-
anchorRef: anchorRef,
|
|
2695
|
-
saving: saving,
|
|
2696
|
-
setSaving: setSaving,
|
|
2697
|
-
selectedRows: selectedRows,
|
|
2698
|
-
field: field,
|
|
2699
|
-
data: props.data,
|
|
2700
|
-
value: props.value,
|
|
2701
|
-
updateValue: updateValue
|
|
2702
|
-
} }, { children: children })));
|
|
2703
|
-
};
|
|
2704
|
-
|
|
2705
2729
|
var GridCellRenderer = function (props) {
|
|
2706
2730
|
var _a, _b, _c;
|
|
2707
2731
|
var checkUpdating = react.useContext(GridUpdatingContext).checkUpdating;
|
|
@@ -2718,11 +2742,15 @@ var GridCellRenderer = function (props) {
|
|
|
2718
2742
|
*/
|
|
2719
2743
|
var GridCell = function (props, custom) {
|
|
2720
2744
|
var _a;
|
|
2721
|
-
return __assign(__assign(__assign(__assign(__assign({ colId: props.field, sortable: !!((props === null || props === void 0 ? void 0 : props.field) || (props === null || props === void 0 ? void 0 : props.valueGetter)), resizable: true }, ((custom === null || custom === void 0 ? void 0 : custom.editor) && {
|
|
2745
|
+
return __assign(__assign(__assign(__assign(__assign(__assign({ colId: props.field, sortable: !!((props === null || props === void 0 ? void 0 : props.field) || (props === null || props === void 0 ? void 0 : props.valueGetter)), resizable: true }, ((custom === null || custom === void 0 ? void 0 : custom.editor) && {
|
|
2722
2746
|
cellClass: (custom === null || custom === void 0 ? void 0 : custom.multiEdit) ? GenericMultiEditCellClass : undefined,
|
|
2723
2747
|
editable: (_a = props.editable) !== null && _a !== void 0 ? _a : true,
|
|
2724
2748
|
cellEditor: GenericCellEditorComponentWrapper(custom)
|
|
2725
|
-
})),
|
|
2749
|
+
})), { suppressKeyboardEvent: function (e) {
|
|
2750
|
+
// It's important that aggrid doesn't trigger edit on enter
|
|
2751
|
+
// as the incorrect selected rows will be returned
|
|
2752
|
+
return e.event.key === "Enter";
|
|
2753
|
+
} }), ((custom === null || custom === void 0 ? void 0 : custom.editorParams) && {
|
|
2726
2754
|
cellEditorParams: __assign(__assign({}, custom.editorParams), { multiEdit: custom.multiEdit })
|
|
2727
2755
|
})), {
|
|
2728
2756
|
// Default value formatter, otherwise react freaks out on objects
|
|
@@ -2791,8 +2819,77 @@ var useGridPopoverHook = function (props) {
|
|
|
2791
2819
|
}
|
|
2792
2820
|
});
|
|
2793
2821
|
}); }, [props.save, stopEditing, updateValue]);
|
|
2822
|
+
var onlyInputKeyboardEventHandlers = {
|
|
2823
|
+
onKeyUp: function (e) {
|
|
2824
|
+
var isTextArea = e.currentTarget.type === "textarea";
|
|
2825
|
+
if (e.key === "Enter" && !isTextArea) {
|
|
2826
|
+
e.preventDefault();
|
|
2827
|
+
e.stopPropagation();
|
|
2828
|
+
triggerSave().then();
|
|
2829
|
+
}
|
|
2830
|
+
else if (e.key === "Tab") {
|
|
2831
|
+
e.preventDefault();
|
|
2832
|
+
e.stopPropagation();
|
|
2833
|
+
}
|
|
2834
|
+
},
|
|
2835
|
+
onKeyDown: function (e) {
|
|
2836
|
+
var isTextArea = e.currentTarget.type === "textarea";
|
|
2837
|
+
if (e.key === "Enter" && !isTextArea) {
|
|
2838
|
+
e.preventDefault();
|
|
2839
|
+
e.stopPropagation();
|
|
2840
|
+
}
|
|
2841
|
+
else if (e.key === "Tab") {
|
|
2842
|
+
e.preventDefault();
|
|
2843
|
+
e.stopPropagation();
|
|
2844
|
+
!e.shiftKey && triggerSave().then();
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
};
|
|
2848
|
+
var firstInputKeyboardEventHandlers = {
|
|
2849
|
+
onKeyUp: function (e) {
|
|
2850
|
+
if (e.key === "Tab" && e.shiftKey) {
|
|
2851
|
+
e.preventDefault();
|
|
2852
|
+
e.stopPropagation();
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
onKeyDown: function (e) {
|
|
2856
|
+
if (e.key === "Tab" && e.shiftKey) {
|
|
2857
|
+
e.preventDefault();
|
|
2858
|
+
e.stopPropagation();
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
};
|
|
2862
|
+
var lastInputKeyboardEventHandlers = {
|
|
2863
|
+
onKeyUp: function (e) {
|
|
2864
|
+
var isTextArea = e.currentTarget.type === "textarea";
|
|
2865
|
+
if (e.key === "Enter" && !isTextArea) {
|
|
2866
|
+
e.preventDefault();
|
|
2867
|
+
e.stopPropagation();
|
|
2868
|
+
triggerSave().then();
|
|
2869
|
+
}
|
|
2870
|
+
else if (e.key === "Tab" && !e.shiftKey) {
|
|
2871
|
+
e.preventDefault();
|
|
2872
|
+
e.stopPropagation();
|
|
2873
|
+
}
|
|
2874
|
+
},
|
|
2875
|
+
onKeyDown: function (e) {
|
|
2876
|
+
var isTextArea = e.currentTarget.type === "textarea";
|
|
2877
|
+
if (e.key === "Enter" && !isTextArea) {
|
|
2878
|
+
e.preventDefault();
|
|
2879
|
+
e.stopPropagation();
|
|
2880
|
+
}
|
|
2881
|
+
else if (e.key === "Tab" && !e.shiftKey) {
|
|
2882
|
+
e.preventDefault();
|
|
2883
|
+
e.stopPropagation();
|
|
2884
|
+
triggerSave().then();
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
};
|
|
2794
2888
|
var popoverWrapper = react.useCallback(function (children) {
|
|
2795
2889
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: anchorRef.current && (jsxRuntime.jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: "step-ag-grid-react-menu", onClose: function (event) {
|
|
2890
|
+
// Prevent menu from closing when modals are invoked
|
|
2891
|
+
if (event.reason === "blur")
|
|
2892
|
+
return;
|
|
2796
2893
|
triggerSave(event.reason).then();
|
|
2797
2894
|
}, viewScroll: "auto", dontShrinkIfDirectionIsTop: true, className: props.className, closeMenuExclusionClassName: "ReactModal__Content" }, { children: [saving && ( // This is the overlay that prevents editing when the editor is saving
|
|
2798
2895
|
jsxRuntime.jsx("div", { style: {
|
|
@@ -2807,7 +2904,10 @@ var useGridPopoverHook = function (props) {
|
|
|
2807
2904
|
}, [anchorRef, isOpen, props.className, saving, triggerSave]);
|
|
2808
2905
|
return {
|
|
2809
2906
|
popoverWrapper: popoverWrapper,
|
|
2810
|
-
triggerSave: triggerSave
|
|
2907
|
+
triggerSave: triggerSave,
|
|
2908
|
+
onlyInputKeyboardEventHandlers: onlyInputKeyboardEventHandlers,
|
|
2909
|
+
firstInputKeyboardEventHandlers: firstInputKeyboardEventHandlers,
|
|
2910
|
+
lastInputKeyboardEventHandlers: lastInputKeyboardEventHandlers
|
|
2811
2911
|
};
|
|
2812
2912
|
};
|
|
2813
2913
|
|
|
@@ -2830,12 +2930,12 @@ var GridRenderPopoutMenuCell = function (props) {
|
|
|
2830
2930
|
return (jsxRuntime.jsx(GridLoadableCell, __assign({ isLoading: isLoading, className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }, { children: jsxRuntime.jsx(lui.LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md" }) })));
|
|
2831
2931
|
};
|
|
2832
2932
|
|
|
2833
|
-
var css_248z$
|
|
2834
|
-
styleInject(css_248z$6);
|
|
2835
|
-
|
|
2836
|
-
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}";
|
|
2933
|
+
var css_248z$5 = ".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}";
|
|
2837
2934
|
styleInject(css_248z$5);
|
|
2838
2935
|
|
|
2936
|
+
var css_248z$4 = ".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}";
|
|
2937
|
+
styleInject(css_248z$4);
|
|
2938
|
+
|
|
2839
2939
|
/* global setTimeout, clearTimeout */
|
|
2840
2940
|
|
|
2841
2941
|
var dist = function debounce(fn) {
|
|
@@ -2923,9 +3023,13 @@ var GridFormDropDown = function (props) {
|
|
|
2923
3023
|
var _c = react.useState([]), filteredValues = _c[0], setFilteredValues = _c[1];
|
|
2924
3024
|
var optionsInitialising = react.useRef(false);
|
|
2925
3025
|
var _d = react.useState(null), options = _d[0], setOptions = _d[1];
|
|
2926
|
-
var
|
|
3026
|
+
var subComponentIsValid = react.useRef(false);
|
|
3027
|
+
var _e = react.useState(), subSelectedValue = _e[0], setSubSelectedValue = _e[1];
|
|
3028
|
+
var _f = react.useState(), selectedSubComponent = _f[0], setSelectedSubComponent = _f[1];
|
|
2927
3029
|
var selectItemHandler = react.useCallback(function (value, subComponentValue) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2928
3030
|
return __generator(this, function (_a) {
|
|
3031
|
+
if (subComponentValue !== undefined && !subComponentIsValid.current)
|
|
3032
|
+
return [2 /*return*/, false];
|
|
2929
3033
|
return [2 /*return*/, updateValue(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2930
3034
|
var hasChanged;
|
|
2931
3035
|
return __generator(this, function (_a) {
|
|
@@ -3068,67 +3172,61 @@ var GridFormDropDown = function (props) {
|
|
|
3068
3172
|
}
|
|
3069
3173
|
});
|
|
3070
3174
|
}); }, [filteredValues, options, selectItemHandler, selectFilterHandler, stopEditing, filter, props]);
|
|
3071
|
-
var
|
|
3175
|
+
var save = react.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
3176
|
+
return __generator(this, function (_a) {
|
|
3177
|
+
switch (_a.label) {
|
|
3178
|
+
case 0:
|
|
3179
|
+
// Handler for sub-selected value
|
|
3180
|
+
if (!selectedSubComponent)
|
|
3181
|
+
return [2 /*return*/, true];
|
|
3182
|
+
if (!subComponentIsValid.current)
|
|
3183
|
+
return [2 /*return*/, false];
|
|
3184
|
+
return [4 /*yield*/, selectItemHandler(selectedSubComponent.value, subSelectedValue)];
|
|
3185
|
+
case 1:
|
|
3186
|
+
_a.sent();
|
|
3187
|
+
return [2 /*return*/, true];
|
|
3188
|
+
}
|
|
3189
|
+
});
|
|
3190
|
+
}); }, [selectItemHandler, selectedSubComponent, subSelectedValue]);
|
|
3191
|
+
var popoverWrapper = useGridPopoverHook({ className: props.className, save: save }).popoverWrapper;
|
|
3072
3192
|
return popoverWrapper(jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.filtered && (jsxRuntime.jsxs("div", __assign({ className: "GridFormDropDown-filter" }, { children: [jsxRuntime.jsx(FocusableItem, __assign({ className: "filter-item" }, { children: function (_a) {
|
|
3073
3193
|
var _b;
|
|
3074
3194
|
var ref = _a.ref;
|
|
3075
3195
|
return (jsxRuntime.jsx("div", __assign({ style: { display: "flex", width: "100%" } }, { children: jsxRuntime.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); } }) })));
|
|
3076
3196
|
} })), jsxRuntime.jsx(MenuDivider, {}, "$$divider_filter")] }))), jsxRuntime.jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && (jsxRuntime.jsx(MenuItem, { children: "[Empty]" }, "".concat(fieldToString(field), "-empty"))), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3077
3197
|
var _a;
|
|
3078
|
-
return item.value === MenuSeparatorString ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsxRuntime.jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsxRuntime.
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
var subComponentValueIndex = localSubComponentValues.findIndex(function (_a) {
|
|
3084
|
-
var optionValue = _a.optionValue;
|
|
3085
|
-
return optionValue === item.value;
|
|
3086
|
-
});
|
|
3087
|
-
if (subComponentValueIndex !== -1) {
|
|
3088
|
-
localSubComponentValues[subComponentValueIndex].subComponentValue = value;
|
|
3198
|
+
return item.value === MenuSeparatorString ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsxRuntime.jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function (e) {
|
|
3199
|
+
if (item.subComponent) {
|
|
3200
|
+
if (selectedSubComponent === item) {
|
|
3201
|
+
setSelectedSubComponent(null);
|
|
3202
|
+
subComponentIsValid.current = true;
|
|
3089
3203
|
}
|
|
3090
3204
|
else {
|
|
3091
|
-
|
|
3092
|
-
subComponentValue: value,
|
|
3093
|
-
optionValue: item.value
|
|
3094
|
-
});
|
|
3205
|
+
setSelectedSubComponent(item);
|
|
3095
3206
|
}
|
|
3096
|
-
|
|
3097
|
-
}
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3207
|
+
e.keepOpen = true;
|
|
3208
|
+
}
|
|
3209
|
+
else {
|
|
3210
|
+
selectItemHandler(item.value).then();
|
|
3211
|
+
}
|
|
3212
|
+
} }, { children: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)) }), "".concat(fieldToString(field), "-").concat(index)), item.subComponent && selectedSubComponent === item && (jsxRuntime.jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) { return (jsxRuntime.jsx(GridSubComponentContext.Provider, __assign({ value: {
|
|
3213
|
+
value: subSelectedValue,
|
|
3214
|
+
setValue: function (value) {
|
|
3215
|
+
setSubSelectedValue(value);
|
|
3216
|
+
},
|
|
3217
|
+
setValid: function (valid) {
|
|
3218
|
+
subComponentIsValid.current = valid;
|
|
3219
|
+
},
|
|
3220
|
+
triggerSave: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
3221
|
+
return __generator(this, function (_a) {
|
|
3106
3222
|
ref.closeMenu();
|
|
3107
|
-
return
|
|
3223
|
+
return [2 /*return*/];
|
|
3108
3224
|
});
|
|
3109
|
-
}
|
|
3110
|
-
|
|
3111
|
-
} }, "".concat(fieldToString(field), "-").concat(index, "_subcomponent_inner")));
|
|
3112
|
-
} }), "".concat(fieldToString(field), "-").concat(index, "_subcomponent"))) }, "menu-wrapper-".concat(index)));
|
|
3225
|
+
}); }
|
|
3226
|
+
} }, { children: item.subComponent && (jsxRuntime.jsx(item.subComponent, {}, "".concat(fieldToString(field), "-").concat(index, "_subcomponent_inner"))) }))); } }), "".concat(item.label, "_subcomponent")))] }, "menu-wrapper-".concat(index)));
|
|
3113
3227
|
})] }) }))] }));
|
|
3114
3228
|
};
|
|
3115
3229
|
|
|
3116
|
-
var GridSubComponentContext = react.createContext({
|
|
3117
|
-
value: "GridSubComponentContext value no context",
|
|
3118
|
-
setValue: function () {
|
|
3119
|
-
console.error("GridSubComponentContext setValue no context");
|
|
3120
|
-
},
|
|
3121
|
-
setValid: function () {
|
|
3122
|
-
console.error("GridSubComponentContext setValid no context");
|
|
3123
|
-
},
|
|
3124
|
-
triggerSave: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
3125
|
-
return __generator(this, function (_a) {
|
|
3126
|
-
console.error("GridSubComponentContext triggerSave no context");
|
|
3127
|
-
return [2 /*return*/];
|
|
3128
|
-
});
|
|
3129
|
-
}); }
|
|
3130
|
-
});
|
|
3131
|
-
|
|
3132
3230
|
var GridFormMultiSelect = function (props) {
|
|
3133
3231
|
var selectedRows = useGridPopoverContext().selectedRows;
|
|
3134
3232
|
var initialiseValues = react.useMemo(function () {
|
|
@@ -3233,7 +3331,10 @@ var GridFormMultiSelect = function (props) {
|
|
|
3233
3331
|
setSelectedValues(__assign(__assign({}, selectedValues), (_a = {}, _a["".concat(item.value)] = null, _a)));
|
|
3234
3332
|
}
|
|
3235
3333
|
}, [selectedValues]);
|
|
3236
|
-
var _e = useGridPopoverHook({
|
|
3334
|
+
var _e = useGridPopoverHook({
|
|
3335
|
+
className: props.className,
|
|
3336
|
+
save: save
|
|
3337
|
+
}), popoverWrapper = _e.popoverWrapper, lastInputKeyboardEventHandlers = _e.lastInputKeyboardEventHandlers, triggerSave = _e.triggerSave;
|
|
3237
3338
|
return popoverWrapper(jsxRuntime.jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormMultiSelect-container" }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [options && props.filtered && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FocusableItem, __assign({ className: "filter-item" }, { children: function (_a) {
|
|
3238
3339
|
var _b;
|
|
3239
3340
|
var ref = _a.ref;
|
|
@@ -3243,18 +3344,7 @@ var GridFormMultiSelect = function (props) {
|
|
|
3243
3344
|
return item.value === MenuSeparatorString ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : filteredValues.includes(item.value) ? null : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(MenuItem, __assign({ onClick: function (e) {
|
|
3244
3345
|
e.keepOpen = true;
|
|
3245
3346
|
toggleValue(item);
|
|
3246
|
-
},
|
|
3247
|
-
return __generator(this, function (_a) {
|
|
3248
|
-
if (e.key === "Enter")
|
|
3249
|
-
triggerSave().then();
|
|
3250
|
-
else if (e.key === " ") {
|
|
3251
|
-
toggleValue(item);
|
|
3252
|
-
e.preventDefault();
|
|
3253
|
-
e.stopPropagation();
|
|
3254
|
-
}
|
|
3255
|
-
return [2 /*return*/];
|
|
3256
|
-
});
|
|
3257
|
-
}); } }, { children: jsxRuntime.jsx(lui.LuiCheckboxInput, { isChecked: "".concat(item.value) in selectedValues, value: "".concat(item.value), label: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)), inputProps: {
|
|
3347
|
+
} }, lastInputKeyboardEventHandlers, { children: jsxRuntime.jsx(lui.LuiCheckboxInput, { isChecked: "".concat(item.value) in selectedValues, value: "".concat(item.value), label: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)), inputProps: {
|
|
3258
3348
|
onClick: function (e) {
|
|
3259
3349
|
e.preventDefault();
|
|
3260
3350
|
e.stopPropagation();
|
|
@@ -3282,8 +3372,8 @@ var GridPopoutEditMultiSelect = function (colDef, props) {
|
|
|
3282
3372
|
return GridCell(colDef, __assign(__assign({ editor: GridFormMultiSelect }, props), { editorParams: __assign({ className: "GridMultiSelect-containerMedium" }, props.editorParams) }));
|
|
3283
3373
|
};
|
|
3284
3374
|
|
|
3285
|
-
var css_248z$
|
|
3286
|
-
styleInject(css_248z$
|
|
3375
|
+
var css_248z$3 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
|
|
3376
|
+
styleInject(css_248z$3);
|
|
3287
3377
|
|
|
3288
3378
|
/** Menu configuration types **/
|
|
3289
3379
|
var PopoutMenuSeparator = Object.freeze({ __isMenuSeparator__: true });
|
|
@@ -3381,8 +3471,8 @@ var GridFormPopoverMenu = function (props) {
|
|
|
3381
3471
|
e.keepOpen = true;
|
|
3382
3472
|
}
|
|
3383
3473
|
else {
|
|
3384
|
-
setSubComponentSelected(null);
|
|
3385
3474
|
actionClick(item).then();
|
|
3475
|
+
e.keepOpen = true;
|
|
3386
3476
|
}
|
|
3387
3477
|
}, [actionClick, subComponentSelected]);
|
|
3388
3478
|
var selectedRowCount = selectedRows.length;
|
|
@@ -3399,21 +3489,16 @@ var GridFormPopoverMenu = function (props) {
|
|
|
3399
3489
|
return [4 /*yield*/, actionClick(subComponentSelected)];
|
|
3400
3490
|
case 1:
|
|
3401
3491
|
_a.sent();
|
|
3402
|
-
|
|
3403
|
-
case 2:
|
|
3492
|
+
return [2 /*return*/, false];
|
|
3493
|
+
case 2:
|
|
3494
|
+
// Otherwise assume it's a cancel, either way we close the menu
|
|
3495
|
+
return [2 /*return*/, true];
|
|
3404
3496
|
}
|
|
3405
3497
|
});
|
|
3406
3498
|
}); }, [actionClick, subComponentSelected]);
|
|
3407
3499
|
var _e = useGridPopoverHook({ className: props.className, save: save }), popoverWrapper = _e.popoverWrapper, triggerSave = _e.triggerSave;
|
|
3408
|
-
var localTriggerSave = function (reason) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3409
|
-
return __generator(this, function (_a) {
|
|
3410
|
-
if (!subComponentIsValid.current)
|
|
3411
|
-
return [2 /*return*/];
|
|
3412
|
-
return [2 /*return*/, triggerSave(reason)];
|
|
3413
|
-
});
|
|
3414
|
-
}); };
|
|
3415
3500
|
return popoverWrapper(jsxRuntime.jsx(ComponentLoadingWrapper, __assign({ loading: !filteredOptions, className: "GridFormPopupMenu" }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3416
|
-
return item.label === PopoutMenuSeparator ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : (!item.hidden && (jsxRuntime.jsxs(
|
|
3501
|
+
return item.label === PopoutMenuSeparator ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : (!item.hidden && (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx(MenuItem, __assign({ onClick: function (e) { return onMenuItemClick(e, 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)), item.subComponent && subComponentSelected === item && (jsxRuntime.jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (_) {
|
|
3417
3502
|
return item.subComponent && (jsxRuntime.jsx(GridSubComponentContext.Provider, __assign({ value: {
|
|
3418
3503
|
value: subSelectedValue,
|
|
3419
3504
|
setValue: function (value) {
|
|
@@ -3422,9 +3507,9 @@ var GridFormPopoverMenu = function (props) {
|
|
|
3422
3507
|
setValid: function (valid) {
|
|
3423
3508
|
subComponentIsValid.current = valid;
|
|
3424
3509
|
},
|
|
3425
|
-
triggerSave:
|
|
3510
|
+
triggerSave: triggerSave
|
|
3426
3511
|
} }, { children: jsxRuntime.jsx(item.subComponent, {}) })));
|
|
3427
|
-
} }), "".concat(item.label, "_subcomponent")))] })));
|
|
3512
|
+
} }), "".concat(item.label, "_subcomponent")))] }, "".concat(item.label))));
|
|
3428
3513
|
}) }) })));
|
|
3429
3514
|
};
|
|
3430
3515
|
|
|
@@ -3516,16 +3601,19 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
3516
3601
|
return dmsString;
|
|
3517
3602
|
};
|
|
3518
3603
|
|
|
3519
|
-
var css_248z$
|
|
3520
|
-
styleInject(css_248z$3);
|
|
3521
|
-
|
|
3522
|
-
var css_248z$2 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
3604
|
+
var css_248z$2 = ".GridFormEditBearing-input{width:320px}";
|
|
3523
3605
|
styleInject(css_248z$2);
|
|
3524
3606
|
|
|
3607
|
+
var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
3608
|
+
styleInject(css_248z$1);
|
|
3609
|
+
|
|
3525
3610
|
var TextInputFormatted = function (props) {
|
|
3526
|
-
return (jsxRuntime.jsxs("div", __assign({ className: clsx("LuiTextInput Grid-popoverContainer", props.error && "hasError", props.
|
|
3611
|
+
return (jsxRuntime.jsxs("div", __assign({ className: clsx("LuiTextInput Grid-popoverContainer", props.error && "hasError", props.className) }, { children: [jsxRuntime.jsxs("span", __assign({ className: "LuiTextInput-inputWrapper" }, { children: [jsxRuntime.jsx("input", __assign({ type: "text", spellCheck: true, defaultValue: props.value }, lodashEs.omit(props, ["error", "value", "helpText", "formatted", "className"]), { className: "LuiTextInput-input", onMouseEnter: function (e) {
|
|
3527
3612
|
e.currentTarget.focus();
|
|
3528
|
-
|
|
3613
|
+
props.onMouseEnter && props.onMouseEnter(e);
|
|
3614
|
+
} })), jsxRuntime.jsx("span", __assign({ className: "LuiTextInput-formatted" }, { children: props.formatted }))] })), props.error && (jsxRuntime.jsxs("span", __assign({ className: "LuiTextInput-error" }, { children: [jsxRuntime.jsx(lui.LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }), props.error] }))), props.helpText && !props.error && (jsxRuntime.jsx("span", __assign({ style: {
|
|
3615
|
+
fontSize: "0.7rem"
|
|
3616
|
+
} }, { children: props.helpText })))] })));
|
|
3529
3617
|
};
|
|
3530
3618
|
|
|
3531
3619
|
var GridFormEditBearing = function (props) {
|
|
@@ -3560,18 +3648,13 @@ var GridFormEditBearing = function (props) {
|
|
|
3560
3648
|
}
|
|
3561
3649
|
});
|
|
3562
3650
|
}); }, [field, initialValue, props, value]);
|
|
3563
|
-
var _c = useGridPopoverHook({
|
|
3564
|
-
|
|
3651
|
+
var _c = useGridPopoverHook({
|
|
3652
|
+
className: props.className,
|
|
3653
|
+
save: save
|
|
3654
|
+
}), popoverWrapper = _c.popoverWrapper, onlyInputKeyboardEventHandlers = _c.onlyInputKeyboardEventHandlers;
|
|
3655
|
+
return popoverWrapper(jsxRuntime.jsx("div", __assign({ className: "GridFormEditBearing-input Grid-popoverContainer" }, { children: jsxRuntime.jsx(TextInputFormatted, __assign({ value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|
|
3565
3656
|
setValue(e.target.value.trim());
|
|
3566
|
-
},
|
|
3567
|
-
autoFocus: true,
|
|
3568
|
-
placeholder: props.placeHolder,
|
|
3569
|
-
disabled: false,
|
|
3570
|
-
maxLength: 16,
|
|
3571
|
-
onKeyDown: function (e) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
3572
|
-
return [2 /*return*/, e.key === "Enter" && triggerSave().then()];
|
|
3573
|
-
}); }); }
|
|
3574
|
-
}, formatted: bearingStringValidator(value, props.range) ? "?" : convertDDToDMS(bearingNumberParser(value)), error: bearingStringValidator(value, props.range) }) })));
|
|
3657
|
+
}, autoFocus: true, placeholder: props.placeHolder }, onlyInputKeyboardEventHandlers, { formatted: bearingStringValidator(value, props.range) ? "?" : convertDDToDMS(bearingNumberParser(value)), error: bearingStringValidator(value, props.range) })) })));
|
|
3575
3658
|
};
|
|
3576
3659
|
|
|
3577
3660
|
var GridPopoverEditBearingLike = function (colDef, props) {
|
|
@@ -3708,32 +3791,44 @@ var useGenerateOrDefaultId = function (idFromProps) {
|
|
|
3708
3791
|
return id;
|
|
3709
3792
|
};
|
|
3710
3793
|
var TextAreaInput = function (props) {
|
|
3711
|
-
var _a
|
|
3712
|
-
var id = useGenerateOrDefaultId(
|
|
3713
|
-
return (jsxRuntime.jsxs("div", __assign({ className: clsx("LuiTextAreaInput Grid-popoverContainer",
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3794
|
+
var _a;
|
|
3795
|
+
var id = useGenerateOrDefaultId(props === null || props === void 0 ? void 0 : props.id);
|
|
3796
|
+
return (jsxRuntime.jsxs("div", __assign({ className: clsx("LuiTextAreaInput Grid-popoverContainer", props.disabled ? "isDisabled" : "", props.error ? "hasError" : "", props.className) }, { children: [jsxRuntime.jsxs("label", __assign({ htmlFor: id }, { children: [props.mandatory != null && jsxRuntime.jsx("span", __assign({ className: "LuiTextAreaInput-mandatory" }, { children: "*" })), props.label != null && jsxRuntime.jsx("span", __assign({ className: "LuiTextAreaInput-label" }, { children: props.label })), jsxRuntime.jsx("div", __assign({ className: "LuiTextAreaInput-wrapper" }, { children: jsxRuntime.jsx("textarea", __assign({ rows: 5 }, lodashEs.omit(props, ["error", "value", "helpText", "formatted", "className"]), { id: id, value: (_a = props.value) !== null && _a !== void 0 ? _a : "", spellCheck: true, onMouseEnter: function (e) {
|
|
3797
|
+
if (document.activeElement != e.currentTarget) {
|
|
3798
|
+
e.currentTarget.focus();
|
|
3799
|
+
e.currentTarget.selectionStart = e.currentTarget.value.length;
|
|
3800
|
+
}
|
|
3801
|
+
props.onMouseEnter && props.onMouseEnter(e);
|
|
3802
|
+
} }, { children: props.value })) }))] })), props.error && (jsxRuntime.jsxs("span", __assign({ className: "LuiTextAreaInput-error" }, { children: [jsxRuntime.jsx(lui.LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextAreaInput-error-icon", size: "sm", status: "error" }), props.error] }))), props.helpText && !props.error && (jsxRuntime.jsx("span", __assign({ style: {
|
|
3803
|
+
fontSize: "0.7rem"
|
|
3804
|
+
} }, { children: props.helpText })))] })));
|
|
3719
3805
|
};
|
|
3720
3806
|
|
|
3721
|
-
var
|
|
3722
|
-
|
|
3723
|
-
var _b = useGridPopoverContext(), field = _b.field, initialVale = _b.value;
|
|
3724
|
-
var _c = react.useState(initialVale != null ? "".concat(initialVale) : ""), value = _c[0], setValue = _c[1];
|
|
3725
|
-
var invalid = react.useCallback(function () {
|
|
3726
|
-
if (props.required && value.length == 0) {
|
|
3727
|
-
return "Some text is required";
|
|
3728
|
-
}
|
|
3729
|
-
if (props.maxLength && value.length > props.maxLength) {
|
|
3730
|
-
return "Text must be no longer than ".concat(props.maxLength, " characters");
|
|
3731
|
-
}
|
|
3732
|
-
if (props.validate) {
|
|
3733
|
-
return props.validate(value);
|
|
3734
|
-
}
|
|
3807
|
+
var TextInputValidator = function (props, value) {
|
|
3808
|
+
if (value == null)
|
|
3735
3809
|
return null;
|
|
3736
|
-
|
|
3810
|
+
// This can happen because subcomponent is invoked without type safety
|
|
3811
|
+
if (typeof value !== "string") {
|
|
3812
|
+
console.error("Value is not a string", value);
|
|
3813
|
+
}
|
|
3814
|
+
if (props.required && value.length === 0) {
|
|
3815
|
+
return "Some text is required";
|
|
3816
|
+
}
|
|
3817
|
+
if (props.maxLength && value.length > props.maxLength) {
|
|
3818
|
+
return "Text must be no longer than ".concat(props.maxLength, " characters");
|
|
3819
|
+
}
|
|
3820
|
+
if (props.validate) {
|
|
3821
|
+
return props.validate(value);
|
|
3822
|
+
}
|
|
3823
|
+
return null;
|
|
3824
|
+
};
|
|
3825
|
+
|
|
3826
|
+
var GridFormTextArea = function (props) {
|
|
3827
|
+
var _a, _b;
|
|
3828
|
+
var _c = useGridPopoverContext(), field = _c.field, initialVale = _c.value;
|
|
3829
|
+
var _d = react.useState(initialVale != null ? "".concat(initialVale) : ""), value = _d[0], setValue = _d[1];
|
|
3830
|
+
var helpText = (_a = props.helpText) !== null && _a !== void 0 ? _a : "Press tab to save";
|
|
3831
|
+
var invalid = react.useCallback(function () { return TextInputValidator(props, value); }, [props, value]);
|
|
3737
3832
|
var save = react.useCallback(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3738
3833
|
return __generator(this, function (_a) {
|
|
3739
3834
|
switch (_a.label) {
|
|
@@ -3757,30 +3852,19 @@ var GridFormTextArea = function (props) {
|
|
|
3757
3852
|
}
|
|
3758
3853
|
});
|
|
3759
3854
|
}); }, [invalid, initialVale, value, props, field]);
|
|
3760
|
-
var
|
|
3761
|
-
return popoverWrapper(jsxRuntime.jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (
|
|
3855
|
+
var _e = useGridPopoverHook({ className: props.className, save: save }), popoverWrapper = _e.popoverWrapper, lastInputKeyboardEventHandlers = _e.lastInputKeyboardEventHandlers;
|
|
3856
|
+
return popoverWrapper(jsxRuntime.jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (_b = props.width) !== null && _b !== void 0 ? _b : 240 } }, { children: jsxRuntime.jsx(TextAreaInput, __assign({ value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), placeholder: props.placeholder, helpText: helpText }, lastInputKeyboardEventHandlers)) })));
|
|
3762
3857
|
};
|
|
3763
3858
|
|
|
3764
3859
|
var GridPopoverTextArea = function (colDef, params) { return GridCell(colDef, __assign({ editor: GridFormTextArea }, params)); };
|
|
3765
3860
|
|
|
3766
3861
|
var GridFormTextInput = function (props) {
|
|
3767
|
-
var _a;
|
|
3768
|
-
var
|
|
3862
|
+
var _a, _b;
|
|
3863
|
+
var _c = useGridPopoverContext(), field = _c.field, initialVale = _c.value;
|
|
3864
|
+
var helpText = (_a = props.helpText) !== null && _a !== void 0 ? _a : "Press enter or tab to save";
|
|
3769
3865
|
var initValue = initialVale == null ? "" : "".concat(initialVale);
|
|
3770
|
-
var
|
|
3771
|
-
var invalid = react.useCallback(function () {
|
|
3772
|
-
var trimmedValue = value.trim();
|
|
3773
|
-
if (props.required && trimmedValue.length == 0) {
|
|
3774
|
-
return "Some text is required";
|
|
3775
|
-
}
|
|
3776
|
-
if (props.maxLength && trimmedValue.length > props.maxLength) {
|
|
3777
|
-
return "Text must be no longer than ".concat(props.maxLength, " characters");
|
|
3778
|
-
}
|
|
3779
|
-
if (props.validate) {
|
|
3780
|
-
return props.validate(trimmedValue, data);
|
|
3781
|
-
}
|
|
3782
|
-
return null;
|
|
3783
|
-
}, [data, props, value]);
|
|
3866
|
+
var _d = react.useState(initValue), value = _d[0], setValue = _d[1];
|
|
3867
|
+
var invalid = react.useCallback(function () { return TextInputValidator(props, value); }, [props, value]);
|
|
3784
3868
|
var save = react.useCallback(function (selectedRows) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3785
3869
|
var trimmedValue;
|
|
3786
3870
|
return __generator(this, function (_a) {
|
|
@@ -3806,90 +3890,72 @@ var GridFormTextInput = function (props) {
|
|
|
3806
3890
|
}
|
|
3807
3891
|
});
|
|
3808
3892
|
}); }, [invalid, value, initValue, props, field]);
|
|
3809
|
-
var
|
|
3810
|
-
return popoverWrapper(jsxRuntime.jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (
|
|
3811
|
-
style: { width: "100%" },
|
|
3812
|
-
placeholder: props.placeholder,
|
|
3813
|
-
onKeyDown: function (e) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
3814
|
-
return [2 /*return*/, e.key === "Enter" && triggerSave().then()];
|
|
3815
|
-
}); }); }
|
|
3816
|
-
} }) })));
|
|
3893
|
+
var _e = useGridPopoverHook({ className: props.className, save: save }), popoverWrapper = _e.popoverWrapper, lastInputKeyboardEventHandlers = _e.lastInputKeyboardEventHandlers;
|
|
3894
|
+
return popoverWrapper(jsxRuntime.jsx("div", __assign({ style: { display: "flex", flexDirection: "row", width: (_b = props.width) !== null && _b !== void 0 ? _b : 240 }, className: "FormTest" }, { children: jsxRuntime.jsx(TextInputFormatted, __assign({ value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), formatted: props.units, style: { width: "100%" }, placeholder: props.placeholder }, lastInputKeyboardEventHandlers, { helpText: helpText })) })));
|
|
3817
3895
|
};
|
|
3818
3896
|
|
|
3819
3897
|
var GridPopoverTextInput = function (colDef, params) {
|
|
3820
3898
|
return GridCell(colDef, __assign({ editor: GridFormTextInput }, params));
|
|
3821
3899
|
};
|
|
3822
3900
|
|
|
3823
|
-
var
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
var
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
fontSize: "0.7rem"
|
|
3856
|
-
} }, { children: helpText }))] })));
|
|
3901
|
+
var GridFormSubComponentTextInput = function (props) {
|
|
3902
|
+
var _a;
|
|
3903
|
+
var _b = react.useContext(GridSubComponentContext), value = _b.value, setValue = _b.setValue, setValid = _b.setValid, triggerSave = _b.triggerSave;
|
|
3904
|
+
var helpText = (_a = props.helpText) !== null && _a !== void 0 ? _a : "Press enter or tab to save";
|
|
3905
|
+
// If is not initialised yet as it's just been created then set the default value
|
|
3906
|
+
react.useEffect(function () {
|
|
3907
|
+
if (value == null)
|
|
3908
|
+
setValue(props.defaultValue);
|
|
3909
|
+
}, [props.defaultValue, setValue, value]);
|
|
3910
|
+
var invalid = react.useCallback(function () { return TextInputValidator(props, value); }, [props, value]);
|
|
3911
|
+
react.useEffect(function () {
|
|
3912
|
+
setValid(value != null && invalid() == null);
|
|
3913
|
+
}, [setValid, invalid, value]);
|
|
3914
|
+
return (jsxRuntime.jsx(TextInputFormatted, { value: value, error: invalid(), onChange: function (e) { return setValue(e.target.value); }, helpText: helpText, autoFocus: true, onKeyDown: function (e) {
|
|
3915
|
+
if (e.key === "Tab" || e.key === "Enter") {
|
|
3916
|
+
e.preventDefault();
|
|
3917
|
+
e.stopPropagation();
|
|
3918
|
+
}
|
|
3919
|
+
}, onKeyUp: function (e) {
|
|
3920
|
+
if (e.key === "Tab") {
|
|
3921
|
+
!e.shiftKey && triggerSave().then();
|
|
3922
|
+
e.preventDefault();
|
|
3923
|
+
e.stopPropagation();
|
|
3924
|
+
}
|
|
3925
|
+
else if (e.key === "Enter") {
|
|
3926
|
+
triggerSave().then();
|
|
3927
|
+
e.preventDefault();
|
|
3928
|
+
e.stopPropagation();
|
|
3929
|
+
}
|
|
3930
|
+
}, placeholder: props.placeholder, style: {
|
|
3931
|
+
width: "100%"
|
|
3932
|
+
} }));
|
|
3857
3933
|
};
|
|
3858
3934
|
|
|
3859
|
-
var
|
|
3860
|
-
var _a
|
|
3935
|
+
var GridFormSubComponentTextArea = function (props) {
|
|
3936
|
+
var _a;
|
|
3937
|
+
var _b = react.useContext(GridSubComponentContext), value = _b.value, setValue = _b.setValue, setValid = _b.setValid, triggerSave = _b.triggerSave;
|
|
3938
|
+
var helpText = (_a = props.helpText) !== null && _a !== void 0 ? _a : "Press tab to save";
|
|
3861
3939
|
// If is not initialised yet as it's just been created then set the default value
|
|
3862
3940
|
react.useEffect(function () {
|
|
3863
3941
|
if (value == null)
|
|
3864
3942
|
setValue(props.defaultValue);
|
|
3865
3943
|
}, [props.defaultValue, setValue, value]);
|
|
3866
|
-
var
|
|
3867
|
-
if (value == null)
|
|
3868
|
-
return null;
|
|
3869
|
-
// This can happen because subcomponent is invoked without type safety
|
|
3870
|
-
if (typeof value !== "string") {
|
|
3871
|
-
console.error("Value is not a string", value);
|
|
3872
|
-
}
|
|
3873
|
-
if (props.required && value.length === 0) {
|
|
3874
|
-
return "Some text is required";
|
|
3875
|
-
}
|
|
3876
|
-
if (props.maxLength && value.length > props.maxLength) {
|
|
3877
|
-
return "Text must be no longer than ".concat(props.maxLength, " characters");
|
|
3878
|
-
}
|
|
3879
|
-
if (props.validate) {
|
|
3880
|
-
return props.validate(value);
|
|
3881
|
-
}
|
|
3882
|
-
return null;
|
|
3883
|
-
}, [props]);
|
|
3944
|
+
var invalid = react.useCallback(function () { return TextInputValidator(props, value); }, [props, value]);
|
|
3884
3945
|
react.useEffect(function () {
|
|
3885
|
-
setValid(value != null &&
|
|
3886
|
-
}, [setValid,
|
|
3887
|
-
return (jsxRuntime.jsx("div", __assign({ className: "FreeTextInput LuiDeprecatedForms" }, { children: jsxRuntime.jsx(
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3946
|
+
setValid(value != null && invalid() == null);
|
|
3947
|
+
}, [setValid, invalid, value]);
|
|
3948
|
+
return (jsxRuntime.jsx("div", __assign({ className: clsx("FreeTextInput LuiDeprecatedForms", props.className) }, { children: jsxRuntime.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, onKeyDown: function (e) {
|
|
3949
|
+
if (e.key === "Tab") {
|
|
3950
|
+
e.preventDefault();
|
|
3951
|
+
e.stopPropagation();
|
|
3952
|
+
}
|
|
3953
|
+
}, onKeyUp: function (e) {
|
|
3954
|
+
if (e.key === "Tab") {
|
|
3955
|
+
!e.shiftKey && triggerSave().then();
|
|
3956
|
+
e.preventDefault();
|
|
3957
|
+
e.stopPropagation();
|
|
3958
|
+
}
|
|
3893
3959
|
} }) })));
|
|
3894
3960
|
};
|
|
3895
3961
|
|
|
@@ -4019,11 +4085,14 @@ exports.GridContextProvider = GridContextProvider;
|
|
|
4019
4085
|
exports.GridFormDropDown = GridFormDropDown;
|
|
4020
4086
|
exports.GridFormMultiSelect = GridFormMultiSelect;
|
|
4021
4087
|
exports.GridFormPopoverMenu = GridFormPopoverMenu;
|
|
4088
|
+
exports.GridFormSubComponentTextArea = GridFormSubComponentTextArea;
|
|
4022
4089
|
exports.GridFormSubComponentTextInput = GridFormSubComponentTextInput;
|
|
4023
4090
|
exports.GridHeaderSelect = GridHeaderSelect;
|
|
4024
4091
|
exports.GridIcon = GridIcon;
|
|
4025
4092
|
exports.GridLoadableCell = GridLoadableCell;
|
|
4026
4093
|
exports.GridPopoutEditMultiSelect = GridPopoutEditMultiSelect;
|
|
4094
|
+
exports.GridPopoverContext = GridPopoverContext;
|
|
4095
|
+
exports.GridPopoverContextProvider = GridPopoverContextProvider;
|
|
4027
4096
|
exports.GridPopoverEditBearing = GridPopoverEditBearing;
|
|
4028
4097
|
exports.GridPopoverEditBearingCorrection = GridPopoverEditBearingCorrection;
|
|
4029
4098
|
exports.GridPopoverEditDropDown = GridPopoverEditDropDown;
|
|
@@ -4033,7 +4102,7 @@ exports.GridPopoverTextArea = GridPopoverTextArea;
|
|
|
4033
4102
|
exports.GridPopoverTextInput = GridPopoverTextInput;
|
|
4034
4103
|
exports.GridRenderPopoutMenuCell = GridRenderPopoutMenuCell;
|
|
4035
4104
|
exports.GridRendererGenericCell = GridRendererGenericCell;
|
|
4036
|
-
exports.
|
|
4105
|
+
exports.GridSubComponentContext = GridSubComponentContext;
|
|
4037
4106
|
exports.GridUpdatingContext = GridUpdatingContext;
|
|
4038
4107
|
exports.GridUpdatingContextProvider = GridUpdatingContextProvider;
|
|
4039
4108
|
exports.Menu = Menu;
|
|
@@ -4059,6 +4128,7 @@ exports.convertDDToDMS = convertDDToDMS;
|
|
|
4059
4128
|
exports.hasParentClass = hasParentClass;
|
|
4060
4129
|
exports.isFloat = isFloat;
|
|
4061
4130
|
exports.isNotEmpty = isNotEmpty;
|
|
4131
|
+
exports.useGridPopoverContext = useGridPopoverContext;
|
|
4062
4132
|
exports.useGridPopoverHook = useGridPopoverHook;
|
|
4063
4133
|
exports.useMenuState = useMenuState;
|
|
4064
4134
|
exports.usePostSortRowsHook = usePostSortRowsHook;
|