1mpacto-react-ui 2.0.20 → 2.0.21
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/assets/style.css +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.mjs +40 -40
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
- package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
- package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.mjs +98 -100
- package/dist/components/Calendar/CalendarMonth.cjs +1 -1
- package/dist/components/Calendar/CalendarMonth.mjs +41 -42
- package/dist/components/Calendar/CalendarRange.cjs +1 -1
- package/dist/components/Calendar/CalendarRange.mjs +59 -61
- package/dist/components/Calendar/CalendarYear.cjs +2 -2
- package/dist/components/Calendar/CalendarYear.mjs +37 -38
- package/dist/components/Chart/DoughnutChart.cjs +1 -1
- package/dist/components/Chart/DoughnutChart.mjs +93 -96
- package/dist/components/Chart/GradientBarChart.cjs +1 -1
- package/dist/components/Chart/GradientBarChart.mjs +80 -81
- package/dist/components/Chart/GradientLineChart.cjs +1 -1
- package/dist/components/Chart/GradientLineChart.mjs +50 -51
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.mjs +23 -23
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.mjs +45 -48
- package/dist/components/Collapse/Collapse.cjs +1 -1
- package/dist/components/Collapse/Collapse.mjs +23 -24
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +86 -89
- package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
- package/dist/components/DatePicker/FilterDate.cjs +1 -1
- package/dist/components/DatePicker/FilterDate.mjs +107 -110
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
- package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
- package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
- package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
- package/dist/components/Input/InputFloatingInner.cjs +5 -5
- package/dist/components/Input/InputFloatingInner.mjs +24 -25
- package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
- package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
- package/dist/components/Pagination/Pagination.cjs +2 -2
- package/dist/components/Pagination/Pagination.mjs +76 -80
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
- package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
- package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.mjs +65 -68
- package/dist/components/Step/Step.cjs +5 -5
- package/dist/components/Step/Step.mjs +52 -52
- package/dist/components/Table/Table.cjs +3 -3
- package/dist/components/Table/Table.mjs +275 -298
- package/dist/components/Table/TableSubMobile.cjs +1 -1
- package/dist/components/Table/TableSubMobile.mjs +32 -35
- package/dist/components/Tabs/Tabs.cjs +8 -8
- package/dist/components/Tabs/Tabs.mjs +66 -70
- package/dist/components/Textarea/Textarea.cjs +7 -7
- package/dist/components/Textarea/Textarea.mjs +47 -50
- package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
- package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
- package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
- package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
- package/dist/components/TimeRange/TimeRange.cjs +1 -1
- package/dist/components/TimeRange/TimeRange.mjs +88 -91
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.mjs +44 -46
- package/dist/components/Upload/UploadFile.cjs +1 -1
- package/dist/components/Upload/UploadFile.mjs +50 -54
- package/dist/components/Upload/UploadImage.cjs +3 -3
- package/dist/components/Upload/UploadImage.mjs +62 -68
- package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
- package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
- package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
- package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
- package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
- package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
- package/dist/config/components/tinymce.cjs +2 -2
- package/dist/config/components/tinymce.mjs +3 -3
- package/dist/hooks/useCountdown.cjs +1 -1
- package/dist/hooks/useCountdown.mjs +15 -15
- package/dist/hooks/useDebounce.cjs +1 -1
- package/dist/hooks/useDebounce.mjs +19 -19
- package/dist/hooks/useOtpInput.cjs +1 -1
- package/dist/hooks/useOtpInput.mjs +47 -51
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +5 -4
- package/dist/package.json.mjs +1 -1
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +172 -173
- package/package.json +4 -4
|
@@ -1,85 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { parseFileName as
|
|
7
|
-
const
|
|
8
|
-
value:
|
|
9
|
-
validateFile:
|
|
10
|
-
classNameContainer:
|
|
11
|
-
classNameButton:
|
|
12
|
-
textUpload:
|
|
13
|
-
buttonProps:
|
|
14
|
-
maxFile:
|
|
15
|
-
maxSize:
|
|
16
|
-
error:
|
|
17
|
-
removeElement:
|
|
18
|
-
onChange:
|
|
19
|
-
handlerDownload:
|
|
20
|
-
priorityError:
|
|
21
|
-
eventError:
|
|
22
|
-
locationRemoveElement:
|
|
23
|
-
idItemAttachment:
|
|
1
|
+
import { jsxs as o, jsx as t, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import b from "react";
|
|
3
|
+
import S from "../Button/Button.mjs";
|
|
4
|
+
import r from "./UploadMultipleFile.module.scss.mjs";
|
|
5
|
+
import T from "../Input/InputNative.mjs";
|
|
6
|
+
import { parseFileName as $ } from "../../utils/common.mjs";
|
|
7
|
+
const O = ({
|
|
8
|
+
value: j,
|
|
9
|
+
validateFile: f,
|
|
10
|
+
classNameContainer: B,
|
|
11
|
+
classNameButton: M,
|
|
12
|
+
textUpload: v = "Unggah Lampiran",
|
|
13
|
+
buttonProps: C = {},
|
|
14
|
+
maxFile: p = 1,
|
|
15
|
+
maxSize: m = 1,
|
|
16
|
+
error: u,
|
|
17
|
+
removeElement: n,
|
|
18
|
+
onChange: h,
|
|
19
|
+
handlerDownload: g,
|
|
20
|
+
priorityError: F = "external",
|
|
21
|
+
eventError: U,
|
|
22
|
+
locationRemoveElement: d = "right",
|
|
23
|
+
idItemAttachment: x
|
|
24
24
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
internal:
|
|
27
|
-
external:
|
|
28
|
-
},
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
|
|
25
|
+
const z = { variants: "ghost-laba-blue-10", size: "small" }, a = b.useRef(null), k = f || ["image/png", "image/jpeg", "image/jpg"], [N, P] = b.useState(""), R = {
|
|
26
|
+
internal: N || u,
|
|
27
|
+
external: u || N
|
|
28
|
+
}, A = (e) => {
|
|
29
|
+
if (e?.length) {
|
|
30
|
+
const i = Array.from(e).slice(0, p), l = i?.filter((c) => !k.includes(c.type)), J = i?.reduce((c, L) => c + L.size, 0) / 1024 / 1024;
|
|
31
|
+
let s = "";
|
|
32
|
+
if (l.length > 0 ? s = "Berkas tidak didukung, silahkan pilih file kembali." : J > m ? s = `${e.length > 1 ? "Jumlah u" : "U"}kuran berkas tidak boleh melebihi ${m}MB.` : typeof h == "function" && h(i), P(s), U?.(s), !a?.current) return;
|
|
33
|
+
a.current.value = "";
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
t.preventDefault(), s != null && s.current && ((n = s.current) == null || n.click());
|
|
35
|
+
}, I = (e) => {
|
|
36
|
+
e.preventDefault(), a?.current && a.current?.click();
|
|
38
37
|
};
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
38
|
+
return /* @__PURE__ */ o("div", { className: `${r.container} ${B ?? ""}`, children: [
|
|
39
|
+
/* @__PURE__ */ t(
|
|
40
|
+
S,
|
|
42
41
|
{
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
className:
|
|
46
|
-
onClick: (
|
|
47
|
-
children:
|
|
42
|
+
...z,
|
|
43
|
+
...C,
|
|
44
|
+
className: M ?? "",
|
|
45
|
+
onClick: (e) => I(e),
|
|
46
|
+
children: v
|
|
48
47
|
}
|
|
49
48
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
49
|
+
/* @__PURE__ */ t(
|
|
50
|
+
T,
|
|
52
51
|
{
|
|
53
|
-
accept:
|
|
54
|
-
ref:
|
|
52
|
+
accept: k?.join(", "),
|
|
53
|
+
ref: a,
|
|
55
54
|
type: "file",
|
|
56
|
-
onChange: (
|
|
57
|
-
error:
|
|
58
|
-
multiple:
|
|
55
|
+
onChange: (e) => A(e.target.files),
|
|
56
|
+
error: R[F],
|
|
57
|
+
multiple: p > 1,
|
|
59
58
|
hidden: !0
|
|
60
59
|
}
|
|
61
60
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ t("div", { className: r.files, children: j?.map((e, i) => /* @__PURE__ */ o(
|
|
63
62
|
"div",
|
|
64
63
|
{
|
|
65
|
-
id: `${
|
|
66
|
-
className:
|
|
67
|
-
onClick: (
|
|
68
|
-
|
|
64
|
+
id: `${x}-${i}`,
|
|
65
|
+
className: r.file,
|
|
66
|
+
onClick: (l) => {
|
|
67
|
+
l.stopPropagation(), typeof g == "function" && g(e);
|
|
69
68
|
},
|
|
70
69
|
children: [
|
|
71
|
-
typeof
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
70
|
+
typeof n == "function" && d === "left" && /* @__PURE__ */ t(y, { children: n(e, i) }),
|
|
71
|
+
/* @__PURE__ */ o("div", { className: r["file-name-wrapper"], children: [
|
|
72
|
+
/* @__PURE__ */ t("span", { className: r["file-name"], children: $(e?.originalName ?? e?.name ?? e?.fileName ?? "").filename }),
|
|
73
|
+
/* @__PURE__ */ t("span", { className: r["file-extension"], children: $(e?.originalName ?? e?.name ?? e?.fileName ?? "").extension })
|
|
75
74
|
] }),
|
|
76
|
-
typeof
|
|
75
|
+
typeof n == "function" && d === "right" && /* @__PURE__ */ t(y, { children: n(e, i) })
|
|
77
76
|
]
|
|
78
77
|
},
|
|
79
|
-
|
|
78
|
+
i
|
|
80
79
|
)) })
|
|
81
80
|
] });
|
|
82
81
|
};
|
|
83
82
|
export {
|
|
84
|
-
|
|
83
|
+
O as default
|
|
85
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),o=require("react"),N=require("react-virtuoso"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),o=require("react"),N=require("react-virtuoso"),F=({children:i,...r})=>n.jsx(n.Fragment,{children:i(r)}),$=({children:i,...r})=>n.jsx(n.Fragment,{children:o.isValidElement(i)&&n.jsx(n.Fragment,{children:o.cloneElement(i,r)})}),f=o.forwardRef((i,r)=>{const{classNameContainer:C="",computeItemKey:p=()=>"",itemSize:w=()=>0,totalCount:s=0,typeHight:t="min-max",minHeightItem:x=0,maxHeightTable:l=0,minLengthItem:y=0,itemContent:v,typeCalculateItemSize:H="manual",itemSizeNames:z=[],overscan:u=null,component:E={},idContainer:m="",triggerCalCulateContainer:S="",accumulationHeight:L=0,delayTriggerCalculateHeight:j=0,increaseViewportBy:R=()=>0,context:V={},endReached:I,increaseTotalCount:d=1}=i,[a,g]=o.useState(0),T=()=>{if(t==="min-max"){const e=(s+d)*x;return{height:s>y?l:a>e?a:e}}return t==="container"?{height:a}:{}},b=e=>{const B=e.getAttribute("data-index");let h=e.getBoundingClientRect()?.height||0;return z?.forEach(q=>{h+=document.querySelector(`[${q}="${B}"]`)?.getBoundingClientRect()?.height??0}),h},c=()=>{if(m&&t==="container"){const e=document?.getElementById(m)?.offsetHeight??0;g(e-L)}};return o.useEffect(()=>{const e=setTimeout(c,j);return window?.addEventListener("resize",c),window?.addEventListener("load",c),()=>{clearTimeout(e),window?.removeEventListener("resize",c),window?.removeEventListener("load",c)}},[t,S]),n.jsx("div",{className:`iru-w-full ${C}`,children:n.jsx(N.Virtuoso,{context:V,ref:r,overscan:typeof u=="function"?u(t==="container"?a:l):t==="container"?a:l,totalListHeightChanged:e=>t==="min-max"?g(e):null,style:T(),totalCount:s,computeItemKey:p,itemSize:o.useCallback(e=>H==="manual"?w(e):b(e),[]),itemContent:(...e)=>v(F,...e),components:{Item:$,...E},endReached:I,increaseViewportBy:R(t==="container"?a:l)})})});f.displayName="ListVirtualization";exports.default=f;
|
|
@@ -1,82 +1,79 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Virtuoso as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $, useState as W, useEffect as j, useCallback as k, isValidElement as q, cloneElement as A } from "react";
|
|
3
|
+
import { Virtuoso as F } from "react-virtuoso";
|
|
4
|
+
const K = ({ children: n, ...o }) => /* @__PURE__ */ r(m, { children: n(o) }), D = ({ children: n, ...o }) => /* @__PURE__ */ r(m, { children: q(n) && /* @__PURE__ */ r(m, { children: A(n, o) }) }), G = $((n, o) => {
|
|
5
5
|
const {
|
|
6
|
-
classNameContainer:
|
|
7
|
-
computeItemKey:
|
|
8
|
-
itemSize:
|
|
6
|
+
classNameContainer: f = "",
|
|
7
|
+
computeItemKey: p = () => "",
|
|
8
|
+
itemSize: C = () => 0,
|
|
9
9
|
totalCount: c = 0,
|
|
10
10
|
typeHight: t = "min-max",
|
|
11
|
-
minHeightItem:
|
|
11
|
+
minHeightItem: w = 0,
|
|
12
12
|
maxHeightTable: l = 0,
|
|
13
|
-
minLengthItem:
|
|
14
|
-
itemContent:
|
|
15
|
-
typeCalculateItemSize:
|
|
16
|
-
itemSizeNames:
|
|
17
|
-
overscan:
|
|
18
|
-
component:
|
|
19
|
-
idContainer:
|
|
20
|
-
triggerCalCulateContainer:
|
|
21
|
-
accumulationHeight:
|
|
13
|
+
minLengthItem: y = 0,
|
|
14
|
+
itemContent: H,
|
|
15
|
+
typeCalculateItemSize: z = "manual",
|
|
16
|
+
itemSizeNames: v = [],
|
|
17
|
+
overscan: s = null,
|
|
18
|
+
component: x = {},
|
|
19
|
+
idContainer: u = "",
|
|
20
|
+
triggerCalCulateContainer: E = "",
|
|
21
|
+
accumulationHeight: L = 0,
|
|
22
22
|
delayTriggerCalculateHeight: S = 0,
|
|
23
|
-
increaseViewportBy:
|
|
24
|
-
context:
|
|
25
|
-
endReached:
|
|
26
|
-
increaseTotalCount:
|
|
27
|
-
} = n, [i,
|
|
23
|
+
increaseViewportBy: I = () => 0,
|
|
24
|
+
context: V = {},
|
|
25
|
+
endReached: B,
|
|
26
|
+
increaseTotalCount: d = 1
|
|
27
|
+
} = n, [i, h] = W(0), R = () => {
|
|
28
28
|
if (t === "min-max") {
|
|
29
|
-
const e = (c +
|
|
30
|
-
return { height: c >
|
|
29
|
+
const e = (c + d) * w;
|
|
30
|
+
return { height: c > y ? l : i > e ? i : e };
|
|
31
31
|
}
|
|
32
32
|
return t === "container" ? { height: i } : {};
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
p += ((y = (w = document.querySelector(`[${j}="${m}"]`)) == null ? void 0 : w.getBoundingClientRect()) == null ? void 0 : y.height) ?? 0;
|
|
40
|
-
}), p;
|
|
33
|
+
}, T = (e) => {
|
|
34
|
+
const N = e.getAttribute("data-index");
|
|
35
|
+
let g = e.getBoundingClientRect()?.height || 0;
|
|
36
|
+
return v?.forEach((b) => {
|
|
37
|
+
g += document.querySelector(`[${b}="${N}"]`)?.getBoundingClientRect()?.height ?? 0;
|
|
38
|
+
}), g;
|
|
41
39
|
}, a = () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
f(m - R);
|
|
40
|
+
if (u && t === "container") {
|
|
41
|
+
const e = document?.getElementById(u)?.offsetHeight ?? 0;
|
|
42
|
+
h(e - L);
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
|
-
return
|
|
45
|
+
return j(() => {
|
|
49
46
|
const e = setTimeout(a, S);
|
|
50
|
-
return window
|
|
51
|
-
clearTimeout(e), window
|
|
47
|
+
return window?.addEventListener("resize", a), window?.addEventListener("load", a), () => {
|
|
48
|
+
clearTimeout(e), window?.removeEventListener("resize", a), window?.removeEventListener("load", a);
|
|
52
49
|
};
|
|
53
|
-
}, [t,
|
|
54
|
-
|
|
50
|
+
}, [t, E]), /* @__PURE__ */ r("div", { className: `iru-w-full ${f}`, children: /* @__PURE__ */ r(
|
|
51
|
+
F,
|
|
55
52
|
{
|
|
56
|
-
context:
|
|
53
|
+
context: V,
|
|
57
54
|
ref: o,
|
|
58
|
-
overscan: typeof
|
|
59
|
-
totalListHeightChanged: (e) => t === "min-max" ?
|
|
60
|
-
style:
|
|
55
|
+
overscan: typeof s == "function" ? s(t === "container" ? i : l) : t === "container" ? i : l,
|
|
56
|
+
totalListHeightChanged: (e) => t === "min-max" ? h(e) : null,
|
|
57
|
+
style: R(),
|
|
61
58
|
totalCount: c,
|
|
62
|
-
computeItemKey:
|
|
63
|
-
itemSize:
|
|
64
|
-
(e) =>
|
|
59
|
+
computeItemKey: p,
|
|
60
|
+
itemSize: k(
|
|
61
|
+
(e) => z === "manual" ? C(e) : T(e),
|
|
65
62
|
[]
|
|
66
63
|
),
|
|
67
|
-
itemContent: (...e) =>
|
|
64
|
+
itemContent: (...e) => H(K, ...e),
|
|
68
65
|
components: {
|
|
69
66
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
70
67
|
// @ts-ignore
|
|
71
|
-
Item:
|
|
72
|
-
...
|
|
68
|
+
Item: D,
|
|
69
|
+
...x
|
|
73
70
|
},
|
|
74
|
-
endReached:
|
|
75
|
-
increaseViewportBy:
|
|
71
|
+
endReached: B,
|
|
72
|
+
increaseViewportBy: I(t === "container" ? i : l)
|
|
76
73
|
}
|
|
77
74
|
) });
|
|
78
75
|
});
|
|
79
|
-
|
|
76
|
+
G.displayName = "ListVirtualization";
|
|
80
77
|
export {
|
|
81
|
-
|
|
78
|
+
G as default
|
|
82
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),o=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),o=require("react"),F=require("react-virtuoso"),$=({children:i,...r})=>n.jsx(n.Fragment,{children:i(r)}),M=({children:i,...r})=>n.jsx(n.Fragment,{children:o.isValidElement(i)&&n.jsx(n.Fragment,{children:o.cloneElement(i,r)})}),f=o.forwardRef((i,r)=>{const{classNameContainer:C="",computeItemKey:w=()=>"",itemSize:x=()=>0,totalCount:l=0,typeHight:t="min-max",minHeightItem:p=0,maxHeightTable:s=0,minLengthItem:y=0,fixedHeaderContent:H,itemContent:v,typeCalculateItemSize:z="manual",itemSizeNames:T=[],overscan:u=null,component:b={},idContainer:m="",triggerCalCulateContainer:E="",accumulationHeight:S=0,delayTriggerCalculateHeight:R=0,increaseViewportBy:j=()=>0,context:V={},endReached:L,increaseTotalCount:d=1}=i,[a,g]=o.useState(0),B=()=>{if(t==="min-max"){const e=(l+d)*p;return{height:l>y?s:a>e?a:e}}return t==="container"?{height:a}:{}},I=e=>{const q=e.getAttribute("data-index");let h=e.getBoundingClientRect()?.height||0;return T?.forEach(N=>{h+=document.querySelector(`[${N}="${q}"]`)?.getBoundingClientRect()?.height??0}),h},c=()=>{if(m&&t==="container"){const e=document?.getElementById(m)?.offsetHeight??0;g(e-S)}};return o.useEffect(()=>{const e=setTimeout(c,R);return window?.addEventListener("resize",c),window?.addEventListener("load",c),()=>{clearTimeout(e),window?.removeEventListener("resize",c),window?.removeEventListener("load",c)}},[t,E]),n.jsx("div",{className:`iru-w-full ${C}`,children:n.jsx(F.TableVirtuoso,{context:V,ref:r,overscan:typeof u=="function"?u(t==="container"?a:s):t==="container"?a:s,totalListHeightChanged:e=>t==="min-max"?g(e):null,style:B(),totalCount:l,computeItemKey:w,itemSize:o.useCallback(e=>z==="manual"?x(e):I(e),[]),components:{TableRow:M,...b},fixedHeaderContent:H,itemContent:(...e)=>v($,...e),endReached:L,increaseViewportBy:j(t==="container"?a:s)})})});f.displayName="TableVirtualization";exports.default=f;
|
|
@@ -1,84 +1,81 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { TableVirtuoso as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as W, useState as j, useEffect as k, useCallback as q, isValidElement as A, cloneElement as F } from "react";
|
|
3
|
+
import { TableVirtuoso as K } from "react-virtuoso";
|
|
4
|
+
const D = ({ children: n, ...a }) => /* @__PURE__ */ r(m, { children: n(a) }), G = ({ children: n, ...a }) => /* @__PURE__ */ r(m, { children: A(n) && /* @__PURE__ */ r(m, { children: F(n, a) }) }), J = W((n, a) => {
|
|
5
5
|
const {
|
|
6
|
-
classNameContainer:
|
|
7
|
-
computeItemKey:
|
|
8
|
-
itemSize:
|
|
6
|
+
classNameContainer: f = "",
|
|
7
|
+
computeItemKey: p = () => "",
|
|
8
|
+
itemSize: C = () => 0,
|
|
9
9
|
totalCount: c = 0,
|
|
10
10
|
typeHight: t = "min-max",
|
|
11
|
-
minHeightItem:
|
|
11
|
+
minHeightItem: w = 0,
|
|
12
12
|
maxHeightTable: l = 0,
|
|
13
|
-
minLengthItem:
|
|
14
|
-
fixedHeaderContent:
|
|
15
|
-
itemContent:
|
|
16
|
-
typeCalculateItemSize:
|
|
17
|
-
itemSizeNames:
|
|
18
|
-
overscan:
|
|
19
|
-
component:
|
|
20
|
-
idContainer:
|
|
21
|
-
triggerCalCulateContainer:
|
|
22
|
-
accumulationHeight:
|
|
23
|
-
delayTriggerCalculateHeight:
|
|
24
|
-
increaseViewportBy:
|
|
25
|
-
context:
|
|
26
|
-
endReached:
|
|
27
|
-
increaseTotalCount:
|
|
28
|
-
} = n, [i,
|
|
13
|
+
minLengthItem: y = 0,
|
|
14
|
+
fixedHeaderContent: H,
|
|
15
|
+
itemContent: x,
|
|
16
|
+
typeCalculateItemSize: z = "manual",
|
|
17
|
+
itemSizeNames: v = [],
|
|
18
|
+
overscan: s = null,
|
|
19
|
+
component: E = {},
|
|
20
|
+
idContainer: u = "",
|
|
21
|
+
triggerCalCulateContainer: T = "",
|
|
22
|
+
accumulationHeight: b = 0,
|
|
23
|
+
delayTriggerCalculateHeight: S = 0,
|
|
24
|
+
increaseViewportBy: L = () => 0,
|
|
25
|
+
context: R = {},
|
|
26
|
+
endReached: V,
|
|
27
|
+
increaseTotalCount: d = 1
|
|
28
|
+
} = n, [i, h] = j(0), B = () => {
|
|
29
29
|
if (t === "min-max") {
|
|
30
|
-
const e = (c +
|
|
31
|
-
return { height: c >
|
|
30
|
+
const e = (c + d) * w;
|
|
31
|
+
return { height: c > y ? l : i > e ? i : e };
|
|
32
32
|
}
|
|
33
33
|
return t === "container" ? { height: i } : {};
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
p += ((y = (w = document.querySelector(`[${k}="${s}"]`)) == null ? void 0 : w.getBoundingClientRect()) == null ? void 0 : y.height) ?? 0;
|
|
41
|
-
}), p;
|
|
34
|
+
}, I = (e) => {
|
|
35
|
+
const N = e.getAttribute("data-index");
|
|
36
|
+
let g = e.getBoundingClientRect()?.height || 0;
|
|
37
|
+
return v?.forEach(($) => {
|
|
38
|
+
g += document.querySelector(`[${$}="${N}"]`)?.getBoundingClientRect()?.height ?? 0;
|
|
39
|
+
}), g;
|
|
42
40
|
}, o = () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
f(s - B);
|
|
41
|
+
if (u && t === "container") {
|
|
42
|
+
const e = document?.getElementById(u)?.offsetHeight ?? 0;
|
|
43
|
+
h(e - b);
|
|
47
44
|
}
|
|
48
45
|
};
|
|
49
|
-
return
|
|
50
|
-
const e = setTimeout(o,
|
|
51
|
-
return window
|
|
52
|
-
clearTimeout(e), window
|
|
46
|
+
return k(() => {
|
|
47
|
+
const e = setTimeout(o, S);
|
|
48
|
+
return window?.addEventListener("resize", o), window?.addEventListener("load", o), () => {
|
|
49
|
+
clearTimeout(e), window?.removeEventListener("resize", o), window?.removeEventListener("load", o);
|
|
53
50
|
};
|
|
54
|
-
}, [t,
|
|
55
|
-
|
|
51
|
+
}, [t, T]), /* @__PURE__ */ r("div", { className: `iru-w-full ${f}`, children: /* @__PURE__ */ r(
|
|
52
|
+
K,
|
|
56
53
|
{
|
|
57
|
-
context:
|
|
54
|
+
context: R,
|
|
58
55
|
ref: a,
|
|
59
|
-
overscan: typeof
|
|
60
|
-
totalListHeightChanged: (e) => t === "min-max" ?
|
|
61
|
-
style:
|
|
56
|
+
overscan: typeof s == "function" ? s(t === "container" ? i : l) : t === "container" ? i : l,
|
|
57
|
+
totalListHeightChanged: (e) => t === "min-max" ? h(e) : null,
|
|
58
|
+
style: B(),
|
|
62
59
|
totalCount: c,
|
|
63
|
-
computeItemKey:
|
|
64
|
-
itemSize:
|
|
65
|
-
(e) =>
|
|
60
|
+
computeItemKey: p,
|
|
61
|
+
itemSize: q(
|
|
62
|
+
(e) => z === "manual" ? C(e) : I(e),
|
|
66
63
|
[]
|
|
67
64
|
),
|
|
68
65
|
components: {
|
|
69
66
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
70
67
|
// @ts-ignore
|
|
71
|
-
TableRow:
|
|
72
|
-
...
|
|
68
|
+
TableRow: G,
|
|
69
|
+
...E
|
|
73
70
|
},
|
|
74
|
-
fixedHeaderContent:
|
|
75
|
-
itemContent: (...e) =>
|
|
76
|
-
endReached:
|
|
77
|
-
increaseViewportBy:
|
|
71
|
+
fixedHeaderContent: H,
|
|
72
|
+
itemContent: (...e) => x(D, ...e),
|
|
73
|
+
endReached: V,
|
|
74
|
+
increaseViewportBy: L(t === "container" ? i : l)
|
|
78
75
|
}
|
|
79
76
|
) });
|
|
80
77
|
});
|
|
81
|
-
|
|
78
|
+
J.displayName = "TableVirtualization";
|
|
82
79
|
export {
|
|
83
|
-
|
|
80
|
+
J as default
|
|
84
81
|
};
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
Verdana=Verdana,geneva;
|
|
18
18
|
Webdings=Webdings;
|
|
19
19
|
Wingdings=Wingdings,zapf dingbats
|
|
20
|
-
`,forced_root_block:"p",forced_root_block_attrs:{style:"font-family: Lato; margin: 0px"},autosave_interval:"5s",autosave_prefix:"{path}{query}-{id}-",autosave_restore_when_empty:!1,autosave_retention:"2m",paste_block_drop:!0,branding:!1,paste_data_images:!1,resize:!1,width:"100%",init_instance_callback:t=>{if(n){const e=document.getElementById(`${t.id}_ifr`),
|
|
20
|
+
`,forced_root_block:"p",forced_root_block_attrs:{style:"font-family: Lato; margin: 0px"},autosave_interval:"5s",autosave_prefix:"{path}{query}-{id}-",autosave_restore_when_empty:!1,autosave_retention:"2m",paste_block_drop:!0,branding:!1,paste_data_images:!1,resize:!1,width:"100%",init_instance_callback:t=>{if(n){const e=document.getElementById(`${t.id}_ifr`),i=e?.parentNode,a=document.createElement("p");a.className=`
|
|
21
21
|
!iru-text-laba-grey-10
|
|
22
22
|
!iru-absolute
|
|
23
23
|
!iru-font-Lato
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
!iru-pl-2
|
|
26
26
|
!iru-pt-2
|
|
27
27
|
!iru-pointer-events-none
|
|
28
|
-
`,e
|
|
28
|
+
`,e?.className&&(e.className="!iru-mt-6 !iru-w-full"),a.appendChild(document.createTextNode(n||"")),i?.appendChild(a)}},setup:t=>{t.on("PostProcess",function(e){/<p style="font-family: Lato; margin: 0px;"> <\/p>/i.test(e.content)&&(e.content=e.content.replace(/ /gi,"<br />"))}),t.on("PastePostProcess",e=>{e.node.querySelectorAll("*").forEach(o=>{t.dom.setStyle(o,"font-family","Lato"),t.dom.setStyle(o,"margin","0px")})})}}});exports.default=l;
|
|
@@ -53,8 +53,8 @@ const m = ({ label: n }) => ({
|
|
|
53
53
|
width: "100%",
|
|
54
54
|
init_instance_callback: (t) => {
|
|
55
55
|
if (n) {
|
|
56
|
-
const e = document.getElementById(`${t.id}_ifr`),
|
|
57
|
-
|
|
56
|
+
const e = document.getElementById(`${t.id}_ifr`), i = e?.parentNode, a = document.createElement("p");
|
|
57
|
+
a.className = `
|
|
58
58
|
!iru-text-laba-grey-10
|
|
59
59
|
!iru-absolute
|
|
60
60
|
!iru-font-Lato
|
|
@@ -62,7 +62,7 @@ const m = ({ label: n }) => ({
|
|
|
62
62
|
!iru-pl-2
|
|
63
63
|
!iru-pt-2
|
|
64
64
|
!iru-pointer-events-none
|
|
65
|
-
`, e
|
|
65
|
+
`, e?.className && (e.className = "!iru-mt-6 !iru-w-full"), a.appendChild(document.createTextNode(n || "")), i?.appendChild(a);
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
setup: (t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),l=t=>{const o=t.getTime()-Date.now();return Math.max(Math.floor(o/1e3),0)},w=t=>{const o=s.useMemo(()=>{const e=new Date(t.date);return t.adjustTimesTime&&e.setHours(e.getHours()-t.adjustTimesTime),e},[t.date,t.adjustTimesTime]),[c,g]=s.useState(o),[u,f]=s.useState(()=>l(c)),[r,a]=s.useState(t.running??!1),[i,m]=s.useState(()=>t?.callbackDone);return s.useEffect(()=>{let e;return r&&u>0&&(e=setInterval(()=>{const n=l(c);f(n),n<=0&&(a(!1),e&&clearInterval(e),typeof i=="function"&&i())},t.intervalMs)),()=>{e&&clearInterval(e)}},[r,c,t.intervalMs,i,u]),{count:u,isRunning:r,startCountdown:()=>{!r&&u>0&&a(!0)},stopCountdown:()=>{a(!1)},resetCountdown:e=>{let n;e instanceof Date?n=e:typeof e=="number"?n=new Date(Date.now()+e*1e3):n=o,g(n);const d=l(n);d<=0?a(!1):a(!0),f(d)},setCallbackDone:e=>m(()=>e)}};exports.default=w;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import a from "react";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return Math.max(Math.floor(
|
|
2
|
+
const f = (t) => {
|
|
3
|
+
const o = t.getTime() - Date.now();
|
|
4
|
+
return Math.max(Math.floor(o / 1e3), 0);
|
|
5
5
|
}, M = (t) => {
|
|
6
|
-
const
|
|
6
|
+
const o = a.useMemo(() => {
|
|
7
7
|
const e = new Date(t.date);
|
|
8
8
|
return t.adjustTimesTime && e.setHours(e.getHours() - t.adjustTimesTime), e;
|
|
9
|
-
}, [t.date, t.adjustTimesTime]), [
|
|
9
|
+
}, [t.date, t.adjustTimesTime]), [c, m] = a.useState(o), [r, l] = a.useState(() => f(c)), [u, s] = a.useState(t.running ?? !1), [i, w] = a.useState(() => t?.callbackDone);
|
|
10
10
|
return a.useEffect(() => {
|
|
11
11
|
let e;
|
|
12
|
-
return
|
|
13
|
-
const n =
|
|
14
|
-
|
|
12
|
+
return u && r > 0 && (e = setInterval(() => {
|
|
13
|
+
const n = f(c);
|
|
14
|
+
l(n), n <= 0 && (s(!1), e && clearInterval(e), typeof i == "function" && i());
|
|
15
15
|
}, t.intervalMs)), () => {
|
|
16
16
|
e && clearInterval(e);
|
|
17
17
|
};
|
|
18
|
-
}, [
|
|
19
|
-
count:
|
|
20
|
-
isRunning:
|
|
18
|
+
}, [u, c, t.intervalMs, i, r]), {
|
|
19
|
+
count: r,
|
|
20
|
+
isRunning: u,
|
|
21
21
|
startCountdown: () => {
|
|
22
|
-
!
|
|
22
|
+
!u && r > 0 && s(!0);
|
|
23
23
|
},
|
|
24
24
|
stopCountdown: () => {
|
|
25
25
|
s(!1);
|
|
26
26
|
},
|
|
27
27
|
resetCountdown: (e) => {
|
|
28
28
|
let n;
|
|
29
|
-
e instanceof Date ? n = e : typeof e == "number" ? n = new Date(Date.now() + e * 1e3) : n =
|
|
30
|
-
const d =
|
|
31
|
-
d <= 0 ? s(!1) : s(!0),
|
|
29
|
+
e instanceof Date ? n = e : typeof e == "number" ? n = new Date(Date.now() + e * 1e3) : n = o, m(n);
|
|
30
|
+
const d = f(n);
|
|
31
|
+
d <= 0 ? s(!1) : s(!0), l(d);
|
|
32
32
|
},
|
|
33
33
|
setCallbackDone: (e) => w(() => e)
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),a=(i,l,c,n)=>{c.current!==null&&(clearTimeout(c.current),c.current=null),n.current!==null&&(clearTimeout(n.current),n.current=null),l.current!==null&&(i.current(...l.current),l.current=null)},b=(i,l)=>{const c=l?.wait??0,n=l?.maxWait,u=r.useRef(null),e=r.useRef(null),s=r.useRef(i),t=r.useRef(null);s.current=i;const o=r.useCallback(()=>{u.current!==null&&(clearTimeout(u.current),u.current=null),e.current!==null&&(clearTimeout(e.current),e.current=null),t.current=null},[]),f=r.useCallback(()=>{a(s,t,u,e)},[]),m=r.useCallback(()=>u.current!==null,[]),T=r.useCallback((...d)=>{t.current=d,u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,e.current!==null&&(clearTimeout(e.current),e.current=null),t.current!==null&&(s.current(...t.current),t.current=null)},c),n!==void 0&&e.current===null&&(e.current=setTimeout(()=>{e.current=null,a(s,t,u,e)},n))},[c,n]);return r.useEffect(()=>()=>{u.current!==null&&clearTimeout(u.current),e.current!==null&&clearTimeout(e.current)},[]),{debouncedFn:T,cancel:o,flush:f,pending:m}};exports.default=b;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
}, C = (a,
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const s =
|
|
8
|
-
u.current !== null && (clearTimeout(u.current), u.current = null), r.current !== null && (clearTimeout(r.current), r.current = null),
|
|
9
|
-
}, []),
|
|
10
|
-
i
|
|
11
|
-
}, []),
|
|
1
|
+
import e from "react";
|
|
2
|
+
const o = (a, l, c, n) => {
|
|
3
|
+
c.current !== null && (clearTimeout(c.current), c.current = null), n.current !== null && (clearTimeout(n.current), n.current = null), l.current !== null && (a.current(...l.current), l.current = null);
|
|
4
|
+
}, C = (a, l) => {
|
|
5
|
+
const c = l?.wait ?? 0, n = l?.maxWait, u = e.useRef(null), r = e.useRef(null), i = e.useRef(a), t = e.useRef(null);
|
|
6
|
+
i.current = a;
|
|
7
|
+
const s = e.useCallback(() => {
|
|
8
|
+
u.current !== null && (clearTimeout(u.current), u.current = null), r.current !== null && (clearTimeout(r.current), r.current = null), t.current = null;
|
|
9
|
+
}, []), f = e.useCallback(() => {
|
|
10
|
+
o(i, t, u, r);
|
|
11
|
+
}, []), m = e.useCallback(() => u.current !== null, []), T = e.useCallback(
|
|
12
12
|
(...b) => {
|
|
13
|
-
|
|
14
|
-
u.current = null, r.current !== null && (clearTimeout(r.current), r.current = null),
|
|
15
|
-
},
|
|
16
|
-
r.current = null, i
|
|
17
|
-
},
|
|
13
|
+
t.current = b, u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
14
|
+
u.current = null, r.current !== null && (clearTimeout(r.current), r.current = null), t.current !== null && (i.current(...t.current), t.current = null);
|
|
15
|
+
}, c), n !== void 0 && r.current === null && (r.current = setTimeout(() => {
|
|
16
|
+
r.current = null, o(i, t, u, r);
|
|
17
|
+
}, n));
|
|
18
18
|
},
|
|
19
|
-
[
|
|
19
|
+
[c, n]
|
|
20
20
|
);
|
|
21
|
-
return
|
|
21
|
+
return e.useEffect(() => () => {
|
|
22
22
|
u.current !== null && clearTimeout(u.current), r.current !== null && clearTimeout(r.current);
|
|
23
|
-
}, []), { debouncedFn:
|
|
23
|
+
}, []), { debouncedFn: T, cancel: s, flush: f, pending: m };
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
26
26
|
C as default
|