@zydon/common 2.0.2 → 2.0.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.
@@ -0,0 +1,6 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { createPortal } from 'react-dom';
3
+
4
+ var d=({children:e,container:o,waitBeforeShow:t=50})=>{let[m,n]=useState(!1);return useEffect(()=>{let s=setTimeout(()=>n(!0),t);return ()=>clearTimeout(s)},[t]),t?m?createPortal(e,document.getElementById(o)||document.body):null:createPortal(e,document.getElementById(o)||document.body)},P=d;
5
+
6
+ export { P as a };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ interface ModalActionsProps {
5
+ id?: string;
6
+ }
7
+
8
+ declare const ModalActions: ({ children, id, }: PropsWithChildren<ModalActionsProps>) => react_jsx_runtime.JSX.Element;
9
+
10
+ export { ModalActions as default };
@@ -0,0 +1,6 @@
1
+ import { a } from '../../chunk-JWVPX7Y7.mjs';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ var i=({children:r,id:t="modal-actions"})=>jsx(a,{container:t,children:r}),n=i;
5
+
6
+ export { n as default };
@@ -1,6 +1 @@
1
- import { useState, useEffect } from 'react';
2
- import { createPortal } from 'react-dom';
3
-
4
- var d=({children:e,container:o,waitBeforeShow:t=50})=>{let[m,n]=useState(!1);return useEffect(()=>{let s=setTimeout(()=>n(!0),t);return ()=>clearTimeout(s)},[t]),t?m?createPortal(e,document.getElementById(o)||document.body):null:createPortal(e,document.getElementById(o)||document.body)},P=d;
5
-
6
- export { P as default };
1
+ export { a as default } from '../../chunk-JWVPX7Y7.mjs';
@@ -1,6 +1,6 @@
1
- export { a as default } from '../../chunk-CKOWGDWH.mjs';
2
- import '../../chunk-2ZLS7IUJ.mjs';
1
+ export { a as default } from '../../chunk-XKSDKMZ4.mjs';
3
2
  import '../../chunk-OUPUY4L2.mjs';
3
+ import '../../chunk-2ZLS7IUJ.mjs';
4
4
  import '../../chunk-WHA7HOMZ.mjs';
5
5
  import '../../chunk-SXVKHA6L.mjs';
6
6
  import '../../chunk-MUAMRRNL.mjs';
@@ -1,6 +1,6 @@
1
1
  import { b, a as a$4 } from '../../chunk-MAKO5GLN.mjs';
2
- import { a as a$1 } from '../../chunk-2ZLS7IUJ.mjs';
3
2
  import { a } from '../../chunk-OUPUY4L2.mjs';
3
+ import { a as a$1 } from '../../chunk-2ZLS7IUJ.mjs';
4
4
  import { a as a$2 } from '../../chunk-WHA7HOMZ.mjs';
5
5
  import { a as a$3 } from '../../chunk-SXVKHA6L.mjs';
6
6
  import '../../chunk-MUAMRRNL.mjs';
@@ -1,5 +1,5 @@
1
- import { a as a$1 } from '../../../chunk-HQYCK4C3.mjs';
2
1
  import { a as a$2 } from '../../../chunk-ZREC5BF3.mjs';
2
+ import { a as a$1 } from '../../../chunk-HQYCK4C3.mjs';
3
3
  import { a as a$3 } from '../../../chunk-POP3P3YE.mjs';
4
4
  import '../../../chunk-6UGYYTYE.mjs';
5
5
  import '../../../chunk-D6NU2WRK.mjs';
@@ -1,6 +1,6 @@
1
- import { a } from '../../../chunk-CKOWGDWH.mjs';
2
- import '../../../chunk-2ZLS7IUJ.mjs';
1
+ import { a } from '../../../chunk-XKSDKMZ4.mjs';
3
2
  import '../../../chunk-OUPUY4L2.mjs';
3
+ import '../../../chunk-2ZLS7IUJ.mjs';
4
4
  import '../../../chunk-WHA7HOMZ.mjs';
5
5
  import '../../../chunk-SXVKHA6L.mjs';
6
6
  import '../../../chunk-MUAMRRNL.mjs';
@@ -1,4 +1,4 @@
1
- declare const isValidDate: (date: string | Date) => boolean;
1
+ declare const isValidDate: (date?: string | Date | null) => boolean;
2
2
  declare function stringToDate(dateString?: string, format?: string): Date | null;
3
3
 
4
4
  export { isValidDate, stringToDate };
@@ -1,6 +1,6 @@
1
1
  import r from 'dayjs';
2
- import n from 'dayjs/plugin/customParseFormat';
2
+ import e from 'dayjs/plugin/customParseFormat';
3
3
 
4
- r.extend(n);var a=t=>r(t).isValid();function l(t,e="DD/MM/YYYY HH:mm:ss"){if(!t)return null;let o=r(t,e);return o.isValid()?o.toDate():null}
4
+ r.extend(e);var a=t=>t?r(t).isValid():!1;function l(t,o="DD/MM/YYYY HH:mm:ss"){if(!t)return null;let n=r(t,o);return n.isValid()?n.toDate():null}
5
5
 
6
6
  export { a as isValidDate, l as stringToDate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -1,5 +1,5 @@
1
- import { a as a$3 } from './chunk-2ZLS7IUJ.mjs';
2
1
  import { a as a$1 } from './chunk-OUPUY4L2.mjs';
2
+ import { a as a$3 } from './chunk-2ZLS7IUJ.mjs';
3
3
  import { a as a$4 } from './chunk-WHA7HOMZ.mjs';
4
4
  import { a as a$2 } from './chunk-SXVKHA6L.mjs';
5
5
  import { a as a$5 } from './chunk-QHCGLZFD.mjs';