1mpacto-react-ui 2.0.20 → 2.0.22

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.
Files changed (114) hide show
  1. package/dist/assets/_mixins.scss +72 -72
  2. package/dist/assets/icons/arrow-narrow-down.svg +3 -3
  3. package/dist/assets/style.css +1 -1
  4. package/dist/components/Alert/index.cjs +1 -1
  5. package/dist/components/Alert/index.mjs +40 -40
  6. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
  7. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
  8. package/dist/components/Button/Button.cjs +12 -12
  9. package/dist/components/Button/Button.config.cjs +1 -1
  10. package/dist/components/Button/Button.config.mjs +3 -1
  11. package/dist/components/Button/Button.mjs +24 -24
  12. package/dist/components/Button/style.module.scss.cjs +1 -1
  13. package/dist/components/Button/style.module.scss.mjs +57 -55
  14. package/dist/components/ButtonIcon/ButtonIcon.cjs +12 -12
  15. package/dist/components/ButtonIcon/ButtonIcon.mjs +20 -20
  16. package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
  17. package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
  18. package/dist/components/Calendar/Calendar.cjs +1 -1
  19. package/dist/components/Calendar/Calendar.mjs +98 -100
  20. package/dist/components/Calendar/CalendarMonth.cjs +1 -1
  21. package/dist/components/Calendar/CalendarMonth.mjs +41 -42
  22. package/dist/components/Calendar/CalendarRange.cjs +1 -1
  23. package/dist/components/Calendar/CalendarRange.mjs +59 -61
  24. package/dist/components/Calendar/CalendarYear.cjs +3 -3
  25. package/dist/components/Calendar/CalendarYear.mjs +39 -40
  26. package/dist/components/Chart/DoughnutChart.cjs +1 -1
  27. package/dist/components/Chart/DoughnutChart.mjs +93 -96
  28. package/dist/components/Chart/GradientBarChart.cjs +1 -1
  29. package/dist/components/Chart/GradientBarChart.mjs +80 -81
  30. package/dist/components/Chart/GradientLineChart.cjs +1 -1
  31. package/dist/components/Chart/GradientLineChart.mjs +50 -51
  32. package/dist/components/Chart/LineChart.cjs +1 -1
  33. package/dist/components/Chart/LineChart.mjs +23 -23
  34. package/dist/components/Chart/PieChart.cjs +1 -1
  35. package/dist/components/Chart/PieChart.mjs +45 -48
  36. package/dist/components/Collapse/Collapse.cjs +1 -1
  37. package/dist/components/Collapse/Collapse.mjs +23 -24
  38. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  39. package/dist/components/DatePicker/DatePicker.mjs +86 -89
  40. package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
  41. package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
  42. package/dist/components/DatePicker/FilterDate.cjs +1 -1
  43. package/dist/components/DatePicker/FilterDate.mjs +107 -110
  44. package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
  45. package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
  46. package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
  47. package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
  48. package/dist/components/Input/InputFloatingInner.cjs +5 -5
  49. package/dist/components/Input/InputFloatingInner.mjs +24 -25
  50. package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
  51. package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
  52. package/dist/components/Pagination/Pagination.cjs +2 -2
  53. package/dist/components/Pagination/Pagination.mjs +76 -80
  54. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
  55. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
  56. package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
  57. package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
  58. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  59. package/dist/components/Sidebar/Sidebar.mjs +65 -68
  60. package/dist/components/Slider/Slider.cjs +1 -0
  61. package/dist/components/Slider/Slider.mjs +61 -0
  62. package/dist/components/Slider/style.module.scss.cjs +1 -0
  63. package/dist/components/Slider/style.module.scss.mjs +14 -0
  64. package/dist/components/Step/Step.cjs +5 -5
  65. package/dist/components/Step/Step.mjs +52 -52
  66. package/dist/components/Table/Table.cjs +3 -3
  67. package/dist/components/Table/Table.mjs +275 -298
  68. package/dist/components/Table/TableSubMobile.cjs +1 -1
  69. package/dist/components/Table/TableSubMobile.mjs +32 -35
  70. package/dist/components/Tabs/Tabs.cjs +8 -8
  71. package/dist/components/Tabs/Tabs.mjs +66 -70
  72. package/dist/components/Textarea/Textarea.cjs +7 -7
  73. package/dist/components/Textarea/Textarea.mjs +47 -50
  74. package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
  75. package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
  76. package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
  77. package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
  78. package/dist/components/TimeRange/TimeRange.cjs +1 -1
  79. package/dist/components/TimeRange/TimeRange.mjs +88 -91
  80. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  81. package/dist/components/Tooltip/Tooltip.mjs +44 -46
  82. package/dist/components/Upload/UploadFile.cjs +1 -1
  83. package/dist/components/Upload/UploadFile.mjs +50 -54
  84. package/dist/components/Upload/UploadImage.cjs +12 -12
  85. package/dist/components/Upload/UploadImage.mjs +73 -79
  86. package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
  87. package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
  88. package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
  89. package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
  90. package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
  91. package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
  92. package/dist/config/components/tinymce.cjs +2 -2
  93. package/dist/config/components/tinymce.mjs +3 -3
  94. package/dist/hooks/useCountdown.cjs +1 -1
  95. package/dist/hooks/useCountdown.mjs +15 -15
  96. package/dist/hooks/useDebounce.cjs +1 -1
  97. package/dist/hooks/useDebounce.mjs +19 -19
  98. package/dist/hooks/useOtpInput.cjs +1 -1
  99. package/dist/hooks/useOtpInput.mjs +47 -51
  100. package/dist/index.cjs +1 -1
  101. package/dist/index.mjs +48 -46
  102. package/dist/package.json.cjs +1 -1
  103. package/dist/package.json.d.ts +129 -128
  104. package/dist/package.json.mjs +1 -1
  105. package/dist/src/components/Button/Button.config.d.ts +2 -0
  106. package/dist/src/components/Slider/Slider.d.ts +3 -0
  107. package/dist/src/components/Slider/Slider.stories.d.ts +6 -0
  108. package/dist/src/components/index.d.ts +4 -2
  109. package/dist/src/interfaces/components/Button/index.d.ts +1 -1
  110. package/dist/src/interfaces/components/Slider/index.d.ts +51 -0
  111. package/dist/types-external/table.d.ts +15 -15
  112. package/dist/utils/common.cjs +1 -1
  113. package/dist/utils/common.mjs +172 -173
  114. package/package.json +128 -128
@@ -1,75 +1,72 @@
1
- import { jsxs as a, jsx as s, Fragment as S } from "react/jsx-runtime";
2
- import e, { createElement as G } from "react";
1
+ import { jsxs as a, jsx as s, Fragment as w } from "react/jsx-runtime";
2
+ import e, { createElement as q } from "react";
3
3
  import o from "./Sidebar.module.scss.mjs";
