@web-utils/form-ui 1.0.0-beta24 → 1.0.0-beta26
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/base.css +1 -1
- package/chunks/BAE_vglg.mjs +174 -0
- package/chunks/{Njpw648u.mjs → BPbmq_Fz.mjs} +1 -1
- package/chunks/CCc9Zjms.mjs +62 -0
- package/chunks/{Ce7JJ6Kh.mjs → D1G2MMMx.mjs} +1 -1
- package/chunks/DS8NSFKr.mjs +478 -0
- package/chunks/{DpBkGggC.mjs → lVzx0-GH.mjs} +5 -6
- package/chunks/{DL491cg2.mjs → qRpPD8iK.mjs} +5 -6
- package/chunks/{CQwLIAVn.mjs → tRXOz6_G.mjs} +5 -6
- package/element-dialog/index.d.ts +280 -2
- package/form-cascader/index.d.ts +193 -2
- package/form-check-box-group/index.d.ts +190 -1
- package/form-checkbox/index.d.ts +199 -1
- package/form-date-picker/index.d.ts +202 -2
- package/form-image/index.d.ts +203 -1
- package/form-input/index.d.ts +200 -2
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.d.ts +203 -2
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.d.ts +196 -0
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +196 -0
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +199 -1
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +196 -0
- package/form-input-phone-number/index.mjs +1 -1
- package/form-item-group/index.mjs +1 -1
- package/form-item-x/index.d.ts +2 -2
- package/form-radio-group/index.d.ts +199 -1
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +201 -1
- package/form-rate/index.mjs +1 -1
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +193 -2
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +201 -1
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +201 -1
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +192 -1
- package/form-text/index.mjs +1 -1
- package/form-view/index.mjs +1 -1
- package/index.d.ts +2 -2
- package/index.mjs +23 -23
- package/month-calendar/index.d.ts +1 -1
- package/package.json +2 -1
- package/table-view/index.mjs +1 -1
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.mjs +1 -1
- package/vue-cron/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +226 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +1 -1
- package/year-calendar/index.mjs +2 -174
- package/year-calendar/style.css +1 -1
- package/chunks/C2hH5v6n.mjs +0 -73
- package/chunks/CKW6E1o4.mjs +0 -106
- package/chunks/gw2yFGP0.mjs +0 -53
- package/month-calendar/index.mjs +0 -312
- package/month-calendar/style.css +0 -1
- /package/chunks/{DgJWblJ-.mjs → BJP-5-0v.mjs} +0 -0
- /package/chunks/{DOl--Hf9.mjs → Bgny2wyC.mjs} +0 -0
- /package/chunks/{DETsVUo_.mjs → C9J3j0PX.mjs} +0 -0
- /package/chunks/{DJNXk_Cv.mjs → CkFapoKt.mjs} +0 -0
- /package/chunks/{B7x-U0mD.mjs → CotIhBXj.mjs} +0 -0
- /package/chunks/{CwnhyemQ.mjs → DGYsSu6t.mjs} +0 -0
- /package/chunks/{B7Fo7eih.mjs → DlFC9IZx.mjs} +0 -0
- /package/chunks/{5XleJ1q7.mjs → Dn79Y_Rb.mjs} +0 -0
- /package/chunks/{3o0tA4s6.mjs → ltggbLWM.mjs} +0 -0
- /package/chunks/{DIJ8AiAE.mjs → o5196FMX.mjs} +0 -0
- /package/chunks/{eR-FlUht.mjs → pxFLMMUm.mjs} +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { t as e } from "../chunks/CkFapoKt.mjs";
|
|
2
|
+
import { isArray as t, isDef as n, isPlainObject as r, scrollIntoView as i } from "@web-utils/core";
|
|
3
|
+
import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, nextTick as d, normalizeClass as f, openBlock as p, renderList as m, toDisplayString as h, vShow as g, withCtx as _, withDirectives as v, withKeys as y } from "vue";
|
|
4
|
+
import { ElMessage as b, formContextKey as x, formItemContextKey as S } from "element-plus";
|
|
5
|
+
import { ElButton as C, ElInput as w, ElPopover as T, ElTag as E } from "element-plus/es";
|
|
6
|
+
import { debounce as D } from "lodash-es";
|
|
7
|
+
//#region src/components/form/XInputTag.vue
|
|
8
|
+
var O = {
|
|
9
|
+
name: "XInputTag",
|
|
10
|
+
inject: {
|
|
11
|
+
elForm: {
|
|
12
|
+
from: x,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
elFormItem: {
|
|
16
|
+
from: S,
|
|
17
|
+
default: ""
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: [Array, String],
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
disabled: Boolean,
|
|
26
|
+
separator: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ","
|
|
29
|
+
},
|
|
30
|
+
count: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
arrayMode: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
37
|
+
},
|
|
38
|
+
objectMode: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !0
|
|
41
|
+
},
|
|
42
|
+
query: Function,
|
|
43
|
+
type: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "标签"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
emits: ["update:modelValue"],
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
inputVisible: !1,
|
|
52
|
+
inputValue: "",
|
|
53
|
+
maxTag: 20,
|
|
54
|
+
items: [],
|
|
55
|
+
currentIndex: null
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
inputDisabled() {
|
|
60
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
61
|
+
},
|
|
62
|
+
tags: { get() {
|
|
63
|
+
if (this.arrayMode) {
|
|
64
|
+
var e;
|
|
65
|
+
return (e = this.modelValue) != null && e.length ? this.objectMode ? this.modelValue.map((e) => e.id > 0 ? e : {
|
|
66
|
+
...e,
|
|
67
|
+
id: null
|
|
68
|
+
}) : this.modelValue : [];
|
|
69
|
+
} else {
|
|
70
|
+
var n;
|
|
71
|
+
let e = this.arrayMode ? this.modelValue || [] : t(this.modelValue) ? this.modelValue : ((n = this.modelValue) == null ? void 0 : n.split(this.separator)) || [];
|
|
72
|
+
return e.length && e[0] ? e.map((e) => this.objectMode ? {
|
|
73
|
+
name: e,
|
|
74
|
+
id: null
|
|
75
|
+
} : e) : [];
|
|
76
|
+
}
|
|
77
|
+
} }
|
|
78
|
+
},
|
|
79
|
+
created() {
|
|
80
|
+
this.query && (this.debounceQuery = D(async () => {
|
|
81
|
+
this.query ? (this.items = await this.query(this.inputValue), this.currentIndex = 0) : this.currentIndex = null;
|
|
82
|
+
}, 200));
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
async showInput() {
|
|
86
|
+
var e;
|
|
87
|
+
this.inputVisible = !0, await d(), this.$refs.saveTagInput.$refs.input.focus(), (e = this.items) != null && e.length && (this.currentIndex = 0);
|
|
88
|
+
},
|
|
89
|
+
handleClose(e) {
|
|
90
|
+
let t = this.tags.filter((t) => t !== e);
|
|
91
|
+
this.$emit("update:modelValue", this.arrayMode ? t : t.map((e) => e.name || e).join(this.separator));
|
|
92
|
+
},
|
|
93
|
+
async handleInputConfirm() {
|
|
94
|
+
await d(), n(this.currentIndex) && this.items[this.currentIndex] ? await this.addTag(this.items[this.currentIndex]) : this.inputValue ? await this.addTag(this.inputValue) : this.reset();
|
|
95
|
+
},
|
|
96
|
+
async reset() {
|
|
97
|
+
this.$refs.popover.hide(), await d(), this.inputVisible = !1, this.inputValue = "", this.currentIndex = null;
|
|
98
|
+
},
|
|
99
|
+
async addTag(e) {
|
|
100
|
+
if (this.tags.length >= this.maxTag) {
|
|
101
|
+
b.warning({
|
|
102
|
+
message: `${this.type}已达上限!`,
|
|
103
|
+
showClose: !0
|
|
104
|
+
}), this.inputVisible = !1, this.inputValue = "";
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (e) {
|
|
108
|
+
var t;
|
|
109
|
+
let n = r(e);
|
|
110
|
+
if (this.tags.some((t) => (this.objectMode && t.name || t) === (n && e.name || e))) {
|
|
111
|
+
this.inputVisible = !1, this.inputValue = "", b.warning({
|
|
112
|
+
message: `${this.type}已存在!`,
|
|
113
|
+
showClose: !0
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
let i = [...this.tags];
|
|
118
|
+
if (n) i.push(e);
|
|
119
|
+
else {
|
|
120
|
+
let t = this.items.find((t) => (t.name || t) === e);
|
|
121
|
+
t ? i.push(t) : i.push(this.objectMode ? {
|
|
122
|
+
id: null,
|
|
123
|
+
name: e
|
|
124
|
+
} : e);
|
|
125
|
+
}
|
|
126
|
+
this.$emit("update:modelValue", this.arrayMode ? i : i.map((e) => e.name || e).join(this.separator)), await this.$nextTick(), (t = this.elFormItem) == null || t.clearValidate();
|
|
127
|
+
}
|
|
128
|
+
await this.reset();
|
|
129
|
+
},
|
|
130
|
+
onInputBlur() {
|
|
131
|
+
var e;
|
|
132
|
+
((e = this.items) == null ? void 0 : e.length) === 0 ? this.handleInputConfirm() : this.reset();
|
|
133
|
+
},
|
|
134
|
+
tryQuery() {
|
|
135
|
+
var e;
|
|
136
|
+
(e = this.debounceQuery) == null || e.call(this);
|
|
137
|
+
},
|
|
138
|
+
onDropdownItemClick(e) {
|
|
139
|
+
this.inputVisible = !1, this.inputValue = "", this.addTag(e);
|
|
140
|
+
},
|
|
141
|
+
select(e) {
|
|
142
|
+
var t;
|
|
143
|
+
(t = this.items) != null && t.length && (e === 1 ? this.currentIndex > 0 ? this.currentIndex-- : this.currentIndex = this.items.length - 1 : e === 2 && (this.currentIndex < this.items.length - 1 ? this.currentIndex++ : this.currentIndex = 0), i(this.$refs.list, this.$refs.items[this.currentIndex]));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, k = { class: "x-input-tag" }, A = {
|
|
147
|
+
key: 1,
|
|
148
|
+
style: {
|
|
149
|
+
"margin-left": "8px",
|
|
150
|
+
color: "#b5b5b5",
|
|
151
|
+
"line-height": "normal"
|
|
152
|
+
}
|
|
153
|
+
}, j = {
|
|
154
|
+
key: 4,
|
|
155
|
+
class: "tags-count"
|
|
156
|
+
}, M = {
|
|
157
|
+
ref: "list",
|
|
158
|
+
class: "dropdown-item-list"
|
|
159
|
+
}, N = ["onMouseenter", "onClick"];
|
|
160
|
+
function P(e, t, n, r, i, d) {
|
|
161
|
+
let b = E, x = w, S = C, D = T;
|
|
162
|
+
return p(), c("div", k, [
|
|
163
|
+
d.tags && d.tags.length && d.tags[0] ? (p(!0), c(a, { key: 0 }, m(d.tags, (e, t) => (p(), o(b, {
|
|
164
|
+
key: e.id || e.name || e,
|
|
165
|
+
size: "small",
|
|
166
|
+
"disable-transitions": "",
|
|
167
|
+
closable: !d.inputDisabled,
|
|
168
|
+
onClose: (n) => d.handleClose(e, t)
|
|
169
|
+
}, {
|
|
170
|
+
default: _(() => [u(h(e.name || e), 1)]),
|
|
171
|
+
_: 2
|
|
172
|
+
}, 1032, ["closable", "onClose"]))), 128)) : d.inputDisabled ? (p(), c("span", A, "无")) : s("v-if", !0),
|
|
173
|
+
d.inputDisabled ? s("v-if", !0) : v((p(), o(x, {
|
|
174
|
+
key: 2,
|
|
175
|
+
ref: "saveTagInput",
|
|
176
|
+
modelValue: i.inputValue,
|
|
177
|
+
"onUpdate:modelValue": [t[0] || (t[0] = (e) => i.inputValue = e), d.tryQuery],
|
|
178
|
+
class: "input-new-tag",
|
|
179
|
+
size: "small",
|
|
180
|
+
onKeyup: [
|
|
181
|
+
t[1] || (t[1] = y((e) => d.select(1), ["up"])),
|
|
182
|
+
t[2] || (t[2] = y((e) => d.select(2), ["down"])),
|
|
183
|
+
y(d.onInputBlur, ["esc"]),
|
|
184
|
+
y(d.handleInputConfirm, ["enter"])
|
|
185
|
+
],
|
|
186
|
+
onBlur: d.onInputBlur
|
|
187
|
+
}, null, 8, [
|
|
188
|
+
"modelValue",
|
|
189
|
+
"onUpdate:modelValue",
|
|
190
|
+
"onKeyup",
|
|
191
|
+
"onBlur"
|
|
192
|
+
])), [[g, i.inputVisible]]),
|
|
193
|
+
!d.inputDisabled && !i.inputVisible ? v((p(), o(S, {
|
|
194
|
+
key: 3,
|
|
195
|
+
class: "button-new-tag",
|
|
196
|
+
size: "small",
|
|
197
|
+
onClick: d.showInput
|
|
198
|
+
}, {
|
|
199
|
+
default: _(() => [...t[3] || (t[3] = [u(" + 添加 ", -1)])]),
|
|
200
|
+
_: 1
|
|
201
|
+
}, 8, ["onClick"])), [[g, d.tags.length < i.maxTag]]) : s("v-if", !0),
|
|
202
|
+
n.count ? (p(), c("span", j, h(d.tags.length && d.tags[0] ? d.tags.length : ""), 1)) : s("v-if", !0),
|
|
203
|
+
n.query ? (p(), o(D, {
|
|
204
|
+
key: 5,
|
|
205
|
+
ref: "popover",
|
|
206
|
+
"virtual-ref": e.$refs.saveTagInput,
|
|
207
|
+
placement: "bottom",
|
|
208
|
+
width: "240",
|
|
209
|
+
"popper-class": "dropdown-popup",
|
|
210
|
+
trigger: "manual"
|
|
211
|
+
}, {
|
|
212
|
+
default: _(() => [l("ul", M, [(p(!0), c(a, null, m(i.items, (e, t) => (p(), c("li", {
|
|
213
|
+
ref_for: !0,
|
|
214
|
+
ref: "items",
|
|
215
|
+
key: e.id || e.name || e,
|
|
216
|
+
class: f(["dropdown-item", { active: i.currentIndex === t }]),
|
|
217
|
+
onMouseenter: (e) => i.currentIndex = t,
|
|
218
|
+
onClick: (t) => d.onDropdownItemClick(e)
|
|
219
|
+
}, h(e.name || e), 43, N))), 128))], 512)]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["virtual-ref"])) : s("v-if", !0)
|
|
222
|
+
]);
|
|
223
|
+
}
|
|
224
|
+
var F = /* @__PURE__ */ e(O, [["render", P]]);
|
|
225
|
+
//#endregion
|
|
226
|
+
export { F as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.el-form-item.is-error .x-input-tag{border-color:#f56c6c}.x-input-tag{border:1px solid var(--border-color);border-radius:4px;width:100%;height:120px;padding-top:4px;padding-right:4px;line-height:0;position:relative;overflow:auto}.x-input-tag .el-tag .el-tag__close:hover{background-color:#ee8677}.x-input-tag .el-tag,.x-input-tag .button-new-tag{margin-bottom:4px;margin-left:4px}.x-input-tag .el-input.input-new-tag{width:120px;margin-bottom:4px;margin-left:4px}.x-input-tag .tags-count{color:#b7b7b7;font-size:.9em;position:absolute;bottom:10px;right:6px}.dropdown-popup{padding:0}.dropdown-popup .dropdown-item-list{max-height:200px;overflow:auto}.dropdown-popup .dropdown-item{cursor:pointer;padding:5px 10px}.dropdown-popup .dropdown-item:hover,.dropdown-popup .dropdown-item.active{background-color:#f5f7fa}
|
package/year-calendar/index.d.ts
CHANGED
|
@@ -86,11 +86,11 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
86
86
|
"onUpdate:activeDates"?: ((...args: any[]) => any) | undefined;
|
|
87
87
|
}>, {
|
|
88
88
|
modelValue: string | number;
|
|
89
|
+
showYearSelector: boolean;
|
|
89
90
|
activeDates: unknown[];
|
|
90
91
|
lang: string;
|
|
91
92
|
activeClass: string;
|
|
92
93
|
prefixClass: string;
|
|
93
|
-
showYearSelector: boolean;
|
|
94
94
|
hideWeekend: boolean;
|
|
95
95
|
hideSunday: boolean;
|
|
96
96
|
}, {}, {
|
package/year-calendar/index.mjs
CHANGED
|
@@ -1,174 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../chunks/
|
|
2
|
-
|
|
3
|
-
import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createStaticVNode as o, createVNode as s, normalizeClass as c, openBlock as l, renderList as u, toDisplayString as d } from "vue";
|
|
4
|
-
import f from "dayjs";
|
|
5
|
-
//#region src/components/material-year-calendar/YearCalendar.vue
|
|
6
|
-
var p = {
|
|
7
|
-
name: "YearCalendar",
|
|
8
|
-
components: { MonthCalendar: t },
|
|
9
|
-
props: {
|
|
10
|
-
showYearSelector: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: () => !0
|
|
13
|
-
},
|
|
14
|
-
activeDates: {
|
|
15
|
-
type: Array,
|
|
16
|
-
default: () => [],
|
|
17
|
-
validator: (e) => {
|
|
18
|
-
let t = !0, n = null;
|
|
19
|
-
return e.forEach((e) => {
|
|
20
|
-
typeof e == "string" ? n = e : typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "date") && (n = e.date), /^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n) || (t = !1);
|
|
21
|
-
let r = n.split("-"), i = parseInt(r[2], 10), a = parseInt(r[1], 10), o = parseInt(r[0], 10);
|
|
22
|
-
(o < 1e3 || o > 3e3 || a === 0 || a > 12) && (t = !1);
|
|
23
|
-
let s = [
|
|
24
|
-
31,
|
|
25
|
-
28,
|
|
26
|
-
31,
|
|
27
|
-
30,
|
|
28
|
-
31,
|
|
29
|
-
30,
|
|
30
|
-
31,
|
|
31
|
-
31,
|
|
32
|
-
30,
|
|
33
|
-
31,
|
|
34
|
-
30,
|
|
35
|
-
31
|
|
36
|
-
];
|
|
37
|
-
(o % 400 == 0 || o % 100 != 0 && o % 4 == 0) && (s[1] = 29), i > 0 && i <= s[a - 1] || (t = !1);
|
|
38
|
-
}), t;
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
modelValue: {
|
|
42
|
-
type: [String, Number],
|
|
43
|
-
default: f().year()
|
|
44
|
-
},
|
|
45
|
-
lang: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: "en"
|
|
48
|
-
},
|
|
49
|
-
activeClass: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: () => ""
|
|
52
|
-
},
|
|
53
|
-
prefixClass: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: () => "calendar--active"
|
|
56
|
-
},
|
|
57
|
-
hideWeekend: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: !1
|
|
60
|
-
},
|
|
61
|
-
hideSunday: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: !1
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
emits: [
|
|
67
|
-
"toggleDate",
|
|
68
|
-
"monthClick",
|
|
69
|
-
"update:activeDates",
|
|
70
|
-
"update:modelValue"
|
|
71
|
-
],
|
|
72
|
-
data() {
|
|
73
|
-
return { isUsingString: !0 };
|
|
74
|
-
},
|
|
75
|
-
computed: {
|
|
76
|
-
month() {
|
|
77
|
-
let e = {};
|
|
78
|
-
return this.activeDates.forEach((t) => {
|
|
79
|
-
let n;
|
|
80
|
-
if (n = typeof t == "string" ? {
|
|
81
|
-
date: t,
|
|
82
|
-
className: this.activeClass
|
|
83
|
-
} : {
|
|
84
|
-
date: t.date,
|
|
85
|
-
className: t.className || ""
|
|
86
|
-
}, f(n.date).year() !== parseInt(this.modelValue)) return;
|
|
87
|
-
let r = (f(n.date).month() + 1).toString();
|
|
88
|
-
e[r] || (e[r] = []), e[r].push(n);
|
|
89
|
-
}), e;
|
|
90
|
-
},
|
|
91
|
-
activeYear: {
|
|
92
|
-
get() {
|
|
93
|
-
return parseInt(this.modelValue);
|
|
94
|
-
},
|
|
95
|
-
set(e) {
|
|
96
|
-
this.$emit("update:modelValue", e);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
created() {
|
|
101
|
-
this.isUsingString = this.activeDates.length && typeof this.activeDates[0] == "string";
|
|
102
|
-
},
|
|
103
|
-
methods: {
|
|
104
|
-
changeYear(e) {
|
|
105
|
-
this.activeYear = e + this.activeYear - 3;
|
|
106
|
-
},
|
|
107
|
-
toggleDate(e) {
|
|
108
|
-
let t = f().set("year", this.modelValue).set("month", e.month - 1).set("date", e.date).format("YYYY-MM-DD");
|
|
109
|
-
this.$emit("toggleDate", {
|
|
110
|
-
date: t,
|
|
111
|
-
selected: e.selected,
|
|
112
|
-
className: e.className
|
|
113
|
-
});
|
|
114
|
-
let n, r;
|
|
115
|
-
if (this.isUsingString) n = this.activeDates.indexOf(t), r = this.modifiedActiveDates(n, t);
|
|
116
|
-
else {
|
|
117
|
-
let i = {
|
|
118
|
-
date: t,
|
|
119
|
-
className: e.className
|
|
120
|
-
};
|
|
121
|
-
n = this.activeDates.indexOf(this.activeDates.find((e) => e.date === t)), r = this.modifiedActiveDates(n, i);
|
|
122
|
-
}
|
|
123
|
-
this.$emit("update:activeDates", r);
|
|
124
|
-
},
|
|
125
|
-
modifiedActiveDates(e, t) {
|
|
126
|
-
let n = [...this.activeDates];
|
|
127
|
-
return e === -1 ? n.push(t) : n.splice(e, 1), n;
|
|
128
|
-
},
|
|
129
|
-
monthClick(e) {
|
|
130
|
-
this.$emit("monthClick", e);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}, m = { class: "vue-calendar__container" }, h = {
|
|
134
|
-
key: 0,
|
|
135
|
-
class: "container__year"
|
|
136
|
-
}, g = ["onClick"];
|
|
137
|
-
function _(e, f, p, _, v, y) {
|
|
138
|
-
let b = t;
|
|
139
|
-
return l(), i("div", m, [p.showYearSelector ? (l(), i("div", h, [
|
|
140
|
-
r(" <span><button @click=\"addYear(-1)\">back</button></span> "),
|
|
141
|
-
(l(), i(n, null, u(5, (e) => a("span", {
|
|
142
|
-
key: e,
|
|
143
|
-
class: "year__chooser",
|
|
144
|
-
onClick: (t) => y.changeYear(e)
|
|
145
|
-
}, d(e + y.activeYear - 3), 9, g)), 64)),
|
|
146
|
-
r(" <span><button @click=\"addYear(1)\">next</button></span> ")
|
|
147
|
-
])) : r("v-if", !0), a("div", { class: c(["container__months", {
|
|
148
|
-
"hide-weekend": p.hideWeekend,
|
|
149
|
-
"hide-sunday": p.hideSunday
|
|
150
|
-
}]) }, [(l(), i(n, null, u(12, (e) => s(b, {
|
|
151
|
-
key: `month-${e}`,
|
|
152
|
-
class: "container__month",
|
|
153
|
-
year: y.activeYear,
|
|
154
|
-
month: e,
|
|
155
|
-
"active-dates": y.month[e],
|
|
156
|
-
"active-class": p.activeClass,
|
|
157
|
-
lang: p.lang,
|
|
158
|
-
"prefix-class": p.prefixClass,
|
|
159
|
-
onToggleDate: y.toggleDate,
|
|
160
|
-
onMonthClickEvent: y.monthClick
|
|
161
|
-
}, null, 8, [
|
|
162
|
-
"year",
|
|
163
|
-
"month",
|
|
164
|
-
"active-dates",
|
|
165
|
-
"active-class",
|
|
166
|
-
"lang",
|
|
167
|
-
"prefix-class",
|
|
168
|
-
"onToggleDate",
|
|
169
|
-
"onMonthClickEvent"
|
|
170
|
-
])), 64)), f[0] || (f[0] = o("<div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div>", 5))], 2)]);
|
|
171
|
-
}
|
|
172
|
-
var v = /* @__PURE__ */ e(p, [["render", _], ["__scopeId", "data-v-dc54a16d"]]);
|
|
173
|
-
//#endregion
|
|
174
|
-
export { v as default };
|
|
1
|
+
import { t as e } from "../chunks/DS8NSFKr.mjs";
|
|
2
|
+
export { e as default };
|
package/year-calendar/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.container__months.hide-sunday .calendar__day:nth-of-type(7n){display:none}.container__months.hide-sunday .calendar__day{flex:16.66%}.container__months.hide-weekend .calendar__day:nth-of-type(7n),.container__months.hide-weekend .calendar__day:nth-of-type(7n-1){display:none}.container__months.hide-weekend .calendar__day{flex:19%}.vue-calendar__container[data-v-
|
|
1
|
+
.c-wrapper[data-v-2a7f150d]{padding:10px}.calendar[data-v-2a7f150d]{text-align:center;color:#353c46cc;background-color:#fff;border-radius:2px;min-width:0;min-height:295px;text-decoration:none;transition:transform .3s;position:relative;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.calendar[data-v-2a7f150d]:hover{z-index:2}@media (min-width:1024px){.calendar[data-v-2a7f150d]:hover{transform:scale(1.15);box-shadow:0 7px 21px #0000001a}}.calendar .calendar__title[data-v-2a7f150d]{cursor:pointer;border-bottom:1px solid #c4c4c44d;flex:100%;justify-content:center;align-items:center;height:50px;margin-bottom:12px;font-size:18px;font-weight:700;display:flex}.calendar .calendar__body[data-v-2a7f150d]{flex-wrap:wrap;place-content:flex-start;min-width:194px;padding:0 20px;display:flex}.calendar .calendar__day[data-v-2a7f150d]{color:#5db3d4;flex:14.28%;justify-content:center;align-items:center;height:31px;font-size:16px;display:flex}.calendar .day__weektitle[data-v-2a7f150d]{color:#353c46cc}.calendar .day[data-v-2a7f150d]{cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:5px;justify-content:center;align-items:center;width:22px;height:22px;font-size:14px;display:flex;position:relative}.calendar .day[data-v-2a7f150d]:after{content:"";z-index:1;background-color:#0000;border-radius:50%;width:10px;height:10px;display:block;position:absolute;top:-5px;right:-5px}.calendar .day.calendar--active[data-v-2a7f150d]:after{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20fill='%23FF6060'%20d='M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm5%2011H7v-2h10v2z'/%3e%3c/svg%3e");background-size:100% 100%}.calendar .day[data-v-2a7f150d]:not(.calendar__day--otherMonth):hover{background-color:#6666661a;border-radius:5px}.calendar .day.calendar--active[data-v-2a7f150d]{color:#bcbcbc;background-color:#ffbaba80}.calendar .day.calendar--active.info[data-v-2a7f150d]{color:#fff;background-color:#17a2b8cc}.calendar .day.calendar--active.info[data-v-2a7f150d]:after{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%2317a2b8'%20d='M0%200h24v24H0V0z'/%3e%3cpath%20fill='white'%20d='M11%207h2v2h-2zm0%204h2v6h-2zm1-9C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm0%2018c-4.41%200-8-3.59-8-8s3.59-8%208-8%208%203.59%208%208-3.59%208-8%208z'/%3e%3c/svg%3e");background-size:100% 100%}.calendar .day.calendar--active.warning[data-v-2a7f150d]{color:#fff;background-color:#ffc107b3}.calendar .day.calendar--active.warning[data-v-2a7f150d]:after{background-color:#eaeaea4d;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23ffc107'%20d='M4.47%2021h15.06c1.54%200%202.5-1.67%201.73-3L13.73%204.99c-.77-1.33-2.69-1.33-3.46%200L2.74%2018c-.77%201.33.19%203%201.73%203zM12%2014c-.55%200-1-.45-1-1v-2c0-.55.45-1%201-1s1%20.45%201%201v2c0%20.55-.45%201-1%201zm1%204h-2v-2h2v2z'/%3e%3c/svg%3e");background-size:100% 100%}.calendar .calendar__day--otherMonth[data-v-2a7f150d]{color:#eaeaea;cursor:auto}.container__months.hide-sunday .calendar__day:nth-of-type(7n){display:none}.container__months.hide-sunday .calendar__day{flex:16.66%}.container__months.hide-weekend .calendar__day:nth-of-type(7n),.container__months.hide-weekend .calendar__day:nth-of-type(7n-1){display:none}.container__months.hide-weekend .calendar__day{flex:19%}.vue-calendar__container[data-v-5cc87b9a]{background-color:#f6f6f3;border-radius:2px;min-width:0;text-decoration:none;position:relative;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.vue-calendar__container .container__year[data-v-5cc87b9a]{-webkit-user-select:none;user-select:none;text-align:center;background-color:#fff;flex:100%;height:65px;font-size:24px;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]{cursor:pointer;color:#000000e6;flex:1;justify-content:center;align-items:center;height:100%;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:hover{background-color:#6666661a}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:nth-child(4n-3){color:#0000004d}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:nth-child(2n){color:#0009}.vue-calendar__container .container__year .year__chooser[data-v-5cc87b9a]:nth-child(3){box-shadow:inset 0 -3px #4792bd}.vue-calendar__container .container__months[data-v-5cc87b9a]{flex-wrap:wrap;padding:15px;display:flex}.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:16.66%;padding:8px}@media (max-width:1300px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:25%}}@media (max-width:992px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:33.3%}}@media (max-width:768px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:50%}}@media (max-width:450px){.vue-calendar__container .container__month[data-v-5cc87b9a]{flex:100%}}.vue-calendar__container .p-0[data-v-5cc87b9a]{padding:0}
|
package/chunks/C2hH5v6n.mjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { i as e, n as t, t as n } from "./ADvOhGAW.mjs";
|
|
2
|
-
import { n as r, r as i, t as a } from "./CKW6E1o4.mjs";
|
|
3
|
-
import { validatePhoneNum as o } from "@web-utils/core";
|
|
4
|
-
import { computed as s, createVNode as c, mergeProps as l, useModel as u } from "vue";
|
|
5
|
-
import { ElInput as d } from "element-plus/es";
|
|
6
|
-
//#region src/utils/form-validate.ts
|
|
7
|
-
var f = (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 p(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/FormInput.vue
|
|
13
|
-
var m = {
|
|
14
|
-
name: "FormInput",
|
|
15
|
-
inheritAttrs: !1,
|
|
16
|
-
props: { ...a },
|
|
17
|
-
emits: {
|
|
18
|
-
...t,
|
|
19
|
-
click: null,
|
|
20
|
-
blur: null,
|
|
21
|
-
focus: null,
|
|
22
|
-
change: null,
|
|
23
|
-
input: null,
|
|
24
|
-
clear: null,
|
|
25
|
-
keydown: null,
|
|
26
|
-
mouseleave: null,
|
|
27
|
-
mouseenter: null,
|
|
28
|
-
compositionstart: null,
|
|
29
|
-
compositionupdate: null,
|
|
30
|
-
compositionend: null
|
|
31
|
-
},
|
|
32
|
-
setup(t, { emit: a, slots: m, attrs: h }) {
|
|
33
|
-
let g = u(t, "modelValue"), _ = `请输入正确的${t.label}!`, { render: v, placeholder: y, disabled: b, autoBind: x } = e(t, {
|
|
34
|
-
emit: a,
|
|
35
|
-
slots: m,
|
|
36
|
-
attrs: h,
|
|
37
|
-
rules: s(() => {
|
|
38
|
-
if (!t.type || t.type === "textarea") return null;
|
|
39
|
-
let e = {
|
|
40
|
-
message: _,
|
|
41
|
-
trigger: "blur"
|
|
42
|
-
};
|
|
43
|
-
if (t.type === "email") e.validator = f;
|
|
44
|
-
else if (t.type === "idcard") e.validator = p;
|
|
45
|
-
else if (t.type === "phone") e.validator = o;
|
|
46
|
-
else return null;
|
|
47
|
-
return [e];
|
|
48
|
-
}),
|
|
49
|
-
events: r,
|
|
50
|
-
predicate: i
|
|
51
|
-
});
|
|
52
|
-
return () => v({ vNodes: c(d, l({ class: ["form-input", {
|
|
53
|
-
"is-readonly": t.readonlyGrey && t.readonly && !t.picker,
|
|
54
|
-
"el-input-cursor-pointer": t.picker && !b.value
|
|
55
|
-
}] }, x.value, {
|
|
56
|
-
modelValue: g.value,
|
|
57
|
-
"onUpdate:modelValue": (e) => g.value = e,
|
|
58
|
-
disabled: b.value,
|
|
59
|
-
placeholder: y.value,
|
|
60
|
-
readonly: t.readonly || t.picker,
|
|
61
|
-
"prefix-icon": n({ icon: t.picker ? "el-icon-search" : t.prefixIcon }),
|
|
62
|
-
"suffix-icon": n({ icon: t.suffixIcon })
|
|
63
|
-
}), {
|
|
64
|
-
prefix: m.prefix || t.prefix ? () => t.prefix : null,
|
|
65
|
-
suffix: m.suffix || t.suffix ? () => t.suffix : null,
|
|
66
|
-
"password-icon": m["password-icon"],
|
|
67
|
-
prepend: m.prepend || t.prepend ? () => t.prepend : null,
|
|
68
|
-
append: m.append || t.append ? () => t.append : null
|
|
69
|
-
}) });
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
export { m as t };
|
package/chunks/CKW6E1o4.mjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./mjEH6tHn.mjs";
|
|
2
|
-
//#region src/components/form/props/input.ts
|
|
3
|
-
var n = {
|
|
4
|
-
...e,
|
|
5
|
-
...t,
|
|
6
|
-
type: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: "text"
|
|
9
|
-
},
|
|
10
|
-
modelValue: [String, Number],
|
|
11
|
-
modelModifiers: Object,
|
|
12
|
-
maxlength: [String, Number],
|
|
13
|
-
minlength: [String, Number],
|
|
14
|
-
showWordLimit: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: !1
|
|
17
|
-
},
|
|
18
|
-
wordLimitPosition: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "inside"
|
|
21
|
-
},
|
|
22
|
-
placeholder: String,
|
|
23
|
-
clearable: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: !0
|
|
26
|
-
},
|
|
27
|
-
clearIcon: [String, Object],
|
|
28
|
-
formatter: Function,
|
|
29
|
-
parser: Function,
|
|
30
|
-
showPassword: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
34
|
-
size: String,
|
|
35
|
-
prefixIcon: [String, Object],
|
|
36
|
-
suffixIcon: [String, Object],
|
|
37
|
-
rows: {
|
|
38
|
-
type: Number,
|
|
39
|
-
default: 2
|
|
40
|
-
},
|
|
41
|
-
autosize: [Boolean, Object],
|
|
42
|
-
autocomplete: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: "off"
|
|
45
|
-
},
|
|
46
|
-
name: String,
|
|
47
|
-
readonly: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: !1
|
|
50
|
-
},
|
|
51
|
-
max: [String, Number],
|
|
52
|
-
min: [String, Number],
|
|
53
|
-
step: [String, Number],
|
|
54
|
-
resize: String,
|
|
55
|
-
autofocus: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: !1
|
|
58
|
-
},
|
|
59
|
-
form: String,
|
|
60
|
-
ariaLabel: String,
|
|
61
|
-
tabindex: [String, Number],
|
|
62
|
-
validateEvent: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: !0
|
|
65
|
-
},
|
|
66
|
-
inputStyle: [String, Object],
|
|
67
|
-
label: String,
|
|
68
|
-
inputmode: String,
|
|
69
|
-
countGraphemes: Function,
|
|
70
|
-
prepend: String,
|
|
71
|
-
append: String,
|
|
72
|
-
prefix: String,
|
|
73
|
-
suffix: String,
|
|
74
|
-
picker: Boolean,
|
|
75
|
-
readonlyGrey: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: !0
|
|
78
|
-
}
|
|
79
|
-
}, r = {
|
|
80
|
-
readonly: !0,
|
|
81
|
-
prefixIcon: !0,
|
|
82
|
-
suffixIcon: !0,
|
|
83
|
-
placeholder: !0,
|
|
84
|
-
modelValue: !0,
|
|
85
|
-
readonlyGrey: !0,
|
|
86
|
-
picker: !0,
|
|
87
|
-
append: !0,
|
|
88
|
-
prefix: !0,
|
|
89
|
-
suffix: !0,
|
|
90
|
-
prepend: !0
|
|
91
|
-
}, i = [
|
|
92
|
-
"click",
|
|
93
|
-
"blur",
|
|
94
|
-
"focus",
|
|
95
|
-
"change",
|
|
96
|
-
"input",
|
|
97
|
-
"clear",
|
|
98
|
-
"keydown",
|
|
99
|
-
"mouseleave",
|
|
100
|
-
"mouseenter",
|
|
101
|
-
"compositionstart",
|
|
102
|
-
"compositionupdate",
|
|
103
|
-
"compositionend"
|
|
104
|
-
], a = (t) => e[t] === void 0 && r[t] !== !0;
|
|
105
|
-
//#endregion
|
|
106
|
-
export { i as n, a as r, n as t };
|
package/chunks/gw2yFGP0.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { i as e, n as t } from "./ADvOhGAW.mjs";
|
|
2
|
-
import { n, t as r } from "./mjEH6tHn.mjs";
|
|
3
|
-
import { n as i, r as a } from "./CKW6E1o4.mjs";
|
|
4
|
-
import { t as o } from "./Ce7JJ6Kh.mjs";
|
|
5
|
-
import { createVNode as s, mergeProps as c, ref as l } from "vue";
|
|
6
|
-
import { ElInput as u, ElPopover as d } from "element-plus/es";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/form/FormInputCronExpression.vue
|
|
9
|
-
var f = {
|
|
10
|
-
name: "FormInputCronExpression",
|
|
11
|
-
props: {
|
|
12
|
-
...n,
|
|
13
|
-
...r,
|
|
14
|
-
modelValue: [String, Number]
|
|
15
|
-
},
|
|
16
|
-
emits: { ...t },
|
|
17
|
-
setup(t, { emit: n, slots: r, attrs: f }) {
|
|
18
|
-
let p = l(!1), { emitInput: m, render: h, placeholder: g, disabled: _, autoBind: v } = e(t, {
|
|
19
|
-
emit: n,
|
|
20
|
-
slots: r,
|
|
21
|
-
attrs: f,
|
|
22
|
-
events: i,
|
|
23
|
-
predicate: a
|
|
24
|
-
}), y = () => {
|
|
25
|
-
p.value = !0;
|
|
26
|
-
}, b = () => {
|
|
27
|
-
p.value = !1;
|
|
28
|
-
};
|
|
29
|
-
return () => h({ vNodes: s("div", { class: "cron" }, [s(d, {
|
|
30
|
-
placement: "bottom-start",
|
|
31
|
-
disabled: _.value,
|
|
32
|
-
modelValue: p.value,
|
|
33
|
-
"onUpdate:modelValue": (e) => p.value = e,
|
|
34
|
-
"popper-class": "cron-popover"
|
|
35
|
-
}, {
|
|
36
|
-
default: () => s(o, c(v.value, {
|
|
37
|
-
i18n: "cn",
|
|
38
|
-
expression: t.modelValue,
|
|
39
|
-
onChange: m,
|
|
40
|
-
onClose: b
|
|
41
|
-
}), null),
|
|
42
|
-
reference: () => s(u, {
|
|
43
|
-
modelValue: t.modelValue,
|
|
44
|
-
readonly: !0,
|
|
45
|
-
disabled: _.value,
|
|
46
|
-
placeholder: g.value,
|
|
47
|
-
onClick: y
|
|
48
|
-
}, null)
|
|
49
|
-
})]) });
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { f as t };
|