@linzjs/step-ag-grid 17.4.9 → 17.5.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.
@@ -10,18 +10,21 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
10
10
  themes: (
11
11
  'step-compact.theme-specific': (
12
12
  extend-theme: alpine,
13
- --ag-row-height: 36px,
14
- --ag-header-height: 36px,
15
- --ag-font-size: calc($grid-base-font-size - 2px),
13
+ row-height: 36px,
14
+ header-height: 36px,
15
+ font-size: calc($grid-base-font-size - 2px),
16
16
  ),
17
17
  'step-default.theme-specific': (
18
18
  extend-theme: alpine,
19
- --ag-row-height: 40px,
20
- --ag-header-height: 40px,
21
- --ag-font-size: calc($grid-base-font-size),
19
+ row-height: 40px,
20
+ header-height: 40px,
21
+ font-size: calc($grid-base-font-size),
22
22
  ),
23
23
  ),
24
24
 
25
+ input-focus-border-color: lui.$sea,
26
+ borders-input: 1px solid,
27
+ input-border-color: lui.$silver,
25
28
  alpine-active-color: lui.$sea,
26
29
  background-color: lui.$white,
27
30
  border-color: lui.$dew,
@@ -49,6 +52,10 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
49
52
 
50
53
  .ag-theme-step-default.theme-specific,
51
54
  .ag-theme-step-compact.theme-specific {
55
+ .ag-text-area-input:focus {
56
+ border-color: lui.$sea;
57
+ }
58
+
52
59
  .ag-cell[col-id="selection"] {
53
60
  display: flex; // Fix that when you click below checkbox it doesn't process a click
54
61
  }
@@ -64,8 +64,12 @@ export interface GridProps {
64
64
  * Whether to select row on context menu.
65
65
  */
66
66
  contextMenuSelectRow?: boolean;
67
+ /**
68
+ * Defaults to false.
69
+ */
70
+ singleClickEdit?: boolean;
67
71
  }
68
72
  /**
69
73
  * Wrapper for AgGrid to add commonly used functionality.
70
74
  */
71
- export declare const Grid: ({ "data-testid": dataTestId, rowSelection, suppressColumnVirtualization, theme, sizeColumns, selectColumnPinned, contextMenuSelectRow, rowHeight, ...params }: GridProps) => ReactElement;
75
+ export declare const Grid: ({ "data-testid": dataTestId, rowSelection, suppressColumnVirtualization, theme, sizeColumns, selectColumnPinned, contextMenuSelectRow, singleClickEdit, rowHeight, ...params }: GridProps) => ReactElement;
@@ -2344,7 +2344,7 @@ const useGridContextMenu = ({ contextMenuSelectRow, contextMenu: ContextMenu, })
2344
2344
  /**
2345
2345
  * Wrapper for AgGrid to add commonly used functionality.
2346
2346
  */
2347
- const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressColumnVirtualization = true, theme = "ag-theme-step-default", sizeColumns = "auto", selectColumnPinned = null, contextMenuSelectRow = false, rowHeight = theme === "ag-theme-step-default" ? 40 : theme === "ag-theme-step-compact" ? 36 : undefined, ...params }) => {
2347
+ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressColumnVirtualization = true, theme = "ag-theme-step-default", sizeColumns = "auto", selectColumnPinned = null, contextMenuSelectRow = false, singleClickEdit = false, rowHeight = theme === "ag-theme-step-default" ? 40 : theme === "ag-theme-step-compact" ? 36 : undefined, ...params }) => {
2348
2348
  const { gridReady, setApis, ensureRowVisible, getFirstRowId, selectRowsById, focusByRowById, ensureSelectedRowIsVisible, autoSizeColumns, sizeColumnsToFit, externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync, isExternalFilterPresent, doesExternalFilterPass, setOnCellEditingComplete, getColDef, } = React.useContext(GridContext);
2349
2349
  const { checkUpdating, updatedDep, updatingCols } = React.useContext(GridUpdatingContext);
2350
2350
  const { prePopupOps } = React.useContext(GridContext);
@@ -2648,10 +2648,10 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
2648
2648
  * Handle single click edits
2649
2649
  */
2650
2650
  const onCellClicked = React.useCallback((event) => {
2651
- if (event.colDef?.cellRendererParams?.singleClickEdit) {
2651
+ if (event.colDef?.cellRendererParams?.singleClickEdit ?? singleClickEdit) {
2652
2652
  startCellEditing(event);
2653
2653
  }
2654
- }, [startCellEditing]);
2654
+ }, [singleClickEdit, startCellEditing]);
2655
2655
  /**
2656
2656
  * If cell has an edit action invoke it (if editable)
2657
2657
  */
@@ -3268,11 +3268,11 @@ function styleInject(css, ref) {
3268
3268
  }
3269
3269
  }
3270
3270
 
3271
- var css_248z$2 = ".helpText{color:#6b6966;font-size:.75rem;font-weight:400}";
3271
+ var css_248z$2 = ".FormError-helpText{color:#6b6966;font-size:.75rem;font-weight:400}";
3272
3272
  styleInject(css_248z$2);
3273
3273
 
3274
3274
  const FormError = (props) => {
3275
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.error && (jsxRuntime.jsx("span", { className: "LuiTextInput-error", style: { paddingLeft: 0 }, children: props.error })), props.helpText && !props.error && jsxRuntime.jsx("span", { className: "helpText", children: props.helpText })] }));
3275
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.error && (jsxRuntime.jsx("span", { className: "LuiTextInput-error", style: { paddingLeft: 0 }, children: props.error })), props.helpText && !props.error && jsxRuntime.jsx("span", { className: "FormError-helpText", children: props.helpText })] }));
3276
3276
  };
3277
3277
 
3278
3278
  function escapeStringRegexp(string) {
@@ -3648,11 +3648,11 @@ const GridFormDropDown = (props) => {
3648
3648
  })] }) })] }));
3649
3649
  };
3650
3650
 
3651
- var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
3651
+ var css_248z$1 = ".LuiTextInput.GridLuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
3652
3652
  styleInject(css_248z$1);
3653
3653
 
3654
3654
  const TextInputFormatted = (props) => {
3655
- return (jsxRuntime.jsxs("div", { className: clsx("LuiTextInput Grid-popoverContainer", props.error && "hasError", props.className), children: [jsxRuntime.jsxs("span", { className: "LuiTextInput-inputWrapper", children: [jsxRuntime.jsx("input", { type: "text", spellCheck: true, defaultValue: props.value, ...lodashEs.omit(props, ["error", "value", "helpText", "formatted", "className", "allowTabToSave"]), className: "LuiTextInput-input", onMouseEnter: (e) => {
3655
+ return (jsxRuntime.jsxs("div", { className: clsx("LuiTextInput GridLuiTextInput Grid-popoverContainer", props.error && "hasError", props.className), children: [jsxRuntime.jsxs("span", { className: "LuiTextInput-inputWrapper", children: [jsxRuntime.jsx("input", { type: "text", spellCheck: true, defaultValue: props.value, ...lodashEs.omit(props, ["error", "value", "helpText", "formatted", "className", "allowTabToSave"]), className: "LuiTextInput-input", onMouseEnter: (e) => {
3656
3656
  e.currentTarget.focus();
3657
3657
  props.onMouseEnter && props.onMouseEnter(e);
3658
3658
  }, "data-allowtabtosave": props.allowTabToSave }), jsxRuntime.jsx("span", { className: "LuiTextInput-formatted", children: props.formatted })] }), jsxRuntime.jsx(FormError, { error: props.error, helpText: props.helpText })] }));