vue-devui 1.5.12 → 1.5.13-hotfix.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/auto-complete/index.es.js +139 -61
- package/auto-complete/index.umd.js +16 -16
- package/auto-complete/style.css +1 -1
- package/checkbox/index.es.js +115 -61
- package/checkbox/index.umd.js +15 -15
- package/checkbox/style.css +1 -1
- package/code-editor/index.es.js +5 -2
- package/code-editor/index.umd.js +6 -6
- package/code-review/index.es.js +12 -1
- package/code-review/index.umd.js +18 -18
- package/code-review/style.css +1 -1
- package/date-picker-pro/index.es.js +213 -109
- package/date-picker-pro/index.umd.js +19 -19
- package/date-picker-pro/style.css +1 -1
- package/editor-md/index.es.js +1 -1
- package/editor-md/index.umd.js +1 -1
- package/form/index.es.js +142 -64
- package/form/index.umd.js +14 -14
- package/form/style.css +1 -1
- package/image-preview/index.es.js +2 -6
- package/image-preview/index.umd.js +2 -2
- package/image-preview/style.css +1 -1
- package/input/index.es.js +207 -79
- package/input/index.umd.js +18 -18
- package/input/style.css +1 -1
- package/input-number/index.es.js +123 -46
- package/input-number/index.umd.js +20 -20
- package/input-number/style.css +1 -1
- package/mention/index.es.js +138 -60
- package/mention/index.umd.js +16 -16
- package/mention/style.css +1 -1
- package/nuxt/components/STYLE_TOKEN.js +3 -0
- package/nuxt/components/formControlProps.js +3 -0
- package/package.json +1 -1
- package/pagination/index.es.js +155 -89
- package/pagination/index.umd.js +13 -13
- package/pagination/style.css +1 -1
- package/progress/index.es.js +6 -6
- package/progress/index.umd.js +1 -1
- package/radio/index.es.js +115 -61
- package/radio/index.umd.js +16 -16
- package/radio/style.css +1 -1
- package/search/index.es.js +211 -83
- package/search/index.umd.js +19 -19
- package/search/style.css +1 -1
- package/select/index.es.js +148 -82
- package/select/index.umd.js +11 -11
- package/select/style.css +1 -1
- package/skeleton/index.es.js +1 -0
- package/skeleton/index.umd.js +2 -2
- package/steps/index.es.js +35 -11
- package/steps/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +115 -61
- package/switch/index.umd.js +14 -14
- package/switch/style.css +1 -1
- package/table/index.es.js +88 -34
- package/table/index.umd.js +15 -15
- package/table/style.css +1 -1
- package/textarea/index.es.js +141 -63
- package/textarea/index.umd.js +17 -17
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +159 -55
- package/time-picker/index.umd.js +11 -11
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +148 -82
- package/time-select/index.umd.js +17 -17
- package/time-select/style.css +1 -1
- package/tree/index.es.js +86 -32
- package/tree/index.umd.js +11 -11
- package/tree/style.css +1 -1
- package/types/auto-focus/index.d.ts +9 -0
- package/types/auto-focus/src/auto-focus-directive.d.ts +4 -0
- package/types/code-review/src/code-review-types.d.ts +6 -0
- package/types/code-review/src/code-review.d.ts +9 -0
- package/types/form/index.d.ts +1 -0
- package/types/form/src/components/form-control/use-form-control.d.ts +11 -2
- package/types/form/src/components/form-item/form-item-types.d.ts +10 -2
- package/types/form/src/components/form-item/form-item.d.ts +3 -3
- package/types/form/src/components/form-label/form-label.d.ts +1 -13
- package/types/form/src/components/form-label/use-form-label.d.ts +14 -2
- package/types/form/src/form-types.d.ts +11 -0
- package/types/form/src/form.d.ts +18 -0
- package/types/input/src/composables/use-input-event.d.ts +12 -2
- package/types/input/src/input-types.d.ts +8 -0
- package/types/input/src/input.d.ts +18 -0
- package/types/input-icon/src/input-icon.d.ts +18 -0
- package/types/list/index.d.ts +0 -1
- package/types/select/src/composables/use-select-menu-size.d.ts +5 -0
- package/types/vue-devui.d.ts +2 -1
- package/vue-devui.es.js +202 -70
- package/vue-devui.umd.js +78 -78
package/input/index.es.js
CHANGED
|
@@ -29,7 +29,8 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, provide, reactive, onUnmounted, Transition, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, onMounted, Teleport, createTextVNode, onBeforeUnmount, getCurrentInstance, shallowRef } from "vue";
|
|
32
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, provide, reactive, onUnmounted, Transition, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, onMounted, Teleport, createTextVNode, onBeforeUnmount, getCurrentInstance, shallowRef, resolveDirective } from "vue";
|
|
33
|
+
import "clipboard";
|
|
33
34
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
34
35
|
const DEFAULT_PREFIX = "icon";
|
|
35
36
|
const iconProps = {
|
|
@@ -81,7 +82,7 @@ const svgIconProps = {
|
|
|
81
82
|
default: "inherit"
|
|
82
83
|
}
|
|
83
84
|
};
|
|
84
|
-
function createBem(namespace, element, modifier) {
|
|
85
|
+
function createBem$1(namespace, element, modifier) {
|
|
85
86
|
let cls = namespace;
|
|
86
87
|
if (element) {
|
|
87
88
|
cls += `__${element}`;
|
|
@@ -91,12 +92,12 @@ function createBem(namespace, element, modifier) {
|
|
|
91
92
|
}
|
|
92
93
|
return cls;
|
|
93
94
|
}
|
|
94
|
-
function useNamespace(block, needDot = false) {
|
|
95
|
+
function useNamespace$1(block, needDot = false) {
|
|
95
96
|
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
96
|
-
const b = () => createBem(namespace);
|
|
97
|
-
const e = (element) => element ? createBem(namespace, element) : "";
|
|
98
|
-
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
99
|
-
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
97
|
+
const b = () => createBem$1(namespace);
|
|
98
|
+
const e = (element) => element ? createBem$1(namespace, element) : "";
|
|
99
|
+
const m = (modifier) => modifier ? createBem$1(namespace, "", modifier) : "";
|
|
100
|
+
const em = (element, modifier) => element && modifier ? createBem$1(namespace, element, modifier) : "";
|
|
100
101
|
return {
|
|
101
102
|
b,
|
|
102
103
|
e,
|
|
@@ -114,7 +115,7 @@ var svgIcon = defineComponent({
|
|
|
114
115
|
color,
|
|
115
116
|
size
|
|
116
117
|
} = toRefs(props);
|
|
117
|
-
const ns2 = useNamespace("svg-icon");
|
|
118
|
+
const ns2 = useNamespace$1("svg-icon");
|
|
118
119
|
const iconName = computed(() => `#icon-${name.value}`);
|
|
119
120
|
const iconSize = computed(() => {
|
|
120
121
|
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
@@ -146,7 +147,7 @@ function useIconDom(props, ctx) {
|
|
|
146
147
|
classPrefix,
|
|
147
148
|
rotate
|
|
148
149
|
} = toRefs(props);
|
|
149
|
-
const ns2 = useNamespace("icon");
|
|
150
|
+
const ns2 = useNamespace$1("icon");
|
|
150
151
|
const iconSize = computed(() => {
|
|
151
152
|
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
152
153
|
});
|
|
@@ -204,7 +205,7 @@ var Icon = defineComponent({
|
|
|
204
205
|
const {
|
|
205
206
|
iconDom
|
|
206
207
|
} = useIconDom(props, ctx);
|
|
207
|
-
const ns2 = useNamespace("icon");
|
|
208
|
+
const ns2 = useNamespace$1("icon");
|
|
208
209
|
const wrapClassed = computed(() => ({
|
|
209
210
|
[ns2.e("container")]: true,
|
|
210
211
|
[ns2.m("disabled")]: disabled.value,
|
|
@@ -226,6 +227,13 @@ var Icon = defineComponent({
|
|
|
226
227
|
};
|
|
227
228
|
}
|
|
228
229
|
});
|
|
230
|
+
var AutoFocus = {
|
|
231
|
+
mounted: (el, binding) => {
|
|
232
|
+
if (binding.value) {
|
|
233
|
+
el.focus();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
229
237
|
const inputProps = {
|
|
230
238
|
modelValue: {
|
|
231
239
|
type: String,
|
|
@@ -265,6 +273,14 @@ const inputProps = {
|
|
|
265
273
|
placeholder: {
|
|
266
274
|
type: String,
|
|
267
275
|
default: ""
|
|
276
|
+
},
|
|
277
|
+
title: {
|
|
278
|
+
type: String,
|
|
279
|
+
default: ""
|
|
280
|
+
},
|
|
281
|
+
autofocus: {
|
|
282
|
+
type: Boolean,
|
|
283
|
+
default: false
|
|
268
284
|
}
|
|
269
285
|
};
|
|
270
286
|
const formItemProps = {
|
|
@@ -293,7 +309,7 @@ const formItemProps = {
|
|
|
293
309
|
default: void 0
|
|
294
310
|
},
|
|
295
311
|
helpTips: {
|
|
296
|
-
type: String,
|
|
312
|
+
type: [String, Object],
|
|
297
313
|
default: ""
|
|
298
314
|
},
|
|
299
315
|
feedbackStatus: {
|
|
@@ -306,6 +322,48 @@ const formItemProps = {
|
|
|
306
322
|
};
|
|
307
323
|
const FORM_ITEM_TOKEN = Symbol("dFormItem");
|
|
308
324
|
const LABEL_DATA = Symbol("labelData");
|
|
325
|
+
function lockScroll() {
|
|
326
|
+
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
327
|
+
const scrollTop = document.documentElement.scrollTop;
|
|
328
|
+
const style = document.documentElement.getAttribute("style");
|
|
329
|
+
document.documentElement.style.position = "fixed";
|
|
330
|
+
document.documentElement.style.top = `-${scrollTop}px`;
|
|
331
|
+
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
332
|
+
document.documentElement.style.overflowY = "scroll";
|
|
333
|
+
return () => {
|
|
334
|
+
if (style) {
|
|
335
|
+
document.documentElement.setAttribute("style", style);
|
|
336
|
+
} else {
|
|
337
|
+
document.documentElement.removeAttribute("style");
|
|
338
|
+
}
|
|
339
|
+
document.documentElement.scrollTop = scrollTop;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
function createBem(namespace, element, modifier) {
|
|
345
|
+
let cls = namespace;
|
|
346
|
+
if (element) {
|
|
347
|
+
cls += `__${element}`;
|
|
348
|
+
}
|
|
349
|
+
if (modifier) {
|
|
350
|
+
cls += `--${modifier}`;
|
|
351
|
+
}
|
|
352
|
+
return cls;
|
|
353
|
+
}
|
|
354
|
+
function useNamespace(block, needDot = false) {
|
|
355
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
356
|
+
const b = () => createBem(namespace);
|
|
357
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
358
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
359
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
360
|
+
return {
|
|
361
|
+
b,
|
|
362
|
+
e,
|
|
363
|
+
m,
|
|
364
|
+
em
|
|
365
|
+
};
|
|
366
|
+
}
|
|
309
367
|
const formProps = {
|
|
310
368
|
data: {
|
|
311
369
|
type: Object,
|
|
@@ -352,9 +410,18 @@ const formProps = {
|
|
|
352
410
|
hideRequiredMark: {
|
|
353
411
|
type: Boolean,
|
|
354
412
|
default: false
|
|
413
|
+
},
|
|
414
|
+
styleType: {
|
|
415
|
+
type: String,
|
|
416
|
+
default: "default"
|
|
417
|
+
},
|
|
418
|
+
appendToBodyScrollStrategy: {
|
|
419
|
+
type: String,
|
|
420
|
+
default: "reposition"
|
|
355
421
|
}
|
|
356
422
|
};
|
|
357
423
|
const FORM_TOKEN = Symbol("dForm");
|
|
424
|
+
const STYLE_TOKEN = Symbol("dForm");
|
|
358
425
|
function useFieldCollection() {
|
|
359
426
|
const itemContexts = [];
|
|
360
427
|
const addItemContext = (field) => {
|
|
@@ -1545,7 +1612,7 @@ var lodash = { exports: {} };
|
|
|
1545
1612
|
if (typeof func != "function") {
|
|
1546
1613
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
1547
1614
|
}
|
|
1548
|
-
return
|
|
1615
|
+
return setTimeout2(function() {
|
|
1549
1616
|
func.apply(undefined$1, args);
|
|
1550
1617
|
}, wait);
|
|
1551
1618
|
}
|
|
@@ -3354,7 +3421,7 @@ var lodash = { exports: {} };
|
|
|
3354
3421
|
return object4[key];
|
|
3355
3422
|
}
|
|
3356
3423
|
var setData = shortOut(baseSetData);
|
|
3357
|
-
var
|
|
3424
|
+
var setTimeout2 = ctxSetTimeout || function(func, wait) {
|
|
3358
3425
|
return root.setTimeout(func, wait);
|
|
3359
3426
|
};
|
|
3360
3427
|
var setToString = shortOut(baseSetToString);
|
|
@@ -4146,7 +4213,7 @@ var lodash = { exports: {} };
|
|
|
4146
4213
|
}
|
|
4147
4214
|
function leadingEdge(time) {
|
|
4148
4215
|
lastInvokeTime = time;
|
|
4149
|
-
timerId =
|
|
4216
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4150
4217
|
return leading ? invokeFunc(time) : result2;
|
|
4151
4218
|
}
|
|
4152
4219
|
function remainingWait(time) {
|
|
@@ -4162,7 +4229,7 @@ var lodash = { exports: {} };
|
|
|
4162
4229
|
if (shouldInvoke(time)) {
|
|
4163
4230
|
return trailingEdge(time);
|
|
4164
4231
|
}
|
|
4165
|
-
timerId =
|
|
4232
|
+
timerId = setTimeout2(timerExpired, remainingWait(time));
|
|
4166
4233
|
}
|
|
4167
4234
|
function trailingEdge(time) {
|
|
4168
4235
|
timerId = undefined$1;
|
|
@@ -4193,12 +4260,12 @@ var lodash = { exports: {} };
|
|
|
4193
4260
|
}
|
|
4194
4261
|
if (maxing) {
|
|
4195
4262
|
clearTimeout(timerId);
|
|
4196
|
-
timerId =
|
|
4263
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4197
4264
|
return invokeFunc(lastCallTime);
|
|
4198
4265
|
}
|
|
4199
4266
|
}
|
|
4200
4267
|
if (timerId === undefined$1) {
|
|
4201
|
-
timerId =
|
|
4268
|
+
timerId = setTimeout2(timerExpired, wait);
|
|
4202
4269
|
}
|
|
4203
4270
|
return result2;
|
|
4204
4271
|
}
|
|
@@ -5861,6 +5928,7 @@ defineComponent({
|
|
|
5861
5928
|
addItemContext,
|
|
5862
5929
|
removeItemContext
|
|
5863
5930
|
})));
|
|
5931
|
+
provide(STYLE_TOKEN, props.styleType);
|
|
5864
5932
|
ctx.expose({
|
|
5865
5933
|
validate,
|
|
5866
5934
|
validateFields,
|
|
@@ -5876,12 +5944,6 @@ defineComponent({
|
|
|
5876
5944
|
};
|
|
5877
5945
|
}
|
|
5878
5946
|
});
|
|
5879
|
-
const formLabelProps = {
|
|
5880
|
-
helpTips: {
|
|
5881
|
-
type: String,
|
|
5882
|
-
default: ""
|
|
5883
|
-
}
|
|
5884
|
-
};
|
|
5885
5947
|
const fixedOverlayProps = {
|
|
5886
5948
|
modelValue: {
|
|
5887
5949
|
type: Boolean,
|
|
@@ -5896,25 +5958,6 @@ const fixedOverlayProps = {
|
|
|
5896
5958
|
default: true
|
|
5897
5959
|
}
|
|
5898
5960
|
};
|
|
5899
|
-
function lockScroll() {
|
|
5900
|
-
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
5901
|
-
const scrollTop = document.documentElement.scrollTop;
|
|
5902
|
-
const style = document.documentElement.getAttribute("style");
|
|
5903
|
-
document.documentElement.style.position = "fixed";
|
|
5904
|
-
document.documentElement.style.top = `-${scrollTop}px`;
|
|
5905
|
-
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
5906
|
-
document.documentElement.style.overflowY = "scroll";
|
|
5907
|
-
return () => {
|
|
5908
|
-
if (style) {
|
|
5909
|
-
document.documentElement.setAttribute("style", style);
|
|
5910
|
-
} else {
|
|
5911
|
-
document.documentElement.removeAttribute("style");
|
|
5912
|
-
}
|
|
5913
|
-
document.documentElement.scrollTop = scrollTop;
|
|
5914
|
-
};
|
|
5915
|
-
}
|
|
5916
|
-
return;
|
|
5917
|
-
}
|
|
5918
5961
|
function useFixedOverlay(props, ctx) {
|
|
5919
5962
|
let lockScrollCb;
|
|
5920
5963
|
const onClick = (event) => {
|
|
@@ -5947,7 +5990,7 @@ defineComponent({
|
|
|
5947
5990
|
const {
|
|
5948
5991
|
modelValue
|
|
5949
5992
|
} = toRefs(props);
|
|
5950
|
-
const ns2 = useNamespace("fixed-overlay");
|
|
5993
|
+
const ns2 = useNamespace$1("fixed-overlay");
|
|
5951
5994
|
const {
|
|
5952
5995
|
onClick
|
|
5953
5996
|
} = useFixedOverlay(props, ctx);
|
|
@@ -6113,7 +6156,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
6113
6156
|
emit,
|
|
6114
6157
|
expose
|
|
6115
6158
|
}) {
|
|
6116
|
-
const ns2 = useNamespace("flexible-overlay");
|
|
6159
|
+
const ns2 = useNamespace$1("flexible-overlay");
|
|
6117
6160
|
const {
|
|
6118
6161
|
clickEventBubble
|
|
6119
6162
|
} = toRefs(props);
|
|
@@ -6142,7 +6185,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
6142
6185
|
});
|
|
6143
6186
|
const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
|
|
6144
6187
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
6145
|
-
const ns$1 = useNamespace("popper-trigger");
|
|
6188
|
+
const ns$1 = useNamespace$1("popper-trigger");
|
|
6146
6189
|
function wrapContent(content) {
|
|
6147
6190
|
return h("span", { class: ns$1.b() }, content);
|
|
6148
6191
|
}
|
|
@@ -6329,7 +6372,7 @@ function usePopoverEvent(props, visible, origin) {
|
|
|
6329
6372
|
});
|
|
6330
6373
|
return { placement, handlePositionChange, onMouseenter, onMouseleave };
|
|
6331
6374
|
}
|
|
6332
|
-
const ns = useNamespace("popover");
|
|
6375
|
+
const ns = useNamespace$1("popover");
|
|
6333
6376
|
function SuccessIcon$1() {
|
|
6334
6377
|
return createVNode("svg", {
|
|
6335
6378
|
"class": [ns.e("icon"), ns.em("icon", "success")],
|
|
@@ -6431,7 +6474,7 @@ var PopoverIcon = defineComponent({
|
|
|
6431
6474
|
}
|
|
6432
6475
|
},
|
|
6433
6476
|
setup(props) {
|
|
6434
|
-
const ns2 = useNamespace("popover");
|
|
6477
|
+
const ns2 = useNamespace$1("popover");
|
|
6435
6478
|
return () => props.type && props.type !== "default" && createVNode("span", {
|
|
6436
6479
|
"class": ns2.e("icon-wrap")
|
|
6437
6480
|
}, [props.type === "success" && createVNode(SuccessIcon$1, null, null), props.type === "warning" && createVNode(WarningIcon, null, null), props.type === "info" && createVNode(InfoIcon, null, null), props.type === "error" && createVNode(ErrorIcon$1, null, null)]);
|
|
@@ -6468,7 +6511,7 @@ var Popover = defineComponent({
|
|
|
6468
6511
|
const {
|
|
6469
6512
|
overlayStyles
|
|
6470
6513
|
} = usePopover(props, visible, placement, origin, popoverRef);
|
|
6471
|
-
const ns2 = useNamespace("popover");
|
|
6514
|
+
const ns2 = useNamespace$1("popover");
|
|
6472
6515
|
provide(POPPER_TRIGGER_TOKEN, origin);
|
|
6473
6516
|
watch(visible, (newVal) => {
|
|
6474
6517
|
if (newVal) {
|
|
@@ -6602,6 +6645,12 @@ function useFormLabel() {
|
|
|
6602
6645
|
const formItemContext = inject(FORM_ITEM_TOKEN);
|
|
6603
6646
|
const labelData = inject(LABEL_DATA);
|
|
6604
6647
|
const ns2 = useNamespace("form");
|
|
6648
|
+
const defaultTipsPopover = {
|
|
6649
|
+
content: "",
|
|
6650
|
+
position: ["top"],
|
|
6651
|
+
trigger: "hover",
|
|
6652
|
+
popType: "info"
|
|
6653
|
+
};
|
|
6605
6654
|
const labelClasses = computed(() => ({
|
|
6606
6655
|
[`${ns2.e("label")}`]: true,
|
|
6607
6656
|
[`${ns2.em("label", "vertical")}`]: labelData.value.layout === "vertical",
|
|
@@ -6613,17 +6662,24 @@ function useFormLabel() {
|
|
|
6613
6662
|
[`${ns2.em("label", "required")}`]: formItemContext.isRequired,
|
|
6614
6663
|
[`${ns2.em("label", "required-hide")}`]: formItemContext.isRequired && formContext.hideRequiredMark
|
|
6615
6664
|
}));
|
|
6616
|
-
|
|
6665
|
+
const tipsPopover = computed(() => {
|
|
6666
|
+
if (typeof labelData.value.helpTips === "string") {
|
|
6667
|
+
return __spreadProps(__spreadValues({}, defaultTipsPopover), { content: labelData.value.helpTips });
|
|
6668
|
+
} else {
|
|
6669
|
+
return __spreadValues(__spreadValues({}, defaultTipsPopover), labelData.value.helpTips);
|
|
6670
|
+
}
|
|
6671
|
+
});
|
|
6672
|
+
return { labelClasses, labelInnerClasses, tipsPopover };
|
|
6617
6673
|
}
|
|
6618
6674
|
var formLabel = "";
|
|
6619
6675
|
var FormLabel = defineComponent({
|
|
6620
6676
|
name: "DFormLabel",
|
|
6621
|
-
|
|
6622
|
-
setup(props, ctx) {
|
|
6677
|
+
setup(_, ctx) {
|
|
6623
6678
|
const ns2 = useNamespace("form");
|
|
6624
6679
|
const {
|
|
6625
6680
|
labelClasses,
|
|
6626
|
-
labelInnerClasses
|
|
6681
|
+
labelInnerClasses,
|
|
6682
|
+
tipsPopover
|
|
6627
6683
|
} = useFormLabel();
|
|
6628
6684
|
return () => {
|
|
6629
6685
|
var _a, _b;
|
|
@@ -6631,12 +6687,9 @@ var FormLabel = defineComponent({
|
|
|
6631
6687
|
"class": labelClasses.value
|
|
6632
6688
|
}, [createVNode("span", {
|
|
6633
6689
|
"class": labelInnerClasses.value
|
|
6634
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]),
|
|
6635
|
-
"
|
|
6636
|
-
|
|
6637
|
-
"trigger": "hover",
|
|
6638
|
-
"pop-type": "info"
|
|
6639
|
-
}, {
|
|
6690
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), tipsPopover.value.content && createVNode(Popover, mergeProps({
|
|
6691
|
+
"class": ns2.e("label-tips-popover")
|
|
6692
|
+
}, tipsPopover.value), {
|
|
6640
6693
|
default: () => [createVNode(HelpTipsIcon, {
|
|
6641
6694
|
"class": ns2.e("label-help")
|
|
6642
6695
|
}, null), createTextVNode(",")]
|
|
@@ -6667,7 +6720,7 @@ function useFormControl(props) {
|
|
|
6667
6720
|
[ns2.em("control-container", "has-feedback")]: Boolean(feedbackStatus == null ? void 0 : feedbackStatus.value),
|
|
6668
6721
|
[ns2.em("control-container", "feedback-error")]: Boolean((feedbackStatus == null ? void 0 : feedbackStatus.value) === "error")
|
|
6669
6722
|
}));
|
|
6670
|
-
return { controlClasses, controlContainerClasses };
|
|
6723
|
+
return { controlClasses, controlContainerClasses, labelData };
|
|
6671
6724
|
}
|
|
6672
6725
|
function useFormControlValidate() {
|
|
6673
6726
|
const formItemContext = inject(FORM_ITEM_TOKEN);
|
|
@@ -6684,11 +6737,15 @@ var FormControl = defineComponent({
|
|
|
6684
6737
|
name: "DFormControl",
|
|
6685
6738
|
props: formControlProps,
|
|
6686
6739
|
setup(props, ctx) {
|
|
6740
|
+
const formContext = inject(FORM_TOKEN);
|
|
6687
6741
|
const formControl2 = ref();
|
|
6742
|
+
const popoverRef = ref();
|
|
6688
6743
|
const ns2 = useNamespace("form");
|
|
6744
|
+
const showPopoverClick = ref(true);
|
|
6689
6745
|
const {
|
|
6690
6746
|
controlClasses,
|
|
6691
|
-
controlContainerClasses
|
|
6747
|
+
controlContainerClasses,
|
|
6748
|
+
labelData
|
|
6692
6749
|
} = useFormControl(props);
|
|
6693
6750
|
const {
|
|
6694
6751
|
feedbackStatus,
|
|
@@ -6698,17 +6755,52 @@ var FormControl = defineComponent({
|
|
|
6698
6755
|
errorMessage,
|
|
6699
6756
|
popPosition
|
|
6700
6757
|
} = useFormControlValidate();
|
|
6758
|
+
const align = computed(() => {
|
|
6759
|
+
var _a, _b;
|
|
6760
|
+
if ((_a = popPosition.value) == null ? void 0 : _a.some((item) => item.includes("start"))) {
|
|
6761
|
+
return "start";
|
|
6762
|
+
}
|
|
6763
|
+
if ((_b = popPosition.value) == null ? void 0 : _b.some((item) => item.includes("end"))) {
|
|
6764
|
+
return "end";
|
|
6765
|
+
}
|
|
6766
|
+
return void 0;
|
|
6767
|
+
});
|
|
6768
|
+
const onDocumentClick = (e) => {
|
|
6769
|
+
const composedPath = e.composedPath();
|
|
6770
|
+
if (composedPath.includes(popoverRef.value.triggerEl)) {
|
|
6771
|
+
showPopoverClick.value = true;
|
|
6772
|
+
} else {
|
|
6773
|
+
showPopoverClick.value = false;
|
|
6774
|
+
}
|
|
6775
|
+
};
|
|
6776
|
+
watch(showPopover, (val) => {
|
|
6777
|
+
if (val) {
|
|
6778
|
+
setTimeout(() => {
|
|
6779
|
+
document.addEventListener("click", onDocumentClick);
|
|
6780
|
+
});
|
|
6781
|
+
} else {
|
|
6782
|
+
showPopoverClick.value = true;
|
|
6783
|
+
document.removeEventListener("click", onDocumentClick);
|
|
6784
|
+
}
|
|
6785
|
+
});
|
|
6786
|
+
onUnmounted(() => {
|
|
6787
|
+
document.removeEventListener("click", onDocumentClick);
|
|
6788
|
+
});
|
|
6701
6789
|
return () => createVNode("div", {
|
|
6702
6790
|
"class": controlClasses.value,
|
|
6703
6791
|
"ref": formControl2
|
|
6704
6792
|
}, [createVNode("div", {
|
|
6705
6793
|
"class": controlContainerClasses.value
|
|
6706
6794
|
}, [createVNode(Popover, {
|
|
6707
|
-
"
|
|
6795
|
+
"ref": popoverRef,
|
|
6796
|
+
"is-open": showPopover.value && showPopoverClick.value,
|
|
6708
6797
|
"trigger": "manually",
|
|
6709
6798
|
"content": errorMessage.value,
|
|
6710
6799
|
"pop-type": "error",
|
|
6711
|
-
"position": popPosition.value
|
|
6800
|
+
"position": popPosition.value,
|
|
6801
|
+
"align": align.value,
|
|
6802
|
+
"scroll-element": "auto",
|
|
6803
|
+
"append-to-body-scroll-strategy": formContext.appendToBodyScrollStrategy
|
|
6712
6804
|
}, {
|
|
6713
6805
|
default: () => {
|
|
6714
6806
|
var _a, _b;
|
|
@@ -6720,7 +6812,7 @@ var FormControl = defineComponent({
|
|
|
6720
6812
|
"class": ns2.e("control-info")
|
|
6721
6813
|
}, [showMessage.value && createVNode("div", {
|
|
6722
6814
|
"class": "error-message"
|
|
6723
|
-
}, [errorMessage.value]), props.extraInfo && createVNode("div", {
|
|
6815
|
+
}, [errorMessage.value]), labelData.value.formItemCtx.slots.extraInfo ? labelData.value.formItemCtx.slots.extraInfo() : props.extraInfo && createVNode("div", {
|
|
6724
6816
|
"class": ns2.e("control-extra")
|
|
6725
6817
|
}, [props.extraInfo])])]);
|
|
6726
6818
|
}
|
|
@@ -7903,7 +7995,9 @@ defineComponent({
|
|
|
7903
7995
|
const labelData = computed(() => ({
|
|
7904
7996
|
layout: formContext.layout,
|
|
7905
7997
|
labelSize: formContext.labelSize,
|
|
7906
|
-
labelAlign: formContext.labelAlign
|
|
7998
|
+
labelAlign: formContext.labelAlign,
|
|
7999
|
+
helpTips: helpTips.value,
|
|
8000
|
+
formItemCtx: ctx
|
|
7907
8001
|
}));
|
|
7908
8002
|
provide(LABEL_DATA, labelData);
|
|
7909
8003
|
const context = reactive(__spreadProps(__spreadValues({}, otherProps), {
|
|
@@ -7919,6 +8013,7 @@ defineComponent({
|
|
|
7919
8013
|
}));
|
|
7920
8014
|
provide(FORM_ITEM_TOKEN, context);
|
|
7921
8015
|
ctx.expose({
|
|
8016
|
+
validate,
|
|
7922
8017
|
resetField,
|
|
7923
8018
|
clearValidate
|
|
7924
8019
|
});
|
|
@@ -7932,9 +8027,7 @@ defineComponent({
|
|
|
7932
8027
|
});
|
|
7933
8028
|
return () => createVNode("div", {
|
|
7934
8029
|
"class": itemClasses.value
|
|
7935
|
-
}, [createVNode(FormLabel, {
|
|
7936
|
-
"help-tips": helpTips.value
|
|
7937
|
-
}, {
|
|
8030
|
+
}, [createVNode(FormLabel, null, {
|
|
7938
8031
|
default: () => [ctx.slots.label ? ctx.slots.label() : label == null ? void 0 : label.value]
|
|
7939
8032
|
}), createVNode(FormControl, {
|
|
7940
8033
|
"feedback-status": feedbackStatus == null ? void 0 : feedbackStatus.value,
|
|
@@ -7980,6 +8073,7 @@ function useInputRender(props, ctx) {
|
|
|
7980
8073
|
const slots = ctx.slots;
|
|
7981
8074
|
const inputDisabled = computed(() => disabled.value || (formContext == null ? void 0 : formContext.disabled));
|
|
7982
8075
|
const inputSize = computed(() => (size == null ? void 0 : size.value) || (formContext == null ? void 0 : formContext.size) || "");
|
|
8076
|
+
const styleType = inject(STYLE_TOKEN, void 0);
|
|
7983
8077
|
const _a = ctx.attrs, { style, class: customClass } = _a, otherAttrs = __objRest(_a, ["style", "class"]);
|
|
7984
8078
|
const customStyle = { style };
|
|
7985
8079
|
const wrapClasses = computed(() => ({
|
|
@@ -7995,7 +8089,8 @@ function useInputRender(props, ctx) {
|
|
|
7995
8089
|
[ns2.m(inputSize.value)]: Boolean(inputSize.value),
|
|
7996
8090
|
[slotNs.b()]: slots.prepend || slots.append,
|
|
7997
8091
|
[ns2.m("append")]: slots.append,
|
|
7998
|
-
[ns2.m("prepend")]: slots.prepend
|
|
8092
|
+
[ns2.m("prepend")]: slots.prepend,
|
|
8093
|
+
[ns2.m("gray-style")]: styleType === "gray"
|
|
7999
8094
|
},
|
|
8000
8095
|
customClass
|
|
8001
8096
|
]);
|
|
@@ -8003,6 +8098,7 @@ function useInputRender(props, ctx) {
|
|
|
8003
8098
|
}
|
|
8004
8099
|
function useInputEvent(isFocus, props, ctx, focus) {
|
|
8005
8100
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
8101
|
+
const isComposition = ref(false);
|
|
8006
8102
|
const onFocus = (e) => {
|
|
8007
8103
|
isFocus.value = true;
|
|
8008
8104
|
ctx.emit("focus", e);
|
|
@@ -8016,6 +8112,9 @@ function useInputEvent(isFocus, props, ctx, focus) {
|
|
|
8016
8112
|
};
|
|
8017
8113
|
const onInput = (e) => {
|
|
8018
8114
|
ctx.emit("input", e.target.value);
|
|
8115
|
+
if (isComposition.value) {
|
|
8116
|
+
return;
|
|
8117
|
+
}
|
|
8019
8118
|
ctx.emit("update:modelValue", e.target.value);
|
|
8020
8119
|
};
|
|
8021
8120
|
const onChange = (e) => {
|
|
@@ -8029,7 +8128,22 @@ function useInputEvent(isFocus, props, ctx, focus) {
|
|
|
8029
8128
|
ctx.emit("clear");
|
|
8030
8129
|
focus();
|
|
8031
8130
|
};
|
|
8032
|
-
|
|
8131
|
+
const onCompositionStart = () => {
|
|
8132
|
+
isComposition.value = true;
|
|
8133
|
+
};
|
|
8134
|
+
const onCompositionUpdate = (e) => {
|
|
8135
|
+
var _a;
|
|
8136
|
+
const text = (_a = e.target) == null ? void 0 : _a.value;
|
|
8137
|
+
const lastCharacter = text[text.length - 1] || "";
|
|
8138
|
+
isComposition.value = !/([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi.test(lastCharacter);
|
|
8139
|
+
};
|
|
8140
|
+
const onCompositionEnd = (e) => {
|
|
8141
|
+
if (isComposition.value) {
|
|
8142
|
+
isComposition.value = false;
|
|
8143
|
+
onInput(e);
|
|
8144
|
+
}
|
|
8145
|
+
};
|
|
8146
|
+
return { onFocus, onBlur, onInput, onChange, onKeydown, onClear, onCompositionStart, onCompositionUpdate, onCompositionEnd };
|
|
8033
8147
|
}
|
|
8034
8148
|
function useInputFunction(input2) {
|
|
8035
8149
|
const refInput = computed(() => input2.value);
|
|
@@ -8219,6 +8333,9 @@ function createI18nTranslate(name, app, newPrefix) {
|
|
|
8219
8333
|
}
|
|
8220
8334
|
var Input = defineComponent({
|
|
8221
8335
|
name: "DInput",
|
|
8336
|
+
directives: {
|
|
8337
|
+
dAutoFocus: AutoFocus
|
|
8338
|
+
},
|
|
8222
8339
|
inheritAttrs: false,
|
|
8223
8340
|
props: inputProps,
|
|
8224
8341
|
emits: ["update:modelValue", "focus", "blur", "input", "change", "keydown", "clear"],
|
|
@@ -8227,7 +8344,10 @@ var Input = defineComponent({
|
|
|
8227
8344
|
const t = createI18nTranslate("DInput", app);
|
|
8228
8345
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
8229
8346
|
const {
|
|
8230
|
-
modelValue
|
|
8347
|
+
modelValue,
|
|
8348
|
+
placeholder,
|
|
8349
|
+
title,
|
|
8350
|
+
autofocus
|
|
8231
8351
|
} = toRefs(props);
|
|
8232
8352
|
const ns2 = useNamespace("input");
|
|
8233
8353
|
const slotNs = useNamespace("input-slot");
|
|
@@ -8252,7 +8372,10 @@ var Input = defineComponent({
|
|
|
8252
8372
|
onInput,
|
|
8253
8373
|
onChange,
|
|
8254
8374
|
onKeydown,
|
|
8255
|
-
onClear
|
|
8375
|
+
onClear,
|
|
8376
|
+
onCompositionStart,
|
|
8377
|
+
onCompositionUpdate,
|
|
8378
|
+
onCompositionEnd
|
|
8256
8379
|
} = useInputEvent(isFocus, props, ctx, focus);
|
|
8257
8380
|
const passwordVisible = ref(false);
|
|
8258
8381
|
const clickPasswordIcon = () => {
|
|
@@ -8277,7 +8400,7 @@ var Input = defineComponent({
|
|
|
8277
8400
|
blur
|
|
8278
8401
|
});
|
|
8279
8402
|
return () => {
|
|
8280
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8403
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
8281
8404
|
return createVNode("div", mergeProps({
|
|
8282
8405
|
"class": inputClasses.value
|
|
8283
8406
|
}, customStyle), [ctx.slots.prepend && createVNode("div", {
|
|
@@ -8289,25 +8412,29 @@ var Input = defineComponent({
|
|
|
8289
8412
|
}, [ctx.slots.prefix && ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)), props.prefix && createVNode(Icon, {
|
|
8290
8413
|
"size": inputSize.value,
|
|
8291
8414
|
"name": props.prefix
|
|
8292
|
-
}, null)]), createVNode("input", mergeProps({
|
|
8415
|
+
}, null)]), withDirectives(createVNode("input", mergeProps({
|
|
8293
8416
|
"ref": input2,
|
|
8294
8417
|
"value": modelValue.value,
|
|
8295
8418
|
"disabled": inputDisabled.value,
|
|
8296
8419
|
"class": ns2.e("inner"),
|
|
8297
|
-
"placeholder":
|
|
8420
|
+
"placeholder": (_e = placeholder.value) != null ? _e : t("placeholder")
|
|
8298
8421
|
}, otherAttrs, {
|
|
8422
|
+
"title": title.value,
|
|
8299
8423
|
"type": props.showPassword ? passwordVisible.value ? "text" : "password" : "text",
|
|
8300
8424
|
"onInput": onInput,
|
|
8301
8425
|
"onFocus": onFocus,
|
|
8302
8426
|
"onBlur": onBlur,
|
|
8303
8427
|
"onChange": onChange,
|
|
8304
|
-
"onKeydown": onKeydown
|
|
8305
|
-
|
|
8428
|
+
"onKeydown": onKeydown,
|
|
8429
|
+
"onCompositionstart": onCompositionStart,
|
|
8430
|
+
"onCompositionupdate": onCompositionUpdate,
|
|
8431
|
+
"onCompositionend": onCompositionEnd
|
|
8432
|
+
}), null), [[resolveDirective("dAutoFocus"), autofocus.value]]), suffixVisible && createVNode("span", {
|
|
8306
8433
|
"class": slotNs.e("suffix")
|
|
8307
8434
|
}, [props.suffix && createVNode(Icon, {
|
|
8308
8435
|
"size": inputSize.value,
|
|
8309
8436
|
"name": props.suffix
|
|
8310
|
-
}, null), ctx.slots.suffix && ((
|
|
8437
|
+
}, null), ctx.slots.suffix && ((_g = (_f = ctx.slots).suffix) == null ? void 0 : _g.call(_f)), showPwdVisible.value && createVNode(Icon, {
|
|
8311
8438
|
"size": inputSize.value,
|
|
8312
8439
|
"class": ns2.em("password", "icon"),
|
|
8313
8440
|
"name": passwordVisible.value ? "preview" : "preview-forbidden",
|
|
@@ -8315,11 +8442,12 @@ var Input = defineComponent({
|
|
|
8315
8442
|
}, null), showClearable.value && createVNode(Icon, {
|
|
8316
8443
|
"size": inputSize.value,
|
|
8317
8444
|
"class": ns2.em("clear", "icon"),
|
|
8318
|
-
"name": "
|
|
8445
|
+
"name": "error-o",
|
|
8446
|
+
"color": "#adb0b8",
|
|
8319
8447
|
"onClick": onClear
|
|
8320
8448
|
}, null)])]), ctx.slots.append && createVNode("div", {
|
|
8321
8449
|
"class": slotNs.e("append")
|
|
8322
|
-
}, [(
|
|
8450
|
+
}, [(_i = (_h = ctx.slots).append) == null ? void 0 : _i.call(_h)])]);
|
|
8323
8451
|
};
|
|
8324
8452
|
}
|
|
8325
8453
|
});
|