@cashub/ui 0.14.1 → 0.14.3

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.
@@ -25,11 +25,7 @@ var CropperWrapper = function CropperWrapper(_ref) {
25
25
  cropBoxResizable = _ref$cropBoxResizable === void 0 ? false : _ref$cropBoxResizable,
26
26
  onInitialized = _ref.onInitialized,
27
27
  _ref$dragMode = _ref.dragMode,
28
- dragMode = _ref$dragMode === void 0 ? 'move' : _ref$dragMode,
29
- minCroppedWidth = _ref.minCroppedWidth,
30
- minCroppedHeight = _ref.minCroppedHeight,
31
- maxCroppedWidth = _ref.maxCroppedWidth,
32
- maxCroppedHeight = _ref.maxCroppedHeight;
28
+ dragMode = _ref$dragMode === void 0 ? 'move' : _ref$dragMode;
33
29
  var imageRef = (0, _react.useRef)(null);
34
30
  (0, _react.useEffect)(function () {
35
31
  var node = imageRef.current;
@@ -41,25 +37,9 @@ var CropperWrapper = function CropperWrapper(_ref) {
41
37
  initialAspectRatio: 9 / 16,
42
38
  background: true,
43
39
  cropBoxResizable: cropBoxResizable,
44
- minCroppedWidth: minCroppedWidth,
45
- minCroppedHeight: minCroppedHeight,
46
- maxCroppedWidth: maxCroppedWidth,
47
- maxCroppedHeight: maxCroppedHeight,
48
40
  data: {
49
41
  width: width,
50
42
  height: height
51
- },
52
- crop: function crop() {
53
- var _cropper$getCropBoxDa = cropper.getCropBoxData(),
54
- width = _cropper$getCropBoxDa.width,
55
- height = _cropper$getCropBoxDa.height;
56
-
57
- if (width < minCroppedWidth || height < minCroppedHeight || width > maxCroppedWidth || height > maxCroppedHeight) {
58
- cropper.setCropBoxData({
59
- width: Math.max(minCroppedWidth, Math.min(maxCroppedWidth, width)),
60
- height: Math.max(minCroppedHeight, Math.min(maxCroppedHeight, height))
61
- });
62
- }
63
43
  }
64
44
  });
65
45
 
@@ -73,7 +53,7 @@ var CropperWrapper = function CropperWrapper(_ref) {
73
53
 
74
54
  node === null || node === void 0 ? void 0 : (_node$cropper = node.cropper) === null || _node$cropper === void 0 ? void 0 : _node$cropper.destroy();
75
55
  };
76
- }, [onInitialized, dragMode, width, height, cropBoxResizable, minCroppedWidth, minCroppedHeight, maxCroppedWidth, maxCroppedHeight]);
56
+ }, [onInitialized, dragMode, width, height, cropBoxResizable]);
77
57
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
78
58
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
79
59
  src: src,
