@gisce/react-ooui 2.74.1 → 2.74.3

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 +1 @@
1
- {"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../src/hooks/useExport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,iCAAiC,CAAC;AAMzC,eAAO,MAAM,SAAS;WAQb,MAAM;aACJ,GAAG;;YAEJ,GAAG,EAAE;;aAEJ,MAAM,IAAI;;;;;;;;;4BA4DL,MAAM;;;;;;;wBArDF,aAAa;;;;;;;;;;;;sCAoJb,gBAAgB;;;;;wCA5BhB,gBAAgB;CAuEnC,CAAC"}
1
+ {"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../src/hooks/useExport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,iCAAiC,CAAC;AAMzC,eAAO,MAAM,SAAS;WAQb,MAAM;aACJ,GAAG;;YAEJ,GAAG,EAAE;;aAEJ,MAAM,IAAI;;;;;;;;;4BA4DL,MAAM;;;;;;;wBArDF,aAAa;;;;;;;;;;;;sCA0Jb,gBAAgB;;;;;wCA5BhB,gBAAgB;CAuEnC,CAAC"}
@@ -2764,12 +2764,20 @@ const Iu = {
2764
2764
  }
2765
2765
  }
2766
2766
  }, Fu = (e) => {
2767
- const t = e.reduce((i, l) => i + l.value, 0), r = e.map((i) => i.value / t * 100).map((i) => Math.round(i)), a = 100 - r.reduce((i, l) => i + l, 0);
2768
- for (let i = 0; i < Math.abs(a); i++)
2769
- a > 0 ? r[i % r.length]++ : r[i % r.length]--;
2770
- return e.map((i, l) => ({
2771
- x: i.x,
2772
- percent: r[l]
2767
+ const t = e.reduce((c, d) => c + d.value, 0), r = e.map((c) => c.value / t * 100).map(
2768
+ (c) => Math.round(c * 100) / 100
2769
+ ), o = r.reduce((c, d) => c + d, 0);
2770
+ if (Math.abs(o - 100) < 1e-3)
2771
+ return e.map((c, d) => ({
2772
+ x: c.x,
2773
+ percent: r[d]
2774
+ }));
2775
+ const i = (100 - o) / r.length, l = r.map(
2776
+ (c) => Math.round((c + i) * 100) / 100
2777
+ );
2778
+ return e.map((c, d) => ({
2779
+ x: c.x,
2780
+ percent: l[d]
2773
2781
  }));
2774
2782
  }, { Text: Ts } = nn, la = 400, Au = nt(Vc), _u = nt(Nc), Ru = nt(Mc), Ou = {
2775
2783
  line: Au,
@@ -2798,7 +2806,7 @@ const Iu = {
2798
2806
  if (!d)
2799
2807
  return;
2800
2808
  const g = d.find((_) => _.x === y);
2801
- return `${`${((g == null ? void 0 : g.percent) || 0).toFixed(0)}%`}`;
2809
+ return `${`${(g == null ? void 0 : g.percent) || 0}`}%`;
2802
2810
  },
2803
2811
  [d]
2804
2812
  ), u = Q(() => {
@@ -13283,7 +13291,12 @@ const { useToken: Kg } = Xe, { TextArea: Co } = ht, qg = (e) => {
13283
13291
  predefinedExports: g.map((_) => ({
13284
13292
  ..._,
13285
13293
  fields: _.fields.map((C) => {
13286
- const x = To(C.key), T = Io(C.key, i.current)[x];
13294
+ const x = To(C.key), R = Io(C.key, i.current);
13295
+ if (!R)
13296
+ return {
13297
+ key: C.key
13298
+ };
13299
+ const T = R[x];
13287
13300
  return T ? {
13288
13301
  key: C.key,
13289
13302
  title: T.string
@@ -13372,7 +13385,7 @@ const { useToken: Kg } = Xe, { TextArea: Co } = ht, qg = (e) => {
13372
13385
  return e;
13373
13386
  const t = e.split("/");
13374
13387
  return t[t.length - 1];
13375
- }, Io = (e, t) => e.indexOf("/") === -1 ? t["/"] : t[xo(e)], Zg = ({
13388
+ }, Io = (e, t) => e.indexOf("/") === -1 ? t["/"] : t == null ? void 0 : t[xo(e)], Zg = ({
13376
13389
  title: e,
13377
13390
  parentTitle: t
13378
13391
  }) => `${t ? t + " → " : ""}${e}`, ey = async ({