@xh/hoist 77.0.0-SNAPSHOT.1761672695220 → 77.0.0-SNAPSHOT.1761690719868
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/CHANGELOG.md +7 -1
- package/cmp/grid/Grid.ts +3 -2
- package/cmp/grid/impl/MenuSupport.ts +10 -15
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## 77.0.0-SNAPSHOT - unreleased
|
|
4
4
|
|
|
5
|
+
### 🐞 Bug Fixes
|
|
6
|
+
* Fixes regressions in grid context menu for filtering and copy/paste introduced by agGrid v34.
|
|
7
|
+
|
|
8
|
+
* Note: AgGrid no longer supports html markup in context menus. Applications setting the
|
|
9
|
+
RecordGridAction `text` property to markup should be sure to convert to a simpler form.
|
|
10
|
+
|
|
5
11
|
### 💥 Breaking Changes
|
|
6
12
|
|
|
7
13
|
* The `disableXssProtection` flag supported by `AppSpec` and `FieldSpec` has been removed and
|
|
@@ -14,7 +20,7 @@
|
|
|
14
20
|
* Apps that were previously opting-out via `disableXssProtection` should simply remove that
|
|
15
21
|
flag. Apps for which this protection remains important should enable at either the app level
|
|
16
22
|
or for selected Fields and/or Stores.
|
|
17
|
-
|
|
23
|
+
|
|
18
24
|
## 76.2.0 - 2025-10-22
|
|
19
25
|
|
|
20
26
|
### ⚙️ Technical
|
package/cmp/grid/Grid.ts
CHANGED
|
@@ -273,6 +273,7 @@ export class GridLocalModel extends HoistModel {
|
|
|
273
273
|
mode: selModel.mode == 'single' ? 'singleRow' : 'multiRow',
|
|
274
274
|
enableClickSelection: selModel.isEnabled,
|
|
275
275
|
isRowSelectable: () => selModel.isEnabled,
|
|
276
|
+
copySelectedRows: selModel.isEnabled,
|
|
276
277
|
checkboxes: false,
|
|
277
278
|
headerCheckbox: false
|
|
278
279
|
};
|
|
@@ -321,7 +322,7 @@ export class GridLocalModel extends HoistModel {
|
|
|
321
322
|
getContextMenuItems = (params: GetContextMenuItemsParams) => {
|
|
322
323
|
const {model} = this,
|
|
323
324
|
{contextMenu} = model;
|
|
324
|
-
if (!contextMenu || XH.isMobileApp || model.isEditing) return
|
|
325
|
+
if (!contextMenu || XH.isMobileApp || model.isEditing) return [];
|
|
325
326
|
|
|
326
327
|
// Manipulate selection if needed.
|
|
327
328
|
if (model.selModel.isEnabled) {
|
|
@@ -336,7 +337,7 @@ export class GridLocalModel extends HoistModel {
|
|
|
336
337
|
}
|
|
337
338
|
|
|
338
339
|
const ret = getAgGridMenuItems(params, model, contextMenu);
|
|
339
|
-
if (isEmpty(ret)) return
|
|
340
|
+
if (isEmpty(ret)) return [];
|
|
340
341
|
|
|
341
342
|
return ret;
|
|
342
343
|
};
|
|
@@ -12,7 +12,6 @@ import {filterConsecutiveMenuSeparators} from '@xh/hoist/utils/impl';
|
|
|
12
12
|
import copy from 'clipboard-copy';
|
|
13
13
|
import {isEmpty, isFunction, isNil, isString, uniq} from 'lodash';
|
|
14
14
|
import {isValidElement} from 'react';
|
|
15
|
-
import {renderToStaticMarkup} from '@xh/hoist/utils/react';
|
|
16
15
|
import {GridContextMenuItemLike, GridContextMenuSpec} from '../GridContextMenu';
|
|
17
16
|
|
|
18
17
|
import type {GetContextMenuItemsParams, MenuItemDef} from '@xh/hoist/kit/ag-grid';
|
|
@@ -179,21 +178,17 @@ function replaceHoistToken(token: string, gridModel: GridModel): Some<RecordActi
|
|
|
179
178
|
const values = getValues(selectedRecords, field);
|
|
180
179
|
if (values.length > 1) return {text: `${values.length} values`};
|
|
181
180
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
// That's the contract for `RecordAction.text`, but even more importantly, we end up piping
|
|
192
|
-
// those actions into Ag-Grid context menus, which *only* accept strings / HTML markup
|
|
193
|
-
// and *not* ReactElements (as of AG v28.2).
|
|
194
|
-
text = isValidElement(elem) ? renderToStaticMarkup(elem) : elem;
|
|
181
|
+
// Grid col renderers will very typically return elements, but we need this to be a string.
|
|
182
|
+
// As of AG v34.2.0 actions into Ag-Grid context menus *only* accept strings.
|
|
183
|
+
let raw = values[0],
|
|
184
|
+
renderer = fieldSpec.renderer ?? column.renderer,
|
|
185
|
+
text = renderer?.(raw, {record, column, gridModel});
|
|
186
|
+
if (!isString(text)) {
|
|
187
|
+
text = raw?.toString();
|
|
188
|
+
}
|
|
189
|
+
text = text?.trim();
|
|
195
190
|
|
|
196
|
-
return {text};
|
|
191
|
+
return {text: text ?? '[blank]'};
|
|
197
192
|
};
|
|
198
193
|
|
|
199
194
|
return new RecordAction({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "77.0.0-SNAPSHOT.
|
|
3
|
+
"version": "77.0.0-SNAPSHOT.1761690719868",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|