@lemon-fe/kits 1.0.0-83 → 1.0.0-84

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.
Files changed (29) hide show
  1. package/es/components/DataGrid/cell-editors/Text.d.ts +1 -1
  2. package/es/components/DataGrid/index.d.ts +4 -4
  3. package/es/components/DataGrid/index.js +1 -1
  4. package/es/components/DataGrid/index.less +1 -5
  5. package/es/components/DataGrid/modules/clipboard/clipboard/clipboardService.js +5 -0
  6. package/es/components/DataGrid/modules/clipboard/version.d.ts +1 -1
  7. package/es/components/DataGrid/modules/clipboard/version.js +1 -1
  8. package/es/components/DataGrid/modules/column-tool-panel/columnsToolPanelModule.js +1 -1
  9. package/es/components/DataGrid/modules/column-tool-panel/version.d.ts +1 -1
  10. package/es/components/DataGrid/modules/column-tool-panel/version.js +1 -1
  11. package/es/components/DataGrid/modules/master-detail/version.d.ts +1 -1
  12. package/es/components/DataGrid/modules/master-detail/version.js +1 -1
  13. package/es/components/DataGrid/modules/menu/menu/chartMenuItemMapper.js +2 -2
  14. package/es/components/DataGrid/modules/menu/menu/contextMenu.js +5 -1
  15. package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.d.ts +1 -1
  16. package/es/components/DataGrid/modules/menu/menu/enterpriseMenu.js +3 -2
  17. package/es/components/DataGrid/modules/menu/menu/menuItemMapper.js +1 -1
  18. package/es/components/DataGrid/modules/menu/version.d.ts +1 -1
  19. package/es/components/DataGrid/modules/menu/version.js +1 -1
  20. package/es/components/DataGrid/modules/row-grouping/rowGrouping/aggregationStage.d.ts +1 -1
  21. package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.d.ts +2 -0
  22. package/es/components/DataGrid/modules/row-grouping/rowGrouping/batchRemover.js +12 -0
  23. package/es/components/DataGrid/modules/row-grouping/rowGrouping/groupStage.js +14 -6
  24. package/es/components/DataGrid/modules/row-grouping/version.d.ts +1 -1
  25. package/es/components/DataGrid/modules/row-grouping/version.js +1 -1
  26. package/es/components/DataGrid/modules/side-bar/sideBar/sideBarComp.js +1 -1
  27. package/es/components/DataGrid/modules/side-bar/version.d.ts +1 -1
  28. package/es/components/DataGrid/modules/side-bar/version.js +1 -1
  29. package/package.json +13 -13
@@ -4,5 +4,5 @@ import type { ICellEditorParams } from '@ag-grid-community/core';
4
4
  export interface TextEditorParams {
5
5
  disabled: boolean;
6
6
  }
7
- declare const _default: React.ForwardRefExoticComponent<ICellEditorParams<any, any> & TextEditorParams & React.RefAttributes<ICellEditorReactComp>>;
7
+ declare const _default: React.ForwardRefExoticComponent<ICellEditorParams<any, any, any> & TextEditorParams & React.RefAttributes<ICellEditorReactComp>>;
8
8
  export default _default;
@@ -44,10 +44,10 @@ export default class DataGrid<TData extends Record<string, any>> extends Compone
44
44
  };
45
45
  static EmptyCol: ColType<any>;
