@erpsquad/common 1.8.6 → 1.8.8
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/extends/index.esm.js +4 -2
- package/dist/_virtual/extends/index.esm.js.map +1 -1
- package/dist/_virtual/extends/index.js +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/action-bar/action-bar/index.esm.js +4 -56
- package/dist/components/action-bar/action-bar/index.esm.js.map +1 -1
- package/dist/components/action-bar/action-bar/index.js +18 -28
- package/dist/components/action-bar/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/action-bar.d.ts +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/editor/custom-editor/index.esm.js +1 -1
- package/dist/components/editor/custom-editor/index.esm.js.map +1 -1
- package/dist/components/editor/custom-editor/index.js +1 -1
- package/dist/components/editor/custom-editor/index.js.map +1 -1
- package/dist/components/filter/filter/index.esm.js +1 -1
- package/dist/components/filter/filter/index.esm.js.map +1 -1
- package/dist/components/filter/filter/index.js +1 -1
- package/dist/components/filter/filter/index.js.map +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/header/header/index.esm.js +1 -1
- package/dist/components/header/header/index.esm.js.map +1 -1
- package/dist/components/header/header/index.js +1 -1
- package/dist/components/header/header/index.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.js +1 -1
- package/dist/components/header/redux/actionCreator/index.js.map +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/index.d.ts +28 -57
- package/dist/components/index.esm.js +433 -477
- package/dist/components/index.esm.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/location-select.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/reports-title-bar/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js.map +1 -1
- package/dist/components/switches/android-12-switch.d.ts +3 -1
- 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/upload/index.esm.js +2 -2
- package/dist/components/upload/upload/index.esm.js.map +1 -1
- package/dist/components/upload/upload/index.js +2 -2
- package/dist/components/upload/upload/index.js.map +1 -1
- package/dist/components/upload-media/upload-media.d.ts +1 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/constants/index.esm.js +2 -0
- package/dist/constants/index.esm.js.map +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/contexts/AuthContext/index.esm.js +2 -2
- package/dist/contexts/AuthContext/index.esm.js.map +1 -1
- package/dist/contexts/AuthContext/index.js +1 -1
- package/dist/contexts/AuthContext/index.js.map +1 -1
- package/dist/contexts/languageContext/index.esm.js +1 -1
- package/dist/contexts/languageContext/index.esm.js.map +1 -1
- package/dist/contexts/languageContext/index.js +1 -1
- package/dist/contexts/languageContext/index.js.map +1 -1
- package/dist/index.esm.js +549 -561
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/node_modules/@mui/icons-material/esm/Remove/index.esm.js +9 -0
- package/dist/node_modules/@mui/icons-material/esm/Remove/index.esm.js.map +1 -0
- package/dist/node_modules/@mui/icons-material/esm/Remove/index.js +2 -0
- package/dist/node_modules/@mui/icons-material/esm/Remove/index.js.map +1 -0
- package/dist/node_modules/@mui/system/createStyled/index.esm.js +4 -4
- package/dist/node_modules/@mui/system/createStyled/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.js.map +1 -1
- package/dist/redux/store/index.esm.js +5 -2
- package/dist/redux/store/index.esm.js.map +1 -1
- package/dist/redux/store/index.js +1 -1
- package/dist/redux/store/index.js.map +1 -1
- package/dist/redux/types.d.ts +1 -0
- package/dist/style.css +3 -1
- package/dist/utils/api/index.esm.js +4 -4
- 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/common/index.esm.js +8 -8
- package/dist/utils/common/index.esm.js.map +1 -1
- package/dist/utils/common/index.js +1 -1
- package/dist/utils/common/index.js.map +1 -1
- package/dist/utils/common-utility.d.ts +1 -1
- package/dist/utils/deformat-text/index.esm.js +7 -0
- package/dist/utils/deformat-text/index.esm.js.map +1 -0
- package/dist/{_virtual/ArrowDropDown → utils/deformat-text}/index.js +1 -1
- package/dist/utils/deformat-text/index.js.map +1 -0
- package/dist/utils/form-builder-conversion/index.esm.js +279 -0
- package/dist/utils/form-builder-conversion/index.esm.js.map +1 -0
- package/dist/utils/form-builder-conversion/index.js +2 -0
- package/dist/utils/form-builder-conversion/index.js.map +1 -0
- package/dist/views/form-builder/custom-form/index.esm.js +1151 -0
- package/dist/views/form-builder/custom-form/index.esm.js.map +1 -0
- package/dist/views/form-builder/custom-form/index.js +30 -0
- package/dist/views/form-builder/custom-form/index.js.map +1 -0
- package/dist/views/form-builder/custom-form.d.ts +7 -0
- package/dist/views/form-builder/element-edit-forms/checkbox/index.esm.js +327 -0
- package/dist/views/form-builder/element-edit-forms/checkbox/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/checkbox/index.js +30 -0
- package/dist/views/form-builder/element-edit-forms/checkbox/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/checkbox.d.ts +3 -0
- package/dist/views/form-builder/element-edit-forms/column-width/index.esm.js +92 -0
- package/dist/views/form-builder/element-edit-forms/column-width/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/column-width/index.js +4 -0
- package/dist/views/form-builder/element-edit-forms/column-width/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/column-width.d.ts +3 -0
- package/dist/views/form-builder/element-edit-forms/field-select/index.esm.js +89 -0
- package/dist/views/form-builder/element-edit-forms/field-select/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/field-select/index.js +3 -0
- package/dist/views/form-builder/element-edit-forms/field-select/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/field-select.d.ts +4 -0
- package/dist/views/form-builder/element-edit-forms/index.d.ts +7 -0
- package/dist/views/form-builder/element-edit-forms/section/index.esm.js +221 -0
- package/dist/views/form-builder/element-edit-forms/section/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/section/index.js +15 -0
- package/dist/views/form-builder/element-edit-forms/section/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/section.d.ts +3 -0
- package/dist/views/form-builder/element-edit-forms/select/index.esm.js +318 -0
- package/dist/views/form-builder/element-edit-forms/select/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/select/index.js +25 -0
- package/dist/views/form-builder/element-edit-forms/select/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/select.d.ts +33 -0
- package/dist/views/form-builder/element-edit-forms/table-form/index.esm.js +111 -0
- package/dist/views/form-builder/element-edit-forms/table-form/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/table-form/index.js +5 -0
- package/dist/views/form-builder/element-edit-forms/table-form/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/table-form.d.ts +13 -0
- package/dist/views/form-builder/element-edit-forms/text/index.esm.js +559 -0
- package/dist/views/form-builder/element-edit-forms/text/index.esm.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/text/index.js +31 -0
- package/dist/views/form-builder/element-edit-forms/text/index.js.map +1 -0
- package/dist/views/form-builder/element-edit-forms/text.d.ts +12 -0
- package/dist/views/form-builder/field_properties/index.esm.js +216 -0
- package/dist/views/form-builder/field_properties/index.esm.js.map +1 -0
- package/dist/views/form-builder/field_properties/index.js +2 -0
- package/dist/views/form-builder/field_properties/index.js.map +1 -0
- package/dist/views/form-builder/field_properties.d.ts +99 -0
- package/dist/views/form-builder/form-fields/index.esm.js +354 -0
- package/dist/views/form-builder/form-fields/index.esm.js.map +1 -0
- package/dist/views/form-builder/form-fields/index.js +24 -0
- package/dist/views/form-builder/form-fields/index.js.map +1 -0
- package/dist/views/form-builder/form-fields.d.ts +46 -0
- package/dist/views/form-builder/index/index.esm.js +32 -0
- package/dist/views/form-builder/index/index.esm.js.map +1 -0
- package/dist/views/form-builder/index/index.js +2 -0
- package/dist/views/form-builder/index/index.js.map +1 -0
- package/dist/views/form-builder/index.d.ts +33 -0
- package/dist/views/form-builder/redux/actionCreator/index.esm.js +41 -0
- package/dist/views/form-builder/redux/actionCreator/index.esm.js.map +1 -0
- package/dist/views/form-builder/redux/actionCreator/index.js +2 -0
- package/dist/views/form-builder/redux/actionCreator/index.js.map +1 -0
- package/dist/views/form-builder/redux/actionCreator.d.ts +5 -0
- package/dist/views/form-builder/redux/reducer/index.esm.js +96 -0
- package/dist/views/form-builder/redux/reducer/index.esm.js.map +1 -0
- package/dist/views/form-builder/redux/reducer/index.js +2 -0
- package/dist/views/form-builder/redux/reducer/index.js.map +1 -0
- package/dist/views/form-builder/redux/state/index.esm.js +23 -0
- package/dist/views/form-builder/redux/state/index.esm.js.map +1 -0
- package/dist/views/form-builder/redux/state/index.js +2 -0
- package/dist/views/form-builder/redux/state/index.js.map +1 -0
- package/dist/views/form-builder/redux/state.d.ts +27 -0
- package/dist/views/form-builder/types.d.ts +2 -0
- package/dist/views/form-builder/utils/common/index.esm.js +285 -0
- package/dist/views/form-builder/utils/common/index.esm.js.map +1 -0
- package/dist/views/form-builder/utils/common/index.js +2 -0
- package/dist/views/form-builder/utils/common/index.js.map +1 -0
- package/dist/views/form-builder/utils/common.d.ts +66 -0
- package/dist/views/form-builder/utils/index.d.ts +2 -0
- package/dist/views/index.esm.js +37 -3
- package/dist/views/index.esm.js.map +1 -1
- package/dist/views/index.js +1 -1
- package/dist/views/template-editor/components/EditorHeader/index.esm.js +1 -1
- package/dist/views/template-editor/components/EditorHeader/index.js +3 -3
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js +3 -3
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.js +14 -14
- package/dist/views/template-editor/components/EditorSidebar/index.js.map +1 -1
- package/dist/views/template-editor/templates/index.esm.js +1 -1
- package/dist/views/template-editor/templates/index.esm.js.map +1 -1
- package/dist/views/template-editor/templates/index.js +1 -1
- package/dist/views/template-editor/templates/index.js.map +1 -1
- package/dist/views/template-editor/utils/index.d.ts +1 -1
- package/package.json +35 -35
- package/CSS_SETUP.md +0 -67
- package/QUICK_START.md +0 -34
- package/dist/_virtual/ArrowDropDown/index.esm.js +0 -5
- package/dist/_virtual/ArrowDropDown/index.esm.js.map +0 -1
- package/dist/_virtual/ArrowDropDown/index.js.map +0 -1
- package/dist/_virtual/ArrowDropUp/index.esm.js +0 -5
- package/dist/_virtual/ArrowDropUp/index.esm.js.map +0 -1
- package/dist/_virtual/ArrowDropUp/index.js +0 -2
- package/dist/_virtual/ArrowDropUp/index.js.map +0 -1
- package/dist/components/Dashboard/dashboard-card/index.esm.js +0 -17
- package/dist/components/Dashboard/dashboard-card/index.esm.js.map +0 -1
- package/dist/components/Dashboard/dashboard-card/index.js +0 -6
- package/dist/components/Dashboard/dashboard-card/index.js.map +0 -1
- package/dist/components/Dashboard/dashboard-header/index.esm.js +0 -68
- package/dist/components/Dashboard/dashboard-header/index.esm.js.map +0 -1
- package/dist/components/Dashboard/dashboard-header/index.js +0 -7
- package/dist/components/Dashboard/dashboard-header/index.js.map +0 -1
- package/dist/components/activityLog/activity-log/index.esm.js +0 -104
- package/dist/components/activityLog/activity-log/index.esm.js.map +0 -1
- package/dist/components/activityLog/activity-log/index.js +0 -14
- package/dist/components/activityLog/activity-log/index.js.map +0 -1
- package/dist/components/charts/ChartLegends/index.esm.js +0 -31
- package/dist/components/charts/ChartLegends/index.esm.js.map +0 -1
- package/dist/components/charts/ChartLegends/index.js +0 -5
- package/dist/components/charts/ChartLegends/index.js.map +0 -1
- package/dist/components/charts/areaLinerChart/index.esm.js +0 -110
- package/dist/components/charts/areaLinerChart/index.esm.js.map +0 -1
- package/dist/components/charts/areaLinerChart/index.js +0 -4
- package/dist/components/charts/areaLinerChart/index.js.map +0 -1
- package/dist/components/charts/bar-chart/bar-chart/index.esm.js +0 -85
- package/dist/components/charts/bar-chart/bar-chart/index.esm.js.map +0 -1
- package/dist/components/charts/bar-chart/bar-chart/index.js +0 -2
- package/dist/components/charts/bar-chart/bar-chart/index.js.map +0 -1
- package/dist/components/charts/barChart/barChart/index.esm.js +0 -147
- package/dist/components/charts/barChart/barChart/index.esm.js.map +0 -1
- package/dist/components/charts/barChart/barChart/index.js +0 -2
- package/dist/components/charts/barChart/barChart/index.js.map +0 -1
- package/dist/components/charts/barLineChart/barLinechart/index.esm.js +0 -193
- package/dist/components/charts/barLineChart/barLinechart/index.esm.js.map +0 -1
- package/dist/components/charts/barLineChart/barLinechart/index.js +0 -11
- package/dist/components/charts/barLineChart/barLinechart/index.js.map +0 -1
- package/dist/components/charts/donut-chart/donut-chart/index.esm.js +0 -85
- package/dist/components/charts/donut-chart/donut-chart/index.esm.js.map +0 -1
- package/dist/components/charts/donut-chart/donut-chart/index.js +0 -6
- package/dist/components/charts/donut-chart/donut-chart/index.js.map +0 -1
- package/dist/components/charts/donutChart/DonutChart/index.esm.js +0 -96
- package/dist/components/charts/donutChart/DonutChart/index.esm.js.map +0 -1
- package/dist/components/charts/donutChart/DonutChart/index.js +0 -5
- package/dist/components/charts/donutChart/DonutChart/index.js.map +0 -1
- package/dist/components/charts/groupBarChart/GroupBarChart/index.esm.js +0 -92
- package/dist/components/charts/groupBarChart/GroupBarChart/index.esm.js.map +0 -1
- package/dist/components/charts/groupBarChart/GroupBarChart/index.js +0 -2
- package/dist/components/charts/groupBarChart/GroupBarChart/index.js.map +0 -1
- package/dist/components/charts/line-chart/area-lineChart/index.esm.js +0 -55
- package/dist/components/charts/line-chart/area-lineChart/index.esm.js.map +0 -1
- package/dist/components/charts/line-chart/area-lineChart/index.js +0 -2
- package/dist/components/charts/line-chart/area-lineChart/index.js.map +0 -1
- package/dist/components/charts/line-chart/line-chart/index.esm.js +0 -108
- package/dist/components/charts/line-chart/line-chart/index.esm.js.map +0 -1
- package/dist/components/charts/line-chart/line-chart/index.js +0 -2
- package/dist/components/charts/line-chart/line-chart/index.js.map +0 -1
- package/dist/components/charts/multiLineChart/multi-line-chart/index.esm.js +0 -100
- package/dist/components/charts/multiLineChart/multi-line-chart/index.esm.js.map +0 -1
- package/dist/components/charts/multiLineChart/multi-line-chart/index.js +0 -2
- package/dist/components/charts/multiLineChart/multi-line-chart/index.js.map +0 -1
- package/dist/components/grid/custom-grid-card/custom-grid-card/index.esm.js +0 -131
- package/dist/components/grid/custom-grid-card/custom-grid-card/index.esm.js.map +0 -1
- package/dist/components/grid/custom-grid-card/custom-grid-card/index.js +0 -11
- package/dist/components/grid/custom-grid-card/custom-grid-card/index.js.map +0 -1
- package/dist/components/grid/grid-card/grid-card/index.esm.js +0 -102
- package/dist/components/grid/grid-card/grid-card/index.esm.js.map +0 -1
- package/dist/components/grid/grid-card/grid-card/index.js +0 -12
- package/dist/components/grid/grid-card/grid-card/index.js.map +0 -1
- package/dist/components/grid/grid-wrapper/grid-wrapper/index.esm.js +0 -17
- package/dist/components/grid/grid-wrapper/grid-wrapper/index.esm.js.map +0 -1
- package/dist/components/grid/grid-wrapper/grid-wrapper/index.js +0 -5
- package/dist/components/grid/grid-wrapper/grid-wrapper/index.js.map +0 -1
- package/dist/components/mulitline/multiline/index.esm.js +0 -62
- package/dist/components/mulitline/multiline/index.esm.js.map +0 -1
- package/dist/components/mulitline/multiline/index.js +0 -13
- package/dist/components/mulitline/multiline/index.js.map +0 -1
- package/dist/components/reports/dynamic-report/dynamic-report/index.esm.js +0 -472
- package/dist/components/reports/dynamic-report/dynamic-report/index.esm.js.map +0 -1
- package/dist/components/reports/dynamic-report/dynamic-report/index.js +0 -8
- package/dist/components/reports/dynamic-report/dynamic-report/index.js.map +0 -1
- package/dist/components/reports/dynamic-report/dynamic-rows/index.esm.js +0 -201
- package/dist/components/reports/dynamic-report/dynamic-rows/index.esm.js.map +0 -1
- package/dist/components/reports/dynamic-report/dynamic-rows/index.js +0 -6
- package/dist/components/reports/dynamic-report/dynamic-rows/index.js.map +0 -1
- package/dist/components/rfq-response/item-response-details/index.esm.js +0 -91
- package/dist/components/rfq-response/item-response-details/index.esm.js.map +0 -1
- package/dist/components/rfq-response/item-response-details/index.js +0 -9
- package/dist/components/rfq-response/item-response-details/index.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/extends/index.esm.js +0 -23
- package/dist/node_modules/@babel/runtime/helpers/extends/index.esm.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/extends/index.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/extends/index.js.map +0 -1
- package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.esm.js +0 -18
- package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.esm.js.map +0 -1
- package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.js +0 -2
- package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.js.map +0 -1
- package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.esm.js +0 -18
- package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.esm.js.map +0 -1
- package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.js +0 -2
- package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/ascending/index.esm.js +0 -7
- package/dist/node_modules/d3-array/src/ascending/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/ascending/index.js +0 -2
- package/dist/node_modules/d3-array/src/ascending/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/bisect/index.esm.js +0 -11
- package/dist/node_modules/d3-array/src/bisect/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/bisect/index.js +0 -2
- package/dist/node_modules/d3-array/src/bisect/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/bisector/index.esm.js +0 -48
- package/dist/node_modules/d3-array/src/bisector/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/bisector/index.js +0 -2
- package/dist/node_modules/d3-array/src/bisector/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/descending/index.esm.js +0 -7
- package/dist/node_modules/d3-array/src/descending/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/descending/index.js +0 -2
- package/dist/node_modules/d3-array/src/descending/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/max/index.esm.js +0 -22
- package/dist/node_modules/d3-array/src/max/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/max/index.js +0 -2
- package/dist/node_modules/d3-array/src/max/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/min/index.esm.js +0 -22
- package/dist/node_modules/d3-array/src/min/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/min/index.js +0 -2
- package/dist/node_modules/d3-array/src/min/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/number/index.esm.js +0 -7
- package/dist/node_modules/d3-array/src/number/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/number/index.js +0 -2
- package/dist/node_modules/d3-array/src/number/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/range/index.esm.js +0 -12
- package/dist/node_modules/d3-array/src/range/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/range/index.js +0 -2
- package/dist/node_modules/d3-array/src/range/index.js.map +0 -1
- package/dist/node_modules/d3-array/src/ticks/index.esm.js +0 -52
- package/dist/node_modules/d3-array/src/ticks/index.esm.js.map +0 -1
- package/dist/node_modules/d3-array/src/ticks/index.js +0 -2
- package/dist/node_modules/d3-array/src/ticks/index.js.map +0 -1
- package/dist/node_modules/d3-axis/src/axis/index.esm.js +0 -99
- package/dist/node_modules/d3-axis/src/axis/index.esm.js.map +0 -1
- package/dist/node_modules/d3-axis/src/axis/index.js +0 -2
- package/dist/node_modules/d3-axis/src/axis/index.js.map +0 -1
- package/dist/node_modules/d3-axis/src/identity/index.esm.js +0 -7
- package/dist/node_modules/d3-axis/src/identity/index.esm.js.map +0 -1
- package/dist/node_modules/d3-axis/src/identity/index.js +0 -2
- package/dist/node_modules/d3-axis/src/identity/index.js.map +0 -1
- package/dist/node_modules/d3-color/src/color/index.esm.js +0 -339
- package/dist/node_modules/d3-color/src/color/index.esm.js.map +0 -1
- package/dist/node_modules/d3-color/src/color/index.js +0 -2
- package/dist/node_modules/d3-color/src/color/index.js.map +0 -1
- package/dist/node_modules/d3-color/src/define/index.esm.js +0 -14
- package/dist/node_modules/d3-color/src/define/index.esm.js.map +0 -1
- package/dist/node_modules/d3-color/src/define/index.js +0 -2
- package/dist/node_modules/d3-color/src/define/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/defaultLocale/index.esm.js +0 -21
- package/dist/node_modules/d3-format/src/defaultLocale/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/defaultLocale/index.js +0 -2
- package/dist/node_modules/d3-format/src/defaultLocale/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/exponent/index.esm.js +0 -8
- package/dist/node_modules/d3-format/src/exponent/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/exponent/index.js +0 -2
- package/dist/node_modules/d3-format/src/exponent/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatDecimal/index.esm.js +0 -16
- package/dist/node_modules/d3-format/src/formatDecimal/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatDecimal/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatDecimal/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatGroup/index.esm.js +0 -16
- package/dist/node_modules/d3-format/src/formatGroup/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatGroup/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatGroup/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatNumerals/index.esm.js +0 -11
- package/dist/node_modules/d3-format/src/formatNumerals/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatNumerals/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatNumerals/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatPrefixAuto/index.esm.js +0 -13
- package/dist/node_modules/d3-format/src/formatPrefixAuto/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatPrefixAuto/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatPrefixAuto/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatRounded/index.esm.js +0 -11
- package/dist/node_modules/d3-format/src/formatRounded/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatRounded/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatRounded/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatSpecifier/index.esm.js +0 -38
- package/dist/node_modules/d3-format/src/formatSpecifier/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatSpecifier/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatSpecifier/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatTrim/index.esm.js +0 -22
- package/dist/node_modules/d3-format/src/formatTrim/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatTrim/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatTrim/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatTypes/index.esm.js +0 -22
- package/dist/node_modules/d3-format/src/formatTypes/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/formatTypes/index.js +0 -2
- package/dist/node_modules/d3-format/src/formatTypes/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/identity/index.esm.js +0 -7
- package/dist/node_modules/d3-format/src/identity/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/identity/index.js +0 -2
- package/dist/node_modules/d3-format/src/identity/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/locale/index.esm.js +0 -83
- package/dist/node_modules/d3-format/src/locale/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/locale/index.js +0 -2
- package/dist/node_modules/d3-format/src/locale/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/precisionFixed/index.esm.js +0 -8
- package/dist/node_modules/d3-format/src/precisionFixed/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/precisionFixed/index.js +0 -2
- package/dist/node_modules/d3-format/src/precisionFixed/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/precisionPrefix/index.esm.js +0 -8
- package/dist/node_modules/d3-format/src/precisionPrefix/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/precisionPrefix/index.js +0 -2
- package/dist/node_modules/d3-format/src/precisionPrefix/index.js.map +0 -1
- package/dist/node_modules/d3-format/src/precisionRound/index.esm.js +0 -9
- package/dist/node_modules/d3-format/src/precisionRound/index.esm.js.map +0 -1
- package/dist/node_modules/d3-format/src/precisionRound/index.js +0 -2
- package/dist/node_modules/d3-format/src/precisionRound/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/array/index.esm.js +0 -14
- package/dist/node_modules/d3-interpolate/src/array/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/array/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/array/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/color/index.esm.js +0 -25
- package/dist/node_modules/d3-interpolate/src/color/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/color/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/color/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/constant/index.esm.js +0 -5
- package/dist/node_modules/d3-interpolate/src/constant/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/constant/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/constant/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/date/index.esm.js +0 -10
- package/dist/node_modules/d3-interpolate/src/date/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/date/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/date/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/number/index.esm.js +0 -9
- package/dist/node_modules/d3-interpolate/src/number/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/number/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/number/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/numberArray/index.esm.js +0 -16
- package/dist/node_modules/d3-interpolate/src/numberArray/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/numberArray/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/numberArray/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/object/index.esm.js +0 -21
- package/dist/node_modules/d3-interpolate/src/object/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/object/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/object/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/rgb/index.esm.js +0 -21
- package/dist/node_modules/d3-interpolate/src/rgb/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/rgb/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/rgb/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/round/index.esm.js +0 -9
- package/dist/node_modules/d3-interpolate/src/round/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/round/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/round/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/string/index.esm.js +0 -44
- package/dist/node_modules/d3-interpolate/src/string/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/string/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/string/index.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/value/index.esm.js +0 -17
- package/dist/node_modules/d3-interpolate/src/value/index.esm.js.map +0 -1
- package/dist/node_modules/d3-interpolate/src/value/index.js +0 -2
- package/dist/node_modules/d3-interpolate/src/value/index.js.map +0 -1
- package/dist/node_modules/d3-path/src/path/index.esm.js +0 -89
- package/dist/node_modules/d3-path/src/path/index.esm.js.map +0 -1
- package/dist/node_modules/d3-path/src/path/index.js +0 -2
- package/dist/node_modules/d3-path/src/path/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/band/index.esm.js +0 -71
- package/dist/node_modules/d3-scale/src/band/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/band/index.js +0 -2
- package/dist/node_modules/d3-scale/src/band/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/constant/index.esm.js +0 -9
- package/dist/node_modules/d3-scale/src/constant/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/constant/index.js +0 -2
- package/dist/node_modules/d3-scale/src/constant/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/continuous/index.esm.js +0 -96
- package/dist/node_modules/d3-scale/src/continuous/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/continuous/index.js +0 -2
- package/dist/node_modules/d3-scale/src/continuous/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/init/index.esm.js +0 -17
- package/dist/node_modules/d3-scale/src/init/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/init/index.js +0 -2
- package/dist/node_modules/d3-scale/src/init/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/linear/index.esm.js +0 -62
- package/dist/node_modules/d3-scale/src/linear/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/linear/index.js +0 -2
- package/dist/node_modules/d3-scale/src/linear/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/number/index.esm.js +0 -7
- package/dist/node_modules/d3-scale/src/number/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/number/index.js +0 -2
- package/dist/node_modules/d3-scale/src/number/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/ordinal/index.esm.js +0 -39
- package/dist/node_modules/d3-scale/src/ordinal/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/ordinal/index.js +0 -2
- package/dist/node_modules/d3-scale/src/ordinal/index.js.map +0 -1
- package/dist/node_modules/d3-scale/src/tickFormat/index.esm.js +0 -35
- package/dist/node_modules/d3-scale/src/tickFormat/index.esm.js.map +0 -1
- package/dist/node_modules/d3-scale/src/tickFormat/index.js +0 -2
- package/dist/node_modules/d3-scale/src/tickFormat/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/array/index.esm.js +0 -7
- package/dist/node_modules/d3-selection/src/array/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/array/index.js +0 -2
- package/dist/node_modules/d3-selection/src/array/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/constant/index.esm.js +0 -9
- package/dist/node_modules/d3-selection/src/constant/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/constant/index.js +0 -2
- package/dist/node_modules/d3-selection/src/constant/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/creator/index.esm.js +0 -21
- package/dist/node_modules/d3-selection/src/creator/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/creator/index.js +0 -2
- package/dist/node_modules/d3-selection/src/creator/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/matcher/index.esm.js +0 -15
- package/dist/node_modules/d3-selection/src/matcher/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/matcher/index.js +0 -2
- package/dist/node_modules/d3-selection/src/matcher/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/namespace/index.esm.js +0 -10
- package/dist/node_modules/d3-selection/src/namespace/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/namespace/index.js +0 -2
- package/dist/node_modules/d3-selection/src/namespace/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/namespaces/index.esm.js +0 -13
- package/dist/node_modules/d3-selection/src/namespaces/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/namespaces/index.js +0 -2
- package/dist/node_modules/d3-selection/src/namespaces/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/pointer/index.esm.js +0 -23
- package/dist/node_modules/d3-selection/src/pointer/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/pointer/index.js +0 -2
- package/dist/node_modules/d3-selection/src/pointer/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/select/index.esm.js +0 -8
- package/dist/node_modules/d3-selection/src/select/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/select/index.js +0 -2
- package/dist/node_modules/d3-selection/src/select/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/append/index.esm.js +0 -11
- package/dist/node_modules/d3-selection/src/selection/append/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/append/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/append/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/attr/index.esm.js +0 -47
- package/dist/node_modules/d3-selection/src/selection/attr/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/attr/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/attr/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/call/index.esm.js +0 -10
- package/dist/node_modules/d3-selection/src/selection/call/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/call/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/call/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/classed/index.esm.js +0 -65
- package/dist/node_modules/d3-selection/src/selection/classed/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/classed/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/classed/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/clone/index.esm.js +0 -15
- package/dist/node_modules/d3-selection/src/selection/clone/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/clone/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/clone/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/data/index.esm.js +0 -77
- package/dist/node_modules/d3-selection/src/selection/data/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/data/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/data/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/datum/index.esm.js +0 -7
- package/dist/node_modules/d3-selection/src/selection/datum/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/datum/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/datum/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/dispatch/index.esm.js +0 -29
- package/dist/node_modules/d3-selection/src/selection/dispatch/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/dispatch/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/dispatch/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/each/index.esm.js +0 -12
- package/dist/node_modules/d3-selection/src/selection/each/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/each/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/each/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/empty/index.esm.js +0 -7
- package/dist/node_modules/d3-selection/src/selection/empty/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/empty/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/empty/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/enter/index.esm.js +0 -32
- package/dist/node_modules/d3-selection/src/selection/enter/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/enter/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/enter/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/exit/index.esm.js +0 -9
- package/dist/node_modules/d3-selection/src/selection/exit/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/exit/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/exit/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/filter/index.esm.js +0 -17
- package/dist/node_modules/d3-selection/src/selection/filter/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/filter/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/filter/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/html/index.esm.js +0 -21
- package/dist/node_modules/d3-selection/src/selection/html/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/html/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/html/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/index/index.esm.js +0 -85
- package/dist/node_modules/d3-selection/src/selection/index/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/index/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/index/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/insert/index.esm.js +0 -15
- package/dist/node_modules/d3-selection/src/selection/insert/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/insert/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/insert/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/iterator/index.esm.js +0 -11
- package/dist/node_modules/d3-selection/src/selection/iterator/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/iterator/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/iterator/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/join/index.esm.js +0 -20
- package/dist/node_modules/d3-selection/src/selection/join/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/join/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/join/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/lower/index.esm.js +0 -10
- package/dist/node_modules/d3-selection/src/selection/lower/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/lower/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/lower/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/merge/index.esm.js +0 -19
- package/dist/node_modules/d3-selection/src/selection/merge/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/merge/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/merge/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/node/index.esm.js +0 -13
- package/dist/node_modules/d3-selection/src/selection/node/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/node/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/node/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/nodes/index.esm.js +0 -7
- package/dist/node_modules/d3-selection/src/selection/nodes/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/nodes/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/nodes/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/on/index.esm.js +0 -65
- package/dist/node_modules/d3-selection/src/selection/on/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/on/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/on/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/order/index.esm.js +0 -15
- package/dist/node_modules/d3-selection/src/selection/order/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/order/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/order/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/property/index.esm.js +0 -24
- package/dist/node_modules/d3-selection/src/selection/property/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/property/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/property/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/raise/index.esm.js +0 -10
- package/dist/node_modules/d3-selection/src/selection/raise/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/raise/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/raise/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/remove/index.esm.js +0 -11
- package/dist/node_modules/d3-selection/src/selection/remove/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/remove/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/remove/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/select/index.esm.js +0 -18
- package/dist/node_modules/d3-selection/src/selection/select/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/select/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/select/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/selectAll/index.esm.js +0 -25
- package/dist/node_modules/d3-selection/src/selection/selectAll/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/selectAll/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/selectAll/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/selectChild/index.esm.js +0 -17
- package/dist/node_modules/d3-selection/src/selection/selectChild/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/selectChild/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/selectChild/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/selectChildren/index.esm.js +0 -17
- package/dist/node_modules/d3-selection/src/selection/selectChildren/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/selectChildren/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/selectChildren/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/size/index.esm.js +0 -9
- package/dist/node_modules/d3-selection/src/selection/size/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/size/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/size/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/sort/index.esm.js +0 -23
- package/dist/node_modules/d3-selection/src/selection/sort/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/sort/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/sort/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/sparse/index.esm.js +0 -7
- package/dist/node_modules/d3-selection/src/selection/sparse/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/sparse/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/sparse/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/style/index.esm.js +0 -29
- package/dist/node_modules/d3-selection/src/selection/style/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/style/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/style/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/text/index.esm.js +0 -21
- package/dist/node_modules/d3-selection/src/selection/text/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selection/text/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selection/text/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selector/index.esm.js +0 -11
- package/dist/node_modules/d3-selection/src/selector/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selector/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selector/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selectorAll/index.esm.js +0 -12
- package/dist/node_modules/d3-selection/src/selectorAll/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/selectorAll/index.js +0 -2
- package/dist/node_modules/d3-selection/src/selectorAll/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/sourceEvent/index.esm.js +0 -9
- package/dist/node_modules/d3-selection/src/sourceEvent/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/sourceEvent/index.js +0 -2
- package/dist/node_modules/d3-selection/src/sourceEvent/index.js.map +0 -1
- package/dist/node_modules/d3-selection/src/window/index.esm.js +0 -7
- package/dist/node_modules/d3-selection/src/window/index.esm.js.map +0 -1
- package/dist/node_modules/d3-selection/src/window/index.js +0 -2
- package/dist/node_modules/d3-selection/src/window/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/arc/index.esm.js +0 -134
- package/dist/node_modules/d3-shape/src/arc/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/arc/index.js +0 -2
- package/dist/node_modules/d3-shape/src/arc/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/area/index.esm.js +0 -82
- package/dist/node_modules/d3-shape/src/area/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/area/index.js +0 -2
- package/dist/node_modules/d3-shape/src/area/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/array/index.esm.js +0 -7
- package/dist/node_modules/d3-shape/src/array/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/array/index.js +0 -2
- package/dist/node_modules/d3-shape/src/array/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/constant/index.esm.js +0 -9
- package/dist/node_modules/d3-shape/src/constant/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/constant/index.js +0 -2
- package/dist/node_modules/d3-shape/src/constant/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/curve/linear/index.esm.js +0 -39
- package/dist/node_modules/d3-shape/src/curve/linear/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/curve/linear/index.js +0 -2
- package/dist/node_modules/d3-shape/src/curve/linear/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/curve/monotone/index.esm.js +0 -76
- package/dist/node_modules/d3-shape/src/curve/monotone/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/curve/monotone/index.js +0 -2
- package/dist/node_modules/d3-shape/src/curve/monotone/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/descending/index.esm.js +0 -7
- package/dist/node_modules/d3-shape/src/descending/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/descending/index.js +0 -2
- package/dist/node_modules/d3-shape/src/descending/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/identity/index.esm.js +0 -7
- package/dist/node_modules/d3-shape/src/identity/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/identity/index.js +0 -2
- package/dist/node_modules/d3-shape/src/identity/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/line/index.esm.js +0 -42
- package/dist/node_modules/d3-shape/src/line/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/line/index.js +0 -2
- package/dist/node_modules/d3-shape/src/line/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/math/index.esm.js +0 -33
- package/dist/node_modules/d3-shape/src/math/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/math/index.js +0 -2
- package/dist/node_modules/d3-shape/src/math/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/path/index.esm.js +0 -20
- package/dist/node_modules/d3-shape/src/path/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/path/index.js +0 -2
- package/dist/node_modules/d3-shape/src/path/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/pie/index.esm.js +0 -56
- package/dist/node_modules/d3-shape/src/pie/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/pie/index.js +0 -2
- package/dist/node_modules/d3-shape/src/pie/index.js.map +0 -1
- package/dist/node_modules/d3-shape/src/point/index.esm.js +0 -11
- package/dist/node_modules/d3-shape/src/point/index.esm.js.map +0 -1
- package/dist/node_modules/d3-shape/src/point/index.js +0 -2
- package/dist/node_modules/d3-shape/src/point/index.js.map +0 -1
- package/dist/node_modules/internmap/src/index/index.esm.js +0 -44
- package/dist/node_modules/internmap/src/index/index.esm.js.map +0 -1
- package/dist/node_modules/internmap/src/index/index.js +0 -2
- package/dist/node_modules/internmap/src/index/index.js.map +0 -1
- package/dist/redux/store.d.ts +0 -1575
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useMemo, useEffect } from "react";
|
|
3
|
-
import band from "../../../../node_modules/d3-scale/src/band/index.esm.js";
|
|
4
|
-
import linear from "../../../../node_modules/d3-scale/src/linear/index.esm.js";
|
|
5
|
-
import max from "../../../../node_modules/d3-array/src/max/index.esm.js";
|
|
6
|
-
import select from "../../../../node_modules/d3-selection/src/select/index.esm.js";
|
|
7
|
-
import line from "../../../../node_modules/d3-shape/src/line/index.esm.js";
|
|
8
|
-
import { axisBottom, axisLeft } from "../../../../node_modules/d3-axis/src/axis/index.esm.js";
|
|
9
|
-
const formatNumber = (num) => {
|
|
10
|
-
if (num >= 1e9) return (num / 1e9).toFixed(1) + "B";
|
|
11
|
-
if (num >= 1e6) return (num / 1e6).toFixed(1) + "M";
|
|
12
|
-
if (num >= 1e3) return (num / 1e3).toFixed(1) + "K";
|
|
13
|
-
return num;
|
|
14
|
-
};
|
|
15
|
-
const LineChart = ({
|
|
16
|
-
data,
|
|
17
|
-
numOfLines = 5,
|
|
18
|
-
width = 500,
|
|
19
|
-
height = 300
|
|
20
|
-
}) => {
|
|
21
|
-
const svgRef = useRef(null);
|
|
22
|
-
const wrapperRef = useRef(null);
|
|
23
|
-
const maxValue = useMemo(() => {
|
|
24
|
-
return Math.max(...data.map((d) => d.value));
|
|
25
|
-
}, [data]);
|
|
26
|
-
const yAxisMaxValue = useMemo(() => {
|
|
27
|
-
return maxValue * 1.25;
|
|
28
|
-
}, [maxValue]);
|
|
29
|
-
const yAxisTicks = useMemo(() => {
|
|
30
|
-
const ticks = [];
|
|
31
|
-
const interval = yAxisMaxValue / numOfLines;
|
|
32
|
-
for (let i = 0; i <= numOfLines; i++) {
|
|
33
|
-
ticks.push(interval * i);
|
|
34
|
-
}
|
|
35
|
-
return ticks;
|
|
36
|
-
}, [yAxisMaxValue, numOfLines]);
|
|
37
|
-
const needsHorizontalScroll = data.length > 12;
|
|
38
|
-
const minGroupWidth = 120;
|
|
39
|
-
const calculatedChartWidth = needsHorizontalScroll ? Math.max(data.length * minGroupWidth, width) : width;
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
const wrapper = wrapperRef.current;
|
|
42
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
43
|
-
if (entries[0]) {
|
|
44
|
-
const newWidth = entries[0].contentRect.width;
|
|
45
|
-
setContainerWidth(newWidth);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
if (wrapper) {
|
|
49
|
-
resizeObserver.observe(wrapper);
|
|
50
|
-
}
|
|
51
|
-
return () => {
|
|
52
|
-
if (wrapper) {
|
|
53
|
-
resizeObserver.unobserve(wrapper);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}, []);
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
const svg = select(svgRef.current);
|
|
59
|
-
svg.selectAll("*").remove();
|
|
60
|
-
const margin = { top: 20, right: 20, bottom: 70, left: 40 };
|
|
61
|
-
const barWidth = calculatedChartWidth - margin.left - margin.right;
|
|
62
|
-
const barHeight = height - margin.top - margin.bottom;
|
|
63
|
-
const mousemove = (event, d) => {
|
|
64
|
-
const xPosition = event.offsetX + margin.left - 25;
|
|
65
|
-
const yPosition = event.offsetY + margin.top - 40;
|
|
66
|
-
const text = `${d.label} - ${d.value}`;
|
|
67
|
-
tooltip.attr("x", xPosition).attr("y", yPosition).style("opacity", 9).style("height", text.length >= 16 ? 50 : 35);
|
|
68
|
-
tooltipText.html(text);
|
|
69
|
-
};
|
|
70
|
-
const mouseleave = () => {
|
|
71
|
-
tooltip.style("opacity", 0);
|
|
72
|
-
};
|
|
73
|
-
const x = band().domain(data.map((d) => d.label)).range([0, barWidth]).padding(0.1);
|
|
74
|
-
const y = linear().domain([0, max(data, (d) => d.value)]).range([barHeight, 0]);
|
|
75
|
-
const chart = svg.append("g").attr("transform", `translate(${margin.left},${margin.top})`);
|
|
76
|
-
const line$1 = line().x((d) => x(d.label) + x.bandwidth() / 2).y((d) => y(d.value));
|
|
77
|
-
chart.append("path").datum(data).attr("class", "line").attr("d", line$1).style("fill", "none").style("stroke", "#357AF6").style("stroke-width", 2);
|
|
78
|
-
chart.selectAll(".point").data(data).enter().append("circle").attr("class", "point").attr("cx", (d) => x(d.label) + x.bandwidth() / 2).attr("cy", (d) => y(d.value)).attr("r", 4).style("fill", "#357AF6").on("mousemove", mousemove).on("mouseleave", mouseleave);
|
|
79
|
-
yAxisTicks.slice(1).forEach((tick) => {
|
|
80
|
-
chart.append("line").attr("class", "dotted-line").attr("x1", 0).attr("y1", y(tick)).attr("x2", width).attr("y2", y(tick)).style("stroke", "gray").style("stroke-dasharray", "3,3");
|
|
81
|
-
});
|
|
82
|
-
const xAxis = chart.append("g").attr("class", "x-axis").attr("transform", `translate(0, ${barHeight})`).call(axisBottom(x));
|
|
83
|
-
xAxis.selectAll(".tick line").remove();
|
|
84
|
-
const yAxis = chart.append("g").attr("class", "y-axis").call(
|
|
85
|
-
axisLeft(y).tickValues(yAxisTicks).tickFormat((d) => {
|
|
86
|
-
return formatNumber(d);
|
|
87
|
-
}).tickSizeOuter(0),
|
|
88
|
-
0
|
|
89
|
-
);
|
|
90
|
-
yAxis.selectAll(".domain").remove();
|
|
91
|
-
yAxis.selectAll(".tick line").remove();
|
|
92
|
-
const tooltip = svg.append("foreignObject").attr("class", "tooltip").attr("width", 120).attr("height", 20).style("opacity", 0).style("position", "absolute").style("background-color", "white").style("border", "none").style("box-shadow", "0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)").style("border-radius", "0.313rem").style("padding", "0.625rem").style("font-size", "0.75rem");
|
|
93
|
-
const tooltipText = tooltip.append("xhtml:div").style("font-size", "0.75rem").style("color", "black");
|
|
94
|
-
}, [data, height, width, yAxisMaxValue, yAxisTicks, calculatedChartWidth]);
|
|
95
|
-
return /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
96
|
-
"svg",
|
|
97
|
-
{
|
|
98
|
-
ref: svgRef,
|
|
99
|
-
width: calculatedChartWidth,
|
|
100
|
-
height,
|
|
101
|
-
viewBox: `0 0 ${calculatedChartWidth} ${height}`
|
|
102
|
-
}
|
|
103
|
-
) });
|
|
104
|
-
};
|
|
105
|
-
export {
|
|
106
|
-
LineChart as default
|
|
107
|
-
};
|
|
108
|
-
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../../src/components/charts/line-chart/line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useMemo } from \"react\";\nimport * as d3 from \"d3\";\n\ninterface DataPoint {\n label: string;\n value: number;\n}\n\ninterface LineChartProps {\n data: DataPoint[];\n numOfLines?: number;\n width?: number;\n height?: number;\n}\n\nconst formatNumber = (num: number) => {\n if (num >= 1e9) return (num / 1e9).toFixed(1) + \"B\";\n if (num >= 1e6) return (num / 1e6).toFixed(1) + \"M\";\n if (num >= 1e3) return (num / 1e3).toFixed(1) + \"K\";\n return num;\n};\n\nconst LineChart: React.FC<LineChartProps> = ({\n data,\n numOfLines = 5,\n width = 500,\n height = 300,\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const maxValue = useMemo(() => {\n return Math.max(...data.map((d) => d.value));\n }, [data]);\n\n const yAxisMaxValue = useMemo(() => {\n return maxValue * 1.25;\n }, [maxValue]);\n\n const yAxisTicks = useMemo(() => {\n const ticks = [];\n const interval = yAxisMaxValue / numOfLines;\n for (let i = 0; i <= numOfLines; i++) {\n ticks.push(interval * i);\n }\n return ticks;\n }, [yAxisMaxValue, numOfLines]);\n\n const needsHorizontalScroll = data.length > 12;\n const minGroupWidth = 120; \n const calculatedChartWidth = needsHorizontalScroll \n ? Math.max(data.length * minGroupWidth, width)\n : width;\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 useEffect(() => {\n const svg = d3.select(svgRef.current);\n\n svg.selectAll(\"*\").remove();\n\n const margin = { top: 20, right: 20, bottom: 70, left: 40 };\n const barWidth = calculatedChartWidth - margin.left - margin.right;\n const barHeight = height - margin.top - margin.bottom;\n\n const mousemove = (event: any, d: any) => {\n\n const xPosition = event.offsetX + margin.left - 25;\n const yPosition = event.offsetY + margin.top - 40;\n const text = `${d.label} - ${d.value}`;\n tooltip\n .attr(\"x\", xPosition)\n .attr(\"y\", yPosition)\n .style(\"opacity\", 9)\n .style(\"height\", text.length >= 16 ? 50 : 35);\n\n tooltipText.html(text);\n };\n\n const mouseleave = () => {\n tooltip.style(\"opacity\", 0);\n };\n\n const x = d3\n .scaleBand()\n .domain(data.map((d: any) => d.label))\n .range([0, barWidth])\n .padding(0.1);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, (d: any) => d.value)])\n .range([barHeight, 0]);\n\n const chart = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n const line = d3\n .line<DataPoint>()\n //@ts-expect-error not applicable\n .x((d: any) => x(d.label) + x.bandwidth() / 2)\n .y((d: any) => y(d.value));\n\n chart\n .append(\"path\")\n .datum(data)\n .attr(\"class\", \"line\")\n .attr(\"d\", line)\n .style(\"fill\", \"none\")\n .style(\"stroke\", \"#357AF6\")\n .style(\"stroke-width\", 2);\n\n chart\n .selectAll(\".point\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n //@ts-expect-error not applicable\n .attr(\"cx\", (d: any) => x(d.label) + x.bandwidth() / 2)\n .attr(\"cy\", (d: any) => y(d.value))\n .attr(\"r\", 4)\n .style(\"fill\", \"#357AF6\")\n .on(\"mousemove\", mousemove)\n .on(\"mouseleave\", mouseleave);\n\n yAxisTicks.slice(1).forEach((tick) => {\n chart\n .append(\"line\")\n .attr(\"class\", \"dotted-line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", y(tick))\n .attr(\"x2\", width)\n .attr(\"y2\", y(tick))\n .style(\"stroke\", \"gray\")\n .style(\"stroke-dasharray\", \"3,3\");\n });\n\n const xAxis = chart\n .append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(0, ${barHeight})`)\n .call(d3.axisBottom(x));\n\n xAxis.selectAll(\".tick line\").remove();\n\n const yAxis = chart\n .append(\"g\")\n .attr(\"class\", \"y-axis\")\n .call(\n d3\n .axisLeft(y)\n .tickValues(yAxisTicks)\n //@ts-expect-error not applicable\n .tickFormat((d: any) => {\n return formatNumber(d);\n })\n .tickSizeOuter(0),\n 0,\n );\n\n yAxis.selectAll(\".domain\").remove();\n yAxis.selectAll(\".tick line\").remove();\n\n const tooltip = svg\n .append(\"foreignObject\")\n .attr(\"class\", \"tooltip\")\n .attr(\"width\", 120)\n .attr(\"height\", 20)\n .style(\"opacity\", 0)\n .style(\"position\", \"absolute\")\n .style(\"background-color\", \"white\")\n .style(\"border\", \"none\")\n .style(\"box-shadow\", \"0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)\")\n .style(\"border-radius\", \"0.313rem\")\n .style(\"padding\", \"0.625rem\")\n .style(\"font-size\", \"0.75rem\");\n\n const tooltipText = tooltip\n .append(\"xhtml:div\")\n .style(\"font-size\", \"0.75rem\")\n .style(\"color\", \"black\");\n }, [data, height, width, yAxisMaxValue, yAxisTicks, calculatedChartWidth]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <svg \n ref={svgRef}\n width={calculatedChartWidth}\n height={height}\n viewBox={`0 0 ${calculatedChartWidth} ${height}`}\n />\n </div>\n );\n};\n\nexport default LineChart;\n"],"names":["d3.select","d3.scaleBand","d3.scaleLinear","d3.max","line","d3.line","d3.axisBottom","d3.axisLeft"],"mappings":";;;;;;;;AAeA,MAAM,eAAe,CAAC,QAAgB;AACpC,MAAI,OAAO,IAAK,SAAQ,MAAM,KAAK,QAAQ,CAAC,IAAI;AAChD,MAAI,OAAO,IAAK,SAAQ,MAAM,KAAK,QAAQ,CAAC,IAAI;AAChD,MAAI,OAAO,IAAK,SAAQ,MAAM,KAAK,QAAQ,CAAC,IAAI;AAChD,SAAO;AACT;AAEA,MAAM,YAAsC,CAAC;AAAA,EAC3C;AAAA,EACA,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AACX,MAAM;AACJ,QAAM,SAAS,OAAsB,IAAI;AACzC,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,WAAW,QAAQ,MAAM;AAC7B,WAAO,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAAA,EAC7C,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,gBAAgB,QAAQ,MAAM;AAClC,WAAO,WAAW;AAAA,EACpB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A,GAClD,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAK;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,SAAS,OAAO,oBAAoB,IAAI,MAAM;AAAA,IAAA;AAAA,EAAA,GAEtD;AAEJ;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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/band/index.js"),s=require("../../../../node_modules/d3-scale/src/linear/index.js"),a=require("../../../../node_modules/d3-array/src/max/index.js"),l=require("../../../../node_modules/d3-selection/src/select/index.js"),n=require("../../../../node_modules/d3-shape/src/line/index.js"),o=require("../../../../node_modules/d3-axis/src/axis/index.js");exports.default=({data:i,numOfLines:d=5,width:c=500,height:u=300})=>{const m=t.useRef(null),h=t.useRef(null),p=t.useMemo(()=>Math.max(...i.map(e=>e.value)),[i]),y=t.useMemo(()=>1.25*p,[p]),x=t.useMemo(()=>{const e=[],t=y/d;for(let r=0;r<=d;r++)e.push(t*r);return e},[y,d]),f=i.length>12?Math.max(120*i.length,c):c;return t.useEffect(()=>{const e=h.current,t=new ResizeObserver(e=>{if(e[0]){const t=e[0].contentRect.width;setContainerWidth(t)}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),t.useEffect(()=>{const e=l.default(m.current);e.selectAll("*").remove();const t=f-40-20,d=u-20-70,h=r.default().domain(i.map(e=>e.label)).range([0,t]).padding(.1),p=s.default().domain([0,a.default(i,e=>e.value)]).range([d,0]),y=e.append("g").attr("transform","translate(40,20)"),v=n.default().x(e=>h(e.label)+h.bandwidth()/2).y(e=>p(e.value));y.append("path").datum(i).attr("class","line").attr("d",v).style("fill","none").style("stroke","#357AF6").style("stroke-width",2),y.selectAll(".point").data(i).enter().append("circle").attr("class","point").attr("cx",e=>h(e.label)+h.bandwidth()/2).attr("cy",e=>p(e.value)).attr("r",4).style("fill","#357AF6").on("mousemove",(e,t)=>{const r=e.offsetX+40-25,s=e.offsetY+20-40,a=`${t.label} - ${t.value}`;b.attr("x",r).attr("y",s).style("opacity",9).style("height",a.length>=16?50:35),w.html(a)}).on("mouseleave",()=>{b.style("opacity",0)}),x.slice(1).forEach(e=>{y.append("line").attr("class","dotted-line").attr("x1",0).attr("y1",p(e)).attr("x2",c).attr("y2",p(e)).style("stroke","gray").style("stroke-dasharray","3,3")}),y.append("g").attr("class","x-axis").attr("transform",`translate(0, ${d})`).call(o.axisBottom(h)).selectAll(".tick line").remove();const g=y.append("g").attr("class","y-axis").call(o.axisLeft(p).tickValues(x).tickFormat(e=>{return(t=e)>=1e9?(t/1e9).toFixed(1)+"B":t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":t;var t}).tickSizeOuter(0),0);g.selectAll(".domain").remove(),g.selectAll(".tick line").remove();const b=e.append("foreignObject").attr("class","tooltip").attr("width",120).attr("height",20).style("opacity",0).style("position","absolute").style("background-color","white").style("border","none").style("box-shadow","0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)").style("border-radius","0.313rem").style("padding","0.625rem").style("font-size","0.75rem"),w=b.append("xhtml:div").style("font-size","0.75rem").style("color","black")},[i,u,c,y,x,f]),/* @__PURE__ */e.jsx("div",{ref:h,style:{width:"100%",height:"100%"},children:/* @__PURE__ */e.jsx("svg",{ref:m,width:f,height:u,viewBox:`0 0 ${f} ${u}`})})};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/charts/line-chart/line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useMemo } from \"react\";\nimport * as d3 from \"d3\";\n\ninterface DataPoint {\n label: string;\n value: number;\n}\n\ninterface LineChartProps {\n data: DataPoint[];\n numOfLines?: number;\n width?: number;\n height?: number;\n}\n\nconst formatNumber = (num: number) => {\n if (num >= 1e9) return (num / 1e9).toFixed(1) + \"B\";\n if (num >= 1e6) return (num / 1e6).toFixed(1) + \"M\";\n if (num >= 1e3) return (num / 1e3).toFixed(1) + \"K\";\n return num;\n};\n\nconst LineChart: React.FC<LineChartProps> = ({\n data,\n numOfLines = 5,\n width = 500,\n height = 300,\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const maxValue = useMemo(() => {\n return Math.max(...data.map((d) => d.value));\n }, [data]);\n\n const yAxisMaxValue = useMemo(() => {\n return maxValue * 1.25;\n }, [maxValue]);\n\n const yAxisTicks = useMemo(() => {\n const ticks = [];\n const interval = yAxisMaxValue / numOfLines;\n for (let i = 0; i <= numOfLines; i++) {\n ticks.push(interval * i);\n }\n return ticks;\n }, [yAxisMaxValue, numOfLines]);\n\n const needsHorizontalScroll = data.length > 12;\n const minGroupWidth = 120; \n const calculatedChartWidth = needsHorizontalScroll \n ? Math.max(data.length * minGroupWidth, width)\n : width;\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 useEffect(() => {\n const svg = d3.select(svgRef.current);\n\n svg.selectAll(\"*\").remove();\n\n const margin = { top: 20, right: 20, bottom: 70, left: 40 };\n const barWidth = calculatedChartWidth - margin.left - margin.right;\n const barHeight = height - margin.top - margin.bottom;\n\n const mousemove = (event: any, d: any) => {\n\n const xPosition = event.offsetX + margin.left - 25;\n const yPosition = event.offsetY + margin.top - 40;\n const text = `${d.label} - ${d.value}`;\n tooltip\n .attr(\"x\", xPosition)\n .attr(\"y\", yPosition)\n .style(\"opacity\", 9)\n .style(\"height\", text.length >= 16 ? 50 : 35);\n\n tooltipText.html(text);\n };\n\n const mouseleave = () => {\n tooltip.style(\"opacity\", 0);\n };\n\n const x = d3\n .scaleBand()\n .domain(data.map((d: any) => d.label))\n .range([0, barWidth])\n .padding(0.1);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, (d: any) => d.value)])\n .range([barHeight, 0]);\n\n const chart = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n const line = d3\n .line<DataPoint>()\n //@ts-expect-error not applicable\n .x((d: any) => x(d.label) + x.bandwidth() / 2)\n .y((d: any) => y(d.value));\n\n chart\n .append(\"path\")\n .datum(data)\n .attr(\"class\", \"line\")\n .attr(\"d\", line)\n .style(\"fill\", \"none\")\n .style(\"stroke\", \"#357AF6\")\n .style(\"stroke-width\", 2);\n\n chart\n .selectAll(\".point\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n //@ts-expect-error not applicable\n .attr(\"cx\", (d: any) => x(d.label) + x.bandwidth() / 2)\n .attr(\"cy\", (d: any) => y(d.value))\n .attr(\"r\", 4)\n .style(\"fill\", \"#357AF6\")\n .on(\"mousemove\", mousemove)\n .on(\"mouseleave\", mouseleave);\n\n yAxisTicks.slice(1).forEach((tick) => {\n chart\n .append(\"line\")\n .attr(\"class\", \"dotted-line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", y(tick))\n .attr(\"x2\", width)\n .attr(\"y2\", y(tick))\n .style(\"stroke\", \"gray\")\n .style(\"stroke-dasharray\", \"3,3\");\n });\n\n const xAxis = chart\n .append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(0, ${barHeight})`)\n .call(d3.axisBottom(x));\n\n xAxis.selectAll(\".tick line\").remove();\n\n const yAxis = chart\n .append(\"g\")\n .attr(\"class\", \"y-axis\")\n .call(\n d3\n .axisLeft(y)\n .tickValues(yAxisTicks)\n //@ts-expect-error not applicable\n .tickFormat((d: any) => {\n return formatNumber(d);\n })\n .tickSizeOuter(0),\n 0,\n );\n\n yAxis.selectAll(\".domain\").remove();\n yAxis.selectAll(\".tick line\").remove();\n\n const tooltip = svg\n .append(\"foreignObject\")\n .attr(\"class\", \"tooltip\")\n .attr(\"width\", 120)\n .attr(\"height\", 20)\n .style(\"opacity\", 0)\n .style(\"position\", \"absolute\")\n .style(\"background-color\", \"white\")\n .style(\"border\", \"none\")\n .style(\"box-shadow\", \"0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)\")\n .style(\"border-radius\", \"0.313rem\")\n .style(\"padding\", \"0.625rem\")\n .style(\"font-size\", \"0.75rem\");\n\n const tooltipText = tooltip\n .append(\"xhtml:div\")\n .style(\"font-size\", \"0.75rem\")\n .style(\"color\", \"black\");\n }, [data, height, width, yAxisMaxValue, yAxisTicks, calculatedChartWidth]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <svg \n ref={svgRef}\n width={calculatedChartWidth}\n height={height}\n viewBox={`0 0 ${calculatedChartWidth} ${height}`}\n />\n </div>\n );\n};\n\nexport default LineChart;\n"],"names":["data","numOfLines","width","height","svgRef","useRef","wrapperRef","maxValue","useMemo","Math","max","map","d","value","yAxisMaxValue","yAxisTicks","ticks","interval","i","push","calculatedChartWidth","length","useEffect","wrapper","current","resizeObserver","ResizeObserver","entries","newWidth","contentRect","setContainerWidth","observe","unobserve","svg","d3.select","selectAll","remove","barWidth","barHeight","x","d3.scaleBand","domain","label","range","padding","y","d3.scaleLinear","d3.max","chart","append","attr","line","d3.line","bandwidth","datum","style","enter","on","event","xPosition","offsetX","yPosition","offsetY","text","tooltip","tooltipText","html","slice","forEach","tick","call","d3.axisBottom","yAxis","d3.axisLeft","tickValues","tickFormat","num","toFixed","tickSizeOuter","jsx","ref","children","viewBox"],"mappings":"shBAsB4C,EAC1CA,OACAC,aAAa,EACbC,QAAQ,IACRC,SAAS,QAET,MAAMC,EAASC,EAAAA,OAAsB,MAC/BC,EAAaD,EAAAA,OAAuB,MACpCE,EAAWC,EAAAA,QAAQ,IAChBC,KAAKC,OAAOV,EAAKW,IAAKC,GAAMA,EAAEC,QAC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Y,IAACA,IA+JXE,cAAc,GACjB,GAGJN,EAAMrC,UAAU,WAAWC,SAC3BoC,EAAMrC,UAAU,cAAcC,SAE9B,MAAM4B,EAAU/B,EACbgB,OAAO,iBACPC,KAAK,QAAS,WACdA,KAAK,QAAS,KACdA,KAAK,SAAU,IACfK,MAAM,UAAW,GACjBA,MAAM,WAAY,YAClBA,MAAM,mBAAoB,SAC1BA,MAAM,SAAU,QAChBA,MAAM,aAAc,+CACpBA,MAAM,gBAAiB,YACvBA,MAAM,UAAW,YACjBA,MAAM,YAAa,WAEhBU,EAAcD,EACjBf,OAAO,aACPM,MAAM,YAAa,WACnBA,MAAM,QAAS,UACjB,CAACvD,EAAMG,EAAQD,EAAOY,EAAeC,EAAYK,mBAGlD2D,EAAAA,IAAC,MAAA,CAAIC,IAAK1E,EAAYiD,MAAO,CAAErD,MAAO,OAAQC,OAAQ,QAClD8E,wBAAAF,EAAAA,IAAC,MAAA,CACGC,IAAK5E,EACLF,MAAOkB,EACPjB,SACA+E,QAAS,OAAO9D,KAAwBjB"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState, useEffect } from "react";
|
|
3
|
-
import linear from "../../../../node_modules/d3-scale/src/linear/index.esm.js";
|
|
4
|
-
import max from "../../../../node_modules/d3-array/src/max/index.esm.js";
|
|
5
|
-
import select from "../../../../node_modules/d3-selection/src/select/index.esm.js";
|
|
6
|
-
import { axisBottom, axisLeft } from "../../../../node_modules/d3-axis/src/axis/index.esm.js";
|
|
7
|
-
import line from "../../../../node_modules/d3-shape/src/line/index.esm.js";
|
|
8
|
-
import { monotoneX } from "../../../../node_modules/d3-shape/src/curve/monotone/index.esm.js";
|
|
9
|
-
import curveLinear from "../../../../node_modules/d3-shape/src/curve/linear/index.esm.js";
|
|
10
|
-
import { format } from "../../../../node_modules/d3-format/src/defaultLocale/index.esm.js";
|
|
11
|
-
const formatNumber = (num, symbol, labelType) => {
|
|
12
|
-
if (labelType === "inPercent") {
|
|
13
|
-
return `${format(".0%")(num / 100)}`;
|
|
14
|
-
} else if (labelType === "inValue") {
|
|
15
|
-
return `${symbol || ""} ${format(".2s")(num).replace("k", "K")}`;
|
|
16
|
-
}
|
|
17
|
-
return num.toString();
|
|
18
|
-
};
|
|
19
|
-
const MultiLineChart = ({
|
|
20
|
-
data,
|
|
21
|
-
yAxisData,
|
|
22
|
-
xAxisData,
|
|
23
|
-
colors = ["steelblue", "orange", "green", "red"],
|
|
24
|
-
// Default colors
|
|
25
|
-
height = 400,
|
|
26
|
-
margin = { top: 20, right: 50, bottom: 30, left: 50 },
|
|
27
|
-
line: line$1 = false,
|
|
28
|
-
yAxisLabelType = "inValue",
|
|
29
|
-
currency,
|
|
30
|
-
customLabelFormatter
|
|
31
|
-
}) => {
|
|
32
|
-
const svgRef = useRef(null);
|
|
33
|
-
const wrapperRef = useRef(null);
|
|
34
|
-
const [containerWidth, setContainerWidth] = useState(0);
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
}, [yAxisLabelType]);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
const wrapper = wrapperRef.current;
|
|
39
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
40
|
-
if (entries[0]) {
|
|
41
|
-
const newWidth = entries[0].contentRect.width;
|
|
42
|
-
setContainerWidth(newWidth);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
if (wrapper) {
|
|
46
|
-
resizeObserver.observe(wrapper);
|
|
47
|
-
}
|
|
48
|
-
return () => {
|
|
49
|
-
if (wrapper) {
|
|
50
|
-
resizeObserver.unobserve(wrapper);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}, []);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (containerWidth === 0) return;
|
|
56
|
-
const svg = select(svgRef.current);
|
|
57
|
-
svg.selectAll("*").remove();
|
|
58
|
-
const innerWidth = containerWidth - margin.left - margin.right;
|
|
59
|
-
const innerHeight = height - margin.top - margin.bottom;
|
|
60
|
-
const x = linear().domain([0, xAxisData.length]).range([0, innerWidth]);
|
|
61
|
-
const y = linear().domain([0, max(yAxisData)]).nice().range([innerHeight, 0]);
|
|
62
|
-
const xAxis = svg.append("g").attr("class", "x-axis").attr("transform", `translate(${margin.left},${height - margin.bottom})`).call(
|
|
63
|
-
axisBottom(x).ticks(xAxisData.length - 1).tickFormat((d, i) => xAxisData[i])
|
|
64
|
-
);
|
|
65
|
-
xAxis.selectAll("text").attr("transform", "translate(20, 10)").style("text-anchor", "middle");
|
|
66
|
-
xAxis.select(".domain").attr("stroke", "none");
|
|
67
|
-
const yAxis = svg.append("g").attr("class", "y-axis").attr("transform", `translate(${margin.left},${margin.top})`).call(axisLeft(y).tickPadding(10).tickFormat(
|
|
68
|
-
(d) => customLabelFormatter ? customLabelFormatter(d) : formatNumber(d, currency, yAxisLabelType)
|
|
69
|
-
).tickSizeOuter(0));
|
|
70
|
-
if (line$1) {
|
|
71
|
-
yAxis.selectAll(".grid-line").data(y.ticks()).enter().append("line").attr("class", "grid-line").attr("x1", 0).attr("x2", innerWidth).attr("y1", (d) => y(d)).attr("y2", (d) => y(d)).style("stroke", "#ddd").style("stroke-dasharray", "6,3").style("stroke-width", 1);
|
|
72
|
-
}
|
|
73
|
-
xAxis.selectAll(".tick line").remove();
|
|
74
|
-
yAxis.selectAll(".tick line").remove();
|
|
75
|
-
yAxis.select(".domain").attr("stroke", "none");
|
|
76
|
-
Object.keys(data).forEach((key, index) => {
|
|
77
|
-
var _a, _b, _c;
|
|
78
|
-
if (key !== "months") {
|
|
79
|
-
const chartLine = line().x((d, i) => x(i)).y((d) => y(d)).curve(data[key].isSmooth ? monotoneX : curveLinear);
|
|
80
|
-
svg.append("path").datum((_a = data[key]) == null ? void 0 : _a.data).attr("fill", "none").attr("stroke", colors[index % colors.length]).attr("stroke-width", 2).attr("transform", `translate(${margin.left},${margin.top})`).attr("d", chartLine).on("mouseover", function() {
|
|
81
|
-
select(this).attr("stroke-width", 4);
|
|
82
|
-
}).on("mouseout", function() {
|
|
83
|
-
select(this).attr("stroke-width", 2);
|
|
84
|
-
});
|
|
85
|
-
if ((_b = data[key]) == null ? void 0 : _b.displayDot) {
|
|
86
|
-
svg.selectAll(`.circle-${key}`).data((_c = data[key]) == null ? void 0 : _c.data).enter().append("circle").attr("class", `circle-${key}`).attr("cx", (d, i) => x(i) + margin.left).attr("cy", (d) => y(d) + margin.top).attr("r", 4).attr("fill", colors[index % colors.length]).attr("stroke", "white").attr("stroke-width", 1.5).on("mouseover", function() {
|
|
87
|
-
select(this).attr("r", 6);
|
|
88
|
-
}).on("mouseout", function() {
|
|
89
|
-
select(this).attr("r", 4);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}, [data, yAxisData, xAxisData, height, containerWidth, colors, margin, line$1, yAxisLabelType, currency, customLabelFormatter]);
|
|
95
|
-
return /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { position: "relative" }, children: /* @__PURE__ */ jsx("svg", { ref: svgRef, width: "100%", height, viewBox: `0 0 ${containerWidth} ${height}` }) }) });
|
|
96
|
-
};
|
|
97
|
-
export {
|
|
98
|
-
MultiLineChart as default
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../../src/components/charts/multiLineChart/multi-line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from 'react';\nimport * as d3 from 'd3';\n\nexport interface IMultiLineChartProps {\n data: any;\n width?: number;\n height?: number;\n margin?: { top: number, right: number, bottom: number, left: number };\n yAxisData: any;\n xAxisData: any;\n colors?: string[];\n line?: boolean;\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string\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\n\n\nconst MultiLineChart = ({\n data,\n yAxisData,\n xAxisData,\n colors = ['steelblue', 'orange', 'green', 'red'], // Default colors\n height = 400,\n margin = { top: 20, right: 50, bottom: 30, left: 50 },\n line = false,\n yAxisLabelType = 'inValue',\n currency,\n customLabelFormatter,\n}: IMultiLineChartProps) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n\n useEffect(() => {\n }, [yAxisLabelType]);\n // ResizeObserver to adjust the chart size dynamically\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 \n if (containerWidth === 0) return; \n\n const svg = d3.select(svgRef.current);\n svg.selectAll(\"*\").remove(); \n\n const innerWidth = containerWidth-margin.left- margin.right;\n const innerHeight = height - margin.top - margin.bottom;\n\n // Scales\n const x = d3.scaleLinear()\n .domain([0, xAxisData.length]) // Linear scale based on index of xAxisData\n .range([0, innerWidth]);\n\n const y = d3.scaleLinear()\n .domain([0, d3.max(yAxisData) as number])\n .nice()\n .range([innerHeight, 0]);\n\n\n // Append x-axis\n const xAxis = svg.append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(${margin.left},${height - margin.bottom})`)\n .call(d3.axisBottom(x)\n .ticks(xAxisData.length - 1)\n .tickFormat((d, i) => xAxisData[i])\n );\n\n xAxis.selectAll(\"text\")\n .attr(\"transform\", \"translate(20, 10)\") // Push labels down by 10px\n .style(\"text-anchor\", \"middle\"); // Keep the labels centered\n xAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Append y-axis\n const yAxis = svg.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .call(d3.axisLeft(y).tickPadding(10).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n )\n .tickSizeOuter(0) as any,);\n\n if (line) {\n yAxis.selectAll('.grid-line')\n .data(y.ticks())\n .enter()\n .append('line')\n .attr('class', 'grid-line')\n .attr('x1', 0)\n .attr('x2', innerWidth)\n .attr('y1', d => y(d))\n .attr('y2', d => y(d))\n .style('stroke', '#ddd')\n .style('stroke-dasharray', '6,3') // Dotted line\n .style('stroke-width', 1);\n }\n xAxis.selectAll(\".tick line\").remove();\n yAxis.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Plot the lines for each dataset\n\n Object.keys(data).forEach((key, index) => {\n if (key !== 'months') {\n const chartLine = d3.line()\n .x((d, i) => x(i)) // Use index-based positioning for x-axis\n .y((d: any) => y(d)).curve(data[key].isSmooth ? d3.curveMonotoneX : d3.curveLinear);\n // Append the line\n svg.append(\"path\")\n .datum(data[key]?.data)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", colors[index % colors.length])\n .attr(\"stroke-width\", 2)\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .attr(\"d\", chartLine)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"stroke-width\", 4);\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"stroke-width\", 2);\n });\n\n\n\n // Append circles for each data point\n if (data[key]?.displayDot) {\n svg.selectAll(`.circle-${key}`)\n .data(data[key]?.data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", `circle-${key}`)\n .attr(\"cx\", (d, i) => x(i) + margin.left) // Adjust for margin.left\n .attr(\"cy\", (d: any) => y(d) + margin.top) // Adjust for margin.top\n .attr(\"r\", 4) // Circle radius\n .attr(\"fill\", colors[index % colors.length])\n .attr(\"stroke\", \"white\") // Optional: adds a border for contrast\n .attr(\"stroke-width\", 1.5)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"r\", 6); // Increase size on hover\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"r\", 4); // Return to normal size\n });\n }\n\n }\n });\n }, [data, yAxisData, xAxisData, height, containerWidth, colors, margin, line, yAxisLabelType, currency, customLabelFormatter]);\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} viewBox={`0 0 ${containerWidth} ${height}`} />\n </div>\n </div>\n );\n};\n\nexport default MultiLineChart;\n"],"names":["d3.format","line","d3.select","d3.scaleLinear","d3.max","d3.axisBottom","d3.axisLeft","d3.line","d3.curveMonotoneX","d3.curveLinear"],"mappings":";;;;;;;;;;AAgBA,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,UAAQ,EAAE,IAAIA,OAAU,KAAK,EAAE,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC;AAAA,EACnE;AACA,SAAO,IAAI,SAAA;AACf;AAIA,MAAM,iBAAiB,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAC,aAAa,UAAU,SAAS,KAAK;AAAA;AAAA,EAC/C,SAAS;AAAA,EACT,SAAS,EAAE,KAAK,IAAI,OAAO,IAAI,QAAQ,IAAI,MAAM,GAAA;AAAA,EAAG,MACpDC,SAAO;AAAA,EACP,iBAAiB;AAAA,EACjB;AAAA,EACA;AACJ,MAA4B;AACxB,QAAM,SAAS,OAAsB,IAAI;AACzC,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,EAAI,KAAK,QAAQ,OAAM,QAAO,QAAgB,SAAS,OAAO,cAAc,IAAI,MAAM,GAAA,CAAI,GAC/F,GACJ;AAER;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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"),s=require("../../../../node_modules/d3-selection/src/select/index.js"),o=require("../../../../node_modules/d3-axis/src/axis/index.js"),l=require("../../../../node_modules/d3-shape/src/line/index.js"),n=require("../../../../node_modules/d3-shape/src/curve/monotone/index.js"),i=require("../../../../node_modules/d3-shape/src/curve/linear/index.js"),d=require("../../../../node_modules/d3-format/src/defaultLocale/index.js");exports.default=({data:c,yAxisData:u,xAxisData:f,colors:m=["steelblue","orange","green","red"],height:h=400,margin:x={top:20,right:50,bottom:30,left:50},line:p=!1,yAxisLabelType:v="inValue",currency:g,customLabelFormatter:k})=>{const y=t.useRef(null),j=t.useRef(null),[$,b]=t.useState(0);return t.useEffect(()=>{},[v]),t.useEffect(()=>{const e=j.current,t=new ResizeObserver(e=>{if(e[0]){const t=e[0].contentRect.width;b(t)}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),t.useEffect(()=>{if(0===$)return;const e=s.default(y.current);e.selectAll("*").remove();const t=$-x.left-x.right,j=h-x.top-x.bottom,b=r.default().domain([0,f.length]).range([0,t]),w=r.default().domain([0,a.default(u)]).nice().range([j,0]),q=e.append("g").attr("class","x-axis").attr("transform",`translate(${x.left},${h-x.bottom})`).call(o.axisBottom(b).ticks(f.length-1).tickFormat((e,t)=>f[t]));q.selectAll("text").attr("transform","translate(20, 10)").style("text-anchor","middle"),q.select(".domain").attr("stroke","none");const _=e.append("g").attr("class","y-axis").attr("transform",`translate(${x.left},${x.top})`).call(o.axisLeft(w).tickPadding(10).tickFormat(e=>{return k?k(e):(t=e,r=g,"inPercent"===(a=v)?`${d.format(".0%")(t/100)}`:"inValue"===a?`${r||""} ${d.format(".2s")(t).replace("k","K")}`:t.toString());var t,r,a}).tickSizeOuter(0));p&&_.selectAll(".grid-line").data(w.ticks()).enter().append("line").attr("class","grid-line").attr("x1",0).attr("x2",t).attr("y1",e=>w(e)).attr("y2",e=>w(e)).style("stroke","#ddd").style("stroke-dasharray","6,3").style("stroke-width",1),q.selectAll(".tick line").remove(),_.selectAll(".tick line").remove(),_.select(".domain").attr("stroke","none"),Object.keys(c).forEach((t,r)=>{var a,o,d;if("months"!==t){const u=l.default().x((e,t)=>b(t)).y(e=>w(e)).curve(c[t].isSmooth?n.monotoneX:i.default);e.append("path").datum(null==(a=c[t])?void 0:a.data).attr("fill","none").attr("stroke",m[r%m.length]).attr("stroke-width",2).attr("transform",`translate(${x.left},${x.top})`).attr("d",u).on("mouseover",function(){s.default(this).attr("stroke-width",4)}).on("mouseout",function(){s.default(this).attr("stroke-width",2)}),(null==(o=c[t])?void 0:o.displayDot)&&e.selectAll(`.circle-${t}`).data(null==(d=c[t])?void 0:d.data).enter().append("circle").attr("class",`circle-${t}`).attr("cx",(e,t)=>b(t)+x.left).attr("cy",e=>w(e)+x.top).attr("r",4).attr("fill",m[r%m.length]).attr("stroke","white").attr("stroke-width",1.5).on("mouseover",function(){s.default(this).attr("r",6)}).on("mouseout",function(){s.default(this).attr("r",4)})}})},[c,u,f,h,$,m,x,p,v,g,k]),/* @__PURE__ */e.jsx("div",{ref:j,style:{width:"100%",height:"100%"},children:/* @__PURE__ */e.jsx("div",{style:{position:"relative"},children:/* @__PURE__ */e.jsx("svg",{ref:y,width:"100%",height:h,viewBox:`0 0 ${$} ${h}`})})})};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/charts/multiLineChart/multi-line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from 'react';\nimport * as d3 from 'd3';\n\nexport interface IMultiLineChartProps {\n data: any;\n width?: number;\n height?: number;\n margin?: { top: number, right: number, bottom: number, left: number };\n yAxisData: any;\n xAxisData: any;\n colors?: string[];\n line?: boolean;\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string\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\n\n\nconst MultiLineChart = ({\n data,\n yAxisData,\n xAxisData,\n colors = ['steelblue', 'orange', 'green', 'red'], // Default colors\n height = 400,\n margin = { top: 20, right: 50, bottom: 30, left: 50 },\n line = false,\n yAxisLabelType = 'inValue',\n currency,\n customLabelFormatter,\n}: IMultiLineChartProps) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n\n useEffect(() => {\n }, [yAxisLabelType]);\n // ResizeObserver to adjust the chart size dynamically\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 \n if (containerWidth === 0) return; \n\n const svg = d3.select(svgRef.current);\n svg.selectAll(\"*\").remove(); \n\n const innerWidth = containerWidth-margin.left- margin.right;\n const innerHeight = height - margin.top - margin.bottom;\n\n // Scales\n const x = d3.scaleLinear()\n .domain([0, xAxisData.length]) // Linear scale based on index of xAxisData\n .range([0, innerWidth]);\n\n const y = d3.scaleLinear()\n .domain([0, d3.max(yAxisData) as number])\n .nice()\n .range([innerHeight, 0]);\n\n\n // Append x-axis\n const xAxis = svg.append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(${margin.left},${height - margin.bottom})`)\n .call(d3.axisBottom(x)\n .ticks(xAxisData.length - 1)\n .tickFormat((d, i) => xAxisData[i])\n );\n\n xAxis.selectAll(\"text\")\n .attr(\"transform\", \"translate(20, 10)\") // Push labels down by 10px\n .style(\"text-anchor\", \"middle\"); // Keep the labels centered\n xAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Append y-axis\n const yAxis = svg.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .call(d3.axisLeft(y).tickPadding(10).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n )\n .tickSizeOuter(0) as any,);\n\n if (line) {\n yAxis.selectAll('.grid-line')\n .data(y.ticks())\n .enter()\n .append('line')\n .attr('class', 'grid-line')\n .attr('x1', 0)\n .attr('x2', innerWidth)\n .attr('y1', d => y(d))\n .attr('y2', d => y(d))\n .style('stroke', '#ddd')\n .style('stroke-dasharray', '6,3') // Dotted line\n .style('stroke-width', 1);\n }\n xAxis.selectAll(\".tick line\").remove();\n yAxis.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Plot the lines for each dataset\n\n Object.keys(data).forEach((key, index) => {\n if (key !== 'months') {\n const chartLine = d3.line()\n .x((d, i) => x(i)) // Use index-based positioning for x-axis\n .y((d: any) => y(d)).curve(data[key].isSmooth ? d3.curveMonotoneX : d3.curveLinear);\n // Append the line\n svg.append(\"path\")\n .datum(data[key]?.data)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", colors[index % colors.length])\n .attr(\"stroke-width\", 2)\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .attr(\"d\", chartLine)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"stroke-width\", 4);\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"stroke-width\", 2);\n });\n\n\n\n // Append circles for each data point\n if (data[key]?.displayDot) {\n svg.selectAll(`.circle-${key}`)\n .data(data[key]?.data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", `circle-${key}`)\n .attr(\"cx\", (d, i) => x(i) + margin.left) // Adjust for margin.left\n .attr(\"cy\", (d: any) => y(d) + margin.top) // Adjust for margin.top\n .attr(\"r\", 4) // Circle radius\n .attr(\"fill\", colors[index % colors.length])\n .attr(\"stroke\", \"white\") // Optional: adds a border for contrast\n .attr(\"stroke-width\", 1.5)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"r\", 6); // Increase size on hover\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"r\", 4); // Return to normal size\n });\n }\n\n }\n });\n }, [data, yAxisData, xAxisData, height, containerWidth, colors, margin, line, yAxisLabelType, currency, customLabelFormatter]);\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} viewBox={`0 0 ${containerWidth} ${height}`} />\n </div>\n </div>\n );\n};\n\nexport default MultiLineChart;\n"],"names":["data","yAxisData","xAxisData","colors","height","margin","top","right","bottom","left","line","yAxisLabelType","currency","customLabelFormatter","svgRef","useRef","wrapperRef","containerWidth","setContainerWidth","useState","useEffect","wrapper","current","resizeObserver","ResizeObserver","entries","newWidth","contentRect","width","observe","unobserve","svg","d3.select","selectAll","remove","innerWidth","innerHeight","x","d3.scaleLinear","domain","length","range","y","d3.max","nice","xAxis","append","attr","call","d3.axisBottom","ticks","tickFormat","d","i","style","select","yAxis","d3.axisLeft","tickPadding","num","symbol","labelType","d3.format","replace","toString","tickSizeOuter","enter","Object","keys","forEach","key","index","chartLine","d3.line","curve","isSmooth","d3.curveMonotoneX","d3.curveLinear","datum","_a","on","this","_b","displayDot","_c","jsx","ref","children","position","viewBox"],"mappings":"orBA2BuB,EACnBA,OACAC,YACAC,YACAC,SAAS,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AK,YAAa,aAAa1C,EAAOI,QAAQJ,EAAOC,QACrDyC,KAAK,IAAKyB,GACVQ,GAAG,YAAa,WACbhD,EAAAA,QAAUiD,MAAMlC,KAAK,eAAgB,EACzC,GACCiC,GAAG,WAAY,WACZhD,EAAAA,QAAUiD,MAAMlC,KAAK,eAAgB,EACzC,IAKA,OAAAmC,EAAAlF,EAAKsE,SAAL,EAAAY,EAAWC,aACXpD,EAAIE,UAAU,WAAWqC,KACpBtE,KAAK,OAAAoF,EAAApF,EAAKsE,SAAL,EAAAc,EAAWpF,MAChBkE,QACApB,OAAO,UACPC,KAAK,QAAS,UAAUuB,KACxBvB,KAAK,KAAM,CAACK,EAAGC,IAAMhB,EAAEgB,GAAKhD,EAAOI,MACnCsC,KAAK,KAAOK,GAAWV,EAAEU,GAAK/C,EAAOC,KACrCyC,KAAK,IAAK,GACVA,KAAK,OAAQ5C,EAAOoE,EAAQpE,EAAOqC,SACnCO,KAAK,SAAU,SACfA,KAAK,eAAgB,KACrBiC,GAAG,YAAa,WACbhD,EAAAA,QAAUiD,MAAMlC,KAAK,IAAK,EAC9B,GACCiC,GAAG,WAAY,WACZhD,EAAAA,QAAUiD,MAAMlC,KAAK,IAAK,EAC9B,EAGZ,KAEL,CAAC/C,EAAMC,EAAWC,EAAWE,EAAQa,EAAgBd,EAAQE,EAAQK,EAAMC,EAAgBC,EAAUC,qBAGpGwE,IAAC,MAAA,CAAIC,IAAKtE,EAAYsC,MAAO,CAAE1B,MAAO,OAAQxB,OAAQ,QAClDmF,wBAAAF,EAAAA,IAAC,MAAA,CAAI/B,MAAO,CAAEkC,SAAU,YACpBD,0BAAAF,IAAC,MAAA,CAAIC,IAAKxE,EAAQc,MAAM,OAAOxB,SAAgBqF,QAAS,OAAOxE,KAAkBb"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Typography } from "../../../typography/typography/index.esm.js";
|
|
4
|
-
import { formatDate } from "../../../../utils/dateFormat/index.esm.js";
|
|
5
|
-
import Menu from "../../../menu/menu/index.esm.js";
|
|
6
|
-
import Card from "../../../../node_modules/@mui/material/Card/Card/index.esm.js";
|
|
7
|
-
import CardContent from "../../../../node_modules/@mui/material/CardContent/CardContent/index.esm.js";
|
|
8
|
-
import Box from "../../../../node_modules/@mui/material/Box/Box/index.esm.js";
|
|
9
|
-
import IconButton from "../../../../node_modules/@mui/material/IconButton/IconButton/index.esm.js";
|
|
10
|
-
import MenuItem from "../../../../node_modules/@mui/material/MenuItem/MenuItem/index.esm.js";
|
|
11
|
-
import { MoreIcon } from "../../../icons/more/index.esm.js";
|
|
12
|
-
const CustomGridCard = ({
|
|
13
|
-
title,
|
|
14
|
-
subTitle,
|
|
15
|
-
children,
|
|
16
|
-
data,
|
|
17
|
-
rowActionMenu,
|
|
18
|
-
destructiveActionMenu
|
|
19
|
-
}) => {
|
|
20
|
-
const [rowAnchorEl, setRowAnchorEl] = useState(null);
|
|
21
|
-
const [row, setRow] = useState(null);
|
|
22
|
-
const handleMenuOpen = (e, currencyRow) => {
|
|
23
|
-
setRow(currencyRow);
|
|
24
|
-
setRowAnchorEl(e.currentTarget);
|
|
25
|
-
};
|
|
26
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
-
Card,
|
|
28
|
-
{
|
|
29
|
-
sx: {
|
|
30
|
-
width: "16.625rem",
|
|
31
|
-
borderRadius: "0.5rem",
|
|
32
|
-
border: "0.5px solid #eeeff1",
|
|
33
|
-
// backgroundColor: 'theme.secondary.100',
|
|
34
|
-
boxShadow: `
|
|
35
|
-
0px 0px 2px 0px #e0e0e0,
|
|
36
|
-
0px 1px 4px -2px rgba(24, 39, 75, 0.02),
|
|
37
|
-
0px 4px 4px -2px rgba(24, 39, 75, 0.06);`
|
|
38
|
-
// m: 3
|
|
39
|
-
},
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(
|
|
42
|
-
CardContent,
|
|
43
|
-
{
|
|
44
|
-
sx: {
|
|
45
|
-
display: "flex",
|
|
46
|
-
flexDirection: "column",
|
|
47
|
-
padding: "1rem 1rem 1.25rem 1rem",
|
|
48
|
-
justifyContent: "space-between",
|
|
49
|
-
alignItems: "flex-start",
|
|
50
|
-
flexShrink: 0
|
|
51
|
-
},
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ jsxs(
|
|
54
|
-
Box,
|
|
55
|
-
{
|
|
56
|
-
sx: {
|
|
57
|
-
display: "flex",
|
|
58
|
-
width: "100%",
|
|
59
|
-
justifyContent: "space-between",
|
|
60
|
-
alignItems: "flex-start"
|
|
61
|
-
// marginBottom: 1
|
|
62
|
-
},
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ jsx(Typography, { type: "s3", weight: "medium", color: "theme.secondary.1000", children: title }),
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
66
|
-
IconButton,
|
|
67
|
-
{
|
|
68
|
-
color: "inherit",
|
|
69
|
-
size: "small",
|
|
70
|
-
onClick: (e) => handleMenuOpen(e, data),
|
|
71
|
-
children: /* @__PURE__ */ jsx(
|
|
72
|
-
MoreIcon,
|
|
73
|
-
{
|
|
74
|
-
sx: { transform: "rotate(90deg)" },
|
|
75
|
-
orient: "vertical",
|
|
76
|
-
fontSize: "small"
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
),
|
|
84
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Typography, { type: "s4", color: "theme.secondary.800", children: subTitle }) }),
|
|
85
|
-
children,
|
|
86
|
-
(data == null ? void 0 : data.created_at) && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Typography, { type: "s4", color: "theme.secondary.800", children: [
|
|
87
|
-
"Created On ",
|
|
88
|
-
formatDate(data == null ? void 0 : data.created_at, "DD MMM, YYYY")
|
|
89
|
-
] }) })
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
/* @__PURE__ */ jsxs(
|
|
94
|
-
Menu,
|
|
95
|
-
{
|
|
96
|
-
anchorEl: rowAnchorEl,
|
|
97
|
-
open: Boolean(rowAnchorEl),
|
|
98
|
-
onClose: () => setRowAnchorEl(null),
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ jsx(Box, { children: rowActionMenu.map((item) => /* @__PURE__ */ jsx(
|
|
101
|
-
MenuItem,
|
|
102
|
-
{
|
|
103
|
-
onClick: () => {
|
|
104
|
-
row && item.handleAction(row);
|
|
105
|
-
setRowAnchorEl(null);
|
|
106
|
-
},
|
|
107
|
-
children: /* @__PURE__ */ jsx(Typography, { type: "s4", color: "inherit", children: item.label })
|
|
108
|
-
}
|
|
109
|
-
)) }),
|
|
110
|
-
/* @__PURE__ */ jsx(Box, { className: "dropdown-inner--DestructiveHeader", children: destructiveActionMenu.map((item) => /* @__PURE__ */ jsx(
|
|
111
|
-
MenuItem,
|
|
112
|
-
{
|
|
113
|
-
onClick: () => {
|
|
114
|
-
row && item.handleAction(row);
|
|
115
|
-
setRowAnchorEl(null);
|
|
116
|
-
},
|
|
117
|
-
className: "dropdown-inner--DestructiveActions",
|
|
118
|
-
children: /* @__PURE__ */ jsx(Typography, { type: "s4", color: "inherit", children: item.label })
|
|
119
|
-
}
|
|
120
|
-
)) })
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
export {
|
|
129
|
-
CustomGridCard as default
|
|
130
|
-
};
|
|
131
|
-
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../../src/components/grid/custom-grid-card/custom-grid-card.tsx"],"sourcesContent":["import { Box, Card, CardContent, IconButton, MenuItem } from '@mui/material';\nimport React, { useState } from 'react';\nimport Typography, { ITypography } from '../../typography/typography';\nimport { MoreIcon } from '../../icons';\nimport { formatDate } from '../../../utils/dateFormat';\n// import Chip from '../../chip/chip';\nimport Menu from '../../menu/menu';\n\ninterface CustomGridCardProps {\n\ttitle: React.ReactNode | string;\n\tsubTitle?: React.ReactNode | string;\n\tchildren?: React.ReactNode | string;\n\ttitleProps?: ITypography;\n\tdata: Record<any, any>;\n\trowActionMenu: any[];\n\tdestructiveActionMenu: any[];\n}\n\nconst CustomGridCard: React.FC<CustomGridCardProps> = ({\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tdata,\n\trowActionMenu,\n\tdestructiveActionMenu\n}) => {\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<HTMLElement | null>(null);\n\tconst [row, setRow] = useState<[] | null>(null);\n\n\tconst handleMenuOpen = (\n\t\te: React.MouseEvent<HTMLButtonElement>,\n\t\tcurrencyRow: []\n\t) => {\n\t\tsetRow(currencyRow);\n\t\tsetRowAnchorEl(e.currentTarget);\n\t};\n\n\treturn (\n\t\t<Card\n\t\t\tsx={{\n\t\t\t\twidth: '16.625rem',\n\t\t\t\tborderRadius: '0.5rem',\n\t\t\t\tborder: '0.5px solid #eeeff1',\n\t\t\t\t// backgroundColor: 'theme.secondary.100',\n\t\t\t\tboxShadow: `\n 0px 0px 2px 0px #e0e0e0,\n 0px 1px 4px -2px rgba(24, 39, 75, 0.02),\n 0px 4px 4px -2px rgba(24, 39, 75, 0.06);`\n\t\t\t\t// m: 3\n\t\t\t}}>\n\t\t\t<CardContent\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tpadding: '1rem 1rem 1.25rem 1rem',\n\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\talignItems: 'flex-start',\n\t\t\t\t\tflexShrink: 0\n\t\t\t\t}}>\n\t\t\t\t{/* Title & More Button */}\n\t\t\t\t<Box\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\talignItems: 'flex-start'\n\t\t\t\t\t\t// marginBottom: 1\n\t\t\t\t\t}}>\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\tcolor='inherit'\n\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\tonClick={(e) => handleMenuOpen(e, data)}>\n\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\tsx={{ transform: 'rotate(90deg)' }}\n\t\t\t\t\t\t\torient='vertical'\n\t\t\t\t\t\t\tfontSize='small'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</IconButton>\n\t\t\t\t</Box>\n\t\t\t\t{/* Sub Title */}\n\t\t\t\t<Box>\n\t\t\t\t\t<Typography type='s4' color='theme.secondary.800'>\n\t\t\t\t\t\t{subTitle}\n\t\t\t\t\t</Typography>\n\t\t\t\t</Box>\n\t\t\t\t{children}\n\t\t\t\t{data?.created_at && (\n\t\t\t\t\t<Box>\n\t\t\t\t\t\t<Typography type='s4' color='theme.secondary.800'>\n\t\t\t\t\t\t\tCreated On {formatDate(data?.created_at, 'DD MMM, YYYY')}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\t\t\t</CardContent>\n\n\t\t\t{/* Action Menu */}\n\t\t\t<Menu\n\t\t\t\tanchorEl={rowAnchorEl}\n\t\t\t\topen={Boolean(rowAnchorEl)}\n\t\t\t\tonClose={() => setRowAnchorEl(null)}>\n\t\t\t\t<Box>\n\t\t\t\t\t{rowActionMenu.map((item) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\trow && item.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t\t<Box className='dropdown-inner--DestructiveHeader'>\n\t\t\t\t\t{destructiveActionMenu.map((item) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\trow && item.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'>\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t</Menu>\n\t\t</Card>\n\t);\n};\n\nexport default CustomGridCard;\n"],"names":[],"mappings":";;;;;;;;;;;AAkBA,MAAM,iBAAgD,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAM;AACL,QAAM,CAAC,aAAa,cAAc,IAAI,SAA6B,IAAI;AACvE,QAAM,CAAC,KAAK,MAAM,IAAI,SAAoB,IAAI;AAE9C,QAAM,iBAAiB,CACtB,GACA,gBACI;AACJ,WAAO,WAAW;AAClB,mBAAe,EAAE,aAAa;AAAA,EAC/B;AAEA,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,IAAI;AAAA,QACH,OAAO;AAAA,QACP,cAAc;AAAA,QACd,QAAQ;AAAA;AAAA,QAER,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,MAAA;AAAA,MAMZ,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,IAAI;AAAA,cACH,SAAS;AAAA,cACT,eAAe;AAAA,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A;AAAA,kBACA,SAAS,MAAM;AACd,2BAAO,KAAK,aAAa,GAAG;AAC5B,mCAAe,IAAI;AAAA,kBACpB;AAAA,kBACA,8BAAC,YAAA,EAAW,MAAK,MAAK,OAAM,WAC1B,eAAK,MAAA,CACP;AAAA,gBAAA;AAAA,cAAA,CAED,GACF;AAAA,kCACC,KAAA,EAAI,WAAU,qCACb,UAAA,sBAAsB,IAAI,CAAC,SAC3B;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACA,SAAS,MAAM;AACd,2BAAO,KAAK,aAAa,GAAG;AAC5B,mCAAe,IAAI;AAAA,kBACpB;AAAA,kBACA,WAAU;AAAA,kBACV,8BAAC,YAAA,EAAW,MAAK,MAAK,OAAM,WAC1B,eAAK,MAAA,CACP;AAAA,gBAAA;AAAA,cAAA,CAED,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../typography/typography/index.js"),n=require("../../../../utils/dateFormat/index.js"),i=require("../../../menu/menu/index.js"),l=require("../../../../node_modules/@mui/material/Card/Card/index.js"),a=require("../../../../node_modules/@mui/material/CardContent/CardContent/index.js"),d=require("../../../../node_modules/@mui/material/Box/Box/index.js"),o=require("../../../../node_modules/@mui/material/IconButton/IconButton/index.js"),s=require("../../../../node_modules/@mui/material/MenuItem/MenuItem/index.js"),u=require("../../../icons/more/index.js");exports.default=({title:c,subTitle:x,children:p,data:m,rowActionMenu:h,destructiveActionMenu:j})=>{const[y,f]=r.useState(null),[g,C]=r.useState(null);/* @__PURE__ */
|
|
2
|
-
return e.jsxs(l.default,{sx:{width:"16.625rem",borderRadius:"0.5rem",border:"0.5px solid #eeeff1",boxShadow:"\n 0px 0px 2px 0px #e0e0e0,\n 0px 1px 4px -2px rgba(24, 39, 75, 0.02),\n 0px 4px 4px -2px rgba(24, 39, 75, 0.06);"},children:[
|
|
3
|
-
/* @__PURE__ */e.jsxs(a.default,{sx:{display:"flex",flexDirection:"column",padding:"1rem 1rem 1.25rem 1rem",justifyContent:"space-between",alignItems:"flex-start",flexShrink:0},children:[
|
|
4
|
-
/* @__PURE__ */e.jsxs(d.default,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"flex-start"},children:[
|
|
5
|
-
/* @__PURE__ */e.jsx(t.Typography,{type:"s3",weight:"medium",color:"theme.secondary.1000",children:c}),
|
|
6
|
-
/* @__PURE__ */e.jsx(o.default,{color:"inherit",size:"small",onClick:e=>((e,r)=>{C(r),f(e.currentTarget)})(e,m),children:/* @__PURE__ */e.jsx(u.MoreIcon,{sx:{transform:"rotate(90deg)"},orient:"vertical",fontSize:"small"})})]}),
|
|
7
|
-
/* @__PURE__ */e.jsx(d.default,{children:/* @__PURE__ */e.jsx(t.Typography,{type:"s4",color:"theme.secondary.800",children:x})}),p,(null==m?void 0:m.created_at)&&/* @__PURE__ */e.jsx(d.default,{children:/* @__PURE__ */e.jsxs(t.Typography,{type:"s4",color:"theme.secondary.800",children:["Created On ",n.formatDate(null==m?void 0:m.created_at,"DD MMM, YYYY")]})})]}),
|
|
8
|
-
/* @__PURE__ */e.jsxs(i.default,{anchorEl:y,open:Boolean(y),onClose:()=>f(null),children:[
|
|
9
|
-
/* @__PURE__ */e.jsx(d.default,{children:h.map(r=>/* @__PURE__ */e.jsx(s.default,{onClick:()=>{g&&r.handleAction(g),f(null)},children:/* @__PURE__ */e.jsx(t.Typography,{type:"s4",color:"inherit",children:r.label})}))}),
|
|
10
|
-
/* @__PURE__ */e.jsx(d.default,{className:"dropdown-inner--DestructiveHeader",children:j.map(r=>/* @__PURE__ */e.jsx(s.default,{onClick:()=>{g&&r.handleAction(g),f(null)},className:"dropdown-inner--DestructiveActions",children:/* @__PURE__ */e.jsx(t.Typography,{type:"s4",color:"inherit",children:r.label})}))})]})]})};
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/grid/custom-grid-card/custom-grid-card.tsx"],"sourcesContent":["import { Box, Card, CardContent, IconButton, MenuItem } from '@mui/material';\nimport React, { useState } from 'react';\nimport Typography, { ITypography } from '../../typography/typography';\nimport { MoreIcon } from '../../icons';\nimport { formatDate } from '../../../utils/dateFormat';\n// import Chip from '../../chip/chip';\nimport Menu from '../../menu/menu';\n\ninterface CustomGridCardProps {\n\ttitle: React.ReactNode | string;\n\tsubTitle?: React.ReactNode | string;\n\tchildren?: React.ReactNode | string;\n\ttitleProps?: ITypography;\n\tdata: Record<any, any>;\n\trowActionMenu: any[];\n\tdestructiveActionMenu: any[];\n}\n\nconst CustomGridCard: React.FC<CustomGridCardProps> = ({\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tdata,\n\trowActionMenu,\n\tdestructiveActionMenu\n}) => {\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<HTMLElement | null>(null);\n\tconst [row, setRow] = useState<[] | null>(null);\n\n\tconst handleMenuOpen = (\n\t\te: React.MouseEvent<HTMLButtonElement>,\n\t\tcurrencyRow: []\n\t) => {\n\t\tsetRow(currencyRow);\n\t\tsetRowAnchorEl(e.currentTarget);\n\t};\n\n\treturn (\n\t\t<Card\n\t\t\tsx={{\n\t\t\t\twidth: '16.625rem',\n\t\t\t\tborderRadius: '0.5rem',\n\t\t\t\tborder: '0.5px solid #eeeff1',\n\t\t\t\t// backgroundColor: 'theme.secondary.100',\n\t\t\t\tboxShadow: `\n 0px 0px 2px 0px #e0e0e0,\n 0px 1px 4px -2px rgba(24, 39, 75, 0.02),\n 0px 4px 4px -2px rgba(24, 39, 75, 0.06);`\n\t\t\t\t// m: 3\n\t\t\t}}>\n\t\t\t<CardContent\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tpadding: '1rem 1rem 1.25rem 1rem',\n\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\talignItems: 'flex-start',\n\t\t\t\t\tflexShrink: 0\n\t\t\t\t}}>\n\t\t\t\t{/* Title & More Button */}\n\t\t\t\t<Box\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\talignItems: 'flex-start'\n\t\t\t\t\t\t// marginBottom: 1\n\t\t\t\t\t}}>\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\tcolor='inherit'\n\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\tonClick={(e) => handleMenuOpen(e, data)}>\n\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\tsx={{ transform: 'rotate(90deg)' }}\n\t\t\t\t\t\t\torient='vertical'\n\t\t\t\t\t\t\tfontSize='small'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</IconButton>\n\t\t\t\t</Box>\n\t\t\t\t{/* Sub Title */}\n\t\t\t\t<Box>\n\t\t\t\t\t<Typography type='s4' color='theme.secondary.800'>\n\t\t\t\t\t\t{subTitle}\n\t\t\t\t\t</Typography>\n\t\t\t\t</Box>\n\t\t\t\t{children}\n\t\t\t\t{data?.created_at && (\n\t\t\t\t\t<Box>\n\t\t\t\t\t\t<Typography type='s4' color='theme.secondary.800'>\n\t\t\t\t\t\t\tCreated On {formatDate(data?.created_at, 'DD MMM, YYYY')}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\t\t\t</CardContent>\n\n\t\t\t{/* Action Menu */}\n\t\t\t<Menu\n\t\t\t\tanchorEl={rowAnchorEl}\n\t\t\t\topen={Boolean(rowAnchorEl)}\n\t\t\t\tonClose={() => setRowAnchorEl(null)}>\n\t\t\t\t<Box>\n\t\t\t\t\t{rowActionMenu.map((item) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\trow && item.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t\t<Box className='dropdown-inner--DestructiveHeader'>\n\t\t\t\t\t{destructiveActionMenu.map((item) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\trow && item.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'>\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t</Menu>\n\t\t</Card>\n\t);\n};\n\nexport default CustomGridCard;\n"],"names":["title","subTitle","children","data","rowActionMenu","destructiveActionMenu","rowAnchorEl","setRowAnchorEl","useState","row","setRow","jsxs","Card","sx","width","borderRadius","border","boxShadow","CardContent","display","flexDirection","padding","justifyContent","alignItems","flexShrink","Box","jsx","Typography","type","weight","color","IconButton","size","onClick","e","currencyRow","currentTarget","handleMenuOpen","MoreIcon","transform","orient","fontSize","created_at","formatDate","Menu","anchorEl","open","Boolean","onClose","map","item","MenuItem","handleAction","label","className"],"mappings":"wsBAkBsD,EACrDA,QACAC,WACAC,WACAC,OACAC,gBACAC,4BAEA,MAAOC,EAAaC,GAAkBC,EAAAA,SAA6B,OAC5DC,E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