@cashub/ui 0.46.1 → 0.48.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/Tab/TabList.js +38 -26
- package/Tab/TabPanel.js +13 -20
- package/Tab/TabTab.js +36 -24
- package/Tab/index.js +15 -1
- package/Tab/subComponent/TabListV2.js +25 -0
- package/Tab/subComponent/TabPanelV2.js +52 -0
- package/Tab/subComponent/TabTabV2.js +63 -0
- package/VerticalTab/TabList.js +13 -18
- package/VerticalTab/TabPanel.js +16 -20
- package/VerticalTab/TabTab.js +40 -21
- package/VerticalTab/VerticalTab.js +8 -4
- package/alert/Alert.js +12 -5
- package/animate/Collapse.js +5 -7
- package/animate/Loader.js +18 -7
- package/animate/PulseRing.js +18 -5
- package/animate/Spinner.js +8 -3
- package/backdrop/BaseBackdrop.js +9 -3
- package/backdrop/LoadingBackdrop.js +7 -3
- package/backdrop/ModalBackdrop.js +5 -3
- package/badge/Badge.js +15 -3
- package/badge/BadgeDot.js +8 -3
- package/badge/BadgeFill.js +24 -6
- package/badge/BadgeWithText.js +13 -3
- package/billing/BarChart.js +1 -1
- package/breadcrumb/Breadcrumb.js +42 -3
- package/button/Button.js +88 -20
- package/button/ButtonGroup.js +33 -9
- package/button/IconButton.js +37 -10
- package/button/ScrollToTopButton.js +12 -4
- package/callout/Callout.js +37 -8
- package/chart/BarChart.js +10 -17
- package/chart/DoughnutChart.js +34 -20
- package/chart/LineChart.js +14 -20
- package/chart/SingleBarChart.js +22 -5
- package/chart/utils/centerTextPlugin.js +2 -2
- package/chart/utils/customTooltip.js +7 -7
- package/chart/utils/htmlLegendPlugin.js +1 -1
- package/container/FlexContainer.js +15 -7
- package/cropper/Cropper.js +1 -2
- package/datetimePicker/DatePicker.js +80 -26
- package/datetimePicker/DatePickerV2.js +95 -36
- package/datetimePicker/DatetimePicker.js +174 -11
- package/datetimePicker/DatetimePickerV2.js +87 -33
- package/datetimePicker/DatetimePickerV3.js +174 -11
- package/datetimePicker/TimeInput.js +35 -10
- package/datetimePicker/TimePicker.js +77 -22
- package/datetimePicker/TimePickerStyle.js +53 -3
- package/datetimePicker/TimePickerV2.js +54 -21
- package/datetimePicker/accordion/Month.js +93 -16
- package/datetimePicker/accordion/Year.js +96 -18
- package/datetimePicker/hooks/useChangeNumber.js +3 -6
- package/datetimePicker/hooks/useDecrease.js +3 -6
- package/datetimePicker/hooks/useIncrease.js +3 -6
- package/datetimePicker/subComponent/Accordion.js +101 -20
- package/descriptionList/DescriptionDetail.js +15 -4
- package/descriptionList/DescriptionList.js +12 -4
- package/descriptionList/DescriptionTerm.js +5 -3
- package/divider/Divider.js +15 -6
- package/dropdown/DropdownButtonOption.js +22 -6
- package/dropdown/DropdownContent.js +29 -15
- package/dropdown/DropdownDivOption.js +17 -3
- package/dropdown/DropdownLinkOption.js +14 -3
- package/dropdown/DropdownToggle.js +7 -15
- package/dropzone/FileDropzone.js +121 -22
- package/dropzone/ImageDropzone.js +83 -14
- package/dropzone/subComponent/Message.js +11 -4
- package/figure/IconFigure.js +16 -7
- package/figure/ImageFigure.js +19 -6
- package/file/HiddenFileInput.js +3 -3
- package/form/Checkbox.js +74 -13
- package/form/Fieldset.js +9 -3
- package/form/FormItem.js +10 -5
- package/form/Input.js +40 -7
- package/form/Label.js +34 -10
- package/form/MutedText.js +8 -4
- package/form/PasswordInput.js +20 -13
- package/form/RadioButton.js +55 -8
- package/form/SearchSelect.js +64 -12
- package/form/Searchbox.js +45 -19
- package/form/Slider.js +28 -10
- package/form/SwitchButton.js +48 -14
- package/form/Textarea.js +30 -3
- package/form/TreeView.js +13 -6
- package/grid/Column.js +23 -10
- package/grid/Grid.js +14 -6
- package/heading/Heading1.js +8 -4
- package/heading/Heading2.js +11 -5
- package/heading/Heading3.js +20 -8
- package/iconbox/ApplicationIconBox.js +48 -12
- package/iconbox/IconBox.js +31 -7
- package/iconbox/IconBoxV2.js +33 -8
- package/iconbox/subComponent/IconBoxFigure.js +17 -9
- package/iconbox/subComponent/IconBoxImage.js +21 -8
- package/image/ImageFluid.js +7 -3
- package/image/UploadImage.js +66 -18
- package/index.js +8 -1
- package/jsoneditor/JsonEditor.js +121 -15
- package/keyframe/Pulse.js +13 -3
- package/keyframe/Spin.js +5 -3
- package/layout/Aside.js +30 -5
- package/layout/Backdrop.js +8 -4
- package/layout/Container.js +21 -5
- package/layout/Footer.js +26 -7
- package/layout/Sidebar.jsx +33 -3
- package/link/LinkSpan.js +37 -19
- package/map/GoogleMap.js +3 -7
- package/map/GoogleReverseGeolocation.js +6 -3
- package/map/LeafletMap.js +2 -2
- package/map/subComponent/GoogleMapContainer.js +16 -4
- package/map/subComponent/GoogleMapPopup.js +7 -10
- package/map/subComponent/GoogleMapWrapper.js +8 -15
- package/map/subComponent/LeafletDrawControl.js +9 -7
- package/map/subComponent/LeafletMapContainer.js +159 -4
- package/modal/StateModal.js +49 -28
- package/modal/TitleModal.js +70 -29
- package/package.json +1 -1
- package/page/Disclaimer.js +119 -3
- package/paginate/Paginate.js +54 -12
- package/popover/Popover.js +30 -25
- package/qrcode/QRCode.js +20 -6
- package/qrcode/QRCodeContainter.js +12 -4
- package/ribbon/Ribbon.js +29 -4
- package/section/Section.js +68 -20
- package/section/SectionBody.js +29 -8
- package/section/SectionHeader.js +36 -11
- package/section/SectionToolbar.js +9 -3
- package/section/SectionToolbarItem.js +8 -3
- package/select/InputSelect.js +16 -23
- package/select/Select.js +112 -43
- package/select/subComponent/Checkbox.js +24 -5
- package/select/subComponent/Footer.js +4 -3
- package/select/subComponent/ListBox.js +12 -5
- package/select/subComponent/Option.js +27 -7
- package/select/subComponent/OptionGroup.js +13 -3
- package/select/subComponent/Options.js +18 -5
- package/select/subComponent/SearchBox.js +34 -12
- package/select/subComponent/SelectedMultipleTags.js +21 -3
- package/select/subComponent/SelectedMultipleText.js +19 -4
- package/select/subComponent/SelectedSingle.js +7 -3
- package/styles/GlobalStyle.js +156 -45
- package/styles/mixin/backgroundColor.js +16 -8
- package/styles/mixin/borderColor.js +13 -7
- package/styles/mixin/color.js +13 -7
- package/styles/mixin/colorOnBackground.js +13 -7
- package/styles/mixin/inputPlaceholder.js +20 -3
- package/styles/mixin/media.js +5 -3
- package/styles/mixin/rounded.js +10 -6
- package/styles/mixin/scrollbar.js +13 -3
- package/styles/theme/dark.theme.js +15 -14
- package/styles/theme/light.theme.js +15 -14
- package/styles/theme/white.theme.js +15 -14
- package/table/GridTable.js +71 -33
- package/table/ImageBox.js +15 -5
- package/table/InfiniteGridTable.js +92 -46
- package/table/PermissionTable.js +32 -10
- package/table/SimpleGridTable.js +143 -0
- package/table/Table.js +198 -48
- package/table/__mock__/columns.js +1 -1
- package/table/index.js +7 -0
- package/table/subComponent/BaseTableHeadCell.js +37 -8
- package/table/subComponent/GridTableFooter.js +10 -4
- package/table/subComponent/GridTableHeadCell.js +6 -4
- package/table/subComponent/Resizer.js +19 -4
- package/table/subComponent/TableFooter.js +15 -6
- package/table/subComponent/TableFooterInfo.js +4 -3
- package/table/subComponent/TableFooterPager.js +19 -6
- package/table/subComponent/TableHeadCell.js +9 -3
- package/table/subComponent/TableSort.js +17 -7
- package/tagify/TagifyStyle.js +49 -3
- package/tagify/Tags.js +37 -21
- package/tagify/templates/getCreateButtonTemplate.js +5 -2
- package/text/Paragraph.js +50 -12
- package/timeline/Timeline.js +94 -17
- package/toast/CustomToastContainer.js +35 -3
- package/toast/MessageContainer.js +22 -4
- package/tooltip/Tooltip.js +47 -19
- package/treeView/TreeViewV2.js +1 -1
- package/treeView/TreeflexStyle.js +38 -3
- package/wizard/Wizard.js +115 -6
package/table/PermissionTable.js
CHANGED
|
@@ -5,37 +5,59 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
9
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const PermissionTable = _styledComponents.default.table`
|
|
10
|
+
width: 100%;
|
|
11
|
+
vertical-align: middle;
|
|
12
|
+
table-layout: fixed;
|
|
13
|
+
border: 0;
|
|
14
|
+
color: var(--font-on-background);
|
|
15
|
+
`;
|
|
16
|
+
const TH = _styledComponents.default.th`
|
|
17
|
+
padding: var(--spacing) 0;
|
|
18
|
+
border-bottom: 1px solid var(--border-color);
|
|
19
|
+
font-weight: var(--font-bold);
|
|
20
|
+
|
|
21
|
+
${_ref => {
|
|
13
22
|
let {
|
|
14
23
|
clickable
|
|
15
24
|
} = _ref;
|
|
16
25
|
return clickable && 'cursor: pointer;';
|
|
17
|
-
}
|
|
26
|
+
}}
|
|
27
|
+
${_ref2 => {
|
|
18
28
|
let {
|
|
19
29
|
alignCenter
|
|
20
30
|
} = _ref2;
|
|
21
31
|
return alignCenter && 'text-align: center;';
|
|
22
|
-
}
|
|
23
|
-
|
|
32
|
+
}}
|
|
33
|
+
`;
|
|
34
|
+
const TD = _styledComponents.default.td`
|
|
35
|
+
padding: var(--spacing) 0;
|
|
36
|
+
border-bottom: 1px solid var(--border-color);
|
|
37
|
+
|
|
38
|
+
&:nth-child(even) {
|
|
39
|
+
background: var(--color-background1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
${_ref3 => {
|
|
24
43
|
let {
|
|
25
44
|
clickable
|
|
26
45
|
} = _ref3;
|
|
27
46
|
return clickable && 'cursor: pointer;';
|
|
28
|
-
}
|
|
47
|
+
}}
|
|
48
|
+
${_ref4 => {
|
|
29
49
|
let {
|
|
30
50
|
alignCenter
|
|
31
51
|
} = _ref4;
|
|
32
52
|
return alignCenter && 'text-align: center;';
|
|
33
|
-
}
|
|
53
|
+
}}
|
|
54
|
+
${_ref5 => {
|
|
34
55
|
let {
|
|
35
56
|
bold
|
|
36
57
|
} = _ref5;
|
|
37
58
|
return bold && 'font-weight: var(--font-bold);';
|
|
38
|
-
}
|
|
59
|
+
}}
|
|
60
|
+
`;
|
|
39
61
|
var _default = exports.default = Object.assign(PermissionTable, {
|
|
40
62
|
TH,
|
|
41
63
|
TD
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _GridTableHeadCell = _interopRequireDefault(require("./subComponent/GridTableHeadCell"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const SimpleGridTable = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
columns,
|
|
15
|
+
data,
|
|
16
|
+
backgroundReverse,
|
|
17
|
+
translation
|
|
18
|
+
} = _ref;
|
|
19
|
+
const texts = (0, _react.useMemo)(() => {
|
|
20
|
+
const defaultTexts = {
|
|
21
|
+
empty: 'No data available in table'
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
...defaultTexts,
|
|
25
|
+
...translation
|
|
26
|
+
};
|
|
27
|
+
}, [translation]);
|
|
28
|
+
const tableHeads = (0, _react.useMemo)(() => {
|
|
29
|
+
const tableHeads = columns.map((column, index) => {
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TH, {
|
|
31
|
+
backgroundReverse: !backgroundReverse,
|
|
32
|
+
children: column.title
|
|
33
|
+
}, `TH${index}`);
|
|
34
|
+
});
|
|
35
|
+
return tableHeads;
|
|
36
|
+
}, [backgroundReverse, columns]);
|
|
37
|
+
const tableRows = (0, _react.useMemo)(() => {
|
|
38
|
+
if (data.length === 0) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return data.map((row, rowIndex) => {
|
|
42
|
+
const tds = columns.map((column, columnIndex) => {
|
|
43
|
+
const {
|
|
44
|
+
title,
|
|
45
|
+
fieldName,
|
|
46
|
+
render
|
|
47
|
+
} = column;
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TD, {
|
|
49
|
+
"data-label": title,
|
|
50
|
+
backgroundReverse: backgroundReverse,
|
|
51
|
+
children: render ? render(row[fieldName], row) : String(row[fieldName])
|
|
52
|
+
}, columnIndex);
|
|
53
|
+
});
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TR, {
|
|
55
|
+
children: tds
|
|
56
|
+
}, rowIndex);
|
|
57
|
+
});
|
|
58
|
+
}, [backgroundReverse, columns, data]);
|
|
59
|
+
const generateEmptyMessage = (0, _react.useCallback)(() => {
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TR, {
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TD, {
|
|
62
|
+
center: true,
|
|
63
|
+
colSpan: columns.length,
|
|
64
|
+
backgroundReverse: backgroundReverse,
|
|
65
|
+
children: texts.empty
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}, [backgroundReverse, columns, texts]);
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TableWrapper, {
|
|
71
|
+
backgroundReverse: backgroundReverse,
|
|
72
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ResponsiveTable, {
|
|
73
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
|
75
|
+
children: tableHeads
|
|
76
|
+
})
|
|
77
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
|
78
|
+
children: tableRows || generateEmptyMessage()
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const TableWrapper = _styledComponents.default.div`
|
|
85
|
+
background: ${_ref2 => {
|
|
86
|
+
let {
|
|
87
|
+
backgroundReverse
|
|
88
|
+
} = _ref2;
|
|
89
|
+
return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
|
|
90
|
+
}};
|
|
91
|
+
`;
|
|
92
|
+
const ResponsiveTable = _styledComponents.default.table`
|
|
93
|
+
width: 100%;
|
|
94
|
+
color: var(--font-on-background);
|
|
95
|
+
table-layout: fixed;
|
|
96
|
+
border-collapse: separate;
|
|
97
|
+
border-spacing: 0;
|
|
98
|
+
border: 1px solid var(--border-color);
|
|
99
|
+
border-radius: 8px;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
`;
|
|
102
|
+
const TH = (0, _styledComponents.default)(_GridTableHeadCell.default)`
|
|
103
|
+
text-align: left;
|
|
104
|
+
border-top: none;
|
|
105
|
+
border-right: 1px solid var(--border-color);
|
|
106
|
+
|
|
107
|
+
&:last-child {
|
|
108
|
+
border-right: none;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
const TD = _styledComponents.default.td`
|
|
112
|
+
height: 48px;
|
|
113
|
+
padding: 0 var(--spacing-xs);
|
|
114
|
+
border-bottom: 1px solid var(--border-color);
|
|
115
|
+
border-right: 1px solid var(--border-color);
|
|
116
|
+
text-align: ${_ref3 => {
|
|
117
|
+
let {
|
|
118
|
+
center
|
|
119
|
+
} = _ref3;
|
|
120
|
+
return center ? 'center' : 'left';
|
|
121
|
+
}};
|
|
122
|
+
background: ${_ref4 => {
|
|
123
|
+
let {
|
|
124
|
+
backgroundReverse
|
|
125
|
+
} = _ref4;
|
|
126
|
+
return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
|
|
127
|
+
}};
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
|
|
132
|
+
&:last-child {
|
|
133
|
+
border-right: none;
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
const TR = _styledComponents.default.tr`
|
|
137
|
+
&:last-child {
|
|
138
|
+
${TD} {
|
|
139
|
+
border-bottom: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
var _default = exports.default = SimpleGridTable;
|
package/table/Table.js
CHANGED
|
@@ -16,19 +16,9 @@ var _Paginate = _interopRequireDefault(require("../paginate/Paginate"));
|
|
|
16
16
|
var _Select = _interopRequireDefault(require("../select/Select"));
|
|
17
17
|
var _Popover = _interopRequireDefault(require("../popover/Popover"));
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
20
|
-
const _excluded = ["title", "fieldName", "render", "custom", "customPop"];
|
|
21
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
25
|
-
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; }
|
|
26
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
27
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
30
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
31
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
32
22
|
const Table = _ref => {
|
|
33
23
|
let {
|
|
34
24
|
columns,
|
|
@@ -66,7 +56,10 @@ const Table = _ref => {
|
|
|
66
56
|
info: 'Showing _START_ to _END_ of _TOTAL_ entries',
|
|
67
57
|
empty: 'No data available in table'
|
|
68
58
|
};
|
|
69
|
-
return
|
|
59
|
+
return {
|
|
60
|
+
...defaultTexts,
|
|
61
|
+
...translation
|
|
62
|
+
};
|
|
70
63
|
}, [translation]);
|
|
71
64
|
const handleSortChange = (0, _react.useCallback)(columnName => {
|
|
72
65
|
if (onSortChange) {
|
|
@@ -150,7 +143,7 @@ const Table = _ref => {
|
|
|
150
143
|
children: title
|
|
151
144
|
}), sortable && generateSort(fieldName)]
|
|
152
145
|
})
|
|
153
|
-
},
|
|
146
|
+
}, `TH${index}`);
|
|
154
147
|
});
|
|
155
148
|
}, [columns, handleSortChange, generateSort, showFullValue]);
|
|
156
149
|
const tableRows = (0, _react.useMemo)(() => {
|
|
@@ -171,13 +164,13 @@ const Table = _ref => {
|
|
|
171
164
|
// row data cell
|
|
172
165
|
const tds = columns.map((column, columnIndex) => {
|
|
173
166
|
const {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
167
|
+
title,
|
|
168
|
+
fieldName,
|
|
169
|
+
render,
|
|
170
|
+
custom,
|
|
171
|
+
customPop,
|
|
172
|
+
...props
|
|
173
|
+
} = column;
|
|
181
174
|
const key = rowIndex + columnIndex.toString();
|
|
182
175
|
let value = row[fieldName];
|
|
183
176
|
|
|
@@ -210,13 +203,13 @@ const Table = _ref => {
|
|
|
210
203
|
children: render ? render(value, row) : String(value)
|
|
211
204
|
});
|
|
212
205
|
}
|
|
213
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TableDataCell,
|
|
206
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TableDataCell, {
|
|
214
207
|
"data-label": title,
|
|
215
208
|
enableRowDrag: columnIndex === columns.length - 1 && enableRowDrag,
|
|
216
209
|
backgroundReverse: backgroundReverse,
|
|
217
210
|
border: rowConfig.border,
|
|
218
|
-
custom: isCustom
|
|
219
|
-
|
|
211
|
+
custom: isCustom,
|
|
212
|
+
...props,
|
|
220
213
|
children: [renderedData, enableRowDrag && columnIndex === columns.length - 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(DragHandle, {
|
|
221
214
|
draggable: true,
|
|
222
215
|
onDragStart: event => {
|
|
@@ -238,7 +231,7 @@ const Table = _ref => {
|
|
|
238
231
|
})]
|
|
239
232
|
})
|
|
240
233
|
})]
|
|
241
|
-
}
|
|
234
|
+
}, columnIndex);
|
|
242
235
|
});
|
|
243
236
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BodyTR, {
|
|
244
237
|
clickable: onRowClick,
|
|
@@ -334,46 +327,112 @@ const Table = _ref => {
|
|
|
334
327
|
})]
|
|
335
328
|
});
|
|
336
329
|
};
|
|
337
|
-
const ResponsiveTable = _styledComponents.default.table
|
|
330
|
+
const ResponsiveTable = _styledComponents.default.table`
|
|
331
|
+
width: 100%;
|
|
332
|
+
border-collapse: separate;
|
|
333
|
+
margin-top: calc(var(--spacing-s) * -1);
|
|
334
|
+
border-spacing: 0 var(--spacing-s);
|
|
335
|
+
color: var(--font-on-background);
|
|
336
|
+
table-layout: fixed;
|
|
337
|
+
|
|
338
|
+
${_ref2 => {
|
|
338
339
|
let {
|
|
339
340
|
enableRowDrag
|
|
340
341
|
} = _ref2;
|
|
341
342
|
return enableRowDrag && 'padding-right: calc(1.5rem + 0.5rem);';
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
const
|
|
343
|
+
}}
|
|
344
|
+
`;
|
|
345
|
+
const TableHead = _styledComponents.default.thead`
|
|
346
|
+
${_media.default.mobile`
|
|
347
|
+
display: none;
|
|
348
|
+
`}
|
|
349
|
+
`;
|
|
350
|
+
const BodyTR = _styledComponents.default.tr`
|
|
351
|
+
&:hover {
|
|
352
|
+
> td {
|
|
353
|
+
border-color: var(--color-primary);
|
|
354
|
+
border-width: var(--border-width);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
${_ref3 => {
|
|
345
359
|
let {
|
|
346
360
|
active,
|
|
347
361
|
primary
|
|
348
362
|
} = _ref3;
|
|
349
|
-
return (active || primary) && (0, _styledComponents.css)
|
|
350
|
-
|
|
363
|
+
return (active || primary) && (0, _styledComponents.css)`
|
|
364
|
+
> td {
|
|
365
|
+
background: var(--color-background3);
|
|
366
|
+
}
|
|
367
|
+
`;
|
|
368
|
+
}}
|
|
369
|
+
|
|
370
|
+
${_ref4 => {
|
|
351
371
|
let {
|
|
352
372
|
clickable
|
|
353
373
|
} = _ref4;
|
|
354
374
|
return clickable && 'pointer: cursor;';
|
|
355
|
-
}
|
|
375
|
+
}}
|
|
376
|
+
|
|
377
|
+
${_media.default.mobile`
|
|
378
|
+
overflow: hidden;
|
|
379
|
+
position: relative;
|
|
380
|
+
transition: .3s;
|
|
381
|
+
display: block;
|
|
382
|
+
margin-bottom: 0.75rem;
|
|
383
|
+
padding: var(--spacing-xs) var(--spacing-s);
|
|
384
|
+
background: var(
|
|
385
|
+
--color-background${_ref5 => {
|
|
356
386
|
let {
|
|
357
387
|
backgroundReverse
|
|
358
388
|
} = _ref5;
|
|
359
389
|
return backgroundReverse ? 1 : 2;
|
|
360
|
-
}
|
|
390
|
+
}}
|
|
391
|
+
);
|
|
392
|
+
border-radius: var(--border-radius);
|
|
393
|
+
transition: .3s;
|
|
394
|
+
border: 1px solid transparent;
|
|
395
|
+
|
|
396
|
+
&:hover {
|
|
397
|
+
border: var(--border-width) solid var(--color-primary);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
${_ref6 => {
|
|
361
401
|
let {
|
|
362
402
|
active,
|
|
363
403
|
primary
|
|
364
404
|
} = _ref6;
|
|
365
|
-
return (active || primary) && (0, _styledComponents.css)
|
|
366
|
-
|
|
405
|
+
return (active || primary) && (0, _styledComponents.css)`
|
|
406
|
+
background: var(--color-background3);
|
|
407
|
+
`;
|
|
408
|
+
}}
|
|
409
|
+
|
|
410
|
+
${_ref7 => {
|
|
367
411
|
let {
|
|
368
412
|
border
|
|
369
413
|
} = _ref7;
|
|
370
|
-
return border && (0, _styledComponents.css)
|
|
371
|
-
|
|
414
|
+
return border && (0, _styledComponents.css)`
|
|
415
|
+
border-color: var(--font-on-background);
|
|
416
|
+
border-width: 3px;
|
|
417
|
+
`;
|
|
418
|
+
}}
|
|
419
|
+
|
|
420
|
+
${_ref8 => {
|
|
372
421
|
let {
|
|
373
422
|
noData
|
|
374
423
|
} = _ref8;
|
|
375
|
-
return noData && (0, _styledComponents.css)
|
|
376
|
-
|
|
424
|
+
return noData && (0, _styledComponents.css)`
|
|
425
|
+
height: 168px;
|
|
426
|
+
|
|
427
|
+
> td {
|
|
428
|
+
&:first-child:before {
|
|
429
|
+
display: none;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
`;
|
|
433
|
+
}}
|
|
434
|
+
`}
|
|
435
|
+
`;
|
|
377
436
|
const TableDataCell = _styledComponents.default.td.attrs(_ref9 => {
|
|
378
437
|
let {
|
|
379
438
|
border
|
|
@@ -382,37 +441,128 @@ const TableDataCell = _styledComponents.default.td.attrs(_ref9 => {
|
|
|
382
441
|
borderWidth: border ? '3px' : 'var(--border-width)',
|
|
383
442
|
borderColor: border ? 'var(--font-on-background)' : 'transparent'
|
|
384
443
|
};
|
|
385
|
-
})
|
|
444
|
+
})`
|
|
445
|
+
height: 48px;
|
|
446
|
+
background: ${_ref10 => {
|
|
386
447
|
let {
|
|
387
448
|
backgroundReverse
|
|
388
449
|
} = _ref10;
|
|
389
450
|
return backgroundReverse ? 'var(--color-background1)' : 'var(--color-background2)';
|
|
390
|
-
}
|
|
451
|
+
}};
|
|
452
|
+
padding: 0 var(--spacing-xs);
|
|
453
|
+
max-width: 0px;
|
|
454
|
+
text-align: ${_ref11 => {
|
|
391
455
|
let {
|
|
392
456
|
center
|
|
393
457
|
} = _ref11;
|
|
394
458
|
return center ? 'center' : 'left';
|
|
395
|
-
}
|
|
459
|
+
}};
|
|
460
|
+
vertical-align: middle;
|
|
461
|
+
transition: border-color 0.3s;
|
|
462
|
+
|
|
463
|
+
${_ref12 => {
|
|
396
464
|
let {
|
|
397
465
|
borderWidth,
|
|
398
466
|
borderColor
|
|
399
467
|
} = _ref12;
|
|
400
|
-
return (0, _styledComponents.css)
|
|
401
|
-
}
|
|
468
|
+
return (0, _styledComponents.css)`
|
|
469
|
+
border-top: ${borderWidth} solid ${borderColor};
|
|
470
|
+
border-bottom: ${borderWidth} solid ${borderColor};
|
|
471
|
+
&:first-child {
|
|
472
|
+
border-left: ${borderWidth} solid ${borderColor};
|
|
473
|
+
border-top-left-radius: var(--border-radius-l);
|
|
474
|
+
border-bottom-left-radius: var(--border-radius-l);
|
|
475
|
+
padding-left: var(--spacing);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
&:last-child {
|
|
479
|
+
border-right: ${borderWidth} solid ${borderColor};
|
|
480
|
+
border-top-right-radius: var(--border-radius-l);
|
|
481
|
+
border-bottom-right-radius: var(--border-radius-l);
|
|
482
|
+
padding-right: var(--spacing);
|
|
483
|
+
}
|
|
484
|
+
`;
|
|
485
|
+
}}
|
|
486
|
+
> span {
|
|
487
|
+
display: inline-block;
|
|
488
|
+
width: 100%;
|
|
489
|
+
overflow: hidden;
|
|
490
|
+
white-space: pre;
|
|
491
|
+
text-overflow: ellipsis;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
${_ref13 => {
|
|
402
495
|
let {
|
|
403
496
|
noData
|
|
404
497
|
} = _ref13;
|
|
405
|
-
return noData && (0, _styledComponents.css)
|
|
406
|
-
|
|
498
|
+
return noData && (0, _styledComponents.css)`
|
|
499
|
+
padding: 20px 0;
|
|
500
|
+
`;
|
|
501
|
+
}}
|
|
502
|
+
|
|
503
|
+
${_ref14 => {
|
|
407
504
|
let {
|
|
408
505
|
enableRowDrag
|
|
409
506
|
} = _ref14;
|
|
410
507
|
return enableRowDrag && 'position: relative;';
|
|
411
|
-
}
|
|
508
|
+
}}
|
|
509
|
+
|
|
510
|
+
${_media.default.mobile`
|
|
511
|
+
display: flex;
|
|
512
|
+
height: auto;
|
|
513
|
+
margin-bottom: var(--spacing-xs);
|
|
514
|
+
background: transparent !important;
|
|
515
|
+
border: none !important;
|
|
516
|
+
min-width: 100%;
|
|
517
|
+
|
|
518
|
+
&:first-child {
|
|
519
|
+
padding: var(--spacing-xs) 0 0 var(--spacing-xs);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
&:last-child {
|
|
523
|
+
padding-right: var(--spacing-xs);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
&:before {
|
|
527
|
+
content: attr(data-label) ": ";
|
|
528
|
+
font-weight: bold;
|
|
529
|
+
padding-right: var(--spacing-xs);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
> span {
|
|
533
|
+
flex: 1;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
${_ref15 => {
|
|
412
537
|
let {
|
|
413
538
|
custom
|
|
414
539
|
} = _ref15;
|
|
415
|
-
return custom && (0, _styledComponents.css)
|
|
416
|
-
|
|
417
|
-
|
|
540
|
+
return custom && (0, _styledComponents.css)`
|
|
541
|
+
&:last-child:before {
|
|
542
|
+
display: none;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
&:last-child {
|
|
546
|
+
padding: 0;
|
|
547
|
+
position: absolute;
|
|
548
|
+
right: 0.75rem;
|
|
549
|
+
top: var(--spacing-xs);
|
|
550
|
+
justify-content: flex-end;
|
|
551
|
+
}
|
|
552
|
+
`;
|
|
553
|
+
}}
|
|
554
|
+
`}
|
|
555
|
+
`;
|
|
556
|
+
const DragHandle = _styledComponents.default.div`
|
|
557
|
+
display: flex;
|
|
558
|
+
align-items: center;
|
|
559
|
+
justify-content: center;
|
|
560
|
+
width: var(--spacing);
|
|
561
|
+
height: var(--spacing);
|
|
562
|
+
position: absolute;
|
|
563
|
+
left: calc(100% + var(--spacing-xs));
|
|
564
|
+
cursor: grab;
|
|
565
|
+
top: 50%;
|
|
566
|
+
transform: translateY(-50%);
|
|
567
|
+
`;
|
|
418
568
|
var _default = exports.default = Table;
|
package/table/index.js
CHANGED
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "PermissionTable", {
|
|
|
27
27
|
return _PermissionTable.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "SimpleGridTable", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _SimpleGridTable.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "Table", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function () {
|
|
@@ -37,5 +43,6 @@ var _GridTable = _interopRequireDefault(require("./GridTable"));
|
|
|
37
43
|
var _InfiniteGridTable = _interopRequireDefault(require("./InfiniteGridTable"));
|
|
38
44
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
39
45
|
var _PermissionTable = _interopRequireDefault(require("./PermissionTable"));
|
|
46
|
+
var _SimpleGridTable = _interopRequireDefault(require("./SimpleGridTable"));
|
|
40
47
|
var _ImageBox = _interopRequireDefault(require("./ImageBox"));
|
|
41
48
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -5,29 +5,58 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
9
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const BaseTableHeadCell = _styledComponents.default.th`
|
|
11
|
+
position: relative;
|
|
12
|
+
font-size: var(--font-body1);
|
|
13
|
+
font-weight: var(--font-bold);
|
|
14
|
+
width: ${_ref => {
|
|
13
15
|
let {
|
|
14
16
|
width
|
|
15
17
|
} = _ref;
|
|
16
18
|
return width || 'auto';
|
|
17
|
-
}
|
|
19
|
+
}};
|
|
20
|
+
padding: var(--spacing-s) var(--spacing-xs);
|
|
21
|
+
|
|
22
|
+
> div {
|
|
23
|
+
display: flex;
|
|
24
|
+
|
|
25
|
+
> span {
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
${_ref2 => {
|
|
18
33
|
let {
|
|
19
34
|
sortable
|
|
20
35
|
} = _ref2;
|
|
21
|
-
return sortable && (0, _styledComponents.css)
|
|
22
|
-
|
|
36
|
+
return sortable && (0, _styledComponents.css)`
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
|
|
39
|
+
> div > span {
|
|
40
|
+
max-width: calc(100% - 1rem);
|
|
41
|
+
padding-right: var(--spacing-xs);
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
}}
|
|
45
|
+
|
|
46
|
+
${_ref3 => {
|
|
23
47
|
let {
|
|
24
48
|
align
|
|
25
49
|
} = _ref3;
|
|
26
50
|
switch (align) {
|
|
27
51
|
case 'center':
|
|
28
|
-
return (0, _styledComponents.css)
|
|
52
|
+
return (0, _styledComponents.css)`
|
|
53
|
+
> div {
|
|
54
|
+
justify-content: center;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
29
57
|
default:
|
|
30
58
|
break;
|
|
31
59
|
}
|
|
32
|
-
}
|
|
60
|
+
}}
|
|
61
|
+
`;
|
|
33
62
|
var _default = exports.default = BaseTableHeadCell;
|