@@ -21,11 +21,7 @@ var CropperModalHandler = function CropperModalHandler(_ref) {
21
21
  _ref$cropBoxResizable = _ref.cropBoxResizable,
22
22
  cropBoxResizable = _ref$cropBoxResizable === void 0 ? false : _ref$cropBoxResizable,
23
23
  onCrop = _ref.onCrop,
24
- _onClose = _ref.onClose,
25
- minCroppedWidth = _ref.minCroppedWidth,
26
- minCroppedHeight = _ref.minCroppedHeight,
27
- maxCroppedWidth = _ref.maxCroppedWidth,
28
- maxCroppedHeight = _ref.maxCroppedHeight;
24
+ _onClose = _ref.onClose;
29
25
  (0, _TitleModal.default)({
30
26
  size: 'normal',
31
27
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CropImageModal.default, {
@@ -37,11 +33,7 @@ var CropperModalHandler = function CropperModalHandler(_ref) {
37
33
  height: height,
38
34
  cropBoxResizable: cropBoxResizable,
39
35
  onCrop: onCrop,
40
- onClose: _onClose,
41
- minCroppedWidth: minCroppedWidth,
42
- minCroppedHeight: minCroppedHeight,
43
- maxCroppedWidth: maxCroppedWidth,
44
- maxCroppedHeight: maxCroppedHeight
36
+ onClose: _onClose
45
37
  }),
46
38
  onClose: function onClose(dismiss) {
47
39
  if (dismiss === true && _onClose) {
@@ -45,11 +45,7 @@ var CropImageModal = function CropImageModal(_ref) {
45
45
  cropBoxResizable = _ref$cropBoxResizable === void 0 ? false : _ref$cropBoxResizable,
46
46
  onCrop = _ref.onCrop,
47
47
  onClose = _ref.onClose,
48
- close = _ref.close,
49
- minCroppedWidth = _ref.minCroppedWidth,
50
- minCroppedHeight = _ref.minCroppedHeight,
51
- maxCroppedWidth = _ref.maxCroppedWidth,
52
- maxCroppedHeight = _ref.maxCroppedHeight;
48
+ close = _ref.close;
53
49
 
54
50
  var _useTranslation = (0, _reactI18next.useTranslation)(),
55
51
  t = _useTranslation.t;
@@ -96,11 +92,7 @@ var CropImageModal = function CropImageModal(_ref) {
96
92
  width: width,
97
93
  height: height,
98
94
  cropBoxResizable: cropBoxResizable,
99
- onInitialized: handleInitialized,
100
- minCroppedWidth: minCroppedWidth,
101
- minCroppedHeight: minCroppedHeight,
102
- maxCroppedWidth: maxCroppedWidth,
103
- maxCroppedHeight: maxCroppedHeight
95
+ onInitialized: handleInitialized
104
96
  })
105
97
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TitleModal.default.Footer, {
106
98
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
@@ -54,10 +54,6 @@ var ImageDropzone = function ImageDropzone(_ref) {
54
54
  width = _ref$width === void 0 ? 180 : _ref$width,
55
55
  _ref$height = _ref.height,
56
56
  height = _ref$height === void 0 ? 320 : _ref$height,
57
- minCroppedWidth = _ref.minCroppedWidth,
58
- minCroppedHeight = _ref.minCroppedHeight,
59
- maxCroppedWidth = _ref.maxCroppedWidth,
60
- maxCroppedHeight = _ref.maxCroppedHeight,
61
57
  _ref$fixedSize = _ref.fixedSize,
62
58
  fixedSize = _ref$fixedSize === void 0 ? true : _ref$fixedSize,
63
59
  maxFiles = _ref.maxFiles,
@@ -186,10 +182,6 @@ var ImageDropzone = function ImageDropzone(_ref) {
186
182
  src: file.url,
187
183
  width: width,
188
184
  height: height,
189
- minCroppedWidth: minCroppedWidth,
190
- minCroppedHeight: minCroppedHeight,
191
- maxCroppedWidth: maxCroppedWidth,
192
- maxCroppedHeight: maxCroppedHeight,
193
185
  cropBoxResizable: cropper.cropBoxResizable ? cropper.cropBoxResizable : false,
194
186
  onCrop: function onCrop(croppedSrc) {
195
187
  var croppedImageFile = (0, _utils.dataURLtoFile)(croppedSrc, file.name);
@@ -203,7 +195,7 @@ var ImageDropzone = function ImageDropzone(_ref) {
203
195
  });
204
196
  }
205
197
  });
206
- }, [width, height, cropper, minCroppedWidth, minCroppedHeight, maxCroppedWidth, maxCroppedHeight]);
198
+ }, [width, height, cropper]);
207
199
 
208
200
  var previewItem = function previewItem() {
209
201
  return files.map(function (file, index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.14.1",
3
+ "version": "0.14.3",
4
4
  "private": false,
5
5
  "author": "CASHUB Team",
6
6
  "description": "CASHUB UI components library",
package/table/Table.js CHANGED
@@ -304,7 +304,7 @@ var BodyTR = _styledComponents.default.tr(_templateObject4 || (_templateObject4
304
304
  return noData && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 168px;\n\n > td {\n &:first-child:before {\n display: none;\n }\n }\n "])));
305
305
  }));
306
306
 
307
- var TableDataCell = _styledComponents.default.td(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n height: 48px;\n background: ", ";\n padding: 0 var(--spacing-xs);\n max-width: 0px;\n text-align: ", ";\n vertical-align: middle;\n border-top: var(--border-width) solid transparent;\n border-bottom: var(--border-width) solid transparent;\n transition: border-color 0.3s;\n\n &:first-child {\n border-left: var(--border-width) solid transparent;\n border-top-left-radius: var(--border-radius-l);\n border-bottom-left-radius: var(--border-radius-l);\n padding-left: var(--spacing);\n }\n\n &:last-child {\n border-right: var(--border-width) solid transparent;\n border-top-right-radius: var(--border-radius-l);\n border-bottom-right-radius: var(--border-radius-l);\n padding-right: var(--spacing);\n }\n\n > span {\n display: inline-block;\n width: 100%;\n padding: 0 2px;\n overflow: hidden;\n white-space: pre;\n text-overflow: ellipsis;\n }\n\n ", "\n\n ", "\n"])), function (_ref8) {
307
+ var TableDataCell = _styledComponents.default.td(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n height: 48px;\n background: ", ";\n padding: 0 var(--spacing-xs);\n max-width: 0px;\n text-align: ", ";\n vertical-align: middle;\n border-top: var(--border-width) solid transparent;\n border-bottom: var(--border-width) solid transparent;\n transition: border-color 0.3s;\n\n &:first-child {\n border-left: var(--border-width) solid transparent;\n border-top-left-radius: var(--border-radius-l);\n border-bottom-left-radius: var(--border-radius-l);\n padding-left: var(--spacing);\n }\n\n &:last-child {\n border-right: var(--border-width) solid transparent;\n border-top-right-radius: var(--border-radius-l);\n border-bottom-right-radius: var(--border-radius-l);\n padding-right: var(--spacing);\n }\n\n > span {\n display: inline-block;\n width: 100%;\n overflow: hidden;\n white-space: pre;\n text-overflow: ellipsis;\n }\n\n ", "\n\n ", "\n"])), function (_ref8) {
308
308
  var backgroundReverse = _ref8.backgroundReverse;
309
309
  return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
310
310
  }, function (_ref9) {
@@ -9,7 +9,7 @@ exports.default = void 0;
9
9
 
10
10
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
11
 
12
- var _templateObject, _templateObject2;
12
+ var _templateObject, _templateObject2, _templateObject3;
13
13
 
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
 
@@ -17,18 +17,18 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
17
17
 
18
18
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
19
19
 
20
- var BaseTableHeadCell = _styledComponents.default.th(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n font-size: var(--font-body1);\n font-weight: var(--font-bold);\n width: ", ";\n padding: var(--spacing-s) var(--spacing-xs);\n\n > div {\n display: flex;\n\n > span {\n max-width: calc(100% - 0.5rem - 1rem);\n padding-right: var(--spacing-xs);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n\n ", "\n\n ", "\n"])), function (_ref) {
20
+ var BaseTableHeadCell = _styledComponents.default.th(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n font-size: var(--font-body1);\n font-weight: var(--font-bold);\n width: ", ";\n padding: var(--spacing-s) var(--spacing-xs);\n\n > div {\n display: flex;\n\n > span {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n\n ", "\n\n ", "\n"])), function (_ref) {
21
21
  var width = _ref.width;
22
22
  return width || 'auto';
23
23
  }, function (_ref2) {
24
24
  var sortable = _ref2.sortable;
25
- return sortable && 'cursor: pointer;';
25
+ return sortable && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n > div > span {\n max-width: calc(100% - 1rem);\n padding-right: var(--spacing-xs);\n }\n "])));
26
26
  }, function (_ref3) {
27
27
  var align = _ref3.align;
28
28
 
29
29
  switch (align) {
30
30
  case 'center':
31
- return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n > div {\n justify-content: center;\n }\n "])));
31
+ return (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n > div {\n justify-content: center;\n }\n "])));
32
32
 
33
33
  default:
34
34
  break;
@@ -15,6 +15,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
 
16
16
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
17
17
 
18
- var TableHeadCell = (0, _styledComponents.default)(_BaseTableHeadCell.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-width: 0px;\n\n &:first-child {\n padding-left: var(--spacing);\n }\n\n &:last-child {\n padding-right: var(--spacing);\n }\n"])));
18
+ var TableHeadCell = (0, _styledComponents.default)(_BaseTableHeadCell.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:first-child {\n padding-left: var(--spacing);\n }\n\n &:last-child {\n padding-right: var(--spacing);\n }\n"])));
19
19
  var _default = TableHeadCell;
20
20
  exports.default = _default;