@majoo-ui/react 1.57.16 → 1.57.18

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.
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { LabelProps } from 'recharts';
3
3
  import { CSS } from '../../config/stitches.config';
4
- interface BarChartData {
4
+ export interface BarChartData {
5
5
  name: string;
6
6
  total: number;
7
7
  color: string;
@@ -11,6 +11,7 @@ interface PieChartLegend {
11
11
  show?: boolean;
12
12
  showTotal?: boolean;
13
13
  position?: 'right' | 'bottom' | 'left';
14
+ height?: number;
14
15
  }
15
16
  interface PieChartTooltip {
16
17
  label?: (number: any) => string;
@@ -89,6 +90,7 @@ declare const PieChartComponent: {
89
90
  showTotal: boolean;
90
91
  data: never[];
91
92
  position: string;
93
+ height: number;
92
94
  };
93
95
  isMobile: boolean;
94
96
  outerRadius: number;
@@ -1088,10 +1088,19 @@ interface FetchDataParams {
1088
1088
  sortAccessor?: string;
1089
1089
  sortDirection?: string;
1090
1090
  }
1091
+ interface getCellPropParams {
1092
+ css?: CSS;
1093
+ sticky?: 'left' | 'right';
1094
+ stickyPosition?: number;
1095
+ shadow?: boolean;
1096
+ }
1097
+ interface CellProp {
1098
+ getCellProps?: (object: getCellPropParams) => object;
1099
+ }
1091
1100
  export interface RowGroup {
1092
1101
  groupKey: string;
1093
- headerRender?: (row: Row<object>) => React.ReactNode;
1094
- footerRender?: (row: Row<object>) => React.ReactNode;
1102
+ headerRender?: (row: Row<object>, cell: CellProp) => React.ReactNode;
1103
+ footerRender?: (row: Row<object>, cell: CellProp) => React.ReactNode;
1095
1104
  showGroupingWhenSorted?: boolean;
1096
1105
  }
1097
1106
  interface CustomRowsStyle {
package/index.esm.js CHANGED
@@ -19386,7 +19386,7 @@ const defaultFetchDataParams = {
19386
19386
  pageSize: 10
19387
19387
  };
19388
19388
  const stickyPositionStyling = column => {
19389
- if (column.stickyPosition) {
19389
+ if (typeof column.stickyPosition === 'number') {
19390
19390
  return column.sticky === 'left' ? {
19391
19391
  position: 'sticky',
19392
19392
  left: `${column.stickyPosition}px !important`
@@ -19969,7 +19969,17 @@ function Table({
19969
19969
  }
19970
19970
  }
19971
19971
  return jsxs(React.Fragment, {
19972
- children: [((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isTopChild'] && ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender) ? rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender(row) : jsx(Text$1, Object.assign({
19972
+ children: [((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isTopChild'] && ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender) ? rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender(row, {
19973
+ getCellProps: cellProps => ({
19974
+ css: Object.assign(Object.assign(Object.assign({}, stickyPositionStyling({
19975
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
19976
+ stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
19977
+ })), stickyShadowStyling({
19978
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
19979
+ shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
19980
+ }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
19981
+ })
19982
+ }) : jsx(Text$1, Object.assign({
19973
19983
  variant: "contentButton"
19974
19984
  }, {
19975
19985
  children: row.cells[0].render('Cell')
@@ -20051,7 +20061,17 @@ function Table({
20051
20061
  }), void 0)
20052
20062
  }), void 0)]
20053
20063
  }, cell.column.id)]
20054
- }), cell.column.id)) : null, ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isBottomChild'] && !!(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender) && (rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender(row))]
20064
+ }), cell.column.id)) : null, ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isBottomChild'] && !!(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender) && (rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender(row, {
20065
+ getCellProps: cellProps => ({
20066
+ css: Object.assign(Object.assign(Object.assign({}, stickyPositionStyling({
20067
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
20068
+ stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
20069
+ })), stickyShadowStyling({
20070
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
20071
+ shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
20072
+ }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
20073
+ })
20074
+ }))]
20055
20075
  }, row.id);
20056
20076
  })
