@cashub/ui 0.13.13 → 0.14.1
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/modal/StateModal.js +1 -1
- package/modal/TitleModal.js +1 -1
- package/package.json +2 -2
- package/popover/Popover.js +18 -13
- package/table/Table.js +3 -1
package/modal/StateModal.js
CHANGED
|
@@ -67,7 +67,7 @@ var StateModal = function StateModal(_ref) {
|
|
|
67
67
|
var onClose = _ref.onClose,
|
|
68
68
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
69
69
|
|
|
70
|
-
var rootElement = (0, _utils.
|
|
70
|
+
var rootElement = (0, _utils.appendElementTo)('StateModalContainer');
|
|
71
71
|
var Container = document.createElement('div');
|
|
72
72
|
rootElement.appendChild(Container);
|
|
73
73
|
|
package/modal/TitleModal.js
CHANGED
|
@@ -68,7 +68,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
68
68
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
69
69
|
|
|
70
70
|
var TitleModal = function TitleModal(props) {
|
|
71
|
-
var rootElement = (0, _utils.
|
|
71
|
+
var rootElement = (0, _utils.appendElementTo)('TitleModalContainer');
|
|
72
72
|
var Container = document.createElement('div');
|
|
73
73
|
rootElement.appendChild(Container);
|
|
74
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cashub/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "CASHUB Team",
|
|
6
6
|
"description": "CASHUB UI components library",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@cashub/hooks": "^0.2.0",
|
|
14
|
-
"@cashub/utils": "^0.
|
|
14
|
+
"@cashub/utils": "^0.5.0",
|
|
15
15
|
"@popperjs/core": "^2.11.5",
|
|
16
16
|
"@yaireo/tagify": "^4.12.0",
|
|
17
17
|
"brace": "^0.11.1",
|
package/popover/Popover.js
CHANGED
|
@@ -21,9 +21,9 @@ var _utils = require("@cashub/utils");
|
|
|
21
21
|
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
|
|
24
|
-
var _templateObject;
|
|
24
|
+
var _templateObject, _templateObject2;
|
|
25
25
|
|
|
26
|
-
var _excluded = ["id"];
|
|
26
|
+
var _excluded = ["container", "id"];
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
@@ -56,10 +56,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
56
56
|
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; }
|
|
57
57
|
|
|
58
58
|
var Popover = function Popover(_ref) {
|
|
59
|
-
var
|
|
59
|
+
var container = _ref.container,
|
|
60
|
+
id = _ref.id,
|
|
60
61
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
61
62
|
|
|
62
|
-
var rootElement = (0, _utils.
|
|
63
|
+
var rootElement = (0, _utils.appendElementTo)('PopoverContainer', 'div', container);
|
|
63
64
|
|
|
64
65
|
var handleClose = function handleClose() {
|
|
65
66
|
// unmount component and clear event handler and state before remove container
|
|
@@ -105,18 +106,22 @@ var Box = function Box(_ref2) {
|
|
|
105
106
|
handleClose();
|
|
106
107
|
}
|
|
107
108
|
},
|
|
108
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
110
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PopoverBox, _objectSpread(_objectSpread({
|
|
111
|
+
id: id,
|
|
112
|
+
ref: setTooltipElement,
|
|
113
|
+
style: styles.popper
|
|
114
|
+
}, attributes.popper), {}, {
|
|
115
|
+
placement: state && state.placement,
|
|
116
|
+
children: content
|
|
117
|
+
}))
|
|
118
|
+
})
|
|
116
119
|
});
|
|
117
120
|
};
|
|
118
121
|
|
|
119
|
-
var
|
|
122
|
+
var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
123
|
+
|
|
124
|
+
var PopoverBox = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid var(--border-color);\n color: var(--font-on-background);\n background: var(--color-background2);\n box-shadow: var(--box-shadow);\n border-radius: calc(var(--border-radius) / 2);\n padding: var(--spacing-xs);\n z-index: 80;\n font-size: var(--font-body1);\n font-weight: var(--font-normal);\n max-width: 50vw;\n word-break: break-all;\n"])));
|
|
120
125
|
|
|
121
126
|
var _default = Popover;
|
|
122
127
|
exports.default = _default;
|
package/table/Table.js
CHANGED
|
@@ -70,6 +70,7 @@ var Table = function Table(_ref) {
|
|
|
70
70
|
backgroundReverse = _ref.backgroundReverse,
|
|
71
71
|
translation = _ref.translation,
|
|
72
72
|
beforeCreateRow = _ref.beforeCreateRow,
|
|
73
|
+
popoverContainer = _ref.popoverContainer,
|
|
73
74
|
_ref$centerFooter = _ref.centerFooter,
|
|
74
75
|
centerFooter = _ref$centerFooter === void 0 ? false : _ref$centerFooter;
|
|
75
76
|
var tableRef = (0, _react.useRef)(null);
|
|
@@ -112,12 +113,13 @@ var Table = function Table(_ref) {
|
|
|
112
113
|
event.stopPropagation();
|
|
113
114
|
(0, _Popover.default)({
|
|
114
115
|
id: id,
|
|
116
|
+
container: popoverContainer,
|
|
115
117
|
target: event.target,
|
|
116
118
|
content: innerText,
|
|
117
119
|
boundary: tableRef.current
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
|
-
}, []); // generate sort icon area
|
|
122
|
+
}, [popoverContainer]); // generate sort icon area
|
|
121
123
|
|
|
122
124
|
var generateSort = (0, _hooks.useGenerateSort)(sortColumn, sortType);
|
|
123
125
|
var tableHeads = (0, _react.useMemo)(function () {
|