@ambuj.bhaskar/react-component-library 0.30.9 → 0.30.11

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/index.d.ts CHANGED
@@ -681,6 +681,8 @@ export declare type ChartProps = {
681
681
  lineTension?: number;
682
682
  opacity?: number;
683
683
  lineStroke?: number;
684
+ barPercentage?: number;
685
+ categoryPercentage?: number;
684
686
  data: ChartData;
685
687
  options?: any;
686
688
  width?: string;
package/dist/index.js CHANGED
@@ -74093,42 +74093,44 @@ function jEe({
74093
74093
  lineTension: r,
74094
74094
  opacity: o,
74095
74095
  lineStroke: i,
74096
- colors: a
74096
+ colors: a,
74097
+ barPercentage: s,
74098
+ categoryPercentage: l
74097
74099
  }) {
74098
- const s = a, l = t === "doughnut" || t === "pie";
74100
+ const u = a, d = t === "doughnut" || t === "pie";
74099
74101
  return {
74100
74102
  labels: e.labels,
74101
74103
  datasets: e.datasets.map(
74102
- (u, d) => {
74103
- var h;
74104
- return l ? {
74105
- ...u,
74106
- label: u.label,
74107
- data: u.data,
74108
- backgroundColor: u.colors && u.colors.length === u.data.length ? (h = u.colors) == null ? void 0 : h.map((C) => W4(C, o)) : u.data.map(
74109
- (C, m) => W4(
74110
- s[m % s.length],
74104
+ (h, C) => {
74105
+ var m;
74106
+ return d ? {
74107
+ ...h,
74108
+ label: h.label,
74109
+ data: h.data,
74110
+ backgroundColor: h.colors && h.colors.length === h.data.length ? (m = h.colors) == null ? void 0 : m.map((v) => W4(v, o)) : h.data.map(
74111
+ (v, A) => W4(
74112
+ u[A % u.length],
74111
74113
  o
74112
74114
  )
74113
74115
  ),
74114
- borderColor: u.colors && u.colors.length === u.data.length ? u.colors : u.data.map(
74115
- (C, m) => s[m % s.length]
74116
+ borderColor: h.colors && h.colors.length === h.data.length ? h.colors : h.data.map(
74117
+ (v, A) => u[A % u.length]
74116
74118
  ),
74117
74119
  borderWidth: 2
74118
74120
  } : {
74119
- ...u,
74120
- label: u.label,
74121
- data: u.data,
74121
+ ...h,
74122
+ label: h.label,
74123
+ data: h.data,
74122
74124
  backgroundColor: W4(
74123
- u.color || s[d % s.length],
74125
+ h.color || u[C % u.length],
74124
74126
  o
74125
74127
  ),
74126
- borderColor: u.color || s[d % s.length],
74128
+ borderColor: h.color || u[C % u.length],
74127
74129
  borderWidth: t === "line" ? i : 1,
74128
74130
  fill: n == "fill",
74129
74131
  tension: r ?? 0.4,
74130
- barPercentage: (u == null ? void 0 : u.barPercentage) ?? 1,
74131
- categoryPercentage: (u == null ? void 0 : u.categoryPercentage) ?? 0.7
74132
+ barPercentage: s ?? (h == null ? void 0 : h.barPercentage) ?? 1,
74133
+ categoryPercentage: l ?? (h == null ? void 0 : h.categoryPercentage) ?? 0.7
74132
74134
  };
74133
74135
  }
74134
74136
  )
@@ -74342,28 +74344,32 @@ const zEe = (e) => {
74342
74344
  backgroundColor: d,
74343
74345
  className: h = "",
74344
74346
  colors: C = ["#4e79a7", "#f28e2b", "#e15759", "#76b7b2"],
74345
- displayExternalLegend: m = !1
74347
+ displayExternalLegend: m = !1,
74348
+ barPercentage: v,
74349
+ categoryPercentage: A
74346
74350
  }) => {
74347
- var T, N, F;
74348
- const v = wt(null);
74351
+ var F, V, $;
74352
+ const p = wt(null);
74349
74353
  $Ee(e);
74350
- const [A, p] = Pt(
74354
+ const [y, x] = Pt(
74351
74355
  () => TS(t, e)
74352
74356
  );
74353
74357
  Rt(() => {
74354
- p(TS(t, e));
74358
+ x(TS(t, e));
74355
74359
  }, [t, e]);
74356
- const y = WEe(t, e, A), x = jEe({
74357
- input: y,
74360
+ const E = WEe(t, e, y), S = jEe({
74361
+ input: E,
74358
74362
  type: e,
74359
74363
  lineVariant: o,
74360
74364
  lineTension: i,
74361
74365
  opacity: a,
74362
74366
  lineStroke: s,
74363
- colors: C
74364
- }), E = UEe(t, e, C, A), S = (V) => {
74365
- p(($) => KEe($, V));
74366
- }, _ = ((T = n == null ? void 0 : n.plugins) == null ? void 0 : T.legend) || {}, M = Ul.merge(
74367
+ colors: C,
74368
+ barPercentage: v,
74369
+ categoryPercentage: A
74370
+ }), _ = UEe(t, e, C, y), M = (K) => {
74371
+ x((X) => KEe(X, K));
74372
+ }, H = ((F = n == null ? void 0 : n.plugins) == null ? void 0 : F.legend) || {}, k = Ul.merge(
74367
74373
  {},
74368
74374
  VEe({
74369
74375
  type: e,
@@ -74371,26 +74377,26 @@ const zEe = (e) => {
74371
74377
  hideLegend: m
74372
74378
  }),
74373
74379
  n
74374
- ), H = ZEe[e], k = ((F = (N = n == null ? void 0 : n.plugins) == null ? void 0 : N.legend) == null ? void 0 : F.position) ?? "bottom", B = QEe(k), I = zEe(k), P = _.height ?? B.height, R = _.width ?? B.width;
74375
- return H ? /* @__PURE__ */ j.jsxs(
74380
+ ), B = ZEe[e], I = (($ = (V = n == null ? void 0 : n.plugins) == null ? void 0 : V.legend) == null ? void 0 : $.position) ?? "bottom", P = QEe(I), R = zEe(I), T = H.height ?? P.height, N = H.width ?? P.width;
74381
+ return B ? /* @__PURE__ */ j.jsxs(
74376
74382
  "div",
74377
74383
  {
74378
74384
  className: "awi_chart_container",
74379
- style: { flexDirection: I, height: u, width: l },
74385
+ style: { flexDirection: R, height: u, width: l },
74380
74386
  children: [
74381
74387
  /* @__PURE__ */ j.jsx(
74382
74388
  "div",
74383
74389
  {
74384
74390
  style: {
74385
74391
  width: "100%",
74386
- height: m ? `calc(100% - ${P})` : "100%"
74392
+ height: m ? `calc(100% - ${T})` : "100%"
74387
74393
  },
74388
74394
  children: /* @__PURE__ */ j.jsx(
74389
- H,
74395
+ B,
74390
74396
  {
74391
- ref: v,
74392
- data: x,
74393
- options: M,
74397
+ ref: p,
74398
+ data: S,
74399
+ options: k,
74394
74400
  style: {
74395
74401
  backgroundColor: d,
74396
74402
  height: "100%",
@@ -74404,14 +74410,14 @@ const zEe = (e) => {
74404
74410
  m && /* @__PURE__ */ j.jsx(
74405
74411
  GEe,
74406
74412
  {
74407
- items: E,
74408
- onToggleDataset: S,
74409
- scrollable: _.scrollable ?? !1,
74410
- height: P,
74411
- width: R,
74412
- legendConfig: _,
74413
+ items: _,
74414
+ onToggleDataset: M,
74415
+ scrollable: H.scrollable ?? !1,
74416
+ height: T,
74417
+ width: N,
74418
+ legendConfig: H,
74413
74419
  backgroundColor: d,
74414
- position: k
74420
+ position: I
74415
74421
  }
74416
74422
  )
74417
74423
  ]