@adaptabletools/adaptable 13.0.0-canary.21 → 13.0.0-canary.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "13.0.0-canary.21",
3
+ "version": "13.0.0-canary.22",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1664742496151;
1
+ declare const _default: 1664770961793;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1664742496151;
3
+ exports.default = 1664770961793;
@@ -133,10 +133,15 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
133
133
  this.adaptable.api.gridApi.jumpToCell(cellDataChangedInfo.primaryKeyValue, cellDataChangedInfo.column.columnId);
134
134
  }
135
135
  if (actionName === 'jump-to-row' &&
136
- gridDataChangedInfo &&
137
- // no sense to jump to a deleted(non-existing) row
138
- (gridDataChangedInfo === null || gridDataChangedInfo === void 0 ? void 0 : gridDataChangedInfo.rowTrigger) !== 'Delete') {
139
- const [firstRowNode] = gridDataChangedInfo.rowNodes;
136
+ // either a cell change
137
+ (cellDataChangedInfo ||
138
+ // or a grid change, but NOT row deletion
139
+ (gridDataChangedInfo &&
140
+ // no sense to jump to a deleted(non-existing) row
141
+ (gridDataChangedInfo === null || gridDataChangedInfo === void 0 ? void 0 : gridDataChangedInfo.rowTrigger) !== 'Delete'))) {
142
+ const [firstRowNode] = cellDataChangedInfo
143
+ ? [cellDataChangedInfo.rowNode]
144
+ : gridDataChangedInfo.rowNodes;
140
145
  const targetRowNodePrimaryKeyValue = this.adaptable.api.gridApi.getPrimaryKeyValueForRowNode(firstRowNode);
141
146
  if (targetRowNodePrimaryKeyValue) {
142
147
  this.adaptable.api.gridApi.jumpToRow(targetRowNodePrimaryKeyValue);
@@ -92,32 +92,34 @@ const AlertBehaviourWizardSection = (props) => {
92
92
  const rowAddedAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(data);
93
93
  const rowRemovedAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(data);
94
94
  const cellChangedAlert = !rowAddedAlert && !rowRemovedAlert;
95
+ const hasPreventCellEdit = cellChangedAlert;
96
+ const hasHighlightCell = cellChangedAlert;
97
+ const hasHighlightRow = cellChangedAlert || rowAddedAlert;
98
+ const hasJumpToCell = cellChangedAlert;
99
+ const hasJumpToRow = cellChangedAlert || rowAddedAlert;
95
100
  const onChange = (AlertProperties) => {
96
101
  props.onChange(Object.assign(Object.assign({}, data), { AlertProperties: Object.assign(Object.assign({}, data.AlertProperties), AlertProperties) }));
97
102
  };
98
103
  return (React.createElement(Tabs_1.Tabs, null,
99
104
  React.createElement(Tabs_1.Tabs.Tab, null, api.internalApi.getCorrectEnglishVariant('Behaviour')),
100
105
  React.createElement(Tabs_1.Tabs.Content, null,
101
- cellChangedAlert && (React.createElement(CheckBox_1.CheckBox, { "data-name": "prevet-cell-edit", style: { alignItems: 'flex-start' }, checked: AlertProperties.PreventEdit, onChange: (PreventEdit) => {
106
+ hasPreventCellEdit && (React.createElement(CheckBox_1.CheckBox, { "data-name": "prevent-cell-edit", style: { alignItems: 'flex-start' }, checked: AlertProperties.PreventEdit, onChange: (PreventEdit) => {
102
107
  onChange({
103
108
  PreventEdit,
104
109
  });
105
110
  } },
106
111
  "Prevent Cell Edit",
107
112
  React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(automatically undo data change which triggered Alert)"))),
108
- cellChangedAlert && (React.createElement(HighlightStyle, { dataName: "highlight-cell", highlight: AlertProperties.HighlightCell, label: "Highlight Cell", onChange: (HighlightCell) => {
113
+ hasHighlightCell && (React.createElement(HighlightStyle, { dataName: "highlight-cell", highlight: AlertProperties.HighlightCell, label: "Highlight Cell", onChange: (HighlightCell) => {
109
114
  onChange({ HighlightCell });
110
115
  } })),
111
- cellChangedAlert && (React.createElement(HighlightStyle, { dataName: "highlight-row", highlight: AlertProperties.HighlightRow, label: "Highlight Row", onChange: (HighlightRow) => {
116
+ hasHighlightRow && (React.createElement(HighlightStyle, { dataName: "highlight-row", highlight: AlertProperties.HighlightRow, label: "Highlight Row", onChange: (HighlightRow) => {
112
117
  onChange({ HighlightRow });
113
118
  } })),
114
- rowAddedAlert && (React.createElement(HighlightStyle, { dataName: "highlight-row", highlight: AlertProperties.HighlightRow, label: "Highlight Row", onChange: (HighlightRow) => {
115
- onChange({ HighlightRow });
116
- } })),
117
- cellChangedAlert && (React.createElement(CheckBox_1.CheckBox, { "data-name": "jump-to-cell", checked: AlertProperties.JumpToCell, onChange: (JumpToCell) => {
119
+ hasJumpToCell && (React.createElement(CheckBox_1.CheckBox, { "data-name": "jump-to-cell", checked: AlertProperties.JumpToCell, onChange: (JumpToCell) => {
118
120
  onChange({ JumpToCell });
119
121
  } }, "Jump To Cell")),
120
- rowAddedAlert && (React.createElement(CheckBox_1.CheckBox, { "data-name": "jump-to-row", checked: AlertProperties.JumpToRow, onChange: (JumpToRow) => {
122
+ hasJumpToRow && (React.createElement(CheckBox_1.CheckBox, { "data-name": "jump-to-row", checked: AlertProperties.JumpToRow, onChange: (JumpToRow) => {
121
123
  onChange({ JumpToRow });
122
124
  } }, "Jump To Row")),
123
125
  React.createElement(CheckBox_1.CheckBox, { "data-name": "show-in-div", checked: AlertProperties.ShowInDiv, onChange: (ShowInDiv) => {
@@ -17,9 +17,32 @@ const AlertButtonsEditor = (props) => {
17
17
  const onChange = (newButtons) => {
18
18
  props.onChange(newButtons);
19
19
  };
20
+ const alertDefinition = adaptableAlert.alertDefinition;
21
+ const rowAddedAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
22
+ const rowRemovedAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
23
+ const cellChangedAlert = !rowAddedAlert && !rowRemovedAlert;
24
+ const hasHighlightCell = cellChangedAlert;
25
+ const hasHighlightRow = cellChangedAlert || rowAddedAlert;
26
+ const hasJumpToCell = cellChangedAlert;
27
+ const hasJumpToRow = cellChangedAlert || rowAddedAlert;
28
+ const hasUndo = cellChangedAlert;
20
29
  const AlertButtons = (0, Helper_1.cloneObject)(props.AlertButtons || []) || [];
21
30
  const buttonActions = [];
22
- buttonActions.push('highlight-row', 'jump-to-row', 'highlight-cell', 'jump-to-cell', 'undo');
31
+ if (hasHighlightRow) {
32
+ buttonActions.push('highlight-row');
33
+ }
34
+ if (hasJumpToRow) {
35
+ buttonActions.push('jump-to-row');
36
+ }
37
+ if (hasHighlightCell) {
38
+ buttonActions.push('highlight-cell');
39
+ }
40
+ if (hasJumpToCell) {
41
+ buttonActions.push('jump-to-cell');
42
+ }
43
+ if (hasUndo) {
44
+ buttonActions.push('undo');
45
+ }
23
46
  buttonActions.push('suspend');
24
47
  return (React.createElement(React.Fragment, null,
25
48
  React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between" },
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "13.0.0-canary.21";
1
+ declare const _default: "13.0.0-canary.22";
2
2
  export default _default;
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '13.0.0-canary.21'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '13.0.0-canary.22'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version