4
- import J from "./ItemSidebar.mjs";
5
- import V from "../../config/tailwind/nativeScreen.mjs";
6
- import { configSidebar as v } from "./Sidebar.config.mjs";
7
- const K = e.forwardRef(
8
- (x, L) => {
9
- var $;
4
+ import A from "./ItemSidebar.mjs";
5
+ import k from "../../config/tailwind/nativeScreen.mjs";
6
+ import { configSidebar as S } from "./Sidebar.config.mjs";
7
+ const D = e.forwardRef(
8
+ ($, O) => {
10
9
  const {
11
- as: E,
12
- children: N,
13
- patch: r = "/",
14
- iconCompany: c,
15
- iconSubs: z,
10
+ as: v,
11
+ children: E,
12
+ patch: c = "/",
13
+ iconCompany: r,
14
+ iconSubs: V,
16
15
  iconCollapse: u,
17
- iconCollapseClose: g,
18
- modules: j,
19
- toleranceWidthIconCompany: B = 25,
20
- onClickItems: M,
16
+ iconCollapseClose: N,
17
+ modules: x,
18
+ toleranceWidthIconCompany: L = 25,
19
+ onClickItems: z,
21
20
  variant: m = "payhere-brand-base-white",
22
21
  footer: l,
23
- withInheritance: I,
22
+ withInheritance: g,
24
23
  id: h = "1ru-sidebar",
25
- styleSidebar: T,
26
- styleContent: F,
27
- ...H
28
- } = x, P = e.useRef(null), [i, d] = e.useState(null), [t, f] = e.useState(null), [q, R] = e.useState(""), [W, b] = e.useState(), [k, A] = e.useState(0), y = () => {
29
- var O;
30
- let n = 0;
31
- const C = document.getElementById("icon-company-sidebar");
32
- (O = C == null ? void 0 : C.childNodes) == null || O.forEach((D) => {
33
- n += D.getBoundingClientRect().width ?? 0;
34
- }), b(n + B + "px");
35
- }, w = () => {
36
- A(window.innerWidth);
24
+ styleSidebar: j,
25
+ styleContent: B,
26
+ ...M
27
+ } = $, T = e.useRef(null), [n, d] = e.useState(null), [i, f] = e.useState(null), [F, I] = e.useState(""), [R, b] = e.useState(), [W, H] = e.useState(0), y = () => {
28
+ let t = 0;
29
+ document.getElementById("icon-company-sidebar")?.childNodes?.forEach((P) => {
30
+ t += P.getBoundingClientRect().width ?? 0;
31
+ }), b(t + L + "px");
32
+ }, C = () => {
33
+ H(window.innerWidth);
37
34
  }, p = () => {
38
- d(!t), t ? b("auto") : setTimeout(() => {
35
+ d(!i), i ? b("auto") : setTimeout(() => {
39
36
  y();
40
37
  }, 100);
41
38
  };
42
39
  return e.useEffect(() => {
43
- k >= (v.mobileSupport.includes(m) ? V.lg : V.md) ? (d(!0), setTimeout(() => {
40
+ W >= (S.mobileSupport.includes(m) ? k.lg : k.md) ? (d(!0), setTimeout(() => {
44
41
  y();
45
42
  }, 100)) : (d(!1), b("auto"));
46
- }, [k]), e.useEffect(() => {
47
- typeof i == "boolean" && f(i);
48
- }, [i]), e.useImperativeHandle(
49
- L,
43
+ }, [W]), e.useEffect(() => {
44
+ typeof n == "boolean" && f(n);
45
+ }, [n]), e.useImperativeHandle(
46
+ O,
50
47
  () => ({
51
- openSidebar: i,
48
+ openSidebar: n,
52
49
  setOpenSidebar: d,
53
50
  handlerClickCollapse: p
54
51
  }),
55
- [i, t]
56
- ), e.useEffect(() => (r && r.split("/").length > 1 && R(r + "/"), y(), w(), window.addEventListener("resize", w), () => window.removeEventListener("resize", w)), []), /* @__PURE__ */ a("div", { className: v.variants[m], ...H, ref: P, children: [
52
+ [n, i]
53
+ ), e.useEffect(() => (c && c.split("/").length > 1 && I(c + "/"), y(), C(), window.addEventListener("resize", C), () => window.removeEventListener("resize", C)), []), /* @__PURE__ */ a("div", { className: S.variants[m], ...M, ref: T, children: [
57
54
  /* @__PURE__ */ a(
58
55
  "div",
59
56
  {
60
57
  id: h,
61
- className: `${o.sidebar} ${typeof t == "boolean" && t ? o["sidebar-open"] : ""} ${typeof t == "boolean" && !t ? o["sidebar-close"] : ""}`,
62
- style: T || {},
58
+ className: `${o.sidebar} ${typeof i == "boolean" && i ? o["sidebar-open"] : ""} ${typeof i == "boolean" && !i ? o["sidebar-close"] : ""}`,
59
+ style: j || {},
63
60
  children: [
64
61
  e.isValidElement(u) && /* @__PURE__ */ a(
65
62
  "div",
66
63
  {
67
64
  className: o["button-collaps-sidebar"],
68
- id: `${h}-${i ? "close-collapse" : "open-collapse"}`,
65
+ id: `${h}-${n ? "close-collapse" : "open-collapse"}`,
69
66
  onClick: p,
70
67
  children: [
71
- i && u,
72
- i ? "" : e.isValidElement(g) ? g : u
68
+ n && u,
69
+ n ? "" : e.isValidElement(N) ? N : u
73
70
  ]
74
71
  }
75
72
  ),
@@ -79,11 +76,11 @@ const K = e.forwardRef(
79
76
  id: "icon-company-sidebar",
80
77
  className: o["icon-company-sidebar"],
81
78
  style: {
82
- width: W && v.withCuctomWidthIconCompany.includes(m) ? W : "100%"
79
+ width: R && S.withCuctomWidthIconCompany.includes(m) ? R : "100%"
83
80
  },
84
81
  children: [
85
- e.isValidElement(c) && c,
86
- typeof c == "function" && c({ openSidebar: t, setOpenSidebar: d })
82
+ e.isValidElement(r) && r,
83
+ typeof r == "function" && r({ openSidebar: i, setOpenSidebar: d })
87
84
  ]
88
85
  }
89
86
  ) }),
@@ -92,45 +89,45 @@ const K = e.forwardRef(
92
89
  {
93
90
  className: o["menu-sidebar"],
94
91
  onMouseOver: () => {
95
- i || f(!0);
92
+ n || f(!0);
96
93
  },
97
94
  onMouseOut: () => {
98
- i || f(!1);
95
+ n || f(!1);
99
96
  },
100
- children: j.map((n) => /* @__PURE__ */ G(
101
- J,
97
+ children: x.map((t) => /* @__PURE__ */ q(
98
+ A,
102
99
  {
103
- ...n,
104
- as: n.manualRoute || n.subs.length > 0 ? "div" : E,
105
- linkComponent: E,
106
- key: n.name,
107
- show: q,
108
- open: t,
109
- patch: r,
110
- iconSubs: z,
100
+ ...t,
101
+ as: t.manualRoute || t.subs.length > 0 ? "div" : v,
102
+ linkComponent: v,
103
+ key: t.name,
104
+ show: F,
105
+ open: i,
106
+ patch: c,
107
+ iconSubs: V,
111
108
  variant: m,
112
- setShow: R,
113
- onClickItems: M
109
+ setShow: I,
110
+ onClickItems: z
114
111
  }
115
112
  ))
116
113
  }
117
114
  ),
118
- l && /* @__PURE__ */ a("div", { className: t ? "iru-opacity-[1]" : "iru-opacity-0", children: [
115
+ l && /* @__PURE__ */ a("div", { className: i ? "iru-opacity-[1]" : "iru-opacity-0", children: [
119
116
  e.isValidElement(l) && /* @__PURE__ */ s("div", { children: l }),
120
117
  typeof l == "function" && /* @__PURE__ */ s("div", { children: l() })
121
118
  ] })
122
119
  ]
123
120
  }
124
121
  ),
125
- i && /* @__PURE__ */ s("div", { id: `${h}-splace-screen`, className: o["splace-screen"], onClick: p }),
126
- /* @__PURE__ */ a("div", { className: o["content-sidebar"], style: F || {}, children: [
127
- I && (($ = e.Children) == null ? void 0 : $.map(N, (n) => /* @__PURE__ */ s(S, { children: e.isValidElement(n) && /* @__PURE__ */ s(S, { children: e.cloneElement(n, { openSidebar: i, handlerClickCollapse: p }) }) }))),
128
- !I && /* @__PURE__ */ s(S, { children: N })
122
+ n && /* @__PURE__ */ s("div", { id: `${h}-splace-screen`, className: o["splace-screen"], onClick: p }),
123
+ /* @__PURE__ */ a("div", { className: o["content-sidebar"], style: B || {}, children: [
124
+ g && e.Children?.map(E, (t) => /* @__PURE__ */ s(w, { children: e.isValidElement(t) && /* @__PURE__ */ s(w, { children: e.cloneElement(t, { openSidebar: n, handlerClickCollapse: p }) }) })),
125
+ !g && /* @__PURE__ */ s(w, { children: E })
129
126
  ] })
130
127
  ] });
131
128
  }
132
129
  );
133
- K.displayName = "Sidebar";
130
+ D.displayName = "Sidebar";
134
131
  export {
135
- K as default
132
+ D as default
136
133
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),n=require("react"),r=require("./style.module.scss.cjs"),$=n.forwardRef((P,b)=>{const{min:s=0,max:u=10,value:e,onChange:i,className:p,disabled:l=!1,classNameThumb:N,classNameTrackFill:k,classNameTrack:w,...x}=P,d=n.useRef(null),[M,f]=n.useState(e??s),[h,g]=n.useState(!1),m=e??M,v=(m-s)/(u-s)*100,o=n.useCallback(t=>{if(!d.current)return m;const a=d.current.getBoundingClientRect(),R=Math.min(Math.max((t-a.left)/a.width,0),1);return Math.round(s+R*(u-s))},[s,u,m]),V=n.useCallback(t=>{if(l)return;t.preventDefault(),t.target.setPointerCapture(t.pointerId),g(!0);const a=o(t.clientX);e===void 0&&f(a),i?.(a)},[l,e,o,i]),j=n.useCallback(t=>{if(!h||l)return;const a=o(t.clientX);e===void 0&&f(a),i?.(a)},[h,l,e,o,i]),C=()=>{g(!1)};return n.useEffect(()=>{e!==void 0&&f(e)},[e]),c.jsx("div",{ref:b,className:`${r.default.slider} ${l?r.default.disabled:""} ${p??""}`,...x,children:c.jsxs("div",{ref:d,className:`${r.default.track} ${w??""}`,onPointerDown:V,onPointerMove:j,onPointerUp:C,children:[c.jsx("div",{className:`${r.default["track-fill"]} ${k??""}`,style:{width:`${v}%`}}),c.jsx("div",{className:`${r.default.thumb} ${N??""}`,style:{left:`${v}%`}})]})})});$.displayName="Slider";exports.default=$;
@@ -0,0 +1,61 @@
1
+ import { jsx as f, jsxs as R } from "react/jsx-runtime";
2
+ import { forwardRef as I, useRef as S, useState as v, useCallback as m, useEffect as T } from "react";
3
+ import s from "./style.module.scss.mjs";
4
+ const j = I(($, N) => {
5
+ const {
6
+ min: r = 0,
7
+ max: i = 10,
8
+ value: e,
9
+ onChange: l,
10
+ className: P,
11
+ disabled: a = !1,
12
+ classNameThumb: w,
13
+ classNameTrackFill: V,
14
+ classNameTrack: k,
15
+ ...b
16
+ } = $, c = S(null), [x, d] = v(e ?? r), [h, p] = v(!1), u = e ?? x, g = (u - r) / (i - r) * 100, o = m(
17
+ (t) => {
18
+ if (!c.current) return u;
19
+ const n = c.current.getBoundingClientRect(), C = Math.min(Math.max((t - n.left) / n.width, 0), 1);
20
+ return Math.round(r + C * (i - r));
21
+ },
22
+ [r, i, u]
23
+ ), D = m(
24
+ (t) => {
25
+ if (a) return;
26
+ t.preventDefault(), t.target.setPointerCapture(t.pointerId), p(!0);
27
+ const n = o(t.clientX);
28
+ e === void 0 && d(n), l?.(n);
29
+ },
30
+ [a, e, o, l]
31
+ ), M = m(
32
+ (t) => {
33
+ if (!h || a) return;
34
+ const n = o(t.clientX);
35
+ e === void 0 && d(n), l?.(n);
36
+ },
37
+ [h, a, e, o, l]
38
+ ), y = () => {
39
+ p(!1);
40
+ };
41
+ return T(() => {
42
+ e !== void 0 && d(e);
43
+ }, [e]), /* @__PURE__ */ f("div", { ref: N, className: `${s.slider} ${a ? s.disabled : ""} ${P ?? ""}`, ...b, children: /* @__PURE__ */ R(
44
+ "div",
45
+ {
46
+ ref: c,
47
+ className: `${s.track} ${k ?? ""}`,
48
+ onPointerDown: D,
49
+ onPointerMove: M,
50
+ onPointerUp: y,
51
+ children: [
52
+ /* @__PURE__ */ f("div", { className: `${s["track-fill"]} ${V ?? ""}`, style: { width: `${g}%` } }),
53
+ /* @__PURE__ */ f("div", { className: `${s.thumb} ${w ?? ""}`, style: { left: `${g}%` } })
54
+ ]
55
+ }
56
+ ) });
57
+ });
58
+ j.displayName = "Slider";
59
+ export {
60
+ j as default
61
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r="_slider_nvr4r_1",t="_disabled_nvr4r_7",e="_track_nvr4r_13",l="_thumb_nvr4r_32",s={slider:r,disabled:t,track:e,"track-fill":"_track-fill_nvr4r_22",thumb:l};exports.default=s;exports.disabled=t;exports.slider=r;exports.thumb=l;exports.track=e;
@@ -0,0 +1,14 @@
1
+ const r = "_slider_nvr4r_1", t = "_disabled_nvr4r_7", _ = "_track_nvr4r_13", s = "_thumb_nvr4r_32", l = {
2
+ slider: r,
3
+ disabled: t,
4
+ track: _,
5
+ "track-fill": "_track-fill_nvr4r_22",
6
+ thumb: s
7
+ };
8
+ export {
9
+ l as default,
10
+ t as disabled,
11
+ r as slider,
12
+ s as thumb,
13
+ _ as track
14
+ };
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),d=require("./Step.module.scss.cjs"),g=({widthLine:l,color:r})=>s.jsx("svg",{height:"5",xmlns:"http://www.w3.org/2000/svg",className:d.default["content-line-dashed"],width:l+10,style:{right:-(l/2+14)},children:s.jsx("g",{fill:"none",stroke:r,strokeWidth:"10",children:s.jsx("path",{strokeDasharray:"12,4",d:`M0 0 ${l+10} 0`})})}),u=({widthLine:l,color:r})=>s.jsx("hr",{className:d.default["content-line-active"],style:{width:l+22,right:-(l/2+20),borderColor:r}}),N=({activeStep:l,stepList:r,widthLine:n=250,classNameContainer:x,classNameContent:f,classNameDesc:$,onChange:a,afterActiveType:t="solid",beforeActiveType:h="dashed",colorActive:m="#0163c8 ",colorInactive:j="#D6D6D6"})=>s.jsx("div",{className:`${d.default.container} ${x??""}`,children:r.map((e,o)=>{const c=o+1;return s.jsxs("div",{className:`${d.default["content-section"]} ${f??""}`,onClick:()=>{typeof a=="function"&&a(e)},children:[s.jsxs("div",{className:d.default["content-step"],children:[c<r.length&&s.jsxs(s.Fragment,{children:[(e.step??c)>=l&&s.jsxs(s.Fragment,{children:[h==="solid"&&s.jsx(u,{color:j,widthLine:n}),h==="dashed"&&s.jsx(g,{color:j,widthLine:n})]}),(e.step??c)<l&&s.jsxs(s.Fragment,{children:[t==="solid"&&s.jsx(u,{color:m,widthLine:n}),t==="dashed"&&s.jsx(g,{color:m,widthLine:n})]})]}),o!==0&&s.jsx("div",{style:{width:n/2}}),s.jsx("div",{className:`${d.default["number-step"]}
2
- ${(e.step??c)<l?d.default.passed:""}
3
- ${(e.step??c)===l?d.default.active:""}
4
- ${e.className??""}`,children:l>e.step&&e.valueDone?s.jsx(s.Fragment,{children:e.valueDone}):s.jsx(s.Fragment,{children:e.value?e.value:c})}),o+1!==(r==null?void 0:r.length)&&s.jsx("div",{style:{width:n/2}})]}),e.desc&&s.jsx("div",{className:`${d.default["content-description"]} ${$??""}
5
- ${(e.step??c)<=l?d.default.active:""}`,style:{maxWidth:o+1===(r==null?void 0:r.length)||o===0?(n-30)*2:n-30,marginRight:o+1===(r==null?void 0:r.length)?-(n/2):0,marginLeft:o===0?-(n/2):0},children:e.desc})]},o)})});exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),l=require("./Step.module.scss.cjs"),g=({widthLine:t,color:n})=>s.jsx("svg",{height:"5",xmlns:"http://www.w3.org/2000/svg",className:l.default["content-line-dashed"],width:t+10,style:{right:-(t/2+14)},children:s.jsx("g",{fill:"none",stroke:n,strokeWidth:"10",children:s.jsx("path",{strokeDasharray:"12,4",d:`M0 0 ${t+10} 0`})})}),u=({widthLine:t,color:n})=>s.jsx("hr",{className:l.default["content-line-active"],style:{width:t+22,right:-(t/2+20),borderColor:n}}),$=({activeStep:t,stepList:n,widthLine:r=250,classNameContainer:x,classNameContent:f,classNameDesc:i,onChange:c,afterActiveType:a="solid",beforeActiveType:h="dashed",colorActive:m="#0163c8 ",colorInactive:j="#D6D6D6"})=>s.jsx("div",{className:`${l.default.container} ${x??""}`,children:n.map((e,d)=>{const o=d+1;return s.jsxs("div",{className:`${l.default["content-section"]} ${f??""}`,onClick:()=>{typeof c=="function"&&c(e)},children:[s.jsxs("div",{className:l.default["content-step"],children:[o<n.length&&s.jsxs(s.Fragment,{children:[(e.step??o)>=t&&s.jsxs(s.Fragment,{children:[h==="solid"&&s.jsx(u,{color:j,widthLine:r}),h==="dashed"&&s.jsx(g,{color:j,widthLine:r})]}),(e.step??o)<t&&s.jsxs(s.Fragment,{children:[a==="solid"&&s.jsx(u,{color:m,widthLine:r}),a==="dashed"&&s.jsx(g,{color:m,widthLine:r})]})]}),d!==0&&s.jsx("div",{style:{width:r/2}}),s.jsx("div",{className:`${l.default["number-step"]}
2
+ ${(e.step??o)<t?l.default.passed:""}
3
+ ${(e.step??o)===t?l.default.active:""}
4
+ ${e.className??""}`,children:t>e.step&&e.valueDone?s.jsx(s.Fragment,{children:e.valueDone}):s.jsx(s.Fragment,{children:e.value?e.value:o})}),d+1!==n?.length&&s.jsx("div",{style:{width:r/2}})]}),e.desc&&s.jsx("div",{className:`${l.default["content-description"]} ${i??""}
5
+ ${(e.step??o)<=t?l.default.active:""}`,style:{maxWidth:d+1===n?.length||d===0?(r-30)*2:r-30,marginRight:d+1===n?.length?-(r/2):0,marginLeft:d===0?-(r/2):0},children:e.desc})]},d)})});exports.default=$;
@@ -1,85 +1,85 @@
1
- import { jsx as o, jsxs as a, Fragment as m } from "react/jsx-runtime";
2
- import s from "./Step.module.scss.mjs";
3
- const D = ({ widthLine: c, color: r }) => /* @__PURE__ */ o(
1
+ import { jsx as s, jsxs as d, Fragment as h } from "react/jsx-runtime";
2
+ import t from "./Step.module.scss.mjs";
3
+ const i = ({ widthLine: o, color: c }) => /* @__PURE__ */ s(
4
4
  "svg",
5
5
  {
6
6
  height: "5",
7
7
  xmlns: "http://www.w3.org/2000/svg",
8
- className: s["content-line-dashed"],
9
- width: c + 10,
10
- style: { right: -(c / 2 + 14) },
11
- children: /* @__PURE__ */ o("g", { fill: "none", stroke: r, strokeWidth: "10", children: /* @__PURE__ */ o("path", { strokeDasharray: "12,4", d: `M0 0 ${c + 10} 0` }) })
8
+ className: t["content-line-dashed"],
9
+ width: o + 10,
10
+ style: { right: -(o / 2 + 14) },
11
+ children: /* @__PURE__ */ s("g", { fill: "none", stroke: c, strokeWidth: "10", children: /* @__PURE__ */ s("path", { strokeDasharray: "12,4", d: `M0 0 ${o + 10} 0` }) })
12
12
  }
13
- ), f = ({ widthLine: c, color: r }) => /* @__PURE__ */ o(
13
+ ), N = ({ widthLine: o, color: c }) => /* @__PURE__ */ s(
14
14
  "hr",
15
15
  {
16
- className: s["content-line-active"],
17
- style: { width: c + 22, right: -(c / 2 + 20), borderColor: r }
16
+ className: t["content-line-active"],
17
+ style: { width: o + 22, right: -(o / 2 + 20), borderColor: c }
18
18
  }
19
- ), C = ({
20
- activeStep: c,
21
- stepList: r,
22
- widthLine: n = 250,
23
- classNameContainer: y,
24
- classNameContent: k,
25
- classNameDesc: b,
26
- onChange: e,
27
- afterActiveType: g = "solid",
28
- beforeActiveType: $ = "dashed",
29
- colorActive: t = "#0163c8 ",
30
- colorInactive: N = "#D6D6D6"
31
- }) => /* @__PURE__ */ o("div", { className: `${s.container} ${y ?? ""}`, children: r.map((l, d) => {
32
- const h = d + 1;
33
- return /* @__PURE__ */ a(
19
+ ), j = ({
20
+ activeStep: o,
21
+ stepList: c,
22
+ widthLine: l = 250,
23
+ classNameContainer: D,
24
+ classNameContent: f,
25
+ classNameDesc: y,
26
+ onChange: a,
27
+ afterActiveType: m = "solid",
28
+ beforeActiveType: g = "dashed",
29
+ colorActive: $ = "#0163c8 ",
30
+ colorInactive: p = "#D6D6D6"
31
+ }) => /* @__PURE__ */ s("div", { className: `${t.container} ${D ?? ""}`, children: c.map((r, n) => {
32
+ const e = n + 1;
33
+ return /* @__PURE__ */ d(
34
34
  "div",
35
35
  {
36
- className: `${s["content-section"]} ${k ?? ""}`,
36
+ className: `${t["content-section"]} ${f ?? ""}`,
37
37
  onClick: () => {
38
- typeof e == "function" && e(l);
38
+ typeof a == "function" && a(r);
39
39
  },
40
40
  children: [
41
- /* @__PURE__ */ a("div", { className: s["content-step"], children: [
42
- h < r.length && /* @__PURE__ */ a(m, { children: [
43
- (l.step ?? h) >= c && /* @__PURE__ */ a(m, { children: [
44
- $ === "solid" && /* @__PURE__ */ o(f, { color: N, widthLine: n }),
45
- $ === "dashed" && /* @__PURE__ */ o(D, { color: N, widthLine: n })
41
+ /* @__PURE__ */ d("div", { className: t["content-step"], children: [
42
+ e < c.length && /* @__PURE__ */ d(h, { children: [
43
+ (r.step ?? e) >= o && /* @__PURE__ */ d(h, { children: [
44
+ g === "solid" && /* @__PURE__ */ s(N, { color: p, widthLine: l }),
45
+ g === "dashed" && /* @__PURE__ */ s(i, { color: p, widthLine: l })
46
46
  ] }),
47
- (l.step ?? h) < c && /* @__PURE__ */ a(m, { children: [
48
- g === "solid" && /* @__PURE__ */ o(f, { color: t, widthLine: n }),
49
- g === "dashed" && /* @__PURE__ */ o(D, { color: t, widthLine: n })
47
+ (r.step ?? e) < o && /* @__PURE__ */ d(h, { children: [
48
+ m === "solid" && /* @__PURE__ */ s(N, { color: $, widthLine: l }),
49
+ m === "dashed" && /* @__PURE__ */ s(i, { color: $, widthLine: l })
50
50
  ] })
51
51
  ] }),
52
- d !== 0 && /* @__PURE__ */ o("div", { style: { width: n / 2 } }),
53
- /* @__PURE__ */ o(
52
+ n !== 0 && /* @__PURE__ */ s("div", { style: { width: l / 2 } }),
53
+ /* @__PURE__ */ s(
54
54
  "div",
55
55
  {
56
- className: `${s["number-step"]}
57
- ${(l.step ?? h) < c ? s.passed : ""}
58
- ${(l.step ?? h) === c ? s.active : ""}
59
- ${l.className ?? ""}`,
60
- children: c > l.step && l.valueDone ? /* @__PURE__ */ o(m, { children: l.valueDone }) : /* @__PURE__ */ o(m, { children: l.value ? l.value : h })
56
+ className: `${t["number-step"]}
57
+ ${(r.step ?? e) < o ? t.passed : ""}
58
+ ${(r.step ?? e) === o ? t.active : ""}
59
+ ${r.className ?? ""}`,
60
+ children: o > r.step && r.valueDone ? /* @__PURE__ */ s(h, { children: r.valueDone }) : /* @__PURE__ */ s(h, { children: r.value ? r.value : e })
61
61
  }
62
62
  ),
63
- d + 1 !== (r == null ? void 0 : r.length) && /* @__PURE__ */ o("div", { style: { width: n / 2 } })
63
+ n + 1 !== c?.length && /* @__PURE__ */ s("div", { style: { width: l / 2 } })
64
64
  ] }),
65
- l.desc && /* @__PURE__ */ o(
65
+ r.desc && /* @__PURE__ */ s(
66
66
  "div",
67
67
  {
68
- className: `${s["content-description"]} ${b ?? ""}
69
- ${(l.step ?? h) <= c ? s.active : ""}`,
68
+ className: `${t["content-description"]} ${y ?? ""}
69
+ ${(r.step ?? e) <= o ? t.active : ""}`,
70
70
  style: {
71
- maxWidth: d + 1 === (r == null ? void 0 : r.length) || d === 0 ? (n - 30) * 2 : n - 30,
72
- marginRight: d + 1 === (r == null ? void 0 : r.length) ? -(n / 2) : 0,
73
- marginLeft: d === 0 ? -(n / 2) : 0
71
+ maxWidth: n + 1 === c?.length || n === 0 ? (l - 30) * 2 : l - 30,
72
+ marginRight: n + 1 === c?.length ? -(l / 2) : 0,
73
+ marginLeft: n === 0 ? -(l / 2) : 0
74
74
  },
75
- children: l.desc
75
+ children: r.desc
76
76
  }
77
77
  )
78
78
  ]
79
79
  },
80
- d
80
+ n
81
81
  );
82
82
  }) });
83
83
  export {
84
- C as default
84
+ j as default
85
85
  };
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),q=require("@tanstack/react-table"),p=require("react"),U=require("../Virtualization/TableVirtualization.cjs"),P=require("./Table.module.scss.cjs"),L=require("../../hooks/useDeepCompareEffect.cjs"),h=require("./Table.config.cjs"),X=(n,c)=>{var g,m;let i={};return n&&(i={position:"sticky",top:0,zIndex:2}),(g=c.column.columnDef.meta)!=null&&g.styleTh&&(i={...i,...(m=c.column.columnDef.meta)==null?void 0:m.styleTh(c.column.columnDef)}),i},A=(n,c=!1)=>{const i=n.getIsPinned(),g=i==="left"&&n.getIsLastColumn("left"),m=i==="right"&&n.getIsFirstColumn("right");return i?{boxShadow:g?"-4px 0 4px -4px gray inset":m?"4px 0 4px -4px gray inset":void 0,left:i==="left"?`${n.getStart("left")}px`:void 0,right:i==="right"?`${n.getAfter("right")}px`:void 0,position:"sticky",width:n.getSize(),zIndex:1,background:c?"white":""}:{}},K=n=>{const c=n.columnPinning.left||[],i=n.columnPinning.right||[],g=n.rowPinning.top||[],m=n.rowPinning.bottom||[];return{left:c,right:i,top:g,bottom:m,isPinning:c.length>0||i.length>0||g.length>0||m.length>0}},Y=({tableInstance:n,classNameWrapperTable:c,classNameTable:i,handlerRowClick:g,privillageRowClick:m,headerId:z,tbodyTrId:N,theadTrId:F,maxHeight:$,idCalculateHeight:M,componentSortASC:W,componentSortDESC:T,classNamePointer:C,emptyPlaceholder:d,renderSubComponent:a,visibilityColumns:j,classNameSubMobile:b})=>e.jsx("div",{id:"1ru-table",style:$?{height:$,overflow:"auto"}:{},className:c??"",children:e.jsxs("table",{className:i,style:{width:K(n.getState()).isPinning?n.getCenterTotalSize():""},children:[e.jsx("thead",{id:z,"data-calculate-height-header":M,children:n.getHeaderGroups().map(u=>e.jsx("tr",{children:u.headers.map(o=>{var l,f,t,s;const S=(f=(l=o.column.columnDef.meta)==null?void 0:l.rowSpan)==null?void 0:f.call(l,o);return!o.isPlaceholder&&S!==void 0&&o.id===o.column.id?e.jsx(e.Fragment,{}):e.jsxs("th",{style:{...X($,o),...A(o.column),...j.columns.includes(o.column.id)?{display:"none"}:{}},id:`${F(o)}-${o.id}`,colSpan:typeof((t=o.column.columnDef.meta)==null?void 0:t.colSpan)=="function"?(s=o.column.columnDef.meta)==null?void 0:s.colSpan(o.column.columnDef):o.colSpan,rowSpan:S,children:[o.isPlaceholder&&S===void 0?null:e.jsxs("div",{className:o.column.getCanSort()?P.default.sorting:"",onClick:o.column.getToggleSortingHandler(),id:o.column.getCanSort()?`${F(o)}-${o.id}-sort`:"",children:[q.flexRender(o.column.columnDef.header,o.getContext()),o.column.getCanSort()&&e.jsx("span",{className:"iru-flex-shrink-0",children:o.column.getIsSorted()==="asc"||o.column.getIsSorted()==="desc"?e.jsxs(e.Fragment,{children:[o.column.getIsSorted()==="asc"&&e.jsx(e.Fragment,{children:W}),o.column.getIsSorted()==="desc"&&e.jsx(e.Fragment,{children:T})]}):e.jsx(e.Fragment,{})})]}),o.column.getIsPinned()&&e.jsx("div",{onDoubleClick:()=>o.column.resetSize(),onMouseDown:o.getResizeHandler(),onTouchStart:o.getResizeHandler(),className:P.default["resize-menu"]})]},o.id)})},u.id))}),e.jsxs("tbody",{children:[n.getRowModel().rows.length>0&&n.getRowModel().rows.map((u,o)=>{var S;return e.jsxs(p.Fragment,{children:[e.jsx("tr",{onClick:l=>{l.stopPropagation(),m&&typeof g=="function"&&g(u.original,u)},className:m?C:"","data-calculate-height":`${M}-${o}`,id:N(u),children:u.getVisibleCells().map(l=>{var f,t,s;return e.jsx("td",{style:{...typeof((f=l.column.columnDef.meta)==null?void 0:f.styleTd)=="function"?l.column.columnDef.meta.styleTd(u.original,u):{},...A(l.column,!0),...j.columns.includes(l.column.id)?{display:"none"}:{}},className:typeof((t=l.column.columnDef.meta)==null?void 0:t.classNameTd)=="function"?(s=l.column.columnDef.meta)==null?void 0:s.classNameTd(u.original,u):"",id:`${N(u)}-${l.column.id}`,children:q.flexRender(l.column.columnDef.cell,l.getContext())},l.id)})},u.id),u.getIsExpanded()&&typeof a=="function"&&e.jsx("tr",{children:e.jsx("td",{colSpan:u.getVisibleCells().length-(((S=j==null?void 0:j.realColumns)==null?void 0:S.length)||0),children:a(u.original,u,{visibilityColumns:j,classNameSubMobile:b})})})]},u.id)}),n.getRowModel().rows.length===0&&p.isValidElement(d)&&e.jsx("tr",{children:e.jsx("td",{colSpan:n.getVisibleFlatColumns().length,children:d})})]})]})}),O=p.forwardRef((n,c)=>{const{context:i,...g}=n;return e.jsx("thead",{id:(i==null?void 0:i.headerId)??"",...g,ref:c})});O.displayName="VirtualizationHead";const Q=({style:n,context:c,...i})=>e.jsx("table",{...i,id:"1ru-table",className:(c==null?void 0:c.classNameTable)??"",style:{...n,width:c==null?void 0:c.width}}),Z=({tableInstance:n,classNameWrapperTable:c,handlerRowClick:i,privillageRowClick:g,virtualizationProps:m,headerId:z,tbodyTrId:N,theadTrId:F,classNameTable:$,componentSortASC:M,componentSortDESC:W,classNamePointer:T,emptyPlaceholder:C,renderSubComponent:d,visibilityColumns:a,classNameSubMobile:j})=>{var o,S,l;const[b,u]=p.useState(0);return e.jsx(U.default,{context:{headerId:z,classNameTable:$,width:K(n.getState()).isPinning?n.getCenterTotalSize():""},typeHight:"min-max",totalCount:((o=n.getRowModel().rows)==null?void 0:o.length)||0,minLengthItem:((S=n.getRowModel().rows)==null?void 0:S.length)||0,typeCalculateItemSize:"auto",component:{TableHead:O,Table:Q,EmptyPlaceholder:()=>e.jsx("tbody",{ref:f=>{var t;return u(((t=f==null?void 0:f.getBoundingClientRect())==null?void 0:t.height)??0)},children:e.jsx("tr",{children:e.jsx("td",{colSpan:n.getVisibleFlatColumns().length,children:p.isValidElement(C)&&C})})})},classNameContainer:c,fixedHeaderContent:()=>n.getHeaderGroups().map(f=>e.jsx("tr",{children:f.headers.map(t=>{var y,R,w,V;const s=(R=(y=t.column.columnDef.meta)==null?void 0:y.rowSpan)==null?void 0:R.call(y,t);return!t.isPlaceholder&&s!==void 0&&t.id===t.column.id?e.jsx(e.Fragment,{}):e.jsxs("th",{id:`${F(t)}-${t.id}`,colSpan:t.colSpan,rowSpan:s,style:{...typeof((w=t.column.columnDef.meta)==null?void 0:w.styleTh)=="function"?(V=t.column.columnDef.meta)==null?void 0:V.styleTh(t.column.columnDef):{},...A(t.column),...a.columns.includes(t.column.id)?{display:"none"}:{}},children:[t.isPlaceholder&&s===void 0?null:e.jsxs("div",{className:t.column.getCanSort()?P.default.sorting:"",onClick:t.column.getToggleSortingHandler(),id:t.column.getCanSort()?`${F(t)}-${t.id}-sort`:"",children:[q.flexRender(t.column.columnDef.header,t.getContext()),t.column.getCanSort()&&e.jsx("span",{className:"iru-flex-shrink-0",children:t.column.getIsSorted()==="asc"||t.column.getIsSorted()==="desc"?e.jsxs(e.Fragment,{children:[t.column.getIsSorted()==="asc"&&e.jsx(e.Fragment,{children:M}),t.column.getIsSorted()==="desc"&&e.jsx(e.Fragment,{children:W})]}):e.jsx(e.Fragment,{})})]}),t.column.getIsPinned()&&e.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:P.default["resize-menu"]})]},t.id)})},f.id)),itemContent:(f,t)=>{var y,R;const s=(R=(y=n.getRowModel())==null?void 0:y.rows)==null?void 0:R[t];return e.jsx(f,{children:({...w})=>{var V;return e.jsxs(p.Fragment,{children:[e.jsx("tr",{...w,onClick:r=>{r.stopPropagation(),g&&typeof i=="function"&&i(s.original,s)},className:g?T:"",id:N(s),children:s.getVisibleCells().map(r=>{var D,x,H;return e.jsx(e.Fragment,{children:e.jsx("td",{style:{...typeof((D=r.column.columnDef.meta)==null?void 0:D.styleTd)=="function"?r.column.columnDef.meta.styleTd(s.original,s):{},...A(r.column,!0),...a.columns.includes(r.column.id)?{display:"none"}:{}},className:typeof((x=r.column.columnDef.meta)==null?void 0:x.classNameTd)=="function"?(H=r.column.columnDef.meta)==null?void 0:H.classNameTd(s.original,s):"",id:`${N(s)}-${r.column.id}`,children:q.flexRender(r.column.columnDef.cell,r.getContext())},r.id)})})}),s.getIsExpanded()&&typeof d=="function"&&e.jsx("tr",{"data-sub-component":t,children:e.jsx("td",{colSpan:s.getVisibleCells().length-(((V=a==null?void 0:a.realColumns)==null?void 0:V.length)||0),children:d(s.original,s,{visibilityColumns:a,classNameSubMobile:j})})})]},s.id)}},s.id)},...m,minHeightItem:((m==null?void 0:m.minHeightItem)??60)+((((l=n.getRowModel().rows)==null?void 0:l.length)||0)>0?0:b),itemSizeNames:typeof d=="function"?[...(m==null?void 0:m.itemSizeNames)??[],"data-sub-component"]:m==null?void 0:m.itemSizeNames})},I=({tableInstance:n,classNameWrapperTable:c="",classNameTable:i="",collapseAll:g=!0,handlerRowClick:m,privillageRowClick:z=!1,virtualization:N=!1,virtualizationProps:F,headerId:$="",tbodyTrId:M=()=>"",theadTrId:W=()=>"",maxHeight:T=0,idCalculateHeight:C=void 0,kind:d="laba-reguler",componentSortASC:a,componentSortDESC:j,scrollTop:b=!1,emptyPlaceholder:u,variant:o,renderSubComponent:S,columnBreakpoints:l})=>{var V;const[f,t]=p.useState(0),[s,y]=p.useState({columns:[],realColumns:[]}),R=()=>{if(![void 0,"undefined"].includes(C)){const r=document.querySelector(`[data-calculate-height-header="${C}"]`);let D=0;const x=document.querySelectorAll(`[data-calculate-height^="${C}-"]`);return x==null||x.forEach(H=>{D+=H.offsetHeight}),D>T?T+r.offsetHeight:0}return T},w=()=>{var H;const r=((H=document.querySelector("body"))==null?void 0:H.offsetWidth)||0,D=l==null?void 0:l.sort((E,_)=>{const G=(E.maxWidth??E.minWidth)||0,J=(_.maxWidth??_.minWidth)||0;return G!==J?G-J:E.maxWidth?-1:1}),x=(D==null?void 0:D.find(E=>!!(Object.hasOwnProperty.call(E,"maxWidth")&&r<=(E.maxWidth||0)||Object.hasOwnProperty.call(E,"minWidth")&&r>=(E.minWidth||0))))||{};Object.keys(x).length>0?(y({columns:x.columns,realColumns:x.realColumns||x.columns}),x!=null&&x.resetExpanded&&n.resetExpanded()):y({columns:[],realColumns:[]})};return L.useDeepCompareEffect(()=>{!g&&typeof n.toggleAllRowsExpanded=="function"&&n.toggleAllRowsExpanded()},[g,n==null?void 0:n.toggleAllRowsExpanded]),L.useDeepCompareEffect(()=>{T>0&&t(R())},[(V=n==null?void 0:n.options)==null?void 0:V.data,T]),L.useDeepCompareEffect(()=>{if(Array.isArray(l)&&(l==null?void 0:l.length)>0)return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[l]),e.jsxs(e.Fragment,{children:[!N&&e.jsx(Y,{theadTrId:W,tbodyTrId:M,headerId:$,tableInstance:n,classNameTable:i,classNameWrapperTable:`${h.ConfigTable().kind[d]} ${o?h.ConfigTable().variant[o]:""}
2
- ${b?h.ConfigTable().utility["table-scroll-top"]:""} ${c}`,handlerRowClick:m,privillageRowClick:z,maxHeight:f,idCalculateHeight:C,componentSortASC:p.isValidElement(a)?a:h.ConfigTable().sortingIcon[d].asc,componentSortDESC:p.isValidElement(j)?j:h.ConfigTable().sortingIcon[d].desc,classNamePointer:h.ConfigTable().pointer[d],emptyPlaceholder:u,renderSubComponent:S,visibilityColumns:s,classNameSubMobile:h.ConfigTable().subMobile[d]}),N&&e.jsx(Z,{theadTrId:W,tbodyTrId:M,headerId:$,tableInstance:n,classNameTable:i,classNameWrapperTable:`${h.ConfigTable().kind[d]} ${o?h.ConfigTable().variant[o]:""}
3
- ${b?h.ConfigTable().utility["table-scroll-top"]:""} ${c}`,handlerRowClick:m,privillageRowClick:z,virtualizationProps:F,componentSortASC:p.isValidElement(a)?a:h.ConfigTable().sortingIcon[d].asc,componentSortDESC:p.isValidElement(j)?j:h.ConfigTable().sortingIcon[d].desc,classNamePointer:h.ConfigTable().pointer[d],emptyPlaceholder:u,renderSubComponent:S,visibilityColumns:s,classNameSubMobile:h.ConfigTable().subMobile[d]})]})};exports.VirtualizationHead=O;exports.VirtualizationTable=Q;exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),z=require("@tanstack/react-table"),f=require("react"),I=require("../Virtualization/TableVirtualization.cjs"),E=require("./Table.module.scss.cjs"),R=require("../../hooks/useDeepCompareEffect.cjs"),g=require("./Table.config.cjs"),G=(o,c)=>{let i={};return o&&(i={position:"sticky",top:0,zIndex:2}),c.column.columnDef.meta?.styleTh&&(i={...i,...c.column.columnDef.meta?.styleTh(c.column.columnDef)}),i},V=(o,c=!1)=>{const i=o.getIsPinned(),m=i==="left"&&o.getIsLastColumn("left"),r=i==="right"&&o.getIsFirstColumn("right");return i?{boxShadow:m?"-4px 0 4px -4px gray inset":r?"4px 0 4px -4px gray inset":void 0,left:i==="left"?`${o.getStart("left")}px`:void 0,right:i==="right"?`${o.getAfter("right")}px`:void 0,position:"sticky",width:o.getSize(),zIndex:1,background:c?"white":""}:{}},O=o=>{const c=o.columnPinning.left||[],i=o.columnPinning.right||[],m=o.rowPinning.top||[],r=o.rowPinning.bottom||[];return{left:c,right:i,top:m,bottom:r,isPinning:c.length>0||i.length>0||m.length>0||r.length>0}},J=({tableInstance:o,classNameWrapperTable:c,classNameTable:i,handlerRowClick:m,privillageRowClick:r,headerId:D,tbodyTrId:y,theadTrId:T,maxHeight:S,idCalculateHeight:C,componentSortASC:N,componentSortDESC:h,classNamePointer:j,emptyPlaceholder:u,renderSubComponent:d,visibilityColumns:x,classNameSubMobile:b})=>t.jsx("div",{id:"1ru-table",style:S?{height:S,overflow:"auto"}:{},className:c??"",children:t.jsxs("table",{className:i,style:{width:O(o.getState()).isPinning?o.getCenterTotalSize():""},children:[t.jsx("thead",{id:D,"data-calculate-height-header":C,children:o.getHeaderGroups().map(s=>t.jsx("tr",{children:s.headers.map(n=>{const e=n.column.columnDef.meta?.rowSpan?.(n);return!n.isPlaceholder&&e!==void 0&&n.id===n.column.id?t.jsx(t.Fragment,{}):t.jsxs("th",{style:{...G(S,n),...V(n.column),...x.columns.includes(n.column.id)?{display:"none"}:{}},id:`${T(n)}-${n.id}`,colSpan:typeof n.column.columnDef.meta?.colSpan=="function"?n.column.columnDef.meta?.colSpan(n.column.columnDef):n.colSpan,rowSpan:e,children:[n.isPlaceholder&&e===void 0?null:t.jsxs("div",{className:n.column.getCanSort()?E.default.sorting:"",onClick:n.column.getToggleSortingHandler(),id:n.column.getCanSort()?`${T(n)}-${n.id}-sort`:"",children:[z.flexRender(n.column.columnDef.header,n.getContext()),n.column.getCanSort()&&t.jsx("span",{className:"iru-flex-shrink-0",children:n.column.getIsSorted()==="asc"||n.column.getIsSorted()==="desc"?t.jsxs(t.Fragment,{children:[n.column.getIsSorted()==="asc"&&t.jsx(t.Fragment,{children:N}),n.column.getIsSorted()==="desc"&&t.jsx(t.Fragment,{children:h})]}):t.jsx(t.Fragment,{})})]}),n.column.getIsPinned()&&t.jsx("div",{onDoubleClick:()=>n.column.resetSize(),onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler(),className:E.default["resize-menu"]})]},n.id)})},s.id))}),t.jsxs("tbody",{children:[o.getRowModel().rows.length>0&&o.getRowModel().rows.map((s,n)=>t.jsxs(f.Fragment,{children:[t.jsx("tr",{onClick:e=>{e.stopPropagation(),r&&typeof m=="function"&&m(s.original,s)},className:r?j:"","data-calculate-height":`${C}-${n}`,id:y(s),children:s.getVisibleCells().map(e=>t.jsx("td",{style:{...typeof e.column.columnDef.meta?.styleTd=="function"?e.column.columnDef.meta.styleTd(s.original,s):{},...V(e.column,!0),...x.columns.includes(e.column.id)?{display:"none"}:{}},className:typeof e.column.columnDef.meta?.classNameTd=="function"?e.column.columnDef.meta?.classNameTd(s.original,s):"",id:`${y(s)}-${e.column.id}`,children:z.flexRender(e.column.columnDef.cell,e.getContext())},e.id))},s.id),s.getIsExpanded()&&typeof d=="function"&&t.jsx("tr",{children:t.jsx("td",{colSpan:s.getVisibleCells().length-(x?.realColumns?.length||0),children:d(s.original,s,{visibilityColumns:x,classNameSubMobile:b})})})]},s.id)),o.getRowModel().rows.length===0&&f.isValidElement(u)&&t.jsx("tr",{children:t.jsx("td",{colSpan:o.getVisibleFlatColumns().length,children:u})})]})]})}),H=f.forwardRef((o,c)=>{const{context:i,...m}=o;return t.jsx("thead",{id:i?.headerId??"",...m,ref:c})});H.displayName="VirtualizationHead";const _=({style:o,context:c,...i})=>t.jsx("table",{...i,id:"1ru-table",className:c?.classNameTable??"",style:{...o,width:c?.width}}),K=({tableInstance:o,classNameWrapperTable:c,handlerRowClick:i,privillageRowClick:m,virtualizationProps:r,headerId:D,tbodyTrId:y,theadTrId:T,classNameTable:S,componentSortASC:C,componentSortDESC:N,classNamePointer:h,emptyPlaceholder:j,renderSubComponent:u,visibilityColumns:d,classNameSubMobile:x})=>{const[b,s]=f.useState(0);return t.jsx(I.default,{context:{headerId:D,classNameTable:S,width:O(o.getState()).isPinning?o.getCenterTotalSize():""},typeHight:"min-max",totalCount:o.getRowModel().rows?.length||0,minLengthItem:o.getRowModel().rows?.length||0,typeCalculateItemSize:"auto",component:{TableHead:H,Table:_,EmptyPlaceholder:()=>t.jsx("tbody",{ref:n=>s(n?.getBoundingClientRect()?.height??0),children:t.jsx("tr",{children:t.jsx("td",{colSpan:o.getVisibleFlatColumns().length,children:f.isValidElement(j)&&j})})})},classNameContainer:c,fixedHeaderContent:()=>o.getHeaderGroups().map(n=>t.jsx("tr",{children:n.headers.map(e=>{const l=e.column.columnDef.meta?.rowSpan?.(e);return!e.isPlaceholder&&l!==void 0&&e.id===e.column.id?t.jsx(t.Fragment,{}):t.jsxs("th",{id:`${T(e)}-${e.id}`,colSpan:e.colSpan,rowSpan:l,style:{...typeof e.column.columnDef.meta?.styleTh=="function"?e.column.columnDef.meta?.styleTh(e.column.columnDef):{},...V(e.column),...d.columns.includes(e.column.id)?{display:"none"}:{}},children:[e.isPlaceholder&&l===void 0?null:t.jsxs("div",{className:e.column.getCanSort()?E.default.sorting:"",onClick:e.column.getToggleSortingHandler(),id:e.column.getCanSort()?`${T(e)}-${e.id}-sort`:"",children:[z.flexRender(e.column.columnDef.header,e.getContext()),e.column.getCanSort()&&t.jsx("span",{className:"iru-flex-shrink-0",children:e.column.getIsSorted()==="asc"||e.column.getIsSorted()==="desc"?t.jsxs(t.Fragment,{children:[e.column.getIsSorted()==="asc"&&t.jsx(t.Fragment,{children:C}),e.column.getIsSorted()==="desc"&&t.jsx(t.Fragment,{children:N})]}):t.jsx(t.Fragment,{})})]}),e.column.getIsPinned()&&t.jsx("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:E.default["resize-menu"]})]},e.id)})},n.id)),itemContent:(n,e)=>{const l=o.getRowModel()?.rows?.[e];return t.jsx(n,{children:({...P})=>t.jsxs(f.Fragment,{children:[t.jsx("tr",{...P,onClick:a=>{a.stopPropagation(),m&&typeof i=="function"&&i(l.original,l)},className:m?h:"",id:y(l),children:l.getVisibleCells().map(a=>t.jsx(t.Fragment,{children:t.jsx("td",{style:{...typeof a.column.columnDef.meta?.styleTd=="function"?a.column.columnDef.meta.styleTd(l.original,l):{},...V(a.column,!0),...d.columns.includes(a.column.id)?{display:"none"}:{}},className:typeof a.column.columnDef.meta?.classNameTd=="function"?a.column.columnDef.meta?.classNameTd(l.original,l):"",id:`${y(l)}-${a.column.id}`,children:z.flexRender(a.column.columnDef.cell,a.getContext())},a.id)}))}),l.getIsExpanded()&&typeof u=="function"&&t.jsx("tr",{"data-sub-component":e,children:t.jsx("td",{colSpan:l.getVisibleCells().length-(d?.realColumns?.length||0),children:u(l.original,l,{visibilityColumns:d,classNameSubMobile:x})})})]},l.id)},l.id)},...r,minHeightItem:(r?.minHeightItem??60)+((o.getRowModel().rows?.length||0)>0?0:b),itemSizeNames:typeof u=="function"?[...r?.itemSizeNames??[],"data-sub-component"]:r?.itemSizeNames})},Q=({tableInstance:o,classNameWrapperTable:c="",classNameTable:i="",collapseAll:m=!0,handlerRowClick:r,privillageRowClick:D=!1,virtualization:y=!1,virtualizationProps:T,headerId:S="",tbodyTrId:C=()=>"",theadTrId:N=()=>"",maxHeight:h=0,idCalculateHeight:j=void 0,kind:u="laba-reguler",componentSortASC:d,componentSortDESC:x,scrollTop:b=!1,emptyPlaceholder:s,variant:n,renderSubComponent:e,columnBreakpoints:l})=>{const[P,a]=f.useState(0),[W,q]=f.useState({columns:[],realColumns:[]}),B=()=>{if(![void 0,"undefined"].includes(j)){const w=document.querySelector(`[data-calculate-height-header="${j}"]`);let M=0;return document.querySelectorAll(`[data-calculate-height^="${j}-"]`)?.forEach(p=>{M+=p.offsetHeight}),M>h?h+w.offsetHeight:0}return h},F=()=>{const w=document.querySelector("body")?.offsetWidth||0,$=l?.sort((p,v)=>{const A=(p.maxWidth??p.minWidth)||0,L=(v.maxWidth??v.minWidth)||0;return A!==L?A-L:p.maxWidth?-1:1})?.find(p=>!!(Object.hasOwnProperty.call(p,"maxWidth")&&w<=(p.maxWidth||0)||Object.hasOwnProperty.call(p,"minWidth")&&w>=(p.minWidth||0)))||{};Object.keys($).length>0?(q({columns:$.columns,realColumns:$.realColumns||$.columns}),$?.resetExpanded&&o.resetExpanded()):q({columns:[],realColumns:[]})};return R.useDeepCompareEffect(()=>{!m&&typeof o.toggleAllRowsExpanded=="function"&&o.toggleAllRowsExpanded()},[m,o?.toggleAllRowsExpanded]),R.useDeepCompareEffect(()=>{h>0&&a(B())},[o?.options?.data,h]),R.useDeepCompareEffect(()=>{if(Array.isArray(l)&&l?.length>0)return F(),window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[l]),t.jsxs(t.Fragment,{children:[!y&&t.jsx(J,{theadTrId:N,tbodyTrId:C,headerId:S,tableInstance:o,classNameTable:i,classNameWrapperTable:`${g.ConfigTable().kind[u]} ${n?g.ConfigTable().variant[n]:""}
2
+ ${b?g.ConfigTable().utility["table-scroll-top"]:""} ${c}`,handlerRowClick:r,privillageRowClick:D,maxHeight:P,idCalculateHeight:j,componentSortASC:f.isValidElement(d)?d:g.ConfigTable().sortingIcon[u].asc,componentSortDESC:f.isValidElement(x)?x:g.ConfigTable().sortingIcon[u].desc,classNamePointer:g.ConfigTable().pointer[u],emptyPlaceholder:s,renderSubComponent:e,visibilityColumns:W,classNameSubMobile:g.ConfigTable().subMobile[u]}),y&&t.jsx(K,{theadTrId:N,tbodyTrId:C,headerId:S,tableInstance:o,classNameTable:i,classNameWrapperTable:`${g.ConfigTable().kind[u]} ${n?g.ConfigTable().variant[n]:""}
3
+ ${b?g.ConfigTable().utility["table-scroll-top"]:""} ${c}`,handlerRowClick:r,privillageRowClick:D,virtualizationProps:T,componentSortASC:f.isValidElement(d)?d:g.ConfigTable().sortingIcon[u].asc,componentSortDESC:f.isValidElement(x)?x:g.ConfigTable().sortingIcon[u].desc,classNamePointer:g.ConfigTable().pointer[u],emptyPlaceholder:s,renderSubComponent:e,visibilityColumns:W,classNameSubMobile:g.ConfigTable().subMobile[u]})]})};exports.VirtualizationHead=H;exports.VirtualizationTable=_;exports.default=Q;