next-recomponents 1.6.2 → 1.6.4
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.mjs +5 -3
- package/package.json +1 -1
- package/src/modal/index.tsx +4 -2
- package/src/table/h.tsx +3 -1
package/dist/index.d.mts
CHANGED
|
@@ -143,7 +143,7 @@ interface Props extends React$1.DetailedHTMLProps<React$1.DialogHTMLAttributes<H
|
|
|
143
143
|
hide: () => void;
|
|
144
144
|
}>;
|
|
145
145
|
}
|
|
146
|
-
declare function Modal({ button, children, ref }: Props): react_jsx_runtime.JSX.Element;
|
|
146
|
+
declare function Modal({ button, children, ref, title }: Props): react_jsx_runtime.JSX.Element;
|
|
147
147
|
|
|
148
148
|
type PreProps = {
|
|
149
149
|
data: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ interface Props extends React$1.DetailedHTMLProps<React$1.DialogHTMLAttributes<H
|
|
|
143
143
|
hide: () => void;
|
|
144
144
|
}>;
|
|
145
145
|
}
|
|
146
|
-
declare function Modal({ button, children, ref }: Props): react_jsx_runtime.JSX.Element;
|
|
146
|
+
declare function Modal({ button, children, ref, title }: Props): react_jsx_runtime.JSX.Element;
|
|
147
147
|
|
|
148
148
|
type PreProps = {
|
|
149
149
|
data: string;
|
package/dist/index.js
CHANGED
|
@@ -31985,7 +31985,8 @@ function HTable(_a) {
|
|
|
31985
31985
|
}
|
|
31986
31986
|
const typeOf = typeof d[key];
|
|
31987
31987
|
const isObject2 = typeOf == "object";
|
|
31988
|
-
const
|
|
31988
|
+
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
31989
|
+
const isDate = !isObject2 && regex.test(d[key].toString());
|
|
31989
31990
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
31990
31991
|
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? ((_b2 = d[key]) == null ? void 0 : _b2.props).value : JSON.stringify(d[key]) : d[key];
|
|
31991
31992
|
const handler = import_react25.default.isValidElement(d[key]) ? d[key] : null;
|
|
@@ -32812,7 +32813,7 @@ function Select(_a) {
|
|
|
32812
32813
|
// src/modal/index.tsx
|
|
32813
32814
|
var import_react30 = __toESM(require("react"));
|
|
32814
32815
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
32815
|
-
function Modal({ button, children, ref }) {
|
|
32816
|
+
function Modal({ button, children, ref, title = "" }) {
|
|
32816
32817
|
const modalRef = ref || (0, import_react30.useRef)(null);
|
|
32817
32818
|
function show() {
|
|
32818
32819
|
var _a;
|
|
@@ -32842,9 +32843,10 @@ function Modal({ button, children, ref }) {
|
|
|
32842
32843
|
{
|
|
32843
32844
|
onClick: hide,
|
|
32844
32845
|
className: "absolute top-0 right-0 text-red-500 ",
|
|
32845
|
-
children:
|
|
32846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon, {})
|
|
32846
32847
|
}
|
|
32847
32848
|
),
|
|
32849
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "font-bold text-xl", children: title }),
|
|
32848
32850
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-col gap-3 pt-6", children: import_react30.default.Children.map(children, (child) => {
|
|
32849
32851
|
if (import_react30.default.isValidElement(child)) {
|
|
32850
32852
|
const { type, props } = child;
|
package/dist/index.mjs
CHANGED
|
@@ -31971,7 +31971,8 @@ function HTable(_a) {
|
|
|
31971
31971
|
}
|
|
31972
31972
|
const typeOf = typeof d[key];
|
|
31973
31973
|
const isObject2 = typeOf == "object";
|
|
31974
|
-
const
|
|
31974
|
+
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
31975
|
+
const isDate = !isObject2 && regex.test(d[key].toString());
|
|
31975
31976
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
31976
31977
|
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? ((_b2 = d[key]) == null ? void 0 : _b2.props).value : JSON.stringify(d[key]) : d[key];
|
|
31977
31978
|
const handler = React4.isValidElement(d[key]) ? d[key] : null;
|
|
@@ -32804,7 +32805,7 @@ function Select(_a) {
|
|
|
32804
32805
|
// src/modal/index.tsx
|
|
32805
32806
|
import React7, { useRef as useRef6 } from "react";
|
|
32806
32807
|
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
32807
|
-
function Modal({ button, children, ref }) {
|
|
32808
|
+
function Modal({ button, children, ref, title = "" }) {
|
|
32808
32809
|
const modalRef = ref || useRef6(null);
|
|
32809
32810
|
function show() {
|
|
32810
32811
|
var _a;
|
|
@@ -32834,9 +32835,10 @@ function Modal({ button, children, ref }) {
|
|
|
32834
32835
|
{
|
|
32835
32836
|
onClick: hide,
|
|
32836
32837
|
className: "absolute top-0 right-0 text-red-500 ",
|
|
32837
|
-
children:
|
|
32838
|
+
children: /* @__PURE__ */ jsx17(CloseIcon, {})
|
|
32838
32839
|
}
|
|
32839
32840
|
),
|
|
32841
|
+
/* @__PURE__ */ jsx17("div", { className: "font-bold text-xl", children: title }),
|
|
32840
32842
|
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-3 pt-6", children: React7.Children.map(children, (child) => {
|
|
32841
32843
|
if (React7.isValidElement(child)) {
|
|
32842
32844
|
const { type, props } = child;
|
package/package.json
CHANGED
package/src/modal/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
|
+
import CloseIcon from "src/select/close";
|
|
2
3
|
|
|
3
4
|
interface Props
|
|
4
5
|
extends React.DetailedHTMLProps<
|
|
@@ -8,7 +9,7 @@ interface Props
|
|
|
8
9
|
button: React.ReactElement<{ onClick: (e: React.MouseEvent) => void }>;
|
|
9
10
|
children: React.ReactElement<{ hide: () => void }>;
|
|
10
11
|
}
|
|
11
|
-
export default function Modal({ button, children, ref }: Props) {
|
|
12
|
+
export default function Modal({ button, children, ref, title = "" }: Props) {
|
|
12
13
|
const modalRef = ref || useRef<HTMLDialogElement>(null);
|
|
13
14
|
function show() {
|
|
14
15
|
typeof modalRef == "object" && modalRef.current?.showModal();
|
|
@@ -39,8 +40,9 @@ export default function Modal({ button, children, ref }: Props) {
|
|
|
39
40
|
onClick={hide}
|
|
40
41
|
className="absolute top-0 right-0 text-red-500 "
|
|
41
42
|
>
|
|
42
|
-
|
|
43
|
+
<CloseIcon />
|
|
43
44
|
</button>
|
|
45
|
+
<div className="font-bold text-xl">{title}</div>
|
|
44
46
|
<div className="flex flex-col gap-3 pt-6">
|
|
45
47
|
{React.Children.map(children, (child) => {
|
|
46
48
|
if (React.isValidElement(child)) {
|
package/src/table/h.tsx
CHANGED
|
@@ -50,7 +50,9 @@ export default function HTable({
|
|
|
50
50
|
}
|
|
51
51
|
const typeOf = typeof d[key];
|
|
52
52
|
const isObject = typeOf == "object";
|
|
53
|
-
const
|
|
53
|
+
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
54
|
+
|
|
55
|
+
const isDate = !isObject && regex.test(d[key].toString());
|
|
54
56
|
const cellTypeOf = isDate ? "date" : isObject ? "object" : typeOf;
|
|
55
57
|
const content =
|
|
56
58
|
cellTypeOf == "date"
|