@web-utils/form-ui 1.0.0-beta4 → 1.0.0-beta40
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/api/index.d.ts +60 -0
- package/api/index.mjs +42 -0
- package/awesome-button/index.d.ts +60 -0
- package/awesome-button/index.mjs +49 -0
- package/base.css +1 -0
- package/chunks/B1MSrc6f.mjs +8 -0
- package/chunks/B3ajWLh3.mjs +198 -0
- package/chunks/BH_JJ8Xh.mjs +106 -0
- package/chunks/BWBHzD5N.mjs +89 -0
- package/chunks/Bd1UFJic.mjs +660 -0
- package/chunks/Bm5eiSmT.mjs +79 -0
- package/chunks/BsCS7SB5.mjs +141 -0
- package/chunks/BufIRDd0.mjs +185 -0
- package/chunks/C1AgOUe_.mjs +172 -0
- package/chunks/C3Uo82-I.mjs +35 -0
- package/chunks/C9dGL28n.mjs +56 -0
- package/chunks/CFOGMFgo.mjs +150 -0
- package/chunks/CLPSCSsy.mjs +603 -0
- package/chunks/CSyJ-vEx.mjs +17 -0
- package/chunks/CTKmEf2M.mjs +93 -0
- package/chunks/CWfUPCtS.mjs +1360 -0
- package/chunks/CXvGoZKJ.mjs +198 -0
- package/chunks/Cab-ZjRx.mjs +164 -0
- package/chunks/ChmDDqoZ2.mjs +478 -0
- package/chunks/Cj59E77g.mjs +230 -0
- package/chunks/CqTcEefA.mjs +93 -0
- package/chunks/Ct5bDJ50.mjs +38 -0
- package/chunks/CuG2Q-PM.mjs +100 -0
- package/chunks/D8UVq1t1.mjs +176 -0
- package/chunks/DDmQcNm6.mjs +93 -0
- package/chunks/DF9fJMQS.mjs +105 -0
- package/chunks/DJe97Fgi.mjs +107 -0
- package/chunks/DXYgAmil.mjs +317 -0
- package/chunks/DhtHh0jk.mjs +87 -0
- package/chunks/DiJyms_r.mjs +100 -0
- package/chunks/Ds_Tpa_M.mjs +83 -0
- package/chunks/TvNHGVAP.mjs +25 -0
- package/chunks/XCGWTz41.mjs +25 -0
- package/chunks/XqRTtFfp.mjs +166 -0
- package/chunks/cmuHpsX6.mjs +109 -0
- package/chunks/o6VhYAN52.mjs +207 -0
- package/chunks/pdwFQpA8.mjs +57 -0
- package/chunks/taicx2sd.mjs +25 -0
- package/confirm-button/index.d.ts +113 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +84 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +53 -0
- package/constants/index.mjs +4 -0
- package/editable-tree/index.d.ts +254 -0
- package/editable-tree/index.mjs +2 -0
- package/editable-tree/style.css +1 -0
- package/element-dialog/index.d.ts +337 -16
- package/element-dialog/index.mjs +2 -91
- package/empty-view/index.d.ts +2 -2
- package/empty-view/index.mjs +1 -1
- package/flex-scroll-area/index.d.ts +1 -1
- package/flex-scroll-area/index.mjs +1 -1
- package/form-advice/index.mjs +13 -12
- package/form-button/index.d.ts +114 -0
- package/form-button/index.mjs +36 -0
- package/form-card/index.d.ts +14 -0
- package/form-card/index.mjs +18 -0
- package/form-cascader/index.d.ts +472 -0
- package/form-cascader/index.mjs +2 -0
- package/form-check-box-group/index.d.ts +289 -18
- package/form-check-box-group/index.mjs +1 -1
- package/form-check-box-group/style.css +1 -0
- package/form-checkbox/index.d.ts +236 -16
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.d.ts +390 -19
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +87 -20
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +145 -13
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +301 -20
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-cron-expression/index.d.ts +217 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +307 -16
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +307 -16
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +246 -18
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +307 -16
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +263 -1
- package/form-input-tag/index.mjs +1 -3
- package/form-input-time/index.d.ts +434 -1
- package/form-input-time/index.mjs +1 -3
- package/form-item-config-provider/index.d.ts +22 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +91 -17
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-item-x/index.d.ts +141 -11
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -0
- package/form-radio-group/index.d.ts +303 -16
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +254 -14
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +2 -2
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +537 -18
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +283 -16
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +272 -14
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +165 -13
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +2 -0
- package/form-time-select/index.d.ts +319 -0
- package/form-time-select/index.mjs +2 -0
- package/form-view/index.mjs +1 -1
- package/helper/dictionary.d.ts +15 -0
- package/helper/dictionary.mjs +97 -0
- package/hook/useDictionary.d.ts +60 -0
- package/hook/useDictionary.mjs +15 -0
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/iframe-window/index.d.ts +9 -0
- package/iframe-window/index.mjs +37 -0
- package/iframe-window/style.css +1 -0
- package/index.d.ts +52 -36
- package/index.mjs +54 -61
- package/package.json +10 -5
- package/pageable-table/index.d.ts +398 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resize-observer/index.d.ts +8 -0
- package/resize-observer/index.mjs +40 -0
- package/resize-observer/style.css +1 -0
- package/resolver/index.mjs +29 -0
- package/table-column/index.d.ts +160 -0
- package/table-column/index.mjs +2 -0
- package/table-column/style.css +1 -0
- package/table-column-def/index.d.ts +85 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +340 -1
- package/table-view/index.mjs +453 -6
- package/table-view/style.css +1 -0
- package/toolbar/index.d.ts +128 -1
- package/toolbar/index.mjs +1 -8
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.d.ts +188 -1
- package/toolbar-button/index.mjs +1 -8
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +227 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +2 -0
- package/year-calendar/style.css +1 -0
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/B5BIQCcK.mjs +0 -149
- package/chunks/BHNKrW1j.mjs +0 -61
- package/chunks/BO9jWhBl.mjs +0 -46
- package/chunks/BZ8aOa78.mjs +0 -35
- package/chunks/Bsz7y4Xp.mjs +0 -73
- package/chunks/Bxj372sF.mjs +0 -53
- package/chunks/C33EmJN8.mjs +0 -32
- package/chunks/C6Li3-l7.mjs +0 -28
- package/chunks/CBcdalMX.mjs +0 -35
- package/chunks/CdRsyF0n.mjs +0 -43
- package/chunks/ClNahmiU.mjs +0 -23
- package/chunks/CstztYMu.mjs +0 -28
- package/chunks/DC9b53M6.mjs +0 -32
- package/chunks/DDVAgRED.mjs +0 -36
- package/chunks/DpJQABVD.mjs +0 -91
- package/chunks/ZsLNWI9x.mjs +0 -46
- package/chunks/jn_iQrVZ.mjs +0 -28
- package/constants.d.ts +0 -1
- package/constants.mjs +0 -4
- package/input/style.css +0 -1
- package/resolver.mjs +0 -79
- package/utils/style.css +0 -1
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { i as e, n as t, t as n } from "./Cj59E77g.mjs";
|
|
2
|
+
import { n as r, t as i } from "./CSyJ-vEx.mjs";
|
|
3
|
+
import { validatePhoneNum as a } from "@web-utils/core";
|
|
4
|
+
import { computed as o, createVNode as s, mergeProps as c, useModel as l } from "vue";
|
|
5
|
+
import { ElInput as u } from "element-plus/es";
|
|
6
|
+
//#region src/utils/form-validate.ts
|
|
7
|
+
var d = (e, t, n) => t && !/^[A-Za-z0-9\u4e00-\u9fa5_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
|
|
8
|
+
function f(e, t, n) {
|
|
9
|
+
t && !/^[1-9][0-9]{5}(18|19|(2[0-9]))[0-9]{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)[0-9]{3}[0-9Xx]$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/form/props/input.ts
|
|
13
|
+
var p = {
|
|
14
|
+
...r,
|
|
15
|
+
...i,
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "text"
|
|
19
|
+
},
|
|
20
|
+
modelValue: [String, Number],
|
|
21
|
+
modelModifiers: Object,
|
|
22
|
+
maxlength: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: 255
|
|
25
|
+
},
|
|
26
|
+
minlength: [String, Number],
|
|
27
|
+
showWordLimit: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
wordLimitPosition: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "inside"
|
|
34
|
+
},
|
|
35
|
+
placeholder: String,
|
|
36
|
+
clearable: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !0
|
|
39
|
+
},
|
|
40
|
+
clearIcon: [String, Object],
|
|
41
|
+
formatter: Function,
|
|
42
|
+
parser: Function,
|
|
43
|
+
showPassword: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
size: String,
|
|
48
|
+
prefixIcon: [String, Object],
|
|
49
|
+
suffixIcon: [String, Object],
|
|
50
|
+
rows: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 4
|
|
53
|
+
},
|
|
54
|
+
autosize: [Boolean, Object],
|
|
55
|
+
autocomplete: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "off"
|
|
58
|
+
},
|
|
59
|
+
name: String,
|
|
60
|
+
readonly: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
max: [String, Number],
|
|
65
|
+
min: [String, Number],
|
|
66
|
+
step: [String, Number],
|
|
67
|
+
resize: String,
|
|
68
|
+
autofocus: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
form: String,
|
|
73
|
+
ariaLabel: String,
|
|
74
|
+
tabindex: [String, Number],
|
|
75
|
+
validateEvent: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !0
|
|
78
|
+
},
|
|
79
|
+
inputStyle: [String, Object],
|
|
80
|
+
inputmode: String,
|
|
81
|
+
countGraphemes: Function,
|
|
82
|
+
prepend: String,
|
|
83
|
+
append: String,
|
|
84
|
+
prefix: String,
|
|
85
|
+
suffix: String,
|
|
86
|
+
picker: Boolean,
|
|
87
|
+
readonlyGrey: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: !0
|
|
90
|
+
}
|
|
91
|
+
}, m = {
|
|
92
|
+
readonly: !0,
|
|
93
|
+
prefixIcon: !0,
|
|
94
|
+
disabled: !0,
|
|
95
|
+
suffixIcon: !0,
|
|
96
|
+
placeholder: !0,
|
|
97
|
+
modelValue: !0,
|
|
98
|
+
readonlyGrey: !0,
|
|
99
|
+
picker: !0,
|
|
100
|
+
append: !0,
|
|
101
|
+
prefix: !0,
|
|
102
|
+
suffix: !0,
|
|
103
|
+
prepend: !0
|
|
104
|
+
}, h = (e) => r[e] === void 0 && m[e] !== !0, g = {
|
|
105
|
+
name: "FormInput",
|
|
106
|
+
inheritAttrs: !1,
|
|
107
|
+
props: { ...p },
|
|
108
|
+
emits: { ...t },
|
|
109
|
+
setup(t, { emit: r, slots: i, attrs: p }) {
|
|
110
|
+
let m = l(t, "modelValue"), g = `请输入正确的${t.label}!`, { render: _, placeholder: v, disabled: y, listeners: b, inputProps: x } = e(t, {
|
|
111
|
+
emit: r,
|
|
112
|
+
slots: i,
|
|
113
|
+
attrs: p,
|
|
114
|
+
rules: o(() => {
|
|
115
|
+
if (!t.type || t.type === "textarea") return null;
|
|
116
|
+
let e = {
|
|
117
|
+
message: g,
|
|
118
|
+
trigger: "blur"
|
|
119
|
+
};
|
|
120
|
+
if (t.type === "email") e.validator = d;
|
|
121
|
+
else if (t.type === "idcard") e.validator = f;
|
|
122
|
+
else if (t.type === "phone") e.validator = a;
|
|
123
|
+
else return null;
|
|
124
|
+
return [e];
|
|
125
|
+
}),
|
|
126
|
+
predicate: h
|
|
127
|
+
});
|
|
128
|
+
return () => _({ vNodes: s(u, c(b.value, x.value, {
|
|
129
|
+
class: ["form-input", {
|
|
130
|
+
"is-readonly": t.readonlyGrey && t.readonly && !t.picker,
|
|
131
|
+
"el-input-cursor-pointer": t.picker && !y.value
|
|
132
|
+
}],
|
|
133
|
+
modelValue: m.value,
|
|
134
|
+
"onUpdate:modelValue": (e) => m.value = e,
|
|
135
|
+
disabled: y.value,
|
|
136
|
+
placeholder: v.value,
|
|
137
|
+
readonly: t.readonly || t.picker,
|
|
138
|
+
"prefix-icon": n({ icon: t.picker ? "el-icon-search" : t.prefixIcon }),
|
|
139
|
+
"suffix-icon": n({ icon: t.suffixIcon })
|
|
140
|
+
}), {
|
|
141
|
+
prefix: i.prefix || t.prefix ? () => t.prefix : null,
|
|
142
|
+
suffix: i.suffix || t.suffix ? () => t.suffix : null,
|
|
143
|
+
"password-icon": i["password-icon"],
|
|
144
|
+
prepend: i.prepend || t.prepend ? () => t.prepend : null,
|
|
145
|
+
append: i.append || t.append ? () => t.append : null
|
|
146
|
+
}) });
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
//#endregion
|
|
150
|
+
export { p as n, g as t };
|