sag_components 1.0.11 → 1.0.13
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.
|
@@ -11,14 +11,19 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _OneColumnContainer = require("../OneColumnContainer.style");
|
|
13
13
|
var _InfoIcon = require("./InfoIcon");
|
|
14
|
-
var
|
|
14
|
+
var _core = require("@dnd-kit/core");
|
|
15
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
|
+
var _excluded = ["children", "itemClass", "overStyle", "draggingStyle", "droppedStyle", "refId", "width", "height", "infoText"];
|
|
15
17
|
/**
|
|
16
18
|
* Primary UI component for user interaction
|
|
17
19
|
*/
|
|
18
20
|
var OneColumnContainer = function OneColumnContainer(_ref) {
|
|
19
21
|
var children = _ref.children,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
itemClass = _ref.itemClass,
|
|
23
|
+
overStyle = _ref.overStyle,
|
|
24
|
+
draggingStyle = _ref.draggingStyle,
|
|
25
|
+
droppedStyle = _ref.droppedStyle,
|
|
26
|
+
refId = _ref.refId,
|
|
22
27
|
width = _ref.width,
|
|
23
28
|
height = _ref.height,
|
|
24
29
|
infoText = _ref.infoText,
|
|
@@ -27,15 +32,28 @@ var OneColumnContainer = function OneColumnContainer(_ref) {
|
|
|
27
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
33
|
clicked = _useState2[0],
|
|
29
34
|
setClicked = _useState2[1];
|
|
35
|
+
var _useDroppable = (0, _core.useDroppable)({
|
|
36
|
+
refId: refId
|
|
37
|
+
}),
|
|
38
|
+
isOver = _useDroppable.isOver,
|
|
39
|
+
setNodeRef = _useDroppable.setNodeRef;
|
|
30
40
|
var onInfoClick = function onInfoClick() {
|
|
31
41
|
setClicked(!clicked);
|
|
32
42
|
};
|
|
33
43
|
return /*#__PURE__*/_react.default.createElement(_OneColumnContainer.StyledContainer, {
|
|
34
|
-
className:
|
|
35
|
-
ref:
|
|
44
|
+
className: (0, _classnames.default)(itemClass, overStyle, draggingStyle, droppedStyle),
|
|
45
|
+
ref: setNodeRef,
|
|
36
46
|
width: width,
|
|
37
47
|
height: height
|
|
38
|
-
}, children
|
|
48
|
+
}, children, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextContainer, {
|
|
49
|
+
clicked: clicked,
|
|
50
|
+
width: width,
|
|
51
|
+
height: height
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextLabel, null, infoText)), /*#__PURE__*/_react.default.createElement(_OneColumnContainer.IconContainer, {
|
|
53
|
+
onClick: onInfoClick
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, {
|
|
55
|
+
clicked: clicked
|
|
56
|
+
})));
|
|
39
57
|
};
|
|
40
58
|
exports.OneColumnContainer = OneColumnContainer;
|
|
41
59
|
OneColumnContainer.defaultProps = {};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sag_components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "react-scripts start",
|
|
8
8
|
"build": "cross-env BABEL_ENV=production babel src -d dist",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"styled-components": "^5.3.10"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@dnd-kit/core": "^6.0.8",
|
|
42
43
|
"@emotion/react": "^11.11.0",
|
|
43
44
|
"@emotion/styled": "^11.11.0",
|
|
44
45
|
"@fontsource/roboto": "^4.5.8",
|
|
@@ -47,7 +48,8 @@
|
|
|
47
48
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
48
49
|
"@mui/icons-material": "^5.11.16",
|
|
49
50
|
"@mui/material": "^5.13.0",
|
|
50
|
-
"@mui/styled-engine-sc": "^5.12.0",
|
|
51
|
+
"@mui/styled-engine-sc": "^5.12.0",
|
|
52
|
+
"classnames": "^2.3.2",
|
|
51
53
|
"hoopy": "^0.1.4",
|
|
52
54
|
"react-scripts": "5.0.1"
|
|
53
55
|
},
|
|
@@ -2,26 +2,34 @@ import React from 'react';
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { InfoTextLabel,InfoTextContainer,IconContainer, StyledContainer } from '../OneColumnContainer.style';
|
|
4
4
|
import { InfoIcon } from "./InfoIcon";
|
|
5
|
-
|
|
5
|
+
import { useDroppable, UniqueIdentifier } from "@dnd-kit/core";
|
|
6
|
+
import classNames from "classnames";
|
|
6
7
|
/**
|
|
7
8
|
* Primary UI component for user interaction
|
|
8
9
|
*/
|
|
9
|
-
export const OneColumnContainer = ({ children,
|
|
10
|
+
export const OneColumnContainer = ({ children,itemClass,overStyle,draggingStyle,droppedStyle,refId,width,height,infoText,...props }) => {
|
|
10
11
|
const [clicked, setClicked] = useState(false);
|
|
11
|
-
|
|
12
|
+
const { isOver, setNodeRef } = useDroppable({
|
|
13
|
+
refId,
|
|
14
|
+
});
|
|
12
15
|
const onInfoClick = ()=>{
|
|
13
16
|
setClicked(!clicked)
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
return (
|
|
17
|
-
<StyledContainer className={
|
|
20
|
+
<StyledContainer className={classNames(
|
|
21
|
+
itemClass,
|
|
22
|
+
overStyle,
|
|
23
|
+
draggingStyle,
|
|
24
|
+
droppedStyle
|
|
25
|
+
)} ref={setNodeRef} width={width} height={height}>
|
|
18
26
|
{children}
|
|
19
|
-
|
|
27
|
+
<InfoTextContainer clicked={clicked} width={width} height={height}>
|
|
20
28
|
<InfoTextLabel>{infoText}</InfoTextLabel>
|
|
21
29
|
</InfoTextContainer>
|
|
22
30
|
<IconContainer onClick={onInfoClick}>
|
|
23
31
|
<InfoIcon clicked={clicked} />
|
|
24
|
-
</IconContainer>
|
|
32
|
+
</IconContainer>
|
|
25
33
|
</StyledContainer>
|
|
26
34
|
);
|
|
27
35
|
};
|