1mpacto-react-ui 2.0.16 → 2.0.17
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/dist/assets/style.css +1 -1
- package/dist/components/Alert/index.cjs +1 -0
- package/dist/components/Alert/index.mjs +220 -0
- package/dist/components/Alert/style.module.scss.cjs +1 -0
- package/dist/components/Alert/style.module.scss.mjs +14 -0
- package/dist/components/Badges/Badges.cjs +2 -0
- package/dist/components/Badges/Badges.config.cjs +1 -0
- package/dist/components/Badges/Badges.config.mjs +47 -0
- package/dist/components/Badges/Badges.mjs +29 -0
- package/dist/components/Badges/style.module.scss.cjs +1 -0
- package/dist/components/Badges/style.module.scss.mjs +40 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.config.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.config.mjs +16 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +67 -0
- package/dist/components/Breadcrumbs/style.module.scss.cjs +1 -0
- package/dist/components/Breadcrumbs/style.module.scss.mjs +16 -0
- package/dist/components/Button/Button.cjs +12 -0
- package/dist/components/Button/Button.config.cjs +1 -0
- package/dist/components/Button/Button.config.mjs +75 -0
- package/dist/components/Button/Button.mjs +75 -0
- package/dist/components/Button/style.module.scss.cjs +1 -0
- package/dist/components/Button/style.module.scss.mjs +58 -0
- package/dist/components/ButtonIcon/ButtonIcon.cjs +12 -0
- package/dist/components/ButtonIcon/ButtonIcon.config.cjs +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.config.mjs +68 -0
- package/dist/components/ButtonIcon/ButtonIcon.mjs +65 -0
- package/dist/components/ButtonIcon/style.module.scss.cjs +1 -0
- package/dist/components/ButtonIcon/style.module.scss.mjs +51 -0
- package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -0
- package/dist/components/ButtonPopover/ButtonPopover.mjs +84 -0
- package/dist/components/ButtonPopover/style.module.scss.cjs +1 -0
- package/dist/components/ButtonPopover/style.module.scss.mjs +10 -0
- package/dist/components/Calendar/Calendar.cjs +1 -0
- package/dist/components/Calendar/Calendar.mjs +199 -0
- package/dist/components/Calendar/CalendarButton.cjs +1 -0
- package/dist/components/Calendar/CalendarButton.mjs +18 -0
- package/dist/components/Calendar/CalendarCell.cjs +1 -0
- package/dist/components/Calendar/CalendarCell.mjs +26 -0
- package/dist/components/Calendar/CalendarMonth.cjs +1 -0
- package/dist/components/Calendar/CalendarMonth.mjs +74 -0
- package/dist/components/Calendar/CalendarRange.cjs +1 -0
- package/dist/components/Calendar/CalendarRange.mjs +140 -0
- package/dist/components/Calendar/CalendarYear.cjs +3 -0
- package/dist/components/Calendar/CalendarYear.mjs +74 -0
- package/dist/components/Calendar/style.module.scss.cjs +1 -0
- package/dist/components/Calendar/style.module.scss.mjs +36 -0
- package/dist/components/Chart/DoughnutChart.cjs +1 -0
- package/dist/components/Chart/DoughnutChart.mjs +173 -0
- package/dist/components/Chart/GradientBarChart.cjs +1 -0
- package/dist/components/Chart/GradientBarChart.mjs +157 -0
- package/dist/components/Chart/GradientLineChart.cjs +1 -0
- package/dist/components/Chart/GradientLineChart.mjs +143 -0
- package/dist/components/Chart/LineChart.cjs +1 -0
- package/dist/components/Chart/LineChart.mjs +158 -0
- package/dist/components/Chips/Chips.cjs +3 -0
- package/dist/components/Chips/Chips.config.cjs +1 -0
- package/dist/components/Chips/Chips.config.mjs +35 -0
- package/dist/components/Chips/Chips.mjs +37 -0
- package/dist/components/Chips/style.module.scss.cjs +1 -0
- package/dist/components/Chips/style.module.scss.mjs +14 -0
- package/dist/components/Collapse/Collapse.cjs +1 -0
- package/dist/components/Collapse/Collapse.mjs +35 -0
- package/dist/components/Collapse/CollapseV2.cjs +1 -0
- package/dist/components/Collapse/CollapseV2.mjs +30 -0
- package/dist/components/Collapse/style.module.scss.cjs +1 -0
- package/dist/components/Collapse/style.module.scss.mjs +7 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -0
- package/dist/components/DatePicker/DatePicker.mjs +125 -0
- package/dist/components/DatePicker/DateRangePicker.cjs +1 -0
- package/dist/components/DatePicker/DateRangePicker.mjs +112 -0
- package/dist/components/DatePicker/FilterDate.cjs +1 -0
- package/dist/components/DatePicker/FilterDate.mjs +248 -0
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -0
- package/dist/components/DatePicker/MonthYearPicker.mjs +83 -0
- package/dist/components/ErrorMessage/ErrorMessage.cjs +1 -0
- package/dist/components/ErrorMessage/ErrorMessage.config.cjs +1 -0
- package/dist/components/ErrorMessage/ErrorMessage.config.mjs +11 -0
- package/dist/components/ErrorMessage/ErrorMessage.mjs +6 -0
- package/dist/components/ErrorMessage/style.module.scss.cjs +1 -0
- package/dist/components/ErrorMessage/style.module.scss.mjs +8 -0
- package/dist/components/FilterContainer/FilterContainer.cjs +1 -0
- package/dist/components/FilterContainer/FilterContainer.mjs +63 -0
- package/dist/components/Input/InputFloatingInner.cjs +5 -0
- package/dist/components/Input/InputFloatingInner.config.cjs +1 -0
- package/dist/components/Input/InputFloatingInner.config.mjs +11 -0
- package/dist/components/Input/InputFloatingInner.mjs +65 -0
- package/dist/components/Input/InputFloatingInner.module.scss.cjs +1 -0
- package/dist/components/Input/InputFloatingInner.module.scss.mjs +20 -0
- package/dist/components/Input/InputInnerLabel.cjs +6 -0
- package/dist/components/Input/InputInnerLabel.config.cjs +1 -0
- package/dist/components/Input/InputInnerLabel.config.mjs +10 -0
- package/dist/components/Input/InputInnerLabel.mjs +78 -0
- package/dist/components/Input/InputInnerLabel.module.scss.cjs +1 -0
- package/dist/components/Input/InputInnerLabel.module.scss.mjs +20 -0
- package/dist/components/Input/InputNative.cjs +5 -0
- package/dist/components/Input/InputNative.config.cjs +1 -0
- package/dist/components/Input/InputNative.config.mjs +11 -0
- package/dist/components/Input/InputNative.mjs +58 -0
- package/dist/components/Input/InputNative.module.scss.cjs +1 -0
- package/dist/components/Input/InputNative.module.scss.mjs +18 -0
- package/dist/components/Input/InputReguler.cjs +5 -0
- package/dist/components/Input/InputReguler.config.cjs +1 -0
- package/dist/components/Input/InputReguler.config.mjs +11 -0
- package/dist/components/Input/InputReguler.mjs +79 -0
- package/dist/components/Input/InputReguler.module.scss.cjs +1 -0
- package/dist/components/Input/InputReguler.module.scss.mjs +24 -0
- package/dist/components/Modal/ModalDialog.cjs +1 -0
- package/dist/components/Modal/ModalDialog.config.cjs +1 -0
- package/dist/components/Modal/ModalDialog.config.mjs +12 -0
- package/dist/components/Modal/ModalDialog.mjs +44 -0
- package/dist/components/Modal/style.module.scss.cjs +1 -0
- package/dist/components/Modal/style.module.scss.mjs +14 -0
- package/dist/components/NumberFormat/NumberFormat.cjs +1 -0
- package/dist/components/NumberFormat/NumberFormat.mjs +33 -0
- package/dist/components/Pagination/Pagination.cjs +2 -0
- package/dist/components/Pagination/Pagination.config.cjs +1 -0
- package/dist/components/Pagination/Pagination.config.mjs +25 -0
- package/dist/components/Pagination/Pagination.mjs +231 -0
- package/dist/components/Pagination/style.module.scss.cjs +1 -0
- package/dist/components/Pagination/style.module.scss.mjs +20 -0
- package/dist/components/Popover/Popover.cjs +1 -0
- package/dist/components/Popover/Popover.mjs +78 -0
- package/dist/components/Popover/style.module.scss.cjs +1 -0
- package/dist/components/Popover/style.module.scss.mjs +7 -0
- package/dist/components/PortalComponent/PortalComponent.cjs +1 -0
- package/dist/components/PortalComponent/PortalComponent.mjs +18 -0
- package/dist/components/RadioCheckbox/CheckboxTable.cjs +1 -0
- package/dist/components/RadioCheckbox/CheckboxTable.mjs +27 -0
- package/dist/components/RadioCheckbox/RadioCheckbox.cjs +3 -0
- package/dist/components/RadioCheckbox/RadioCheckbox.config.cjs +1 -0
- package/dist/components/RadioCheckbox/RadioCheckbox.config.mjs +31 -0
- package/dist/components/RadioCheckbox/RadioCheckbox.mjs +84 -0
- package/dist/components/RadioCheckbox/RadioCheckbox.module.scss.cjs +1 -0
- package/dist/components/RadioCheckbox/RadioCheckbox.module.scss.mjs +26 -0
- package/dist/components/RadioCheckbox/RadioCheckboxLabel.cjs +4 -0
- package/dist/components/RadioCheckbox/RadioCheckboxLabel.config.cjs +1 -0
- package/dist/components/RadioCheckbox/RadioCheckboxLabel.config.mjs +20 -0
- package/dist/components/RadioCheckbox/RadioCheckboxLabel.mjs +55 -0
- package/dist/components/RadioCheckbox/RadioCheckboxLabel.module.scss.cjs +1 -0
- package/dist/components/RadioCheckbox/RadioCheckboxLabel.module.scss.mjs +19 -0
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -0
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.config.cjs +1 -0
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.config.mjs +27 -0
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +150 -0
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.module.scss.cjs +1 -0
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.module.scss.mjs +10 -0
- package/dist/components/SelectDropdownContainer/styleConfig.cjs +1 -0
- package/dist/components/SelectDropdownContainer/styleConfig.mjs +277 -0
- package/dist/components/Sidebar/ItemSidebar.cjs +8 -0
- package/dist/components/Sidebar/ItemSidebar.config.cjs +1 -0
- package/dist/components/Sidebar/ItemSidebar.config.mjs +42 -0
- package/dist/components/Sidebar/ItemSidebar.mjs +122 -0
- package/dist/components/Sidebar/Sidebar.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.config.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.config.mjs +25 -0
- package/dist/components/Sidebar/Sidebar.mjs +136 -0
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.module.scss.mjs +26 -0
- package/dist/components/Sidebar/itemSidebar.module.scss.cjs +1 -0
- package/dist/components/Sidebar/itemSidebar.module.scss.mjs +31 -0
- package/dist/components/Step/Step.cjs +5 -0
- package/dist/components/Step/Step.mjs +85 -0
- package/dist/components/Step/Step.module.scss.cjs +1 -0
- package/dist/components/Step/Step.module.scss.mjs +17 -0
- package/dist/components/Step/StepIndicator.cjs +4 -0
- package/dist/components/Step/StepIndicator.mjs +65 -0
- package/dist/components/Step/StepIndicator.module.scss.cjs +1 -0
- package/dist/components/Step/StepIndicator.module.scss.mjs +16 -0
- package/dist/components/Switch/Switch.cjs +1 -0
- package/dist/components/Switch/Switch.config.cjs +1 -0
- package/dist/components/Switch/Switch.config.mjs +28 -0
- package/dist/components/Switch/Switch.mjs +53 -0
- package/dist/components/Switch/style.module.scss.cjs +1 -0
- package/dist/components/Switch/style.module.scss.mjs +23 -0
- package/dist/components/TPublish/TPublish.cjs +1 -0
- package/dist/components/TPublish/TPublish.mjs +5 -0
- package/dist/components/Table/Table.cjs +3 -0
- package/dist/components/Table/Table.config.cjs +1 -0
- package/dist/components/Table/Table.config.mjs +69 -0
- package/dist/components/Table/Table.mjs +402 -0
- package/dist/components/Table/Table.module.scss.cjs +1 -0
- package/dist/components/Table/Table.module.scss.mjs +19 -0
- package/dist/components/Table/TableSubMobile.cjs +1 -0
- package/dist/components/Table/TableSubMobile.mjs +37 -0
- package/dist/components/Table/TableSubMobile.module.scss.cjs +1 -0
- package/dist/components/Table/TableSubMobile.module.scss.mjs +6 -0
- package/dist/components/Tabs/TabPanel.cjs +1 -0
- package/dist/components/Tabs/TabPanel.mjs +14 -0
- package/dist/components/Tabs/Tabs.cjs +8 -0
- package/dist/components/Tabs/Tabs.config.cjs +1 -0
- package/dist/components/Tabs/Tabs.config.mjs +33 -0
- package/dist/components/Tabs/Tabs.mjs +112 -0
- package/dist/components/Tabs/style.module.scss.cjs +1 -0
- package/dist/components/Tabs/style.module.scss.mjs +30 -0
- package/dist/components/Text/Text.cjs +5 -0
- package/dist/components/Text/Text.mjs +39 -0
- package/dist/components/TextEditor/TextEditor.cjs +1 -0
- package/dist/components/TextEditor/TextEditor.mjs +9 -0
- package/dist/components/TextEditor/style.module.scss.cjs +1 -0
- package/dist/components/TextEditor/style.module.scss.mjs +7 -0
- package/dist/components/Textarea/Textarea.cjs +7 -0
- package/dist/components/Textarea/Textarea.config.cjs +1 -0
- package/dist/components/Textarea/Textarea.config.mjs +33 -0
- package/dist/components/Textarea/Textarea.mjs +87 -0
- package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -0
- package/dist/components/Textarea/TextareaFloatingInner.config.cjs +1 -0
- package/dist/components/Textarea/TextareaFloatingInner.config.mjs +9 -0
- package/dist/components/Textarea/TextareaFloatingInner.mjs +101 -0
- package/dist/components/Textarea/TextareaFloatingInner.module.scss.cjs +1 -0
- package/dist/components/Textarea/TextareaFloatingInner.module.scss.mjs +17 -0
- package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -0
- package/dist/components/Textarea/TextareaInnerLabel.config.cjs +1 -0
- package/dist/components/Textarea/TextareaInnerLabel.config.mjs +10 -0
- package/dist/components/Textarea/TextareaInnerLabel.mjs +87 -0
- package/dist/components/Textarea/TextareaInnerLabel.module.scss.cjs +1 -0
- package/dist/components/Textarea/TextareaInnerLabel.module.scss.mjs +17 -0
- package/dist/components/Textarea/style.module.scss.cjs +1 -0
- package/dist/components/Textarea/style.module.scss.mjs +25 -0
- package/dist/components/TimeRange/TimeRange.cjs +1 -0
- package/dist/components/TimeRange/TimeRange.mjs +187 -0
- package/dist/components/TimeRange/TimeRange.module.scss.cjs +1 -0
- package/dist/components/TimeRange/TimeRange.module.scss.mjs +23 -0
- package/dist/components/Timeline/Timeline.cjs +1 -0
- package/dist/components/Timeline/Timeline.mjs +12 -0
- package/dist/components/Timeline/style.module.scss.cjs +1 -0
- package/dist/components/Timeline/style.module.scss.mjs +14 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.mjs +77 -0
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.module.scss.mjs +8 -0
- package/dist/components/TruncateComponent/TruncateComponent.cjs +1 -0
- package/dist/components/TruncateComponent/TruncateComponent.mjs +83 -0
- package/dist/components/Upload/UploadFile.cjs +1 -0
- package/dist/components/Upload/UploadFile.mjs +94 -0
- package/dist/components/Upload/UploadFile.module.scss.cjs +1 -0
- package/dist/components/Upload/UploadFile.module.scss.mjs +6 -0
- package/dist/components/Upload/UploadImage.cjs +12 -0
- package/dist/components/Upload/UploadImage.mjs +162 -0
- package/dist/components/Upload/UploadImage.module.scss.cjs +1 -0
- package/dist/components/Upload/UploadImage.module.scss.mjs +14 -0
- package/dist/components/Upload/UploadMultipleFile.cjs +1 -0
- package/dist/components/Upload/UploadMultipleFile.mjs +85 -0
- package/dist/components/Upload/UploadMultipleFile.module.scss.cjs +1 -0
- package/dist/components/Upload/UploadMultipleFile.module.scss.mjs +14 -0
- package/dist/components/Virtualization/ListVirtualization.cjs +1 -0
- package/dist/components/Virtualization/ListVirtualization.mjs +82 -0
- package/dist/components/Virtualization/TableVirtualization.cjs +1 -0
- package/dist/components/Virtualization/TableVirtualization.mjs +84 -0
- package/dist/config/bigNumber/index.cjs +1 -0
- package/dist/config/bigNumber/index.mjs +15 -0
- package/dist/config/components/borderRadius.cjs +1 -0
- package/dist/config/components/borderRadius.mjs +14 -0
- package/dist/config/components/font.cjs +1 -0
- package/dist/config/components/font.mjs +8 -0
- package/dist/config/components/gap.cjs +1 -0
- package/dist/config/components/gap.mjs +110 -0
- package/dist/config/components/tinymce.cjs +28 -0
- package/dist/config/components/tinymce.mjs +81 -0
- package/dist/config/components/typography.cjs +1 -0
- package/dist/config/components/typography.mjs +83 -0
- package/dist/config/resources/index.cjs +1 -0
- package/dist/config/resources/index.mjs +4 -0
- package/dist/config/tailwind/colors.cjs +1 -0
- package/dist/config/tailwind/colors.mjs +291 -0
- package/dist/config/tailwind/nativeScreen.cjs +1 -0
- package/dist/config/tailwind/nativeScreen.mjs +11 -0
- package/dist/config/tailwind/screen.cjs +1 -0
- package/dist/config/tailwind/screen.mjs +11 -0
- package/dist/config/tailwind/typography.cjs +1 -0
- package/dist/config/tailwind/typography.mjs +158 -0
- package/dist/hooks/useAsyncDebounce.cjs +1 -0
- package/dist/hooks/useAsyncDebounce.mjs +21 -0
- package/dist/hooks/useCombinedResizeObserver.cjs +1 -0
- package/dist/hooks/useCombinedResizeObserver.mjs +48 -0
- package/dist/hooks/useCountdown.cjs +1 -0
- package/dist/hooks/useCountdown.mjs +38 -0
- package/dist/hooks/useDeepCompareEffect.cjs +1 -0
- package/dist/hooks/useDeepCompareEffect.mjs +14 -0
- package/dist/hooks/useElementOrWindowMediaQuery.cjs +1 -0
- package/dist/hooks/useElementOrWindowMediaQuery.mjs +23 -0
- package/dist/hooks/useEventListener.cjs +1 -0
- package/dist/hooks/useEventListener.mjs +19 -0
- package/dist/hooks/useMasonry.cjs +1 -0
- package/dist/hooks/useMasonry.mjs +53 -0
- package/dist/hooks/useMergeRefs.cjs +1 -0
- package/dist/hooks/useMergeRefs.mjs +29 -0
- package/dist/hooks/useOtpInput.cjs +1 -0
- package/dist/hooks/useOtpInput.mjs +115 -0
- package/dist/hooks/useStateRef.cjs +1 -0
- package/dist/hooks/useStateRef.mjs +10 -0
- package/dist/index.cjs +1 -247
- package/dist/index.mjs +207 -51684
- package/dist/package.json.cjs +1 -0
- package/dist/package.json.d.ts +3 -2
- package/dist/package.json.mjs +7 -0
- package/dist/public/assets/icons/arrow-narrow-down.svg.cjs +1 -0
- package/dist/public/assets/icons/arrow-narrow-down.svg.mjs +4 -0
- package/dist/utils/axiosBigNumber.cjs +1 -0
- package/dist/utils/axiosBigNumber.mjs +32 -0
- package/dist/utils/common.cjs +1 -0
- package/dist/utils/common.mjs +264 -0
- package/dist/utils/cookies.cjs +1 -0
- package/dist/utils/cookies.mjs +48 -0
- package/dist/utils/formatBigNumber.cjs +1 -0
- package/dist/utils/formatBigNumber.mjs +39 -0
- package/dist/utils/yup.cjs +1 -0
- package/dist/utils/yup.mjs +78 -0
- package/package.json +3 -2
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsxs as L, jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { Doughnut as T } from "react-chartjs-2";
|
|
3
|
+
import { Chart as R, CategoryScale as F, LinearScale as M, PointElement as Y, LineElement as B, ArcElement as O, Title as k, Tooltip as N, Legend as P } from "chart.js";
|
|
4
|
+
R.register(F, M, Y, B, O, k, N, P);
|
|
5
|
+
const j = (f, n) => {
|
|
6
|
+
var m, v, x, y;
|
|
7
|
+
const C = f.getVisibleDatasetCount(), g = f.getDatasetMeta(C - 1).data.at(0);
|
|
8
|
+
if (g) {
|
|
9
|
+
const { innerRadius: $ } = g.getProps(["innerRadius"]), { ctx: s } = f, w = () => {
|
|
10
|
+
var u;
|
|
11
|
+
const c = [].concat(n), d = c.length, o = s.font;
|
|
12
|
+
let r = 0, p = 0, l;
|
|
13
|
+
for (l = 0; l < d; ++l)
|
|
14
|
+
s.font = c[l].font, r = Math.max(s.measureText(c[l].text).width, r), p += (u = c[l].font) == null ? void 0 : u.lineHeight;
|
|
15
|
+
return s.font = o, {
|
|
16
|
+
height: p,
|
|
17
|
+
width: r
|
|
18
|
+
};
|
|
19
|
+
}, D = (c, d) => {
|
|
20
|
+
let o = document.createElement("div");
|
|
21
|
+
document.body.appendChild(o), o.style.fontSize = `${d}px`, o.style.position = "absolute", o.style.left = "-10", o.style.top = "-10", o.textContent = c;
|
|
22
|
+
const r = {
|
|
23
|
+
width: o.clientWidth,
|
|
24
|
+
height: o.clientHeight
|
|
25
|
+
};
|
|
26
|
+
return document.body.removeChild(o), o = null, r;
|
|
27
|
+
}, S = w(), b = parseFloat(parseFloat($).toFixed(2));
|
|
28
|
+
s.textAlign = "center", s.textBaseline = "middle";
|
|
29
|
+
const I = (f.chartArea.left + f.chartArea.right) / 2, e = (f.chartArea.top + f.chartArea.bottom) / 2 - S.height / 2;
|
|
30
|
+
let t;
|
|
31
|
+
const z = n.length;
|
|
32
|
+
let E = 0;
|
|
33
|
+
for (t = 0; t < z; ++t) {
|
|
34
|
+
let c = (m = n[t].font) == null ? void 0 : m.size, d = (v = n[t].font) == null ? void 0 : v.lineHeight;
|
|
35
|
+
const o = typeof n[t].text == "number" ? n[t].text.toString() : n[t].text;
|
|
36
|
+
for (; D(o, c).width > b + (n[t].id === "value" ? 50 : 0); )
|
|
37
|
+
c -= 1, d = D(o, c).height;
|
|
38
|
+
o.length > 22 && d < 14 && (d = 18);
|
|
39
|
+
const r = e + d / 2 + E, p = typeof n[t].text == "number" ? new Intl.NumberFormat("id-ID", { style: "currency", currency: "IDR" }).format(
|
|
40
|
+
n[t].text
|
|
41
|
+
) : n[t].text;
|
|
42
|
+
let l = n[t].urlIconDesc ? " " : "";
|
|
43
|
+
if (n[t].percentage !== void 0 ? l += `${n[t].percentage}% ${n[t].text}` : l += p, s.fillStyle = n[t].color, s.font = `${c < 10 ? 10 : c}px sans-serif`, E += d, n[t].percentage !== void 0 && n[t].urlIconDesc) {
|
|
44
|
+
const h = ((y = (x = n[t]) == null ? void 0 : x.percentage) == null ? void 0 : y.length) ?? 0, u = new Image();
|
|
45
|
+
u.src = n[t].urlIconDesc, s.drawImage(u, 45 - (h > 6 ? h + 2 : h - 2.5), r - 8, 16, 14);
|
|
46
|
+
}
|
|
47
|
+
s.fillText(l, I, r);
|
|
48
|
+
}
|
|
49
|
+
s.restore(), s.save();
|
|
50
|
+
}
|
|
51
|
+
}, V = ({
|
|
52
|
+
labels: f,
|
|
53
|
+
data: n,
|
|
54
|
+
backgroundColor: C,
|
|
55
|
+
options: g = {},
|
|
56
|
+
redraw: m,
|
|
57
|
+
widthInnerDoughnut: v,
|
|
58
|
+
innerLabels: x,
|
|
59
|
+
open: y = !0,
|
|
60
|
+
keyRemoveDataOpen: $ = "gap",
|
|
61
|
+
keyLabel: s = "title",
|
|
62
|
+
keyValue: w = "originalValue",
|
|
63
|
+
keyBackground: D = "backgroundColor",
|
|
64
|
+
className: S
|
|
65
|
+
}) => {
|
|
66
|
+
const b = {
|
|
67
|
+
labels: f || n.map((i) => i[s]),
|
|
68
|
+
datasets: [
|
|
69
|
+
{
|
|
70
|
+
data: n.map((i) => i[w]),
|
|
71
|
+
backgroundColor: C || n.map((i) => i[D])
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}, I = {
|
|
75
|
+
cutout: v,
|
|
76
|
+
animation: { duration: m ? 400 : 0 },
|
|
77
|
+
plugins: {
|
|
78
|
+
legend: { display: !1 },
|
|
79
|
+
tooltip: {
|
|
80
|
+
external(i) {
|
|
81
|
+
let e = document.getElementById("chartjs-tooltip");
|
|
82
|
+
e || (e = document.createElement("div"), e.id = "chartjs-tooltip", e.innerHTML = "<table></table>", document.body.appendChild(e));
|
|
83
|
+
const t = i.tooltip;
|
|
84
|
+
if (t.opacity === 0) {
|
|
85
|
+
e.style.opacity = "0";
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
e.classList.remove("above", "below", "no-transform"), t.yAlign ? e.classList.add(t.yAlign) : e.classList.add("no-transform");
|
|
89
|
+
const z = n.filter((r) => !r[s]), E = n.filter((r) => r[w] > 0 && r[w] < 1);
|
|
90
|
+
if (z.length === 1 && E.length === 1) return;
|
|
91
|
+
function c(r) {
|
|
92
|
+
return r.lines;
|
|
93
|
+
}
|
|
94
|
+
if (t.body) {
|
|
95
|
+
const r = t.title || [];
|
|
96
|
+
let p = t.body.map(c), l = "<thead>";
|
|
97
|
+
r.forEach((u) => {
|
|
98
|
+
let a = "";
|
|
99
|
+
a += "display: flex", a += "; justify-content: center", a += "; font-weight: 600", a += "; font-size: 12px", a += "; padding: 0px 14px", l += `<tr><span style="${a}">${u}</span></tr>`;
|
|
100
|
+
}), l += "</thead><tbody>", p.length > 1 && p[0][0] === p[1][0] && (p = [p[0]]), p.forEach((u) => {
|
|
101
|
+
let a = "";
|
|
102
|
+
a += "display: flex", a += "; justify-content: center", a += "; color: #0163C8", a += "; padding: 0px 14px", a += "; font-size: 12px";
|
|
103
|
+
const H = `<span style="${a}">${u}</span>`;
|
|
104
|
+
l += `<tr><td>${H}</td></tr>`;
|
|
105
|
+
}), l += "</tbody>";
|
|
106
|
+
const h = e.querySelector("table");
|
|
107
|
+
h && (h.innerHTML = l);
|
|
108
|
+
}
|
|
109
|
+
const d = i.chart.canvas.getBoundingClientRect(), o = d.top + window.pageYOffset + t.caretY;
|
|
110
|
+
e.style.opacity = "1", e.style.border = "solid 1px #0163C8", e.style.background = "white", e.style.height = "fit-content", e.style.borderRadius = "10px", e.style.position = "absolute", e.style.zIndex = "10", e.style.padding = "4px 0", e.style.left = `${d.left + window.pageXOffset + t.caretX - 80}px`, e.style.top = `${o > 300 && !y ? 280 : o}px`, e.style.pointerEvents = "none";
|
|
111
|
+
},
|
|
112
|
+
displayColors: !0,
|
|
113
|
+
enabled: !1,
|
|
114
|
+
callbacks: {
|
|
115
|
+
title(i) {
|
|
116
|
+
const e = n[i[0].dataIndex];
|
|
117
|
+
return e == null ? void 0 : e[s];
|
|
118
|
+
},
|
|
119
|
+
label(i) {
|
|
120
|
+
const e = n == null ? void 0 : n[i.dataIndex];
|
|
121
|
+
let t = "Nilai: ";
|
|
122
|
+
return e && (t += e.value), t;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
elements: {
|
|
128
|
+
arc: {
|
|
129
|
+
borderWidth: 0
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ L("div", { className: S ?? "", children: [
|
|
134
|
+
!y && /* @__PURE__ */ A(
|
|
135
|
+
T,
|
|
136
|
+
{
|
|
137
|
+
data: b,
|
|
138
|
+
redraw: m,
|
|
139
|
+
plugins: [
|
|
140
|
+
{
|
|
141
|
+
id: "draw",
|
|
142
|
+
beforeDraw(i) {
|
|
143
|
+
j(i, x);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
options: Object.keys(g).length > 1 ? g : I
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
y && /* @__PURE__ */ A(
|
|
151
|
+
T,
|
|
152
|
+
{
|
|
153
|
+
data: b,
|
|
154
|
+
redraw: m,
|
|
155
|
+
plugins: [
|
|
156
|
+
{
|
|
157
|
+
id: "draw",
|
|
158
|
+
beforeDraw(i) {
|
|
159
|
+
j(
|
|
160
|
+
i,
|
|
161
|
+
x.filter((e) => e.id !== $)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
options: Object.keys(g).length > 1 ? g : I
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
] });
|
|
170
|
+
};
|
|
171
|
+
export {
|
|
172
|
+
V as default
|
|
173
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("react/jsx-runtime"),y=require("chart.js"),x=require("react"),j=require("react-chartjs-2"),R=require("../../utils/common.cjs"),w=require("../PortalComponent/PortalComponent.cjs");y.Chart.register(y.CategoryScale,y.LinearScale,y.BarElement,y.Tooltip,y.PointElement,y.Filler,y.Tooltip);const E=a=>({chart:n,tooltip:s})=>{var C,g,B,l,f,S;const c={};if(s.opacity===0){a(D=>({...D,style:{...D.style,opacity:0,pointerEvents:"none"}}));return}if(!s.dataPoints||s.dataPoints.length===0)return;c.opacity="1",c.position="absolute",c.pointerEvents="none";const o=n.canvas.getBoundingClientRect();c.left=o.left+window.pageXOffset+s.caretX+"px",c.top=o.top+window.pageYOffset+s.caretY+"px";const d=((g=(C=s.dataPoints)==null?void 0:C[0])==null?void 0:g.label)??"",r=((l=(B=s.dataPoints)==null?void 0:B[0])==null?void 0:l.raw)??"",i=((S=(f=s.dataPoints)==null?void 0:f[0])==null?void 0:S.dataset.label)??"";a({dataset:i,label:d,value:r,style:c,dataPoints:s.dataPoints})},F={id:"labelplugin",afterDatasetsDraw(a){const{ctx:n,chartArea:{top:s,bottom:c}}=a;n.save(),a.data.datasets.forEach((o,d)=>{const r=a.getDatasetMeta(d);r.visible&&r.data.forEach((i,C)=>{const g=o.data[C]||0,B=o!=null&&o.setDigit?R.setDigit(String(g)):String(g);n.font="12px Lato",n.textAlign="center";let l,f=!1;typeof g=="number"&&g>=0?(n.textBaseline="bottom",n.fillStyle=(o==null?void 0:o.colorTextLabelPositive)||i.options.borderColor,l=i.y-5,l>s&&(f=!0)):(n.textBaseline="top",n.fillStyle=(o==null?void 0:o.colorTextLabelNegative)||i.options.borderColor,l=i.y+5,l<c&&(f=!0)),f&&n.fillText(B,i.x,l)})}),n.restore()}},O={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{grace:"15%",position:"left",border:{display:!1,dash:[5,3],color:"#CFD8DC"},ticks:{callback:function(a){return R.setDigit(a)??0},font:{size:10,weight:"normal"},padding:10,color:"#898989"}},x:{grid:{display:!1},border:{dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},color:"#898989"}}},interaction:{mode:"index",intersect:!1}},q=({data:a,classNameContainer:n,height:s,id:c,options:o,CustomTooltip:d})=>{const r=x.useRef(void 0),i=x.useRef(0),C=x.useRef(0),[g,B]=x.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),l=x.useCallback(function({ctx:P,chartArea:t,scales:u,chartHeight:p,gradientFor:h,item:e}){let v=(u.y.getPixelForValue(0)-t.top)/p;v=v<0?0:v>1?1:v,r.current=P.createLinearGradient(0,t.top,0,p+t.top),h==="background"?(r.current.addColorStop(0,(e==null?void 0:e.colorBackgroundPositiveZero)||"#9FD2FF"),r.current.addColorStop(v,(e==null?void 0:e.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),r.current.addColorStop(v,(e==null?void 0:e.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),r.current.addColorStop(1,(e==null?void 0:e.colorBackgroundNegativeOne)||"#EB6B6B")):(r.current.addColorStop(v,(e==null?void 0:e.colorBorderPositive)||"#80CBC4"),r.current.addColorStop(v,(e==null?void 0:e.colorBorderNegative)||"#EB6B6B"))},[]),f=x.useCallback(function({ctx:P,chartArea:t,scales:u,gradientFor:p,item:h}){const e=t.right-t.left,b=t.bottom-t.top;return(!r.current||i.current!==e||C.current!==b)&&(i.current=e,C.current=b,l({ctx:P,chartArea:t,scales:u,chartHeight:b,gradientFor:p,item:h})),l({ctx:P,chartArea:t,scales:u,chartHeight:b,gradientFor:p,item:h}),r.current},[]),S=x.useMemo(()=>({...a,datasets:a.datasets.map(t=>({fill:!0,backgroundColor:function(u){const p=u.chart,{ctx:h,chartArea:e,scales:b}=p;if(e)return f({ctx:h,chartArea:e,scales:b,gradientFor:"background",item:t})},borderColor:function(u){const p=u.chart,{ctx:h,chartArea:e,scales:b}=p;if(e)return f({ctx:h,chartArea:e,scales:b,gradientFor:"border",item:t})},borderWidth:0,tension:0,pointRadius:0,pointHoverRadius:4,setDigit:!0,...t,data:t.data}))}),[a]),D=x.useMemo(()=>{const P={plugins:{tooltip:{enabled:!d,external:({chart:t,tooltip:u})=>d?E(B)({chart:t,tooltip:u}):void 0}}};return R.mergeObjects(O,P,o??{})},[o,d]);return k.jsxs("div",{id:c,className:n,style:{height:s||"300px"},children:[d&&k.jsx(w.default,{selector:"body",children:k.jsx(d,{...g})}),k.jsx(j.Bar,{data:S,options:D,plugins:[F]})]})};exports.default=q;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsxs as w, jsx as k } from "react/jsx-runtime";
|
|
2
|
+
import { Chart as E, CategoryScale as F, LinearScale as O, BarElement as L, Tooltip as D, PointElement as Z, Filler as N } from "chart.js";
|
|
3
|
+
import v from "react";
|
|
4
|
+
import { Bar as G } from "react-chartjs-2";
|
|
5
|
+
import { mergeObjects as j, setDigit as R } from "../../utils/common.mjs";
|
|
6
|
+
import H from "../PortalComponent/PortalComponent.mjs";
|
|
7
|
+
E.register(F, O, L, D, Z, N, D);
|
|
8
|
+
const M = (s) => ({ chart: n, tooltip: a }) => {
|
|
9
|
+
var C, f, x, l, p, B;
|
|
10
|
+
const i = {};
|
|
11
|
+
if (a.opacity === 0) {
|
|
12
|
+
s((S) => ({ ...S, style: { ...S.style, opacity: 0, pointerEvents: "none" } }));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!a.dataPoints || a.dataPoints.length === 0)
|
|
16
|
+
return;
|
|
17
|
+
i.opacity = "1", i.position = "absolute", i.pointerEvents = "none";
|
|
18
|
+
const e = n.canvas.getBoundingClientRect();
|
|
19
|
+
i.left = e.left + window.pageXOffset + a.caretX + "px", i.top = e.top + window.pageYOffset + a.caretY + "px";
|
|
20
|
+
const u = ((f = (C = a.dataPoints) == null ? void 0 : C[0]) == null ? void 0 : f.label) ?? "", r = ((l = (x = a.dataPoints) == null ? void 0 : x[0]) == null ? void 0 : l.raw) ?? "", c = ((B = (p = a.dataPoints) == null ? void 0 : p[0]) == null ? void 0 : B.dataset.label) ?? "";
|
|
21
|
+
s({
|
|
22
|
+
dataset: c,
|
|
23
|
+
label: u,
|
|
24
|
+
value: r,
|
|
25
|
+
style: i,
|
|
26
|
+
dataPoints: a.dataPoints
|
|
27
|
+
});
|
|
28
|
+
}, z = {
|
|
29
|
+
id: "labelplugin",
|
|
30
|
+
afterDatasetsDraw(s) {
|
|
31
|
+
const {
|
|
32
|
+
ctx: n,
|
|
33
|
+
chartArea: { top: a, bottom: i }
|
|
34
|
+
} = s;
|
|
35
|
+
n.save(), s.data.datasets.forEach((e, u) => {
|
|
36
|
+
const r = s.getDatasetMeta(u);
|
|
37
|
+
r.visible && r.data.forEach((c, C) => {
|
|
38
|
+
const f = e.data[C] || 0, x = e != null && e.setDigit ? R(String(f)) : String(f);
|
|
39
|
+
n.font = "12px Lato", n.textAlign = "center";
|
|
40
|
+
let l, p = !1;
|
|
41
|
+
typeof f == "number" && f >= 0 ? (n.textBaseline = "bottom", n.fillStyle = (e == null ? void 0 : e.colorTextLabelPositive) || c.options.borderColor, l = c.y - 5, l > a && (p = !0)) : (n.textBaseline = "top", n.fillStyle = (e == null ? void 0 : e.colorTextLabelNegative) || c.options.borderColor, l = c.y + 5, l < i && (p = !0)), p && n.fillText(x, c.x, l);
|
|
42
|
+
});
|
|
43
|
+
}), n.restore();
|
|
44
|
+
}
|
|
45
|
+
}, T = {
|
|
46
|
+
responsive: !0,
|
|
47
|
+
maintainAspectRatio: !1,
|
|
48
|
+
plugins: {
|
|
49
|
+
legend: {
|
|
50
|
+
display: !1
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
scales: {
|
|
54
|
+
y: {
|
|
55
|
+
grace: "15%",
|
|
56
|
+
position: "left",
|
|
57
|
+
border: { display: !1, dash: [5, 3], color: "#CFD8DC" },
|
|
58
|
+
ticks: {
|
|
59
|
+
callback: function(s) {
|
|
60
|
+
return R(s) ?? 0;
|
|
61
|
+
},
|
|
62
|
+
font: {
|
|
63
|
+
size: 10,
|
|
64
|
+
weight: "normal"
|
|
65
|
+
},
|
|
66
|
+
padding: 10,
|
|
67
|
+
color: "#898989"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
x: {
|
|
71
|
+
grid: {
|
|
72
|
+
display: !1
|
|
73
|
+
},
|
|
74
|
+
border: { dash: [5, 3], color: "#CFD8DC" },
|
|
75
|
+
ticks: {
|
|
76
|
+
font: {
|
|
77
|
+
size: 10,
|
|
78
|
+
weight: "normal"
|
|
79
|
+
},
|
|
80
|
+
color: "#898989"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
interaction: {
|
|
85
|
+
mode: "index",
|
|
86
|
+
intersect: !1
|
|
87
|
+
}
|
|
88
|
+
}, K = ({ data: s, classNameContainer: n, height: a, id: i, options: e, CustomTooltip: u }) => {
|
|
89
|
+
const r = v.useRef(void 0), c = v.useRef(0), C = v.useRef(0), [f, x] = v.useState({
|
|
90
|
+
dataset: "",
|
|
91
|
+
label: "",
|
|
92
|
+
value: 0,
|
|
93
|
+
style: { opacity: 0, position: "absolute", left: 0, bottom: 0 },
|
|
94
|
+
dataPoints: []
|
|
95
|
+
}), l = v.useCallback(function({
|
|
96
|
+
ctx: P,
|
|
97
|
+
chartArea: t,
|
|
98
|
+
scales: d,
|
|
99
|
+
chartHeight: g,
|
|
100
|
+
gradientFor: y,
|
|
101
|
+
item: o
|
|
102
|
+
}) {
|
|
103
|
+
let h = (d.y.getPixelForValue(0) - t.top) / g;
|
|
104
|
+
h = h < 0 ? 0 : h > 1 ? 1 : h, r.current = P.createLinearGradient(0, t.top, 0, g + t.top), y === "background" ? (r.current.addColorStop(0, (o == null ? void 0 : o.colorBackgroundPositiveZero) || "#9FD2FF"), r.current.addColorStop(
|
|
105
|
+
h,
|
|
106
|
+
(o == null ? void 0 : o.colorBackgroundPositivePercentage) || "rgba(115, 235, 163, 0.1)"
|
|
107
|
+
), r.current.addColorStop(
|
|
108
|
+
h,
|
|
109
|
+
(o == null ? void 0 : o.colorBackgroundNegativePercentage) || "rgba(235, 107, 107, 0.1)"
|
|
110
|
+
), r.current.addColorStop(1, (o == null ? void 0 : o.colorBackgroundNegativeOne) || "#EB6B6B")) : (r.current.addColorStop(h, (o == null ? void 0 : o.colorBorderPositive) || "#80CBC4"), r.current.addColorStop(h, (o == null ? void 0 : o.colorBorderNegative) || "#EB6B6B"));
|
|
111
|
+
}, []), p = v.useCallback(function({
|
|
112
|
+
ctx: P,
|
|
113
|
+
chartArea: t,
|
|
114
|
+
scales: d,
|
|
115
|
+
gradientFor: g,
|
|
116
|
+
item: y
|
|
117
|
+
}) {
|
|
118
|
+
const o = t.right - t.left, b = t.bottom - t.top;
|
|
119
|
+
return (!r.current || c.current !== o || C.current !== b) && (c.current = o, C.current = b, l({ ctx: P, chartArea: t, scales: d, chartHeight: b, gradientFor: g, item: y })), l({ ctx: P, chartArea: t, scales: d, chartHeight: b, gradientFor: g, item: y }), r.current;
|
|
120
|
+
}, []), B = v.useMemo(() => ({
|
|
121
|
+
...s,
|
|
122
|
+
datasets: s.datasets.map((t) => ({
|
|
123
|
+
fill: !0,
|
|
124
|
+
backgroundColor: function(d) {
|
|
125
|
+
const g = d.chart, { ctx: y, chartArea: o, scales: b } = g;
|
|
126
|
+
if (o)
|
|
127
|
+
return p({ ctx: y, chartArea: o, scales: b, gradientFor: "background", item: t });
|
|
128
|
+
},
|
|
129
|
+
borderColor: function(d) {
|
|
130
|
+
const g = d.chart, { ctx: y, chartArea: o, scales: b } = g;
|
|
131
|
+
if (o)
|
|
132
|
+
return p({ ctx: y, chartArea: o, scales: b, gradientFor: "border", item: t });
|
|
133
|
+
},
|
|
134
|
+
borderWidth: 0,
|
|
135
|
+
tension: 0,
|
|
136
|
+
pointRadius: 0,
|
|
137
|
+
pointHoverRadius: 4,
|
|
138
|
+
setDigit: !0,
|
|
139
|
+
...t,
|
|
140
|
+
data: t.data
|
|
141
|
+
}))
|
|
142
|
+
}), [s]), S = v.useMemo(() => j(T, {
|
|
143
|
+
plugins: {
|
|
144
|
+
tooltip: {
|
|
145
|
+
enabled: !u,
|
|
146
|
+
external: ({ chart: t, tooltip: d }) => u ? M(x)({ chart: t, tooltip: d }) : void 0
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, e ?? {}), [e, u]);
|
|
150
|
+
return /* @__PURE__ */ w("div", { id: i, className: n, style: { height: a || "300px" }, children: [
|
|
151
|
+
u && /* @__PURE__ */ k(H, { selector: "body", children: /* @__PURE__ */ k(u, { ...f }) }),
|
|
152
|
+
/* @__PURE__ */ k(G, { data: B, options: S, plugins: [z] })
|
|
153
|
+
] });
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
K as default
|
|
157
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("react/jsx-runtime"),P=require("chart.js"),p=require("react"),j=require("react-chartjs-2"),w=require("../../utils/common.cjs"),D=require("../PortalComponent/PortalComponent.cjs");P.Chart.register(P.CategoryScale,P.LinearScale,P.PointElement,P.LineElement,P.Filler,P.Tooltip);const F=r=>({chart:u,tooltip:t})=>{var v,x,B,y,C,S;const s={};if(t.opacity===0){r(k=>({...k,style:{...k.style,opacity:0,pointerEvents:"none"}}));return}if(!t.dataPoints||t.dataPoints.length===0)return;s.opacity="1",s.position="absolute",s.pointerEvents="none";const b=u.canvas.getBoundingClientRect();s.left=b.left+window.pageXOffset+t.caretX+"px",s.top=b.top+window.pageYOffset+t.caretY+"px";const c=((x=(v=t.dataPoints)==null?void 0:v[0])==null?void 0:x.label)??"",n=((y=(B=t.dataPoints)==null?void 0:B[0])==null?void 0:y.raw)??"",i=((S=(C=t.dataPoints)==null?void 0:C[0])==null?void 0:S.dataset.label)??"";r({dataset:i,label:c,value:n,style:s,dataPoints:t.dataPoints})},O={id:"hairlinePlugin",beforeDatasetsDraw:r=>{const u=r.scales.y;if(!u)return;const{ctx:t}=r,{top:s,bottom:b,left:c,right:n}=r.chartArea;if(u.min>0||u.max<0)return;const i=u.getPixelForValue(0);i<s||i>b||(t.save(),t.beginPath(),t.moveTo(c,i),t.lineTo(n,i),t.lineWidth=2,t.strokeStyle="rgb(207, 216, 220)",t.setLineDash([4,3]),t.stroke(),t.restore())}},q={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{grace:"15%",position:"right",border:{display:!1,dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},padding:10,color:"#898989"}},x:{border:{dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},color:"#898989"}}},interaction:{mode:"index",intersect:!1}},E=({data:r,height:u,classNameContainer:t,id:s,options:b,CustomTooltip:c})=>{const n=p.useRef(void 0),i=p.useRef(0),v=p.useRef(0),[x,B]=p.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),y=p.useCallback(function({ctx:h,chartArea:o,scales:a,chartHeight:l,gradientFor:g,item:e}){let f=(a.y.getPixelForValue(0)-o.top)/l;f=f<0?0:f>1?1:f,n.current=h.createLinearGradient(0,o.top,0,l+o.top),g==="background"?(n.current.addColorStop(0,(e==null?void 0:e.colorBackgroundPositiveZero)||"#9FD2FF"),n.current.addColorStop(f,(e==null?void 0:e.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),n.current.addColorStop(f,(e==null?void 0:e.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),n.current.addColorStop(1,(e==null?void 0:e.colorBackgroundNegativeOne)||"#EB6B6B")):(n.current.addColorStop(f,(e==null?void 0:e.colorBorderPositive)||"#80CBC4"),n.current.addColorStop(f,(e==null?void 0:e.colorBorderNegative)||"#EB6B6B"))},[]),C=p.useCallback(function({ctx:h,chartArea:o,scales:a,gradientFor:l,item:g}){const e=o.right-o.left,d=o.bottom-o.top;return(!n.current||i.current!==e||v.current!==d)&&(i.current=e,v.current=d,y({ctx:h,chartArea:o,scales:a,chartHeight:d,gradientFor:l,item:g})),y({ctx:h,chartArea:o,scales:a,chartHeight:d,gradientFor:l,item:g}),n.current},[]),S=p.useMemo(()=>({...r,datasets:r.datasets.map(o=>({fill:!0,backgroundColor:function(a){const l=a.chart,{ctx:g,chartArea:e,scales:d}=l;if(e)return C({ctx:g,chartArea:e,scales:d,gradientFor:"background",item:o})},borderColor:function(a){const l=a.chart,{ctx:g,chartArea:e,scales:d}=l;if(e)return C({ctx:g,chartArea:e,scales:d,gradientFor:"border",item:o})},borderWidth:3,tension:0,pointRadius:0,pointHoverRadius:4,...o,data:o.data}))}),[r]),k=p.useMemo(()=>{const h={plugins:{tooltip:{enabled:!c,external:({chart:o,tooltip:a})=>c?F(B)({chart:o,tooltip:a}):void 0}}};return w.mergeObjects(q,h,b??{})},[b,c]);return R.jsxs("div",{id:s,className:t,style:{height:u||"300px"},children:[c&&R.jsx(D.default,{selector:"body",children:R.jsx(c,{...x})}),R.jsx(j.Line,{data:S,options:k,plugins:[O]})]})};exports.default=E;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsxs as R, jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { Chart as w, CategoryScale as D, LinearScale as F, PointElement as O, LineElement as E, Filler as L, Tooltip as Z } from "chart.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { Line as G } from "react-chartjs-2";
|
|
5
|
+
import { mergeObjects as N } from "../../utils/common.mjs";
|
|
6
|
+
import j from "../PortalComponent/PortalComponent.mjs";
|
|
7
|
+
w.register(D, F, O, E, L, Z);
|
|
8
|
+
const H = (r) => ({ chart: u, tooltip: e }) => {
|
|
9
|
+
var P, C, x, y, v, B;
|
|
10
|
+
const a = {};
|
|
11
|
+
if (e.opacity === 0) {
|
|
12
|
+
r((k) => ({ ...k, style: { ...k.style, opacity: 0, pointerEvents: "none" } }));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!e.dataPoints || e.dataPoints.length === 0)
|
|
16
|
+
return;
|
|
17
|
+
a.opacity = "1", a.position = "absolute", a.pointerEvents = "none";
|
|
18
|
+
const b = u.canvas.getBoundingClientRect();
|
|
19
|
+
a.left = b.left + window.pageXOffset + e.caretX + "px", a.top = b.top + window.pageYOffset + e.caretY + "px";
|
|
20
|
+
const c = ((C = (P = e.dataPoints) == null ? void 0 : P[0]) == null ? void 0 : C.label) ?? "", n = ((y = (x = e.dataPoints) == null ? void 0 : x[0]) == null ? void 0 : y.raw) ?? "", i = ((B = (v = e.dataPoints) == null ? void 0 : v[0]) == null ? void 0 : B.dataset.label) ?? "";
|
|
21
|
+
r({
|
|
22
|
+
dataset: i,
|
|
23
|
+
label: c,
|
|
24
|
+
value: n,
|
|
25
|
+
style: a,
|
|
26
|
+
dataPoints: e.dataPoints
|
|
27
|
+
});
|
|
28
|
+
}, W = {
|
|
29
|
+
id: "hairlinePlugin",
|
|
30
|
+
beforeDatasetsDraw: (r) => {
|
|
31
|
+
const u = r.scales.y;
|
|
32
|
+
if (!u) return;
|
|
33
|
+
const { ctx: e } = r, { top: a, bottom: b, left: c, right: n } = r.chartArea;
|
|
34
|
+
if (u.min > 0 || u.max < 0) return;
|
|
35
|
+
const i = u.getPixelForValue(0);
|
|
36
|
+
i < a || i > b || (e.save(), e.beginPath(), e.moveTo(c, i), e.lineTo(n, i), e.lineWidth = 2, e.strokeStyle = "rgb(207, 216, 220)", e.setLineDash([4, 3]), e.stroke(), e.restore());
|
|
37
|
+
}
|
|
38
|
+
}, z = {
|
|
39
|
+
responsive: !0,
|
|
40
|
+
maintainAspectRatio: !1,
|
|
41
|
+
plugins: {
|
|
42
|
+
legend: {
|
|
43
|
+
display: !1
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
scales: {
|
|
47
|
+
y: {
|
|
48
|
+
grace: "15%",
|
|
49
|
+
position: "right",
|
|
50
|
+
border: { display: !1, dash: [5, 3], color: "#CFD8DC" },
|
|
51
|
+
ticks: {
|
|
52
|
+
font: {
|
|
53
|
+
size: 10,
|
|
54
|
+
weight: "normal"
|
|
55
|
+
},
|
|
56
|
+
padding: 10,
|
|
57
|
+
color: "#898989"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
x: {
|
|
61
|
+
border: { dash: [5, 3], color: "#CFD8DC" },
|
|
62
|
+
ticks: {
|
|
63
|
+
font: {
|
|
64
|
+
size: 10,
|
|
65
|
+
weight: "normal"
|
|
66
|
+
},
|
|
67
|
+
color: "#898989"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
interaction: {
|
|
72
|
+
mode: "index",
|
|
73
|
+
intersect: !1
|
|
74
|
+
}
|
|
75
|
+
}, J = ({ data: r, height: u, classNameContainer: e, id: a, options: b, CustomTooltip: c }) => {
|
|
76
|
+
const n = f.useRef(void 0), i = f.useRef(0), P = f.useRef(0), [C, x] = f.useState({
|
|
77
|
+
dataset: "",
|
|
78
|
+
label: "",
|
|
79
|
+
value: 0,
|
|
80
|
+
style: { opacity: 0, position: "absolute", left: 0, bottom: 0 },
|
|
81
|
+
dataPoints: []
|
|
82
|
+
}), y = f.useCallback(function({
|
|
83
|
+
ctx: h,
|
|
84
|
+
chartArea: o,
|
|
85
|
+
scales: s,
|
|
86
|
+
chartHeight: l,
|
|
87
|
+
gradientFor: g,
|
|
88
|
+
item: t
|
|
89
|
+
}) {
|
|
90
|
+
let p = (s.y.getPixelForValue(0) - o.top) / l;
|
|
91
|
+
p = p < 0 ? 0 : p > 1 ? 1 : p, n.current = h.createLinearGradient(0, o.top, 0, l + o.top), g === "background" ? (n.current.addColorStop(0, (t == null ? void 0 : t.colorBackgroundPositiveZero) || "#9FD2FF"), n.current.addColorStop(
|
|
92
|
+
p,
|
|
93
|
+
(t == null ? void 0 : t.colorBackgroundPositivePercentage) || "rgba(115, 235, 163, 0.1)"
|
|
94
|
+
), n.current.addColorStop(
|
|
95
|
+
p,
|
|
96
|
+
(t == null ? void 0 : t.colorBackgroundNegativePercentage) || "rgba(235, 107, 107, 0.1)"
|
|
97
|
+
), n.current.addColorStop(1, (t == null ? void 0 : t.colorBackgroundNegativeOne) || "#EB6B6B")) : (n.current.addColorStop(p, (t == null ? void 0 : t.colorBorderPositive) || "#80CBC4"), n.current.addColorStop(p, (t == null ? void 0 : t.colorBorderNegative) || "#EB6B6B"));
|
|
98
|
+
}, []), v = f.useCallback(function({
|
|
99
|
+
ctx: h,
|
|
100
|
+
chartArea: o,
|
|
101
|
+
scales: s,
|
|
102
|
+
gradientFor: l,
|
|
103
|
+
item: g
|
|
104
|
+
}) {
|
|
105
|
+
const t = o.right - o.left, d = o.bottom - o.top;
|
|
106
|
+
return (!n.current || i.current !== t || P.current !== d) && (i.current = t, P.current = d, y({ ctx: h, chartArea: o, scales: s, chartHeight: d, gradientFor: l, item: g })), y({ ctx: h, chartArea: o, scales: s, chartHeight: d, gradientFor: l, item: g }), n.current;
|
|
107
|
+
}, []), B = f.useMemo(() => ({
|
|
108
|
+
...r,
|
|
109
|
+
datasets: r.datasets.map((o) => ({
|
|
110
|
+
fill: !0,
|
|
111
|
+
backgroundColor: function(s) {
|
|
112
|
+
const l = s.chart, { ctx: g, chartArea: t, scales: d } = l;
|
|
113
|
+
if (t)
|
|
114
|
+
return v({ ctx: g, chartArea: t, scales: d, gradientFor: "background", item: o });
|
|
115
|
+
},
|
|
116
|
+
borderColor: function(s) {
|
|
117
|
+
const l = s.chart, { ctx: g, chartArea: t, scales: d } = l;
|
|
118
|
+
if (t)
|
|
119
|
+
return v({ ctx: g, chartArea: t, scales: d, gradientFor: "border", item: o });
|
|
120
|
+
},
|
|
121
|
+
borderWidth: 3,
|
|
122
|
+
tension: 0,
|
|
123
|
+
pointRadius: 0,
|
|
124
|
+
pointHoverRadius: 4,
|
|
125
|
+
...o,
|
|
126
|
+
data: o.data
|
|
127
|
+
}))
|
|
128
|
+
}), [r]), k = f.useMemo(() => N(z, {
|
|
129
|
+
plugins: {
|
|
130
|
+
tooltip: {
|
|
131
|
+
enabled: !c,
|
|
132
|
+
external: ({ chart: o, tooltip: s }) => c ? H(x)({ chart: o, tooltip: s }) : void 0
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, b ?? {}), [b, c]);
|
|
136
|
+
return /* @__PURE__ */ R("div", { id: a, className: e, style: { height: u || "300px" }, children: [
|
|
137
|
+
c && /* @__PURE__ */ S(j, { selector: "body", children: /* @__PURE__ */ S(c, { ...C }) }),
|
|
138
|
+
/* @__PURE__ */ S(G, { data: B, options: k, plugins: [W] })
|
|
139
|
+
] });
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
J as default
|
|
143
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react/jsx-runtime"),y=require("react"),s=require("chart.js"),B=require("react-chartjs-2"),S=require("date-fns"),v=require("date-fns/locale"),E=require("../../utils/common.cjs");s.Chart.register(s.CategoryScale,s.LinearScale,s.PointElement,s.LineElement,s.Title,s.Tooltip,s.Legend);const R=(a,f,b)=>{const i=a,g=f||new Date().getMonth(),c=b||new Date().getFullYear();return new Date(`${g}/${i}/${c}`)},$=({data:a,className:f,height:b=65})=>{const i=y.useRef(null),g=a.map(t=>S.formatDate(R(1,t.label,t.year),"MMM yy",{locale:v.id}))||[],[c,x]=y.useState(""),[h,M]=y.useState(""),D=t=>{const e=[],o=[];let u=!t.find(n=>n.isCurrent);return t.forEach(n=>{u?(o.push(n.value),e.push(null)):(e.push(n.value),n.isCurrent?(u=!0,o.push(n.value)):o.push(null))}),{passed:e,notPassed:o}},k={labels:g,datasets:[{label:"",fill:"blue",backgroundColor:"rgba(75,192,192,1)",borderColor:c,borderCapStyle:"butt",borderDashOffset:0,borderJoinStyle:"miter",pointBackgroundColor:function(t){const e=a[t.dataIndex];let o=h;return e.isCurrent&&(o="#ED0019"),o},pointBorderWidth:.1,pointHoverRadius:4,pointRadius:5,pointBorderColor:h,pointHoverBorderColor:c,data:D(a).passed||[]},{label:"",fill:"grey",backgroundColor:"rgba(75,192,192,1)",borderColor:"#D6D6D6",borderCapStyle:"butt",borderDashOffset:0,pointRadius:5,borderJoinStyle:"miter",pointBackgroundColor:h,pointBorderWidth:.1,pointHoverRadius:4,borderDash:[15,5],data:D(a).notPassed||[]}]},j={interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1,labels:{usePointStyle:!0}},tooltip:{external:function(t){let e=document.getElementById("chartjs-tooltip");e||(e=document.createElement("div"),e.id="chartjs-tooltip",e.innerHTML="<table></table>",document.body.appendChild(e));const o=t.tooltip;if(o.opacity===0){e.style.opacity="0";return}e.classList.remove("above","below","no-transform"),o.yAlign?e.classList.add(o.yAlign):e.classList.add("no-transform");function u(m){return m.lines}if(o.body){const m=o.title||[];let l=o.body.map(u),d="<thead>";m.forEach(C=>{let r="";r+="display: flex",r+="; justify-content: center",r+="; font-weight: 600",r+="; font-size: 12px",r+="; padding: 0px 14px",d+=`<tr><span style="${r}">${C}</span></tr>`}),d+="</thead><tbody>",l.length>1&&l[0][0]===l[1][0]&&(l=[l[0]]),l.forEach(C=>{let r="";r+="display: flex",r+="; justify-content: center",r+="; color: #0163C8",r+="; padding: 0px 14px",r+="; font-size: 12px";const w=`<span style="${r}">${C}</span>`;d+=`<tr><td>${w}</td></tr>`}),d+="</tbody>";const L=e.querySelector("table");L&&(L.innerHTML=d)}const n=t.chart.canvas.getBoundingClientRect();e.style.opacity="1",e.style.border="solid 1px #0163C8",e.style.background="white",e.style.height="fit-content",e.style.borderRadius="10px",e.style.position="absolute",e.style.zIndex="10",e.style.padding="4px 0",e.style.left=n.left+window.pageXOffset+o.caretX-30+"px",e.style.top=n.top+window.pageYOffset+o.caretY-60+"px",e.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title:function(t){const e=a[t[0].dataIndex];return S.formatDate(new Date(`1/${e.label}/${e.year}`),"MMMM yyyy",{locale:v.id})},label:function(t){let e=t.dataset.label??"";return e&&(e+=": "),t.parsed.y!==null&&(e+=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(t.parsed.y)),e}}}},scales:{x:{grid:{display:!1},beginAtZero:!0,ticks:{autoSkip:!0,maxTicksLimit:20}},y:{min:0,grid:{display:!1},beginAtZero:!0,ticks:{maxTicksLimit:6,callback:function(t){return E.setDigit(t)??0}}}}};return y.useEffect(()=>{if(i.current){const t=i.current.getContext("2d"),e=t==null?void 0:t.createLinearGradient(0,100,500,-500);e==null||e.addColorStop(0,"rgba(237, 0, 25, 0)"),e==null||e.addColorStop(1,"rgba(237, 0, 25, 20)");const o=t.fillStyle="rgba(255, 255, 255, 0)";M(o),x(e)}},[]),p.jsxs("div",{className:f??"",children:[p.jsx(B.Line,{options:j,data:k,height:b}),p.jsx("div",{className:"iru-h-5",children:p.jsx("canvas",{ref:i})})]})};exports.default=$;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { jsxs as B, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import p from "react";
|
|
3
|
+
import { Chart as E, CategoryScale as R, LinearScale as $, PointElement as I, LineElement as T, Title as j, Tooltip as H, Legend as O } from "chart.js";
|
|
4
|
+
import { Line as A } from "react-chartjs-2";
|
|
5
|
+
import { formatDate as L } from "date-fns";
|
|
6
|
+
import { id as S } from "date-fns/locale";
|
|
7
|
+
import { setDigit as P } from "../../utils/common.mjs";
|
|
8
|
+
E.register(R, $, I, T, j, H, O);
|
|
9
|
+
const Y = (l, u, f) => {
|
|
10
|
+
const s = l, y = u || (/* @__PURE__ */ new Date()).getMonth(), d = f || (/* @__PURE__ */ new Date()).getFullYear();
|
|
11
|
+
return /* @__PURE__ */ new Date(`${y}/${s}/${d}`);
|
|
12
|
+
}, q = ({ data: l, className: u, height: f = 65 }) => {
|
|
13
|
+
const s = p.useRef(null), y = l.map((e) => L(Y(1, e.label, e.year), "MMM yy", { locale: S })) || [], [d, C] = p.useState(""), [b, k] = p.useState(""), x = (e) => {
|
|
14
|
+
const t = [], o = [];
|
|
15
|
+
let c = !e.find((n) => n.isCurrent);
|
|
16
|
+
return e.forEach((n) => {
|
|
17
|
+
c ? (o.push(n.value), t.push(null)) : (t.push(n.value), n.isCurrent ? (c = !0, o.push(n.value)) : o.push(null));
|
|
18
|
+
}), { passed: t, notPassed: o };
|
|
19
|
+
}, v = {
|
|
20
|
+
labels: y,
|
|
21
|
+
datasets: [
|
|
22
|
+
{
|
|
23
|
+
label: "",
|
|
24
|
+
fill: "blue",
|
|
25
|
+
backgroundColor: "rgba(75,192,192,1)",
|
|
26
|
+
borderColor: d,
|
|
27
|
+
borderCapStyle: "butt",
|
|
28
|
+
borderDashOffset: 0,
|
|
29
|
+
borderJoinStyle: "miter",
|
|
30
|
+
pointBackgroundColor: function(e) {
|
|
31
|
+
const t = l[e.dataIndex];
|
|
32
|
+
let o = b;
|
|
33
|
+
return t.isCurrent && (o = "#ED0019"), o;
|
|
34
|
+
},
|
|
35
|
+
pointBorderWidth: 0.1,
|
|
36
|
+
pointHoverRadius: 4,
|
|
37
|
+
pointRadius: 5,
|
|
38
|
+
pointBorderColor: b,
|
|
39
|
+
pointHoverBorderColor: d,
|
|
40
|
+
data: x(l).passed || []
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "",
|
|
44
|
+
// showTooltips: false,
|
|
45
|
+
fill: "grey",
|
|
46
|
+
backgroundColor: "rgba(75,192,192,1)",
|
|
47
|
+
borderColor: "#D6D6D6",
|
|
48
|
+
borderCapStyle: "butt",
|
|
49
|
+
borderDashOffset: 0,
|
|
50
|
+
pointRadius: 5,
|
|
51
|
+
borderJoinStyle: "miter",
|
|
52
|
+
pointBackgroundColor: b,
|
|
53
|
+
pointBorderWidth: 0.1,
|
|
54
|
+
pointHoverRadius: 4,
|
|
55
|
+
borderDash: [15, 5],
|
|
56
|
+
data: x(l).notPassed || []
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}, w = {
|
|
60
|
+
interaction: {
|
|
61
|
+
mode: "index",
|
|
62
|
+
intersect: !1
|
|
63
|
+
},
|
|
64
|
+
plugins: {
|
|
65
|
+
legend: {
|
|
66
|
+
display: !1,
|
|
67
|
+
labels: {
|
|
68
|
+
usePointStyle: !0
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
tooltip: {
|
|
72
|
+
external: function(e) {
|
|
73
|
+
let t = document.getElementById("chartjs-tooltip");
|
|
74
|
+
t || (t = document.createElement("div"), t.id = "chartjs-tooltip", t.innerHTML = "<table></table>", document.body.appendChild(t));
|
|
75
|
+
const o = e.tooltip;
|
|
76
|
+
if (o.opacity === 0) {
|
|
77
|
+
t.style.opacity = "0";
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
t.classList.remove("above", "below", "no-transform"), o.yAlign ? t.classList.add(o.yAlign) : t.classList.add("no-transform");
|
|
81
|
+
function c(m) {
|
|
82
|
+
return m.lines;
|
|
83
|
+
}
|
|
84
|
+
if (o.body) {
|
|
85
|
+
const m = o.title || [];
|
|
86
|
+
let a = o.body.map(c), i = "<thead>";
|
|
87
|
+
m.forEach((g) => {
|
|
88
|
+
let r = "";
|
|
89
|
+
r += "display: flex", r += "; justify-content: center", r += "; font-weight: 600", r += "; font-size: 12px", r += "; padding: 0px 14px", i += `<tr><span style="${r}">${g}</span></tr>`;
|
|
90
|
+
}), i += "</thead><tbody>", a.length > 1 && a[0][0] === a[1][0] && (a = [a[0]]), a.forEach((g) => {
|
|
91
|
+
let r = "";
|
|
92
|
+
r += "display: flex", r += "; justify-content: center", r += "; color: #0163C8", r += "; padding: 0px 14px", r += "; font-size: 12px";
|
|
93
|
+
const M = `<span style="${r}">${g}</span>`;
|
|
94
|
+
i += `<tr><td>${M}</td></tr>`;
|
|
95
|
+
}), i += "</tbody>";
|
|
96
|
+
const D = t.querySelector("table");
|
|
97
|
+
D && (D.innerHTML = i);
|
|
98
|
+
}
|
|
99
|
+
const n = e.chart.canvas.getBoundingClientRect();
|
|
100
|
+
t.style.opacity = "1", t.style.border = "solid 1px #0163C8", t.style.background = "white", t.style.height = "fit-content", t.style.borderRadius = "10px", t.style.position = "absolute", t.style.zIndex = "10", t.style.padding = "4px 0", t.style.left = n.left + window.pageXOffset + o.caretX - 30 + "px", t.style.top = n.top + window.pageYOffset + o.caretY - 60 + "px", t.style.pointerEvents = "none";
|
|
101
|
+
},
|
|
102
|
+
displayColors: !0,
|
|
103
|
+
enabled: !1,
|
|
104
|
+
callbacks: {
|
|
105
|
+
title: function(e) {
|
|
106
|
+
const t = l[e[0].dataIndex];
|
|
107
|
+
return L(/* @__PURE__ */ new Date(`1/${t.label}/${t.year}`), "MMMM yyyy", { locale: S });
|
|
108
|
+
},
|
|
109
|
+
label: function(e) {
|
|
110
|
+
let t = e.dataset.label ?? "";
|
|
111
|
+
return t && (t += ": "), e.parsed.y !== null && (t += new Intl.NumberFormat("id-ID", { style: "currency", currency: "IDR" }).format(e.parsed.y)), t;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
scales: {
|
|
117
|
+
x: {
|
|
118
|
+
grid: {
|
|
119
|
+
display: !1
|
|
120
|
+
},
|
|
121
|
+
beginAtZero: !0,
|
|
122
|
+
ticks: {
|
|
123
|
+
autoSkip: !0,
|
|
124
|
+
maxTicksLimit: 20
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
y: {
|
|
128
|
+
min: 0,
|
|
129
|
+
// position: 'right',
|
|
130
|
+
// stepSize: 5,
|
|
131
|
+
grid: {
|
|
132
|
+
display: !1
|
|
133
|
+
},
|
|
134
|
+
beginAtZero: !0,
|
|
135
|
+
ticks: {
|
|
136
|
+
maxTicksLimit: 6,
|
|
137
|
+
callback: function(e) {
|
|
138
|
+
return P(e) ?? 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return p.useEffect(() => {
|
|
145
|
+
if (s.current) {
|
|
146
|
+
const e = s.current.getContext("2d"), t = e == null ? void 0 : e.createLinearGradient(0, 100, 500, -500);
|
|
147
|
+
t == null || t.addColorStop(0, "rgba(237, 0, 25, 0)"), t == null || t.addColorStop(1, "rgba(237, 0, 25, 20)");
|
|
148
|
+
const o = e.fillStyle = "rgba(255, 255, 255, 0)";
|
|
149
|
+
k(o), C(t);
|
|
150
|
+
}
|
|
151
|
+
}, []), /* @__PURE__ */ B("div", { className: u ?? "", children: [
|
|
152
|
+
/* @__PURE__ */ h(A, { options: w, data: v, height: f }),
|
|
153
|
+
/* @__PURE__ */ h("div", { className: "iru-h-5", children: /* @__PURE__ */ h("canvas", { ref: s }) })
|
|
154
|
+
] });
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
q as default
|
|
158
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),i=require("./Chips.config.cjs"),a=n.forwardRef((c,l)=>{const{className:p,children:f,fonts:u="inter",size:o="reguler",variants:g="filled-laba-blue-10",icon:s=e.jsx(e.Fragment,{}),removeIcon:t=e.jsx(e.Fragment,{}),typography:r,...h}=c;return e.jsxs("span",{className:`${i.configChips.fonts[u]} ${i.configChips.size[o].style}
|
|
2
|
+
${r?i.configChips.typography[r]:i.configChips.size[o].typography}
|
|
3
|
+
${i.configChips.variants[g]} ${p??""}`,ref:l,...h,children:[typeof s=="function"&&s(),n.isValidElement(s)&&s,f,typeof t=="function"&&t(),n.isValidElement(t)&&t]})});a.displayName="Chips";exports.default=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../config/components/font.cjs"),a=require("../../config/components/typography.cjs"),e=require("./style.module.scss.cjs"),t={fonts:l.configFont,size:{reguler:{style:e.default["chips-reguler"],typography:"laba-subtitle-rb"},small:{style:e.default["chips-small"],typography:"laba-subtitle-sb"},l:{style:e.default["chips-l"],typography:"payhere-label-r"},s:{style:e.default["chips-s"],typography:"payhere-body-esm"}},typography:a.configtypography,variants:{"filled-laba-blue-10":e.default["filled-laba-blue-10"],"filled-gray-300":e.default["filled-gray-300"],"filled-blue-gray-100":e.default["filled-blue-gray-100"],"ghost-laba-grey-02":e.default["ghost-laba-grey-02"],"nude-laba-grey-10":e.default["nude-laba-grey-10"]}};exports.configChips=t;
|