@synerise/ds-column-manager 0.13.5 → 0.13.6

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.13.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-column-manager@0.13.5...@synerise/ds-column-manager@0.13.6) (2024-12-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **column-manager:** menu.item children -> datasource ([38b07f3](https://github.com/Synerise/synerise-design/commit/38b07f3b4767d43b933067c5e7699afd95546177))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.13.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-column-manager@0.13.4...@synerise/ds-column-manager@0.13.5) (2024-11-29)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-column-manager
@@ -1,8 +1,9 @@
1
- import React from 'react';
1
+ import type { ReactText, ReactNode } from 'react';
2
+ import type { ThemePropsVars } from '@synerise/ds-core';
2
3
  export type ColumnType = string | 'text' | 'number' | 'date' | 'boolean' | 'list';
3
4
  export type Column = {
4
5
  id: string;
5
- key: React.ReactText;
6
+ key: ReactText;
6
7
  name: string;
7
8
  visible: boolean;
8
9
  type: ColumnType;
@@ -17,9 +18,7 @@ export type ColumnProps = {
17
18
  searchQuery?: string;
18
19
  item: Column;
19
20
  texts: {
20
- [k: string]: string | React.ReactNode;
21
- };
22
- theme: {
23
- [k: string]: string;
21
+ [k: string]: ReactNode;
24
22
  };
23
+ theme: ThemePropsVars;
25
24
  };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  declare const _default: React.ForwardRefExoticComponent<{
3
3
  draggable?: boolean | undefined;
4
- children?: React.ReactNode;
5
4
  texts: {
6
5
  [k: string]: React.ReactNode;
7
6
  };
@@ -1,12 +1,11 @@
1
1
  var _excluded = ["item", "theme", "setFixed", "switchAction", "draggable", "searchQuery", "texts", "showGroupSettings"];
2
2
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
3
- import React from 'react';
4
- import Icon, { CheckS, DividerM, DragHandleM, Grid4M, Grid5M, OptionHorizontalM, PinM, VarTypeBooleanM, VarTypeDateM, VarTypeListM, VarTypeNumberM, VarTypeStringM } from '@synerise/ds-icon';
5
- import Switch from '@synerise/ds-switch/dist/Switch';
3
+ import React, { useMemo } from 'react';
6
4
  import { withTheme } from 'styled-components';
5
+ import Icon, { CheckS, DividerM, DragHandleM, Grid4M, Grid5M, OptionHorizontalM, PinM, VarTypeBooleanM, VarTypeDateM, VarTypeListM, VarTypeNumberM, VarTypeStringM } from '@synerise/ds-icon';
6
+ import Switch from '@synerise/ds-switch';
7
7
  import Dropdown from '@synerise/ds-dropdown';
8
8
  import Button from '@synerise/ds-button';
9
- import Menu from '@synerise/ds-menu';
10
9
  import { escapeRegEx } from '@synerise/ds-utils';
11
10
  import Tooltip from '@synerise/ds-tooltip';
12
11
  import * as S from './ColumnManagerItem.styles';
@@ -31,7 +30,7 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
31
30
  texts = _ref.texts,
32
31
  showGroupSettings = _ref.showGroupSettings,
33
32
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
34
- var columnName = React.useMemo(function () {
33
+ var columnName = useMemo(function () {
35
34
  if (searchQuery) {
36
35
  var escapedQuery = escapeRegEx(searchQuery);
37
36
  var startOfQuery = item.name.toLowerCase().search(escapedQuery.toLowerCase());
@@ -40,8 +39,8 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
40
39
  }
41
40
  return item.name;
42
41
  }, [item.name, searchQuery]);
43
- var fixedMenu = function fixedMenu() {
44
- return /*#__PURE__*/React.createElement(S.FixedMenu, null, /*#__PURE__*/React.createElement(Menu.Item, {
42
+ var menuDataSource = useMemo(function () {
43
+ return [{
45
44
  onClick: function onClick() {
46
45
  return setFixed(item.id, FIXED_TYPES.left);
47
46
  },
@@ -52,8 +51,9 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
52
51
  suffixel: item.fixed === FIXED_TYPES.left && /*#__PURE__*/React.createElement(Icon, {
53
52
  component: /*#__PURE__*/React.createElement(CheckS, null),
54
53
  color: theme.palette['green-600']
55
- })
56
- }, texts.fixedLeft), /*#__PURE__*/React.createElement(Menu.Item, {
54
+ }),
55
+ text: texts.fixedLeft
56
+ }, {
57
57
  onClick: function onClick() {
58
58
  return setFixed(item.id, FIXED_TYPES.right);
59
59
  },
@@ -64,8 +64,9 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
64
64
  suffixel: item.fixed === FIXED_TYPES.right && /*#__PURE__*/React.createElement(Icon, {
65
65
  component: /*#__PURE__*/React.createElement(CheckS, null),
66
66
  color: theme.palette['green-600']
67
- })
68
- }, texts.fixedRight), /*#__PURE__*/React.createElement(Menu.Item, {
67
+ }),
68
+ text: texts.fixedRight
69
+ }, {
69
70
  onClick: function onClick() {
70
71
  return showGroupSettings(item);
71
72
  },
@@ -76,9 +77,10 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
76
77
  suffixel: item.group && /*#__PURE__*/React.createElement(Icon, {
77
78
  component: /*#__PURE__*/React.createElement(CheckS, null),
78
79
  color: theme.palette['green-600']
79
- })
80
- }, texts.group));
81
- };
80
+ }),
81
+ text: texts.group
82
+ }];
83
+ }, [item, setFixed, showGroupSettings, texts.fixedLeft, texts.fixedRight, texts.group, theme.palette]);
82
84
  return /*#__PURE__*/React.createElement(S.ColumnManagerItem, rest, /*#__PURE__*/React.createElement(S.ItemPart, {
83
85
  align: "left"
84
86
  }, draggable && /*#__PURE__*/React.createElement(S.DragHandler, {
@@ -100,7 +102,9 @@ var ColumnManagerItem = function ColumnManagerItem(_ref) {
100
102
  component: /*#__PURE__*/React.createElement(PinM, null),
101
103
  color: theme.palette['grey-400']
102
104
  })), item.visible && /*#__PURE__*/React.createElement(Dropdown, {
103
- overlay: fixedMenu()
105
+ overlay: /*#__PURE__*/React.createElement(S.FixedMenu, {
106
+ dataSource: menuDataSource
107
+ })
104
108
  }, /*#__PURE__*/React.createElement(Button, {
105
109
  type: "ghost",
106
110
  mode: "single-icon"
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { Props } from './ColumManagerResults.types';
3
- declare const ColumnManagerSearchResults: React.FC<Props>;
3
+ declare const ColumnManagerSearchResults: ({ searchResults, searchQuery, setFixed, switchAction, texts, showGroupSettings, }: Props) => React.JSX.Element;
4
4
  export default ColumnManagerSearchResults;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-column-manager",
3
- "version": "0.13.5",
3
+ "version": "0.13.6",
4
4
  "description": "ColumnManager UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -31,23 +31,23 @@
31
31
  "sideEffects": false,
32
32
  "types": "dist/index.d.ts",
33
33
  "dependencies": {
34
- "@synerise/ds-alert": "^0.8.40",
35
- "@synerise/ds-button": "^0.21.21",
34
+ "@synerise/ds-alert": "^0.8.41",
35
+ "@synerise/ds-button": "^0.22.0",
36
36
  "@synerise/ds-drawer": "^0.6.31",
37
- "@synerise/ds-dropdown": "^0.18.26",
37
+ "@synerise/ds-dropdown": "^0.18.27",
38
38
  "@synerise/ds-icon": "^0.68.0",
39
- "@synerise/ds-input": "^0.24.16",
40
- "@synerise/ds-input-number": "^0.10.17",
41
- "@synerise/ds-item-filter": "^0.9.5",
42
- "@synerise/ds-menu": "^0.20.8",
43
- "@synerise/ds-modal": "^0.17.53",
44
- "@synerise/ds-result": "^0.7.16",
39
+ "@synerise/ds-input": "^0.24.17",
40
+ "@synerise/ds-input-number": "^0.10.18",
41
+ "@synerise/ds-item-filter": "^0.9.6",
42
+ "@synerise/ds-menu": "^0.20.9",
43
+ "@synerise/ds-modal": "^0.17.54",
44
+ "@synerise/ds-result": "^0.7.17",
45
45
  "@synerise/ds-scrollbar": "^0.11.21",
46
- "@synerise/ds-search-bar": "^0.7.4",
47
- "@synerise/ds-select": "^0.16.28",
48
- "@synerise/ds-switch": "^0.6.26",
49
- "@synerise/ds-tooltip": "^0.14.51",
50
- "@synerise/ds-typography": "^0.16.8",
46
+ "@synerise/ds-search-bar": "^0.7.5",
47
+ "@synerise/ds-select": "^0.16.29",
48
+ "@synerise/ds-switch": "^0.6.27",
49
+ "@synerise/ds-tooltip": "^0.14.52",
50
+ "@synerise/ds-typography": "^0.16.9",
51
51
  "@synerise/ds-utils": "^0.31.2",
52
52
  "react-sortablejs": "^6.0.0",
53
53
  "uuid": "^8.3.2"
@@ -59,5 +59,5 @@
59
59
  "react-intl": ">=3.12.0 <= 6.8",
60
60
  "styled-components": "5.0.1"
61
61
  },
62
- "gitHead": "9ebd107163650754a5f55680d62d30812d740084"
62
+ "gitHead": "03c0625fb7b5baaa35f6633a425fb803469b6a20"
63
63
  }