@lowdefy/blocks-aggrid 6.0.0 → 6.1.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.
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import React from 'react';
16
- import { Button, Space } from 'antd';
16
+ import { Button, Space, Tooltip } from 'antd';
17
17
  import { type } from '@lowdefy/helpers';
18
18
  import { renderHtml } from '@lowdefy/block-utils';
19
19
  import NullCell from './NullCell.js';
@@ -56,7 +56,11 @@ function ButtonsCell(params) {
56
56
  properties: iconConfig
57
57
  }) : undefined;
58
58
  const showTitle = btn.hideTitle !== true && !type.isNone(title);
59
- return /*#__PURE__*/ React.createElement(Button, {
59
+ // An icon-only button still needs to say what it does: its title becomes
60
+ // the tooltip unless the config names one. A visible-title button gets a
61
+ // tooltip only when asked.
62
+ const tooltip = type.isString(btn.tooltip) ? btn.tooltip : !showTitle && !type.isNone(title) ? String(title) : null;
63
+ const button = /*#__PURE__*/ React.createElement(Button, {
60
64
  key: idx,
61
65
  size: btn.size ?? 'small',
62
66
  type: btn.type,
@@ -72,6 +76,12 @@ function ButtonsCell(params) {
72
76
  html: String(title),
73
77
  methods
74
78
  }));
79
+ if (!tooltip) return button;
80
+ return /*#__PURE__*/ React.createElement(Tooltip, {
81
+ key: idx,
82
+ title: tooltip,
83
+ mouseEnterDelay: 0.3
84
+ }, button);
75
85
  }));
76
86
  }
77
87
  export default ButtonsCell;
@@ -545,6 +545,10 @@ function createDisplayMeta(blockName, { size = false } = {}) {
545
545
  default: false,
546
546
  description: "Hide the button's title (icon-only)."
547
547
  },
548
+ tooltip: {
549
+ type: 'string',
550
+ description: 'Hover text for the button. An icon-only button (`hideTitle: true`) shows its `title` as the tooltip when this is not set.'
551
+ },
548
552
  disabled: {
549
553
  type: 'boolean',
550
554
  default: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-aggrid",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "AgGrid Blocks for Lowdefy.",
6
6
  "homepage": "https://lowdefy.com",
@@ -44,9 +44,9 @@
44
44
  "dist/*"
45
45
  ],
46
46
  "dependencies": {
47
- "@lowdefy/block-utils": "6.0.0",
48
- "@lowdefy/blocks-antd": "6.0.0",
49
- "@lowdefy/helpers": "6.0.0",
47
+ "@lowdefy/block-utils": "6.1.0",
48
+ "@lowdefy/blocks-antd": "6.1.0",
49
+ "@lowdefy/helpers": "6.1.0",
50
50
  "ag-grid-community": "33.3.2",
51
51
  "ag-grid-react": "33.3.2"
52
52
  },
@@ -58,8 +58,8 @@
58
58
  "react-dom": ">=18"
59
59
  },
60
60
  "devDependencies": {
61
- "@lowdefy/block-dev-e2e": "6.0.0",
62
- "@lowdefy/e2e-utils": "6.0.0",
61
+ "@lowdefy/block-dev-e2e": "6.1.0",
62
+ "@lowdefy/e2e-utils": "6.1.0",
63
63
  "@playwright/test": "1.59.1",
64
64
  "@swc/cli": "0.8.1",
65
65
  "@swc/core": "1.15.32",