vue-devui 1.0.0-rc.8 → 1.0.0-rc.9
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/alert/index.es.js +2 -2
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +282 -84
- package/auto-complete/index.umd.js +3 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +59 -74
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +2 -2
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +111 -38
- package/button/index.umd.js +15 -15
- package/button/style.css +1 -1
- package/card/index.es.js +2 -2
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +340 -228
- package/checkbox/index.umd.js +1 -1
- package/checkbox/style.css +1 -1
- package/date-picker/index.es.js +264 -63
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +2 -2
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +104 -48
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +423 -8
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +304 -184
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +2 -2
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +8 -6
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +109 -13
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +2 -2
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +278 -30
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +272 -199
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +2 -2
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +2 -2
- package/loading/index.umd.js +1 -1
- package/modal/index.es.js +105 -32
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +105 -32
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/overlay/index.es.js +2 -2
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -1
- package/pagination/index.es.js +2 -2
- package/pagination/index.umd.js +1 -1
- package/popover/index.es.js +153 -67
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +2 -2
- package/progress/index.umd.js +2 -2
- package/radio/index.es.js +139 -143
- package/radio/index.umd.js +1 -1
- package/rate/index.es.js +16 -8
- package/rate/index.umd.js +1 -1
- package/result/index.es.js +108 -12
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +316 -60
- package/search/index.umd.js +16 -16
- package/search/style.css +1 -1
- package/select/index.es.js +7334 -574
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +2 -2
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +2 -2
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +178 -89
- package/splitter/index.umd.js +17 -17
- package/splitter/style.css +1 -1
- package/status/index.es.js +2 -2
- package/status/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +2 -2
- package/switch/index.umd.js +1 -1
- package/table/index.es.js +1301 -524
- package/table/index.umd.js +18 -18
- package/table/style.css +1 -1
- package/tabs/index.es.js +114 -72
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +6 -7
- package/tag/index.umd.js +1 -1
- package/textarea/index.es.js +5545 -11
- package/textarea/index.umd.js +35 -1
- package/timeline/index.es.js +108 -12
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +168 -79
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +338 -227
- package/tree/index.umd.js +1 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +105 -32
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +3269 -1742
- package/vue-devui.umd.js +29 -23
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
package/search/index.es.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __objRest = (source, exclude) => {
|
|
5
|
+
var target = {};
|
|
6
|
+
for (var prop in source)
|
|
7
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
+
target[prop] = source[prop];
|
|
9
|
+
if (source != null && __getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
import { computed, ref, watch, inject, toRefs, defineComponent, createVNode, resolveDynamicComponent, mergeProps, shallowRef, resolveComponent } from "vue";
|
|
2
17
|
const searchProps = {
|
|
3
18
|
size: {
|
|
4
19
|
type: String,
|
|
@@ -59,8 +74,8 @@ function createBem(namespace, element, modifier) {
|
|
|
59
74
|
}
|
|
60
75
|
return cls;
|
|
61
76
|
}
|
|
62
|
-
function useNamespace(block) {
|
|
63
|
-
const namespace = `devui-${block}`;
|
|
77
|
+
function useNamespace(block, needDot = false) {
|
|
78
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
64
79
|
const b = () => createBem(namespace);
|
|
65
80
|
const e = (element) => element ? createBem(namespace, element) : "";
|
|
66
81
|
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
@@ -82,9 +97,10 @@ const ICON_POSITION = {
|
|
|
82
97
|
left: "left"
|
|
83
98
|
};
|
|
84
99
|
const ns = useNamespace("search");
|
|
85
|
-
const getRootClass = (props) => {
|
|
100
|
+
const getRootClass = (props, isFocus) => {
|
|
86
101
|
return computed(() => ({
|
|
87
102
|
[ns.b()]: true,
|
|
103
|
+
[ns.m("focus")]: isFocus.value,
|
|
88
104
|
[ns.m("disabled")]: props.disabled,
|
|
89
105
|
[ns.m("no-border")]: props.noBorder,
|
|
90
106
|
[ns.m(props.size)]: SIZE_CLASS[props.size],
|
|
@@ -804,7 +820,7 @@ var lodash = { exports: {} };
|
|
|
804
820
|
}
|
|
805
821
|
var runInContext = function runInContext2(context) {
|
|
806
822
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
807
|
-
var Array2 = context.Array, Date = context.Date,
|
|
823
|
+
var Array2 = context.Array, Date = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
808
824
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
809
825
|
var coreJsData = context["__core-js_shared__"];
|
|
810
826
|
var funcToString = funcProto.toString;
|
|
@@ -818,7 +834,7 @@ var lodash = { exports: {} };
|
|
|
818
834
|
var objectCtorString = funcToString.call(Object2);
|
|
819
835
|
var oldDash = root._;
|
|
820
836
|
var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
821
|
-
var
|
|
837
|
+
var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
|
|
822
838
|
var defineProperty = function() {
|
|
823
839
|
try {
|
|
824
840
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -828,11 +844,11 @@ var lodash = { exports: {} };
|
|
|
828
844
|
}
|
|
829
845
|
}();
|
|
830
846
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
831
|
-
var nativeCeil =
|
|
832
|
-
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"),
|
|
833
|
-
var metaMap =
|
|
847
|
+
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
848
|
+
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
849
|
+
var metaMap = WeakMap2 && new WeakMap2();
|
|
834
850
|
var realNames = {};
|
|
835
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(
|
|
851
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
|
|
836
852
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
837
853
|
function lodash2(value) {
|
|
838
854
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
@@ -1285,7 +1301,7 @@ var lodash = { exports: {} };
|
|
|
1285
1301
|
}
|
|
1286
1302
|
function baseDelay(func, wait, args) {
|
|
1287
1303
|
if (typeof func != "function") {
|
|
1288
|
-
throw new
|
|
1304
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
1289
1305
|
}
|
|
1290
1306
|
return setTimeout(function() {
|
|
1291
1307
|
func.apply(undefined$1, args);
|
|
@@ -2080,7 +2096,7 @@ var lodash = { exports: {} };
|
|
|
2080
2096
|
}
|
|
2081
2097
|
function cloneArrayBuffer(arrayBuffer) {
|
|
2082
2098
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2083
|
-
new
|
|
2099
|
+
new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
|
|
2084
2100
|
return result2;
|
|
2085
2101
|
}
|
|
2086
2102
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -2329,7 +2345,7 @@ var lodash = { exports: {} };
|
|
|
2329
2345
|
while (index2--) {
|
|
2330
2346
|
var func = funcs[index2];
|
|
2331
2347
|
if (typeof func != "function") {
|
|
2332
|
-
throw new
|
|
2348
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
2333
2349
|
}
|
|
2334
2350
|
if (prereq && !wrapper && getFuncName(func) == "wrapper") {
|
|
2335
2351
|
var wrapper = new LodashWrapper([], true);
|
|
@@ -2512,7 +2528,7 @@ var lodash = { exports: {} };
|
|
|
2512
2528
|
return setWrapToString(result2, func, bitmask);
|
|
2513
2529
|
}
|
|
2514
2530
|
function createRound(methodName) {
|
|
2515
|
-
var func =
|
|
2531
|
+
var func = Math2[methodName];
|
|
2516
2532
|
return function(number, precision) {
|
|
2517
2533
|
number = toNumber(number);
|
|
2518
2534
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -2542,7 +2558,7 @@ var lodash = { exports: {} };
|
|
|
2542
2558
|
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
|
|
2543
2559
|
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
|
|
2544
2560
|
if (!isBindKey && typeof func != "function") {
|
|
2545
|
-
throw new
|
|
2561
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
2546
2562
|
}
|
|
2547
2563
|
var length = partials ? partials.length : 0;
|
|
2548
2564
|
if (!length) {
|
|
@@ -2662,7 +2678,7 @@ var lodash = { exports: {} };
|
|
|
2662
2678
|
object = object.buffer;
|
|
2663
2679
|
other = other.buffer;
|
|
2664
2680
|
case arrayBufferTag:
|
|
2665
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
2681
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
2666
2682
|
return false;
|
|
2667
2683
|
}
|
|
2668
2684
|
return true;
|
|
@@ -2824,7 +2840,7 @@ var lodash = { exports: {} };
|
|
|
2824
2840
|
return result2;
|
|
2825
2841
|
};
|
|
2826
2842
|
var getTag = baseGetTag;
|
|
2827
|
-
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag ||
|
|
2843
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
2828
2844
|
getTag = function(value) {
|
|
2829
2845
|
var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
|
|
2830
2846
|
if (ctorString) {
|
|
@@ -3809,7 +3825,7 @@ var lodash = { exports: {} };
|
|
|
3809
3825
|
};
|
|
3810
3826
|
function after(n, func) {
|
|
3811
3827
|
if (typeof func != "function") {
|
|
3812
|
-
throw new
|
|
3828
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3813
3829
|
}
|
|
3814
3830
|
n = toInteger(n);
|
|
3815
3831
|
return function() {
|
|
@@ -3826,7 +3842,7 @@ var lodash = { exports: {} };
|
|
|
3826
3842
|
function before(n, func) {
|
|
3827
3843
|
var result2;
|
|
3828
3844
|
if (typeof func != "function") {
|
|
3829
|
-
throw new
|
|
3845
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3830
3846
|
}
|
|
3831
3847
|
n = toInteger(n);
|
|
3832
3848
|
return function() {
|
|
@@ -3870,7 +3886,7 @@ var lodash = { exports: {} };
|
|
|
3870
3886
|
function debounce(func, wait, options) {
|
|
3871
3887
|
var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
3872
3888
|
if (typeof func != "function") {
|
|
3873
|
-
throw new
|
|
3889
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3874
3890
|
}
|
|
3875
3891
|
wait = toNumber(wait) || 0;
|
|
3876
3892
|
if (isObject(options)) {
|
|
@@ -3959,7 +3975,7 @@ var lodash = { exports: {} };
|
|
|
3959
3975
|
}
|
|
3960
3976
|
function memoize(func, resolver) {
|
|
3961
3977
|
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
3962
|
-
throw new
|
|
3978
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3963
3979
|
}
|
|
3964
3980
|
var memoized = function() {
|
|
3965
3981
|
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
@@ -3976,7 +3992,7 @@ var lodash = { exports: {} };
|
|
|
3976
3992
|
memoize.Cache = MapCache;
|
|
3977
3993
|
function negate(predicate) {
|
|
3978
3994
|
if (typeof predicate != "function") {
|
|
3979
|
-
throw new
|
|
3995
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3980
3996
|
}
|
|
3981
3997
|
return function() {
|
|
3982
3998
|
var args = arguments;
|
|
@@ -4020,14 +4036,14 @@ var lodash = { exports: {} };
|
|
|
4020
4036
|
});
|
|
4021
4037
|
function rest(func, start) {
|
|
4022
4038
|
if (typeof func != "function") {
|
|
4023
|
-
throw new
|
|
4039
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4024
4040
|
}
|
|
4025
4041
|
start = start === undefined$1 ? start : toInteger(start);
|
|
4026
4042
|
return baseRest(func, start);
|
|
4027
4043
|
}
|
|
4028
4044
|
function spread(func, start) {
|
|
4029
4045
|
if (typeof func != "function") {
|
|
4030
|
-
throw new
|
|
4046
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4031
4047
|
}
|
|
4032
4048
|
start = start == null ? 0 : nativeMax(toInteger(start), 0);
|
|
4033
4049
|
return baseRest(function(args) {
|
|
@@ -4041,7 +4057,7 @@ var lodash = { exports: {} };
|
|
|
4041
4057
|
function throttle(func, wait, options) {
|
|
4042
4058
|
var leading = true, trailing = true;
|
|
4043
4059
|
if (typeof func != "function") {
|
|
4044
|
-
throw new
|
|
4060
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4045
4061
|
}
|
|
4046
4062
|
if (isObject(options)) {
|
|
4047
4063
|
leading = "leading" in options ? !!options.leading : leading;
|
|
@@ -4183,7 +4199,7 @@ var lodash = { exports: {} };
|
|
|
4183
4199
|
}
|
|
4184
4200
|
function isNative(value) {
|
|
4185
4201
|
if (isMaskable(value)) {
|
|
4186
|
-
throw new
|
|
4202
|
+
throw new Error2(CORE_ERROR_TEXT);
|
|
4187
4203
|
}
|
|
4188
4204
|
return baseIsNative(value);
|
|
4189
4205
|
}
|
|
@@ -4721,7 +4737,7 @@ var lodash = { exports: {} };
|
|
|
4721
4737
|
if (!variable) {
|
|
4722
4738
|
source = "with (obj) {\n" + source + "\n}\n";
|
|
4723
4739
|
} else if (reForbiddenIdentifierChars.test(variable)) {
|
|
4724
|
-
throw new
|
|
4740
|
+
throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
|
|
4725
4741
|
}
|
|
4726
4742
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
|
|
4727
4743
|
source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
|
|
@@ -4840,7 +4856,7 @@ var lodash = { exports: {} };
|
|
|
4840
4856
|
try {
|
|
4841
4857
|
return apply(func, undefined$1, args);
|
|
4842
4858
|
} catch (e) {
|
|
4843
|
-
return isError(e) ? e : new
|
|
4859
|
+
return isError(e) ? e : new Error2(e);
|
|
4844
4860
|
}
|
|
4845
4861
|
});
|
|
4846
4862
|
var bindAll = flatRest(function(object, methodNames) {
|
|
@@ -4854,7 +4870,7 @@ var lodash = { exports: {} };
|
|
|
4854
4870
|
var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
|
|
4855
4871
|
pairs = !length ? [] : arrayMap(pairs, function(pair) {
|
|
4856
4872
|
if (typeof pair[1] != "function") {
|
|
4857
|
-
throw new
|
|
4873
|
+
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
4858
4874
|
}
|
|
4859
4875
|
return [toIteratee(pair[0]), pair[1]];
|
|
4860
4876
|
});
|
|
@@ -5563,26 +5579,59 @@ const inputProps = {
|
|
|
5563
5579
|
size: {
|
|
5564
5580
|
type: String,
|
|
5565
5581
|
default: "md"
|
|
5582
|
+
},
|
|
5583
|
+
validateEvent: {
|
|
5584
|
+
type: Boolean,
|
|
5585
|
+
default: true
|
|
5586
|
+
},
|
|
5587
|
+
prefix: {
|
|
5588
|
+
type: String,
|
|
5589
|
+
default: ""
|
|
5590
|
+
},
|
|
5591
|
+
suffix: {
|
|
5592
|
+
type: String,
|
|
5593
|
+
default: ""
|
|
5594
|
+
},
|
|
5595
|
+
showPassword: {
|
|
5596
|
+
type: Boolean,
|
|
5597
|
+
default: false
|
|
5598
|
+
},
|
|
5599
|
+
clearable: {
|
|
5600
|
+
type: Boolean,
|
|
5601
|
+
default: false
|
|
5566
5602
|
}
|
|
5567
5603
|
};
|
|
5568
5604
|
const FORM_ITEM_TOKEN = Symbol("dFormItem");
|
|
5569
|
-
function useInputRender(props) {
|
|
5605
|
+
function useInputRender(props, ctx) {
|
|
5570
5606
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
5571
5607
|
const isValidateError = computed(() => (formItemContext == null ? void 0 : formItemContext.validateState) === "error");
|
|
5572
5608
|
const ns2 = useNamespace("input");
|
|
5609
|
+
const slotNs = useNamespace("input-slot");
|
|
5573
5610
|
const isFocus = ref(false);
|
|
5574
5611
|
const { error, size, disabled } = toRefs(props);
|
|
5612
|
+
const slots = ctx.slots;
|
|
5613
|
+
const _a = ctx.attrs, { style, class: customClass } = _a, otherAttrs = __objRest(_a, ["style", "class"]);
|
|
5614
|
+
const customStyle = { style };
|
|
5575
5615
|
const wrapClasses = computed(() => ({
|
|
5576
|
-
[ns2.
|
|
5616
|
+
[ns2.e("wrapper")]: true,
|
|
5577
5617
|
[ns2.m("focus")]: isFocus.value,
|
|
5578
5618
|
[ns2.m("disabled")]: disabled.value,
|
|
5579
5619
|
[ns2.m("error")]: error.value || isValidateError.value,
|
|
5580
|
-
[ns2.m("feedback")]: formItemContext == null ? void 0 : formItemContext.showFeedback
|
|
5581
|
-
[ns2.m(size.value)]: true
|
|
5620
|
+
[ns2.m("feedback")]: formItemContext == null ? void 0 : formItemContext.showFeedback
|
|
5582
5621
|
}));
|
|
5583
|
-
|
|
5622
|
+
const inputClasses = computed(() => [
|
|
5623
|
+
{
|
|
5624
|
+
[ns2.b()]: true,
|
|
5625
|
+
[ns2.m(size.value)]: true,
|
|
5626
|
+
[slotNs.b()]: slots.prepend || slots.append,
|
|
5627
|
+
[ns2.m("append")]: slots.append,
|
|
5628
|
+
[ns2.m("prepend")]: slots.prepend
|
|
5629
|
+
},
|
|
5630
|
+
customClass
|
|
5631
|
+
]);
|
|
5632
|
+
return { isFocus, wrapClasses, inputClasses, customStyle, otherAttrs };
|
|
5584
5633
|
}
|
|
5585
|
-
function useInputEvent(isFocus, ctx) {
|
|
5634
|
+
function useInputEvent(isFocus, props, ctx) {
|
|
5586
5635
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
5587
5636
|
const onFocus = (e) => {
|
|
5588
5637
|
isFocus.value = true;
|
|
@@ -5591,7 +5640,9 @@ function useInputEvent(isFocus, ctx) {
|
|
|
5591
5640
|
const onBlur = (e) => {
|
|
5592
5641
|
isFocus.value = false;
|
|
5593
5642
|
ctx.emit("blur", e);
|
|
5594
|
-
|
|
5643
|
+
if (props.validateEvent) {
|
|
5644
|
+
formItemContext == null ? void 0 : formItemContext.validate("blur").catch((err) => console.warn(err));
|
|
5645
|
+
}
|
|
5595
5646
|
};
|
|
5596
5647
|
const onInput = (e) => {
|
|
5597
5648
|
ctx.emit("update:modelValue", e.target.value);
|
|
@@ -5602,14 +5653,154 @@ function useInputEvent(isFocus, ctx) {
|
|
|
5602
5653
|
const onKeydown = (e) => {
|
|
5603
5654
|
ctx.emit("keydown", e);
|
|
5604
5655
|
};
|
|
5605
|
-
|
|
5656
|
+
const onClear = () => {
|
|
5657
|
+
ctx.emit("update:modelValue", "");
|
|
5658
|
+
ctx.emit("clear");
|
|
5659
|
+
};
|
|
5660
|
+
return { onFocus, onBlur, onInput, onChange, onKeydown, onClear };
|
|
5661
|
+
}
|
|
5662
|
+
function useInputFunction(input2) {
|
|
5663
|
+
const refInput = computed(() => input2.value);
|
|
5664
|
+
const select = () => {
|
|
5665
|
+
var _a;
|
|
5666
|
+
(_a = refInput.value) == null ? void 0 : _a.select();
|
|
5667
|
+
};
|
|
5668
|
+
const focus = () => {
|
|
5669
|
+
var _a;
|
|
5670
|
+
(_a = refInput.value) == null ? void 0 : _a.focus();
|
|
5671
|
+
};
|
|
5672
|
+
const blur = () => {
|
|
5673
|
+
var _a;
|
|
5674
|
+
(_a = refInput.value) == null ? void 0 : _a.blur();
|
|
5675
|
+
};
|
|
5676
|
+
return { select, focus, blur };
|
|
5606
5677
|
}
|
|
5607
5678
|
var input = "";
|
|
5679
|
+
function isUrl(value) {
|
|
5680
|
+
return /^((http|https):)?\/\//.test(value);
|
|
5681
|
+
}
|
|
5682
|
+
const DEFAULT_PREFIX = "icon";
|
|
5683
|
+
const iconProps = {
|
|
5684
|
+
name: {
|
|
5685
|
+
type: String,
|
|
5686
|
+
default: "",
|
|
5687
|
+
required: true
|
|
5688
|
+
},
|
|
5689
|
+
size: {
|
|
5690
|
+
type: [Number, String],
|
|
5691
|
+
default: "inherit"
|
|
5692
|
+
},
|
|
5693
|
+
color: {
|
|
5694
|
+
type: String,
|
|
5695
|
+
default: "inherit"
|
|
5696
|
+
},
|
|
5697
|
+
component: {
|
|
5698
|
+
type: Object,
|
|
5699
|
+
default: null
|
|
5700
|
+
},
|
|
5701
|
+
classPrefix: {
|
|
5702
|
+
type: String,
|
|
5703
|
+
default: DEFAULT_PREFIX
|
|
5704
|
+
}
|
|
5705
|
+
};
|
|
5706
|
+
const svgIconProps = {
|
|
5707
|
+
name: {
|
|
5708
|
+
type: String,
|
|
5709
|
+
default: "",
|
|
5710
|
+
required: true
|
|
5711
|
+
},
|
|
5712
|
+
color: {
|
|
5713
|
+
type: String,
|
|
5714
|
+
default: "inherit"
|
|
5715
|
+
},
|
|
5716
|
+
size: {
|
|
5717
|
+
type: [Number, String],
|
|
5718
|
+
default: "inherit"
|
|
5719
|
+
}
|
|
5720
|
+
};
|
|
5721
|
+
var icon = "";
|
|
5722
|
+
var svgIcon = defineComponent({
|
|
5723
|
+
name: "DSvgIcon",
|
|
5724
|
+
props: svgIconProps,
|
|
5725
|
+
setup(props) {
|
|
5726
|
+
const {
|
|
5727
|
+
name,
|
|
5728
|
+
color,
|
|
5729
|
+
size
|
|
5730
|
+
} = toRefs(props);
|
|
5731
|
+
const ns2 = useNamespace("svg-icon");
|
|
5732
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
5733
|
+
const iconSize = computed(() => {
|
|
5734
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
5735
|
+
});
|
|
5736
|
+
const styles = {
|
|
5737
|
+
width: iconSize.value,
|
|
5738
|
+
height: iconSize.value
|
|
5739
|
+
};
|
|
5740
|
+
return () => {
|
|
5741
|
+
return createVNode("svg", {
|
|
5742
|
+
"class": ns2.b(),
|
|
5743
|
+
"style": styles
|
|
5744
|
+
}, [createVNode("use", {
|
|
5745
|
+
"xlink:href": iconName.value,
|
|
5746
|
+
"fill": color.value
|
|
5747
|
+
}, null)]);
|
|
5748
|
+
};
|
|
5749
|
+
}
|
|
5750
|
+
});
|
|
5751
|
+
var Icon = defineComponent({
|
|
5752
|
+
name: "DIcon",
|
|
5753
|
+
props: iconProps,
|
|
5754
|
+
setup(props, {
|
|
5755
|
+
attrs
|
|
5756
|
+
}) {
|
|
5757
|
+
const {
|
|
5758
|
+
component,
|
|
5759
|
+
name,
|
|
5760
|
+
size,
|
|
5761
|
+
color,
|
|
5762
|
+
classPrefix
|
|
5763
|
+
} = toRefs(props);
|
|
5764
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
5765
|
+
const iconSize = computed(() => {
|
|
5766
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
5767
|
+
});
|
|
5768
|
+
const svgIconDom = () => {
|
|
5769
|
+
return createVNode(IconComponent, mergeProps({
|
|
5770
|
+
"name": name.value,
|
|
5771
|
+
"color": color.value,
|
|
5772
|
+
"size": iconSize.value
|
|
5773
|
+
}, attrs), null);
|
|
5774
|
+
};
|
|
5775
|
+
const imgIconDom = () => {
|
|
5776
|
+
return createVNode("img", mergeProps({
|
|
5777
|
+
"src": name.value,
|
|
5778
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
5779
|
+
"style": {
|
|
5780
|
+
width: iconSize.value || ""
|
|
5781
|
+
}
|
|
5782
|
+
}, attrs), null);
|
|
5783
|
+
};
|
|
5784
|
+
const fontIconDom = () => {
|
|
5785
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
5786
|
+
return createVNode("i", mergeProps({
|
|
5787
|
+
"class": [classPrefix.value, fontIconClass],
|
|
5788
|
+
"style": {
|
|
5789
|
+
fontSize: iconSize.value,
|
|
5790
|
+
color: color.value
|
|
5791
|
+
}
|
|
5792
|
+
}, attrs), null);
|
|
5793
|
+
};
|
|
5794
|
+
return () => {
|
|
5795
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
5796
|
+
};
|
|
5797
|
+
}
|
|
5798
|
+
});
|
|
5608
5799
|
var DInput = defineComponent({
|
|
5609
5800
|
name: "DInput",
|
|
5610
5801
|
inheritAttrs: false,
|
|
5611
5802
|
props: inputProps,
|
|
5612
|
-
emits: ["update:modelValue", "focus", "blur", "input", "change", "keydown"],
|
|
5803
|
+
emits: ["update:modelValue", "focus", "blur", "input", "change", "keydown", "clear"],
|
|
5613
5804
|
setup(props, ctx) {
|
|
5614
5805
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
5615
5806
|
const {
|
|
@@ -5617,33 +5808,91 @@ var DInput = defineComponent({
|
|
|
5617
5808
|
disabled
|
|
5618
5809
|
} = toRefs(props);
|
|
5619
5810
|
const ns2 = useNamespace("input");
|
|
5811
|
+
const slotNs = useNamespace("input-slot");
|
|
5620
5812
|
const {
|
|
5621
5813
|
isFocus,
|
|
5622
|
-
wrapClasses
|
|
5623
|
-
|
|
5814
|
+
wrapClasses,
|
|
5815
|
+
inputClasses,
|
|
5816
|
+
customStyle,
|
|
5817
|
+
otherAttrs
|
|
5818
|
+
} = useInputRender(props, ctx);
|
|
5624
5819
|
const {
|
|
5625
5820
|
onFocus,
|
|
5626
5821
|
onBlur,
|
|
5627
5822
|
onInput,
|
|
5628
5823
|
onChange,
|
|
5629
|
-
onKeydown
|
|
5630
|
-
|
|
5824
|
+
onKeydown,
|
|
5825
|
+
onClear
|
|
5826
|
+
} = useInputEvent(isFocus, props, ctx);
|
|
5827
|
+
const input2 = shallowRef();
|
|
5828
|
+
const {
|
|
5829
|
+
select,
|
|
5830
|
+
focus,
|
|
5831
|
+
blur
|
|
5832
|
+
} = useInputFunction(input2);
|
|
5833
|
+
const passwordVisible = ref(false);
|
|
5834
|
+
const clickPasswordIcon = () => {
|
|
5835
|
+
passwordVisible.value = !passwordVisible.value;
|
|
5836
|
+
focus();
|
|
5837
|
+
};
|
|
5838
|
+
const prefixVisiable = ctx.slots.prefix || props.prefix;
|
|
5839
|
+
const suffixVisiable = ctx.slots.suffix || props.suffix || props.showPassword || props.clearable;
|
|
5840
|
+
const showPwdVisible = computed(() => props.showPassword && !props.disabled);
|
|
5841
|
+
const showClearable = computed(() => props.clearable && !props.disabled);
|
|
5631
5842
|
watch(() => props.modelValue, () => {
|
|
5632
|
-
|
|
5843
|
+
if (props.validateEvent) {
|
|
5844
|
+
formItemContext == null ? void 0 : formItemContext.validate("change").catch((err) => console.warn(err));
|
|
5845
|
+
}
|
|
5633
5846
|
});
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
"
|
|
5642
|
-
|
|
5643
|
-
"
|
|
5644
|
-
|
|
5645
|
-
"
|
|
5646
|
-
|
|
5847
|
+
ctx.expose({
|
|
5848
|
+
select,
|
|
5849
|
+
focus,
|
|
5850
|
+
blur
|
|
5851
|
+
});
|
|
5852
|
+
return () => {
|
|
5853
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5854
|
+
return createVNode("div", mergeProps({
|
|
5855
|
+
"class": inputClasses.value
|
|
5856
|
+
}, customStyle), [ctx.slots.prepend && createVNode("div", {
|
|
5857
|
+
"class": slotNs.e("prepend")
|
|
5858
|
+
}, [(_b = (_a = ctx.slots).prepend) == null ? void 0 : _b.call(_a)]), createVNode("div", {
|
|
5859
|
+
"class": wrapClasses.value
|
|
5860
|
+
}, [prefixVisiable && createVNode("span", {
|
|
5861
|
+
"class": slotNs.e("prefix")
|
|
5862
|
+
}, [ctx.slots.prefix && createVNode("div", null, [(_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)]), props.prefix && createVNode(Icon, {
|
|
5863
|
+
"size": props.size,
|
|
5864
|
+
"name": props.prefix
|
|
5865
|
+
}, null)]), createVNode("input", mergeProps({
|
|
5866
|
+
"ref": input2,
|
|
5867
|
+
"value": modelValue.value,
|
|
5868
|
+
"disabled": disabled.value,
|
|
5869
|
+
"class": ns2.e("inner")
|
|
5870
|
+
}, otherAttrs, {
|
|
5871
|
+
"type": props.showPassword ? passwordVisible.value ? "text" : "password" : "text",
|
|
5872
|
+
"onInput": onInput,
|
|
5873
|
+
"onFocus": onFocus,
|
|
5874
|
+
"onBlur": onBlur,
|
|
5875
|
+
"onChange": onChange,
|
|
5876
|
+
"onKeydown": onKeydown
|
|
5877
|
+
}), null), suffixVisiable && createVNode("span", {
|
|
5878
|
+
"class": slotNs.e("suffix")
|
|
5879
|
+
}, [props.suffix && createVNode(Icon, {
|
|
5880
|
+
"size": props.size,
|
|
5881
|
+
"name": props.suffix
|
|
5882
|
+
}, null), ctx.slots.suffix && createVNode("div", null, [(_f = (_e = ctx.slots).suffix) == null ? void 0 : _f.call(_e)]), showPwdVisible.value && createVNode(Icon, {
|
|
5883
|
+
"size": props.size,
|
|
5884
|
+
"class": ns2.em("password", "icon"),
|
|
5885
|
+
"name": passwordVisible.value ? "preview" : "preview-forbidden",
|
|
5886
|
+
"onClick": clickPasswordIcon
|
|
5887
|
+
}, null), showClearable.value && createVNode(Icon, {
|
|
5888
|
+
"size": props.size,
|
|
5889
|
+
"class": ns2.em("clear", "icon"),
|
|
5890
|
+
"name": "close",
|
|
5891
|
+
"onClick": onClear
|
|
5892
|
+
}, null)])]), ctx.slots.append && createVNode("div", {
|
|
5893
|
+
"class": slotNs.e("append")
|
|
5894
|
+
}, [(_h = (_g = ctx.slots).append) == null ? void 0 : _h.call(_g)])]);
|
|
5895
|
+
};
|
|
5647
5896
|
}
|
|
5648
5897
|
});
|
|
5649
5898
|
var search = "";
|
|
@@ -5653,7 +5902,8 @@ var Search = defineComponent({
|
|
|
5653
5902
|
emits: ["update:modelValue", "search"],
|
|
5654
5903
|
setup(props, ctx) {
|
|
5655
5904
|
const ns2 = useNamespace("search");
|
|
5656
|
-
const
|
|
5905
|
+
const isFocus = ref(false);
|
|
5906
|
+
const rootClasses = getRootClass(props, isFocus);
|
|
5657
5907
|
const {
|
|
5658
5908
|
keywords,
|
|
5659
5909
|
clearIconShow,
|
|
@@ -5671,6 +5921,12 @@ var Search = defineComponent({
|
|
|
5671
5921
|
keywords.value = event;
|
|
5672
5922
|
ctx.emit("update:modelValue", event);
|
|
5673
5923
|
};
|
|
5924
|
+
const onFocus = () => {
|
|
5925
|
+
isFocus.value = true;
|
|
5926
|
+
};
|
|
5927
|
+
const onBlur = () => {
|
|
5928
|
+
isFocus.value = false;
|
|
5929
|
+
};
|
|
5674
5930
|
return () => {
|
|
5675
5931
|
const inputProps2 = {
|
|
5676
5932
|
size: props.size,
|
|
@@ -5678,10 +5934,10 @@ var Search = defineComponent({
|
|
|
5678
5934
|
autoFocus: props.autoFocus,
|
|
5679
5935
|
modelValue: keywords.value,
|
|
5680
5936
|
placeholder: props.placeholder,
|
|
5681
|
-
maxLength: props.maxLength,
|
|
5682
|
-
cssClass: props.cssClass,
|
|
5683
5937
|
onKeydown: onInputKeydown,
|
|
5684
|
-
"onUpdate:modelValue": onInputUpdate
|
|
5938
|
+
"onUpdate:modelValue": onInputUpdate,
|
|
5939
|
+
onFocus,
|
|
5940
|
+
onBlur
|
|
5685
5941
|
};
|
|
5686
5942
|
return createVNode("div", {
|
|
5687
5943
|
"class": rootClasses.value
|