@linzjs/step-ag-grid 30.3.0 → 30.4.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/src/components/gridForm/GridFormInlineTextInput.d.ts +5 -0
- package/dist/step-ag-grid.cjs +8 -1
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -1
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormInlineTextInput.tsx +9 -1
- package/src/stories/grid/GridInlineText.stories.tsx +99 -18
|
@@ -10,6 +10,11 @@ export interface GridFormInlineTextInput<TData extends GridBaseRow> extends Text
|
|
|
10
10
|
selectedRowIds: TData['id'][];
|
|
11
11
|
value: string;
|
|
12
12
|
}) => MaybePromise<boolean>;
|
|
13
|
+
onChange?: (props: {
|
|
14
|
+
selectedRows: TData[];
|
|
15
|
+
selectedRowIds: TData['id'][];
|
|
16
|
+
value: string;
|
|
17
|
+
}) => void;
|
|
13
18
|
helpText?: string;
|
|
14
19
|
}
|
|
15
20
|
export declare const GridFormInlineTextInput: <TData extends GridBaseRow>(props: GridFormInlineTextInput<TData>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -63179,7 +63179,14 @@ const GridFormInlineTextInput = (props) => {
|
|
|
63179
63179
|
input?.removeEventListener('keydown', tabRecorder, { capture: true });
|
|
63180
63180
|
};
|
|
63181
63181
|
}, [tabRecorder]);
|
|
63182
|
-
return (jsxRuntime.jsx("div", { className: clsx('GridFormInlineTextInput', invalid() && 'GridFormInlineTextInput-error'), title: String(invalid() ?? ''), children: jsxRuntime.jsx("input", { ref: inputRef, type: 'text', value: value, onChange: (e) =>
|
|
63182
|
+
return (jsxRuntime.jsx("div", { className: clsx('GridFormInlineTextInput', invalid() && 'GridFormInlineTextInput-error'), title: String(invalid() ?? ''), children: jsxRuntime.jsx("input", { ref: inputRef, type: 'text', value: value, onChange: (e) => {
|
|
63183
|
+
setValue(e.target.value);
|
|
63184
|
+
if (props.onChange) {
|
|
63185
|
+
const selectedRows = getSelectedRows();
|
|
63186
|
+
const selectedRowIds = selectedRows.map((data) => data.id);
|
|
63187
|
+
props.onChange({ selectedRows, selectedRowIds, value: e.target.value });
|
|
63188
|
+
}
|
|
63189
|
+
}, placeholder: props.placeholder ?? 'Type here', onBlur: () => {
|
|
63183
63190
|
void triggerSave(CloseReason.BLUR);
|
|
63184
63191
|
}, onKeyUp: (e) => {
|
|
63185
63192
|
if (e.key === 'Enter') {
|