@cashub/ui 0.21.0 → 0.21.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/Tab/Tab.js +9 -13
- package/Tab/TabList.js +14 -32
- package/Tab/TabPanel.js +21 -58
- package/Tab/TabTab.js +20 -40
- package/Tab/index.js +2 -10
- package/Tab/subComponent/TabContext.js +2 -5
- package/animate/Collapse.js +26 -53
- package/animate/Loader.js +21 -26
- package/animate/NumberCounter.js +22 -44
- package/animate/PulseRing.js +9 -21
- package/animate/Spinner.js +2 -10
- package/animate/index.js +5 -11
- package/backdrop/BaseBackdrop.js +2 -9
- package/backdrop/LoadingBackdrop.js +2 -9
- package/backdrop/ModalBackdrop.js +2 -9
- package/backdrop/index.js +3 -7
- package/badge/Badge.js +2 -11
- package/badge/BadgeDot.js +2 -10
- package/badge/BadgeFill.js +15 -20
- package/badge/BadgeWithText.js +6 -13
- package/badge/index.js +4 -9
- package/billing/BarChart.js +10 -17
- package/billing/Grid.js +11 -15
- package/billing/Header2.js +6 -9
- package/billing/Header3.js +9 -16
- package/billing/Paragraph.js +8 -14
- package/billing/ParagraphGroup.js +6 -9
- package/billing/ParagraphText.js +7 -12
- package/billing/Section.js +13 -23
- package/billing/SectionBody.js +5 -8
- package/billing/SectionHeader.js +7 -12
- package/breadcrumb/Breadcrumb.js +11 -21
- package/breadcrumb/index.js +1 -3
- package/button/Button.js +41 -38
- package/button/ButtonGroup.js +21 -18
- package/button/IconButton.js +29 -29
- package/button/ScrollToTopButton.js +12 -39
- package/button/index.js +4 -9
- package/callout/Callout.js +13 -26
- package/callout/index.js +1 -3
- package/chart/BarChart.js +28 -53
- package/chart/DoughnutChart.js +23 -62
- package/chart/LineChart.js +33 -55
- package/chart/SingleBarChart.js +11 -17
- package/chart/index.js +5 -12
- package/chart/utils/customTooltip.js +26 -43
- package/chart/utils/htmlLegendPlugin.js +24 -30
- package/chart/utils/index.js +3 -7
- package/chart/utils/padEmptyChartBar.js +24 -22
- package/container/FlexContainer.js +9 -12
- package/container/index.js +1 -3
- package/cropper/Cropper.js +21 -34
- package/cropper/CropperModalHandler.js +15 -21
- package/cropper/index.js +2 -5
- package/cropper/subComponent/CropImageModal.js +23 -58
- package/datetimePicker/DatePicker.js +103 -217
- package/datetimePicker/DatePickerV2.js +116 -221
- package/datetimePicker/DatetimePicker.js +27 -48
- package/datetimePicker/DatetimePickerV2.js +115 -231
- package/datetimePicker/TimeInput.js +9 -22
- package/datetimePicker/TimePicker.js +94 -151
- package/datetimePicker/TimePickerStyle.js +2 -9
- package/datetimePicker/accordion/Month.js +70 -90
- package/datetimePicker/accordion/Year.js +91 -135
- package/datetimePicker/hooks/index.js +3 -7
- package/datetimePicker/hooks/useChangeNumber.js +14 -27
- package/datetimePicker/hooks/useDecrease.js +19 -35
- package/datetimePicker/hooks/useIncrease.js +19 -35
- package/datetimePicker/index.js +7 -15
- package/datetimePicker/provider/constant.js +2 -3
- package/datetimePicker/subComponent/Accordion.js +108 -158
- package/datetimePicker/subComponent/CustomTimeInput.js +18 -48
- package/datetimePicker/subComponent/DateTimePickerContext.js +2 -5
- package/datetimePicker/utils/GMTDate.js +3 -7
- package/datetimePicker/utils/pad.js +2 -6
- package/datetimePicker/utils/toUTC0.js +3 -6
- package/descriptionList/DescriptionDetail.js +5 -10
- package/descriptionList/DescriptionList.js +5 -10
- package/descriptionList/DescriptionTerm.js +2 -9
- package/descriptionList/index.js +3 -7
- package/divider/Divider.js +9 -12
- package/divider/index.js +1 -3
- package/dropdown/Dropdown.js +28 -65
- package/dropdown/DropdownButtonOption.js +2 -9
- package/dropdown/DropdownContent.js +33 -64
- package/dropdown/DropdownDivOption.js +2 -9
- package/dropdown/DropdownItem.js +10 -16
- package/dropdown/DropdownLinkOption.js +2 -9
- package/dropdown/DropdownToggle.js +18 -38
- package/dropdown/index.js +6 -17
- package/dropdown/subComponent/DropdownContext.js +2 -5
- package/dropzone/FileDropzone.js +148 -302
- package/dropzone/ImageDropzone.js +96 -171
- package/dropzone/index.js +2 -5
- package/dropzone/subComponent/Message.js +7 -14
- package/figure/IconFigure.js +9 -16
- package/figure/ImageFigure.js +11 -17
- package/figure/index.js +2 -5
- package/file/HiddenFileInput.js +5 -14
- package/file/index.js +1 -3
- package/form/Checkbox.js +34 -43
- package/form/FormItem.js +2 -9
- package/form/Input.js +13 -15
- package/form/Label.js +10 -13
- package/form/MutedText.js +5 -10
- package/form/RadioButton.js +20 -32
- package/form/Searchbox.js +21 -65
- package/form/Slider.js +14 -0
- package/form/SwitchButton.js +34 -39
- package/form/Textarea.js +2 -11
- package/form/index.js +9 -19
- package/grid/Column.js +17 -17
- package/grid/Grid.js +13 -14
- package/grid/index.js +2 -5
- package/heading/Heading1.js +5 -10
- package/heading/Heading2.js +9 -12
- package/heading/Heading3.js +21 -18
- package/heading/index.js +3 -7
- package/helmet/Helmet.js +6 -9
- package/helmet/index.js +2 -5
- package/iconbox/ApplicationIconBox.js +25 -31
- package/iconbox/IconBox.js +11 -24
- package/iconbox/IconBoxV2.js +14 -26
- package/iconbox/index.js +3 -7
- package/iconbox/subComponent/IconBoxFigure.js +25 -20
- package/iconbox/subComponent/IconBoxImage.js +15 -18
- package/image/ImageFluid.js +2 -10
- package/image/UploadImage.js +65 -113
- package/image/index.js +2 -5
- package/index.js +44 -130
- package/jsoneditor/JsonEditor.js +10 -32
- package/jsoneditor/index.js +1 -3
- package/keyframe/Pulse.js +2 -7
- package/keyframe/Spin.js +2 -7
- package/link/LinkSpan.js +22 -35
- package/link/index.js +1 -3
- package/map/GoogleMap.js +122 -175
- package/map/GoogleReverseGeolocation.js +79 -186
- package/map/LeafletMap.js +78 -132
- package/map/LeafletReverseGeolocation.js +49 -121
- package/map/index.js +4 -9
- package/map/subComponent/BasicLeafletMap.js +8 -14
- package/map/subComponent/GoogleMapContainer.js +5 -10
- package/map/subComponent/GoogleMapPopup.js +66 -123
- package/map/subComponent/GoogleMapWrapper.js +13 -32
- package/map/subComponent/GoogleMarkerSpiderfier.js +14 -24
- package/map/subComponent/LeafletDrawControl.js +47 -84
- package/map/subComponent/LeafletMapContainer.js +5 -10
- package/map/subComponent/MapSearchBoxControl.js +24 -70
- package/modal/StateModal.js +41 -100
- package/modal/TitleModal.js +89 -190
- package/modal/index.js +2 -5
- package/package.json +1 -1
- package/paginate/Paginate.js +40 -54
- package/paginate/index.js +1 -3
- package/popover/Popover.js +39 -87
- package/popover/index.js +1 -3
- package/qrcode/QRCode.js +10 -23
- package/qrcode/QRCodeContainter.js +8 -16
- package/qrcode/index.js +2 -5
- package/ribbon/Ribbon.js +4 -15
- package/ribbon/index.js +1 -3
- package/section/Section.js +57 -39
- package/section/SectionBody.js +15 -22
- package/section/SectionHeader.js +27 -27
- package/section/SectionToolbar.js +2 -9
- package/section/SectionToolbarItem.js +2 -9
- package/section/index.js +5 -11
- package/select/InputSelect.js +103 -215
- package/select/Select.js +204 -362
- package/select/index.js +2 -5
- package/select/subComponent/ListBox.js +9 -12
- package/select/subComponent/Option.js +8 -16
- package/select/subComponent/OptionGroup.js +2 -9
- package/select/subComponent/Options.js +5 -11
- package/select/subComponent/SearchBox.js +9 -29
- package/select/subComponent/SelectedMultiple.js +8 -16
- package/select/subComponent/SelectedSingle.js +2 -9
- package/styles/GlobalStyle.js +169 -91
- package/styles/config/breakpoint.style.js +2 -3
- package/styles/config/header.style.js +2 -3
- package/styles/config/sidebar.style.js +2 -3
- package/styles/index.js +2 -5
- package/styles/mixin/backgroundColor.js +17 -14
- package/styles/mixin/borderColor.js +17 -14
- package/styles/mixin/color.js +17 -14
- package/styles/mixin/colorOnBackground.js +17 -14
- package/styles/mixin/inputPlaceholder.js +3 -9
- package/styles/mixin/media.js +3 -11
- package/styles/mixin/rounded.js +13 -12
- package/styles/mixin/scrollbar.js +7 -13
- package/styles/theme/dark.theme.js +20 -20
- package/styles/theme/light.theme.js +20 -20
- package/styles/theme/white.theme.js +20 -20
- package/styles/themes.js +2 -8
- package/table/GridTable.js +105 -143
- package/table/ImageBox.js +8 -18
- package/table/PermissionTable.js +25 -25
- package/table/Table.js +137 -153
- package/table/__mock__/columns.js +2 -3
- package/table/__mock__/data.js +2 -3
- package/table/hooks/index.js +2 -5
- package/table/hooks/useCalculateDataRange.js +9 -36
- package/table/hooks/useGenerateSort.js +6 -17
- package/table/index.js +4 -9
- package/table/subComponent/BaseTableHeadCell.js +15 -21
- package/table/subComponent/GridTableFooter.js +5 -10
- package/table/subComponent/GridTableHeadCell.js +5 -10
- package/table/subComponent/Resizer.js +17 -44
- package/table/subComponent/TableFooter.js +5 -10
- package/table/subComponent/TableFooterInfo.js +2 -9
- package/table/subComponent/TableFooterPager.js +5 -12
- package/table/subComponent/TableHeadCell.js +2 -9
- package/table/subComponent/TableSort.js +13 -19
- package/tagify/TagifyStyle.js +2 -9
- package/tagify/Tags.js +15 -37
- package/tagify/index.js +2 -5
- package/text/Paragraph.js +25 -20
- package/text/index.js +1 -3
- package/timeline/Timeline.js +28 -37
- package/timeline/index.js +1 -3
- package/toast/CustomToastContainer.js +2 -9
- package/toast/MessageContainer.js +9 -18
- package/toast/index.js +3 -8
- package/toast/show.js +18 -28
- package/tooltip/Tooltip.js +48 -97
- package/tooltip/index.js +1 -3
- package/wizard/Wizard.js +63 -133
- package/wizard/index.js +1 -3
|
@@ -4,95 +4,80 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
-
|
|
10
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
-
|
|
12
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
-
|
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
-
|
|
16
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
17
|
-
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
|
|
20
|
-
var customTooltip = function customTooltip(theme) {
|
|
7
|
+
const customTooltip = theme => {
|
|
21
8
|
// optimize: render in react way
|
|
22
9
|
return function (context) {
|
|
23
10
|
// Tooltip Element
|
|
24
|
-
|
|
11
|
+
let tooltipEl = document.getElementById('chartjs-tooltip');
|
|
25
12
|
|
|
13
|
+
// Create element on first render
|
|
26
14
|
if (!tooltipEl) {
|
|
27
15
|
tooltipEl = document.createElement('div');
|
|
28
16
|
tooltipEl.id = 'chartjs-tooltip';
|
|
29
17
|
tooltipEl.innerHTML = '<table></table>';
|
|
30
18
|
document.body.appendChild(tooltipEl);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var tooltipModel = context.tooltip;
|
|
19
|
+
}
|
|
35
20
|
|
|
21
|
+
// Hide tooltip, if no tooltip or no data
|
|
22
|
+
const tooltipModel = context.tooltip;
|
|
36
23
|
if (!tooltipModel || !tooltipModel.dataPoints || !tooltipModel.dataPoints[0] || tooltipModel.opacity === 0) {
|
|
37
24
|
tooltipEl.style.display = 'none';
|
|
38
25
|
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
26
|
+
}
|
|
41
27
|
|
|
28
|
+
// Set caret Position
|
|
42
29
|
tooltipEl.classList.remove('above', 'below', 'no-transform');
|
|
43
|
-
|
|
44
30
|
if (tooltipModel.yAlign) {
|
|
45
31
|
tooltipEl.classList.add(tooltipModel.yAlign);
|
|
46
32
|
} else {
|
|
47
33
|
tooltipEl.classList.add('no-transform');
|
|
48
|
-
}
|
|
49
|
-
|
|
34
|
+
}
|
|
50
35
|
|
|
36
|
+
// Set Text
|
|
51
37
|
if (tooltipModel.body) {
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
const titleLines = tooltipModel.title || [];
|
|
39
|
+
const bodyLines = tooltipModel.body.map(bodyItem => {
|
|
54
40
|
return bodyItem.lines;
|
|
55
41
|
});
|
|
56
|
-
|
|
57
|
-
titleLines.forEach(
|
|
42
|
+
let innerHtml = '<thead>';
|
|
43
|
+
titleLines.forEach(title => {
|
|
58
44
|
innerHtml += "<tr><th>".concat(title, "</th></tr>");
|
|
59
45
|
});
|
|
60
46
|
innerHtml += '</thead><tbody>';
|
|
61
|
-
bodyLines.forEach(
|
|
47
|
+
bodyLines.forEach(body => {
|
|
62
48
|
innerHtml += "<tr><td>".concat(body, "</td></tr>");
|
|
63
49
|
});
|
|
64
50
|
innerHtml += '</tbody>';
|
|
65
|
-
|
|
51
|
+
const tableRoot = tooltipEl.querySelector('table');
|
|
66
52
|
tableRoot.innerHTML = innerHtml;
|
|
67
|
-
}
|
|
68
|
-
|
|
53
|
+
}
|
|
69
54
|
|
|
70
|
-
|
|
55
|
+
// `this` will be the overall tooltip
|
|
56
|
+
const position = context.chart.canvas.getBoundingClientRect();
|
|
71
57
|
|
|
58
|
+
// Display, position, and set styles for font
|
|
72
59
|
tooltipEl.style.fontFamily = theme.fontFamily;
|
|
73
60
|
tooltipEl.style.fontSize = theme.fontBody1;
|
|
74
61
|
tooltipEl.style.display = 'block';
|
|
75
62
|
tooltipEl.style.position = 'absolute';
|
|
76
63
|
tooltipEl.style.boxShadow = theme.boxShadow;
|
|
77
|
-
|
|
78
|
-
var _tooltipModel$labelTe = _slicedToArray(tooltipModel.labelTextColors, 1);
|
|
79
|
-
|
|
80
|
-
tooltipEl.style.color = _tooltipModel$labelTe[0];
|
|
64
|
+
[tooltipEl.style.color] = tooltipModel.labelTextColors;
|
|
81
65
|
tooltipEl.style.background = tooltipModel.labelColors[0].backgroundColor;
|
|
82
66
|
tooltipEl.style.borderRadius = theme.borderRadius;
|
|
83
67
|
tooltipEl.style.textAlign = 'center';
|
|
84
68
|
tooltipEl.style.padding = "".concat(theme.spacerXS, " ").concat(theme.spacerS);
|
|
85
|
-
tooltipEl.style.pointerEvents = 'none';
|
|
69
|
+
tooltipEl.style.pointerEvents = 'none';
|
|
86
70
|
|
|
71
|
+
// determine position is left or right
|
|
87
72
|
if (tooltipModel.caretX + tooltipEl.offsetWidth <= this._chart.width) {
|
|
88
73
|
tooltipEl.style.borderTopLeftRadius = 0;
|
|
89
74
|
tooltipEl.style.left = "".concat(position.left + window.pageXOffset + tooltipModel.caretX + 8, "px");
|
|
90
75
|
} else {
|
|
91
76
|
tooltipEl.style.borderTopRightRadius = 0;
|
|
92
77
|
tooltipEl.style.left = "".concat(position.left + window.pageXOffset + tooltipModel.caretX - tooltipModel.width - 16 * 2, "px");
|
|
93
|
-
}
|
|
94
|
-
|
|
78
|
+
}
|
|
95
79
|
|
|
80
|
+
// determine position is top or bottom
|
|
96
81
|
if (tooltipModel.caretY + tooltipEl.offsetHeight <= this._chart.height) {
|
|
97
82
|
tooltipEl.style.top = "".concat(position.top + window.pageYOffset + tooltipModel.caretY + 8, "px");
|
|
98
83
|
} else {
|
|
@@ -100,6 +85,4 @@ var customTooltip = function customTooltip(theme) {
|
|
|
100
85
|
}
|
|
101
86
|
};
|
|
102
87
|
};
|
|
103
|
-
|
|
104
|
-
var _default = customTooltip;
|
|
105
|
-
exports.default = _default;
|
|
88
|
+
var _default = exports.default = customTooltip;
|
|
@@ -4,22 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactChartjs = require("react-chartjs-2");
|
|
9
|
-
|
|
10
|
-
var htmlLegendPlugin = {
|
|
8
|
+
const htmlLegendPlugin = {
|
|
11
9
|
id: 'htmlLegend',
|
|
12
|
-
afterUpdate
|
|
13
|
-
|
|
10
|
+
afterUpdate(chart, args, options) {
|
|
11
|
+
const ul = getOrCreateLegendList(chart, options.containerID);
|
|
14
12
|
|
|
13
|
+
// Remove old legend items
|
|
15
14
|
while (ul.firstChild) {
|
|
16
15
|
ul.firstChild.remove();
|
|
17
|
-
}
|
|
18
|
-
|
|
16
|
+
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
items.
|
|
22
|
-
|
|
18
|
+
// Reuse the built-in legendItems generator
|
|
19
|
+
const items = chart.options.plugins.legend.labels.generateLabels(chart);
|
|
20
|
+
items.forEach(item => {
|
|
21
|
+
const li = document.createElement('li');
|
|
23
22
|
li.style.alignItems = 'center';
|
|
24
23
|
li.style.cursor = 'pointer';
|
|
25
24
|
li.style.display = 'flex';
|
|
@@ -27,22 +26,21 @@ var htmlLegendPlugin = {
|
|
|
27
26
|
li.style.marginLeft = '16px';
|
|
28
27
|
li.style.marginTop = '16px';
|
|
29
28
|
li.style.color = _reactChartjs.defaults.color;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
li.onclick = () => {
|
|
30
|
+
const {
|
|
31
|
+
type
|
|
32
|
+
} = chart.config;
|
|
34
33
|
if (type === 'pie' || type === 'doughnut') {
|
|
35
34
|
// Pie and doughnut charts only have a single dataset and visibility is per item
|
|
36
35
|
chart.toggleDataVisibility(item.index);
|
|
37
36
|
} else {
|
|
38
37
|
chart.setDatasetVisibility(item.datasetIndex, !chart.isDatasetVisible(item.datasetIndex));
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
chart.update();
|
|
42
|
-
};
|
|
40
|
+
};
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
// Color box
|
|
43
|
+
const boxSpan = document.createElement('span');
|
|
46
44
|
boxSpan.style.background = item.fillStyle;
|
|
47
45
|
boxSpan.style.borderColor = item.strokeStyle;
|
|
48
46
|
boxSpan.style.borderWidth = "".concat(item.lineWidth, "px");
|
|
@@ -50,15 +48,16 @@ var htmlLegendPlugin = {
|
|
|
50
48
|
boxSpan.style.display = 'inline-block';
|
|
51
49
|
boxSpan.style.height = '16px';
|
|
52
50
|
boxSpan.style.marginRight = '8px';
|
|
53
|
-
boxSpan.style.width = '32px';
|
|
51
|
+
boxSpan.style.width = '32px';
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
// Text
|
|
54
|
+
const textContainer = document.createElement('p');
|
|
56
55
|
textContainer.style.color = item.fontColor;
|
|
57
56
|
textContainer.style.margin = 0;
|
|
58
57
|
textContainer.style.padding = 0;
|
|
59
58
|
textContainer.style.wordBreak = 'break-all';
|
|
60
59
|
textContainer.style.textDecoration = item.hidden ? 'line-through' : '';
|
|
61
|
-
|
|
60
|
+
const text = document.createTextNode(item.text);
|
|
62
61
|
textContainer.appendChild(text);
|
|
63
62
|
li.appendChild(boxSpan);
|
|
64
63
|
li.appendChild(textContainer);
|
|
@@ -66,11 +65,9 @@ var htmlLegendPlugin = {
|
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var listContainer = legendContainer.querySelector('ul');
|
|
73
|
-
|
|
68
|
+
const getOrCreateLegendList = (chart, id) => {
|
|
69
|
+
const legendContainer = document.getElementById(id);
|
|
70
|
+
let listContainer = legendContainer.querySelector('ul');
|
|
74
71
|
if (!listContainer) {
|
|
75
72
|
listContainer = document.createElement('ul');
|
|
76
73
|
listContainer.style.display = 'flex';
|
|
@@ -81,9 +78,6 @@ var getOrCreateLegendList = function getOrCreateLegendList(chart, id) {
|
|
|
81
78
|
listContainer.style.padding = 0;
|
|
82
79
|
legendContainer.appendChild(listContainer);
|
|
83
80
|
}
|
|
84
|
-
|
|
85
81
|
return listContainer;
|
|
86
82
|
};
|
|
87
|
-
|
|
88
|
-
var _default = htmlLegendPlugin;
|
|
89
|
-
exports.default = _default;
|
|
83
|
+
var _default = exports.default = htmlLegendPlugin;
|
package/chart/utils/index.js
CHANGED
|
@@ -5,27 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "customTooltip", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _customTooltip.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "htmlLegendPlugin", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _htmlLegendPlugin.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "padEmptyChartBar", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _padEmptyChartBar.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
24
|
var _customTooltip = _interopRequireDefault(require("./customTooltip"));
|
|
26
|
-
|
|
27
25
|
var _padEmptyChartBar = _interopRequireDefault(require("./padEmptyChartBar"));
|
|
28
|
-
|
|
29
26
|
var _htmlLegendPlugin = _interopRequireDefault(require("./htmlLegendPlugin"));
|
|
30
|
-
|
|
31
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -5,44 +5,46 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
// make chart bar seem like align left by pad empty bar at the end
|
|
8
|
-
|
|
8
|
+
const padEmptyChartBar = {
|
|
9
9
|
id: 'padEmptyChartBar',
|
|
10
10
|
length: -1,
|
|
11
11
|
// pad empty chart bar when data less than max bar number
|
|
12
|
-
beforeUpdate
|
|
12
|
+
beforeUpdate(chart) {
|
|
13
13
|
this.length = -1;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for (
|
|
14
|
+
const {
|
|
15
|
+
data,
|
|
16
|
+
options
|
|
17
|
+
} = chart.config._config;
|
|
18
|
+
const validLabels = data.labels.filter(label => label !== null);
|
|
19
|
+
const {
|
|
20
|
+
maxBarNumber
|
|
21
|
+
} = options.plugins.padEmptyChartBar;
|
|
22
|
+
for (let index = validLabels.length; index < maxBarNumber; index += 1) {
|
|
23
23
|
this.length = this.length === -1 ? index : this.length;
|
|
24
24
|
data.labels[index] = null;
|
|
25
25
|
data.datasets[0].data[index] = 0;
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
// prevent padded empty chart bar to be drawn
|
|
29
|
-
afterUpdate
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
afterUpdate(chart) {
|
|
30
|
+
const {
|
|
31
|
+
data,
|
|
32
|
+
options
|
|
33
|
+
} = chart.config._config;
|
|
34
|
+
const {
|
|
35
|
+
maxBarNumber
|
|
36
|
+
} = options.plugins.padEmptyChartBar;
|
|
35
37
|
if (this.length === -1) {
|
|
36
38
|
// restore draw function
|
|
37
|
-
for (
|
|
39
|
+
for (let index = 0; index < maxBarNumber; index += 1) {
|
|
40
|
+
// delete data.datasets[0]._meta[data.index].data[i].draw;
|
|
38
41
|
}
|
|
39
42
|
} else {
|
|
40
43
|
// prevents new charts to be drawn
|
|
41
|
-
for (
|
|
42
|
-
data.datasets[0]._meta[data.index].data[
|
|
44
|
+
for (let index = this.length; index < data.maxBarNumber; index += 1) {
|
|
45
|
+
data.datasets[0]._meta[data.index].data[index].draw = () => {};
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
};
|
|
47
|
-
var _default = padEmptyChartBar;
|
|
48
|
-
exports.default = _default;
|
|
50
|
+
var _default = exports.default = padEmptyChartBar;
|
|
@@ -4,22 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _templateObject;
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const FlexContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n\n ", ";\n\n ", ";\n"])), _ref => {
|
|
12
|
+
let {
|
|
13
|
+
marginBottom
|
|
14
|
+
} = _ref;
|
|
18
15
|
return marginBottom && 'margin-bottom: var(--spacing-l)';
|
|
19
|
-
},
|
|
20
|
-
|
|
16
|
+
}, _ref2 => {
|
|
17
|
+
let {
|
|
18
|
+
wrap
|
|
19
|
+
} = _ref2;
|
|
21
20
|
return wrap && 'flex-wrap: wrap';
|
|
22
21
|
});
|
|
23
|
-
|
|
24
|
-
var _default = FlexContainer;
|
|
25
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = FlexContainer;
|
package/container/index.js
CHANGED
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "FlexContainer", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _FlexContainer.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _FlexContainer = _interopRequireDefault(require("./FlexContainer"));
|
|
14
|
-
|
|
15
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/cropper/Cropper.js
CHANGED
|
@@ -4,54 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
require("cropperjs/dist/cropper.css");
|
|
11
|
-
|
|
12
9
|
var _cropperjs = _interopRequireDefault(require("cropperjs"));
|
|
13
|
-
|
|
14
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(0, _react.useEffect)(function () {
|
|
31
|
-
var node = imageRef.current;
|
|
32
|
-
|
|
12
|
+
const CropperWrapper = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
src,
|
|
15
|
+
alt = 'picture',
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
cropBoxResizable = false,
|
|
19
|
+
onInitialized,
|
|
20
|
+
dragMode = 'move'
|
|
21
|
+
} = _ref;
|
|
22
|
+
const imageRef = (0, _react.useRef)(null);
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
const node = imageRef.current;
|
|
33
25
|
if (node !== null) {
|
|
34
|
-
|
|
35
|
-
dragMode
|
|
26
|
+
const cropper = new _cropperjs.default(node, {
|
|
27
|
+
dragMode,
|
|
36
28
|
viewMode: 1,
|
|
37
29
|
initialAspectRatio: 9 / 16,
|
|
38
30
|
background: true,
|
|
39
|
-
cropBoxResizable
|
|
31
|
+
cropBoxResizable,
|
|
40
32
|
data: {
|
|
41
|
-
width
|
|
42
|
-
height
|
|
33
|
+
width,
|
|
34
|
+
height
|
|
43
35
|
}
|
|
44
36
|
});
|
|
45
|
-
|
|
46
37
|
if (onInitialized) {
|
|
47
38
|
onInitialized(cropper);
|
|
48
39
|
}
|
|
49
40
|
}
|
|
50
|
-
|
|
51
|
-
return function () {
|
|
41
|
+
return () => {
|
|
52
42
|
var _node$cropper;
|
|
53
|
-
|
|
54
|
-
node === null || node === void 0 ? void 0 : (_node$cropper = node.cropper) === null || _node$cropper === void 0 ? void 0 : _node$cropper.destroy();
|
|
43
|
+
node === null || node === void 0 || (_node$cropper = node.cropper) === null || _node$cropper === void 0 || _node$cropper.destroy();
|
|
55
44
|
};
|
|
56
45
|
}, [onInitialized, dragMode, width, height, cropBoxResizable]);
|
|
57
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -63,6 +52,4 @@ var CropperWrapper = function CropperWrapper(_ref) {
|
|
|
63
52
|
})
|
|
64
53
|
});
|
|
65
54
|
};
|
|
66
|
-
|
|
67
|
-
var _default = CropperWrapper;
|
|
68
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = CropperWrapper;
|
|
@@ -4,24 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _TitleModal = _interopRequireDefault(require("../modal/TitleModal"));
|
|
9
|
-
|
|
10
8
|
var _CropImageModal = _interopRequireDefault(require("./subComponent/CropImageModal"));
|
|
11
|
-
|
|
12
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
const CropperModalHandler = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
src,
|
|
14
|
+
file,
|
|
15
|
+
width,
|
|
16
|
+
height,
|
|
17
|
+
cropBoxResizable = false,
|
|
18
|
+
onCrop,
|
|
19
|
+
onClose
|
|
20
|
+
} = _ref;
|
|
25
21
|
(0, _TitleModal.default)({
|
|
26
22
|
size: 'normal',
|
|
27
23
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CropImageModal.default, {
|
|
@@ -33,15 +29,13 @@ var CropperModalHandler = function CropperModalHandler(_ref) {
|
|
|
33
29
|
height: height,
|
|
34
30
|
cropBoxResizable: cropBoxResizable,
|
|
35
31
|
onCrop: onCrop,
|
|
36
|
-
onClose:
|
|
32
|
+
onClose: onClose
|
|
37
33
|
}),
|
|
38
|
-
onClose:
|
|
39
|
-
if (dismiss === true &&
|
|
40
|
-
|
|
34
|
+
onClose: dismiss => {
|
|
35
|
+
if (dismiss === true && onClose) {
|
|
36
|
+
onClose();
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
});
|
|
44
40
|
};
|
|
45
|
-
|
|
46
|
-
var _default = CropperModalHandler;
|
|
47
|
-
exports.default = _default;
|
|
41
|
+
var _default = exports.default = CropperModalHandler;
|
package/cropper/index.js
CHANGED
|
@@ -5,19 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "Cropper", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Cropper.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CropperModalHandler", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _CropperModalHandler.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
|
|
19
18
|
var _Cropper = _interopRequireDefault(require("./Cropper"));
|
|
20
|
-
|
|
21
19
|
var _CropperModalHandler = _interopRequireDefault(require("./CropperModalHandler"));
|
|
22
|
-
|
|
23
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -4,80 +4,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _reactI18next = require("react-i18next");
|
|
11
|
-
|
|
12
9
|
var _utils = require("@cashub/utils");
|
|
13
|
-
|
|
14
10
|
var _Cropper = _interopRequireDefault(require("../Cropper"));
|
|
15
|
-
|
|
16
11
|
var _Button = _interopRequireDefault(require("../../button/Button"));
|
|
17
|
-
|
|
18
12
|
var _ButtonGroup = _interopRequireDefault(require("../../button/ButtonGroup"));
|
|
19
|
-
|
|
20
13
|
var _TitleModal = _interopRequireDefault(require("../../modal/TitleModal"));
|
|
21
|
-
|
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
height = _ref.height,
|
|
44
|
-
_ref$cropBoxResizable = _ref.cropBoxResizable,
|
|
45
|
-
cropBoxResizable = _ref$cropBoxResizable === void 0 ? false : _ref$cropBoxResizable,
|
|
46
|
-
onCrop = _ref.onCrop,
|
|
47
|
-
onClose = _ref.onClose,
|
|
48
|
-
close = _ref.close;
|
|
49
|
-
|
|
50
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
51
|
-
t = _useTranslation.t;
|
|
52
|
-
|
|
53
|
-
var _useState = (0, _react.useState)(null),
|
|
54
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
-
instance = _useState2[0],
|
|
56
|
-
setIntance = _useState2[1];
|
|
57
|
-
|
|
58
|
-
var _useState3 = (0, _react.useState)(null),
|
|
59
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
-
resizedImage = _useState4[0],
|
|
61
|
-
setResizedImage = _useState4[1];
|
|
62
|
-
|
|
63
|
-
var handleCrop = (0, _react.useCallback)(function () {
|
|
16
|
+
const CropImageModal = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
src,
|
|
19
|
+
mime,
|
|
20
|
+
alt,
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
cropBoxResizable = false,
|
|
24
|
+
onCrop,
|
|
25
|
+
onClose,
|
|
26
|
+
close
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = (0, _reactI18next.useTranslation)();
|
|
31
|
+
const [instance, setIntance] = (0, _react.useState)(null);
|
|
32
|
+
const [resizedImage, setResizedImage] = (0, _react.useState)(null);
|
|
33
|
+
const handleCrop = (0, _react.useCallback)(() => {
|
|
64
34
|
onCrop(instance.getCroppedCanvas().toDataURL());
|
|
65
35
|
close();
|
|
66
36
|
}, [onCrop, instance, close]);
|
|
67
|
-
|
|
37
|
+
const handleInitialized = (0, _react.useCallback)(instance => {
|
|
68
38
|
setIntance(instance);
|
|
69
39
|
}, []);
|
|
70
|
-
|
|
71
|
-
var handleClose = function handleClose() {
|
|
40
|
+
const handleClose = () => {
|
|
72
41
|
if (onClose) {
|
|
73
42
|
onClose();
|
|
74
43
|
}
|
|
75
|
-
|
|
76
44
|
close();
|
|
77
45
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(0, _utils.resizeImage)(src, mime, width > height ? width : height, 'cover', function (resizedImageUrl) {
|
|
46
|
+
(0, _react.useEffect)(() => {
|
|
47
|
+
(0, _utils.resizeImage)(src, mime, width > height ? width : height, 'cover', resizedImageUrl => {
|
|
81
48
|
setResizedImage(resizedImageUrl);
|
|
82
49
|
});
|
|
83
50
|
}, [src, mime, height, width]);
|
|
@@ -109,6 +76,4 @@ var CropImageModal = function CropImageModal(_ref) {
|
|
|
109
76
|
})]
|
|
110
77
|
});
|
|
111
78
|
};
|
|
112
|
-
|
|
113
|
-
var _default = CropImageModal;
|
|
114
|
-
exports.default = _default;
|
|
79
|
+
var _default = exports.default = CropImageModal;
|