wdwh 1.12.22-dev.0 → 1.12.22-dev.1
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/components.d.ts +1 -7
- package/components.js +6 -6
- package/package.json +1 -1
package/components.d.ts
CHANGED
|
@@ -9,13 +9,7 @@ type ButtonProps = {
|
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
} & React.HTMLAttributes<HTMLButtonElement>;
|
|
11
11
|
type TextInputProps = {
|
|
12
|
-
allow?:
|
|
13
|
-
numbers?: boolean;
|
|
14
|
-
letters?: boolean;
|
|
15
|
-
spaces?: boolean;
|
|
16
|
-
dots?: boolean;
|
|
17
|
-
minus?: boolean;
|
|
18
|
-
} | RegExp;
|
|
12
|
+
allow?: RegExp;
|
|
19
13
|
onChange?: (value: string) => void;
|
|
20
14
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, `type` | `onChange`>;
|
|
21
15
|
type FileInputProps = {
|
package/components.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{clsx as
|
|
2
|
-
{n||
|
|
3
|
-
</button>}function c({onChange:n,allow:
|
|
4
|
-
<label htmlFor={
|
|
1
|
+
import{clsx as l}from".";import{useConst as s}from"./hooks";function a({label:n,children:e,className:i,...t}){return<button className={l(i,"cursor-pointer")}{...t}>
|
|
2
|
+
{n||e}
|
|
3
|
+
</button>}function c({onChange:n,allow:e,...i}){return<input type="text"onChange={n?({target:t})=>{if(e&&!e.test(t.value)){t.value=t.value.split("").filter(o=>e.test(o)).join("");return}n(t.value)}:void 0}{...i}/>}function d({children:n,onFile:e,className:i,...t}){const o=s(t?.id||Math.random().toFixed(7));return<div>
|
|
4
|
+
<label htmlFor={o}className={i}>
|
|
5
5
|
{n}
|
|
6
6
|
</label>
|
|
7
|
-
<input type="file"className="hidden"id={
|
|
8
|
-
</div>}export{a as Button,
|
|
7
|
+
<input type="file"className="hidden"id={o}onChange={({target:u})=>{u.files&&u.files[0]&&e(u.files[0])}}{...t}/>
|
|
8
|
+
</div>}export{a as Button,d as FileInput,c as TextInput};
|