cx 22.4.2 → 22.5.1

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.
@@ -907,7 +907,7 @@ export class Grid extends Widget {
907
907
  let data = store.getData();
908
908
  let skip = 0;
909
909
 
910
- let { header } = instance;
910
+ let { header, state } = instance;
911
911
  let rowStyle = {};
912
912
 
913
913
  let lines = [];
@@ -921,7 +921,7 @@ export class Grid extends Widget {
921
921
 
922
922
  let v,
923
923
  c = ci.widget,
924
- colSpan,
924
+ colSpan = 1,
925
925
  pad,
926
926
  cls = "",
927
927
  style = null;
@@ -934,7 +934,6 @@ export class Grid extends Widget {
934
934
  empty = false;
935
935
  cls = CSS.expand(c.footer.class(data)) || "";
936
936
  style = parseStyle(c.footer.style(data));
937
-
938
937
  if (c.footer.expand) {
939
938
  colSpan = 1;
940
939
  for (
@@ -959,6 +958,16 @@ export class Grid extends Widget {
959
958
 
960
959
  if (pad !== false) cls += (cls ? " " : "") + CSS.state("pad");
961
960
 
961
+ // apply column width to footers too, but only if colSpan == 1,
962
+ // otherwise set 1px so that the footer is not participating in the layout
963
+
964
+ let maxWidth = 1;
965
+ if (colSpan == 1) maxWidth = state.colWidth[c.uniqueColumnId];
966
+ style = {
967
+ ...style,
968
+ maxWidth,
969
+ };
970
+
962
971
  return (
963
972
  <td key={i} className={cls} colSpan={colSpan} style={style}>
964
973
  {v}
@@ -2475,7 +2484,7 @@ class GridComponent extends VDOM.Component {
2475
2484
  if (!futureState.cellEdit && wasCellEditing) {
2476
2485
  //If cell editing is in progress, moving the cursor may cause that the cell editor is unmounted before
2477
2486
  //the blur event which may cause data loss for components which do not have reactOn=change set, e.g. NumberField.
2478
- unfocusElement();
2487
+ unfocusElement(null, false);
2479
2488
  let record = this.getRecordAt(prevState.cursor);
2480
2489
  if ((!this.cellEditorValid || cancelEdit) && this.cellEditUndoData)
2481
2490
  record.store.set(widget.recordName, this.cellEditUndoData);
@@ -119,7 +119,7 @@ export class GridRowComponent extends VDOM.Component {
119
119
  e.stopPropagation();
120
120
 
121
121
  //close context menu
122
- unfocusElement(e.target);
122
+ unfocusElement(e.target, false);
123
123
  }
124
124
  }
125
125
 
@@ -134,7 +134,7 @@ export class GridRowComponent extends VDOM.Component {
134
134
  selectRange: e.shiftKey,
135
135
  selectOptions: {
136
136
  toggle: e.ctrlKey && !e.shiftKey,
137
- add: e.ctrlKey && e.shiftKey
137
+ add: e.ctrlKey && e.shiftKey,
138
138
  },
139
139
  cellIndex: this.getCellIndex(e),
140
140
  });
@@ -190,7 +190,7 @@ export class GridRowComponent extends VDOM.Component {
190
190
  selectRange: e.shiftKey,
191
191
  selectOptions: {
192
192
  toggle: e.ctrlKey && !e.shiftKey,
193
- add: e.ctrlKey && e.shiftKey
193
+ add: e.ctrlKey && e.shiftKey,
194
194
  },
195
195
  cellIndex: this.getCellIndex(e),
196
196
  });
@@ -1,6 +1,9 @@
1
+ import * as React from "react";
1
2
  import * as Cx from "../../core";
3
+ import { Instance } from "../../ui/Instance";
4
+ import { LinkButtonProps } from "./LinkButton";
2
5
 
3
- interface LinkProps extends Cx.HtmlElementProps {
6
+ interface LinkProps extends LinkButtonProps {
4
7
  /** Set to `true` to disable the link. */
5
8
  disabled?: Cx.BooleanProp;
6
9
 
@@ -17,6 +20,7 @@ interface LinkProps extends Cx.HtmlElementProps {
17
20
 
18
21
  activeClass?: Cx.ClassProp;
19
22
  activeStyle?: Cx.StyleProp;
23
+ onClick?: string | ((e: React.SyntheticEvent<any>, instance: Instance) => void);
20
24
  }
21
25
 
22
26
  export class Link extends Cx.Widget<LinkProps> {}
@@ -1,7 +1,7 @@
1
1
  import * as Cx from "../../core";
2
2
  import { ButtonProps } from "../Button";
3
3
 
4
- interface LinkButtonProps extends ButtonProps {
4
+ export interface LinkButtonProps extends ButtonProps {
5
5
  /** Url to the link's target location. Should start with `~/` or `#/` for pushState/hash based navigation. */
6
6
  href?: Cx.StringProp;
7
7