@erpsquad/common 1.8.111 → 1.8.112
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/_virtual/index/index.esm.js +4 -2
- package/dist/_virtual/index/index.esm.js.map +1 -1
- package/dist/_virtual/index/index.esm2.js +2 -4
- package/dist/_virtual/index/index.esm2.js.map +1 -1
- package/dist/_virtual/index/index.js +1 -1
- package/dist/_virtual/index/index2.js +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/action-bar/action-bar.d.ts +1 -1
- package/dist/components/charts/areaLinerChart/index.esm.js +2 -1
- package/dist/components/charts/areaLinerChart/index.esm.js.map +1 -1
- package/dist/components/charts/areaLinerChart/index.js +1 -1
- package/dist/components/charts/areaLinerChart/index.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/footer/footer.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/components/icons/action-arrow.d.ts +3 -3
- package/dist/components/icons/add-circle.d.ts +3 -3
- package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/components/icons/arrow-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/components/icons/assignments.d.ts +3 -3
- package/dist/components/icons/blank-circle.d.ts +3 -3
- package/dist/components/icons/block-filled.d.ts +3 -3
- package/dist/components/icons/calendar-add.d.ts +3 -3
- package/dist/components/icons/calendar.d.ts +3 -3
- package/dist/components/icons/checkbox-square.d.ts +3 -3
- package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/components/icons/clock.d.ts +3 -3
- package/dist/components/icons/close.d.ts +3 -3
- package/dist/components/icons/coin-outline.d.ts +3 -3
- package/dist/components/icons/copy.d.ts +3 -3
- package/dist/components/icons/coupon.d.ts +3 -3
- package/dist/components/icons/cross-hire.d.ts +3 -3
- package/dist/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/components/icons/dashboard.d.ts +3 -3
- package/dist/components/icons/document-download.d.ts +3 -3
- package/dist/components/icons/document.d.ts +3 -3
- package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/components/icons/dollar-circle.d.ts +3 -3
- package/dist/components/icons/edit.d.ts +3 -3
- package/dist/components/icons/email.d.ts +3 -3
- package/dist/components/icons/export.d.ts +3 -3
- package/dist/components/icons/eye-off.d.ts +3 -3
- package/dist/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/components/icons/eye.d.ts +3 -3
- package/dist/components/icons/filled-circle.d.ts +3 -3
- package/dist/components/icons/filter-remove.d.ts +3 -3
- package/dist/components/icons/filter.d.ts +3 -3
- package/dist/components/icons/folder-save.d.ts +3 -3
- package/dist/components/icons/grid.d.ts +3 -3
- package/dist/components/icons/hashtag.d.ts +3 -3
- package/dist/components/icons/image.d.ts +3 -3
- package/dist/components/icons/import.d.ts +3 -3
- package/dist/components/icons/info-circle.d.ts +3 -3
- package/dist/components/icons/info.d.ts +3 -3
- package/dist/components/icons/link-horizontal.d.ts +3 -3
- package/dist/components/icons/link.d.ts +3 -3
- package/dist/components/icons/location.d.ts +3 -3
- package/dist/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/components/icons/lowest-price.d.ts +3 -3
- package/dist/components/icons/more.d.ts +3 -3
- package/dist/components/icons/notification.d.ts +3 -3
- package/dist/components/icons/paper-clip.d.ts +3 -3
- package/dist/components/icons/paragraph.d.ts +3 -3
- package/dist/components/icons/payment-request.d.ts +3 -3
- package/dist/components/icons/phone.d.ts +3 -3
- package/dist/components/icons/printer.d.ts +3 -3
- package/dist/components/icons/process-calendar.d.ts +3 -3
- package/dist/components/icons/promotion.d.ts +3 -3
- package/dist/components/icons/radio-button.d.ts +3 -3
- package/dist/components/icons/receipt-filled.d.ts +3 -3
- package/dist/components/icons/receipt-outline.d.ts +3 -3
- package/dist/components/icons/receipt.d.ts +3 -3
- package/dist/components/icons/refresh-icon.d.ts +3 -3
- package/dist/components/icons/replace.d.ts +3 -3
- package/dist/components/icons/save.d.ts +3 -3
- package/dist/components/icons/search-status.d.ts +3 -3
- package/dist/components/icons/search.d.ts +3 -3
- package/dist/components/icons/settings-fallback.d.ts +3 -3
- package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/components/icons/stacked-layer.d.ts +3 -3
- package/dist/components/icons/start-filled.d.ts +3 -3
- package/dist/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/components/icons/tick-circle.d.ts +3 -3
- package/dist/components/icons/tick-octagon.d.ts +3 -3
- package/dist/components/icons/tick.d.ts +3 -3
- package/dist/components/icons/toggle-switch.d.ts +3 -3
- package/dist/components/icons/trash.d.ts +3 -3
- package/dist/components/icons/wave.d.ts +3 -3
- package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/components/icons/work-centre.d.ts +3 -3
- package/dist/components/location-select.d.ts +1 -1
- package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/components/material-table/material-table.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/switches/android-12-switch.d.ts +1 -3
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/upload-media/upload-media.d.ts +1 -1
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.esm.js +1 -1
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js +1 -1
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js.map +1 -1
- package/dist/node_modules/prop-types/index/index.esm.js +1 -1
- package/dist/node_modules/prop-types/index/index.js +1 -1
- package/dist/node_modules/prop-types/index/index.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +1 -1
- package/dist/src/components/action-bar/action-bar.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +1 -1
- package/dist/src/components/footer/footer.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/src/components/icons/action-arrow.d.ts +3 -3
- package/dist/src/components/icons/add-circle.d.ts +3 -3
- package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/src/components/icons/arrow-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/src/components/icons/assignments.d.ts +3 -3
- package/dist/src/components/icons/blank-circle.d.ts +3 -3
- package/dist/src/components/icons/block-filled.d.ts +3 -3
- package/dist/src/components/icons/calendar-add.d.ts +3 -3
- package/dist/src/components/icons/calendar.d.ts +3 -3
- package/dist/src/components/icons/checkbox-square.d.ts +3 -3
- package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/src/components/icons/clock.d.ts +3 -3
- package/dist/src/components/icons/close.d.ts +3 -3
- package/dist/src/components/icons/coin-outline.d.ts +3 -3
- package/dist/src/components/icons/copy.d.ts +3 -3
- package/dist/src/components/icons/coupon.d.ts +3 -3
- package/dist/src/components/icons/cross-hire.d.ts +3 -3
- package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/src/components/icons/dashboard.d.ts +3 -3
- package/dist/src/components/icons/document-download.d.ts +3 -3
- package/dist/src/components/icons/document.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle.d.ts +3 -3
- package/dist/src/components/icons/edit.d.ts +3 -3
- package/dist/src/components/icons/email.d.ts +3 -3
- package/dist/src/components/icons/export.d.ts +3 -3
- package/dist/src/components/icons/eye-off.d.ts +3 -3
- package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/src/components/icons/eye.d.ts +3 -3
- package/dist/src/components/icons/filled-circle.d.ts +3 -3
- package/dist/src/components/icons/filter-remove.d.ts +3 -3
- package/dist/src/components/icons/filter.d.ts +3 -3
- package/dist/src/components/icons/folder-save.d.ts +3 -3
- package/dist/src/components/icons/grid.d.ts +3 -3
- package/dist/src/components/icons/hashtag.d.ts +3 -3
- package/dist/src/components/icons/image.d.ts +3 -3
- package/dist/src/components/icons/import.d.ts +3 -3
- package/dist/src/components/icons/info-circle.d.ts +3 -3
- package/dist/src/components/icons/info.d.ts +3 -3
- package/dist/src/components/icons/link-horizontal.d.ts +3 -3
- package/dist/src/components/icons/link.d.ts +3 -3
- package/dist/src/components/icons/location.d.ts +3 -3
- package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/src/components/icons/lowest-price.d.ts +3 -3
- package/dist/src/components/icons/more.d.ts +3 -3
- package/dist/src/components/icons/notification.d.ts +3 -3
- package/dist/src/components/icons/paper-clip.d.ts +3 -3
- package/dist/src/components/icons/paragraph.d.ts +3 -3
- package/dist/src/components/icons/payment-request.d.ts +3 -3
- package/dist/src/components/icons/phone.d.ts +3 -3
- package/dist/src/components/icons/printer.d.ts +3 -3
- package/dist/src/components/icons/process-calendar.d.ts +3 -3
- package/dist/src/components/icons/promotion.d.ts +3 -3
- package/dist/src/components/icons/radio-button.d.ts +3 -3
- package/dist/src/components/icons/receipt-filled.d.ts +3 -3
- package/dist/src/components/icons/receipt-outline.d.ts +3 -3
- package/dist/src/components/icons/receipt.d.ts +3 -3
- package/dist/src/components/icons/refresh-icon.d.ts +3 -3
- package/dist/src/components/icons/replace.d.ts +3 -3
- package/dist/src/components/icons/save.d.ts +3 -3
- package/dist/src/components/icons/search-status.d.ts +3 -3
- package/dist/src/components/icons/search.d.ts +3 -3
- package/dist/src/components/icons/settings-fallback.d.ts +3 -3
- package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/src/components/icons/stacked-layer.d.ts +3 -3
- package/dist/src/components/icons/start-filled.d.ts +3 -3
- package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/tick-circle.d.ts +3 -3
- package/dist/src/components/icons/tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/tick.d.ts +3 -3
- package/dist/src/components/icons/toggle-switch.d.ts +3 -3
- package/dist/src/components/icons/trash.d.ts +3 -3
- package/dist/src/components/icons/wave.d.ts +3 -3
- package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/work-centre.d.ts +3 -3
- package/dist/src/components/location-select.d.ts +1 -1
- package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/src/components/material-table/material-table.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +1 -1
- package/dist/src/components/radio/radio.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/components/switches/android-12-switch.d.ts +1 -3
- package/dist/src/components/text-field/text-field.d.ts +1 -1
- package/dist/src/components/time-picker/time-picker.d.ts +1 -1
- package/dist/src/components/upload-media/upload-media.d.ts +1 -1
- package/dist/src/utils/api.d.ts +9 -3
- package/dist/src/utils/common-utility.d.ts +1 -1
- package/dist/src/utils/common.d.ts +22 -4
- package/dist/style.css +65 -65
- package/dist/utils/api/index.esm.js +21 -5
- package/dist/utils/api/index.esm.js.map +1 -1
- package/dist/utils/api/index.js +1 -1
- package/dist/utils/api/index.js.map +1 -1
- package/dist/utils/api.d.ts +9 -3
- package/dist/utils/common-utility.d.ts +1 -1
- package/dist/utils/common.d.ts +22 -4
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getAugmentedNamespace } from "../_commonjsHelpers/index.esm.js";
|
|
2
|
+
import * as index from "../../node_modules/@mui/material/utils/index/index.esm.js";
|
|
3
|
+
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
require$$0 as default
|
|
4
6
|
};
|
|
5
7
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import * as index from "../../node_modules/@mui/material/utils/index/index.esm.js";
|
|
3
|
-
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
1
|
+
var propTypes = { exports: {} };
|
|
4
2
|
export {
|
|
5
|
-
|
|
3
|
+
propTypes as __module
|
|
6
4
|
};
|
|
7
5
|
//# sourceMappingURL=index.esm2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_commonjsHelpers/index.js"),r=require("../../node_modules/@mui/material/utils/index/index.js"),s=/* @__PURE__ */e.getAugmentedNamespace(r);exports.default=s;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__module={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index2.js.map
|
|
@@ -5,6 +5,6 @@ interface AccordionProps {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
accordionProps?: Partial<MUIAccordionProps>;
|
|
7
7
|
}
|
|
8
|
-
declare const Accordion: import('react').
|
|
8
|
+
declare const Accordion: import('react').MemoExoticComponent<(props: AccordionProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
9
|
export { Accordion };
|
|
10
10
|
export default Accordion;
|
|
@@ -45,6 +45,6 @@ interface SavedFilter {
|
|
|
45
45
|
name: string;
|
|
46
46
|
query: RuleGroupType;
|
|
47
47
|
}
|
|
48
|
-
declare const ActionBar: React.
|
|
48
|
+
declare const ActionBar: React.MemoExoticComponent<(props: ActionBarPropsType) => import("react/jsx-runtime").JSX.Element>;
|
|
49
49
|
export { ActionBar };
|
|
50
50
|
export default ActionBar;
|
|
@@ -42,13 +42,14 @@ const AreaLineChart = ({ data, height = 400, customLabelFormatter, yAxisLabelTyp
|
|
|
42
42
|
};
|
|
43
43
|
}, []);
|
|
44
44
|
useEffect(() => {
|
|
45
|
+
var _a, _b;
|
|
45
46
|
if (containerWidth === 0) return;
|
|
46
47
|
const margin = { top: 20, right: 30, bottom: 30, left: 40 };
|
|
47
48
|
const width = containerWidth - margin.left - margin.right;
|
|
48
49
|
const chartHeight = height - margin.top - margin.bottom;
|
|
49
50
|
select(svgRef.current).selectAll("*").remove();
|
|
50
51
|
const svg = select(svgRef.current).attr("width", containerWidth).attr("height", height).append("g").attr("transform", `translate(${margin.left},${margin.top})`);
|
|
51
|
-
const x = point().domain(data[0].values.map((d) => d.month)).range([0, width]);
|
|
52
|
+
const x = point().domain((_b = (_a = data[0]) == null ? void 0 : _a.values) == null ? void 0 : _b.map((d) => d.month)).range([0, width]);
|
|
52
53
|
const y = linear().domain([0, max(data, (dataset) => max(dataset.values, (d) => d.value))]).range([chartHeight, 0]);
|
|
53
54
|
const numTicks = Math.floor(width / 80);
|
|
54
55
|
const xAxis = axisBottom(x).ticks(numTicks);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/components/charts/areaLinerChart.tsx"],"sourcesContent":["import { Box } from '@mui/material';\nimport * as d3 from 'd3';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface IChartProps {\n data: { name: string, values: { month: string, value: number }[], isSmooth?: boolean }[],\n height: number,\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string;\n colors?: string[];\n customLegend: React.ReactNode\n}\n\nconst formatNumber = (num: number, symbol: string, labelType: string) => {\n if (labelType === 'inPercent') {\n return `${d3.format(\".0%\")(num / 100)}`;\n } else if (labelType === 'inValue') {\n return `${symbol || ''} ${d3.format(\".2s\")(num).replace('k', 'K')}`;\n }\n return num.toString();\n};\n\nconst AreaLineChart = ({ data, height = 400, customLabelFormatter, yAxisLabelType = 'inValue', currency, colors, customLegend }: IChartProps) => {\n const svgRef = useRef<SVGSVGElement | null>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n const [tooltipData, setTooltipData] = useState<any>(null);\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n\n useEffect(() => {\n if (containerWidth === 0) return; // Wait for the container width\n\n const margin = { top: 20, right: 30, bottom: 30, left: 40 };\n const width = containerWidth - margin.left - margin.right;\n const chartHeight = height - margin.top - margin.bottom;\n\n // Clear the SVG\n d3.select(svgRef.current).selectAll('*').remove();\n\n const svg = d3\n .select(svgRef.current)\n .attr('width', containerWidth)\n .attr('height', height)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`);\n\n // Define scales\n const x = d3\n .scalePoint()\n .domain(data[0].values.map(d => d.month)) // Assuming all datasets share the same x-domain\n .range([0, width]);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, dataset => d3.max(dataset.values, d => d.value))!]) // Max value across all datasets\n .range([chartHeight, 0]);\n\n // Limit x-axis ticks dynamically based on width\n const numTicks = Math.floor(width / 80); // Adjust the factor (80) based on chart width\n const xAxis = d3.axisBottom(x).ticks(numTicks);\n\n const xAxisGroup = svg.append('g')\n .attr('transform', `translate(0,${chartHeight})`)\n .call(xAxis);\n\n xAxisGroup.selectAll(\"text\")\n .attr(\"transform\", \"translate(0, 10)\")\n .attr('color', '#8E8E93')\n .style(\"text-anchor\", \"middle\");\n\n // Y Axis\n const yAxis = svg.append('g')\n yAxis.append('g').attr('color', '#8E8E93').attr(\"transform\", `translate(-10,0)`)\n .call(d3.axisLeft(y).tickSize(-width).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n ).tickSizeOuter(0) as any)\n .selectAll('line')\n .attr('stroke-dasharray', '3,3')\n .attr('stroke', '#D3D3D4');\n\n xAxisGroup.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n xAxisGroup.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Define color scale for lines\n // const color = d3.scaleOrdinal(d3.schemeCategory10);\n\n // Line and area generators\n const line = (isSmooth: boolean) => d3.line<any>()\n .x(d => x(d.month)!)\n .y(d => y(d.value))\n .curve(isSmooth ? d3.curveMonotoneX : d3.curveLinear); // Conditionally smooth the line\n\n const area = d3.area<any>()\n .x(d => x(d.month)!)\n .y0(chartHeight)\n .y1(d => y(d.value));\n\n // Iterate over each dataset to create lines and areas\n data.forEach((dataset, i) => {\n // const datasetColor = color(i.toString());\n\n // Create gradient for each area\n const gradient = svg.append('defs')\n .append('linearGradient')\n .attr('id', `area-gradient-${i}`)\n .attr('x1', '0%')\n .attr('x2', '0%')\n .attr('y1', '0%')\n .attr('y2', '100%');\n\n gradient.append('stop')\n .attr('offset', '0%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.4);\n\n gradient.append('stop')\n .attr('offset', '100%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.1);\n\n // Append the area with gradient\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', `url(#area-gradient-${i})`)\n .attr('d', area);\n\n // Append the line with smoothness condition\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', 'none')\n .attr('stroke', colors[i])\n .attr('stroke-width', 2)\n .attr('d', line(dataset.isSmooth || false)); // Use smoothness from the dataset\n\n // Append circles for hover effect\n {\n dataset?.showCircle &&\n svg.selectAll(`circle-${i}`)\n .data(dataset.values)\n .enter()\n .append('circle')\n .attr('cx', d => x(d.month)!)\n .attr('cy', d => y(d.value))\n .attr('r', 5)\n .attr('fill', colors[i])\n .attr('stroke', '#fff')\n .style('cursor', 'pointer')\n .on('mouseover', function (event, d) {\n setTooltipData({\n x: `${event.pageX + 10}px`,\n y: `${event.pageY - 30}px`,\n content: `${dataset.name}: ${d.value}`\n });\n d3.select(this).transition().attr('r', 7).attr('fill', '#ff4500');\n })\n .on('mouseout', function () {\n setTooltipData(null);\n d3.select(this).transition().attr('r', 5).attr('fill', colors[i]);\n });\n }\n\n });\n\n }, [data, containerWidth, height, customLabelFormatter, yAxisLabelType, currency, colors, customLegend]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <div style={{ position: 'relative' }}>\n <svg ref={svgRef} width=\"100%\" height={height} />\n {\n customLegend &&\n customLegend\n\n }\n </div>\n {tooltipData &&\n <Box sx={{\n position: 'absolute',\n left: tooltipData.x,\n top: tooltipData.y,\n pointerEvents: 'none',\n backgroundColor: '#2EB273',\n zIndex: '99999',\n border: 'none',\n borderRadius: '3px',\n transform: 'translate(-50%, -100%)',\n padding: '2px 6px 2px 6px',\n gap: '10px'\n }}>\n <span style={{ fontSize: '16px', weight: '500', color: '#ffff' }}>\n {tooltipData.content}\n </span>\n </Box>\n }\n </div>\n );\n};\n\nexport { AreaLineChart };\nexport default AreaLineChart;\n"],"names":["d3.format","d3.select","d3.scalePoint","d3.scaleLinear","d3.max","d3.axisBottom","d3.axisLeft","line","d3.line","d3.curveMonotoneX","d3.curveLinear","area","d3.area"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,eAAe,CAAC,KAAa,QAAgB,cAAsB;AACrE,MAAI,cAAc,aAAa;AAC3B,WAAO,GAAGA,OAAU,KAAK,EAAE,MAAM,GAAG,CAAC;AAAA,EACzC,WAAW,cAAc,WAAW;AAChC,WAAO,GAAG,UAAU,EAAE,IAAIA,OAAU,KAAK,EAAE,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC;AAAA,EACrE;AACA,SAAO,IAAI,SAAA;AACf;AAEA,MAAM,gBAAgB,CAAC,EAAE,MAAM,SAAS,KAAK,sBAAsB,iBAAiB,WAAW,UAAU,QAAQ,aAAA,MAAgC;AAC7I,QAAM,SAAS,OAA6B,IAAI;AAChD,QAAM,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AC,EACA,GAAG,YAAY,WAAY;AACxB,yBAAe,IAAI;AACnBA,iBAAU,IAAI,EAAE,WAAA,EAAa,KAAK,KAAK,CAAC,EAAE,KAAK,QAAQ,OAAO,CAAC,CAAC;AAAA,QACpE,CAAC;AAAA,MACb;AAAA,IAEJ,CAAC;AAAA,EAEL,GAAG,CAAC,MAAM,gBAAgB,QAAQ,sBAAsB,gBAAgB,UAAU,QAAQ,YAAY,CAAC;AAEvG,SACI,qBAAC,OAAA,EAAI,KAAK,YAAY,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA,GAClD,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,OAAO,EAAE,UAAU,cACpB,UAAA;AAAA,MAAA,oBAAC,OAAA,EAAI,KAAK,QAAQ,OAAM,QAAO,QAAgB;AAAA,MAE3C,gBACA;AAAA,IAAA,GAGR;AAAA,IACC,eACG,oBAAC,KAAA,EAAI,IAAI;AAAA,MACL,UAAU;AAAA,MACV,MAAM,YAAY;AAAA,MAClB,KAAK,YAAY;AAAA,MACjB,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,MACX,SAAS;AAAA,MACT,KAAK;AAAA,IAAA,GAEL,UAAA,oBAAC,QAAA,EAAK,OAAO,EAAE,UAAU,QAAQ,QAAQ,OAAO,OAAO,QAAA,GAClD,UAAA,YAAY,SACjB,EAAA,CACJ;AAAA,EAAA,GAER;AAER;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/components/charts/areaLinerChart.tsx"],"sourcesContent":["import { Box } from '@mui/material';\nimport * as d3 from 'd3';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface IChartProps {\n data: { name: string, values: { month: string, value: number }[], isSmooth?: boolean }[],\n height: number,\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string;\n colors?: string[];\n customLegend: React.ReactNode\n}\n\nconst formatNumber = (num: number, symbol: string, labelType: string) => {\n if (labelType === 'inPercent') {\n return `${d3.format(\".0%\")(num / 100)}`;\n } else if (labelType === 'inValue') {\n return `${symbol || ''} ${d3.format(\".2s\")(num).replace('k', 'K')}`;\n }\n return num.toString();\n};\n\nconst AreaLineChart = ({ data, height = 400, customLabelFormatter, yAxisLabelType = 'inValue', currency, colors, customLegend }: IChartProps) => {\n const svgRef = useRef<SVGSVGElement | null>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n const [tooltipData, setTooltipData] = useState<any>(null);\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n\n useEffect(() => {\n if (containerWidth === 0) return; // Wait for the container width\n\n const margin = { top: 20, right: 30, bottom: 30, left: 40 };\n const width = containerWidth - margin.left - margin.right;\n const chartHeight = height - margin.top - margin.bottom;\n\n // Clear the SVG\n d3.select(svgRef.current).selectAll('*').remove();\n\n const svg = d3\n .select(svgRef.current)\n .attr('width', containerWidth)\n .attr('height', height)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`);\n\n // Define scales\n const x = d3\n .scalePoint()\n .domain(data[0]?.values?.map(d => d.month)) // Assuming all datasets share the same x-domain\n .range([0, width]);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, dataset => d3.max(dataset.values, d => d.value))!]) // Max value across all datasets\n .range([chartHeight, 0]);\n\n // Limit x-axis ticks dynamically based on width\n const numTicks = Math.floor(width / 80); // Adjust the factor (80) based on chart width\n const xAxis = d3.axisBottom(x).ticks(numTicks);\n\n const xAxisGroup = svg.append('g')\n .attr('transform', `translate(0,${chartHeight})`)\n .call(xAxis);\n\n xAxisGroup.selectAll(\"text\")\n .attr(\"transform\", \"translate(0, 10)\")\n .attr('color', '#8E8E93')\n .style(\"text-anchor\", \"middle\");\n\n // Y Axis\n const yAxis = svg.append('g')\n yAxis.append('g').attr('color', '#8E8E93').attr(\"transform\", `translate(-10,0)`)\n .call(d3.axisLeft(y).tickSize(-width).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n ).tickSizeOuter(0) as any)\n .selectAll('line')\n .attr('stroke-dasharray', '3,3')\n .attr('stroke', '#D3D3D4');\n\n xAxisGroup.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n xAxisGroup.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Define color scale for lines\n // const color = d3.scaleOrdinal(d3.schemeCategory10);\n\n // Line and area generators\n const line = (isSmooth: boolean) => d3.line<any>()\n .x(d => x(d.month)!)\n .y(d => y(d.value))\n .curve(isSmooth ? d3.curveMonotoneX : d3.curveLinear); // Conditionally smooth the line\n\n const area = d3.area<any>()\n .x(d => x(d.month)!)\n .y0(chartHeight)\n .y1(d => y(d.value));\n\n // Iterate over each dataset to create lines and areas\n data.forEach((dataset, i) => {\n // const datasetColor = color(i.toString());\n\n // Create gradient for each area\n const gradient = svg.append('defs')\n .append('linearGradient')\n .attr('id', `area-gradient-${i}`)\n .attr('x1', '0%')\n .attr('x2', '0%')\n .attr('y1', '0%')\n .attr('y2', '100%');\n\n gradient.append('stop')\n .attr('offset', '0%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.4);\n\n gradient.append('stop')\n .attr('offset', '100%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.1);\n\n // Append the area with gradient\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', `url(#area-gradient-${i})`)\n .attr('d', area);\n\n // Append the line with smoothness condition\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', 'none')\n .attr('stroke', colors[i])\n .attr('stroke-width', 2)\n .attr('d', line(dataset.isSmooth || false)); // Use smoothness from the dataset\n\n // Append circles for hover effect\n {\n dataset?.showCircle &&\n svg.selectAll(`circle-${i}`)\n .data(dataset.values)\n .enter()\n .append('circle')\n .attr('cx', d => x(d.month)!)\n .attr('cy', d => y(d.value))\n .attr('r', 5)\n .attr('fill', colors[i])\n .attr('stroke', '#fff')\n .style('cursor', 'pointer')\n .on('mouseover', function (event, d) {\n setTooltipData({\n x: `${event.pageX + 10}px`,\n y: `${event.pageY - 30}px`,\n content: `${dataset.name}: ${d.value}`\n });\n d3.select(this).transition().attr('r', 7).attr('fill', '#ff4500');\n })\n .on('mouseout', function () {\n setTooltipData(null);\n d3.select(this).transition().attr('r', 5).attr('fill', colors[i]);\n });\n }\n\n });\n\n }, [data, containerWidth, height, customLabelFormatter, yAxisLabelType, currency, colors, customLegend]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <div style={{ position: 'relative' }}>\n <svg ref={svgRef} width=\"100%\" height={height} />\n {\n customLegend &&\n customLegend\n\n }\n </div>\n {tooltipData &&\n <Box sx={{\n position: 'absolute',\n left: tooltipData.x,\n top: tooltipData.y,\n pointerEvents: 'none',\n backgroundColor: '#2EB273',\n zIndex: '99999',\n border: 'none',\n borderRadius: '3px',\n transform: 'translate(-50%, -100%)',\n padding: '2px 6px 2px 6px',\n gap: '10px'\n }}>\n <span style={{ fontSize: '16px', weight: '500', color: '#ffff' }}>\n {tooltipData.content}\n </span>\n </Box>\n }\n </div>\n );\n};\n\nexport { AreaLineChart };\nexport default AreaLineChart;\n"],"names":["d3.format","d3.select","d3.scalePoint","d3.scaleLinear","d3.max","d3.axisBottom","d3.axisLeft","line","d3.line","d3.curveMonotoneX","d3.curveLinear","area","d3.area"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,eAAe,CAAC,KAAa,QAAgB,cAAsB;AACrE,MAAI,cAAc,aAAa;AAC3B,WAAO,GAAGA,OAAU,KAAK,EAAE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B,EAAA,CACJ;AAAA,EAAA,GAER;AAER;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../node_modules/d3-scale/src/linear/index.js"),a=require("../../../node_modules/d3-array/src/max/index.js"),n=require("../../../node_modules/@mui/material/Box/Box/index.js"),o=require("../../../node_modules/d3-selection/src/select/index.js"),s=require("../../../node_modules/d3-scale/src/band/index.js"),l=require("../../../node_modules/d3-axis/src/axis/index.js"),i=require("../../../node_modules/d3-shape/src/area/index.js"),d=require("../../../node_modules/d3-shape/src/line/index.js"),u=require("../../../node_modules/d3-format/src/defaultLocale/index.js"),c=require("../../../node_modules/d3-shape/src/curve/monotone/index.js"),p=require("../../../node_modules/d3-shape/src/curve/linear/index.js");const f=({data:f,height:m=400,customLabelFormatter:x,yAxisLabelType:h="inValue",currency:v,colors:g,customLegend:y})=>{const j=t.useRef(null),k=t.useRef(null),[q,_]=t.useState(0),[b,$]=t.useState(null);return t.useEffect(()=>{const e=k.current,t=new ResizeObserver(e=>{if(e[0]){const t=e[0].contentRect.width;_(t)}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),t.useEffect(()=>{if(0===q)return;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../node_modules/d3-scale/src/linear/index.js"),a=require("../../../node_modules/d3-array/src/max/index.js"),n=require("../../../node_modules/@mui/material/Box/Box/index.js"),o=require("../../../node_modules/d3-selection/src/select/index.js"),s=require("../../../node_modules/d3-scale/src/band/index.js"),l=require("../../../node_modules/d3-axis/src/axis/index.js"),i=require("../../../node_modules/d3-shape/src/area/index.js"),d=require("../../../node_modules/d3-shape/src/line/index.js"),u=require("../../../node_modules/d3-format/src/defaultLocale/index.js"),c=require("../../../node_modules/d3-shape/src/curve/monotone/index.js"),p=require("../../../node_modules/d3-shape/src/curve/linear/index.js");const f=({data:f,height:m=400,customLabelFormatter:x,yAxisLabelType:h="inValue",currency:v,colors:g,customLegend:y})=>{const j=t.useRef(null),k=t.useRef(null),[q,_]=t.useState(0),[b,$]=t.useState(null);return t.useEffect(()=>{const e=k.current,t=new ResizeObserver(e=>{if(e[0]){const t=e[0].contentRect.width;_(t)}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),t.useEffect(()=>{var e,t;if(0===q)return;const n=q-40-30,y=m-20-30;o.default(j.current).selectAll("*").remove();const k=o.default(j.current).attr("width",q).attr("height",m).append("g").attr("transform","translate(40,20)"),_=s.point().domain(null==(t=null==(e=f[0])?void 0:e.values)?void 0:t.map(e=>e.month)).range([0,n]),b=r.default().domain([0,a.default(f,e=>a.default(e.values,e=>e.value))]).range([y,0]),E=Math.floor(n/80),w=l.axisBottom(_).ticks(E),A=k.append("g").attr("transform",`translate(0,${y})`).call(w);A.selectAll("text").attr("transform","translate(0, 10)").attr("color","#8E8E93").style("text-anchor","middle");const S=k.append("g");S.append("g").attr("color","#8E8E93").attr("transform","translate(-10,0)").call(l.axisLeft(b).tickSize(-n).tickFormat(e=>{return x?x(e):(t=e,r=v,"inPercent"===(a=h)?`${u.format(".0%")(t/100)}`:"inValue"===a?`${r||""} ${u.format(".2s")(t).replace("k","K")}`:t.toString());var t,r,a}).tickSizeOuter(0)).selectAll("line").attr("stroke-dasharray","3,3").attr("stroke","#D3D3D4"),A.selectAll(".tick line").remove(),S.select(".domain").attr("stroke","none"),A.select(".domain").attr("stroke","none");const L=i.default().x(e=>_(e.month)).y0(y).y1(e=>b(e.value));f.forEach((e,t)=>{const r=k.append("defs").append("linearGradient").attr("id",`area-gradient-${t}`).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");var a;r.append("stop").attr("offset","0%").attr("stop-color",g[t]).attr("stop-opacity",.4),r.append("stop").attr("offset","100%").attr("stop-color",g[t]).attr("stop-opacity",.1),k.append("path").datum(e.values).attr("fill",`url(#area-gradient-${t})`).attr("d",L),k.append("path").datum(e.values).attr("fill","none").attr("stroke",g[t]).attr("stroke-width",2).attr("d",(a=e.isSmooth||!1,d.default().x(e=>_(e.month)).y(e=>b(e.value)).curve(a?c.monotoneX:p.default))),(null==e?void 0:e.showCircle)&&k.selectAll(`circle-${t}`).data(e.values).enter().append("circle").attr("cx",e=>_(e.month)).attr("cy",e=>b(e.value)).attr("r",5).attr("fill",g[t]).attr("stroke","#fff").style("cursor","pointer").on("mouseover",function(t,r){$({x:`${t.pageX+10}px`,y:t.pageY-30+"px",content:`${e.name}: ${r.value}`}),o.default(this).transition().attr("r",7).attr("fill","#ff4500")}).on("mouseout",function(){$(null),o.default(this).transition().attr("r",5).attr("fill",g[t])})})},[f,q,m,x,h,v,g,y]),/* @__PURE__ */e.jsxs("div",{ref:k,style:{width:"100%",height:"100%"},children:[
|
|
2
2
|
/* @__PURE__ */e.jsxs("div",{style:{position:"relative"},children:[
|
|
3
3
|
/* @__PURE__ */e.jsx("svg",{ref:j,width:"100%",height:m}),y&&y]}),b&&/* @__PURE__ */e.jsx(n.default,{sx:{position:"absolute",left:b.x,top:b.y,pointerEvents:"none",backgroundColor:"#2EB273",zIndex:"99999",border:"none",borderRadius:"3px",transform:"translate(-50%, -100%)",padding:"2px 6px 2px 6px",gap:"10px"},children:/* @__PURE__ */e.jsx("span",{style:{fontSize:"16px",weight:"500",color:"#ffff"},children:b.content})})]})};exports.AreaLineChart=f,exports.default=f;
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/charts/areaLinerChart.tsx"],"sourcesContent":["import { Box } from '@mui/material';\nimport * as d3 from 'd3';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface IChartProps {\n data: { name: string, values: { month: string, value: number }[], isSmooth?: boolean }[],\n height: number,\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string;\n colors?: string[];\n customLegend: React.ReactNode\n}\n\nconst formatNumber = (num: number, symbol: string, labelType: string) => {\n if (labelType === 'inPercent') {\n return `${d3.format(\".0%\")(num / 100)}`;\n } else if (labelType === 'inValue') {\n return `${symbol || ''} ${d3.format(\".2s\")(num).replace('k', 'K')}`;\n }\n return num.toString();\n};\n\nconst AreaLineChart = ({ data, height = 400, customLabelFormatter, yAxisLabelType = 'inValue', currency, colors, customLegend }: IChartProps) => {\n const svgRef = useRef<SVGSVGElement | null>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n const [tooltipData, setTooltipData] = useState<any>(null);\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n\n useEffect(() => {\n if (containerWidth === 0) return; // Wait for the container width\n\n const margin = { top: 20, right: 30, bottom: 30, left: 40 };\n const width = containerWidth - margin.left - margin.right;\n const chartHeight = height - margin.top - margin.bottom;\n\n // Clear the SVG\n d3.select(svgRef.current).selectAll('*').remove();\n\n const svg = d3\n .select(svgRef.current)\n .attr('width', containerWidth)\n .attr('height', height)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`);\n\n // Define scales\n const x = d3\n .scalePoint()\n .domain(data[0].values.map(d => d.month)) // Assuming all datasets share the same x-domain\n .range([0, width]);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, dataset => d3.max(dataset.values, d => d.value))!]) // Max value across all datasets\n .range([chartHeight, 0]);\n\n // Limit x-axis ticks dynamically based on width\n const numTicks = Math.floor(width / 80); // Adjust the factor (80) based on chart width\n const xAxis = d3.axisBottom(x).ticks(numTicks);\n\n const xAxisGroup = svg.append('g')\n .attr('transform', `translate(0,${chartHeight})`)\n .call(xAxis);\n\n xAxisGroup.selectAll(\"text\")\n .attr(\"transform\", \"translate(0, 10)\")\n .attr('color', '#8E8E93')\n .style(\"text-anchor\", \"middle\");\n\n // Y Axis\n const yAxis = svg.append('g')\n yAxis.append('g').attr('color', '#8E8E93').attr(\"transform\", `translate(-10,0)`)\n .call(d3.axisLeft(y).tickSize(-width).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n ).tickSizeOuter(0) as any)\n .selectAll('line')\n .attr('stroke-dasharray', '3,3')\n .attr('stroke', '#D3D3D4');\n\n xAxisGroup.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n xAxisGroup.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Define color scale for lines\n // const color = d3.scaleOrdinal(d3.schemeCategory10);\n\n // Line and area generators\n const line = (isSmooth: boolean) => d3.line<any>()\n .x(d => x(d.month)!)\n .y(d => y(d.value))\n .curve(isSmooth ? d3.curveMonotoneX : d3.curveLinear); // Conditionally smooth the line\n\n const area = d3.area<any>()\n .x(d => x(d.month)!)\n .y0(chartHeight)\n .y1(d => y(d.value));\n\n // Iterate over each dataset to create lines and areas\n data.forEach((dataset, i) => {\n // const datasetColor = color(i.toString());\n\n // Create gradient for each area\n const gradient = svg.append('defs')\n .append('linearGradient')\n .attr('id', `area-gradient-${i}`)\n .attr('x1', '0%')\n .attr('x2', '0%')\n .attr('y1', '0%')\n .attr('y2', '100%');\n\n gradient.append('stop')\n .attr('offset', '0%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.4);\n\n gradient.append('stop')\n .attr('offset', '100%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.1);\n\n // Append the area with gradient\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', `url(#area-gradient-${i})`)\n .attr('d', area);\n\n // Append the line with smoothness condition\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', 'none')\n .attr('stroke', colors[i])\n .attr('stroke-width', 2)\n .attr('d', line(dataset.isSmooth || false)); // Use smoothness from the dataset\n\n // Append circles for hover effect\n {\n dataset?.showCircle &&\n svg.selectAll(`circle-${i}`)\n .data(dataset.values)\n .enter()\n .append('circle')\n .attr('cx', d => x(d.month)!)\n .attr('cy', d => y(d.value))\n .attr('r', 5)\n .attr('fill', colors[i])\n .attr('stroke', '#fff')\n .style('cursor', 'pointer')\n .on('mouseover', function (event, d) {\n setTooltipData({\n x: `${event.pageX + 10}px`,\n y: `${event.pageY - 30}px`,\n content: `${dataset.name}: ${d.value}`\n });\n d3.select(this).transition().attr('r', 7).attr('fill', '#ff4500');\n })\n .on('mouseout', function () {\n setTooltipData(null);\n d3.select(this).transition().attr('r', 5).attr('fill', colors[i]);\n });\n }\n\n });\n\n }, [data, containerWidth, height, customLabelFormatter, yAxisLabelType, currency, colors, customLegend]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <div style={{ position: 'relative' }}>\n <svg ref={svgRef} width=\"100%\" height={height} />\n {\n customLegend &&\n customLegend\n\n }\n </div>\n {tooltipData &&\n <Box sx={{\n position: 'absolute',\n left: tooltipData.x,\n top: tooltipData.y,\n pointerEvents: 'none',\n backgroundColor: '#2EB273',\n zIndex: '99999',\n border: 'none',\n borderRadius: '3px',\n transform: 'translate(-50%, -100%)',\n padding: '2px 6px 2px 6px',\n gap: '10px'\n }}>\n <span style={{ fontSize: '16px', weight: '500', color: '#ffff' }}>\n {tooltipData.content}\n </span>\n </Box>\n }\n </div>\n );\n};\n\nexport { AreaLineChart };\nexport default AreaLineChart;\n"],"names":["AreaLineChart","data","height","customLabelFormatter","yAxisLabelType","currency","colors","customLegend","svgRef","useRef","wrapperRef","containerWidth","setContainerWidth","useState","tooltipData","setTooltipData","useEffect","wrapper","current","resizeObserver","ResizeObserver","entries","newWidth","contentRect","width","observe","unobserve","chartHeight","d3.select","selectAll","remove","svg","attr","append","x","d3.scalePoint","domain","values","map","d","month","range","y","d3.scaleLinear","d3.max","dataset","value","numTicks","Math","floor","xAxis","d3.axisBottom","ticks","xAxisGroup","call","style","yAxis","d3.axisLeft","tickSize","tickFormat","num","symbol","labelType","d3.format","replace","toString","tickSizeOuter","select","area","d3.area","y0","y1","forEach","i","gradient","isSmooth","datum","d3.line","curve","d3.curveMonotoneX","d3.curveLinear","showCircle","enter","on","event","pageX","pageY","content","name","this","transition","jsxs","ref","children","position","jsx","Box","sx","left","top","pointerEvents","backgroundColor","zIndex","border","borderRadius","transform","padding","gap","fontSize","weight","color"],"mappings":"00BAcA,MASMA,EAAgB,EAAGC,OAAMC,SAAS,IAAKC,uBAAsBC,iBAAiB,UAAWC,WAAUC,SAAQC,mBAC7G,MAAMC,EAASC,EAAAA,OAA6B,MACtCC,EAAaD,EAAAA,OAAuB,OACnCE,EAAgBC,GAAqBC,EAAAA,SAAiB,IACtDC,EAAaC,GAAkBF,EAAAA,SAAc,MAiKpD,OAhKAG,EAAAA,UAAU,KACN,MAAMC,EAAUP,EAAWQ,QAErBC,EAAiB,IAAIC,eAAgBC,IACvC,GAAIA,EAAQ,GAAI,CACZ,MAAMC,EAAWD,EAAQ,GAAGE,YAAYC,MACxCZ,EAAkBU,EACtB,IAOJ,OAJIL,GACAE,EAAeM,QAAQR,GAGpB,KACCA,GACAE,EAAeO,UAAUT,KAGlC,IAEHD,EAAAA,UAAU,KACN,GAAuB,IAAnBL,EAAsB,OAE1B,MACMa,EAAQb,EADyC,GAAtB,GAE3BgB,EAAczB,EAFE,GAAuB,GAK7C0B,EAAAA,QAAUpB,EAAOU,SAASW,UAAU,KAAKC,SAEzC,MAAMC,EAAMH,EAAAA,QACApB,EAAOU,SACdc,KAAK,QAASrB,GACdqB,KAAK,SAAU9B,GACf+B,OAAO,KACPD,KAAK,YAAa,oBAGjBE,EAAIC,EAAAA,QAELC,OAAOnC,EAAK,GAAGoC,OAAOC,IAAIC,GAAKA,EAAEC,QACjCC,MAAM,CAAC,EAAGjB,IAETkB,EAAIC,YA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,GAAGA,KAAK,OAAQ1B,EAAOmE,GAClE,MAKjB,CAACxE,EAAMU,EAAgBT,EAAQC,EAAsBC,EAAgBC,EAAUC,EAAQC,mBAGtFoF,OAAC,MAAA,CAAIC,IAAKlF,EAAY6C,MAAO,CAAE/B,MAAO,OAAQtB,OAAQ,QAClD2F,SAAA;eAAAF,EAAAA,KAAC,MAAA,CAAIpC,MAAO,CAAEuC,SAAU,YACpBD,SAAA;eAAAE,EAAAA,IAAC,MAAA,CAAIH,IAAKpF,EAAQgB,MAAM,OAAOtB,WAE3BK,GACAA,KAIPO,kBACGiF,EAAAA,IAACC,UAAA,CAAIC,GAAI,CACLH,SAAU,WACVI,KAAMpF,EAAYoB,EAClBiE,IAAKrF,EAAY4B,EACjB0D,cAAe,OACfC,gBAAiB,UACjBC,OAAQ,QACRC,OAAQ,OACRC,aAAc,MACdC,UAAW,yBACXC,QAAS,kBACTC,IAAK,QAELd,wBAAAE,EAAAA,IAAC,OAAA,CAAKxC,MAAO,CAAEqD,SAAU,OAAQC,OAAQ,MAAOC,MAAO,SAClDjB,SAAA/E,EAAYyE"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/charts/areaLinerChart.tsx"],"sourcesContent":["import { Box } from '@mui/material';\nimport * as d3 from 'd3';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface IChartProps {\n data: { name: string, values: { month: string, value: number }[], isSmooth?: boolean }[],\n height: number,\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string;\n colors?: string[];\n customLegend: React.ReactNode\n}\n\nconst formatNumber = (num: number, symbol: string, labelType: string) => {\n if (labelType === 'inPercent') {\n return `${d3.format(\".0%\")(num / 100)}`;\n } else if (labelType === 'inValue') {\n return `${symbol || ''} ${d3.format(\".2s\")(num).replace('k', 'K')}`;\n }\n return num.toString();\n};\n\nconst AreaLineChart = ({ data, height = 400, customLabelFormatter, yAxisLabelType = 'inValue', currency, colors, customLegend }: IChartProps) => {\n const svgRef = useRef<SVGSVGElement | null>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n const [tooltipData, setTooltipData] = useState<any>(null);\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n\n useEffect(() => {\n if (containerWidth === 0) return; // Wait for the container width\n\n const margin = { top: 20, right: 30, bottom: 30, left: 40 };\n const width = containerWidth - margin.left - margin.right;\n const chartHeight = height - margin.top - margin.bottom;\n\n // Clear the SVG\n d3.select(svgRef.current).selectAll('*').remove();\n\n const svg = d3\n .select(svgRef.current)\n .attr('width', containerWidth)\n .attr('height', height)\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`);\n\n // Define scales\n const x = d3\n .scalePoint()\n .domain(data[0]?.values?.map(d => d.month)) // Assuming all datasets share the same x-domain\n .range([0, width]);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, dataset => d3.max(dataset.values, d => d.value))!]) // Max value across all datasets\n .range([chartHeight, 0]);\n\n // Limit x-axis ticks dynamically based on width\n const numTicks = Math.floor(width / 80); // Adjust the factor (80) based on chart width\n const xAxis = d3.axisBottom(x).ticks(numTicks);\n\n const xAxisGroup = svg.append('g')\n .attr('transform', `translate(0,${chartHeight})`)\n .call(xAxis);\n\n xAxisGroup.selectAll(\"text\")\n .attr(\"transform\", \"translate(0, 10)\")\n .attr('color', '#8E8E93')\n .style(\"text-anchor\", \"middle\");\n\n // Y Axis\n const yAxis = svg.append('g')\n yAxis.append('g').attr('color', '#8E8E93').attr(\"transform\", `translate(-10,0)`)\n .call(d3.axisLeft(y).tickSize(-width).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n ).tickSizeOuter(0) as any)\n .selectAll('line')\n .attr('stroke-dasharray', '3,3')\n .attr('stroke', '#D3D3D4');\n\n xAxisGroup.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n xAxisGroup.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Define color scale for lines\n // const color = d3.scaleOrdinal(d3.schemeCategory10);\n\n // Line and area generators\n const line = (isSmooth: boolean) => d3.line<any>()\n .x(d => x(d.month)!)\n .y(d => y(d.value))\n .curve(isSmooth ? d3.curveMonotoneX : d3.curveLinear); // Conditionally smooth the line\n\n const area = d3.area<any>()\n .x(d => x(d.month)!)\n .y0(chartHeight)\n .y1(d => y(d.value));\n\n // Iterate over each dataset to create lines and areas\n data.forEach((dataset, i) => {\n // const datasetColor = color(i.toString());\n\n // Create gradient for each area\n const gradient = svg.append('defs')\n .append('linearGradient')\n .attr('id', `area-gradient-${i}`)\n .attr('x1', '0%')\n .attr('x2', '0%')\n .attr('y1', '0%')\n .attr('y2', '100%');\n\n gradient.append('stop')\n .attr('offset', '0%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.4);\n\n gradient.append('stop')\n .attr('offset', '100%')\n .attr('stop-color', colors[i])\n .attr('stop-opacity', 0.1);\n\n // Append the area with gradient\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', `url(#area-gradient-${i})`)\n .attr('d', area);\n\n // Append the line with smoothness condition\n svg.append('path')\n .datum(dataset.values)\n .attr('fill', 'none')\n .attr('stroke', colors[i])\n .attr('stroke-width', 2)\n .attr('d', line(dataset.isSmooth || false)); // Use smoothness from the dataset\n\n // Append circles for hover effect\n {\n dataset?.showCircle &&\n svg.selectAll(`circle-${i}`)\n .data(dataset.values)\n .enter()\n .append('circle')\n .attr('cx', d => x(d.month)!)\n .attr('cy', d => y(d.value))\n .attr('r', 5)\n .attr('fill', colors[i])\n .attr('stroke', '#fff')\n .style('cursor', 'pointer')\n .on('mouseover', function (event, d) {\n setTooltipData({\n x: `${event.pageX + 10}px`,\n y: `${event.pageY - 30}px`,\n content: `${dataset.name}: ${d.value}`\n });\n d3.select(this).transition().attr('r', 7).attr('fill', '#ff4500');\n })\n .on('mouseout', function () {\n setTooltipData(null);\n d3.select(this).transition().attr('r', 5).attr('fill', colors[i]);\n });\n }\n\n });\n\n }, [data, containerWidth, height, customLabelFormatter, yAxisLabelType, currency, colors, customLegend]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <div style={{ position: 'relative' }}>\n <svg ref={svgRef} width=\"100%\" height={height} />\n {\n customLegend &&\n customLegend\n\n }\n </div>\n {tooltipData &&\n <Box sx={{\n position: 'absolute',\n left: tooltipData.x,\n top: tooltipData.y,\n pointerEvents: 'none',\n backgroundColor: '#2EB273',\n zIndex: '99999',\n border: 'none',\n borderRadius: '3px',\n transform: 'translate(-50%, -100%)',\n padding: '2px 6px 2px 6px',\n gap: '10px'\n }}>\n <span style={{ fontSize: '16px', weight: '500', color: '#ffff' }}>\n {tooltipData.content}\n </span>\n </Box>\n }\n </div>\n );\n};\n\nexport { AreaLineChart };\nexport default AreaLineChart;\n"],"names":["AreaLineChart","data","height","customLabelFormatter","yAxisLabelType","currency","colors","customLegend","svgRef","useRef","wrapperRef","containerWidth","setContainerWidth","useState","tooltipData","setTooltipData","useEffect","wrapper","current","resizeObserver","ResizeObserver","entries","newWidth","contentRect","width","observe","unobserve","chartHeight","d3.select","selectAll","remove","svg","attr","append","x","d3.scalePoint","domain","_b","_a","values","map","d","month","range","y","d3.scaleLinear","d3.max","dataset","value","numTicks","Math","floor","xAxis","d3.axisBottom","ticks","xAxisGroup","call","style","yAxis","d3.axisLeft","tickSize","tickFormat","num","symbol","labelType","d3.format","replace","toString","tickSizeOuter","select","area","d3.area","y0","y1","forEach","i","gradient","isSmooth","datum","d3.line","curve","d3.curveMonotoneX","d3.curveLinear","showCircle","enter","on","event","pageX","pageY","content","name","this","transition","jsxs","ref","children","position","jsx","Box","sx","left","top","pointerEvents","backgroundColor","zIndex","border","borderRadius","transform","padding","gap","fontSize","weight","color"],"mappings":"00BAcA,MASMA,EAAgB,EAAGC,OAAMC,SAAS,IAAKC,uBAAsBC,iBAAiB,UAAWC,WAAUC,SAAQC,mBAC7G,MAAMC,EAASC,EAAAA,OAA6B,MACtCC,EAAaD,EAAAA,OAAuB,OACnCE,EAAgBC,GAAqBC,EAAAA,SAAiB,IACtDC,EAAaC,GAAkBF,EAAAA,SAAc,MAiKpD,OAhKAG,EAAAA,UAAU,KACN,MAAMC,EAAUP,EAAWQ,QAErBC,EAAiB,IAAIC,eAAgBC,IACvC,GAAIA,EAAQ,GAAI,CACZ,MAAMC,EAAWD,EAAQ,GAAGE,YAAYC,MACxCZ,EAAkBU,EACtB,IAOJ,OAJIL,GACAE,EAAeM,QAAQR,GAGpB,KACCA,GACAE,EAAeO,UAAUT,KAGlC,IAEHD,EAAAA,UAAU,aACN,GAAuB,IAAnBL,EAAsB,OAE1B,MACMa,EAAQb,EADyC,GAAtB,GAE3BgB,EAAczB,EAFE,GAAuB,GAK7C0B,EAAAA,QAAUpB,EAAOU,SAASW,UAAU,KAAKC,SAEzC,MAAMC,EAAMH,EAAAA,QACApB,EAAOU,SACdc,KAAK,QAASrB,GACdqB,KAAK,SAAU9B,GACf+B,OAAO,KACPD,KAAK,YAAa,oBAGjBE,EAAIC,EAAAA,QAELC,OAAO,OAAAC,EAAA,OAAAC,EAAArC,EAAK,SAAL,EAAAqC,EAASC,iBAAQC,IAAIC,GAAKA,EAAEC,QACnCC,MAAM,CAAC,EAAGnB,IAEToB,EAAIC,YAELT,OAAO,CAAC,EAAGU,EAAAA,QAAO7C,EAAM8C,GAAWD,UAAOC,EAAQR,OAAQE,GAAKA,EAAEO,UACjEL,MAAM,CAAChB,EAAa,IAGnBsB,EAAWC,KAAKC,MAAM3B,EAAQ,IAC9B4B,EAAQC,EAAAA,WAAcnB,GAAGoB,MAAML,GAE/B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SAAA;eAAAF,EAAAA,KAAC,MAAA,CAAIpC,MAAO,CAAEuC,SAAU,YACpBD,SAAA;eAAAE,EAAAA,IAAC,MAAA,CAAIH,IAAKtF,EAAQgB,MAAM,OAAOtB,WAE3BK,GACAA,KAIPO,kBACGmF,EAAAA,IAACC,UAAA,CAAIC,GAAI,CACLH,SAAU,WACVI,KAAMtF,EAAYoB,EAClBmE,IAAKvF,EAAY8B,EACjB0D,cAAe,OACfC,gBAAiB,UACjBC,OAAQ,QACRC,OAAQ,OACRC,aAAc,MACdC,UAAW,yBACXC,QAAS,kBACTC,IAAK,QAELd,wBAAAE,EAAAA,IAAC,OAAA,CAAKxC,MAAO,CAAEqD,SAAU,OAAQC,OAAQ,MAAOC,MAAO,SAClDjB,SAAAjF,EAAY2E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckboxProps } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
declare const Checkbox: import('react').
|
|
3
|
+
declare const Checkbox: import('react').MemoExoticComponent<(props: CheckboxProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
export { Checkbox };
|
|
5
5
|
export default Checkbox;
|
|
@@ -16,6 +16,6 @@ export interface DatePickerProps {
|
|
|
16
16
|
textFieldProps?: any;
|
|
17
17
|
format?: string;
|
|
18
18
|
}
|
|
19
|
-
declare const DatePicker: import('react').
|
|
19
|
+
declare const DatePicker: import('react').MemoExoticComponent<(props: DatePickerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
20
|
export { DatePicker };
|
|
21
21
|
export default DatePicker;
|
|
@@ -17,6 +17,6 @@ interface IFooter {
|
|
|
17
17
|
isPaginationDisplayed?: boolean;
|
|
18
18
|
isPageSaving?: boolean;
|
|
19
19
|
}
|
|
20
|
-
declare const Footer: React.
|
|
20
|
+
declare const Footer: React.MemoExoticComponent<({ pages, setPages, currentPage, setCurrentPage, total, paginationModel, handlePaginationModel, sharedPages, resource, savePageConfiguration, handlePageDelete, enablePages, isPaginationDisplayed, isPageSaving }: IFooter) => import("react/jsx-runtime").JSX.Element>;
|
|
21
21
|
export { Footer };
|
|
22
22
|
export default Footer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
declare const DynamicMedia: React.
|
|
3
|
+
declare const DynamicMedia: React.MemoExoticComponent<(props: any) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
export { DynamicMedia };
|
|
5
5
|
export default DynamicMedia;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
declare const DynamicSelect: React.
|
|
3
|
+
declare const DynamicSelect: React.MemoExoticComponent<(props: any) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
export { DynamicSelect };
|
|
5
5
|
export default DynamicSelect;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
declare const DynamicInput: React.
|
|
3
|
+
declare const DynamicInput: React.MemoExoticComponent<(props: any) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
export { DynamicInput };
|
|
5
5
|
export default DynamicInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
declare const DynamicTime: React.
|
|
3
|
+
declare const DynamicTime: React.MemoExoticComponent<(props: any) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
export { DynamicTime };
|
|
5
5
|
export default DynamicTime;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const FormSwitcher: import('react').
|
|
1
|
+
declare const FormSwitcher: import('react').MemoExoticComponent<({ children, isFormSwitcher, control, fieldArrayName, formSwitcherName, label, resetForm, }: any) => import("react/jsx-runtime").JSX.Element>;
|
|
2
2
|
export { FormSwitcher };
|
|
3
3
|
export default FormSwitcher;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ActionArrow: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ActionArrow: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ActionArrow;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const AddCircle: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const AddCircle: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default AddCircle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowBidirectional: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowBidirectional: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowBidirectional;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowCircleDown: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowCircleDown: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowCircleDown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowDownThree: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowDownThree: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowDownThree;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowDownTwo: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowDownTwo: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowDownTwo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowDown: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowDown: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowDown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowUpDown: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowUpDown: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowUpDown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ArrowUpTwo: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const ArrowUpTwo: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default ArrowUpTwo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Assignments: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const Assignments: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default Assignments;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const BlankCircle: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const BlankCircle: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default BlankCircle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const BlockFiled: import('@emotion/styled').StyledComponent<
|
|
4
|
-
ref?: React.Ref<
|
|
5
|
-
}>;
|
|
3
|
+
export declare const BlockFiled: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
4
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
5
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
6
6
|
export default BlockFiled;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CalendarAdd: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const CalendarAdd: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default CalendarAdd;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Calendar: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const Calendar: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default Calendar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CheckboxSquare: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const CheckboxSquare: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default CheckboxSquare;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const CircularArrowSetting: import('@emotion/styled').StyledComponent<
|
|
4
|
-
ref?: React.Ref<
|
|
5
|
-
}>;
|
|
3
|
+
export declare const CircularArrowSetting: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
4
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
5
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
6
6
|
export default CircularArrowSetting;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Clock: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const Clock: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default Clock;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const Close: import('@emotion/styled').StyledComponent<
|
|
4
|
-
ref?: React.Ref<
|
|
5
|
-
}>;
|
|
3
|
+
export declare const Close: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
4
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
5
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
6
6
|
export default Close;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CoinOutline: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const CoinOutline: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default CoinOutline;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Copy: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const Copy: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default Copy;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Coupon: import('@emotion/styled').StyledComponent<
|
|
2
|
-
ref?: import('react').Ref<
|
|
3
|
-
}>;
|
|
1
|
+
export declare const Coupon: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').SVGProps<SVGSVGElement>, "ref"> & {
|
|
2
|
+
ref?: import('react').Ref<SVGSVGElement>;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
4
|
export default Coupon;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const CrossHire: import('@emotion/styled').StyledComponent<
|
|
4
|
-
ref?: React.Ref<
|
|
5
|
-
}>;
|
|
3
|
+
export declare const CrossHire: import('@emotion/styled').StyledComponent<import('@mui/material').SvgIconOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
|
|
4
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
5
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "color" | "fontSize" | "shapeRendering" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
6
6
|
export default CrossHire;
|