@laser-ui/components 0.2.0 → 0.2.2

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [0.2.2](https://github.com/laser-ui/laser-ui/compare/v0.2.1...v0.2.2) (2023-10-31)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **components:** fix menu item tooltip in icon mode ([9107374](https://github.com/laser-ui/laser-ui/commit/91073748a13b12c676a983cb21e6c794b285ea43))
10
+
11
+ ## [0.2.1](https://github.com/laser-ui/laser-ui/compare/v0.2.0...v0.2.1) (2023-10-31)
12
+
13
+ ### Bug Fixes
14
+
15
+ - use the same values used for the call to addEventListener() when calling removeEventListener() ([deaffc3](https://github.com/laser-ui/laser-ui/commit/deaffc31f60a956ef38085c135ded6ad7b7db2e6))
16
+
5
17
  # [0.2.0](https://github.com/laser-ui/laser-ui/compare/v0.1.6...v0.2.0) (2023-10-31)
6
18
 
7
19
  ### Bug Fixes
@@ -267,7 +267,10 @@ function DropdownFC(props, ref) {
267
267
  triggerRef,
268
268
  popupRef,
269
269
  containerRefs: [],
270
- }, onVisibleChange: changeVisible, children: ({ renderTrigger, renderPopup }) => {
270
+ }, onVisibleChange: (visible) => {
271
+ console.log(visible);
272
+ changeVisible(visible);
273
+ }, children: ({ renderTrigger, renderPopup }) => {
271
274
  const render = (el) => {
272
275
  var _a, _b;
273
276
  triggerId = (_a = el.props.id) !== null && _a !== void 0 ? _a : `${namespace}-dropdown-trigger-${uniqueId}`;
@@ -54,7 +54,7 @@ export function Popup(props) {
54
54
  });
55
55
  return () => {
56
56
  els.forEach((el) => {
57
- el.removeEventListener('scroll', listener);
57
+ el.removeEventListener('scroll', listener, { passive: true });
58
58
  });
59
59
  };
60
60
  }
@@ -6,13 +6,14 @@ export function MenuItem(props) {
6
6
  const { children, namespace, styled, id, level, space, step, icon, posinset, mode, inNav, active, focus, disabled, onClick } = props;
7
7
  const inHorizontalNav = mode === 'horizontal' && inNav;
8
8
  const iconMode = mode === 'icon' && inNav;
9
- return (_jsx(Tooltip, { title: children, visible: iconMode ? undefined : false, placement: "right", children: _jsxs("li", Object.assign({}, mergeCS(styled('menu__item', 'menu__item--item', {
10
- 'menu__item--horizontal': inHorizontalNav,
11
- 'menu__item--icon': iconMode,
12
- 'menu__item.is-active': active,
13
- 'menu__item.is-disabled': disabled,
14
- }), { style: { paddingLeft: space + level * step } }), { id: id, role: "menuitem", "aria-disabled": disabled, onClick: onClick, children: [focus && _jsx("div", { className: `${namespace}-focus-outline` }), _jsxs("div", Object.assign({}, styled('menu__indicator', {
15
- 'menu__indicator--first': posinset[0] === 0 && posinset[1] > 1,
16
- 'menu__indicator--last': posinset[0] === posinset[1] - 1 && posinset[1] > 1,
17
- }), { children: [_jsx("div", Object.assign({}, styled('menu__indicator-track', { 'menu__indicator-track--hidden': level === 0 }))), _jsx("div", Object.assign({}, styled('menu__indicator-thumb')))] })), checkNodeExist(icon) && _jsx("div", Object.assign({}, styled('menu__item-icon'), { children: icon })), _jsx("div", Object.assign({}, styled('menu__item-content'), { children: children }))] })) }));
9
+ const node = (_jsxs("li", Object.assign({}, mergeCS(styled('menu__item', 'menu__item--item', {
10
+ 'menu__item--horizontal': inHorizontalNav,
11
+ 'menu__item--icon': iconMode,
12
+ 'menu__item.is-active': active,
13
+ 'menu__item.is-disabled': disabled,
14
+ }), { style: { paddingLeft: space + level * step } }), { id: id, role: "menuitem", "aria-disabled": disabled, onClick: onClick, children: [focus && _jsx("div", { className: `${namespace}-focus-outline` }), _jsxs("div", Object.assign({}, styled('menu__indicator', {
15
+ 'menu__indicator--first': posinset[0] === 0 && posinset[1] > 1,
16
+ 'menu__indicator--last': posinset[0] === posinset[1] - 1 && posinset[1] > 1,
17
+ }), { children: [_jsx("div", Object.assign({}, styled('menu__indicator-track', { 'menu__indicator-track--hidden': level === 0 }))), _jsx("div", Object.assign({}, styled('menu__indicator-thumb')))] })), checkNodeExist(icon) && _jsx("div", Object.assign({}, styled('menu__item-icon'), { children: icon })), _jsx("div", Object.assign({}, styled('menu__item-content'), { children: children }))] })));
18
+ return (_jsx(Tooltip, { title: children, placement: "right", children: (render) => (iconMode ? render(node) : node) }));
18
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laser-ui/components",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "React components.",
5
5
  "keywords": [
6
6
  "ui",
@@ -26,8 +26,8 @@
26
26
  "module": "./index.js",
27
27
  "types": "./index.d.ts",
28
28
  "dependencies": {
29
- "@laser-ui/hooks": "0.2.0",
30
- "@laser-ui/utils": "0.2.0",
29
+ "@laser-ui/hooks": "0.2.2",
30
+ "@laser-ui/utils": "0.2.2",
31
31
  "@material-design-icons/svg": "^0.14.12",
32
32
  "jss": "^10.10.0",
33
33
  "jss-preset-default": "^10.10.0",
@@ -45,5 +45,5 @@
45
45
  "access": "public",
46
46
  "directory": "../../dist/libs/components"
47
47
  },
48
- "gitHead": "70ff2b4c73a45c05aa49c44047e1da3ccbcea030"
48
+ "gitHead": "81e159d1e70c2b3191ce2dad33db867d7871d080"
49
49
  }