20057
20077
  }), void 0), (_b = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _b === void 0 ? void 0 : _b.call(decoration)]
@@ -50717,7 +50737,7 @@ const renderActiveShape = (props, avatar, acronym, validAvatar, activeRef) => {
50717
50737
  id: "circleAvatar"
50718
50738
  }, {
50719
50739
  children: jsx("circle", {
50720
- cx: cx,
50740
+ cx: cx + 1,
50721
50741
  cy: cy,
50722
50742
  r: IMG_WIDHT / 2,
50723
50743
  fill: "#FFFFFF"
@@ -50761,13 +50781,14 @@ const renderActiveShape = (props, avatar, acronym, validAvatar, activeRef) => {
50761
50781
  }, void 0);
50762
50782
  };
50763
50783
  const renderLegend = (formattedData, legend, subtitle) => jsxs(Box, {
50764
- children: [subtitle && jsx(Flex$1, Object.assign({
50784
+ children: [jsx(Flex$1, Object.assign({
50765
50785
  css: {
50766
- marginTop: '$spacing-06'
50786
+ marginTop: '$spacing-05',
50787
+ height: 18
50767
50788
  },
50768
50789
  justify: "center"
50769
50790
  }, {
50770
- children: jsx(Heading, Object.assign({
50791
+ children: subtitle && jsx(Heading, Object.assign({
50771
50792
  heading: "sectionTitle"
50772
50793
  }, {
50773
50794
  children: subtitle
@@ -50954,7 +50975,9 @@ const PieChartComponent = ({
50954
50975
  },
50955
50976
  cursor: true,
50956
50977
  content: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.render) ? (_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.render) === null || _a === void 0 ? void 0 : _a.call(tooltip) : jsx(CustomTooltip, {}, void 0)
50957
- }, void 0), Boolean(legend === null || legend === void 0 ? void 0 : legend.show) && jsx(Legend, Object.assign({}, (legend === null || legend === void 0 ? void 0 : legend.position) !== 'bottom' && {
50978
+ }, void 0), Boolean(legend === null || legend === void 0 ? void 0 : legend.show) && jsx(Legend, Object.assign({
50979
+ height: (legend === null || legend === void 0 ? void 0 : legend.height) || 210
50980
+ }, (legend === null || legend === void 0 ? void 0 : legend.position) !== 'bottom' && {
50958
50981
  verticalAlign: 'middle',
50959
50982
  align: (legend === null || legend === void 0 ? void 0 : legend.position) || 'right',
50960
50983
  layout: 'vertical'
@@ -50975,7 +50998,8 @@ PieChartComponent.defaultProps = {
50975
50998
  show: true,
50976
50999
  showTotal: true,
50977
51000
  data: [],
50978
- position: 'right'
51001
+ position: 'right',
51002
+ height: 210
50979
51003
  },
50980
51004
  isMobile: false,
50981
51005
  outerRadius: 100,
package/index.umd.js CHANGED
@@ -19690,7 +19690,7 @@
19690
19690
  pageSize: 10
19691
19691
  };
19692
19692
  var stickyPositionStyling = function stickyPositionStyling(column) {
19693
- if (column.stickyPosition) {
19693
+ if (typeof column.stickyPosition === 'number') {
19694
19694
  return column.sticky === 'left' ? {
19695
19695
  position: 'sticky',
19696
19696
  left: "".concat(column.stickyPosition, "px !important")
@@ -20333,7 +20333,19 @@
20333
20333
  }
20334
20334
  }
20335
20335
  return jsxRuntime.jsxs(React__namespace.Fragment, {
20336
- children: [((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isTopChild'] && ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender) ? rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender(row) : jsxRuntime.jsx(Text$1, __assign({
20336
+ children: [((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isTopChild'] && ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender) ? rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender(row, {
20337
+ getCellProps: function (cellProps) {
20338
+ return {
20339
+ css: __assign(__assign(__assign({}, stickyPositionStyling({
20340
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
20341
+ stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
20342
+ })), stickyShadowStyling({
20343
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
20344
+ shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
20345
+ }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
20346
+ };
20347
+ }
20348
+ }) : jsxRuntime.jsx(Text$1, __assign({
20337
20349
  variant: "contentButton"
20338
20350
  }, {
20339
20351
  children: row.cells[0].render('Cell')
@@ -20425,7 +20437,19 @@
20425
20437
  }), void 0)]
20426
20438
  }, cell.column.id)]
20427
20439
  }), cell.column.id);
20428
- }) : null, ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isBottomChild'] && !!(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender) && (rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender(row))]
20440
+ }) : null, ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isBottomChild'] && !!(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender) && (rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender(row, {
20441
+ getCellProps: function (cellProps) {
20442
+ return {
20443
+ css: __assign(__assign(__assign({}, stickyPositionStyling({
20444
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
20445
+ stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
20446
+ })), stickyShadowStyling({
20447
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
20448
+ shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
20449
+ }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
20450
+ };
20451
+ }
20452
+ }))]
20429
20453
  }, row.id);
20430
20454
  })
20431
20455
  }), void 0), (_c = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _c === void 0 ? void 0 : _c.call(decoration)]
@@ -51242,7 +51266,7 @@
51242
51266
  id: "circleAvatar"
51243
51267
  }, {
51244
51268
  children: jsxRuntime.jsx("circle", {
51245
- cx: cx,
51269
+ cx: cx + 1,
51246
51270
  cy: cy,
51247
51271
  r: IMG_WIDHT / 2,
51248
51272
  fill: "#FFFFFF"
@@ -51287,13 +51311,14 @@
51287
51311
  };
51288
51312
  var renderLegend = function renderLegend(formattedData, legend, subtitle) {
51289
51313
  return jsxRuntime.jsxs(Box, {
51290
- children: [subtitle && jsxRuntime.jsx(Flex$1, __assign({
51314
+ children: [jsxRuntime.jsx(Flex$1, __assign({
51291
51315
  css: {
51292
- marginTop: '$spacing-06'
51316
+ marginTop: '$spacing-05',
51317
+ height: 18
51293
51318
  },
51294
51319
  justify: "center"
51295
51320
  }, {
51296
- children: jsxRuntime.jsx(Heading, __assign({
51321
+ children: subtitle && jsxRuntime.jsx(Heading, __assign({
51297
51322
  heading: "sectionTitle"
51298
51323
  }, {
51299
51324
  children: subtitle
@@ -51492,7 +51517,9 @@
51492
51517
  },
51493
51518
  cursor: true,
51494
51519
  content: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.render) ? (_b = tooltip === null || tooltip === void 0 ? void 0 : tooltip.render) === null || _b === void 0 ? void 0 : _b.call(tooltip) : jsxRuntime.jsx(CustomTooltip, {}, void 0)
51495
- }, void 0), Boolean(legend === null || legend === void 0 ? void 0 : legend.show) && jsxRuntime.jsx(recharts.Legend, __assign({}, (legend === null || legend === void 0 ? void 0 : legend.position) !== 'bottom' && {
51520
+ }, void 0), Boolean(legend === null || legend === void 0 ? void 0 : legend.show) && jsxRuntime.jsx(recharts.Legend, __assign({
51521
+ height: (legend === null || legend === void 0 ? void 0 : legend.height) || 210
51522
+ }, (legend === null || legend === void 0 ? void 0 : legend.position) !== 'bottom' && {
51496
51523
  verticalAlign: 'middle',
51497
51524
  align: (legend === null || legend === void 0 ? void 0 : legend.position) || 'right',
51498
51525
  layout: 'vertical'
@@ -51513,7 +51540,8 @@
51513
51540
  show: true,
51514
51541
  showTotal: true,
51515
51542
  data: [],
51516
- position: 'right'
51543
+ position: 'right',
51544
+ height: 210
51517
51545
  },
51518
51546
  isMobile: false,
51519
51547
  outerRadius: 100,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.57.16",
3
+ "version": "1.57.18",
4
4
  "dependencies": {
5
5
  "@majoo-ui/core": "^1.31.3",
6
6
  "@majoo-ui/helpers": "^1.30.5",