next-recomponents 2.0.21 → 2.0.23
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.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +28 -13
- package/dist/index.mjs +28 -13
- package/package.json +1 -1
- package/src/modal/index.tsx +2 -0
- package/src/pop/index.tsx +1 -1
- package/src/pop/overlay.tsx +5 -3
- package/src/table/index.tsx +18 -8
package/dist/index.d.mts
CHANGED
|
@@ -154,12 +154,13 @@ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLA
|
|
|
154
154
|
declare function Select({ label, placeholder, children, strictMode, ...props }: CustomSelectProps): react_jsx_runtime.JSX.Element;
|
|
155
155
|
|
|
156
156
|
type PopupColor$1 = "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
157
|
-
declare function Modal({ button, children, color, }: {
|
|
157
|
+
declare function Modal({ button, children, color, title, }: {
|
|
158
158
|
button: ReactElement<React$1.ComponentPropsWithRef<"button">>;
|
|
159
159
|
children: ReactElement<React$1.ComponentPropsWithRef<"div"> & {
|
|
160
160
|
hide: () => void;
|
|
161
161
|
}>;
|
|
162
162
|
color?: PopupColor$1;
|
|
163
|
+
title?: string;
|
|
163
164
|
}): react_jsx_runtime.JSX.Element;
|
|
164
165
|
|
|
165
166
|
type PreProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -154,12 +154,13 @@ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLA
|
|
|
154
154
|
declare function Select({ label, placeholder, children, strictMode, ...props }: CustomSelectProps): react_jsx_runtime.JSX.Element;
|
|
155
155
|
|
|
156
156
|
type PopupColor$1 = "white" | "primary" | "secondary" | "info" | "danger" | "warning" | "success";
|
|
157
|
-
declare function Modal({ button, children, color, }: {
|
|
157
|
+
declare function Modal({ button, children, color, title, }: {
|
|
158
158
|
button: ReactElement<React$1.ComponentPropsWithRef<"button">>;
|
|
159
159
|
children: ReactElement<React$1.ComponentPropsWithRef<"div"> & {
|
|
160
160
|
hide: () => void;
|
|
161
161
|
}>;
|
|
162
162
|
color?: PopupColor$1;
|
|
163
|
+
title?: string;
|
|
163
164
|
}): react_jsx_runtime.JSX.Element;
|
|
164
165
|
|
|
165
166
|
type PreProps = {
|
package/dist/index.js
CHANGED
|
@@ -35845,13 +35845,21 @@ function useColumns(rows, currentCoin, options) {
|
|
|
35845
35845
|
if (`${value}`.match(isDate)) {
|
|
35846
35846
|
return value.toString().split("T")[0].split("-").reverse().join("/");
|
|
35847
35847
|
}
|
|
35848
|
+
const splited = `${value}`.split(".");
|
|
35849
|
+
const hasDecimals = splited.length == 2 && splited.every((v) => `${v}`.match(regular_expresions_default.number));
|
|
35850
|
+
if (hasDecimals) {
|
|
35851
|
+
return [
|
|
35852
|
+
currentCoin,
|
|
35853
|
+
(+`${value}`).toLocaleString("en-US", {
|
|
35854
|
+
minimumFractionDigits: 2,
|
|
35855
|
+
maximumFractionDigits: 2
|
|
35856
|
+
})
|
|
35857
|
+
].join(" ");
|
|
35858
|
+
}
|
|
35848
35859
|
const isNumber = typeof value === "number";
|
|
35849
35860
|
if (isNumber) {
|
|
35850
35861
|
if (isNaN(value)) return value;
|
|
35851
|
-
return
|
|
35852
|
-
minimumFractionDigits: value % 1 !== 0 ? 2 : 0,
|
|
35853
|
-
maximumFractionDigits: value % 1 !== 0 ? 2 : 0
|
|
35854
|
-
});
|
|
35862
|
+
return value;
|
|
35855
35863
|
}
|
|
35856
35864
|
return value;
|
|
35857
35865
|
},
|
|
@@ -37002,15 +37010,21 @@ function PopupOverlay({
|
|
|
37002
37010
|
iconText: c.iconText
|
|
37003
37011
|
}
|
|
37004
37012
|
),
|
|
37005
|
-
|
|
37006
|
-
|
|
37013
|
+
!(popup == null ? void 0 : popup.icons) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
37014
|
+
"div",
|
|
37007
37015
|
{
|
|
37008
|
-
|
|
37009
|
-
|
|
37010
|
-
|
|
37011
|
-
|
|
37016
|
+
className: `w-full h-12 rounded-full flex items-start justify-end`,
|
|
37017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
37018
|
+
Button,
|
|
37019
|
+
{
|
|
37020
|
+
color: "danger",
|
|
37021
|
+
className: "fixed text-xs font-bold",
|
|
37022
|
+
onClick: (e) => onClose(false),
|
|
37023
|
+
children: "x"
|
|
37024
|
+
}
|
|
37025
|
+
)
|
|
37012
37026
|
}
|
|
37013
|
-
)
|
|
37027
|
+
),
|
|
37014
37028
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
37015
37029
|
"div",
|
|
37016
37030
|
{
|
|
@@ -37090,7 +37104,7 @@ function usePopup() {
|
|
|
37090
37104
|
[open]
|
|
37091
37105
|
);
|
|
37092
37106
|
const modal = (0, import_react9.useCallback)(
|
|
37093
|
-
(message, color = "primary", icons =
|
|
37107
|
+
(message, color = "primary", icons = false, full = false) => new Promise(
|
|
37094
37108
|
(resolve) => open({
|
|
37095
37109
|
type: "modal",
|
|
37096
37110
|
message,
|
|
@@ -37155,7 +37169,8 @@ var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
|
37155
37169
|
function Modal({
|
|
37156
37170
|
button,
|
|
37157
37171
|
children,
|
|
37158
|
-
color = "primary"
|
|
37172
|
+
color = "primary",
|
|
37173
|
+
title
|
|
37159
37174
|
}) {
|
|
37160
37175
|
const pop = usePopup();
|
|
37161
37176
|
const hide = () => pop.close(false);
|
package/dist/index.mjs
CHANGED
|
@@ -35825,13 +35825,21 @@ function useColumns(rows, currentCoin, options) {
|
|
|
35825
35825
|
if (`${value}`.match(isDate)) {
|
|
35826
35826
|
return value.toString().split("T")[0].split("-").reverse().join("/");
|
|
35827
35827
|
}
|
|
35828
|
+
const splited = `${value}`.split(".");
|
|
35829
|
+
const hasDecimals = splited.length == 2 && splited.every((v) => `${v}`.match(regular_expresions_default.number));
|
|
35830
|
+
if (hasDecimals) {
|
|
35831
|
+
return [
|
|
35832
|
+
currentCoin,
|
|
35833
|
+
(+`${value}`).toLocaleString("en-US", {
|
|
35834
|
+
minimumFractionDigits: 2,
|
|
35835
|
+
maximumFractionDigits: 2
|
|
35836
|
+
})
|
|
35837
|
+
].join(" ");
|
|
35838
|
+
}
|
|
35828
35839
|
const isNumber = typeof value === "number";
|
|
35829
35840
|
if (isNumber) {
|
|
35830
35841
|
if (isNaN(value)) return value;
|
|
35831
|
-
return
|
|
35832
|
-
minimumFractionDigits: value % 1 !== 0 ? 2 : 0,
|
|
35833
|
-
maximumFractionDigits: value % 1 !== 0 ? 2 : 0
|
|
35834
|
-
});
|
|
35842
|
+
return value;
|
|
35835
35843
|
}
|
|
35836
35844
|
return value;
|
|
35837
35845
|
},
|
|
@@ -36988,15 +36996,21 @@ function PopupOverlay({
|
|
|
36988
36996
|
iconText: c.iconText
|
|
36989
36997
|
}
|
|
36990
36998
|
),
|
|
36991
|
-
|
|
36992
|
-
|
|
36999
|
+
!(popup == null ? void 0 : popup.icons) && /* @__PURE__ */ jsx14(
|
|
37000
|
+
"div",
|
|
36993
37001
|
{
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
|
|
37002
|
+
className: `w-full h-12 rounded-full flex items-start justify-end`,
|
|
37003
|
+
children: /* @__PURE__ */ jsx14(
|
|
37004
|
+
Button,
|
|
37005
|
+
{
|
|
37006
|
+
color: "danger",
|
|
37007
|
+
className: "fixed text-xs font-bold",
|
|
37008
|
+
onClick: (e) => onClose(false),
|
|
37009
|
+
children: "x"
|
|
37010
|
+
}
|
|
37011
|
+
)
|
|
36998
37012
|
}
|
|
36999
|
-
)
|
|
37013
|
+
),
|
|
37000
37014
|
/* @__PURE__ */ jsx14(
|
|
37001
37015
|
"div",
|
|
37002
37016
|
{
|
|
@@ -37076,7 +37090,7 @@ function usePopup() {
|
|
|
37076
37090
|
[open]
|
|
37077
37091
|
);
|
|
37078
37092
|
const modal = useCallback(
|
|
37079
|
-
(message, color = "primary", icons =
|
|
37093
|
+
(message, color = "primary", icons = false, full = false) => new Promise(
|
|
37080
37094
|
(resolve) => open({
|
|
37081
37095
|
type: "modal",
|
|
37082
37096
|
message,
|
|
@@ -37141,7 +37155,8 @@ import { Fragment as Fragment2, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
|
37141
37155
|
function Modal({
|
|
37142
37156
|
button,
|
|
37143
37157
|
children,
|
|
37144
|
-
color = "primary"
|
|
37158
|
+
color = "primary",
|
|
37159
|
+
title
|
|
37145
37160
|
}) {
|
|
37146
37161
|
const pop = usePopup();
|
|
37147
37162
|
const hide = () => pop.close(false);
|
package/package.json
CHANGED
package/src/modal/index.tsx
CHANGED
|
@@ -15,12 +15,14 @@ export default function Modal({
|
|
|
15
15
|
button,
|
|
16
16
|
children,
|
|
17
17
|
color = "primary",
|
|
18
|
+
title,
|
|
18
19
|
}: {
|
|
19
20
|
button: ReactElement<React.ComponentPropsWithRef<"button">>;
|
|
20
21
|
children: ReactElement<
|
|
21
22
|
React.ComponentPropsWithRef<"div"> & { hide: () => void }
|
|
22
23
|
>;
|
|
23
24
|
color?: PopupColor;
|
|
25
|
+
title?: string;
|
|
24
26
|
}) {
|
|
25
27
|
const pop = usePopup();
|
|
26
28
|
const hide = () => pop.close(false);
|
package/src/pop/index.tsx
CHANGED
package/src/pop/overlay.tsx
CHANGED
|
@@ -45,8 +45,10 @@ export function PopupOverlay({
|
|
|
45
45
|
iconText={c.iconText}
|
|
46
46
|
/>
|
|
47
47
|
)}
|
|
48
|
-
{
|
|
49
|
-
<div
|
|
48
|
+
{!popup?.icons && (
|
|
49
|
+
<div
|
|
50
|
+
className={`w-full h-12 rounded-full flex items-start justify-end`}
|
|
51
|
+
>
|
|
50
52
|
<Button
|
|
51
53
|
color="danger"
|
|
52
54
|
className="fixed text-xs font-bold"
|
|
@@ -55,7 +57,7 @@ export function PopupOverlay({
|
|
|
55
57
|
x
|
|
56
58
|
</Button>
|
|
57
59
|
</div>
|
|
58
|
-
}
|
|
60
|
+
)}
|
|
59
61
|
<div
|
|
60
62
|
className={"text-gray-800 text-[15px] font-medium leading-snug "}
|
|
61
63
|
>
|
package/src/table/index.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { Box, Dialog } from "@mui/material";
|
|
|
5
5
|
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import useExcel from "../use-excel";
|
|
7
7
|
import Button from "../button";
|
|
8
|
+
import regularExpresions from "../regular-expresions";
|
|
8
9
|
|
|
9
10
|
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
10
11
|
|
|
@@ -284,18 +285,27 @@ function useColumns(
|
|
|
284
285
|
.join("/");
|
|
285
286
|
}
|
|
286
287
|
|
|
288
|
+
const splited = `${value}`.split(".");
|
|
289
|
+
const hasDecimals =
|
|
290
|
+
splited.length == 2 &&
|
|
291
|
+
splited.every((v: any) => `${v}`.match(regularExpresions.number));
|
|
292
|
+
|
|
293
|
+
if (hasDecimals) {
|
|
294
|
+
return [
|
|
295
|
+
currentCoin,
|
|
296
|
+
(+`${value}`).toLocaleString("en-US", {
|
|
297
|
+
minimumFractionDigits: 2,
|
|
298
|
+
maximumFractionDigits: 2,
|
|
299
|
+
}),
|
|
300
|
+
].join(" ");
|
|
301
|
+
}
|
|
302
|
+
|
|
287
303
|
const isNumber = typeof value === "number";
|
|
288
304
|
|
|
289
305
|
if (isNumber) {
|
|
290
306
|
if (isNaN(value)) return value;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
" " +
|
|
294
|
-
value.toLocaleString("en-US", {
|
|
295
|
-
minimumFractionDigits: value % 1 !== 0 ? 2 : 0,
|
|
296
|
-
maximumFractionDigits: value % 1 !== 0 ? 2 : 0,
|
|
297
|
-
})
|
|
298
|
-
);
|
|
307
|
+
|
|
308
|
+
return value;
|
|
299
309
|
}
|
|
300
310
|
|
|
301
311
|
return value;
|