@vavt/react-ui 1.4.0 → 1.4.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/dist/{Cron-B8cGD7-3.js → Cron-HRBggBRO.js} +1 -1
- package/dist/{Cron-B4S_KhO1.cjs → Cron-vQ7RSsws.cjs} +1 -1
- package/dist/{DatePicker-w6jWiNfz.js → DatePicker-B0f4Nh8h.js} +1 -1
- package/dist/{DatePicker-DwACFSC7.cjs → DatePicker-DFTqHT8i.cjs} +1 -1
- package/dist/{DateTimePicker-NP2aVE5R.js → DateTimePicker-BzkWgjkq.js} +1 -1
- package/dist/{DateTimePicker-B5atDTPW.cjs → DateTimePicker-McwH-cWl.cjs} +1 -1
- package/dist/Input-BbJ4Q_xu.cjs +1 -0
- package/dist/Input-DpoSxIdb.js +113 -0
- package/dist/cjs/Cron.cjs +1 -1
- package/dist/cjs/DatePicker.cjs +1 -1
- package/dist/cjs/DateTimePicker.cjs +1 -1
- package/dist/cjs/Input.cjs +1 -1
- package/dist/cjs/global.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/register.cjs +1 -1
- package/dist/css/Input.css +1 -1
- package/dist/{date-picker-pcnebTrf.js → date-picker-BKXFZDN2.js} +1 -1
- package/dist/{date-picker-DVvBQnvF.cjs → date-picker-Dp0BXURF.cjs} +1 -1
- package/dist/es/Cron.mjs +1 -1
- package/dist/es/DatePicker.mjs +1 -1
- package/dist/es/DateTimePicker.mjs +1 -1
- package/dist/es/Input.mjs +1 -1
- package/dist/es/global.mjs +1 -1
- package/dist/es/index.mjs +5 -5
- package/dist/es/register.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/{registry-Cddoj83d.js → registry-BXGVMimF.js} +4 -4
- package/dist/{registry-DvXvnY8T.cjs → registry-C-Mo3vuy.cjs} +1 -1
- package/dist/types/Input/type.d.cts +4 -2
- package/dist/types/Input/type.d.ts +4 -2
- package/package.json +1 -1
- package/dist/Input-BRy5Xuwy.js +0 -104
- package/dist/Input-C9ESmbJ7.cjs +0 -1
|
@@ -7,13 +7,13 @@ import { n as a } from "./Button-CwkWSWau.js";
|
|
|
7
7
|
import { n as o } from "./Card-DCLfLn1x.js";
|
|
8
8
|
import { n as s } from "./Checkbox-bHOjYdMp.js";
|
|
9
9
|
import { n as c } from "./Col-BZdKuXbj.js";
|
|
10
|
-
import { n as l } from "./Input-
|
|
10
|
+
import { n as l } from "./Input-DpoSxIdb.js";
|
|
11
11
|
import { n as u } from "./Tabs-HWLkyrQR.js";
|
|
12
12
|
import { n as d } from "./NumberInput-CB-nKZgs.js";
|
|
13
|
-
import { n as f } from "./Cron-
|
|
13
|
+
import { n as f } from "./Cron-HRBggBRO.js";
|
|
14
14
|
import { n as p } from "./Dropdown-CyVxoFAH.js";
|
|
15
|
-
import { n as m } from "./DatePicker-
|
|
16
|
-
import { n as h } from "./DateTimePicker-
|
|
15
|
+
import { n as m } from "./DatePicker-B0f4Nh8h.js";
|
|
16
|
+
import { n as h } from "./DateTimePicker-BzkWgjkq.js";
|
|
17
17
|
import { n as g } from "./Divider-BXNZyvHY.js";
|
|
18
18
|
import { n as _ } from "./Drawer-DNZCj--j.js";
|
|
19
19
|
import { n as v } from "./Empty-MmxZitR8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./Alert-tPSJmCXK.cjs"),t=require("./Anchor-CmuV1Ump.cjs"),n=require("./Announcement-BUvNHscy.cjs"),r=require("./Transition-X_89ga-e.cjs"),i=require("./Badge-BkqoSV-F.cjs"),a=require("./Button-qURrKHQ0.cjs"),o=require("./Card-BkZhLXQ5.cjs"),s=require("./Checkbox-CzNGP2tH.cjs"),c=require("./Col-CvoVGKUn.cjs"),l=require("./Input-
|
|
1
|
+
const e=require("./Alert-tPSJmCXK.cjs"),t=require("./Anchor-CmuV1Ump.cjs"),n=require("./Announcement-BUvNHscy.cjs"),r=require("./Transition-X_89ga-e.cjs"),i=require("./Badge-BkqoSV-F.cjs"),a=require("./Button-qURrKHQ0.cjs"),o=require("./Card-BkZhLXQ5.cjs"),s=require("./Checkbox-CzNGP2tH.cjs"),c=require("./Col-CvoVGKUn.cjs"),l=require("./Input-BbJ4Q_xu.cjs"),u=require("./Tabs-BZ0Zc0bL.cjs"),d=require("./NumberInput-Dp1vTDkW.cjs"),f=require("./Cron-vQ7RSsws.cjs"),p=require("./Dropdown-Chx8SZPS.cjs"),m=require("./DatePicker-DFTqHT8i.cjs"),h=require("./DateTimePicker-McwH-cWl.cjs"),g=require("./Divider-BnmUNmy2.cjs"),_=require("./Drawer-YWO6-KLG.cjs"),v=require("./Empty-Dny96c3p.cjs"),y=require("./Form-CyCbST4e.cjs"),b=require("./Tooltip-z6u7ChKj.cjs"),x=require("./Loading-BSqhKOle.cjs"),S=require("./Scrollbar-CEQT6Ao_.cjs"),C=require("./Modal-BKvRyCXZ.cjs"),w=require("./MessageBox-C6NLihE1.cjs"),T=require("./Notification-D6m4qHKz.cjs"),E=require("./Select-Rx6AHue2.cjs"),D=require("./Pagination-D3ok8N9k.cjs"),O=require("./Progress-DTAjlgwZ.cjs"),k=require("./cjs/Radio.cjs"),A=require("./cjs/Row.cjs"),j=require("./Sidebar-2KVVRUEM.cjs"),M=require("./Slider-CU9OS2HB.cjs"),N=require("./Space-DJGRG2rt.cjs"),P=require("./Switch-CpXDMcPW.cjs"),F=require("./Table-Dv2qxs8q.cjs"),I=require("./Tag-4iZGcfrg.cjs"),L=require("./Textarea-CEhAvE10.cjs"),R=require("./Timeline-ROggEQnD.cjs"),z=require("./TimePicker-BCU7D6uD.cjs"),B=require("./Upload-wHEEoe1c.cjs");var V={VlAlert:e.n,VlAnchor:t.n,VlAnnouncement:n.n,VlBadge:i.n,VlButton:a.n,VlCard:o.n,VlCheckbox:s.n,VlCol:c.n,VlCron:f.n,VlDatePicker:m.n,VlDateTimePicker:h.n,VlDivider:g.n,VlDrawer:_.n,VlDropdown:p.n,VlEmpty:v.n,VlForm:y.t,VlInput:l.n,VlLoading:x.n,VlMessageBox:w.t,VlModal:C.n,VlNotification:T.t,VlNumberInput:d.n,VlPagination:D.n,VlProgress:O.n,VlRadio:k.VlRadio,VlRow:A.VlRow,VlScrollbar:S.n,VlSelect:E.n,VlSidebar:j.n,VlSlider:M.n,VlSpace:N.n,VlSwitch:P.n,VlTable:F.n,VlTabs:u.n,VlTag:I.n,VlTextarea:L.n,VlTimeline:R.n,VlTimePicker:z.n,VlTooltip:b.n,VlTransition:r.n,VlUpload:B.n},H=(e=globalThis)=>(Object.assign(e,V),V);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return V}});
|
|
@@ -16,19 +16,21 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
16
16
|
placeholder?: string;
|
|
17
17
|
/** 是否禁用输入框,默认为 false */
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
/** 只读时仍可聚焦与复制,但不能编辑或清空,默认为 false */
|
|
20
|
+
readOnly?: boolean;
|
|
19
21
|
/** 是否展示加载中动画指示器,默认为 false */
|
|
20
22
|
loading?: boolean;
|
|
21
23
|
/** 输入框尺寸大小,默认为 `md` */
|
|
22
24
|
size?: InputSize;
|
|
23
25
|
/** 原生 `<input>` 类型(如 `'text'`、`'password'` 等),默认为 `'text'` */
|
|
24
26
|
type?: string;
|
|
25
|
-
/**
|
|
27
|
+
/** 是否支持一键清空;保留按钮占位,禁用、只读、加载或空值时不可操作,默认为 false */
|
|
26
28
|
clearable?: boolean;
|
|
27
29
|
/** 前置装饰图标 */
|
|
28
30
|
prefixIcon?: InputIcon;
|
|
29
31
|
/** 后置装饰图标 */
|
|
30
32
|
suffixIcon?: InputIcon;
|
|
31
|
-
/**
|
|
33
|
+
/** 侧边辅助提示/错误文案,空间不足时自动换行 */
|
|
32
34
|
tips?: string;
|
|
33
35
|
/** 前置自定义内容插槽(位于输入框内部最左侧) */
|
|
34
36
|
prefix?: ReactNode;
|
|
@@ -16,19 +16,21 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
16
16
|
placeholder?: string;
|
|
17
17
|
/** 是否禁用输入框,默认为 false */
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
/** 只读时仍可聚焦与复制,但不能编辑或清空,默认为 false */
|
|
20
|
+
readOnly?: boolean;
|
|
19
21
|
/** 是否展示加载中动画指示器,默认为 false */
|
|
20
22
|
loading?: boolean;
|
|
21
23
|
/** 输入框尺寸大小,默认为 `md` */
|
|
22
24
|
size?: InputSize;
|
|
23
25
|
/** 原生 `<input>` 类型(如 `'text'`、`'password'` 等),默认为 `'text'` */
|
|
24
26
|
type?: string;
|
|
25
|
-
/**
|
|
27
|
+
/** 是否支持一键清空;保留按钮占位,禁用、只读、加载或空值时不可操作,默认为 false */
|
|
26
28
|
clearable?: boolean;
|
|
27
29
|
/** 前置装饰图标 */
|
|
28
30
|
prefixIcon?: InputIcon;
|
|
29
31
|
/** 后置装饰图标 */
|
|
30
32
|
suffixIcon?: InputIcon;
|
|
31
|
-
/**
|
|
33
|
+
/** 侧边辅助提示/错误文案,空间不足时自动换行 */
|
|
32
34
|
tips?: string;
|
|
33
35
|
/** 前置自定义内容插槽(位于输入框内部最左侧) */
|
|
34
36
|
prefix?: ReactNode;
|
package/package.json
CHANGED
package/dist/Input-BRy5Xuwy.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./icon-Cbvuv4yF.js";
|
|
2
|
-
import { n as t, t as n } from "./state-BSDh-Ob2.js";
|
|
3
|
-
import { n as r } from "./refs-D5IYOBaf.js";
|
|
4
|
-
import { t as i } from "./id-CHixuHb7.js";
|
|
5
|
-
import { X as a } from "lucide-react";
|
|
6
|
-
import { forwardRef as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
7
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
//#region components/Input/Input.tsx
|
|
9
|
-
var f = o((o, f) => {
|
|
10
|
-
let { value: p, defaultValue: m = "", placeholder: h, disabled: g = !1, loading: _ = !1, size: v = "md", type: y = "text", clearable: b = !1, prefixIcon: x, suffixIcon: S, tips: C, prefix: w, suffix: T, id: E, "aria-describedby": D, className: O, style: k, onClear: A, onInput: j, onChange: M, onFocus: N, onBlur: P, onKeyDown: F, ...I } = o, L = c(null), R = s(() => r(L, f), [f]), [z, B] = l(!1), V = n(o, "value"), [H, U] = t({
|
|
11
|
-
value: p == null ? "" : String(p),
|
|
12
|
-
defaultValue: m == null ? "" : String(m),
|
|
13
|
-
controlled: V,
|
|
14
|
-
onChange: M
|
|
15
|
-
}), W = i("vl-input", E), G = i("vl-input-tips"), K = [D, C ? G : void 0].filter(Boolean).join(" ") || void 0, q = [
|
|
16
|
-
"vl-input-wrapper",
|
|
17
|
-
C ? "has-tips" : "",
|
|
18
|
-
O || ""
|
|
19
|
-
].filter(Boolean).join(" "), J = [
|
|
20
|
-
"vl-input",
|
|
21
|
-
v ? `size-${v}` : "",
|
|
22
|
-
g ? "is-disabled" : "",
|
|
23
|
-
_ ? "is-loading" : "",
|
|
24
|
-
z ? "is-focused" : ""
|
|
25
|
-
].filter(Boolean).join(" "), Y = b && !g && !_ && H !== "" && H != null, X = (e) => {
|
|
26
|
-
j?.(e);
|
|
27
|
-
}, Z = (e) => {
|
|
28
|
-
let t = e.target;
|
|
29
|
-
U(t.value);
|
|
30
|
-
}, Q = (e) => {
|
|
31
|
-
B(!0), N?.(e);
|
|
32
|
-
}, $ = (e) => {
|
|
33
|
-
B(!1), P?.(e);
|
|
34
|
-
}, ee = (e) => {
|
|
35
|
-
F?.(e);
|
|
36
|
-
}, te = () => {
|
|
37
|
-
U(""), A?.(), L.current?.focus();
|
|
38
|
-
};
|
|
39
|
-
return /* @__PURE__ */ d("div", {
|
|
40
|
-
className: q,
|
|
41
|
-
style: k,
|
|
42
|
-
children: [/* @__PURE__ */ d("div", {
|
|
43
|
-
className: J,
|
|
44
|
-
children: [
|
|
45
|
-
w ? /* @__PURE__ */ u("div", {
|
|
46
|
-
className: "vl-input__prefix",
|
|
47
|
-
children: w
|
|
48
|
-
}) : null,
|
|
49
|
-
x ? /* @__PURE__ */ u("div", {
|
|
50
|
-
className: "vl-input__prefix-icon",
|
|
51
|
-
children: e(x)
|
|
52
|
-
}) : null,
|
|
53
|
-
/* @__PURE__ */ u("input", {
|
|
54
|
-
ref: R,
|
|
55
|
-
id: W,
|
|
56
|
-
className: "vl-input__inner",
|
|
57
|
-
type: y,
|
|
58
|
-
value: H,
|
|
59
|
-
placeholder: h,
|
|
60
|
-
disabled: g || _,
|
|
61
|
-
"aria-busy": _ || void 0,
|
|
62
|
-
"aria-describedby": K,
|
|
63
|
-
onInput: X,
|
|
64
|
-
onChange: Z,
|
|
65
|
-
onFocus: Q,
|
|
66
|
-
onBlur: $,
|
|
67
|
-
onKeyDown: ee,
|
|
68
|
-
...I
|
|
69
|
-
}),
|
|
70
|
-
b && !g && !_ ? /* @__PURE__ */ u("button", {
|
|
71
|
-
type: "button",
|
|
72
|
-
className: `vl-input__clear${Y ? " can-clear" : ""}`,
|
|
73
|
-
"aria-label": "清空输入",
|
|
74
|
-
"aria-hidden": !Y || void 0,
|
|
75
|
-
tabIndex: Y ? 0 : -1,
|
|
76
|
-
onClick: te,
|
|
77
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
78
|
-
children: /* @__PURE__ */ u(a, {
|
|
79
|
-
size: 16,
|
|
80
|
-
"aria-hidden": "true"
|
|
81
|
-
})
|
|
82
|
-
}) : null,
|
|
83
|
-
S ? /* @__PURE__ */ u("div", {
|
|
84
|
-
className: "vl-input__suffix-icon",
|
|
85
|
-
children: e(S)
|
|
86
|
-
}) : null,
|
|
87
|
-
T ? /* @__PURE__ */ u("div", {
|
|
88
|
-
className: "vl-input__suffix",
|
|
89
|
-
children: T
|
|
90
|
-
}) : null
|
|
91
|
-
]
|
|
92
|
-
}), C ? /* @__PURE__ */ u("div", {
|
|
93
|
-
id: G,
|
|
94
|
-
className: "vl-input__tips",
|
|
95
|
-
children: C
|
|
96
|
-
}) : null]
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
f.displayName = "VlInput";
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region components/Input/index.ts
|
|
102
|
-
var p = f, m = f;
|
|
103
|
-
//#endregion
|
|
104
|
-
export { p as n, m as t };
|
package/dist/Input-C9ESmbJ7.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./icon-DRLyKu8p.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./id-CF0zOP1G.cjs");let i=require("lucide-react"),a=require("react"),o=require("react/jsx-runtime");var s=(0,a.forwardRef)((s,c)=>{let{value:l,defaultValue:u=``,placeholder:d,disabled:f=!1,loading:p=!1,size:m=`md`,type:h=`text`,clearable:g=!1,prefixIcon:_,suffixIcon:v,tips:y,prefix:b,suffix:x,id:S,"aria-describedby":C,className:w,style:T,onClear:E,onInput:D,onChange:O,onFocus:k,onBlur:A,onKeyDown:j,...M}=s,N=(0,a.useRef)(null),P=(0,a.useMemo)(()=>n.n(N,c),[c]),[F,I]=(0,a.useState)(!1),L=t.t(s,`value`),[R,z]=t.n({value:l==null?``:String(l),defaultValue:u==null?``:String(u),controlled:L,onChange:O}),B=r.t(`vl-input`,S),V=r.t(`vl-input-tips`),H=[C,y?V:void 0].filter(Boolean).join(` `)||void 0,U=[`vl-input-wrapper`,y?`has-tips`:``,w||``].filter(Boolean).join(` `),W=[`vl-input`,m?`size-${m}`:``,f?`is-disabled`:``,p?`is-loading`:``,F?`is-focused`:``].filter(Boolean).join(` `),G=g&&!f&&!p&&R!==``&&R!=null,K=e=>{D?.(e)},q=e=>{let t=e.target;z(t.value)},J=e=>{I(!0),k?.(e)},Y=e=>{I(!1),A?.(e)},X=e=>{j?.(e)},Z=()=>{z(``),E?.(),N.current?.focus()};return(0,o.jsxs)(`div`,{className:U,style:T,children:[(0,o.jsxs)(`div`,{className:W,children:[b?(0,o.jsx)(`div`,{className:`vl-input__prefix`,children:b}):null,_?(0,o.jsx)(`div`,{className:`vl-input__prefix-icon`,children:e.n(_)}):null,(0,o.jsx)(`input`,{ref:P,id:B,className:`vl-input__inner`,type:h,value:R,placeholder:d,disabled:f||p,"aria-busy":p||void 0,"aria-describedby":H,onInput:K,onChange:q,onFocus:J,onBlur:Y,onKeyDown:X,...M}),g&&!f&&!p?(0,o.jsx)(`button`,{type:`button`,className:`vl-input__clear${G?` can-clear`:``}`,"aria-label":`清空输入`,"aria-hidden":!G||void 0,tabIndex:G?0:-1,onClick:Z,onMouseDown:e=>e.preventDefault(),children:(0,o.jsx)(i.X,{size:16,"aria-hidden":`true`})}):null,v?(0,o.jsx)(`div`,{className:`vl-input__suffix-icon`,children:e.n(v)}):null,x?(0,o.jsx)(`div`,{className:`vl-input__suffix`,children:x}):null]}),y?(0,o.jsx)(`div`,{id:V,className:`vl-input__tips`,children:y}):null]})});s.displayName=`VlInput`;var c=s,l=s;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|