46
46
  static Editors: {
47
- Text: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any> & import("./typings").TextEditorParams & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
48
- Date: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any> & import("./typings").DateEditorParams & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
49
- Number: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any> & import("./typings").NumberEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
50
- Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "allowClear" | "options" | "virtual" | "showSearch" | "listHeight"> & {
47
+ Text: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").TextEditorParams & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
48
+ Date: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").DateEditorParams & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
49
+ Number: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").NumberEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
50
+ Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "allowClear" | "options" | "virtual" | "showSearch" | "listHeight"> & {
51
51
  fieldNames?: {
52
52
  label: string;
53
53
  value: string;
@@ -294,7 +294,7 @@ var DataGrid = /*#__PURE__*/function (_Component) {
294
294
  if (_this.props.stopEditingWhenCellsLoseFocus) {
295
295
  _this.blurTimer = setTimeout(function () {
296
296
  if (_this.isReady) {
297
- _this.api.stopEditing();
297
+ _this.api.clearFocusedCell();
298
298
  }
299
299
 
300
300
  _this.blurTimer = null;
@@ -157,7 +157,7 @@
157
157
  box-shadow: 0 0 0 2px var(--ag-border-color) inset;
158
158
  }
159
159
 
160
- .ag-cell-focus & {
160
+ .ag-cell-inline-editing & {
161
161
  padding: 0;
162
162
  box-shadow: 0 0 0 2px ~'var(--@{ant-prefix}-primary-5)' inset;
163
163
  }
@@ -299,10 +299,6 @@
299
299
  content: '';
300
300
  pointer-events: none;
301
301
  }
302
-
303
- .@{prefixCls}-grid-editor {
304
- box-shadow: none;
305
- }
306
302
  }
307
303
 
308
304
  .ag-menu {
@@ -540,6 +540,11 @@ var ClipboardService = ClipboardService_1 = /*#__PURE__*/function (_BeanStub) {
540
540
  key: "cutToClipboard",
541
541
  value: function cutToClipboard() {
542
542
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
543
+
544
+ if (this.gridOptionsService.is('suppressCutToClipboard')) {
545
+ return;
546
+ }
547
+
543
548
  this.copyOrCutToClipboard(params, true);
544
549
  }
545
550
  }, {
@@ -1 +1 @@
1
- export declare const VERSION = "29.1.0";
1
+ export declare const VERSION = "29.2.0";
@@ -1,2 +1,2 @@
1
1
  // DO NOT UPDATE MANUALLY: Generated from script during build time
2
- export var VERSION = '29.1.0';
2
+ export var VERSION = '29.2.0';
@@ -9,7 +9,7 @@ import { ModelItemUtils } from "./columnToolPanel/modelItemUtils";
9
9
  import { VERSION } from "./version";
10
10
  export var ColumnsToolPanelModule = {
11
11
  version: VERSION,
12
- moduleName: ModuleNames.ColumnToolPanelModule,
12
+ moduleName: ModuleNames.ColumnsToolPanelModule,
13
13
  beans: [ModelItemUtils],
14
14
  agStackComponents: [{
15
15
  componentName: 'AgPrimaryColsHeader',
@@ -1 +1 @@
1
- export declare const VERSION = "29.1.0";
1
+ export declare const VERSION = "29.2.0";
@@ -1,2 +1,2 @@
1
1
  // DO NOT UPDATE MANUALLY: Generated from script during build time
2
- export var VERSION = '29.1.0';
2
+ export var VERSION = '29.2.0';
@@ -1 +1 @@
1
- export declare const VERSION = "29.1.0";
1
+ export declare const VERSION = "29.2.0";
@@ -1,2 +1,2 @@
1
1
  // DO NOT UPDATE MANUALLY: Generated from script during build time
2
- export var VERSION = '29.1.0';
2
+ export var VERSION = '29.2.0';
@@ -106,7 +106,7 @@ var ChartMenuItemMapper = ChartMenuItemMapper_1 = /*#__PURE__*/function (_BeanSt
106
106
  itemLookup[item._key] = item;
107
107
 
108
108
  if (item.subMenu) {
109
- item.subMenu.map(function (s) {
109
+ item.subMenu.forEach(function (s) {
110
110
  return addItem(s);
111
111
  });
112
112
  }
@@ -128,7 +128,7 @@ var ChartMenuItemMapper = ChartMenuItemMapper_1 = /*#__PURE__*/function (_BeanSt
128
128
  var orderedAndFiltered = Object.assign(Object.assign({}, topLevelMenuItem), {
129
129
  subMenu: []
130
130
  });
131
- Object.entries(chartGroupsDef).map(function (_ref) {
131
+ Object.entries(chartGroupsDef).forEach(function (_ref) {
132
132
  var _ref2 = _slicedToArray(_ref, 2),
133
133
  group = _ref2[0],
134
134
  chartTypes = _ref2[1];
@@ -62,7 +62,11 @@ var ContextMenuFactory = /*#__PURE__*/function (_BeanStub) {
62
62
  if (_.exists(node) && ModuleRegistry.isRegistered(ModuleNames.ClipboardModule)) {
63
63
  if (column) {
64
64
  // only makes sense if column exists, could have originated from a row
65
- defaultMenuOptions.push('cut', 'copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'paste', 'separator');
65
+ if (!this.gridOptionsService.is('suppressCutToClipboard')) {
66
+ defaultMenuOptions.push('cut');
67
+ }
68
+
69
+ defaultMenuOptions.push('copy', 'copyWithHeaders', 'copyWithGroupHeaders', 'paste', 'separator');
66
70
  }
67
71
  }
68
72
 
@@ -13,7 +13,7 @@ export declare class EnterpriseMenuFactory extends BeanStub implements IMenuFact
13
13
  hideActiveMenu(): void;
14
14
  showMenuAfterMouseEvent(column: Column, mouseEvent: MouseEvent, defaultTab?: string): void;
15
15
  showMenuAfterButtonClick(column: Column, eventSource: HTMLElement, containerType: ContainerType, defaultTab?: string, restrictToTabs?: ColumnMenuTab[]): void;
16
- showMenu(column: Column, positionCallback: (menu: EnterpriseMenu) => void, containerType: ContainerType, defaultTab?: string, restrictToTabs?: ColumnMenuTab[], eventSource?: HTMLElement): void;
16
+ private showMenu;
17
17
  private getClosedCallback;
18
18
  private addStopAnchoring;
19
19
  private getMenuParams;
@@ -94,7 +94,8 @@ var EnterpriseMenuFactory = /*#__PURE__*/function (_BeanStub) {
94
94
  nudgeX: 9 * multiplier,
95
95
  nudgeY: -23,
96
96
  position: 'under',
97
- keepWithinBounds: true
97
+ keepWithinBounds: true,
98
+ shouldSetMaxHeight: true
98
99
  });
99
100
 
100
101
  if (defaultTab) {
@@ -337,7 +338,7 @@ export var EnterpriseMenu = /*#__PURE__*/function (_BeanStub2) {
337
338
  key: "isModuleLoaded",
338
339
  value: function isModuleLoaded(menuTabName) {
339
340
  if (menuTabName === EnterpriseMenu.TAB_COLUMNS) {
340
- return ModuleRegistry.isRegistered(ModuleNames.ColumnToolPanelModule);
341
+ return ModuleRegistry.isRegistered(ModuleNames.ColumnsToolPanelModule);
341
342
  }
342
343
 
343
344
  return true;
@@ -255,7 +255,7 @@ var MenuItemMapper = /*#__PURE__*/function (_BeanStub) {
255
255
  name: localeTextFunc('cut', 'Cut'),
256
256
  shortcut: localeTextFunc('ctrlX', 'Ctrl+X'),
257
257
  icon: _.createIconNoSpan('clipboardCut', this.gridOptionsService, null),
258
- disabled: !isEditable,
258
+ disabled: !isEditable || this.gridOptionsService.is('suppressCutToClipboard'),
259
259
  action: function action() {
260
260
  return _this2.clipboardService.cutToClipboard();
261
261
  }
@@ -1 +1 @@
1
- export declare const VERSION = "29.1.0";
1
+ export declare const VERSION = "29.2.0";
@@ -1,2 +1,2 @@
1
1
  // DO NOT UPDATE MANUALLY: Generated from script during build time
2
- export var VERSION = '29.1.0';
2
+ export var VERSION = '29.2.0';
@@ -8,7 +8,7 @@ export declare class AggregationStage extends BeanStub implements IRowNodeStage
8
8
  private columnApi;
9
9
  private filteredOnly;
10
10
  execute(params: StageExecuteParams): any;
11
- getGroupRowAggFunc(): ((params: Pick<GetGroupRowAggParams<any>, "nodes">) => any) | undefined;
11
+ getGroupRowAggFunc(): ((params: Pick<GetGroupRowAggParams<any, any>, "nodes">) => any) | undefined;
12
12
  private createAggDetails;
13
13
  private isSuppressAggFilteredOnly;
14
14
  private recursivelyCreateAggData;
@@ -3,6 +3,8 @@ export declare class BatchRemover {
3
3
  private allSets;
4
4
  private allParents;
5
5
  removeFromChildrenAfterGroup(parent: RowNode, child: RowNode): void;
6
+ isRemoveFromAllLeafChildren(parent: RowNode, child: RowNode): boolean;
7
+ preventRemoveFromAllLeafChildren(parent: RowNode, child: RowNode): void;
6
8
  removeFromAllLeafChildren(parent: RowNode, child: RowNode): void;
7
9
  private getSet;
8
10
  getAllParents(): RowNode[];
@@ -18,6 +18,18 @@ export var BatchRemover = /*#__PURE__*/function () {
18
18
  var set = this.getSet(parent);
19
19
  set.removeFromChildrenAfterGroup[child.id] = true;
20
20
  }
21
+ }, {
22
+ key: "isRemoveFromAllLeafChildren",
23
+ value: function isRemoveFromAllLeafChildren(parent, child) {
24
+ var set = this.getSet(parent);
25
+ return !!set.removeFromAllLeafChildren[child.id];
26
+ }
27
+ }, {
28
+ key: "preventRemoveFromAllLeafChildren",
29
+ value: function preventRemoveFromAllLeafChildren(parent, child) {
30
+ var set = this.getSet(parent);
31
+ delete set.removeFromAllLeafChildren[child.id];
32
+ }
21
33
  }, {
22
34
  key: "removeFromAllLeafChildren",
23
35
  value: function removeFromAllLeafChildren(parent, child) {
@@ -293,7 +293,7 @@ var GroupStage = /*#__PURE__*/function (_BeanStub) {
293
293
  key: "moveNode",
294
294
  value: function moveNode(childNode, details, batchRemover) {
295
295
  this.removeNodesInStages([childNode], details, batchRemover);
296
- this.insertOneNode(childNode, details, true); // hack - if we didn't do this, then renaming a tree item (ie changing rowNode.key) wouldn't get
296
+ this.insertOneNode(childNode, details, true, batchRemover); // hack - if we didn't do this, then renaming a tree item (ie changing rowNode.key) wouldn't get
297
297
  // refreshed into the gui.
298
298
  // this is needed to kick off the event that rowComp listens to for refresh. this in turn
299
299
  // then will get each cell in the row to refresh - which is what we need as we don't know which
@@ -542,7 +542,9 @@ var GroupStage = /*#__PURE__*/function (_BeanStub) {
542
542
  } // groups are about to get disposed, so need to deselect any that are selected
543
543
 
544
544
 
545
- this.selectionService.removeGroupsFromSelection();
545
+ this.selectionService.filterFromSelection(function (node) {
546
+ return node && !node.group;
547
+ });
546
548
  var rootNode = details.rootNode,
547
549
  groupedCols = details.groupedCols; // because we are not creating the root node each time, we have the logic
548
550
  // here to change leafGroup once.
@@ -602,9 +604,9 @@ var GroupStage = /*#__PURE__*/function (_BeanStub) {
602
604
  }
603
605
  }, {
604
606
  key: "insertOneNode",
605
- value: function insertOneNode(childNode, details, isMove) {
607
+ value: function insertOneNode(childNode, details, isMove, batchRemover) {
606
608
  var path = this.getGroupInfo(childNode, details);
607
- var parentGroup = this.findParentForNode(childNode, path, details);
609
+ var parentGroup = this.findParentForNode(childNode, path, details, batchRemover);
608
610
 
609
611
  if (!parentGroup.group) {
610
612
  console.warn("AG Grid: duplicate group keys for row data, keys should be unique", [parentGroup.data, childNode.data]);
@@ -621,7 +623,7 @@ var GroupStage = /*#__PURE__*/function (_BeanStub) {
621
623
  }
622
624
  }, {
623
625
  key: "findParentForNode",
624
- value: function findParentForNode(childNode, path, details) {
626
+ value: function findParentForNode(childNode, path, details, batchRemover) {
625
627
  var _this9 = this;
626
628
 
627
629
  var nextNode = details.rootNode;
@@ -629,7 +631,12 @@ var GroupStage = /*#__PURE__*/function (_BeanStub) {
629
631
  nextNode = _this9.getOrCreateNextNode(nextNode, groupInfo, level, details); // node gets added to all group nodes.
630
632
  // note: we do not add to rootNode here, as the rootNode is the master list of rowNodes
631
633
 
632
- nextNode.allLeafChildren.push(childNode);
634
+ if (!(batchRemover === null || batchRemover === void 0 ? void 0 : batchRemover.isRemoveFromAllLeafChildren(nextNode, childNode))) {
635
+ nextNode.allLeafChildren.push(childNode);
636
+ } else {
637
+ // if this node is about to be removed, prevent that
638
+ batchRemover === null || batchRemover === void 0 ? void 0 : batchRemover.preventRemoveFromAllLeafChildren(nextNode, childNode);
639
+ }
633
640
  });
634
641
  return nextNode;
635
642
  }
@@ -655,6 +662,7 @@ var GroupStage = /*#__PURE__*/function (_BeanStub) {
655
662
  userGroup.allLeafChildren = fillerGroup.allLeafChildren;
656
663
  userGroup.childrenAfterGroup = fillerGroup.childrenAfterGroup;
657
664
  userGroup.childrenMapped = fillerGroup.childrenMapped;
665
+ userGroup.sibling = fillerGroup.sibling;
658
666
  userGroup.updateHasChildren();
659
667
  this.removeFromParent(fillerGroup);
660
668
  userGroup.childrenAfterGroup.forEach(function (rowNode) {
@@ -1 +1 @@
1
- export declare const VERSION = "29.1.0";
1
+ export declare const VERSION = "29.2.0";
@@ -1,2 +1,2 @@
1
1
  // DO NOT UPDATE MANUALLY: Generated from script during build time
2
- export var VERSION = '29.1.0';
2
+ export var VERSION = '29.2.0';
@@ -234,7 +234,7 @@ export var SideBarComp = /*#__PURE__*/function (_Component) {
234
234
 
235
235
 
236
236
  if (def.toolPanel === 'agColumnsToolPanel') {
237
- var moduleMissing = !ModuleRegistry.assertRegistered(ModuleNames.ColumnToolPanelModule, 'Column Tool Panel');
237
+ var moduleMissing = !ModuleRegistry.assertRegistered(ModuleNames.ColumnsToolPanelModule, 'Column Tool Panel');
238
238
 
239
239
  if (moduleMissing) {
240
240
  return;
@@ -1 +1 @@
1
- export declare const VERSION = "29.1.0";
1
+ export declare const VERSION = "29.2.0";
@@ -1,2 +1,2 @@
1
1
  // DO NOT UPDATE MANUALLY: Generated from script during build time
2
- export var VERSION = '29.1.0';
2
+ export var VERSION = '29.2.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-83",
3
+ "version": "1.0.0-84",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -31,12 +31,12 @@
31
31
  ]
32
32
  },
33
33
  "dependencies": {
34
- "@ag-grid-community/client-side-row-model": "^29.1.0",
35
- "@ag-grid-community/core": "^29.1.0",
36
- "@ag-grid-community/csv-export": "^29.1.0",
37
- "@ag-grid-community/infinite-row-model": "^29.1.0",
38
- "@ag-grid-community/react": "^29.1.0",
39
- "@ag-grid-community/styles": "^29.1.0",
34
+ "@ag-grid-community/client-side-row-model": "^29.2.0",
35
+ "@ag-grid-community/core": "^29.2.0",
36
+ "@ag-grid-community/csv-export": "^29.2.0",
37
+ "@ag-grid-community/infinite-row-model": "^29.2.0",
38
+ "@ag-grid-community/react": "^29.2.0",
39
+ "@ag-grid-community/styles": "^29.2.0",
40
40
  "@ant-design/icons": "^4.7.0",
41
41
  "@lemon-fe/hooks": "^0.1.142",
42
42
  "@lemon-fe/utils": "^0.1.117",
@@ -59,12 +59,12 @@
59
59
  "react": ">=16.8"
60
60
  },
61
61
  "devDependencies": {
62
- "@ag-grid-enterprise/clipboard": "^29.1.0",
63
- "@ag-grid-enterprise/column-tool-panel": "^29.1.0",
64
- "@ag-grid-enterprise/master-detail": "^29.1.0",
65
- "@ag-grid-enterprise/menu": "^29.1.0",
66
- "@ag-grid-enterprise/row-grouping": "^29.1.0",
67
- "@ag-grid-enterprise/side-bar": "^29.1.0",
62
+ "@ag-grid-enterprise/clipboard": "^29.2.0",
63
+ "@ag-grid-enterprise/column-tool-panel": "^29.2.0",
64
+ "@ag-grid-enterprise/master-detail": "^29.2.0",
65
+ "@ag-grid-enterprise/menu": "^29.2.0",
66
+ "@ag-grid-enterprise/row-grouping": "^29.2.0",
67
+ "@ag-grid-enterprise/side-bar": "^29.2.0",
68
68
  "@testing-library/jest-dom": "^5.15.1",
69
69
  "@testing-library/react": "^13.0.0",
70
70
  "@types/color-string": "^1.5.2",