@linzjs/step-ag-grid 22.2.4 → 22.3.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/README.md +0 -1
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +7 -6
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +1 -1
- package/dist/step-ag-grid.cjs.js +10 -5
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +10 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +14 -8
- package/src/components/gridPopoverEdit/GridButton.tsx +3 -3
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +2 -6
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +3 -3
- package/src/lui/FormError.scss +22 -4
- package/src/lui/FormError.tsx +5 -3
- package/src/lui/TextInputFormatted.scss +3 -1
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { GridBaseRow } from "../Grid";
|
|
3
3
|
import { CellEditorCommon } from "../GridCell";
|
|
4
|
-
export interface GridPopoutEditDropDownSelectedItem<TData> {
|
|
4
|
+
export interface GridPopoutEditDropDownSelectedItem<TData extends GridBaseRow, TValue> {
|
|
5
5
|
selectedRows: TData[];
|
|
6
|
-
|
|
6
|
+
selectedRowIds: TData["id"][];
|
|
7
|
+
value: TValue;
|
|
7
8
|
subComponentValue?: any;
|
|
8
9
|
}
|
|
9
10
|
interface FinalSelectOption {
|
|
@@ -22,16 +23,16 @@ export declare const MenuHeaderItem: (title: string) => {
|
|
|
22
23
|
value: string;
|
|
23
24
|
};
|
|
24
25
|
export type SelectOption = null | string | FinalSelectOption;
|
|
25
|
-
export interface GridFormDropDownProps<TData extends GridBaseRow> extends CellEditorCommon {
|
|
26
|
+
export interface GridFormDropDownProps<TData extends GridBaseRow, TValue> extends CellEditorCommon {
|
|
26
27
|
className?: "GridPopoverEditDropDown-containerSmall" | "GridPopoverEditDropDown-containerMedium" | "GridPopoverEditDropDown-containerLarge" | "GridPopoverEditDropDown-containerUnlimited" | "GridPopoverEditDropDown-containerAutoWidth" | string | undefined;
|
|
27
28
|
filtered?: "local" | "reload";
|
|
28
29
|
filterDefaultValue?: string;
|
|
29
30
|
filterPlaceholder?: string;
|
|
30
31
|
filterHelpText?: string;
|
|
31
32
|
noOptionsMessage?: string;
|
|
32
|
-
onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData>) => Promise<void>;
|
|
33
|
-
onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData>) => Promise<void>;
|
|
33
|
+
onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void>;
|
|
34
|
+
onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void>;
|
|
34
35
|
options: SelectOption[] | ((selectedRows: TData[], filter?: string) => Promise<SelectOption[] | undefined> | SelectOption[] | undefined) | undefined;
|
|
35
36
|
}
|
|
36
|
-
export declare const GridFormDropDown: <TData extends GridBaseRow>(props: GridFormDropDownProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const GridFormDropDown: <TData extends GridBaseRow, TValue>(props: GridFormDropDownProps<TData, TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -2,11 +2,11 @@ import { ICellEditorParams } from "ag-grid-community";
|
|
|
2
2
|
import { ColDefT } from "../GridCell";
|
|
3
3
|
import { GenericCellColDef } from "../gridRender";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
|
-
export interface GridButtonProps<TData> {
|
|
5
|
+
export interface GridButtonProps<TData extends GridBaseRow> {
|
|
6
6
|
visible?: (cellEditorParams: ICellEditorParams) => boolean;
|
|
7
7
|
onClick?: (props: {
|
|
8
8
|
selectedRows: TData[];
|
|
9
|
-
selectedRowIds:
|
|
9
|
+
selectedRowIds: TData["id"][];
|
|
10
10
|
}) => void;
|
|
11
11
|
}
|
|
12
12
|
export declare const GridButton: <TData extends GridBaseRow>(colDef: GenericCellColDef<TData, boolean>, editor: GridButtonProps<TData>) => ColDefT<TData>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CellEditorCommon, ColDefT } from "../GridCell";
|
|
2
2
|
import { GenericCellColDef } from "../gridRender";
|
|
3
3
|
import { GridBaseRow } from "../Grid";
|
|
4
|
-
export interface GridEditBooleanEditorProps<TData> extends CellEditorCommon {
|
|
4
|
+
export interface GridEditBooleanEditorProps<TData extends GridBaseRow> extends CellEditorCommon {
|
|
5
5
|
onClick: (props: {
|
|
6
6
|
selectedRows: TData[];
|
|
7
|
-
selectedRowIds:
|
|
7
|
+
selectedRowIds: TData["id"][];
|
|
8
8
|
checked: boolean;
|
|
9
9
|
}) => Promise<boolean>;
|
|
10
10
|
}
|
|
@@ -2,4 +2,4 @@ import { GridBaseRow } from "../Grid";
|
|
|
2
2
|
import { ColDefT, GenericCellEditorProps } from "../GridCell";
|
|
3
3
|
import { GridFormDropDownProps } from "../gridForm/GridFormDropDown";
|
|
4
4
|
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
5
|
-
export declare const GridPopoverEditDropDown: <TData extends GridBaseRow, TValue = any>(colDef: GenericCellColDef<TData, TValue>, props: GenericCellEditorProps<GridFormDropDownProps<TData>>) => ColDefT<TData, TValue>;
|
|
5
|
+
export declare const GridPopoverEditDropDown: <TData extends GridBaseRow, TValue = any>(colDef: GenericCellColDef<TData, TValue>, props: GenericCellEditorProps<GridFormDropDownProps<TData, TValue>>) => ColDefT<TData, TValue>;
|
package/dist/step-ag-grid.cjs.js
CHANGED
|
@@ -3350,11 +3350,11 @@ function styleInject(css, ref) {
|
|
|
3350
3350
|
}
|
|
3351
3351
|
}
|
|
3352
3352
|
|
|
3353
|
-
var css_248z$2 = ".FormError-helpText{color:#6b6966;font-size:.75rem;font-weight:400}";
|
|
3353
|
+
var css_248z$2 = ".FormError{display:flex}.FormError-helpText{color:#6b6966;font-size:.75rem;font-weight:400}.FormError-text-icon{margin-right:4px;margin-top:4px}.FormError-error{align-items:center;color:#2a292c;font-size:14px;font-weight:600;padding-left:0}";
|
|
3354
3354
|
styleInject(css_248z$2);
|
|
3355
3355
|
|
|
3356
3356
|
const FormError = (props) => {
|
|
3357
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.error && (jsxRuntime.
|
|
3357
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.error && (jsxRuntime.jsxs("div", { className: "FormError", children: [jsxRuntime.jsx(lui.LuiIcon, { alt: "error", name: "ic_error", className: "FormError-text-icon", size: "sm", status: "error" }), jsxRuntime.jsx("span", { className: "FormError-error", children: props.error })] })), props.helpText && !props.error && jsxRuntime.jsx("span", { className: "FormError-helpText", children: props.helpText })] }));
|
|
3358
3358
|
};
|
|
3359
3359
|
|
|
3360
3360
|
function escapeStringRegexp(string) {
|
|
@@ -3587,7 +3587,12 @@ const GridFormDropDown = (props) => {
|
|
|
3587
3587
|
(subComponentValue !== undefined && subComponentInitialValue.current !== JSON.stringify(subComponentValue));
|
|
3588
3588
|
if (hasChanged) {
|
|
3589
3589
|
if (props.onSelectedItem) {
|
|
3590
|
-
await props.onSelectedItem({
|
|
3590
|
+
await props.onSelectedItem({
|
|
3591
|
+
selectedRows,
|
|
3592
|
+
selectedRowIds: selectedRows.map((row) => row.id),
|
|
3593
|
+
value,
|
|
3594
|
+
subComponentValue,
|
|
3595
|
+
});
|
|
3591
3596
|
}
|
|
3592
3597
|
else {
|
|
3593
3598
|
selectedRows.forEach((row) => (row[field] = value));
|
|
@@ -3653,7 +3658,7 @@ const GridFormDropDown = (props) => {
|
|
|
3653
3658
|
if (selectedItem === null) {
|
|
3654
3659
|
if (props.onSelectFilter) {
|
|
3655
3660
|
const { onSelectFilter } = props;
|
|
3656
|
-
await onSelectFilter({ selectedRows, value: filter });
|
|
3661
|
+
await onSelectFilter({ selectedRows, selectedRowIds: selectedRows.map((row) => row.id), value: filter });
|
|
3657
3662
|
return true;
|
|
3658
3663
|
}
|
|
3659
3664
|
else {
|
|
@@ -3730,7 +3735,7 @@ const GridFormDropDown = (props) => {
|
|
|
3730
3735
|
})] }) })] }));
|
|
3731
3736
|
};
|
|
3732
3737
|
|
|
3733
|
-
var css_248z$1 = ".LuiTextInput.GridLuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#
|
|
3738
|
+
var css_248z$1 = ".LuiTextInput.GridLuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#6b6966;line-height:48px;position:absolute;right:14px;top:0}";
|
|
3734
3739
|
styleInject(css_248z$1);
|
|
3735
3740
|
|
|
3736
3741
|
const TextInputFormatted = (props) => {
|