impaktapps-design 0.1.4 → 0.1.5

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.
@@ -12061,9 +12061,9 @@ const finalDataProvider = (type2, value) => {
12061
12061
  var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
12062
12062
  switch (type2) {
12063
12063
  case "BarGraph":
12064
+ case "StackBarGraph":
12064
12065
  return {
12065
12066
  main: {
12066
- type: "barGraph",
12067
12067
  data: ((_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.data) || [{ x: "ASM", y: 100 }, { x: "SDM", y: 60 }, { x: "DCM", y: 40 }, { x: "RCM", y: 70 }],
12068
12068
  header: "Bar Graph",
12069
12069
  bottomLabel: "Name of Employe",
@@ -12330,16 +12330,16 @@ const finalDataProvider = (type2, value) => {
12330
12330
  const BarGraph = ({
12331
12331
  value
12332
12332
  }) => {
12333
- var _a2, _b2, _c2, _d;
12334
- const barData = finalDataProvider("BarGraph", value);
12333
+ var _a2, _b2, _c2, _d, _e2;
12334
+ const barData = finalDataProvider((_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.type, value);
12335
12335
  let GraphRender = /* @__PURE__ */ jsx(ParentSize$1, {
12336
12336
  children: (parent) => {
12337
- var _a3, _b3, _c3, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2;
12337
+ var _a3, _b3, _c3, _d2, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n2;
12338
12338
  return /* @__PURE__ */ jsx(DrawBarGraph, {
12339
12339
  width: parent.width || 400,
12340
12340
  height: ((_b3 = (_a3 = barData == null ? void 0 : barData.style) == null ? void 0 : _a3.containerStyle) == null ? void 0 : _b3.height) | 400,
12341
12341
  margin: {
12342
- top: ((_e2 = (_d2 = (_c3 = barData == null ? void 0 : barData.style) == null ? void 0 : _c3.labelStyle) == null ? void 0 : _d2.margin) == null ? void 0 : _e2.top) || 10,
12342
+ top: ((_e3 = (_d2 = (_c3 = barData == null ? void 0 : barData.style) == null ? void 0 : _c3.labelStyle) == null ? void 0 : _d2.margin) == null ? void 0 : _e3.top) || 10,
12343
12343
  right: ((_h = (_g = (_f = barData == null ? void 0 : barData.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.margin) == null ? void 0 : _h.right) || 10,
12344
12344
  bottom: ((_k = (_j = (_i = barData == null ? void 0 : barData.style) == null ? void 0 : _i.labelStyle) == null ? void 0 : _j.margin) == null ? void 0 : _k.bottom) || 20,
12345
12345
  left: ((_n2 = (_m = (_l = barData == null ? void 0 : barData.style) == null ? void 0 : _l.labelStyle) == null ? void 0 : _m.margin) == null ? void 0 : _n2.left) || 60
@@ -12349,8 +12349,8 @@ const BarGraph = ({
12349
12349
  }
12350
12350
  });
12351
12351
  return /* @__PURE__ */ jsxs("div", {
12352
- style: (_a2 = barData == null ? void 0 : barData.style) == null ? void 0 : _a2.containerStyle,
12353
- children: [((_b2 = barData == null ? void 0 : barData.main) == null ? void 0 : _b2.header) && /* @__PURE__ */ jsx("div", {
12352
+ style: (_b2 = barData == null ? void 0 : barData.style) == null ? void 0 : _b2.containerStyle,
12353
+ children: [((_c2 = barData == null ? void 0 : barData.main) == null ? void 0 : _c2.header) && /* @__PURE__ */ jsx("div", {
12354
12354
  style: {
12355
12355
  fontWeight: 500,
12356
12356
  textAlign: "left",
@@ -12359,9 +12359,9 @@ const BarGraph = ({
12359
12359
  padding: "15px 0 1px 20px",
12360
12360
  fontSize: "18px",
12361
12361
  color: "#121926",
12362
- ...(_c2 = barData == null ? void 0 : barData.style) == null ? void 0 : _c2.headerStyle
12362
+ ...(_d = barData == null ? void 0 : barData.style) == null ? void 0 : _d.headerStyle
12363
12363
  },
12364
- children: (_d = barData == null ? void 0 : barData.main) == null ? void 0 : _d.header
12364
+ children: (_e2 = barData == null ? void 0 : barData.main) == null ? void 0 : _e2.header
12365
12365
  }), GraphRender]
12366
12366
  });
12367
12367
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-design",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "dependencies": {
5
5
  "@babel/core": "^7.16.12",
6
6
  "@visx/visx": "^3.1.2",
@@ -4,7 +4,7 @@ import { ParentSize } from "@visx/responsive";
4
4
  import { finalDataProvider } from "../../utils/finalDataProvider";
5
5
 
6
6
  const BarGraph = ({ value }:any) => {
7
- const barData:any = finalDataProvider("BarGraph",value)
7
+ const barData:any = finalDataProvider(value?.main?.type,value)
8
8
  let GraphRender = (
9
9
  <ParentSize>
10
10
  {(parent) => (
@@ -9,9 +9,10 @@ const Product1 = [
9
9
  export const finalDataProvider = (type: string, value: any) => {
10
10
  switch (type) {
11
11
  case "BarGraph":
12
+ case "StackBarGraph":
12
13
  return {
13
14
  main: {
14
- type: "barGraph",
15
+
15
16
  data: value?.main?.data || [{ x: "ASM", y: 100 }, { x: "SDM", y: 60 }, { x: "DCM", y: 40 }, { x: "RCM", y: 70 }],
16
17
  // [{}] ,
17
18
  header: "Bar Graph",