@cashub/ui 0.40.4 → 0.40.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/package.json +1 -1
- package/table/InfiniteGridTable.js +24 -12
- package/table/__mock__/columns.js +3 -1
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ var _Resizer = _interopRequireDefault(require("./subComponent/Resizer"));
|
|
|
13
13
|
var _Popover = _interopRequireDefault(require("../popover/Popover"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
16
|
-
const _excluded = ["title", "fieldName", "render", "custom"];
|
|
16
|
+
const _excluded = ["title", "fieldName", "render", "custom", "width"];
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
18
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
19
19
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
@@ -101,7 +101,7 @@ const InfiniteGridTable = _ref => {
|
|
|
101
101
|
return previous.map((column, index) => {
|
|
102
102
|
if (index === targetIndex) {
|
|
103
103
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
104
|
-
width
|
|
104
|
+
width: "".concat(width, "px")
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
return _objectSpread({}, column);
|
|
@@ -188,7 +188,8 @@ const InfiniteGridTable = _ref => {
|
|
|
188
188
|
title,
|
|
189
189
|
fieldName,
|
|
190
190
|
render,
|
|
191
|
-
custom
|
|
191
|
+
custom,
|
|
192
|
+
width
|
|
192
193
|
} = column,
|
|
193
194
|
props = _objectWithoutProperties(column, _excluded);
|
|
194
195
|
const key = rowIndex + columnIndex.toString();
|
|
@@ -206,7 +207,8 @@ const InfiniteGridTable = _ref => {
|
|
|
206
207
|
}
|
|
207
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TD, _objectSpread(_objectSpread({
|
|
208
209
|
"data-label": title,
|
|
209
|
-
backgroundReverse: backgroundReverse
|
|
210
|
+
backgroundReverse: backgroundReverse,
|
|
211
|
+
$width: width
|
|
210
212
|
}, props), {}, {
|
|
211
213
|
children: renderedData
|
|
212
214
|
}), columnIndex);
|
|
@@ -294,26 +296,36 @@ const TableWrapper = _styledComponents.default.div(_templateObject || (_template
|
|
|
294
296
|
return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
|
|
295
297
|
});
|
|
296
298
|
const ResponsiveTable = _styledComponents.default.table(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* make fixed width work */\n position: relative;\n width: 0px;\n color: var(--font-on-background);\n table-layout: fixed;\n border-collapse: collapse;\n"])));
|
|
297
|
-
const TD = _styledComponents.default.td(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 48px;\n padding: 0 var(--spacing-xs);\n border-top: 1px solid var(--border-color);\n border-right: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n text-align: ", ";\n background: ", ";\n\n &:last-child {\n border-right: none;\n padding: 0;\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"])), _ref3 => {
|
|
299
|
+
const TD = _styledComponents.default.td(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n max-width: ", ";\n height: 48px;\n padding: 0 var(--spacing-xs);\n border-top: 1px solid var(--border-color);\n border-right: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n text-align: ", ";\n background: ", ";\n\n &:last-child {\n border-right: none;\n padding: 0;\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"])), _ref3 => {
|
|
298
300
|
let {
|
|
299
|
-
|
|
301
|
+
$width
|
|
300
302
|
} = _ref3;
|
|
301
|
-
return
|
|
303
|
+
return $width;
|
|
302
304
|
}, _ref4 => {
|
|
303
305
|
let {
|
|
304
|
-
|
|
306
|
+
$width
|
|
305
307
|
} = _ref4;
|
|
308
|
+
return $width;
|
|
309
|
+
}, _ref5 => {
|
|
310
|
+
let {
|
|
311
|
+
center
|
|
312
|
+
} = _ref5;
|
|
313
|
+
return center ? 'center' : 'left';
|
|
314
|
+
}, _ref6 => {
|
|
315
|
+
let {
|
|
316
|
+
backgroundReverse
|
|
317
|
+
} = _ref6;
|
|
306
318
|
return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
|
|
307
319
|
});
|
|
308
|
-
const Scrollbar = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: sticky;\n bottom: 0;\n width: 100%;\n overflow: auto;\n background: ", ";\n\n ::before {\n display: block;\n content: '';\n width: ", ";\n height: 1px;\n }\n\n ", "\n"])),
|
|
320
|
+
const Scrollbar = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: sticky;\n bottom: 0;\n width: 100%;\n overflow: auto;\n background: ", ";\n\n ::before {\n display: block;\n content: '';\n width: ", ";\n height: 1px;\n }\n\n ", "\n"])), _ref7 => {
|
|
309
321
|
let {
|
|
310
322
|
backgroundReverse
|
|
311
|
-
} =
|
|
323
|
+
} = _ref7;
|
|
312
324
|
return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
|
|
313
|
-
},
|
|
325
|
+
}, _ref8 => {
|
|
314
326
|
let {
|
|
315
327
|
width
|
|
316
|
-
} =
|
|
328
|
+
} = _ref8;
|
|
317
329
|
return "".concat(width, "px");
|
|
318
330
|
}, (0, _scrollbar.default)({
|
|
319
331
|
size: 'large'
|
|
@@ -10,11 +10,13 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
const columns = [{
|
|
11
11
|
title: 'Name',
|
|
12
12
|
fieldName: 'name',
|
|
13
|
-
sortable: true
|
|
13
|
+
sortable: true,
|
|
14
|
+
width: '400px'
|
|
14
15
|
}, {
|
|
15
16
|
title: 'Tag',
|
|
16
17
|
fieldName: 'tag',
|
|
17
18
|
sortable: false,
|
|
19
|
+
width: '150px',
|
|
18
20
|
render(data) {
|
|
19
21
|
return data.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_badge.Badge, {
|
|
20
22
|
style: {
|