@synerise/ds-cruds 0.3.42 → 0.4.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.
- package/CHANGELOG.md +19 -0
- package/dist/Cruds.js +21 -3
- package/dist/Cruds.styles.d.ts +3 -1
- package/dist/Cruds.styles.js +5 -3
- package/dist/Cruds.types.d.ts +19 -13
- package/dist/SingleAction.js +2 -0
- package/dist/SingleAction.types.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.4.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cruds@0.3.43...@synerise/ds-cruds@0.4.0) (2023-12-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **filter:** reorder cruds in filter step conditions ([8d4019b](https://github.com/Synerise/synerise-design/commit/8d4019b49c7579000e093aabbcd31a75626d9c1c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.3.43](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cruds@0.3.42...@synerise/ds-cruds@0.3.43) (2023-12-13)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-cruds
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.3.42](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cruds@0.3.41...@synerise/ds-cruds@0.3.42) (2023-12-11)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-cruds
|
package/dist/Cruds.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var _excluded = ["onDelete", "onAdd", "onEdit", "onDuplicate", "onMove", "onRemove", "addTooltip", "editTooltip", "duplicateTooltip", "removeTooltip", "moveTooltip", "deleteTooltip"];
|
|
1
|
+
var _excluded = ["onDelete", "onAdd", "onEdit", "onDuplicate", "onMove", "onRemove", "onMoveUp", "onMoveDown", "moveDownInactive", "moveUpInactive", "addTooltip", "editTooltip", "duplicateTooltip", "removeTooltip", "moveTooltip", "moveUpTooltip", "moveDownTooltip", "deleteTooltip"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import { AddS, CloseS, DragHandleM, DuplicateS, EditS, TrashS } from '@synerise/ds-icon';
|
|
8
|
+
import { AddS, CloseS, DragHandleM, DuplicateS, EditS, TrashS, ArrowDownS, ArrowUpS } from '@synerise/ds-icon';
|
|
9
9
|
import * as S from './Cruds.styles';
|
|
10
10
|
import SingleAction from './SingleAction';
|
|
11
11
|
|
|
@@ -16,17 +16,35 @@ var Cruds = function Cruds(_ref) {
|
|
|
16
16
|
onDuplicate = _ref.onDuplicate,
|
|
17
17
|
onMove = _ref.onMove,
|
|
18
18
|
onRemove = _ref.onRemove,
|
|
19
|
+
onMoveUp = _ref.onMoveUp,
|
|
20
|
+
onMoveDown = _ref.onMoveDown,
|
|
21
|
+
moveDownInactive = _ref.moveDownInactive,
|
|
22
|
+
moveUpInactive = _ref.moveUpInactive,
|
|
19
23
|
addTooltip = _ref.addTooltip,
|
|
20
24
|
editTooltip = _ref.editTooltip,
|
|
21
25
|
duplicateTooltip = _ref.duplicateTooltip,
|
|
22
26
|
removeTooltip = _ref.removeTooltip,
|
|
23
27
|
moveTooltip = _ref.moveTooltip,
|
|
28
|
+
moveUpTooltip = _ref.moveUpTooltip,
|
|
29
|
+
moveDownTooltip = _ref.moveDownTooltip,
|
|
24
30
|
deleteTooltip = _ref.deleteTooltip,
|
|
25
31
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
26
32
|
|
|
27
33
|
return /*#__PURE__*/React.createElement(S.CrudsContainer, _extends({
|
|
28
34
|
className: "ds-cruds"
|
|
29
|
-
}, rest),
|
|
35
|
+
}, rest), onMoveUp && /*#__PURE__*/React.createElement(SingleAction, {
|
|
36
|
+
title: moveUpTooltip,
|
|
37
|
+
inactive: moveUpInactive,
|
|
38
|
+
className: "moveup",
|
|
39
|
+
onClick: onMoveUp,
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(ArrowUpS, null)
|
|
41
|
+
}), onMoveDown && /*#__PURE__*/React.createElement(SingleAction, {
|
|
42
|
+
title: moveDownTooltip,
|
|
43
|
+
inactive: moveDownInactive,
|
|
44
|
+
className: "movedown",
|
|
45
|
+
onClick: onMoveDown,
|
|
46
|
+
icon: /*#__PURE__*/React.createElement(ArrowDownS, null)
|
|
47
|
+
}), onAdd && /*#__PURE__*/React.createElement(SingleAction, {
|
|
30
48
|
title: addTooltip,
|
|
31
49
|
className: "add",
|
|
32
50
|
onClick: onAdd,
|
package/dist/Cruds.styles.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const CrudsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
inactive?: boolean | undefined;
|
|
4
|
+
}, never>;
|
package/dist/Cruds.styles.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
2
|
export var CrudsContainer = styled.div.withConfig({
|
|
3
3
|
displayName: "Crudsstyles__CrudsContainer",
|
|
4
4
|
componentId: "sc-14u9591-0"
|
|
5
|
-
})(["display:flex;height:24px;cursor:pointer;.add,.duplicate,.edit,.move{svg{fill:", ";}}.add:hover,.duplicate:hover,.edit:hover,.move:hover{svg{fill:", ";}}.delete,.remove{svg{fill:", ";}}"], function (props) {
|
|
5
|
+
})(["display:flex;height:24px;cursor:pointer;.add,.duplicate,.edit,.move,.moveup,.movedown{svg{fill:", ";}}.add:hover,.duplicate:hover,.edit:hover,.move:hover,.moveup:hover,.movedown:hover{svg{fill:", ";}}.delete,.remove{svg{fill:", ";}}"], function (props) {
|
|
6
6
|
return props.theme.palette['grey-600'];
|
|
7
7
|
}, function (props) {
|
|
8
8
|
return props.theme.palette['blue-600'];
|
|
@@ -12,4 +12,6 @@ export var CrudsContainer = styled.div.withConfig({
|
|
|
12
12
|
export var IconWrapper = styled.div.withConfig({
|
|
13
13
|
displayName: "Crudsstyles__IconWrapper",
|
|
14
14
|
componentId: "sc-14u9591-1"
|
|
15
|
-
})([""])
|
|
15
|
+
})(["", ""], function (props) {
|
|
16
|
+
return Boolean(props.inactive) && css(["&&,&&:hover{cursor:default;svg{pointer-events:none;fill:", ";}}"], props.theme.palette['grey-300']);
|
|
17
|
+
});
|
package/dist/Cruds.types.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import SingleAction from './SingleAction';
|
|
3
3
|
export interface CrudsProps {
|
|
4
|
-
addTooltip?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
addTooltip?: ReactNode;
|
|
5
|
+
moveUpTooltip?: ReactNode;
|
|
6
|
+
moveDownTooltip?: ReactNode;
|
|
7
|
+
moveUpInactive?: boolean;
|
|
8
|
+
moveDownInactive?: boolean;
|
|
9
|
+
editTooltip?: ReactNode;
|
|
10
|
+
duplicateTooltip?: ReactNode;
|
|
11
|
+
removeTooltip?: ReactNode;
|
|
12
|
+
moveTooltip?: ReactNode;
|
|
13
|
+
deleteTooltip?: ReactNode;
|
|
14
|
+
onDelete?: (event?: MouseEvent<HTMLElement>) => void;
|
|
15
|
+
onAdd?: (event?: MouseEvent<HTMLElement>) => void;
|
|
16
|
+
onEdit?: (event?: MouseEvent<HTMLElement>) => void;
|
|
17
|
+
onDuplicate?: (event?: MouseEvent<HTMLElement>) => void;
|
|
18
|
+
onMove?: (event?: MouseEvent<HTMLElement>) => void;
|
|
19
|
+
onMoveUp?: (event?: MouseEvent<HTMLElement>) => void;
|
|
20
|
+
onMoveDown?: (event?: MouseEvent<HTMLElement>) => void;
|
|
21
|
+
onRemove?: (event?: MouseEvent<HTMLElement>) => void;
|
|
16
22
|
}
|
|
17
23
|
export type CrudsSubComponents = {
|
|
18
24
|
CustomAction: typeof SingleAction;
|
package/dist/SingleAction.js
CHANGED
|
@@ -5,6 +5,7 @@ import * as S from './Cruds.styles';
|
|
|
5
5
|
|
|
6
6
|
var SingleAction = function SingleAction(_ref) {
|
|
7
7
|
var title = _ref.title,
|
|
8
|
+
inactive = _ref.inactive,
|
|
8
9
|
className = _ref.className,
|
|
9
10
|
_onClick = _ref.onClick,
|
|
10
11
|
icon = _ref.icon,
|
|
@@ -12,6 +13,7 @@ var SingleAction = function SingleAction(_ref) {
|
|
|
12
13
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
13
14
|
title: title
|
|
14
15
|
}, /*#__PURE__*/React.createElement(S.IconWrapper, {
|
|
16
|
+
inactive: inactive,
|
|
15
17
|
className: className,
|
|
16
18
|
onClick: function onClick(e) {
|
|
17
19
|
!!e && e.stopPropagation();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-cruds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Cruds UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-icon": "^0.58.
|
|
37
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
36
|
+
"@synerise/ds-icon": "^0.58.9",
|
|
37
|
+
"@synerise/ds-tooltip": "^0.14.13"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@synerise/ds-core": "*",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"styled-components": "5.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@synerise/ds-utils": "^0.24.
|
|
45
|
+
"@synerise/ds-utils": "^0.24.23",
|
|
46
46
|
"@testing-library/jest-dom": "5.1.1",
|
|
47
47
|
"@testing-library/react": "10.0.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "0a23e5f431033a6180383d3e0e19e885b5a66778"
|
|
50
50
|
}
|