@web-utils/form-ui 1.0.0-beta75 → 1.0.0-beta77
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/chunks/{CzA5Lt_l2.mjs → B-WTB0ce2.mjs} +1 -1
- package/chunks/{DjFlEzPM2.mjs → BK6DiJfX2.mjs} +3 -3
- package/chunks/{aG2VZRRm2.mjs → BLBHnUme2.mjs} +1 -1
- package/chunks/{CMyOgBni2.mjs → BM8snKHN2.mjs} +1 -1
- package/chunks/{CEDZmNDG2.mjs → BTNnujZA2.mjs} +1 -1
- package/chunks/{DS86zxjN2.mjs → BVsvRLea2.mjs} +2 -2
- package/chunks/{BCI1maFm2.mjs → BaB0bq4I2.mjs} +1 -1
- package/chunks/{B2p5StJk2.mjs → BvlU_Z6D2.mjs} +1 -1
- package/chunks/{B5gBCT5G2.mjs → CI-pH-gR2.mjs} +1 -1
- package/chunks/{BA_en_FG2.mjs → CVM0lwn22.mjs} +1 -1
- package/chunks/{CizBLN6J2.mjs → CWaId08S2.mjs} +1 -1
- package/chunks/{Dv-_PE3-.mjs → CeEYChF4.mjs} +2 -2
- package/chunks/{Bh4XihEh.mjs → Cg6ahpHk.mjs} +1 -1
- package/chunks/{BoXQg1h12.mjs → CoPlnbwi2.mjs} +2 -2
- package/chunks/{C_UxYEd72.mjs → D5_ezGUV2.mjs} +2 -2
- package/chunks/{DCTK5oyK.mjs → DMDsZeqv.mjs} +1 -1
- package/chunks/{CfxgQ-wf2.mjs → DP7eF99m2.mjs} +1 -1
- package/chunks/{CstdEG9K2.mjs → DRXM1Mt22.mjs} +1 -1
- package/chunks/{nZTrOKQf2.mjs → DS4Iw8Y42.mjs} +66 -66
- package/chunks/{Cfz-cav7.mjs → Dgwcljur.mjs} +63 -41
- package/chunks/{_BhTD9wf.mjs → Dhdoa4M6.mjs} +1 -1
- package/chunks/{UCeucUsB.mjs → Dpzw7Rtp.mjs} +1 -1
- package/chunks/{BbO6NHlx2.mjs → JjnlFlI02.mjs} +109 -109
- package/chunks/{VbE4wwJT2.mjs → kAaQhLJs2.mjs} +1 -1
- package/chunks/{Cjxblk9N2.mjs → lPQBM7xc2.mjs} +2 -2
- package/chunks/{CBsdczGQ.mjs → ohCkWdwS.mjs} +1 -1
- package/chunks/{Bp4VotK62.mjs → uDwSrV7X2.mjs} +2 -2
- package/chunks/{C6AxHCkY2.mjs → x2jJ6cfy2.mjs} +1 -1
- package/form-cascader/index.mjs +1 -1
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.mjs +1 -1
- package/form-date-picker/index.mjs +1 -1
- package/form-image/index.mjs +1 -1
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.mjs +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -1
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.mjs +1 -1
- package/form-select/index.mjs +1 -1
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.mjs +1 -1
- package/form-table/index.mjs +1 -1
- package/form-table-plus/index.mjs +1 -1
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.mjs +1 -1
- package/form-time-select/index.mjs +1 -1
- package/form-tree-select/index.mjs +1 -1
- package/form-tree-select-multiple/index.mjs +1 -1
- package/helper/input.d.ts +3 -1
- package/helper/input.mjs +1 -1
- package/helper/sub-table-plus.d.ts +1 -1
- package/index.css +1 -1
- package/index.mjs +28 -28
- package/package.json +1 -1
- package/sub-table/index.mjs +1 -1
- package/sub-table-plus/index.mjs +1 -1
- package/table-view/index.mjs +1 -1
- package/tag-render/index.mjs +15 -16
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +36 -37
package/x-input-tag/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { t as e } from "../chunks/B1MSrc6f.mjs";
|
|
2
2
|
import { t } from "../chunks/mnqSaATq.mjs";
|
|
3
|
-
import { ElInput as n, ElMessage as r, ElPopover as i, ElTag as a } from "element-plus/es";
|
|
3
|
+
import { ElInput as n, ElMessage as r, ElPopover as i, ElTag as a, formContextKey as o, formItemContextKey as s } from "element-plus/es";
|
|
4
4
|
import "element-plus/es/components/base/style/css";
|
|
5
5
|
import "element-plus/es/components/input/style/css";
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { isArray as
|
|
6
|
+
import { Fragment as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, nextTick as m, normalizeClass as h, openBlock as g, renderList as _, toDisplayString as v, vShow as y, withCtx as b, withDirectives as x, withKeys as S } from "vue";
|
|
7
|
+
import { isArray as C, isDef as w, isPlainObject as T, scrollIntoView as E } from "@web-utils/core";
|
|
8
8
|
import "element-plus/es/components/message/style/css";
|
|
9
|
-
import { debounce as
|
|
10
|
-
import { formContextKey as E, formItemContextKey as D } from "element-plus";
|
|
9
|
+
import { debounce as D } from "lodash-es";
|
|
11
10
|
import "element-plus/es/components/popover/style/css";
|
|
12
11
|
import "element-plus/es/components/tag/style/css";
|
|
13
12
|
//#region src/components/form/XInputTag.vue
|
|
@@ -15,11 +14,11 @@ var O = {
|
|
|
15
14
|
name: "XInputTag",
|
|
16
15
|
inject: {
|
|
17
16
|
elForm: {
|
|
18
|
-
from:
|
|
17
|
+
from: o,
|
|
19
18
|
default: ""
|
|
20
19
|
},
|
|
21
20
|
elFormItem: {
|
|
22
|
-
from:
|
|
21
|
+
from: s,
|
|
23
22
|
default: ""
|
|
24
23
|
}
|
|
25
24
|
},
|
|
@@ -74,7 +73,7 @@ var O = {
|
|
|
74
73
|
}) : this.modelValue : [];
|
|
75
74
|
} else {
|
|
76
75
|
var t;
|
|
77
|
-
let e = this.arrayMode ? this.modelValue || [] :
|
|
76
|
+
let e = this.arrayMode ? this.modelValue || [] : C(this.modelValue) ? this.modelValue : ((t = this.modelValue) == null ? void 0 : t.split(this.separator)) || [];
|
|
78
77
|
return e.length && e[0] ? e.map((e) => this.objectMode ? {
|
|
79
78
|
name: e,
|
|
80
79
|
id: null
|
|
@@ -83,25 +82,25 @@ var O = {
|
|
|
83
82
|
} }
|
|
84
83
|
},
|
|
85
84
|
created() {
|
|
86
|
-
this.query && (this.debounceQuery =
|
|
85
|
+
this.query && (this.debounceQuery = D(async () => {
|
|
87
86
|
this.query ? (this.items = await this.query(this.inputValue), this.currentIndex = 0) : this.currentIndex = null;
|
|
88
87
|
}, 200));
|
|
89
88
|
},
|
|
90
89
|
methods: {
|
|
91
90
|
async showInput() {
|
|
92
91
|
var e;
|
|
93
|
-
this.inputVisible = !0, await
|
|
92
|
+
this.inputVisible = !0, await m(), this.$refs.saveTagInput.$refs.input.focus(), (e = this.items) != null && e.length && (this.currentIndex = 0);
|
|
94
93
|
},
|
|
95
94
|
handleClose(e) {
|
|
96
95
|
let t = this.tags.filter((t) => t !== e);
|
|
97
96
|
this.$emit("update:modelValue", this.arrayMode ? t : t.map((e) => e.name || e).join(this.separator));
|
|
98
97
|
},
|
|
99
98
|
async handleInputConfirm() {
|
|
100
|
-
await
|
|
99
|
+
await m(), w(this.currentIndex) && this.items[this.currentIndex] ? await this.addTag(this.items[this.currentIndex]) : this.inputValue ? await this.addTag(this.inputValue) : await this.reset();
|
|
101
100
|
},
|
|
102
101
|
async reset() {
|
|
103
102
|
var e;
|
|
104
|
-
(e = this.$refs.popover) == null || e.hide(), await
|
|
103
|
+
(e = this.$refs.popover) == null || e.hide(), await m(), this.inputVisible = !1, this.inputValue = "", this.currentIndex = null;
|
|
105
104
|
},
|
|
106
105
|
async addTag(e) {
|
|
107
106
|
if (this.tags.length >= this.maxTag) {
|
|
@@ -113,7 +112,7 @@ var O = {
|
|
|
113
112
|
}
|
|
114
113
|
if (e) {
|
|
115
114
|
var t;
|
|
116
|
-
let n =
|
|
115
|
+
let n = T(e);
|
|
117
116
|
if (this.tags.some((t) => (this.objectMode && t.name || t) === (n && e.name || e))) {
|
|
118
117
|
this.inputVisible = !1, this.inputValue = "", r.warning({
|
|
119
118
|
message: `${this.type}已存在!`,
|
|
@@ -147,7 +146,7 @@ var O = {
|
|
|
147
146
|
},
|
|
148
147
|
select(e) {
|
|
149
148
|
var t;
|
|
150
|
-
(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),
|
|
149
|
+
(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), E(this.$refs.list, this.$refs.items[this.currentIndex]));
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
}, k = { class: "x-input-tag" }, A = {
|
|
@@ -164,31 +163,31 @@ var O = {
|
|
|
164
163
|
ref: "list",
|
|
165
164
|
class: "dropdown-item-list"
|
|
166
165
|
}, N = ["onMouseenter", "onClick"];
|
|
167
|
-
function P(e, r,
|
|
166
|
+
function P(e, r, o, s, m, C) {
|
|
168
167
|
let w = a, T = n, E = t, D = i;
|
|
169
|
-
return
|
|
170
|
-
C.tags && C.tags.length && C.tags[0] ? (
|
|
168
|
+
return g(), d("div", k, [
|
|
169
|
+
C.tags && C.tags.length && C.tags[0] ? (g(!0), d(c, { key: 0 }, _(C.tags, (e, t) => (g(), l(w, {
|
|
171
170
|
key: e.id || e.name || e,
|
|
172
171
|
size: "small",
|
|
173
172
|
"disable-transitions": "",
|
|
174
173
|
closable: !C.inputDisabled,
|
|
175
174
|
onClose: (n) => C.handleClose(e, t)
|
|
176
175
|
}, {
|
|
177
|
-
default:
|
|
176
|
+
default: b(() => [p(v(e.name || e), 1)]),
|
|
178
177
|
_: 2
|
|
179
|
-
}, 1032, ["closable", "onClose"]))), 128)) : C.inputDisabled ? (
|
|
180
|
-
C.inputDisabled ?
|
|
178
|
+
}, 1032, ["closable", "onClose"]))), 128)) : C.inputDisabled ? (g(), d("span", A, "无")) : u("v-if", !0),
|
|
179
|
+
C.inputDisabled ? u("v-if", !0) : x((g(), l(T, {
|
|
181
180
|
key: 2,
|
|
182
181
|
ref: "saveTagInput",
|
|
183
|
-
modelValue:
|
|
184
|
-
"onUpdate:modelValue": [r[0] || (r[0] = (e) =>
|
|
182
|
+
modelValue: m.inputValue,
|
|
183
|
+
"onUpdate:modelValue": [r[0] || (r[0] = (e) => m.inputValue = e), C.tryQuery],
|
|
185
184
|
class: "input-new-tag",
|
|
186
185
|
size: "small",
|
|
187
186
|
onKeyup: [
|
|
188
|
-
r[1] || (r[1] =
|
|
189
|
-
r[2] || (r[2] =
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
r[1] || (r[1] = S((e) => C.select(1), ["up"])),
|
|
188
|
+
r[2] || (r[2] = S((e) => C.select(2), ["down"])),
|
|
189
|
+
S(C.onInputBlur, ["esc"]),
|
|
190
|
+
S(C.handleInputConfirm, ["enter"])
|
|
192
191
|
],
|
|
193
192
|
onBlur: C.onInputBlur
|
|
194
193
|
}, null, 8, [
|
|
@@ -196,18 +195,18 @@ function P(e, r, f, x, S, C) {
|
|
|
196
195
|
"onUpdate:modelValue",
|
|
197
196
|
"onKeyup",
|
|
198
197
|
"onBlur"
|
|
199
|
-
])), [[
|
|
200
|
-
!C.inputDisabled && !
|
|
198
|
+
])), [[y, m.inputVisible]]),
|
|
199
|
+
!C.inputDisabled && !m.inputVisible ? x((g(), l(E, {
|
|
201
200
|
key: 3,
|
|
202
201
|
class: "button-new-tag",
|
|
203
202
|
size: "small",
|
|
204
203
|
onClick: C.showInput
|
|
205
204
|
}, {
|
|
206
|
-
default:
|
|
205
|
+
default: b(() => [...r[3] || (r[3] = [p(" + 添加 ", -1)])]),
|
|
207
206
|
_: 1
|
|
208
|
-
}, 8, ["onClick"])), [[
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
}, 8, ["onClick"])), [[y, C.tags.length < m.maxTag]]) : u("v-if", !0),
|
|
208
|
+
o.count ? (g(), d("span", j, v(C.tags.length && C.tags[0] ? C.tags.length : ""), 1)) : u("v-if", !0),
|
|
209
|
+
o.query ? (g(), l(D, {
|
|
211
210
|
key: 5,
|
|
212
211
|
ref: "popover",
|
|
213
212
|
"virtual-ref": e.$refs.saveTagInput,
|
|
@@ -216,16 +215,16 @@ function P(e, r, f, x, S, C) {
|
|
|
216
215
|
"popper-class": "dropdown-popup",
|
|
217
216
|
trigger: "manual"
|
|
218
217
|
}, {
|
|
219
|
-
default:
|
|
218
|
+
default: b(() => [f("ul", M, [(g(!0), d(c, null, _(m.items, (e, t) => (g(), d("li", {
|
|
220
219
|
ref_for: !0,
|
|
221
220
|
ref: "items",
|
|
222
221
|
key: e.id || e.name || e,
|
|
223
|
-
class:
|
|
224
|
-
onMouseenter: (e) =>
|
|
222
|
+
class: h(["dropdown-item", { active: m.currentIndex === t }]),
|
|
223
|
+
onMouseenter: (e) => m.currentIndex = t,
|
|
225
224
|
onClick: (t) => C.onDropdownItemClick(e)
|
|
226
|
-
},
|
|
225
|
+
}, v(e.name || e), 43, N))), 128))], 512)]),
|
|
227
226
|
_: 1
|
|
228
|
-
}, 8, ["virtual-ref"])) :
|
|
227
|
+
}, 8, ["virtual-ref"])) : u("v-if", !0)
|
|
229
228
|
]);
|
|
230
229
|
}
|
|
231
230
|
var F = /* @__PURE__ */ e(O, [["render", P]]);
|