Compare commits
174 Commits
60e7e0d3e4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| e8a683455b | |||
| 8fd2f9da68 | |||
| 5e00eccb29 | |||
| 09c7268229 | |||
| d5576061e3 | |||
| 596ab0f0d4 | |||
| 3855589bfd | |||
| adfa9024ac | |||
| c5e445c07b | |||
| 253770906e | |||
| c0e40bee86 | |||
| 6a15bbb2e0 | |||
| c7f2091874 | |||
| 0c04f452ee | |||
| f62d0bb34b | |||
| 54695b7cc5 | |||
| e263b19eaa | |||
| cfac396548 | |||
| 2f5407d7b3 | |||
| cf87e0c28a | |||
| 47efc3461d | |||
| 0c45925be9 | |||
| 30528311c1 | |||
| 6cd84e0021 | |||
| 378db9dd75 | |||
| 3785a86ac4 | |||
| c537d81b59 | |||
| d858824376 | |||
| a4291f1361 | |||
| 38fb21a80f | |||
| f7cb79367c | |||
| 5fbdeef347 | |||
| f0e8f6d076 | |||
| b4d3954ece | |||
| e77ba65b09 | |||
| 3d21ac0f79 | |||
| abdb35f250 | |||
| 3698023d2a | |||
| baf1ae2854 | |||
| 61f610ddd9 | |||
| ffe213314c | |||
| 171b4ac806 | |||
| 81bb541a46 | |||
| 7859897c84 | |||
| 203b787876 | |||
| f62909247c | |||
| 01a43630c6 | |||
| 65a209fd8a | |||
| 0a1d29ffb8 | |||
| 85769bf2a8 | |||
| 4d54333ad1 | |||
| 71e57b93c2 | |||
| 6460676ec9 | |||
| 025132edb0 | |||
| e4369a5f16 | |||
| e522bb54ce | |||
| 57b59c5c46 | |||
| 3dcf2c482a | |||
| 431f5e189d | |||
| 8a9cd750ae | |||
| 7b10791c2b | |||
| ca6573f1f4 | |||
| e02298f097 | |||
| 2612c8dfbb | |||
| 6d66304fe7 | |||
| 66392a3eab | |||
| 6bfabc7f3b | |||
| 001667587f | |||
| c7f91d9c7e | |||
| d1df623a4c | |||
| 49d55d5c4c | |||
| c00284da01 | |||
| e599f0e50e | |||
| 9a91bf030d | |||
| 1c2def6a48 | |||
| 94c141f0b4 | |||
| 4e038b4d2f | |||
| df4f650c44 | |||
| 2839c0cf7a | |||
| 296e60f6c4 | |||
| a6d8dfea39 | |||
| 13f45bcfef | |||
| 6c966e8424 | |||
| 220c4f1709 | |||
| 326b5598ba | |||
| 53e1658503 | |||
| 912e04cca7 | |||
| 312e31761d | |||
| 02605d2e98 | |||
| fd3eb2e065 | |||
| 9942139736 | |||
| 89a638b782 | |||
| 70b082a208 | |||
| 9ce9d66cbe | |||
| d9e8704a6b | |||
| d9e6e75275 | |||
| 23c229f9ed | |||
| 93447cf66d | |||
| d7ab3cb486 | |||
| fc825565d7 | |||
| 4b56b2b09c | |||
| 5400ed7cdc | |||
| e2cdf6eb6b | |||
| 8f88083070 | |||
| eb3f2e831c | |||
| 56769f4152 | |||
| 2eec5e9df0 | |||
| 72e79b3361 | |||
| f87a5bb70a | |||
| 27f75e2ced | |||
| f2249478ed | |||
| b0e80b8a49 | |||
| db7daf4253 | |||
| 3a62266c6e | |||
| 9989348aa9 | |||
| 1e0508f288 | |||
| dc4ca22ced | |||
| ff6ff998c0 | |||
| 77cce500e5 | |||
| a5df1c4555 | |||
| b6f6487089 | |||
| cf10e5d81a | |||
| 1abacddf32 | |||
| eab2a7b52e | |||
| e293b80814 | |||
| 392b2d1547 | |||
| 971731f497 | |||
| caa6e5f338 | |||
| 32ba924247 | |||
| d712290847 | |||
| 0e1d469c76 | |||
| b1b09141ee | |||
| 4afba8dd1a | |||
| 560115644c | |||
| 3465493f43 | |||
| afa4ba6749 | |||
| d3b3161574 | |||
| dda349419d | |||
| 1a50acd878 | |||
| f598d35da2 | |||
| 4e160ffb4a | |||
| 4155ca0e73 | |||
| 7f37117c39 | |||
| 8f0cb42c5f | |||
| cbf10b35d8 | |||
| 08dd5a910d | |||
| 7603563a7a | |||
| e16168dd21 | |||
| 0511c97302 | |||
| 61a685dfe2 | |||
| 4cfb999c51 | |||
| 770faaa123 | |||
| 059cab17c6 | |||
| c299e62f38 | |||
| c9fd3d4baf | |||
| 1475322d91 | |||
| 61c20fc6b6 | |||
| f3c181ba88 | |||
| 45a0415848 | |||
| 077ae6f534 | |||
| 23f2e2ff67 | |||
| b12826594e | |||
| f99c22984f | |||
| 937a34f05e | |||
| 80c457a21b | |||
| 5a0d86e2e9 | |||
| 8e4f8dd45f | |||
| db74c76a3a | |||
| ad671dc37b | |||
| 145ff44277 | |||
| 7a6502200c | |||
| 254ef38f6a | |||
| c696834501 | |||
| 093de34571 |
@@ -2060,4 +2060,4 @@ function clearNumberFormat(ctx, locale, format) {
|
|||||||
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export { parseDateTimeArgs as A, datetime as B, parseNumberArgs as C, number as D, getLocaleChain as E, MISSING_RESOLVE_VALUE as M, NOT_REOSLVED as N, assign as a, isString as b, isObject$1 as c, isArray as d, isBoolean as e, createCompileError as f, isEmptyObject as g, getGlobalThis as h, isNumber as i, isPlainObject as j, hasOwn$1 as k, handleFlatJson as l, makeSymbol as m, isRegExp as n, isFunction as o, createCoreContext as p, compileToFunction as q, registerMessageCompiler as r, setDevToolsHook as s, resolveValue as t, updateFallbackLocale as u, clearDateTimeFormat as v, clearNumberFormat as w, setAdditionalMeta as x, parseTranslateArgs as y, translate as z };
|
export { parseDateTimeArgs as A, datetime as B, parseNumberArgs as C, number as D, getLocaleChain as E, MISSING_RESOLVE_VALUE as M, NOT_REOSLVED as N, assign as a, isString as b, isObject$1 as c, isBoolean as d, isEmptyObject as e, createCompileError as f, getGlobalThis as g, isPlainObject as h, isNumber as i, isArray as j, hasOwn$1 as k, handleFlatJson as l, makeSymbol as m, isRegExp as n, isFunction as o, compileToFunction as p, createCoreContext as q, registerMessageCompiler as r, setDevToolsHook as s, resolveValue as t, updateFallbackLocale as u, clearDateTimeFormat as v, clearNumberFormat as w, setAdditionalMeta as x, parseTranslateArgs as y, translate as z };
|
||||||
|
|||||||
1
es/_chunks/@layui/index.css
Normal file
1
es/_chunks/@layui/index.css
Normal file
File diff suppressed because one or more lines are too long
6308
es/_chunks/@layui/index.js
Normal file
6308
es/_chunks/@layui/index.js
Normal file
File diff suppressed because one or more lines are too long
@@ -149,7 +149,9 @@ function triggerEffect(effect, debuggerEventExtraInfo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
new Set(
|
||||||
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
||||||
|
);
|
||||||
function toRaw(observed) {
|
function toRaw(observed) {
|
||||||
const raw = observed && observed["__v_raw"];
|
const raw = observed && observed["__v_raw"];
|
||||||
return raw ? toRaw(raw) : observed;
|
return raw ? toRaw(raw) : observed;
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { computed, isRef, reactive, unref, toRefs, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, nextTick, ref, watch, customRef, onUpdated } from "vue";
|
import { getCurrentScope, onScopeDispose, computed, toRefs, getCurrentInstance, onMounted, nextTick, ref, unref, isRef, reactive, watch, customRef, onUpdated } from "vue";
|
||||||
var _a;
|
var _a$1;
|
||||||
const isClient = typeof window !== "undefined";
|
const isClient$1 = typeof window !== "undefined";
|
||||||
const toString = Object.prototype.toString;
|
const toString$1 = Object.prototype.toString;
|
||||||
const isFunction = (val) => typeof val === "function";
|
const isFunction = (val) => typeof val === "function";
|
||||||
const isNumber = (val) => typeof val === "number";
|
const isNumber = (val) => typeof val === "number";
|
||||||
const isString = (val) => typeof val === "string";
|
const isString = (val) => typeof val === "string";
|
||||||
const isObject = (val) => toString.call(val) === "[object Object]";
|
const isObject$1 = (val) => toString$1.call(val) === "[object Object]";
|
||||||
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
||||||
const noop = () => {
|
const noop = () => {
|
||||||
};
|
};
|
||||||
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
isClient$1 && ((_a$1 = window == null ? void 0 : window.navigator) == null ? void 0 : _a$1.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
||||||
function resolveUnref(r) {
|
function resolveUnref(r) {
|
||||||
return typeof r === "function" ? r() : unref(r);
|
return typeof r === "function" ? r() : unref(r);
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ function useTimeoutFn(cb, interval, options = {}) {
|
|||||||
}
|
}
|
||||||
if (immediate) {
|
if (immediate) {
|
||||||
isPending.value = true;
|
isPending.value = true;
|
||||||
if (isClient)
|
if (isClient$1)
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
tryOnScopeDispose(stop);
|
tryOnScopeDispose(stop);
|
||||||
@@ -156,7 +156,7 @@ function unrefElement(elRef) {
|
|||||||
const plain = resolveUnref(elRef);
|
const plain = resolveUnref(elRef);
|
||||||
return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
|
return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
|
||||||
}
|
}
|
||||||
const defaultWindow = isClient ? window : void 0;
|
const defaultWindow = isClient$1 ? window : void 0;
|
||||||
function useEventListener(...args) {
|
function useEventListener(...args) {
|
||||||
let target;
|
let target;
|
||||||
let event;
|
let event;
|
||||||
@@ -561,4 +561,9 @@ function useWindowSize(options = {}) {
|
|||||||
useEventListener("orientationchange", update, { passive: true });
|
useEventListener("orientationchange", update, { passive: true });
|
||||||
return { width, height };
|
return { width, height };
|
||||||
}
|
}
|
||||||
export { TransitionPresets as T, useResizeObserver as a, useThrottleFn as b, useEventListener as c, useEyeDropper as d, useTransition as e, useMousePressed as f, isObject as i, onClickOutside as o, reactiveOmit as r, templateRef as t, useWindowSize as u };
|
var _a;
|
||||||
|
const isClient = typeof window !== "undefined";
|
||||||
|
const toString = Object.prototype.toString;
|
||||||
|
const isObject = (val) => toString.call(val) === "[object Object]";
|
||||||
|
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
||||||
|
export { TransitionPresets as T, useResizeObserver as a, useThrottleFn as b, useEventListener as c, useEyeDropper as d, useTransition as e, useMousePressed as f, isObject as g, isObject$1 as i, onClickOutside as o, reactiveOmit as r, templateRef as t, useWindowSize as u };
|
||||||
|
|||||||
261
es/_chunks/js-image-compressor/index.js
Normal file
261
es/_chunks/js-image-compressor/index.js
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
var jsImageCompressor = { exports: {} };
|
||||||
|
var imageCompressor_min = { exports: {} };
|
||||||
|
(function(module, exports) {
|
||||||
|
!function(e, t) {
|
||||||
|
module.exports = t();
|
||||||
|
}(window, function() {
|
||||||
|
return function(e) {
|
||||||
|
var t = {};
|
||||||
|
function n(r) {
|
||||||
|
if (t[r])
|
||||||
|
return t[r].exports;
|
||||||
|
var a = t[r] = { i: r, l: false, exports: {} };
|
||||||
|
return e[r].call(a.exports, a, a.exports, n), a.l = true, a.exports;
|
||||||
|
}
|
||||||
|
return n.m = e, n.c = t, n.d = function(e2, t2, r) {
|
||||||
|
n.o(e2, t2) || Object.defineProperty(e2, t2, { enumerable: true, get: r });
|
||||||
|
}, n.r = function(e2) {
|
||||||
|
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true });
|
||||||
|
}, n.t = function(e2, t2) {
|
||||||
|
if (1 & t2 && (e2 = n(e2)), 8 & t2)
|
||||||
|
return e2;
|
||||||
|
if (4 & t2 && "object" == typeof e2 && e2 && e2.__esModule)
|
||||||
|
return e2;
|
||||||
|
var r = /* @__PURE__ */ Object.create(null);
|
||||||
|
if (n.r(r), Object.defineProperty(r, "default", { enumerable: true, value: e2 }), 2 & t2 && "string" != typeof e2)
|
||||||
|
for (var a in e2)
|
||||||
|
n.d(r, a, function(t3) {
|
||||||
|
return e2[t3];
|
||||||
|
}.bind(null, a));
|
||||||
|
return r;
|
||||||
|
}, n.n = function(e2) {
|
||||||
|
var t2 = e2 && e2.__esModule ? function() {
|
||||||
|
return e2.default;
|
||||||
|
} : function() {
|
||||||
|
return e2;
|
||||||
|
};
|
||||||
|
return n.d(t2, "a", t2), t2;
|
||||||
|
}, n.o = function(e2, t2) {
|
||||||
|
return Object.prototype.hasOwnProperty.call(e2, t2);
|
||||||
|
}, n.p = "", n(n.s = 0);
|
||||||
|
}([function(e, t, n) {
|
||||||
|
n.r(t);
|
||||||
|
var r = window, a = /^image\//, i = /\.\w+$/, o = {}, s = { file: null, quality: 0.8, convertSize: 2048e3, loose: true, redressOrientation: true }, f = function(e2) {
|
||||||
|
return "function" == typeof e2;
|
||||||
|
}, c = function(e2) {
|
||||||
|
return a.test(e2);
|
||||||
|
};
|
||||||
|
function l(e2) {
|
||||||
|
e2 = Object.assign({}, s, e2), this.options = e2, this.file = e2.file, this.image = null, this.ParsedOrientationInfo = null, this.init();
|
||||||
|
}
|
||||||
|
var u = l.prototype;
|
||||||
|
for (var h in t.default = l, u.init = function() {
|
||||||
|
var e2 = this, t2 = this.file, n2 = this.options;
|
||||||
|
t2 && c(t2.type) ? (c(n2.mimeType) || (n2.mimeType = t2.type), o.file2Image(t2, function(r2) {
|
||||||
|
f(e2.beforeCompress) && (e2.image = r2, t2.width = r2.naturalWidth, t2.height = r2.naturalHeight, e2.beforeCompress(t2)), "image/jpeg" === t2.type && n2.redressOrientation ? e2.getParsedOrientationInfo(function(t3) {
|
||||||
|
e2.parsedOrientationInfo = t3, e2.rendCanvas();
|
||||||
|
}) : (e2.parsedOrientationInfo = { rotate: 0, scaleX: 1, scaleY: 1 }, e2.rendCanvas());
|
||||||
|
}, e2.error)) : e2.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6!");
|
||||||
|
}, u.rendCanvas = function() {
|
||||||
|
var e2 = this, t2 = this.options, n2 = this.image, r2 = this.getExpectedEdge(), a2 = r2.dWidth, i2 = r2.dHeight, s2 = r2.width, f2 = r2.height, c2 = o.image2Canvas(n2, a2, i2, e2.beforeDraw.bind(e2), e2.afterDraw.bind(e2), s2, f2);
|
||||||
|
o.canvas2Blob(c2, function(t3) {
|
||||||
|
t3 && (t3.width = c2.width, t3.height = c2.height), e2.success(t3);
|
||||||
|
}, t2.quality, t2.mimeType);
|
||||||
|
}, u.beforeCompress = function() {
|
||||||
|
f(this.options.beforeCompress) && this.options.beforeCompress(this.file);
|
||||||
|
}, u.getExpectedEdge = function() {
|
||||||
|
var e2, t2 = this.image, n2 = this.parsedOrientationInfo.rotate, r2 = this.options, a2 = t2.naturalWidth, i2 = t2.naturalHeight, o2 = Math.abs(n2) % 180 == 90;
|
||||||
|
o2 && (e2 = i2, i2 = a2, a2 = e2);
|
||||||
|
var s2 = a2 / i2, f2 = Math.max(r2.maxWidth, 0) || 1 / 0, c2 = Math.max(r2.maxHeight, 0) || 1 / 0, l2 = Math.max(r2.minWidth, 0) || 0, u2 = Math.max(r2.minHeight, 0) || 0, h2 = Math.max(r2.width, 0) || a2, d = Math.max(r2.height, 0) || i2;
|
||||||
|
f2 < 1 / 0 && c2 < 1 / 0 ? c2 * s2 > f2 ? c2 = f2 / s2 : f2 = c2 * s2 : f2 < 1 / 0 ? c2 = f2 / s2 : c2 < 1 / 0 && (f2 = c2 * s2), l2 > 0 && u2 > 0 ? u2 * s2 > l2 ? u2 = l2 / s2 : l2 = u2 * s2 : l2 > 0 ? u2 = l2 / s2 : u2 > 0 && (l2 = u2 * s2), d * s2 > h2 ? d = h2 / s2 : h2 = d * s2;
|
||||||
|
var g = h2 = Math.floor(Math.min(Math.max(h2, l2), f2)), p = d = Math.floor(Math.min(Math.max(d, u2), c2));
|
||||||
|
return o2 && (e2 = p, p = g, g = e2), { dWidth: g, dHeight: p, width: h2, height: d };
|
||||||
|
}, u.getParsedOrientationInfo = function(e2) {
|
||||||
|
var t2 = this;
|
||||||
|
this.getOrientation(function(n2) {
|
||||||
|
f(e2) && e2(t2.parseOrientation(n2));
|
||||||
|
});
|
||||||
|
}, u.getOrientation = function(e2) {
|
||||||
|
var t2 = this;
|
||||||
|
o.file2ArrayBuffer(this.file, function(n2) {
|
||||||
|
f(e2) && e2(t2.resetAndGetOrientation(n2));
|
||||||
|
});
|
||||||
|
}, u.resetAndGetOrientation = function(e2) {
|
||||||
|
var t2, n2 = new DataView(e2);
|
||||||
|
try {
|
||||||
|
var r2, a2, i2;
|
||||||
|
if (255 === n2.getUint8(0) && 216 === n2.getUint8(1))
|
||||||
|
for (var s2 = n2.byteLength, f2 = 2; f2 + 1 < s2; ) {
|
||||||
|
if (255 === n2.getUint8(f2) && 225 === n2.getUint8(f2 + 1)) {
|
||||||
|
a2 = f2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
f2 += 1;
|
||||||
|
}
|
||||||
|
if (a2) {
|
||||||
|
var c2 = a2 + 4, l2 = a2 + 10;
|
||||||
|
if ("Exif" === o.getStringFromCharCode(n2, c2, 4)) {
|
||||||
|
var u2 = n2.getUint16(l2);
|
||||||
|
if (((r2 = 18761 === u2) || 19789 === u2) && 42 === n2.getUint16(l2 + 2, r2)) {
|
||||||
|
var h2 = n2.getUint32(l2 + 4, r2);
|
||||||
|
h2 >= 8 && (i2 = l2 + h2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i2) {
|
||||||
|
var d;
|
||||||
|
s2 = n2.getUint16(i2, r2);
|
||||||
|
for (d = 0; d < s2; d += 1)
|
||||||
|
if (f2 = i2 + 12 * d + 2, 274 === n2.getUint16(f2, r2)) {
|
||||||
|
f2 += 8, t2 = n2.getUint16(f2, r2), n2.setUint16(f2, 1, r2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e3) {
|
||||||
|
console.error(e3), t2 = 1;
|
||||||
|
}
|
||||||
|
return t2;
|
||||||
|
}, u.parseOrientation = function(e2) {
|
||||||
|
var t2 = 0, n2 = 1, r2 = 1;
|
||||||
|
switch (e2) {
|
||||||
|
case 2:
|
||||||
|
n2 = -1;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
t2 = -180;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
r2 = -1;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
t2 = 90, r2 = -1;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
t2 = 90;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
t2 = 90, n2 = -1;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
t2 = -90;
|
||||||
|
}
|
||||||
|
return { rotate: t2, scaleX: n2, scaleY: r2 };
|
||||||
|
}, u.beforeDraw = function(e2, t2) {
|
||||||
|
var n2 = this.parsedOrientationInfo, r2 = n2.rotate, a2 = n2.scaleX, i2 = n2.scaleY, o2 = this.file, s2 = this.options, c2 = "transparent", l2 = t2.width, u2 = t2.height;
|
||||||
|
switch (o2.size > s2.convertSize && "image/png" === s2.mimeType && (c2 = "#fff", s2.mimeType = "image/jpeg"), e2.fillStyle = c2, e2.fillRect(0, 0, l2, u2), f(s2.beforeDraw) && s2.beforeDraw.call(this, e2, t2), e2.save(), r2) {
|
||||||
|
case 90:
|
||||||
|
e2.translate(l2, 0);
|
||||||
|
break;
|
||||||
|
case -90:
|
||||||
|
e2.translate(0, u2);
|
||||||
|
break;
|
||||||
|
case -180:
|
||||||
|
e2.translate(l2, u2);
|
||||||
|
}
|
||||||
|
e2.rotate(r2 * Math.PI / 180), e2.scale(a2, i2);
|
||||||
|
}, u.afterDraw = function(e2, t2) {
|
||||||
|
var n2 = this.options;
|
||||||
|
f(n2.afterDraw) && n2.afterDraw.call(this, e2, t2);
|
||||||
|
}, u.error = function(e2) {
|
||||||
|
var t2 = this.options;
|
||||||
|
if (!f(t2.error))
|
||||||
|
throw new Error(e2);
|
||||||
|
t2.error.call(this, e2);
|
||||||
|
}, u.success = function(e2) {
|
||||||
|
var t2, n2, r2 = this.options, a2 = this.file, o2 = this.image, s2 = this.getExpectedEdge(), l2 = o2.naturalHeight, u2 = o2.naturalWidth;
|
||||||
|
if (e2 && e2.size)
|
||||||
|
if (!r2.loose && e2.size > a2.size && !(s2.width > u2 || s2.height > l2))
|
||||||
|
console.warn("\u5F53\u524D\u8BBE\u7F6E\u7684\u662F\u975E\u5BBD\u677E\u6A21\u5F0F\uFF0C\u538B\u7F29\u7ED3\u679C\u5927\u4E8E\u6E90\u56FE\u7247\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"), e2 = a2;
|
||||||
|
else {
|
||||||
|
var h2 = new Date();
|
||||||
|
e2.lastModified = h2.getTime(), e2.lastModifiedDate = h2, e2.name = a2.name, e2.name && e2.type !== a2.type && (e2.name = e2.name.replace(i, (t2 = e2.type, "jpeg" === (n2 = c(t2) ? t2.substr(6) : "") && (n2 = "jpg"), "." + n2)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
console.warn("\u56FE\u7247\u538B\u7F29\u51FA\u4E86\u70B9\u610F\u5916\uFF0C\u8F93\u51FA\u6E90\u56FE\u7247"), e2 = a2;
|
||||||
|
f(r2.success) && r2.success.call(this, e2);
|
||||||
|
}, o.file2DataUrl = function(e2, t2, n2) {
|
||||||
|
var r2 = new FileReader();
|
||||||
|
r2.onload = function() {
|
||||||
|
t2(r2.result);
|
||||||
|
}, r2.onerror = function() {
|
||||||
|
f(n2) && n2("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01");
|
||||||
|
}, r2.readAsDataURL(e2);
|
||||||
|
}, o.file2ArrayBuffer = function(e2, t2, n2) {
|
||||||
|
var r2 = new FileReader();
|
||||||
|
r2.onload = function(e3) {
|
||||||
|
t2(e3.target.result);
|
||||||
|
}, r2.onerror = function() {
|
||||||
|
f(n2) && n2("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF01");
|
||||||
|
}, r2.readAsArrayBuffer(e2);
|
||||||
|
}, o.getStringFromCharCode = function(e2, t2, n2) {
|
||||||
|
var r2, a2 = "";
|
||||||
|
for (n2 += t2, r2 = t2; r2 < n2; r2 += 1)
|
||||||
|
a2 += String.fromCharCode(e2.getUint8(r2));
|
||||||
|
return a2;
|
||||||
|
}, o.file2Image = function(e2, t2, n2) {
|
||||||
|
var a2 = new Image(), i2 = r.URL || r.webkitURL;
|
||||||
|
if (r.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(r.navigator.userAgent) && (a2.crossOrigin = "anonymous"), a2.alt = e2.name, a2.onerror = function() {
|
||||||
|
f(n2) && n2("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01");
|
||||||
|
}, i2) {
|
||||||
|
var o2 = i2.createObjectURL(e2);
|
||||||
|
a2.onload = function() {
|
||||||
|
t2(a2), i2.revokeObjectURL(o2);
|
||||||
|
}, a2.src = o2;
|
||||||
|
} else
|
||||||
|
this.file2DataUrl(e2, function(e3) {
|
||||||
|
a2.onload = function() {
|
||||||
|
t2(a2);
|
||||||
|
}, a2.src = e3;
|
||||||
|
}, n2);
|
||||||
|
}, o.url2Image = function(e2, t2, n2) {
|
||||||
|
var r2 = new Image();
|
||||||
|
r2.src = e2, r2.onload = function() {
|
||||||
|
t2(r2);
|
||||||
|
}, r2.onerror = function() {
|
||||||
|
f(n2) && n2("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01");
|
||||||
|
};
|
||||||
|
}, o.image2Canvas = function(e2, t2, n2, r2, a2, i2, o2) {
|
||||||
|
var s2 = document.createElement("canvas"), c2 = s2.getContext("2d");
|
||||||
|
return s2.width = i2 || e2.naturalWidth, s2.height = o2 || e2.naturalHeight, f(r2) && r2(c2, s2), c2.save(), c2.drawImage(e2, 0, 0, t2, n2), c2.restore(), f(a2) && a2(c2, s2), s2;
|
||||||
|
}, o.canvas2DataUrl = function(e2, t2, n2) {
|
||||||
|
return e2.toDataURL(n2 || "image/jpeg", t2);
|
||||||
|
}, o.dataUrl2Image = function(e2, t2, n2) {
|
||||||
|
var r2 = new Image();
|
||||||
|
r2.onload = function() {
|
||||||
|
t2(r2);
|
||||||
|
}, r2.error = function() {
|
||||||
|
f(n2) && n2("\u56FE\u7247\u52A0\u8F7D\u9519\u8BEF\uFF01");
|
||||||
|
}, r2.src = e2;
|
||||||
|
}, o.dataUrl2Blob = function(e2, t2) {
|
||||||
|
for (var n2 = e2.split(",")[1], r2 = e2.match(/^data:(.*?)(;base64)?,/)[1], a2 = atob(n2), i2 = n2.length, o2 = new Uint8Array(i2), s2 = 0; s2 < i2; s2++)
|
||||||
|
o2[s2] = a2.charCodeAt(s2);
|
||||||
|
return new Blob([o2], { type: t2 || r2 });
|
||||||
|
}, o.blob2DataUrl = function(e2, t2, n2) {
|
||||||
|
this.file2DataUrl(e2, t2, n2);
|
||||||
|
}, o.blob2Image = function(e2, t2, n2) {
|
||||||
|
this.file2Image(e2, t2, n2);
|
||||||
|
}, o.canvas2Blob = function(e2, t2, n2, r2) {
|
||||||
|
var a2 = this;
|
||||||
|
HTMLCanvasElement.prototype.toBlob || Object.defineProperty(HTMLCanvasElement.prototype, "toBlob", { value: function(e3, t3, n3) {
|
||||||
|
var r3 = this.toDataURL(t3, n3);
|
||||||
|
e3(a2.dataUrl2Blob(r3));
|
||||||
|
} }), e2.toBlob(function(e3) {
|
||||||
|
t2(e3);
|
||||||
|
}, r2 || "image/jpeg", n2 || 0.8);
|
||||||
|
}, o.upload = function(e2, t2, n2) {
|
||||||
|
var r2 = new XMLHttpRequest(), a2 = new FormData();
|
||||||
|
a2.append("file", t2), r2.onreadystatechange = function() {
|
||||||
|
if (4 !== r2.readyState || 200 !== r2.status)
|
||||||
|
throw new Error(r2);
|
||||||
|
n2 && n2(r2.responseText);
|
||||||
|
}, r2.open("POST", e2, true), r2.send(a2);
|
||||||
|
}, o)
|
||||||
|
o.hasOwnProperty(h) && (l[h] = o[h]);
|
||||||
|
}]).default;
|
||||||
|
});
|
||||||
|
})(imageCompressor_min);
|
||||||
|
{
|
||||||
|
jsImageCompressor.exports = imageCompressor_min.exports;
|
||||||
|
}
|
||||||
|
var ImageCompressor = jsImageCompressor.exports;
|
||||||
|
export { ImageCompressor as I };
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { m as makeSymbol, a as assign, i as isNumber, b as isString, c as isObject, d as isArray, e as isBoolean, f as createCompileError, g as isEmptyObject, r as registerMessageCompiler, h as getGlobalThis, s as setDevToolsHook, j as isPlainObject, k as hasOwn, l as handleFlatJson, n as isRegExp, o as isFunction, p as createCoreContext, u as updateFallbackLocale, q as compileToFunction, t as resolveValue, v as clearDateTimeFormat, w as clearNumberFormat, x as setAdditionalMeta, N as NOT_REOSLVED, y as parseTranslateArgs, z as translate, M as MISSING_RESOLVE_VALUE, A as parseDateTimeArgs, B as datetime, C as parseNumberArgs, D as number, E as getLocaleChain } from "../@intlify/index.js";
|
import { m as makeSymbol, a as assign, i as isNumber, b as isString, c as isObject, d as isBoolean, e as isEmptyObject, r as registerMessageCompiler, g as getGlobalThis, s as setDevToolsHook, f as createCompileError, h as isPlainObject, j as isArray, k as hasOwn, l as handleFlatJson, n as isRegExp, o as isFunction, u as updateFallbackLocale, p as compileToFunction, q as createCoreContext, t as resolveValue, v as clearDateTimeFormat, w as clearNumberFormat, x as setAdditionalMeta, N as NOT_REOSLVED, y as parseTranslateArgs, z as translate, M as MISSING_RESOLVE_VALUE, A as parseDateTimeArgs, B as datetime, C as parseNumberArgs, D as number, E as getLocaleChain } from "../@intlify/index.js";
|
||||||
import { h, Fragment, getCurrentInstance, inject, onMounted, onUnmounted, isRef, ref, computed, watch, createVNode, Text } from "vue";
|
import { h, Fragment, getCurrentInstance, inject, onMounted, onUnmounted, ref, computed, watch, isRef, createVNode, Text } from "vue";
|
||||||
/*!
|
/*!
|
||||||
* vue-i18n v9.1.10
|
* vue-i18n v9.1.10
|
||||||
* (c) 2022 kazuya kawaguchi
|
* (c) 2022 kazuya kawaguchi
|
||||||
@@ -80,8 +80,12 @@ function createComposer(options = {}) {
|
|||||||
const { __root } = options;
|
const { __root } = options;
|
||||||
const _isGlobal = __root === void 0;
|
const _isGlobal = __root === void 0;
|
||||||
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
||||||
const _locale = ref(__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US");
|
const _locale = ref(
|
||||||
const _fallbackLocale = ref(__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value);
|
__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : "en-US"
|
||||||
|
);
|
||||||
|
const _fallbackLocale = ref(
|
||||||
|
__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
||||||
|
);
|
||||||
const _messages = ref(getLocaleMessages(_locale.value, options));
|
const _messages = ref(getLocaleMessages(_locale.value, options));
|
||||||
const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
const _datetimeFormats = ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
||||||
const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
const _numberFormats = ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
||||||
@@ -215,7 +219,8 @@ function createComposer(options = {}) {
|
|||||||
type: "vnode"
|
type: "vnode"
|
||||||
};
|
};
|
||||||
function transrateVNode(...args) {
|
function transrateVNode(...args) {
|
||||||
return wrapWithDeps((context) => {
|
return wrapWithDeps(
|
||||||
|
(context) => {
|
||||||
let ret;
|
let ret;
|
||||||
const _context2 = context;
|
const _context2 = context;
|
||||||
try {
|
try {
|
||||||
@@ -225,13 +230,33 @@ function createComposer(options = {}) {
|
|||||||
_context2.processor = null;
|
_context2.processor = null;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}, () => parseTranslateArgs(...args), "translate", (root) => root[TransrateVNodeSymbol](...args), (key) => [createVNode(Text, null, key, 0)], (val) => isArray(val));
|
},
|
||||||
|
() => parseTranslateArgs(...args),
|
||||||
|
"translate",
|
||||||
|
(root) => root[TransrateVNodeSymbol](...args),
|
||||||
|
(key) => [createVNode(Text, null, key, 0)],
|
||||||
|
(val) => isArray(val)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
function numberParts(...args) {
|
function numberParts(...args) {
|
||||||
return wrapWithDeps((context) => number(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root[NumberPartsSymbol](...args), () => [], (val) => isString(val) || isArray(val));
|
return wrapWithDeps(
|
||||||
|
(context) => number(context, ...args),
|
||||||
|
() => parseNumberArgs(...args),
|
||||||
|
"number format",
|
||||||
|
(root) => root[NumberPartsSymbol](...args),
|
||||||
|
() => [],
|
||||||
|
(val) => isString(val) || isArray(val)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
function datetimeParts(...args) {
|
function datetimeParts(...args) {
|
||||||
return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root[DatetimePartsSymbol](...args), () => [], (val) => isString(val) || isArray(val));
|
return wrapWithDeps(
|
||||||
|
(context) => datetime(context, ...args),
|
||||||
|
() => parseDateTimeArgs(...args),
|
||||||
|
"datetime format",
|
||||||
|
(root) => root[DatetimePartsSymbol](...args),
|
||||||
|
() => [],
|
||||||
|
(val) => isString(val) || isArray(val)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
function setPluralRules(rules) {
|
function setPluralRules(rules) {
|
||||||
_pluralRules = rules;
|
_pluralRules = rules;
|
||||||
|
|||||||
19987
es/_chunks/xlsx/index.js
Normal file
19987
es/_chunks/xlsx/index.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, useSlots, computed, unref, openBlock, createElementBlock, normalizeClass, renderSlot, createBlock } from "vue";
|
import { defineComponent, useSlots, computed, unref, openBlock, createElementBlock, normalizeClass, renderSlot, createBlock } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ".layui-avatar{font-size:14px;font-variant:tabular-nums;border-radius:var(--global-border-radius);box-sizing:border-box;color:#fff;list-style:none;position:relative;display:inline-block;background:#eeeeee;overflow:hidden;white-space:nowrap;text-align:center;width:32px;height:32px;line-height:32px;vertical-align:middle}.layui-avatar.layui-avatar-radius{border-radius:50%}.layui-avatar.layui-avatar-sm{height:30px;width:30px}.layui-avatar.layui-avatar-lg{height:36px;width:36px}.layui-avatar.layui-avatar-xs{height:28px;width:28px}.layui-avatar-list .layui-avatar{margin-left:-10px;display:inline-block}.layui-avatar>img{width:100%;height:100%;display:block;object-fit:cover}\n")();
|
var index = /* @__PURE__ */ (() => ".layui-avatar{font-size:14px;font-variant:tabular-nums;border-radius:var(--global-border-radius);box-sizing:border-box;color:#fff;list-style:none;position:relative;display:inline-block;background:#eeeeee;overflow:hidden;white-space:nowrap;text-align:center;width:32px;height:32px;line-height:32px;vertical-align:middle}.layui-avatar.layui-avatar-radius{border-radius:50%}.layui-avatar.layui-avatar-sm{height:30px;width:30px}.layui-avatar.layui-avatar-lg{height:36px;width:36px}.layui-avatar.layui-avatar-xs{height:28px;width:28px}.layui-avatar-list .layui-avatar{margin-left:-10px;display:inline-block}.layui-avatar>img{width:100%;height:100%;display:block;object-fit:cover}\n")();
|
||||||
const _hoisted_1 = ["src", "alt"];
|
const _hoisted_1 = ["src", "alt"];
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
@@ -39,7 +39,7 @@ const _sfc_main = defineComponent({
|
|||||||
key: 0,
|
key: 0,
|
||||||
src: __props.src,
|
src: __props.src,
|
||||||
alt: __props.alt
|
alt: __props.alt
|
||||||
}, null, 8, _hoisted_1)) : (openBlock(), createBlock(unref(_sfc_main$2E), {
|
}, null, 8, _hoisted_1)) : (openBlock(), createBlock(unref(_sfc_main$2W), {
|
||||||
key: 1,
|
key: 1,
|
||||||
type: __props.icon
|
type: __props.icon
|
||||||
}, null, 8, ["type"]))
|
}, null, 8, ["type"]))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, ref, shallowRef, computed, onMounted, onBeforeUnmount, withDirectives, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, renderSlot, createVNode, vShow } from "vue";
|
import { defineComponent, ref, shallowRef, computed, onMounted, onBeforeUnmount, withDirectives, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, renderSlot, createVNode, vShow } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ".layui-backtop{position:fixed;right:30px;bottom:40px;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:40px;background-color:#9f9f9f;color:#fff;border-radius:var(--global-border-radius);opacity:.95;z-index:999999}.layui-backtop :hover{opacity:.85}.layui-backtop-medium{width:40px;height:40px;font-size:30px}.layui-backtop-small{width:30px;height:30px;font-size:20px}\n")();
|
var index = /* @__PURE__ */ (() => ".layui-backtop{position:fixed;right:30px;bottom:40px;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:40px;background-color:#9f9f9f;color:#fff;border-radius:var(--global-border-radius);opacity:.95;z-index:999999}.layui-backtop :hover{opacity:.85}.layui-backtop-medium{width:40px;height:40px;font-size:30px}.layui-backtop-small{width:30px;height:30px;font-size:20px}\n")();
|
||||||
const _hoisted_1 = ["onClick"];
|
const _hoisted_1 = ["onClick"];
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
@@ -107,7 +107,9 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
if (props.position === "absolute") {
|
if (props.position === "absolute") {
|
||||||
if (!targetElement.parentElement) {
|
if (!targetElement.parentElement) {
|
||||||
throw new Error(`target parent element is not existed: ${props.target}`);
|
throw new Error(
|
||||||
|
`target parent element is not existed: ${props.target}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
targetElement.parentElement.style.position = "relative";
|
targetElement.parentElement.style.position = "relative";
|
||||||
}
|
}
|
||||||
@@ -162,7 +164,7 @@ const _sfc_main = defineComponent({
|
|||||||
onMouseup: handlerMouseup
|
onMouseup: handlerMouseup
|
||||||
}, [
|
}, [
|
||||||
renderSlot(_ctx.$slots, "default", {}, () => [
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
||||||
createVNode(unref(_sfc_main$2E), {
|
createVNode(unref(_sfc_main$2W), {
|
||||||
type: props.icon,
|
type: props.icon,
|
||||||
size: `${props.iconSize}px`,
|
size: `${props.iconSize}px`,
|
||||||
color: props.iconColor
|
color: props.iconColor
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export { c as default } from "./index2.js";
|
export { d as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
|
|||||||
@@ -6,6 +6,27 @@ const withInstall = (comp) => {
|
|||||||
};
|
};
|
||||||
return component2;
|
return component2;
|
||||||
};
|
};
|
||||||
|
const isElement = (vn) => {
|
||||||
|
return Boolean(vn && vn.shapeFlag & 1);
|
||||||
|
};
|
||||||
|
const isComponent = (vn, type) => {
|
||||||
|
return Boolean(vn && vn.shapeFlag & 6);
|
||||||
|
};
|
||||||
|
const isArrayChildren = (vn, children) => {
|
||||||
|
return Boolean(vn && vn.shapeFlag & 16);
|
||||||
|
};
|
||||||
|
function convertSlotName(vm, name) {
|
||||||
|
const camelCaseName = camelCase(name);
|
||||||
|
const kebabCaseName = kebabCase(name);
|
||||||
|
return vm.slots[camelCaseName] ? camelCaseName : vm.slots[kebabCaseName] ? kebabCaseName : name;
|
||||||
|
}
|
||||||
|
function camelCase(str) {
|
||||||
|
return str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
|
||||||
|
}
|
||||||
|
function kebabCase(key) {
|
||||||
|
const result = key.replace(/([A-Z])/g, " $1").trim();
|
||||||
|
return result.split(" ").join("-").toLowerCase();
|
||||||
|
}
|
||||||
var index = /* @__PURE__ */ (() => ".layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#ff5722;color:#fff;border-radius:var(--global-border-radius)}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;border-color:var(--global-neutral-color-3);color:#666}.layui-badge-dot-ripple>span{position:absolute;top:0;left:0;width:100%;height:100%;display:block;border-radius:50%;box-sizing:border-box;animation:layui-badge-dot-anim-ripple 1.2s ease-in-out infinite}@keyframes layui-badge-dot-anim-ripple{0%{transform:scale(.8);opacity:.6}to{transform:scale(2.4);opacity:0}}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}\n")();
|
var index = /* @__PURE__ */ (() => ".layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#ff5722;color:#fff;border-radius:var(--global-border-radius)}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;border-color:var(--global-neutral-color-3);color:#666}.layui-badge-dot-ripple>span{position:absolute;top:0;left:0;width:100%;height:100%;display:block;border-radius:50%;box-sizing:border-box;animation:layui-badge-dot-anim-ripple 1.2s ease-in-out infinite}@keyframes layui-badge-dot-anim-ripple{0%{transform:scale(.8);opacity:.6}to{transform:scale(2.4);opacity:0}}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}\n")();
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LayBadge"
|
name: "LayBadge"
|
||||||
@@ -51,4 +72,4 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const component = withInstall(_sfc_main);
|
const component = withInstall(_sfc_main);
|
||||||
export { component as c, withInstall as w };
|
export { isComponent as a, isArrayChildren as b, convertSlotName as c, component as d, isElement as i, withInstall as w };
|
||||||
|
|||||||
@@ -153,10 +153,14 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
watch(slotsChange, () => {
|
watch(
|
||||||
|
slotsChange,
|
||||||
|
() => {
|
||||||
childrens.value = [];
|
childrens.value = [];
|
||||||
setItemInstanceBySlot(slot.default && slot.default());
|
setItemInstanceBySlot(slot.default && slot.default());
|
||||||
}, { immediate: true, deep: true });
|
},
|
||||||
|
{ immediate: true, deep: true }
|
||||||
|
);
|
||||||
const sub = () => {
|
const sub = () => {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c;
|
||||||
for (var i = 0; i < childrens.value.length; i++) {
|
for (var i = 0; i < childrens.value.length; i++) {
|
||||||
@@ -213,11 +217,15 @@ const _sfc_main = defineComponent({
|
|||||||
intervalTimer = window.setInterval(autoplay, props.interval);
|
intervalTimer = window.setInterval(autoplay, props.interval);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
watch(() => props.autoplay, () => {
|
watch(
|
||||||
|
() => props.autoplay,
|
||||||
|
() => {
|
||||||
if (props.autoplay) {
|
if (props.autoplay) {
|
||||||
intervalTimer = window.setInterval(autoplay, props.interval);
|
intervalTimer = window.setInterval(autoplay, props.interval);
|
||||||
}
|
}
|
||||||
}, { immediate: true });
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
provide("active", active);
|
provide("active", active);
|
||||||
provide("slotsChange", slotsChange);
|
provide("slotsChange", slotsChange);
|
||||||
provide("anim", anim);
|
provide("anim", anim);
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ import { defineComponent, onMounted, watch, ref, useSlots, openBlock, createElem
|
|||||||
import { _ as _sfc_main$3 } from "../input/index2.js";
|
import { _ as _sfc_main$3 } from "../input/index2.js";
|
||||||
import { _ as _sfc_main$2 } from "../scroll/index2.js";
|
import { _ as _sfc_main$2 } from "../scroll/index2.js";
|
||||||
import { _ as _sfc_main$1 } from "../dropdown/index2.js";
|
import { _ as _sfc_main$1 } from "../dropdown/index2.js";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../dropdownMenu/index2.js";
|
import "../dropdownMenu/index2.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}.layui-cascader{display:inline-block}.layui-cascader[size=lg]{height:44px;width:260px}.layui-cascader[size=lg] .layui-input{height:44px;line-height:44px}.layui-cascader[size=md]{height:38px;width:220px}.layui-cascader[size=md] .layui-input{height:38px;line-height:38px}.layui-cascader[size=sm]{height:32px;width:180px}.layui-cascader[size=sm] .layui-input{height:32px;line-height:32px}.layui-cascader[size=xs]{height:26px;width:140px}.layui-cascader[size=xs] .layui-input{height:26px;line-height:26px}.layui-cascader .layui-input-suffix{padding-right:10px}.layui-cascader .layui-icon-triangle-d{transition:all .3s ease-in-out;transform:rotate(0);color:var(--global-neutral-color-8)}.layui-cascader-opend .layui-icon-triangle-d{transform:rotate(180deg)}.layui-cascader .layui-cascader-panel{box-sizing:border-box;border-radius:2px;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;display:inline-flex}.layui-cascader-menu{display:inline-block;border-right:1px solid var(--global-neutral-color-3)}.layui-cascader-menu:last-child{border-right:none}.layui-cascader-menu-item{min-width:130px;padding:5px 9px 5px 15px;box-sizing:border-box;transition:all .1s ease-in-out;display:flex;justify-content:space-between;align-items:center;min-height:35px}.layui-cascader-menu-item:hover,.layui-cascader-selected{background-color:var(--global-checked-color);color:#fff}.layui-cascader-menu-item .layui-icon-right{margin-left:10px}.layui-cascader-disabled,.layui-cascader-disabled *{cursor:not-allowed!important}\n")();
|
var index = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}.layui-cascader{display:inline-block}.layui-cascader[size=lg]{height:44px;width:260px}.layui-cascader[size=lg] .layui-input{height:44px;line-height:44px}.layui-cascader[size=md]{height:38px;width:220px}.layui-cascader[size=md] .layui-input{height:38px;line-height:38px}.layui-cascader[size=sm]{height:32px;width:180px}.layui-cascader[size=sm] .layui-input{height:32px;line-height:32px}.layui-cascader[size=xs]{height:26px;width:140px}.layui-cascader[size=xs] .layui-input{height:26px;line-height:26px}.layui-cascader .layui-input-suffix{padding-right:10px}.layui-cascader .layui-icon-triangle-d{transition:all .3s ease-in-out;transform:rotate(0);color:var(--global-neutral-color-8)}.layui-cascader-opend .layui-icon-triangle-d{transform:rotate(180deg)}.layui-cascader .layui-cascader-panel{box-sizing:border-box;border-radius:2px;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;display:inline-flex}.layui-cascader-menu{display:inline-block;border-right:1px solid var(--global-neutral-color-3)}.layui-cascader-menu:last-child{border-right:none}.layui-cascader-menu-item{min-width:130px;padding:5px 9px 5px 15px;box-sizing:border-box;transition:all .1s ease-in-out;display:flex;justify-content:space-between;align-items:center;min-height:35px}.layui-cascader-menu-item:hover,.layui-cascader-selected{background-color:var(--global-checked-color);color:#fff}.layui-cascader-menu-item .layui-icon-right{margin-left:10px}.layui-cascader-disabled,.layui-cascader-disabled *{cursor:not-allowed!important}\n")();
|
||||||
const _hoisted_1 = ["size"];
|
const _hoisted_1 = ["size"];
|
||||||
const _hoisted_2 = { class: "layui-cascader-panel" };
|
const _hoisted_2 = {
|
||||||
const _hoisted_3 = ["onClick"];
|
key: 1,
|
||||||
const _hoisted_4 = {
|
class: "slot-area"
|
||||||
|
};
|
||||||
|
const _hoisted_3 = { class: "layui-cascader-panel" };
|
||||||
|
const _hoisted_4 = ["onClick"];
|
||||||
|
const _hoisted_5 = {
|
||||||
key: 2,
|
key: 2,
|
||||||
class: "layui-icon layui-icon-right"
|
class: "layui-icon layui-icon-right"
|
||||||
};
|
};
|
||||||
@@ -45,14 +49,28 @@ const _sfc_main = defineComponent({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initTreeData();
|
initTreeData();
|
||||||
});
|
});
|
||||||
watch(() => props.options, () => {
|
watch(
|
||||||
|
() => props.options,
|
||||||
|
() => {
|
||||||
initTreeData();
|
initTreeData();
|
||||||
});
|
}
|
||||||
watch(() => props.modelValue, () => {
|
);
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
() => {
|
||||||
|
if (watchModelValue.value) {
|
||||||
if (props.modelValue === null || props.modelValue === "") {
|
if (props.modelValue === null || props.modelValue === "") {
|
||||||
onClear();
|
onClear();
|
||||||
|
} else {
|
||||||
|
updateDisplayByModelValue();
|
||||||
}
|
}
|
||||||
});
|
setTimeout(() => {
|
||||||
|
watchModelValue.value = true;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const watchModelValue = ref(true);
|
||||||
const treeData = ref([]);
|
const treeData = ref([]);
|
||||||
const initTreeData = () => {
|
const initTreeData = () => {
|
||||||
let treeLvNum = getMaxFloor(props.options);
|
let treeLvNum = getMaxFloor(props.options);
|
||||||
@@ -69,29 +87,27 @@ const _sfc_main = defineComponent({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateDisplayByModelValue();
|
||||||
|
};
|
||||||
|
function updateDisplayByModelValue() {
|
||||||
if (props.modelValue) {
|
if (props.modelValue) {
|
||||||
try {
|
try {
|
||||||
let valueData = props.modelValue.split(props.decollator);
|
let valueData = props.modelValue.split(props.decollator);
|
||||||
let data = [];
|
for (let index2 = 0; index2 < valueData.length; index2++) {
|
||||||
for (let index2 = 0; index2 < treeData.value.length; index2++) {
|
const element = valueData[index2];
|
||||||
const element = treeData.value[index2];
|
let selectIndex = treeData.value[index2].data.findIndex(
|
||||||
const nowValue = valueData[index2];
|
(e) => e.value === element
|
||||||
for (let i = 0; i < element.length; i++) {
|
);
|
||||||
const ele = element[i];
|
if (selectIndex == -1) {
|
||||||
if (nowValue === ele.value) {
|
break;
|
||||||
data.push(ele);
|
|
||||||
element.selectIndex = i;
|
|
||||||
}
|
}
|
||||||
|
selectBar(treeData.value[index2].data[selectIndex], selectIndex, index2);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
displayValue.value = data.map((e) => {
|
|
||||||
return e.label;
|
|
||||||
}).join(` ${props.decollator} `);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
function getMaxFloor(treeData2) {
|
function getMaxFloor(treeData2) {
|
||||||
let max = 0;
|
let max = 0;
|
||||||
function each(data, floor) {
|
function each(data, floor) {
|
||||||
@@ -165,6 +181,7 @@ const _sfc_main = defineComponent({
|
|||||||
let value = data.map((e) => {
|
let value = data.map((e) => {
|
||||||
return e.value;
|
return e.value;
|
||||||
}).join(props.decollator);
|
}).join(props.decollator);
|
||||||
|
watchModelValue.value = false;
|
||||||
emit("update:modelValue", value);
|
emit("update:modelValue", value);
|
||||||
let evt = {
|
let evt = {
|
||||||
display: displayValue.value,
|
display: displayValue.value,
|
||||||
@@ -218,7 +235,7 @@ const _sfc_main = defineComponent({
|
|||||||
onHide: _cache[2] || (_cache[2] = ($event) => openState.value = false)
|
onHide: _cache[2] || (_cache[2] = ($event) => openState.value = false)
|
||||||
}, {
|
}, {
|
||||||
content: withCtx(() => [
|
content: withCtx(() => [
|
||||||
createElementVNode("div", _hoisted_2, [
|
createElementVNode("div", _hoisted_3, [
|
||||||
(openBlock(true), createElementBlock(Fragment, null, renderList(treeData.value, (itemCol, index2) => {
|
(openBlock(true), createElementBlock(Fragment, null, renderList(treeData.value, (itemCol, index2) => {
|
||||||
return openBlock(), createElementBlock(Fragment, null, [
|
return openBlock(), createElementBlock(Fragment, null, [
|
||||||
itemCol.data.length ? (openBlock(), createBlock(_sfc_main$2, {
|
itemCol.data.length ? (openBlock(), createBlock(_sfc_main$2, {
|
||||||
@@ -240,8 +257,8 @@ const _sfc_main = defineComponent({
|
|||||||
item.slot && unref(slots)[item.slot] ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
item.slot && unref(slots)[item.slot] ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
||||||
createTextVNode(toDisplayString(item.label), 1)
|
createTextVNode(toDisplayString(item.label), 1)
|
||||||
], 64)),
|
], 64)),
|
||||||
item.children && item.children.length ? (openBlock(), createElementBlock("i", _hoisted_4)) : createCommentVNode("", true)
|
item.children && item.children.length ? (openBlock(), createElementBlock("i", _hoisted_5)) : createCommentVNode("", true)
|
||||||
], 10, _hoisted_3);
|
], 10, _hoisted_4);
|
||||||
}), 128))
|
}), 128))
|
||||||
]),
|
]),
|
||||||
_: 2
|
_: 2
|
||||||
@@ -262,7 +279,9 @@ const _sfc_main = defineComponent({
|
|||||||
readonly: true,
|
readonly: true,
|
||||||
size: __props.size,
|
size: __props.size,
|
||||||
onClear
|
onClear
|
||||||
}, null, 8, ["modelValue", "placeholder", "allow-clear", "disabled", "size"])) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
}, null, 8, ["modelValue", "placeholder", "allow-clear", "disabled", "size"])) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
||||||
|
renderSlot(_ctx.$slots, "default")
|
||||||
|
]))
|
||||||
]),
|
]),
|
||||||
_: 3
|
_: 3
|
||||||
}, 8, ["trigger", "disabled", "contentClass", "contentStyle"])
|
}, 8, ["trigger", "disabled", "contentClass", "contentStyle"])
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:var(--global-neutral-color-8)}.layui-form-checkbox i{top:0;right:0;width:29px;height:28px;position:absolute;border:1px solid var(--global-neutral-color-6);border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:var(--global-neutral-color-8);color:var(--global-neutral-color-8)}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid var(--global-neutral-color-6);font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:var(--global-checked-color);color:#fff}.layui-form-checked,.layui-form-checked:hover{border-color:var(--global-checked-color)}.layui-form-checked i,.layui-form-checked:hover i{color:var(--global-checked-color)}.layui-form-checked span,.layui-form-checked:hover span{background-color:var(--global-checked-color)}.layui-form-checked[lay-skin=primary] i{border-color:var(--global-checked-color);background-color:var(--global-checked-color);color:#fff}.layui-form-checked[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:var(--global-neutral-color-8)!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:var(--global-neutral-color-6)}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled span{background-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled em{color:var(--global-neutral-color-6)!important}.layui-checkbox-disabled:hover i{color:#fff!important}.layui-checkbox-disabled .layui-icon-ok,.layui-checkbox-disabled .layui-icon-subtraction{background-color:var(--global-neutral-color-3)!important;border-color:var(--global-neutral-color-3)!important}
|
.layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:var(--global-neutral-color-8)}.layui-form-checkbox i{top:0;right:0;width:29px;height:28px;position:absolute;border-top:1px solid var(--global-neutral-color-6);border-bottom:1px solid var(--global-neutral-color-6);border-right:1px solid var(--global-neutral-color-6);border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:var(--global-neutral-color-8);color:var(--global-neutral-color-8)}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid var(--global-neutral-color-6);font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:var(--global-checked-color);color:#fff}.layui-form-checked,.layui-form-checked:hover{border-color:var(--global-checked-color)}.layui-form-checked i,.layui-form-checked:hover i{color:var(--global-checked-color)}.layui-form-checked span,.layui-form-checked:hover span{background-color:var(--global-checked-color)}.layui-form-checked[lay-skin=primary] i{border-color:var(--global-checked-color);background-color:var(--global-checked-color);color:#fff}.layui-form-checked[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:var(--global-neutral-color-8)!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:var(--global-neutral-color-6)}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled span{background-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled em{color:var(--global-neutral-color-6)!important}.layui-checkbox-disabled:hover i{color:#fff!important}.layui-checkbox-disabled .layui-icon-ok,.layui-checkbox-disabled .layui-icon-subtraction{background-color:var(--global-neutral-color-3)!important;border-color:var(--global-neutral-color-3)!important}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
import "../badge/index2.js";
|
import "../badge/index2.js";
|
||||||
export { c as default } from "./index2.js";
|
export { c as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
|
import "../_chunks/@layui/index.js";
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,38 +1,5 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, ref, provide, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
import { _ as _sfc_main } from "../index2.js";
|
||||||
const __default__ = {
|
import "vue";
|
||||||
name: "LayCheckboxGroup"
|
|
||||||
};
|
|
||||||
const _sfc_main = defineComponent({
|
|
||||||
...__default__,
|
|
||||||
props: {
|
|
||||||
modelValue: { default: () => [] },
|
|
||||||
disabled: { type: Boolean, default: false }
|
|
||||||
},
|
|
||||||
emits: ["update:modelValue", "change"],
|
|
||||||
setup(__props, { emit }) {
|
|
||||||
const props = __props;
|
|
||||||
const modelValue = ref(props.modelValue);
|
|
||||||
const disabled = ref(props.disabled);
|
|
||||||
provide("checkboxGroup", {
|
|
||||||
name: "LayCheckboxGroup",
|
|
||||||
modelValue,
|
|
||||||
disabled
|
|
||||||
});
|
|
||||||
watch(() => modelValue, (val) => {
|
|
||||||
emit("change", modelValue.value);
|
|
||||||
emit("update:modelValue", modelValue.value);
|
|
||||||
}, { deep: true });
|
|
||||||
watch(() => props.modelValue, (val) => modelValue.value = val);
|
|
||||||
watch(() => props.disabled, (val) => disabled.value = val);
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return openBlock(), createElementBlock("div", {
|
|
||||||
class: normalizeClass(["layui-checkbox-group", { "layui-checkbox-group-disabled": disabled.value }])
|
|
||||||
}, [
|
|
||||||
renderSlot(_ctx.$slots, "default")
|
|
||||||
], 2);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const component = withInstall(_sfc_main);
|
const component = withInstall(_sfc_main);
|
||||||
export { component as default };
|
export { component as default };
|
||||||
|
|||||||
@@ -15,9 +15,12 @@ const _sfc_main = defineComponent({
|
|||||||
emits: ["update:modelValue", "change"],
|
emits: ["update:modelValue", "change"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
watch(() => props.modelValue, (val) => {
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => {
|
||||||
activeValues.value = [].concat(val);
|
activeValues.value = [].concat(val);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
const activeValues = ref([].concat(props.modelValue));
|
const activeValues = ref([].concat(props.modelValue));
|
||||||
provide("layCollapse", {
|
provide("layCollapse", {
|
||||||
accordion: props.accordion,
|
accordion: props.accordion,
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ const _sfc_main = defineComponent({
|
|||||||
},
|
},
|
||||||
setup(__props) {
|
setup(__props) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
const { accordion, activeValues, emit, collapseTransition } = inject("layCollapse");
|
const { accordion, activeValues, emit, collapseTransition } = inject(
|
||||||
|
"layCollapse"
|
||||||
|
);
|
||||||
let isShow = computed(() => {
|
let isShow = computed(() => {
|
||||||
return activeValues.value.includes(props.id);
|
return activeValues.value.includes(props.id);
|
||||||
});
|
});
|
||||||
@@ -32,7 +34,10 @@ const _sfc_main = defineComponent({
|
|||||||
} else {
|
} else {
|
||||||
activeValues.value.push(props.id);
|
activeValues.value.push(props.id);
|
||||||
}
|
}
|
||||||
emit("update:modelValue", accordion ? activeValues.value[0] || null : activeValues.value);
|
emit(
|
||||||
|
"update:modelValue",
|
||||||
|
accordion ? activeValues.value[0] || null : activeValues.value
|
||||||
|
);
|
||||||
emit("change", props.id, !_isShow, activeValues.value);
|
emit("change", props.id, !_isShow, activeValues.value);
|
||||||
};
|
};
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
|
|||||||
@@ -132,7 +132,10 @@ const _sfc_main = defineComponent({
|
|||||||
alpha.value = a;
|
alpha.value = a;
|
||||||
});
|
});
|
||||||
watch([red, green, blue], (newValue) => {
|
watch([red, green, blue], (newValue) => {
|
||||||
emit("update:modelValue", rgba2hex(red.value, green.value, blue.value, alpha.value));
|
emit(
|
||||||
|
"update:modelValue",
|
||||||
|
rgba2hex(red.value, green.value, blue.value, alpha.value)
|
||||||
|
);
|
||||||
let { h, s, v } = rgb2hsv(red.value, green.value, blue.value);
|
let { h, s, v } = rgb2hsv(red.value, green.value, blue.value);
|
||||||
hue.value = h;
|
hue.value = h;
|
||||||
saturation.value = s;
|
saturation.value = s;
|
||||||
@@ -141,7 +144,10 @@ const _sfc_main = defineComponent({
|
|||||||
hueSliderStyle.value = `left: ${hue.value / 360 * 100}%;`;
|
hueSliderStyle.value = `left: ${hue.value / 360 * 100}%;`;
|
||||||
});
|
});
|
||||||
watch(alpha, () => {
|
watch(alpha, () => {
|
||||||
emit("update:modelValue", rgba2hex(red.value, green.value, blue.value, alpha.value));
|
emit(
|
||||||
|
"update:modelValue",
|
||||||
|
rgba2hex(red.value, green.value, blue.value, alpha.value)
|
||||||
|
);
|
||||||
alphaSliderStyle.value = `left: ${alpha.value >= 1 ? "calc(100% - 6px)" : alpha.value * 100 + "%"};`;
|
alphaSliderStyle.value = `left: ${alpha.value >= 1 ? "calc(100% - 6px)" : alpha.value * 100 + "%"};`;
|
||||||
});
|
});
|
||||||
let colorObj = computed(() => {
|
let colorObj = computed(() => {
|
||||||
@@ -278,7 +284,9 @@ const _sfc_main = defineComponent({
|
|||||||
if (color) {
|
if (color) {
|
||||||
let r, g, b, a;
|
let r, g, b, a;
|
||||||
if (typeof color === "string") {
|
if (typeof color === "string") {
|
||||||
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8}|[0-9a-fA-F]{3}|[0-9a-fA-F]{4})$/.test(color)) {
|
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8}|[0-9a-fA-F]{3}|[0-9a-fA-F]{4})$/.test(
|
||||||
|
color
|
||||||
|
)) {
|
||||||
return hex2rgba(color);
|
return hex2rgba(color);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ const _sfc_main = defineComponent({
|
|||||||
},
|
},
|
||||||
setup(__props) {
|
setup(__props) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
const classes = computed(() => props.fluid ? "layui-fluid" : "layui-container");
|
const classes = computed(
|
||||||
|
() => props.fluid ? "layui-fluid" : "layui-container"
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", {
|
return openBlock(), createElementBlock("div", {
|
||||||
class: normalizeClass(unref(classes))
|
class: normalizeClass(unref(classes))
|
||||||
|
|||||||
@@ -50,11 +50,14 @@ const _sfc_main = defineComponent({
|
|||||||
const start = function() {
|
const start = function() {
|
||||||
localStartVal.value = props.endVal;
|
localStartVal.value = props.endVal;
|
||||||
};
|
};
|
||||||
watch(() => props.endVal, () => {
|
watch(
|
||||||
|
() => props.endVal,
|
||||||
|
() => {
|
||||||
if (props.autoplay) {
|
if (props.autoplay) {
|
||||||
localStartVal.value = props.endVal;
|
localStartVal.value = props.endVal;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.autoplay) {
|
if (props.autoplay) {
|
||||||
start();
|
start();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@ import "vue";
|
|||||||
import "../_chunks/dayjs/index.js";
|
import "../_chunks/dayjs/index.js";
|
||||||
import "../_chunks/@umijs/index.js";
|
import "../_chunks/@umijs/index.js";
|
||||||
import "../input/index2.js";
|
import "../input/index2.js";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../dropdownMenu/index2.js";
|
import "../dropdownMenu/index2.js";
|
||||||
import "../dropdown/index2.js";
|
import "../dropdown/index2.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { i as isElement, a as isComponent, b as isArrayChildren, w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, ref, onMounted, openBlock, createBlock, Teleport, renderSlot, onUpdated, useSlots, useAttrs, inject, shallowRef, reactive, toRefs, computed, onBeforeUnmount, watch, provide, createElementBlock, Fragment, createVNode, unref, mergeProps, withCtx, normalizeClass, normalizeStyle, createCommentVNode, cloneVNode, h, nextTick } from "vue";
|
import { defineComponent, ref, onMounted, openBlock, createBlock, Teleport, renderSlot, onUpdated, useSlots, useAttrs, inject, shallowRef, reactive, toRefs, computed, onBeforeUnmount, watch, provide, createElementBlock, Fragment, createVNode, unref, mergeProps, withCtx, normalizeClass, normalizeStyle, createCommentVNode, cloneVNode, h, nextTick } from "vue";
|
||||||
import { u as useWindowSize, a as useResizeObserver, o as onClickOutside, b as useThrottleFn } from "../_chunks/@vueuse/index.js";
|
import { u as useWindowSize, a as useResizeObserver, o as onClickOutside, b as useThrottleFn } from "../_chunks/@vueuse/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}\n")();
|
var index = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}\n")();
|
||||||
@@ -56,15 +56,6 @@ const getScrollElements = (container) => {
|
|||||||
}
|
}
|
||||||
return scrollElements;
|
return scrollElements;
|
||||||
};
|
};
|
||||||
const isElement = (vn) => {
|
|
||||||
return Boolean(vn && vn.shapeFlag & 1);
|
|
||||||
};
|
|
||||||
const isComponent = (vn, type) => {
|
|
||||||
return Boolean(vn && vn.shapeFlag & 6);
|
|
||||||
};
|
|
||||||
const isArrayChildren = (vn, children) => {
|
|
||||||
return Boolean(vn && vn.shapeFlag & 16);
|
|
||||||
};
|
|
||||||
const getChildrenArray = (vn) => {
|
const getChildrenArray = (vn) => {
|
||||||
if (isArrayChildren(vn, vn.children)) {
|
if (isArrayChildren(vn, vn.children)) {
|
||||||
return vn.children;
|
return vn.children;
|
||||||
@@ -185,7 +176,10 @@ const _sfc_main = defineComponent({
|
|||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
const childrenRefs = /* @__PURE__ */ new Set();
|
const childrenRefs = /* @__PURE__ */ new Set();
|
||||||
const dropdownCtx = inject(dropdownInjectionKey, void 0);
|
const dropdownCtx = inject(
|
||||||
|
dropdownInjectionKey,
|
||||||
|
void 0
|
||||||
|
);
|
||||||
const { children, firstElement: dropdownRef } = useFirstElement();
|
const { children, firstElement: dropdownRef } = useFirstElement();
|
||||||
const contentRef = shallowRef();
|
const contentRef = shallowRef();
|
||||||
const contentStyle = ref({});
|
const contentStyle = ref({});
|
||||||
@@ -197,11 +191,15 @@ const _sfc_main = defineComponent({
|
|||||||
const { x: mouseLeft, y: mouseTop } = toRefs(mousePosition);
|
const { x: mouseLeft, y: mouseTop } = toRefs(mousePosition);
|
||||||
const openState = ref(false);
|
const openState = ref(false);
|
||||||
let scrollElements;
|
let scrollElements;
|
||||||
const containerRef = computed(() => {
|
const containerRef = computed(
|
||||||
|
() => {
|
||||||
var _a;
|
var _a;
|
||||||
return props.popupContainer ? (_a = document.querySelector(props.popupContainer)) != null ? _a : document.body : dropdownRef.value;
|
return props.popupContainer ? (_a = document.querySelector(props.popupContainer)) != null ? _a : document.body : dropdownRef.value;
|
||||||
});
|
}
|
||||||
const triggerMethods = computed(() => [].concat(props.trigger));
|
);
|
||||||
|
const triggerMethods = computed(
|
||||||
|
() => [].concat(props.trigger)
|
||||||
|
);
|
||||||
const computedPlacement = computed(() => {
|
const computedPlacement = computed(() => {
|
||||||
return transformPlacement(props.placement);
|
return transformPlacement(props.placement);
|
||||||
});
|
});
|
||||||
@@ -285,7 +283,11 @@ const _sfc_main = defineComponent({
|
|||||||
const containerRect = containerRef.value.getBoundingClientRect();
|
const containerRect = containerRef.value.getBoundingClientRect();
|
||||||
const triggerRect = props.alignPoint ? getTriggerRect() : getElementScrollRect(dropdownRef.value, containerRect);
|
const triggerRect = props.alignPoint ? getTriggerRect() : getElementScrollRect(dropdownRef.value, containerRect);
|
||||||
const contentRect = getElementScrollRect(contentRef.value, containerRect);
|
const contentRect = getElementScrollRect(contentRef.value, containerRect);
|
||||||
const { style } = getContentStyle(computedPlacement.value, triggerRect, contentRect);
|
const { style } = getContentStyle(
|
||||||
|
computedPlacement.value,
|
||||||
|
triggerRect,
|
||||||
|
contentRect
|
||||||
|
);
|
||||||
if (props.autoFitMinWidth) {
|
if (props.autoFitMinWidth) {
|
||||||
style.minWidth = `${triggerRect.width}px`;
|
style.minWidth = `${triggerRect.width}px`;
|
||||||
}
|
}
|
||||||
@@ -296,11 +298,20 @@ const _sfc_main = defineComponent({
|
|||||||
if (props.autoFitPosition) {
|
if (props.autoFitPosition) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const triggerRect2 = props.alignPoint ? getTriggerRect() : getElementScrollRect(dropdownRef.value, containerRect);
|
const triggerRect2 = props.alignPoint ? getTriggerRect() : getElementScrollRect(dropdownRef.value, containerRect);
|
||||||
const contentRect2 = getElementScrollRect(contentRef.value, containerRect);
|
const contentRect2 = getElementScrollRect(
|
||||||
|
contentRef.value,
|
||||||
|
containerRect
|
||||||
|
);
|
||||||
let { top, left } = style;
|
let { top, left } = style;
|
||||||
top = Number(top.toString().replace("px", ""));
|
top = Number(top.toString().replace("px", ""));
|
||||||
left = Number(left.toString().replace("px", ""));
|
left = Number(left.toString().replace("px", ""));
|
||||||
const { top: fitTop, left: fitLeft } = getFitPlacement(top, left, computedPlacement.value, triggerRect2, contentRect2);
|
const { top: fitTop, left: fitLeft } = getFitPlacement(
|
||||||
|
top,
|
||||||
|
left,
|
||||||
|
computedPlacement.value,
|
||||||
|
triggerRect2,
|
||||||
|
contentRect2
|
||||||
|
);
|
||||||
style.top = `${fitTop}px`;
|
style.top = `${fitTop}px`;
|
||||||
style.left = `${fitLeft}px`;
|
style.left = `${fitLeft}px`;
|
||||||
contentStyle.value = {
|
contentStyle.value = {
|
||||||
@@ -529,16 +540,22 @@ const _sfc_main = defineComponent({
|
|||||||
dropdownCtx == null ? void 0 : dropdownCtx.removeChildRef(ref2);
|
dropdownCtx == null ? void 0 : dropdownCtx.removeChildRef(ref2);
|
||||||
};
|
};
|
||||||
dropdownCtx == null ? void 0 : dropdownCtx.addChildRef(contentRef);
|
dropdownCtx == null ? void 0 : dropdownCtx.addChildRef(contentRef);
|
||||||
const { stop: removeContentResizeObserver } = useResizeObserver(contentRef, () => {
|
const { stop: removeContentResizeObserver } = useResizeObserver(
|
||||||
|
contentRef,
|
||||||
|
() => {
|
||||||
if (openState.value && props.autoFixPosition) {
|
if (openState.value && props.autoFixPosition) {
|
||||||
updateContentStyle();
|
updateContentStyle();
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
const { stop: removeTriggerResizeObserver } = useResizeObserver(dropdownRef, () => {
|
);
|
||||||
|
const { stop: removeTriggerResizeObserver } = useResizeObserver(
|
||||||
|
dropdownRef,
|
||||||
|
() => {
|
||||||
if (openState.value && props.autoFixPosition) {
|
if (openState.value && props.autoFixPosition) {
|
||||||
updateContentStyle();
|
updateContentStyle();
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
onClickOutside(dropdownRef, (e) => {
|
onClickOutside(dropdownRef, (e) => {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c;
|
||||||
if (!props.clickOutsideToClose || !openState.value || ((_a = dropdownRef.value) == null ? void 0 : _a.contains(e.target)) || ((_b = contentRef.value) == null ? void 0 : _b.contains(e.target))) {
|
if (!props.clickOutsideToClose || !openState.value || ((_a = dropdownRef.value) == null ? void 0 : _a.contains(e.target)) || ((_b = contentRef.value) == null ? void 0 : _b.contains(e.target))) {
|
||||||
@@ -553,7 +570,10 @@ const _sfc_main = defineComponent({
|
|||||||
});
|
});
|
||||||
const onlyChildRenderFunc = () => {
|
const onlyChildRenderFunc = () => {
|
||||||
const slotContent = slots.default ? slots.default() : [];
|
const slotContent = slots.default ? slots.default() : [];
|
||||||
const transformedSlotContent = slotContent.map((vnode) => cloneVNode(vnode, {
|
const transformedSlotContent = slotContent.map(
|
||||||
|
(vnode) => cloneVNode(
|
||||||
|
vnode,
|
||||||
|
{
|
||||||
onClick: handleClick,
|
onClick: handleClick,
|
||||||
onContextmenu: handleContextMenuClick,
|
onContextmenu: handleContextMenuClick,
|
||||||
onMouseenter: handleMouseEnter,
|
onMouseenter: handleMouseEnter,
|
||||||
@@ -561,7 +581,10 @@ const _sfc_main = defineComponent({
|
|||||||
onFocusin: handleFocusin,
|
onFocusin: handleFocusin,
|
||||||
onFocusout: handleFocusout,
|
onFocusout: handleFocusout,
|
||||||
...attrs
|
...attrs
|
||||||
}, true));
|
},
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
children.value = transformedSlotContent;
|
children.value = transformedSlotContent;
|
||||||
return h(Fragment, children.value);
|
return h(Fragment, children.value);
|
||||||
};
|
};
|
||||||
@@ -586,16 +609,23 @@ const _sfc_main = defineComponent({
|
|||||||
removeTriggerResizeObserver();
|
removeTriggerResizeObserver();
|
||||||
window.removeEventListener("resize", handleScroll);
|
window.removeEventListener("resize", handleScroll);
|
||||||
});
|
});
|
||||||
watch(() => props.visible, (newVal, oldVal) => {
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(newVal, oldVal) => {
|
||||||
openState.value = newVal;
|
openState.value = newVal;
|
||||||
}, { immediate: true });
|
},
|
||||||
provide(dropdownInjectionKey, reactive({
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
provide(
|
||||||
|
dropdownInjectionKey,
|
||||||
|
reactive({
|
||||||
onMouseenter: handleMouseEnterWithContext,
|
onMouseenter: handleMouseEnterWithContext,
|
||||||
onMouseleave: handleMouseLeaveWithContext,
|
onMouseleave: handleMouseLeaveWithContext,
|
||||||
addChildRef,
|
addChildRef,
|
||||||
removeChildRef,
|
removeChildRef,
|
||||||
hide: handleContextHide
|
hide: handleContextHide
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
provide("openState", openState);
|
provide("openState", openState);
|
||||||
expose({ show, hide, toggle });
|
expose({ show, hide, toggle });
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ const _sfc_main = defineComponent({
|
|||||||
setup(__props) {
|
setup(__props) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
inject("openState");
|
inject("openState");
|
||||||
const dropdownCtx = inject(dropdownInjectionKey, void 0);
|
const dropdownCtx = inject(
|
||||||
|
dropdownInjectionKey,
|
||||||
|
void 0
|
||||||
|
);
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if (props.disabled) {
|
if (props.disabled) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { defineComponent, openBlock, createBlock, withCtx, createVNode, renderSl
|
|||||||
import { _ as _sfc_main$1 } from "../dropdown/index2.js";
|
import { _ as _sfc_main$1 } from "../dropdown/index2.js";
|
||||||
import { L as LayDropdownMenu } from "../dropdownMenu/index2.js";
|
import { L as LayDropdownMenu } from "../dropdownMenu/index2.js";
|
||||||
import { _ as _sfc_main$2 } from "../dropdownMenuItem/index2.js";
|
import { _ as _sfc_main$2 } from "../dropdownMenuItem/index2.js";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LayDropdownSubMenu"
|
name: "LayDropdownSubMenu"
|
||||||
@@ -38,7 +38,7 @@ const _sfc_main = defineComponent({
|
|||||||
createVNode(_sfc_main$2, { disabled: __props.disabled }, createSlots({
|
createVNode(_sfc_main$2, { disabled: __props.disabled }, createSlots({
|
||||||
suffix: withCtx(() => [
|
suffix: withCtx(() => [
|
||||||
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
||||||
createVNode(unref(_sfc_main$2E), {
|
createVNode(unref(_sfc_main$2W), {
|
||||||
type: "layui-icon-right",
|
type: "layui-icon-right",
|
||||||
size: "14px"
|
size: "14px"
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import "../datePicker/index2.js";
|
|||||||
import "../_chunks/dayjs/index.js";
|
import "../_chunks/dayjs/index.js";
|
||||||
import "../_chunks/@umijs/index.js";
|
import "../_chunks/@umijs/index.js";
|
||||||
import "../input/index2.js";
|
import "../input/index2.js";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../dropdownMenu/index2.js";
|
import "../dropdownMenu/index2.js";
|
||||||
import "../dropdown/index2.js";
|
import "../dropdown/index2.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ const _sfc_main = defineComponent({
|
|||||||
const props = __props;
|
const props = __props;
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const description = computed(() => props.description ? props.description : t("empty.description"));
|
const description = computed(
|
||||||
|
() => props.description ? props.description : t("empty.description")
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||||
createElementVNode("div", _hoisted_2, [
|
createElementVNode("div", _hoisted_2, [
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ const _sfc_main = defineComponent({
|
|||||||
} else if (typeof fields === "string" || Array.isArray(fields) && fields.length > 0) {
|
} else if (typeof fields === "string" || Array.isArray(fields) && fields.length > 0) {
|
||||||
validateItems = [];
|
validateItems = [];
|
||||||
const validateFields = !fields ? [] : [].concat(fields);
|
const validateFields = !fields ? [] : [].concat(fields);
|
||||||
validateFields.forEach((field) => formItemMap[field] && validateItems.push(formItemMap[field]));
|
validateFields.forEach(
|
||||||
|
(field) => formItemMap[field] && validateItems.push(formItemMap[field])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
let errorsArrs = [];
|
let errorsArrs = [];
|
||||||
validateItems.forEach((filed) => {
|
validateItems.forEach((filed) => {
|
||||||
@@ -70,7 +72,9 @@ const _sfc_main = defineComponent({
|
|||||||
if (clearFields.length === 0) {
|
if (clearFields.length === 0) {
|
||||||
formItems.forEach((filed) => filed.clearValidate());
|
formItems.forEach((filed) => filed.clearValidate());
|
||||||
} else {
|
} else {
|
||||||
clearFields.forEach((field) => formItemMap[field] && formItemMap[field].clearValidate());
|
clearFields.forEach(
|
||||||
|
(field) => formItemMap[field] && formItemMap[field].clearValidate()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const reset = function() {
|
const reset = function() {
|
||||||
@@ -88,13 +92,16 @@ const _sfc_main = defineComponent({
|
|||||||
formItemMap[item.prop] = item;
|
formItemMap[item.prop] = item;
|
||||||
};
|
};
|
||||||
expose({ validate, clearValidate, reset });
|
expose({ validate, clearValidate, reset });
|
||||||
provide("LayForm", reactive({
|
provide(
|
||||||
|
"LayForm",
|
||||||
|
reactive({
|
||||||
formItems,
|
formItems,
|
||||||
addField,
|
addField,
|
||||||
clearValidate,
|
clearValidate,
|
||||||
validate,
|
validate,
|
||||||
...toRefs(props)
|
...toRefs(props)
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("form", {
|
return openBlock(), createElementBlock("form", {
|
||||||
class: "layui-form",
|
class: "layui-form",
|
||||||
|
|||||||
@@ -89,8 +89,14 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
return rulesArrs;
|
return rulesArrs;
|
||||||
});
|
});
|
||||||
const filedValue = computed(() => props.prop ? layForm.model[props.prop] : void 0);
|
const filedValue = computed(
|
||||||
watch(() => filedValue.value, (val) => validate(), { deep: true });
|
() => props.prop ? layForm.model[props.prop] : void 0
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => filedValue.value,
|
||||||
|
(val) => validate(),
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
const errorMsg = ref();
|
const errorMsg = ref();
|
||||||
const errorStatus = ref(false);
|
const errorStatus = ref(false);
|
||||||
const validate = (callback) => {
|
const validate = (callback) => {
|
||||||
@@ -101,7 +107,11 @@ const _sfc_main = defineComponent({
|
|||||||
let model = {};
|
let model = {};
|
||||||
let validateMessage = null;
|
let validateMessage = null;
|
||||||
if (layForm.useCN) {
|
if (layForm.useCN) {
|
||||||
validateMessage = Object.assign({}, cnValidateMessage, layForm.validateMessage);
|
validateMessage = Object.assign(
|
||||||
|
{},
|
||||||
|
cnValidateMessage,
|
||||||
|
layForm.validateMessage
|
||||||
|
);
|
||||||
model[props.label || props.prop] = filedValue.value;
|
model[props.label || props.prop] = filedValue.value;
|
||||||
} else {
|
} else {
|
||||||
layForm.validateMessage && (validateMessage = layForm.validateMessage);
|
layForm.validateMessage && (validateMessage = layForm.validateMessage);
|
||||||
@@ -143,12 +153,14 @@ const _sfc_main = defineComponent({
|
|||||||
expose({ validate, clearValidate });
|
expose({ validate, clearValidate });
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.prop) {
|
if (props.prop) {
|
||||||
layForm.addField(reactive({
|
layForm.addField(
|
||||||
|
reactive({
|
||||||
...toRefs(props),
|
...toRefs(props),
|
||||||
$el: formItemRef,
|
$el: formItemRef,
|
||||||
validate,
|
validate,
|
||||||
clearValidate
|
clearValidate
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const getMarginLeft = computed(() => {
|
const getMarginLeft = computed(() => {
|
||||||
@@ -179,7 +191,9 @@ const _sfc_main = defineComponent({
|
|||||||
}, [
|
}, [
|
||||||
props.prop && unref(isRequired) ? (openBlock(), createElementBlock("span", {
|
props.prop && unref(isRequired) ? (openBlock(), createElementBlock("span", {
|
||||||
key: 0,
|
key: 0,
|
||||||
class: normalizeClass(["layui-required", "layui-icon"].concat((_a = unref(layForm).requiredIcons) != null ? _a : ""))
|
class: normalizeClass(
|
||||||
|
["layui-required", "layui-icon"].concat((_a = unref(layForm).requiredIcons) != null ? _a : "")
|
||||||
|
)
|
||||||
}, [
|
}, [
|
||||||
renderSlot(_ctx.$slots, "required", {
|
renderSlot(_ctx.$slots, "required", {
|
||||||
props: { ...props, model: unref(layForm).model }
|
props: { ...props, model: unref(layForm).model }
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ const _sfc_main = defineComponent({
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
const defaultElement = document.documentElement;
|
const defaultElement = document.documentElement;
|
||||||
let targetEl = ref(props.target || defaultElement);
|
let targetEl = ref(
|
||||||
|
props.target || defaultElement
|
||||||
|
);
|
||||||
const isFullscreen = ref(false);
|
const isFullscreen = ref(false);
|
||||||
let isSupported = false;
|
let isSupported = false;
|
||||||
const unprefixedMethods = methodMap[0];
|
const unprefixedMethods = methodMap[0];
|
||||||
@@ -79,10 +81,14 @@ const _sfc_main = defineComponent({
|
|||||||
targetEl2 = activeEl.value || defaultElement;
|
targetEl2 = activeEl.value || defaultElement;
|
||||||
let fullscreenEnter = null;
|
let fullscreenEnter = null;
|
||||||
if (props.immersive) {
|
if (props.immersive) {
|
||||||
fullscreenEnter = Promise.resolve(targetEl2[fullscreenAPI.requestFullscreen]());
|
fullscreenEnter = Promise.resolve(
|
||||||
|
targetEl2[fullscreenAPI.requestFullscreen]()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
styleLayFullscreen(targetEl2, false);
|
styleLayFullscreen(targetEl2, false);
|
||||||
fullscreenEnter = Promise.resolve(targetEl2 == null ? void 0 : targetEl2.classList.add("layui-fullscreen"));
|
fullscreenEnter = Promise.resolve(
|
||||||
|
targetEl2 == null ? void 0 : targetEl2.classList.add("layui-fullscreen")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return await (fullscreenEnter == null ? void 0 : fullscreenEnter.then(() => {
|
return await (fullscreenEnter == null ? void 0 : fullscreenEnter.then(() => {
|
||||||
isFullscreen.value = true;
|
isFullscreen.value = true;
|
||||||
@@ -102,7 +108,9 @@ const _sfc_main = defineComponent({
|
|||||||
if (targetEl2 instanceof Document)
|
if (targetEl2 instanceof Document)
|
||||||
return;
|
return;
|
||||||
styleLayFullscreen(targetEl2, true);
|
styleLayFullscreen(targetEl2, true);
|
||||||
fullscreenExit = Promise.resolve(targetEl2 == null ? void 0 : targetEl2.classList.remove("layui-fullscreen"));
|
fullscreenExit = Promise.resolve(
|
||||||
|
targetEl2 == null ? void 0 : targetEl2.classList.remove("layui-fullscreen")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return await (fullscreenExit == null ? void 0 : fullscreenExit.then(() => {
|
return await (fullscreenExit == null ? void 0 : fullscreenExit.then(() => {
|
||||||
isFullscreen.value = false;
|
isFullscreen.value = false;
|
||||||
@@ -145,7 +153,10 @@ const _sfc_main = defineComponent({
|
|||||||
document.addEventListener("keydown", onKeydownF11);
|
document.addEventListener("keydown", onKeydownF11);
|
||||||
});
|
});
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
document.removeEventListener(fullscreenAPI.fullscreenchange, onFullscreenchange);
|
document.removeEventListener(
|
||||||
|
fullscreenAPI.fullscreenchange,
|
||||||
|
onFullscreenchange
|
||||||
|
);
|
||||||
document.removeEventListener("keydown", onFullscreenchange);
|
document.removeEventListener("keydown", onFullscreenchange);
|
||||||
document.removeEventListener("keydown", onKeydownF11);
|
document.removeEventListener("keydown", onKeydownF11);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
const component = withInstall(_sfc_main$2E);
|
const component = withInstall(_sfc_main$2W);
|
||||||
export { component as default };
|
export { component as default };
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}:root{--icon-picker-border-radius: var(--global-border-radius);--icon-picker-checked-color: var(--global-checked-color)}.layui-iconpicker{position:relative;height:38px;line-height:38px;border-width:1px;border-style:solid;border-radius:var(--icon-picker-border-radius);cursor:pointer}.layui-iconpicker .layui-inline{height:36px;line-height:36px;vertical-align:top}.layui-iconpicker-title{padding-left:5px}.layui-iconpicker-main{padding:0 10px}.layui-iconpicker-main .layui-icon{font-size:20px}.layui-iconpicker-main .layui-inline{vertical-align:top}.layui-iconpicker-split .layui-iconpicker-main{padding:0 15px;border-right-width:1px;border-right-style:solid}.layui-iconpicker-suffix{position:relative;width:35px;text-align:center}.layui-iconpicker-suffix .layui-icon{font-size:14px;color:#00000080;transition:all .3s}.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down{transform:rotate(180deg)}.layui-iconpicker-search{padding:10px;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid whitesmoke}.layui-iconpicker-list{width:321px}.layui-iconpicker-list ul{margin:6px}.layui-iconpicker-list li{vertical-align:top;display:inline-block;width:60px;margin:2.5px;padding:5px;overflow:hidden;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center}.layui-iconpicker-list li:hover{background-color:var(--global-neutral-color-1);color:#00000080}.layui-iconpicker-list li.layui-this{border-color:var(--icon-picker-checked-color);color:var(--icon-picker-checked-color)}.layui-iconpicker-list li .layui-icon{font-size:20px}.layui-iconpicker-list li .layui-elip{margin-top:2px;line-height:20px;font-size:12px}.layui-iconpicker-list .layui-none{margin:30px 0 35px}.layui-iconpicker-scroll .layui-iconpicker-list{max-height:200px}.layui-iconpicker-page{position:relative;padding:10px 10px 5px;border-top:1px solid #eee;text-align:right}.layui-iconpicker-page .layui-laypage{margin:0}.layui-iconpicker-page .layui-laypage a,.layui-iconpicker-page .layui-laypage span{padding:0 10px;color:#666}.layui-iconpicker-page .layui-laypage-count{position:absolute;left:10px}.layui-iconpicker-page .layui-laypage-curr .layui-laypage-em{background:0 0}.layui-iconpicker-page .layui-laypage-curr em{color:#666;color:#0009}.layui-iconpicker-page .layui-laypage-first,.layui-iconpicker-page .layui-laypage-last,.layui-iconpicker-page .layui-laypage-spr{display:none}.layui-colorpicker-disabled{opacity:.6}.layui-colorpicker-disabled,.layui-colorpicker-disabled *{cursor:not-allowed!important}
|
.layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}:root{--icon-picker-border-radius: var(--global-border-radius);--icon-picker-checked-color: var(--global-checked-color)}.layui-iconpicker{position:relative;height:38px;line-height:38px;border-width:1px;border-style:solid;border-radius:var(--icon-picker-border-radius);cursor:pointer}.layui-iconpicker .layui-inline{height:36px;line-height:36px;vertical-align:top}.layui-iconpicker-title{padding-left:5px}.layui-iconpicker-main{padding:0 10px}.layui-iconpicker-main .layui-icon{font-size:20px}.layui-iconpicker-main .layui-inline{vertical-align:top}.layui-iconpicker-split .layui-iconpicker-main{padding:0 15px;border-right-width:1px;border-right-style:solid}.layui-iconpicker-suffix{position:relative;width:35px;text-align:center}.layui-iconpicker-suffix .layui-icon{font-size:14px;color:#00000080;transition:all .3s;display:inline-block}.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down{transform:rotate(180deg)}.layui-iconpicker-search{padding:10px;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid whitesmoke}.layui-iconpicker-list{width:321px}.layui-iconpicker-list ul{margin:6px}.layui-iconpicker-list li{vertical-align:top;display:inline-block;width:60px;margin:2.5px;padding:5px;overflow:hidden;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center}.layui-iconpicker-list li:hover{background-color:var(--global-neutral-color-1);color:#00000080}.layui-iconpicker-list li.layui-this{border-color:var(--icon-picker-checked-color);color:var(--icon-picker-checked-color)}.layui-iconpicker-list li .layui-icon{font-size:20px}.layui-iconpicker-list li .layui-elip{margin-top:2px;line-height:20px;font-size:12px}.layui-iconpicker-list .layui-none{margin:30px 0 35px}.layui-iconpicker-scroll .layui-iconpicker-list{max-height:200px}.layui-iconpicker-page{position:relative;padding:10px 10px 5px;border-top:1px solid #eee;text-align:right}.layui-iconpicker-page .layui-laypage{margin:0}.layui-iconpicker-page .layui-laypage a,.layui-iconpicker-page .layui-laypage span{padding:0 10px;color:#666}.layui-iconpicker-page .layui-laypage-count{position:absolute;left:10px}.layui-iconpicker-page .layui-laypage-curr .layui-laypage-em{background:0 0}.layui-iconpicker-page .layui-laypage-curr em{color:#666;color:#0009}.layui-iconpicker-page .layui-laypage-first,.layui-iconpicker-page .layui-laypage-last,.layui-iconpicker-page .layui-laypage-spr{display:none}.layui-icon-picker-clear{color:#00000073;padding:0 0 0 10px}.layui-icon-picker-clear:hover,.layui-colorpicker-disabled{opacity:.6}.layui-colorpicker-disabled,.layui-colorpicker-disabled *{cursor:not-allowed!important}.transform{transform:rotate(180deg)}
|
||||||
|
|||||||
@@ -1,49 +1,51 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, computed, ref, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, createVNode, createCommentVNode, Fragment, renderList, normalizeClass, unref, toDisplayString } from "vue";
|
import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, createVNode, createCommentVNode, Fragment, renderList, normalizeClass, unref, toDisplayString, withModifiers } from "vue";
|
||||||
import { i as iconfont } from "../checkbox/index2.js";
|
import { i as iconfont } from "../_chunks/@layui/index.js";
|
||||||
import { _ as _sfc_main$1 } from "../dropdown/index2.js";
|
import { _ as _sfc_main$1 } from "../dropdown/index2.js";
|
||||||
import { _ as _sfc_main$2 } from "../input/index2.js";
|
import { _ as _sfc_main$2 } from "../input/index2.js";
|
||||||
import { _ as _sfc_main$3 } from "../scroll/index2.js";
|
import { _ as _sfc_main$3 } from "../scroll/index2.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
import "../dropdownMenu/index2.js";
|
import "../dropdownMenu/index2.js";
|
||||||
var index = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}:root{--icon-picker-border-radius: var(--global-border-radius);--icon-picker-checked-color: var(--global-checked-color)}.layui-iconpicker{position:relative;height:38px;line-height:38px;border-width:1px;border-style:solid;border-radius:var(--icon-picker-border-radius);cursor:pointer}.layui-iconpicker .layui-inline{height:36px;line-height:36px;vertical-align:top}.layui-iconpicker-title{padding-left:5px}.layui-iconpicker-main{padding:0 10px}.layui-iconpicker-main .layui-icon{font-size:20px}.layui-iconpicker-main .layui-inline{vertical-align:top}.layui-iconpicker-split .layui-iconpicker-main{padding:0 15px;border-right-width:1px;border-right-style:solid}.layui-iconpicker-suffix{position:relative;width:35px;text-align:center}.layui-iconpicker-suffix .layui-icon{font-size:14px;color:#00000080;transition:all .3s}.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down{transform:rotate(180deg)}.layui-iconpicker-search{padding:10px;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid whitesmoke}.layui-iconpicker-list{width:321px}.layui-iconpicker-list ul{margin:6px}.layui-iconpicker-list li{vertical-align:top;display:inline-block;width:60px;margin:2.5px;padding:5px;overflow:hidden;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center}.layui-iconpicker-list li:hover{background-color:var(--global-neutral-color-1);color:#00000080}.layui-iconpicker-list li.layui-this{border-color:var(--icon-picker-checked-color);color:var(--icon-picker-checked-color)}.layui-iconpicker-list li .layui-icon{font-size:20px}.layui-iconpicker-list li .layui-elip{margin-top:2px;line-height:20px;font-size:12px}.layui-iconpicker-list .layui-none{margin:30px 0 35px}.layui-iconpicker-scroll .layui-iconpicker-list{max-height:200px}.layui-iconpicker-page{position:relative;padding:10px 10px 5px;border-top:1px solid #eee;text-align:right}.layui-iconpicker-page .layui-laypage{margin:0}.layui-iconpicker-page .layui-laypage a,.layui-iconpicker-page .layui-laypage span{padding:0 10px;color:#666}.layui-iconpicker-page .layui-laypage-count{position:absolute;left:10px}.layui-iconpicker-page .layui-laypage-curr .layui-laypage-em{background:0 0}.layui-iconpicker-page .layui-laypage-curr em{color:#666;color:#0009}.layui-iconpicker-page .layui-laypage-first,.layui-iconpicker-page .layui-laypage-last,.layui-iconpicker-page .layui-laypage-spr{display:none}.layui-colorpicker-disabled{opacity:.6}.layui-colorpicker-disabled,.layui-colorpicker-disabled *{cursor:not-allowed!important}\n")();
|
var index = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}:root{--icon-picker-border-radius: var(--global-border-radius);--icon-picker-checked-color: var(--global-checked-color)}.layui-iconpicker{position:relative;height:38px;line-height:38px;border-width:1px;border-style:solid;border-radius:var(--icon-picker-border-radius);cursor:pointer}.layui-iconpicker .layui-inline{height:36px;line-height:36px;vertical-align:top}.layui-iconpicker-title{padding-left:5px}.layui-iconpicker-main{padding:0 10px}.layui-iconpicker-main .layui-icon{font-size:20px}.layui-iconpicker-main .layui-inline{vertical-align:top}.layui-iconpicker-split .layui-iconpicker-main{padding:0 15px;border-right-width:1px;border-right-style:solid}.layui-iconpicker-suffix{position:relative;width:35px;text-align:center}.layui-iconpicker-suffix .layui-icon{font-size:14px;color:#00000080;transition:all .3s;display:inline-block}.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down{transform:rotate(180deg)}.layui-iconpicker-search{padding:10px;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid whitesmoke}.layui-iconpicker-list{width:321px}.layui-iconpicker-list ul{margin:6px}.layui-iconpicker-list li{vertical-align:top;display:inline-block;width:60px;margin:2.5px;padding:5px;overflow:hidden;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center}.layui-iconpicker-list li:hover{background-color:var(--global-neutral-color-1);color:#00000080}.layui-iconpicker-list li.layui-this{border-color:var(--icon-picker-checked-color);color:var(--icon-picker-checked-color)}.layui-iconpicker-list li .layui-icon{font-size:20px}.layui-iconpicker-list li .layui-elip{margin-top:2px;line-height:20px;font-size:12px}.layui-iconpicker-list .layui-none{margin:30px 0 35px}.layui-iconpicker-scroll .layui-iconpicker-list{max-height:200px}.layui-iconpicker-page{position:relative;padding:10px 10px 5px;border-top:1px solid #eee;text-align:right}.layui-iconpicker-page .layui-laypage{margin:0}.layui-iconpicker-page .layui-laypage a,.layui-iconpicker-page .layui-laypage span{padding:0 10px;color:#666}.layui-iconpicker-page .layui-laypage-count{position:absolute;left:10px}.layui-iconpicker-page .layui-laypage-curr .layui-laypage-em{background:0 0}.layui-iconpicker-page .layui-laypage-curr em{color:#666;color:#0009}.layui-iconpicker-page .layui-laypage-first,.layui-iconpicker-page .layui-laypage-last,.layui-iconpicker-page .layui-laypage-spr{display:none}.layui-icon-picker-clear{color:#00000073;padding:0 0 0 10px}.layui-icon-picker-clear:hover,.layui-colorpicker-disabled{opacity:.6}.layui-colorpicker-disabled,.layui-colorpicker-disabled *{cursor:not-allowed!important}.transform{transform:rotate(180deg)}\n")();
|
||||||
const _hoisted_1 = { class: "layui-inline layui-iconpicker-main" };
|
const _hoisted_1 = { class: "layui-inline layui-iconpicker-main" };
|
||||||
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "layui-inline layui-iconpicker-suffix" }, [
|
const _hoisted_2 = {
|
||||||
/* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-down layui-anim" })
|
key: 0,
|
||||||
], -1);
|
class: "layui-icon-picker-clear"
|
||||||
const _hoisted_3 = { class: "layui-iconpicker-view layui-iconpicker-scroll" };
|
};
|
||||||
const _hoisted_4 = {
|
const _hoisted_3 = { class: "layui-inline layui-iconpicker-suffix" };
|
||||||
|
const _hoisted_4 = { class: "layui-iconpicker-view layui-iconpicker-scroll" };
|
||||||
|
const _hoisted_5 = {
|
||||||
key: 0,
|
key: 0,
|
||||||
class: "layui-iconpicker-search"
|
class: "layui-iconpicker-search"
|
||||||
};
|
};
|
||||||
const _hoisted_5 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-search" }, null, -1);
|
const _hoisted_6 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-search" }, null, -1);
|
||||||
const _hoisted_6 = { class: "layui-iconpicker-list" };
|
const _hoisted_7 = { class: "layui-iconpicker-list" };
|
||||||
const _hoisted_7 = ["onClick"];
|
const _hoisted_8 = ["onClick"];
|
||||||
const _hoisted_8 = { class: "layui-elip" };
|
const _hoisted_9 = { class: "layui-elip" };
|
||||||
const _hoisted_9 = {
|
const _hoisted_10 = {
|
||||||
key: 1,
|
key: 1,
|
||||||
class: "layui-iconpicker-page"
|
class: "layui-iconpicker-page"
|
||||||
};
|
};
|
||||||
const _hoisted_10 = {
|
const _hoisted_11 = {
|
||||||
id: "layui-laypage-1",
|
id: "layui-laypage-1",
|
||||||
class: "layui-laypage layui-laypage-default"
|
class: "layui-laypage layui-laypage-default"
|
||||||
};
|
};
|
||||||
const _hoisted_11 = { class: "layui-laypage-count" };
|
const _hoisted_12 = { class: "layui-laypage-count" };
|
||||||
const _hoisted_12 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-left" }, null, -1);
|
const _hoisted_13 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-left" }, null, -1);
|
||||||
const _hoisted_13 = [
|
const _hoisted_14 = [
|
||||||
_hoisted_12
|
_hoisted_13
|
||||||
];
|
];
|
||||||
const _hoisted_14 = { class: "layui-laypage-curr" };
|
const _hoisted_15 = { class: "layui-laypage-curr" };
|
||||||
const _hoisted_15 = /* @__PURE__ */ createElementVNode("em", { class: "layui-laypage-em" }, null, -1);
|
const _hoisted_16 = /* @__PURE__ */ createElementVNode("em", { class: "layui-laypage-em" }, null, -1);
|
||||||
const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", { class: "layui-laypage-spr" }, "\u2026", -1);
|
const _hoisted_17 = /* @__PURE__ */ createElementVNode("span", { class: "layui-laypage-spr" }, "\u2026", -1);
|
||||||
const _hoisted_17 = /* @__PURE__ */ createElementVNode("a", {
|
const _hoisted_18 = /* @__PURE__ */ createElementVNode("a", {
|
||||||
href: "javascript:;",
|
href: "javascript:;",
|
||||||
class: "layui-laypage-last",
|
class: "layui-laypage-last",
|
||||||
title: "\u5C3E\u9875"
|
title: "\u5C3E\u9875"
|
||||||
}, "14", -1);
|
}, "14", -1);
|
||||||
const _hoisted_18 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-right" }, null, -1);
|
const _hoisted_19 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-right" }, null, -1);
|
||||||
const _hoisted_19 = [
|
const _hoisted_20 = [
|
||||||
_hoisted_18
|
_hoisted_19
|
||||||
];
|
];
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LayIconPicker"
|
name: "LayIconPicker"
|
||||||
@@ -55,6 +57,7 @@ const _sfc_main = defineComponent({
|
|||||||
modelValue: { default: "layui-icon-face-smile" },
|
modelValue: { default: "layui-icon-face-smile" },
|
||||||
disabled: { type: Boolean, default: false },
|
disabled: { type: Boolean, default: false },
|
||||||
showSearch: { type: Boolean },
|
showSearch: { type: Boolean },
|
||||||
|
allowClear: { type: Boolean },
|
||||||
contentClass: null,
|
contentClass: null,
|
||||||
contentStyle: null
|
contentStyle: null
|
||||||
},
|
},
|
||||||
@@ -63,12 +66,19 @@ const _sfc_main = defineComponent({
|
|||||||
const props = __props;
|
const props = __props;
|
||||||
const selectedIcon = computed(() => props.modelValue);
|
const selectedIcon = computed(() => props.modelValue);
|
||||||
const dropdownRef = ref(null);
|
const dropdownRef = ref(null);
|
||||||
|
const openState = ref(false);
|
||||||
const selectIcon = function(icon) {
|
const selectIcon = function(icon) {
|
||||||
var _a;
|
var _a;
|
||||||
emit("update:modelValue", icon);
|
emit("update:modelValue", icon);
|
||||||
emit("change", icon);
|
emit("change", icon);
|
||||||
(_a = dropdownRef.value) == null ? void 0 : _a.hide();
|
(_a = dropdownRef.value) == null ? void 0 : _a.hide();
|
||||||
};
|
};
|
||||||
|
const onClear = function() {
|
||||||
|
emit("update:modelValue", "");
|
||||||
|
};
|
||||||
|
const hasContent = computed(() => {
|
||||||
|
return props.modelValue != null && props.modelValue != "";
|
||||||
|
});
|
||||||
const icones = ref([]);
|
const icones = ref([]);
|
||||||
const total = ref(iconfont.length);
|
const total = ref(iconfont.length);
|
||||||
const totalPage = ref(total.value / 12);
|
const totalPage = ref(total.value / 12);
|
||||||
@@ -162,17 +172,20 @@ const _sfc_main = defineComponent({
|
|||||||
return newList;
|
return newList;
|
||||||
};
|
};
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
|
const _component_lay_icon = resolveComponent("lay-icon");
|
||||||
return openBlock(), createBlock(_sfc_main$1, {
|
return openBlock(), createBlock(_sfc_main$1, {
|
||||||
ref_key: "dropdownRef",
|
ref_key: "dropdownRef",
|
||||||
ref: dropdownRef,
|
ref: dropdownRef,
|
||||||
disabled: __props.disabled,
|
disabled: __props.disabled,
|
||||||
contentClass: __props.contentClass,
|
contentClass: __props.contentClass,
|
||||||
contentStyle: __props.contentStyle,
|
contentStyle: __props.contentStyle,
|
||||||
|
onHide: _cache[2] || (_cache[2] = ($event) => openState.value = false),
|
||||||
|
onShow: _cache[3] || (_cache[3] = ($event) => openState.value = true),
|
||||||
updateAtScroll: ""
|
updateAtScroll: ""
|
||||||
}, {
|
}, {
|
||||||
content: withCtx(() => [
|
content: withCtx(() => [
|
||||||
createElementVNode("div", _hoisted_3, [
|
createElementVNode("div", _hoisted_4, [
|
||||||
__props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
__props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
||||||
createVNode(_sfc_main$2, {
|
createVNode(_sfc_main$2, {
|
||||||
onInput: search,
|
onInput: search,
|
||||||
onClear: clear,
|
onClear: clear,
|
||||||
@@ -180,12 +193,12 @@ const _sfc_main = defineComponent({
|
|||||||
"allow-clear": true
|
"allow-clear": true
|
||||||
}, {
|
}, {
|
||||||
prefix: withCtx(() => [
|
prefix: withCtx(() => [
|
||||||
_hoisted_5
|
_hoisted_6
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
})
|
})
|
||||||
])) : createCommentVNode("", true),
|
])) : createCommentVNode("", true),
|
||||||
createElementVNode("div", _hoisted_6, [
|
createElementVNode("div", _hoisted_7, [
|
||||||
createVNode(_sfc_main$3, {
|
createVNode(_sfc_main$3, {
|
||||||
style: { "height": "200px" },
|
style: { "height": "200px" },
|
||||||
thumbColor: "rgb(238, 238, 238)"
|
thumbColor: "rgb(238, 238, 238)"
|
||||||
@@ -201,33 +214,33 @@ const _sfc_main = defineComponent({
|
|||||||
createElementVNode("i", {
|
createElementVNode("i", {
|
||||||
class: normalizeClass(["layui-icon", [icon.class]])
|
class: normalizeClass(["layui-icon", [icon.class]])
|
||||||
}, null, 2),
|
}, null, 2),
|
||||||
createElementVNode("p", _hoisted_8, toDisplayString(icon.name), 1)
|
createElementVNode("p", _hoisted_9, toDisplayString(icon.name), 1)
|
||||||
], 10, _hoisted_7);
|
], 10, _hoisted_8);
|
||||||
}), 128))
|
}), 128))
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
})
|
})
|
||||||
]),
|
]),
|
||||||
__props.page ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
__props.page ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
||||||
createElementVNode("div", _hoisted_10, [
|
createElementVNode("div", _hoisted_11, [
|
||||||
createElementVNode("span", _hoisted_11, "\u5171 " + toDisplayString(total.value) + " \u4E2A", 1),
|
createElementVNode("span", _hoisted_12, "\u5171 " + toDisplayString(total.value) + " \u4E2A", 1),
|
||||||
createElementVNode("a", {
|
createElementVNode("a", {
|
||||||
href: "javascript:;",
|
href: "javascript:;",
|
||||||
class: normalizeClass(["layui-laypage-prev", [currentPage.value === 1 ? "layui-disabled" : ""]]),
|
class: normalizeClass(["layui-laypage-prev", [currentPage.value === 1 ? "layui-disabled" : ""]]),
|
||||||
onClick: _cache[0] || (_cache[0] = ($event) => prev())
|
onClick: _cache[0] || (_cache[0] = ($event) => prev())
|
||||||
}, _hoisted_13, 2),
|
}, _hoisted_14, 2),
|
||||||
createElementVNode("span", _hoisted_14, [
|
createElementVNode("span", _hoisted_15, [
|
||||||
_hoisted_15,
|
_hoisted_16,
|
||||||
createElementVNode("em", null, toDisplayString(currentPage.value) + " / " + toDisplayString(totalPage.value), 1)
|
createElementVNode("em", null, toDisplayString(currentPage.value) + " / " + toDisplayString(totalPage.value), 1)
|
||||||
]),
|
]),
|
||||||
_hoisted_16,
|
|
||||||
_hoisted_17,
|
_hoisted_17,
|
||||||
|
_hoisted_18,
|
||||||
createElementVNode("a", {
|
createElementVNode("a", {
|
||||||
href: "javascript:;",
|
href: "javascript:;",
|
||||||
class: normalizeClass([[currentPage.value === totalPage.value ? "layui-disabled" : ""], "layui-laypage-next"]),
|
class: normalizeClass([[currentPage.value === totalPage.value ? "layui-disabled" : ""], "layui-laypage-next"]),
|
||||||
onClick: _cache[1] || (_cache[1] = ($event) => next())
|
onClick: _cache[1] || (_cache[1] = ($event) => next())
|
||||||
}, _hoisted_19, 2)
|
}, _hoisted_20, 2)
|
||||||
])
|
])
|
||||||
])) : createCommentVNode("", true)
|
])) : createCommentVNode("", true)
|
||||||
])
|
])
|
||||||
@@ -241,7 +254,17 @@ const _sfc_main = defineComponent({
|
|||||||
class: normalizeClass(["layui-inline layui-icon", [unref(selectedIcon)]])
|
class: normalizeClass(["layui-inline layui-icon", [unref(selectedIcon)]])
|
||||||
}, null, 2)
|
}, null, 2)
|
||||||
]),
|
]),
|
||||||
_hoisted_2
|
__props.allowClear && unref(hasContent) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_2, [
|
||||||
|
createVNode(_component_lay_icon, {
|
||||||
|
type: "layui-icon-close-fill",
|
||||||
|
onClick: withModifiers(onClear, ["stop"])
|
||||||
|
}, null, 8, ["onClick"])
|
||||||
|
])) : createCommentVNode("", true),
|
||||||
|
createElementVNode("span", _hoisted_3, [
|
||||||
|
createElementVNode("i", {
|
||||||
|
class: normalizeClass(["layui-icon layui-icon-down", [openState.value ? "transform" : ""]])
|
||||||
|
}, null, 2)
|
||||||
|
])
|
||||||
], 2)
|
], 2)
|
||||||
]),
|
]),
|
||||||
_: 1
|
_: 1
|
||||||
|
|||||||
55
es/index.js
55
es/index.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
46
es/index2.js
Normal file
46
es/index2.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { defineComponent, ref, provide, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
||||||
|
const __default__ = {
|
||||||
|
name: "LayCheckboxGroup"
|
||||||
|
};
|
||||||
|
const _sfc_main = defineComponent({
|
||||||
|
...__default__,
|
||||||
|
props: {
|
||||||
|
modelValue: { default: () => [] },
|
||||||
|
disabled: { type: Boolean, default: false }
|
||||||
|
},
|
||||||
|
emits: ["update:modelValue", "change"],
|
||||||
|
setup(__props, { emit }) {
|
||||||
|
const props = __props;
|
||||||
|
const modelValue = ref(props.modelValue);
|
||||||
|
const disabled = ref(props.disabled);
|
||||||
|
provide("checkboxGroup", {
|
||||||
|
name: "LayCheckboxGroup",
|
||||||
|
modelValue,
|
||||||
|
disabled
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => modelValue,
|
||||||
|
(val) => {
|
||||||
|
emit("change", modelValue.value);
|
||||||
|
emit("update:modelValue", modelValue.value);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => modelValue.value = val
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.disabled,
|
||||||
|
(val) => disabled.value = val
|
||||||
|
);
|
||||||
|
return (_ctx, _cache) => {
|
||||||
|
return openBlock(), createElementBlock("div", {
|
||||||
|
class: normalizeClass(["layui-checkbox-group", { "layui-checkbox-group-disabled": disabled.value }])
|
||||||
|
}, [
|
||||||
|
renderSlot(_ctx.$slots, "default")
|
||||||
|
], 2);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export { _sfc_main as _ };
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../badge/index2.js";
|
import "../badge/index2.js";
|
||||||
export { c as default } from "./index2.js";
|
export { c as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../dropdownMenu/index2.js";
|
import "../dropdownMenu/index2.js";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { openBlock, createElementBlock, createElementVNode, defineComponent, useSlots, ref, computed, watch, normalizeClass, unref, renderSlot, createCommentVNode, createBlock, createVNode, withModifiers } from "vue";
|
import { openBlock, createElementBlock, createElementVNode, defineComponent, useSlots, ref, computed, watch, normalizeClass, unref, renderSlot, createCommentVNode, createBlock, normalizeStyle, createVNode, withModifiers } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
import { _ as _export_sfc } from "../dropdownMenu/index2.js";
|
import { _ as _export_sfc } from "../dropdownMenu/index2.js";
|
||||||
var index = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}\n")();
|
var index = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}\n")();
|
||||||
const _sfc_main$2 = {};
|
const _sfc_main$2 = {};
|
||||||
@@ -87,32 +87,79 @@ const _sfc_main = defineComponent({
|
|||||||
size: { default: "md" },
|
size: { default: "md" },
|
||||||
maxlength: null,
|
maxlength: null,
|
||||||
max: null,
|
max: null,
|
||||||
min: null
|
min: null,
|
||||||
|
qfw: { type: Boolean, default: false },
|
||||||
|
align: { default: "left" }
|
||||||
},
|
},
|
||||||
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
|
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const type = ref(props.type);
|
const type = ref(props.type);
|
||||||
const currentValue = ref(String(props.modelValue == null ? "" : props.modelValue));
|
const currentValue = ref(
|
||||||
|
String(props.modelValue == null ? "" : props.modelValue)
|
||||||
|
);
|
||||||
const hasContent = computed(() => {
|
const hasContent = computed(() => {
|
||||||
var _a;
|
var _a;
|
||||||
return ((_a = props.modelValue) == null ? void 0 : _a.length) > 0;
|
return ((_a = props.modelValue) == null ? void 0 : _a.length) > 0;
|
||||||
});
|
});
|
||||||
const isPassword = computed(() => type.value == "password");
|
const isPassword = computed(() => type.value == "password");
|
||||||
const composing = ref(false);
|
const composing = ref(false);
|
||||||
watch(() => props.type, () => {
|
const formatMoney = function(s) {
|
||||||
|
if (s == "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var noNegative = true;
|
||||||
|
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||||
|
if (parseFloat(s) < 0) {
|
||||||
|
s = Math.abs(parseFloat(s)) + "";
|
||||||
|
noNegative = false;
|
||||||
|
}
|
||||||
|
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
|
||||||
|
var t = "";
|
||||||
|
for (let i = 0; i < l.length; i++) {
|
||||||
|
if (i % 3 == 2 && i != l.length - 1) {
|
||||||
|
t += l[i] + ",";
|
||||||
|
} else {
|
||||||
|
t += l[i] + "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let z = (noNegative ? "" : "-") + t.split("").reverse().join("");
|
||||||
|
if (r) {
|
||||||
|
return z + "." + r;
|
||||||
|
} else {
|
||||||
|
return isNaN(parseInt(z)) ? 0 : z;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
watch(
|
||||||
|
() => props.type,
|
||||||
|
() => {
|
||||||
type.value = props.type;
|
type.value = props.type;
|
||||||
});
|
}
|
||||||
watch(() => props.modelValue, () => {
|
);
|
||||||
currentValue.value = String(props.modelValue == null ? "" : props.modelValue);
|
const input = ref();
|
||||||
});
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
() => {
|
||||||
|
console.log(input);
|
||||||
|
if (!(input.value == document.activeElement) && props.qfw) {
|
||||||
|
currentValue.value = formatMoney(props.modelValue.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
currentValue.value = String(
|
||||||
|
props.modelValue == null ? "" : props.modelValue
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
const onInput = function(event) {
|
const onInput = function(event) {
|
||||||
const inputElement = event.target;
|
const inputElement = event.target;
|
||||||
const value = inputElement.value;
|
let value = inputElement.value;
|
||||||
emit("input", value);
|
emit("input", value);
|
||||||
if (composing.value)
|
if (composing.value)
|
||||||
return;
|
return;
|
||||||
|
if (props.qfw) {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
emit("update:modelValue", value);
|
emit("update:modelValue", value);
|
||||||
};
|
};
|
||||||
const onClear = () => {
|
const onClear = () => {
|
||||||
@@ -120,17 +167,30 @@ const _sfc_main = defineComponent({
|
|||||||
emit("clear");
|
emit("clear");
|
||||||
};
|
};
|
||||||
const onFocus = (event) => {
|
const onFocus = (event) => {
|
||||||
|
currentValue.value = new String(props.modelValue).replace(/,/g, "");
|
||||||
emit("focus", event);
|
emit("focus", event);
|
||||||
};
|
};
|
||||||
const onChange = (event) => {
|
const onChange = (event) => {
|
||||||
const inputElement = event.target;
|
const inputElement = event.target;
|
||||||
const value = inputElement.value;
|
let value = inputElement.value;
|
||||||
|
if (props.qfw) {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
emit("change", value);
|
emit("change", value);
|
||||||
};
|
};
|
||||||
const onBlur = (event) => {
|
const onBlur = (event) => {
|
||||||
if (props.type === "number") {
|
if (props.type === "number") {
|
||||||
onNumberBlur(event);
|
onNumberBlur(event);
|
||||||
}
|
}
|
||||||
|
if (props.qfw) {
|
||||||
|
try {
|
||||||
|
let reg = /\d{1,3}(?=(\d{3})+$)/g;
|
||||||
|
console.log("\u6DFB\u52A0\uFF0C", formatMoney(props.modelValue.toString()));
|
||||||
|
currentValue.value = formatMoney(props.modelValue.toString());
|
||||||
|
} catch {
|
||||||
|
currentValue.value = "\u8F93\u5165\u9519\u8BEF";
|
||||||
|
}
|
||||||
|
}
|
||||||
emit("blur", event);
|
emit("blur", event);
|
||||||
};
|
};
|
||||||
const onNumberBlur = (event) => {
|
const onNumberBlur = (event) => {
|
||||||
@@ -143,6 +203,9 @@ const _sfc_main = defineComponent({
|
|||||||
if (props.min && props.min > Number(value))
|
if (props.min && props.min > Number(value))
|
||||||
value = props.min.toString();
|
value = props.min.toString();
|
||||||
}
|
}
|
||||||
|
if (props.qfw) {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
emit("update:modelValue", value);
|
emit("update:modelValue", value);
|
||||||
};
|
};
|
||||||
const onCompositionstart = () => {
|
const onCompositionstart = () => {
|
||||||
@@ -175,13 +238,16 @@ const _sfc_main = defineComponent({
|
|||||||
])) : createCommentVNode("", true),
|
])) : createCommentVNode("", true),
|
||||||
createElementVNode("div", _hoisted_3, [
|
createElementVNode("div", _hoisted_3, [
|
||||||
unref(slots).prefix || props.prefixIcon ? (openBlock(), createElementBlock("span", _hoisted_4, [
|
unref(slots).prefix || props.prefixIcon ? (openBlock(), createElementBlock("span", _hoisted_4, [
|
||||||
unref(slots).prefix ? renderSlot(_ctx.$slots, "prefix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2E), {
|
unref(slots).prefix ? renderSlot(_ctx.$slots, "prefix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2W), {
|
||||||
key: 1,
|
key: 1,
|
||||||
type: props.prefixIcon,
|
type: props.prefixIcon,
|
||||||
class: "layui-input-prefix-icon"
|
class: "layui-input-prefix-icon"
|
||||||
}, null, 8, ["type"]))
|
}, null, 8, ["type"]))
|
||||||
])) : createCommentVNode("", true),
|
])) : createCommentVNode("", true),
|
||||||
createElementVNode("input", {
|
createElementVNode("input", {
|
||||||
|
style: normalizeStyle({
|
||||||
|
textAlign: __props.align
|
||||||
|
}),
|
||||||
type: type.value,
|
type: type.value,
|
||||||
name: __props.name,
|
name: __props.name,
|
||||||
disabled: __props.disabled,
|
disabled: __props.disabled,
|
||||||
@@ -198,8 +264,10 @@ const _sfc_main = defineComponent({
|
|||||||
onFocus,
|
onFocus,
|
||||||
onBlur,
|
onBlur,
|
||||||
onCompositionstart,
|
onCompositionstart,
|
||||||
onCompositionend
|
onCompositionend,
|
||||||
}, null, 40, _hoisted_5),
|
ref_key: "input",
|
||||||
|
ref: input
|
||||||
|
}, null, 44, _hoisted_5),
|
||||||
__props.password && unref(hasContent) ? (openBlock(), createElementBlock("span", {
|
__props.password && unref(hasContent) ? (openBlock(), createElementBlock("span", {
|
||||||
key: 1,
|
key: 1,
|
||||||
class: "layui-input-password",
|
class: "layui-input-password",
|
||||||
@@ -208,13 +276,13 @@ const _sfc_main = defineComponent({
|
|||||||
unref(isPassword) ? (openBlock(), createBlock(PasswordIcon, { key: 0 })) : (openBlock(), createBlock(UnPasswordIcon, { key: 1 }))
|
unref(isPassword) ? (openBlock(), createBlock(PasswordIcon, { key: 0 })) : (openBlock(), createBlock(UnPasswordIcon, { key: 1 }))
|
||||||
])) : createCommentVNode("", true),
|
])) : createCommentVNode("", true),
|
||||||
__props.allowClear && unref(hasContent) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
__props.allowClear && unref(hasContent) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
||||||
createVNode(unref(_sfc_main$2E), {
|
createVNode(unref(_sfc_main$2W), {
|
||||||
type: "layui-icon-close-fill",
|
type: "layui-icon-close-fill",
|
||||||
onClick: withModifiers(onClear, ["stop"])
|
onClick: withModifiers(onClear, ["stop"])
|
||||||
}, null, 8, ["onClick"])
|
}, null, 8, ["onClick"])
|
||||||
])) : createCommentVNode("", true),
|
])) : createCommentVNode("", true),
|
||||||
unref(slots).suffix || props.suffixIcon ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
unref(slots).suffix || props.suffixIcon ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
||||||
unref(slots).suffix ? renderSlot(_ctx.$slots, "suffix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2E), {
|
unref(slots).suffix ? renderSlot(_ctx.$slots, "suffix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2W), {
|
||||||
key: 1,
|
key: 1,
|
||||||
type: props.suffixIcon,
|
type: props.suffixIcon,
|
||||||
class: "layui-input-suffix-icon"
|
class: "layui-input-suffix-icon"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -27,8 +27,12 @@ const _sfc_main = defineComponent({
|
|||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
const isTree = computed(() => props.tree);
|
const isTree = computed(() => props.tree);
|
||||||
const isCollapse = computed(() => props.collapse);
|
const isCollapse = computed(
|
||||||
const isCollapseTransition = computed(() => props.collapseTransition);
|
() => props.collapse
|
||||||
|
);
|
||||||
|
const isCollapseTransition = computed(
|
||||||
|
() => props.collapseTransition
|
||||||
|
);
|
||||||
const oldOpenKeys = ref(props.openKeys);
|
const oldOpenKeys = ref(props.openKeys);
|
||||||
const menuTheme = computed(() => props.theme);
|
const menuTheme = computed(() => props.theme);
|
||||||
const openKeys = computed({
|
const openKeys = computed({
|
||||||
@@ -52,14 +56,17 @@ const _sfc_main = defineComponent({
|
|||||||
const indent = computed(() => {
|
const indent = computed(() => {
|
||||||
return props.indent;
|
return props.indent;
|
||||||
});
|
});
|
||||||
watch(() => props.collapse, () => {
|
watch(
|
||||||
|
() => props.collapse,
|
||||||
|
() => {
|
||||||
if (props.collapse) {
|
if (props.collapse) {
|
||||||
oldOpenKeys.value = props.openKeys;
|
oldOpenKeys.value = props.openKeys;
|
||||||
openKeys.value = [];
|
openKeys.value = [];
|
||||||
} else {
|
} else {
|
||||||
openKeys.value = oldOpenKeys.value;
|
openKeys.value = oldOpenKeys.value;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
provideLevel(1);
|
provideLevel(1);
|
||||||
provide("isTree", isTree);
|
provide("isTree", isTree);
|
||||||
provide("selectedKey", selectedKey);
|
provide("selectedKey", selectedKey);
|
||||||
|
|||||||
@@ -36,12 +36,17 @@ const _sfc_main = defineComponent({
|
|||||||
const isCollapse = inject("isCollapse");
|
const isCollapse = inject("isCollapse");
|
||||||
const theme = inject("menuTheme");
|
const theme = inject("menuTheme");
|
||||||
const indent = inject("indent");
|
const indent = inject("indent");
|
||||||
const dropdownCtx = inject(dropdownInjectionKey, void 0);
|
const dropdownCtx = inject(
|
||||||
|
dropdownInjectionKey,
|
||||||
|
void 0
|
||||||
|
);
|
||||||
const selectHandle = function() {
|
const selectHandle = function() {
|
||||||
selectedKey.value = props.id;
|
selectedKey.value = props.id;
|
||||||
dropdownCtx == null ? void 0 : dropdownCtx.hide();
|
dropdownCtx == null ? void 0 : dropdownCtx.hide();
|
||||||
};
|
};
|
||||||
const needTooltip = computed(() => isTree.value && (isCollapse.value === true || isCollapse.value === "true") && level.value === 1);
|
const needTooltip = computed(
|
||||||
|
() => isTree.value && (isCollapse.value === true || isCollapse.value === "true") && level.value === 1
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("li", {
|
return openBlock(), createElementBlock("li", {
|
||||||
class: normalizeClass(["layui-nav-item", { "layui-this": unref(selectedKey) === __props.id }]),
|
class: normalizeClass(["layui-nav-item", { "layui-this": unref(selectedKey) === __props.id }]),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ import "../datePicker/index2.js";
|
|||||||
import "../_chunks/dayjs/index.js";
|
import "../_chunks/dayjs/index.js";
|
||||||
import "../_chunks/@umijs/index.js";
|
import "../_chunks/@umijs/index.js";
|
||||||
import "../input/index2.js";
|
import "../input/index2.js";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../dropdownMenu/index2.js";
|
import "../dropdownMenu/index2.js";
|
||||||
import "../dropdown/index2.js";
|
import "../dropdown/index2.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
|
|||||||
@@ -58,9 +58,12 @@ const _sfc_main = defineComponent({
|
|||||||
const currentPage = ref(props.modelValue);
|
const currentPage = ref(props.modelValue);
|
||||||
const currentPageShow = ref(currentPage.value);
|
const currentPageShow = ref(currentPage.value);
|
||||||
const inlimit = ref(props.limit);
|
const inlimit = ref(props.limit);
|
||||||
watch(() => props.limit, () => {
|
watch(
|
||||||
|
() => props.limit,
|
||||||
|
() => {
|
||||||
inlimit.value = props.limit;
|
inlimit.value = props.limit;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
const totalPage = computed(() => {
|
const totalPage = computed(() => {
|
||||||
maxPage.value = Math.ceil(props.total / inlimit.value);
|
maxPage.value = Math.ceil(props.total / inlimit.value);
|
||||||
let r = [];
|
let r = [];
|
||||||
@@ -118,10 +121,13 @@ const _sfc_main = defineComponent({
|
|||||||
currentPageShow.value = currentPage.value;
|
currentPageShow.value = currentPage.value;
|
||||||
emit("update:modelValue", currentPage.value);
|
emit("update:modelValue", currentPage.value);
|
||||||
});
|
});
|
||||||
watch(() => props.modelValue, () => {
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
() => {
|
||||||
currentPage.value = props.modelValue;
|
currentPage.value = props.modelValue;
|
||||||
currentPageShow.value = currentPage.value;
|
currentPageShow.value = currentPage.value;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||||
__props.showCount ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(t)("page.total")) + " " + toDisplayString(__props.total) + " " + toDisplayString(unref(t)("page.item")) + " " + toDisplayString(maxPage.value) + " " + toDisplayString(unref(t)("page.page")), 1)) : createCommentVNode("", true),
|
__props.showCount ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(t)("page.total")) + " " + toDisplayString(__props.total) + " " + toDisplayString(unref(t)("page.item")) + " " + toDisplayString(maxPage.value) + " " + toDisplayString(unref(t)("page.page")), 1)) : createCommentVNode("", true),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { c as convertSlotName, w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, useSlots, openBlock, createElementBlock, createElementVNode, renderSlot, normalizeClass, toDisplayString, unref, Fragment, createTextVNode } from "vue";
|
import { defineComponent, useSlots, getCurrentInstance, openBlock, createElementBlock, createElementVNode, renderSlot, unref, normalizeClass, toDisplayString, Fragment, createTextVNode } from "vue";
|
||||||
var index = /* @__PURE__ */ (() => '.lay-page-header{display:flex;line-height:24px}.lay-page-header__left{display:flex;cursor:pointer;margin-right:40px;position:relative;color:var(--global-neutral-color-8)}.lay-page-header__left:after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;transform:translateY(-50%);background-color:var(--global-neutral-color-8)}.lay-page-header__left:hover .layui-icon-return,.lay-page-header__left:hover .lay-page-header__title{color:var(--global-checked-color)!important}.lay-page-header__left .layui-icon-return{font-size:14px;margin-right:6px;align-self:center}.lay-page-header__title{font-size:14px}.lay-page-header__content{font-size:18px;color:#393d49}\n')();
|
var index = /* @__PURE__ */ (() => '.lay-page-header{display:flex;line-height:24px}.lay-page-header__left{display:flex;cursor:pointer;margin-right:40px;position:relative;color:var(--global-neutral-color-8)}.lay-page-header__left:after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;transform:translateY(-50%);background-color:var(--global-neutral-color-8)}.lay-page-header__left:hover .layui-icon-return,.lay-page-header__left:hover .lay-page-header__title{color:var(--global-checked-color)!important}.lay-page-header__left .layui-icon-return{font-size:14px;margin-right:6px;align-self:center}.lay-page-header__title{font-size:14px}.lay-page-header__content{font-size:18px;color:#393d49}\n')();
|
||||||
const _hoisted_1 = { class: "lay-page-header" };
|
const _hoisted_1 = { class: "lay-page-header" };
|
||||||
const _hoisted_2 = { class: "lay-page-header__title" };
|
const _hoisted_2 = { class: "lay-page-header__title" };
|
||||||
@@ -17,13 +17,15 @@ const _sfc_main = defineComponent({
|
|||||||
emits: ["back"],
|
emits: ["back"],
|
||||||
setup(__props, { emit: emits }) {
|
setup(__props, { emit: emits }) {
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
|
const instance = getCurrentInstance();
|
||||||
|
const backIconSlotName = convertSlotName(instance, "backIcon");
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||||
createElementVNode("div", {
|
createElementVNode("div", {
|
||||||
class: "lay-page-header__left",
|
class: "lay-page-header__left",
|
||||||
onClick: _cache[0] || (_cache[0] = ($event) => emits("back"))
|
onClick: _cache[0] || (_cache[0] = ($event) => emits("back"))
|
||||||
}, [
|
}, [
|
||||||
renderSlot(_ctx.$slots, "backIcon", {}, () => [
|
renderSlot(_ctx.$slots, unref(backIconSlotName), {}, () => [
|
||||||
createElementVNode("i", {
|
createElementVNode("i", {
|
||||||
class: normalizeClass(["layui-icon", [__props.backIcon]])
|
class: normalizeClass(["layui-icon", [__props.backIcon]])
|
||||||
}, null, 2)
|
}, null, 2)
|
||||||
|
|||||||
@@ -22,12 +22,22 @@ const _sfc_main = defineComponent({
|
|||||||
naiveName: props.name,
|
naiveName: props.name,
|
||||||
disabled
|
disabled
|
||||||
});
|
});
|
||||||
watch(() => modelValue, (val) => {
|
watch(
|
||||||
|
() => modelValue,
|
||||||
|
(val) => {
|
||||||
emit("change", modelValue.value);
|
emit("change", modelValue.value);
|
||||||
emit("update:modelValue", modelValue.value);
|
emit("update:modelValue", modelValue.value);
|
||||||
}, { deep: true });
|
},
|
||||||
watch(() => props.modelValue, (val) => modelValue.value = val);
|
{ deep: true }
|
||||||
watch(() => props.disabled, (val) => disabled.value = val);
|
);
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => modelValue.value = val
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.disabled,
|
||||||
|
(val) => disabled.value = val
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||||
renderSlot(_ctx.$slots, "default")
|
renderSlot(_ctx.$slots, "default")
|
||||||
|
|||||||
@@ -32,11 +32,16 @@ const _sfc_main = defineComponent({
|
|||||||
const props = __props;
|
const props = __props;
|
||||||
const currentValue = ref(props.modelValue);
|
const currentValue = ref(props.modelValue);
|
||||||
const tempValue = ref(currentValue.value);
|
const tempValue = ref(currentValue.value);
|
||||||
const isHalf = computed(() => props.half && Math.round(currentValue.value) !== currentValue.value);
|
const isHalf = computed(
|
||||||
watch(() => props.modelValue, () => {
|
() => props.half && Math.round(currentValue.value) !== currentValue.value
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
() => {
|
||||||
currentValue.value = props.modelValue;
|
currentValue.value = props.modelValue;
|
||||||
tempValue.value = props.modelValue;
|
tempValue.value = props.modelValue;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
const getValue = function(index2, event) {
|
const getValue = function(index2, event) {
|
||||||
if (!props.half) {
|
if (!props.half) {
|
||||||
return index2;
|
return index2;
|
||||||
|
|||||||
@@ -55,14 +55,22 @@ const _sfc_main = defineComponent({
|
|||||||
spreadSizeRef.value = props.spreadSize;
|
spreadSizeRef.value = props.spreadSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ripples.addEventListener("animationend", () => {
|
ripples.addEventListener(
|
||||||
|
"animationend",
|
||||||
|
() => {
|
||||||
isActiveRef.value = false;
|
isActiveRef.value = false;
|
||||||
}, false);
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initWidth();
|
initWidth();
|
||||||
});
|
});
|
||||||
watch(() => props.trigger, (val) => isActiveRef.value = val === "always", { immediate: true });
|
watch(
|
||||||
|
() => props.trigger,
|
||||||
|
(val) => isActiveRef.value = val === "always",
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", mergeProps({
|
return openBlock(), createElementBlock("div", mergeProps({
|
||||||
class: "layui-water-ripples-container",
|
class: "layui-water-ripples-container",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -2,3 +2,4 @@ import "../badge/index2.js";
|
|||||||
export { c as default } from "./index2.js";
|
export { c as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
import "../checkbox/index2.js";
|
import "../checkbox/index2.js";
|
||||||
|
import "../_chunks/@layui/index.js";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, inject, ref, computed, withDirectives, openBlock, createElementBlock, normalizeClass, unref, createBlock, isRef, createCommentVNode, renderSlot, createTextVNode, toDisplayString, vShow } from "vue";
|
import { defineComponent, inject, ref, computed, withDirectives, openBlock, createElementBlock, normalizeClass, unref, createBlock, isRef, createCommentVNode, renderSlot, createTextVNode, toDisplayString, vShow } from "vue";
|
||||||
import { a as _sfc_main$1 } from "../checkbox/index2.js";
|
import { _ as _sfc_main$1 } from "../checkbox/index2.js";
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LaySelectOption"
|
name: "LaySelectOption"
|
||||||
};
|
};
|
||||||
@@ -16,7 +16,10 @@ const _sfc_main = defineComponent({
|
|||||||
const props = __props;
|
const props = __props;
|
||||||
const searchValue = inject("searchValue");
|
const searchValue = inject("searchValue");
|
||||||
const selectRef = inject("selectRef");
|
const selectRef = inject("selectRef");
|
||||||
const selectedValue = inject("selectedValue");
|
const searchMethod = inject("searchMethod");
|
||||||
|
const selectedValue = inject(
|
||||||
|
"selectedValue"
|
||||||
|
);
|
||||||
const multiple = inject("multiple");
|
const multiple = inject("multiple");
|
||||||
const checkboxRef = ref();
|
const checkboxRef = ref();
|
||||||
const handleSelect = () => {
|
const handleSelect = () => {
|
||||||
@@ -39,8 +42,13 @@ const _sfc_main = defineComponent({
|
|||||||
return selectedValue.value === props.value;
|
return selectedValue.value === props.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const first = ref(true);
|
||||||
const display = computed(() => {
|
const display = computed(() => {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
|
if (searchMethod && !first.value) {
|
||||||
|
return searchMethod(searchValue.value, props);
|
||||||
|
}
|
||||||
|
first.value = false;
|
||||||
return ((_a = props.keyword) == null ? void 0 : _a.toString().indexOf(searchValue.value)) > -1 || ((_b = props.label) == null ? void 0 : _b.toString().indexOf(searchValue.value)) > -1;
|
return ((_a = props.keyword) == null ? void 0 : _a.toString().indexOf(searchValue.value)) > -1 || ((_b = props.label) == null ? void 0 : _b.toString().indexOf(searchValue.value)) > -1;
|
||||||
});
|
});
|
||||||
const classes = computed(() => {
|
const classes = computed(() => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, openBlock, createElementBlock, mergeProps, renderSlot, Fragment, renderList, createBlock, normalizeClass } from "vue";
|
import { defineComponent, openBlock, createElementBlock, mergeProps, renderSlot, Fragment, renderList, createBlock, normalizeClass } from "vue";
|
||||||
import { _ as _sfc_main$1 } from "../skeletonItem/index2.js";
|
import { _ as _sfc_main$1 } from "../skeletonItem/index2.js";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ".lay-skeleton .lay-skeleton-item,.lay-skeleton .lay-skeleton-type--p{height:16px;border-radius:5px;margin-bottom:16px;background:#eeeeee}.lay-skeleton .lay-skeleton-type--image{width:240px;height:240px;background:#eeeeee;display:flex;justify-content:center;align-items:center}.lay-skeleton .lay-skeleton-type--image i{font-size:40px}.lay-skeleton-animated .lay-skeleton-type--image{width:240px;height:240px!important;display:flex;justify-content:center;align-items:center}.lay-skeleton-animated .lay-skeleton-type--image i{font-size:40px}.lay-skeleton-animated .lay-skeleton-item{height:16px;border-radius:5px;margin-bottom:16px;background:#eeeeee;background:linear-gradient(90deg,#f2f2f2 25%,#ececec 37%,#f2f2f2 63%);background-size:400% 100%;animation:lay-skeleton-loading 1.2s ease infinite}.lay-skeleton-first{width:30%}.lay-skeleton-last{width:62.8%}@keyframes lay-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}\n")();
|
var index = /* @__PURE__ */ (() => ".lay-skeleton .lay-skeleton-item,.lay-skeleton .lay-skeleton-type--p{height:16px;border-radius:5px;margin-bottom:16px;background:#eeeeee}.lay-skeleton .lay-skeleton-type--image{width:240px;height:240px;background:#eeeeee;display:flex;justify-content:center;align-items:center}.lay-skeleton .lay-skeleton-type--image i{font-size:40px}.lay-skeleton-animated .lay-skeleton-type--image{width:240px;height:240px!important;display:flex;justify-content:center;align-items:center}.lay-skeleton-animated .lay-skeleton-type--image i{font-size:40px}.lay-skeleton-animated .lay-skeleton-item{height:16px;border-radius:5px;margin-bottom:16px;background:#eeeeee;background:linear-gradient(90deg,#f2f2f2 25%,#ececec 37%,#f2f2f2 63%);background-size:400% 100%;animation:lay-skeleton-loading 1.2s ease infinite}.lay-skeleton-first{width:30%}.lay-skeleton-last{width:62.8%}@keyframes lay-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}\n")();
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LaySkeleton"
|
name: "LaySkeleton"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "../badge/index2.js";
|
import "../badge/index2.js";
|
||||||
export { c as default } from "./index2.js";
|
export { c as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, openBlock, createElementBlock, mergeProps, createVNode, unref, createCommentVNode } from "vue";
|
import { defineComponent, openBlock, createElementBlock, mergeProps, createVNode, unref, createCommentVNode } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
const _hoisted_1 = { key: 0 };
|
const _hoisted_1 = { key: 0 };
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LaySkeletonItem"
|
name: "LaySkeletonItem"
|
||||||
@@ -16,7 +16,7 @@ const _sfc_main = defineComponent({
|
|||||||
class: ["lay-skeleton-item", `lay-skeleton-type--${__props.type}`]
|
class: ["lay-skeleton-item", `lay-skeleton-type--${__props.type}`]
|
||||||
}, _ctx.$attrs), [
|
}, _ctx.$attrs), [
|
||||||
__props.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
__props.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
||||||
createVNode(unref(_sfc_main$2E), { type: "layui-icon-picture" })
|
createVNode(unref(_sfc_main$2W), { type: "layui-icon-picture" })
|
||||||
])) : createCommentVNode("", true)
|
])) : createCommentVNode("", true)
|
||||||
], 16);
|
], 16);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ function makeDots(props) {
|
|||||||
return dots;
|
return dots;
|
||||||
}
|
}
|
||||||
const _hoisted_1$4 = ["onMousedown"];
|
const _hoisted_1$4 = ["onMousedown"];
|
||||||
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("div", { class: "layui-slider-line-v" }, null, -1);
|
const _hoisted_2$4 = ["onClick"];
|
||||||
const _hoisted_3$4 = ["onClick"];
|
|
||||||
const __default__$4 = {
|
const __default__$4 = {
|
||||||
name: "StandardVue"
|
name: "StandardVue"
|
||||||
};
|
};
|
||||||
@@ -45,7 +44,8 @@ const _sfc_main$4 = defineComponent({
|
|||||||
step: { default: 0 },
|
step: { default: 0 },
|
||||||
min: { default: 0 },
|
min: { default: 0 },
|
||||||
max: { default: 100 },
|
max: { default: 100 },
|
||||||
showDots: { type: Boolean, default: false }
|
showDots: { type: Boolean, default: false },
|
||||||
|
backgroundColor: { default: "#ccc" }
|
||||||
},
|
},
|
||||||
emits: ["link-val-hook"],
|
emits: ["link-val-hook"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
@@ -129,14 +129,19 @@ const _sfc_main$4 = defineComponent({
|
|||||||
style: normalizeStyle({ width: __props.val + "%" }),
|
style: normalizeStyle({ width: __props.val + "%" }),
|
||||||
class: normalizeClass(["layui-slider-rate-v", [__props.disabled ? "layui-slider-disabled disable-line" : ""]])
|
class: normalizeClass(["layui-slider-rate-v", [__props.disabled ? "layui-slider-disabled disable-line" : ""]])
|
||||||
}, null, 6),
|
}, null, 6),
|
||||||
_hoisted_2$4,
|
createElementVNode("div", {
|
||||||
|
class: "layui-slider-line-v",
|
||||||
|
style: normalizeStyle({
|
||||||
|
backgroundColor: props.backgroundColor
|
||||||
|
})
|
||||||
|
}, null, 4),
|
||||||
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
|
||||||
return withDirectives((openBlock(), createElementBlock("div", {
|
return withDirectives((openBlock(), createElementBlock("div", {
|
||||||
onClick: ($event) => focusDot(item),
|
onClick: ($event) => focusDot(item),
|
||||||
class: "layui-slider-dots",
|
class: "layui-slider-dots",
|
||||||
key: index2,
|
key: index2,
|
||||||
style: normalizeStyle({ left: item + "%" })
|
style: normalizeStyle({ left: item + "%" })
|
||||||
}, null, 12, _hoisted_3$4)), [
|
}, null, 12, _hoisted_2$4)), [
|
||||||
[vShow, __props.showDots]
|
[vShow, __props.showDots]
|
||||||
]);
|
]);
|
||||||
}), 128))
|
}), 128))
|
||||||
@@ -628,7 +633,8 @@ const _sfc_main = defineComponent({
|
|||||||
disabled: { type: Boolean, default: false },
|
disabled: { type: Boolean, default: false },
|
||||||
range: { type: Boolean },
|
range: { type: Boolean },
|
||||||
rangeValue: null,
|
rangeValue: null,
|
||||||
showDots: { type: Boolean, default: false }
|
showDots: { type: Boolean, default: false },
|
||||||
|
backgroundColor: { default: "#ccc" }
|
||||||
},
|
},
|
||||||
emits: ["update:modelValue"],
|
emits: ["update:modelValue"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
@@ -680,8 +686,9 @@ const _sfc_main = defineComponent({
|
|||||||
step: __props.step,
|
step: __props.step,
|
||||||
min: __props.min,
|
min: __props.min,
|
||||||
max: __props.max,
|
max: __props.max,
|
||||||
showDots: __props.showDots
|
showDots: __props.showDots,
|
||||||
}, null, 8, ["val", "disabled", "step", "min", "max", "showDots"])
|
backgroundColor: props.backgroundColor
|
||||||
|
}, null, 8, ["val", "disabled", "step", "min", "max", "showDots", "backgroundColor"])
|
||||||
]))
|
]))
|
||||||
]))
|
]))
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -25,10 +25,12 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const computAlign = computed(() => {
|
const computAlign = computed(
|
||||||
|
() => {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = props.align) != null ? _a : props.direction === "horizontal" ? "center" : "";
|
return (_a = props.align) != null ? _a : props.direction === "horizontal" ? "center" : "";
|
||||||
});
|
}
|
||||||
|
);
|
||||||
const spaceClass = computed(() => [
|
const spaceClass = computed(() => [
|
||||||
"layui-space",
|
"layui-space",
|
||||||
{
|
{
|
||||||
@@ -88,17 +90,25 @@ const _sfc_main = defineComponent({
|
|||||||
};
|
};
|
||||||
return () => {
|
return () => {
|
||||||
const children = extractChildren();
|
const children = extractChildren();
|
||||||
return h("div", {
|
return h(
|
||||||
|
"div",
|
||||||
|
{
|
||||||
class: spaceClass.value,
|
class: spaceClass.value,
|
||||||
style: spaceStyle.value
|
style: spaceStyle.value
|
||||||
}, children.map((child, index2) => {
|
},
|
||||||
|
children.map((child, index2) => {
|
||||||
var _a;
|
var _a;
|
||||||
return h("div", {
|
return h(
|
||||||
|
"div",
|
||||||
|
{
|
||||||
key: (_a = child.key) != null ? _a : `item-${index2}`,
|
key: (_a = child.key) != null ? _a : `item-${index2}`,
|
||||||
class: "layui-space-item",
|
class: "layui-space-item",
|
||||||
style: itemStyle.value
|
style: itemStyle.value
|
||||||
}, h(child));
|
},
|
||||||
}));
|
h(child)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ const _sfc_main = defineComponent({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const boxWidth = target.value.offsetWidth;
|
const boxWidth = target.value.offsetWidth;
|
||||||
const boxHeight = target.value.offsetHeight;
|
const boxHeight = target.value.offsetHeight;
|
||||||
target.value.addEventListener("mousemove", (event) => {
|
target.value.addEventListener(
|
||||||
|
"mousemove",
|
||||||
|
(event) => {
|
||||||
if (domStatus.value && domEvent.value) {
|
if (domStatus.value && domEvent.value) {
|
||||||
const prevDom = domEvent.value.target.previousElementSibling;
|
const prevDom = domEvent.value.target.previousElementSibling;
|
||||||
const nextDom = domEvent.value.target.nextElementSibling;
|
const nextDom = domEvent.value.target.nextElementSibling;
|
||||||
@@ -49,7 +51,8 @@ const _sfc_main = defineComponent({
|
|||||||
nextDom.style.flexBasis = (boxHeight - (event.layerY - prevDomTop) - otherHeight) / (prevDomHeight + nextDomHeight + 5) * otherHeightPercentage + "%";
|
nextDom.style.flexBasis = (boxHeight - (event.layerY - prevDomTop) - otherHeight) / (prevDomHeight + nextDomHeight + 5) * otherHeightPercentage + "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
const moveChange = (event, status, isVertical) => {
|
const moveChange = (event, status, isVertical) => {
|
||||||
domEvent.value = event;
|
domEvent.value = event;
|
||||||
@@ -63,9 +66,11 @@ const _sfc_main = defineComponent({
|
|||||||
};
|
};
|
||||||
const steps = ref([]);
|
const steps = ref([]);
|
||||||
watch(steps, () => {
|
watch(steps, () => {
|
||||||
steps.value.forEach((instance, index2) => {
|
steps.value.forEach(
|
||||||
|
(instance, index2) => {
|
||||||
instance.setIndex(index2);
|
instance.setIndex(index2);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
provide("laySplitPanel", {
|
provide("laySplitPanel", {
|
||||||
props,
|
props,
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ const _sfc_main = defineComponent({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
});
|
});
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
parents.steps.value = parents.steps.value.filter((instance) => instance.itemId !== currentInstance.uid);
|
parents.steps.value = parents.steps.value.filter(
|
||||||
|
(instance) => instance.itemId !== currentInstance.uid
|
||||||
|
);
|
||||||
});
|
});
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock(Fragment, null, [
|
return openBlock(), createElementBlock(Fragment, null, [
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ const _sfc_main = defineComponent({
|
|||||||
emits("onChange", index2 - 1);
|
emits("onChange", index2 - 1);
|
||||||
};
|
};
|
||||||
watch(steps, () => {
|
watch(steps, () => {
|
||||||
steps.value.forEach((instance, index2) => {
|
steps.value.forEach(
|
||||||
|
(instance, index2) => {
|
||||||
instance.setIndex(index2);
|
instance.setIndex(index2);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
provide("LayStep", {
|
provide("LayStep", {
|
||||||
props,
|
props,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, ref, inject, getCurrentInstance, computed, reactive, onMounted, onBeforeUnmount, unref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createBlock, Fragment, toDisplayString, createTextVNode } from "vue";
|
import { defineComponent, ref, inject, getCurrentInstance, computed, reactive, onMounted, onBeforeUnmount, unref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createBlock, Fragment, toDisplayString, createTextVNode } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
const _hoisted_1 = { key: 0 };
|
const _hoisted_1 = { key: 0 };
|
||||||
const _hoisted_2 = { class: "lay-step-item-content-title" };
|
const _hoisted_2 = { class: "lay-step-item-content-title" };
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
@@ -79,7 +79,9 @@ const _sfc_main = defineComponent({
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
});
|
});
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
parents.steps.value = parents.steps.value.filter((instance) => instance.itemId !== currentInstance.uid);
|
parents.steps.value = parents.steps.value.filter(
|
||||||
|
(instance) => instance.itemId !== currentInstance.uid
|
||||||
|
);
|
||||||
});
|
});
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return !unref(simple) ? (openBlock(), createElementBlock("div", {
|
return !unref(simple) ? (openBlock(), createElementBlock("div", {
|
||||||
@@ -110,11 +112,11 @@ const _sfc_main = defineComponent({
|
|||||||
onClick: _cache[0] || (_cache[0] = ($event) => onChange(index.value + 1))
|
onClick: _cache[0] || (_cache[0] = ($event) => onChange(index.value + 1))
|
||||||
}, [
|
}, [
|
||||||
renderSlot(_ctx.$slots, "pace", {}, () => [
|
renderSlot(_ctx.$slots, "pace", {}, () => [
|
||||||
__props.icon ? (openBlock(), createBlock(unref(_sfc_main$2E), {
|
__props.icon ? (openBlock(), createBlock(unref(_sfc_main$2W), {
|
||||||
key: 0,
|
key: 0,
|
||||||
type: __props.icon
|
type: __props.icon
|
||||||
}, null, 8, ["type"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
}, null, 8, ["type"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
||||||
!unref(isActive) ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(index.value + 1), 1)) : (openBlock(), createBlock(unref(_sfc_main$2E), {
|
!unref(isActive) ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(index.value + 1), 1)) : (openBlock(), createBlock(unref(_sfc_main$2W), {
|
||||||
key: 1,
|
key: 1,
|
||||||
type: __props.status === "fail" ? "layui-icon-close" : "layui-icon-ok"
|
type: __props.status === "fail" ? "layui-icon-close" : "layui-icon-ok"
|
||||||
}, null, 8, ["type"]))
|
}, null, 8, ["type"]))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { w as withInstall } from "../badge/index2.js";
|
|||||||
import { defineComponent, inject, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, renderSlot, createElementBlock, createCommentVNode, createVNode, useSlots, ref, watchEffect, normalizeStyle, createSlots } from "vue";
|
import { defineComponent, inject, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, renderSlot, createElementBlock, createCommentVNode, createVNode, useSlots, ref, watchEffect, normalizeStyle, createSlots } from "vue";
|
||||||
import { _ as _sfc_main$3 } from "../transition/index2.js";
|
import { _ as _sfc_main$3 } from "../transition/index2.js";
|
||||||
import { _ as _sfc_main$2 } from "../dropdown/index2.js";
|
import { _ as _sfc_main$2 } from "../dropdown/index2.js";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
import { u as useLevel, p as provideLevel } from "../useLevel/index.js";
|
import { u as useLevel, p as provideLevel } from "../useLevel/index.js";
|
||||||
import { i as indentHandle } from "../utils/index.js";
|
import { i as indentHandle } from "../utils/index.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
@@ -76,7 +76,7 @@ const _sfc_main$1 = defineComponent({
|
|||||||
]),
|
]),
|
||||||
_ctx.$slots.expandIcon ? (openBlock(), createElementBlock("span", _hoisted_5$1, [
|
_ctx.$slots.expandIcon ? (openBlock(), createElementBlock("span", _hoisted_5$1, [
|
||||||
renderSlot(_ctx.$slots, "expandIcon", {}, () => [
|
renderSlot(_ctx.$slots, "expandIcon", {}, () => [
|
||||||
createVNode(unref(_sfc_main$2E), { type: unref(computedExpandIcon) }, null, 8, ["type"])
|
createVNode(unref(_sfc_main$2W), { type: unref(computedExpandIcon) }, null, 8, ["type"])
|
||||||
])
|
])
|
||||||
])) : createCommentVNode("", true)
|
])) : createCommentVNode("", true)
|
||||||
])
|
])
|
||||||
@@ -119,7 +119,9 @@ const _sfc_main = defineComponent({
|
|||||||
const openKeys = inject("openKeys");
|
const openKeys = inject("openKeys");
|
||||||
const indent = inject("indent");
|
const indent = inject("indent");
|
||||||
const isCollapse = inject("isCollapse");
|
const isCollapse = inject("isCollapse");
|
||||||
const isCollapseTransition = inject("isCollapseTransition");
|
const isCollapseTransition = inject(
|
||||||
|
"isCollapseTransition"
|
||||||
|
);
|
||||||
const isOpen = computed(() => {
|
const isOpen = computed(() => {
|
||||||
return openKeys.value.includes(props.id);
|
return openKeys.value.includes(props.id);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { b as isArrayChildren, w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, useSlots, ref, reactive, computed, provide, shallowRef, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, unref, createCommentVNode, Fragment, renderList, withModifiers, createBlock, createVNode, renderSlot, h, createTextVNode } from "vue";
|
import { defineComponent, useSlots, reactive, ref, computed, provide, shallowRef, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, unref, createCommentVNode, Fragment, renderList, withModifiers, createBlock, createVNode, renderSlot, h, createTextVNode } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
import { T as TabInjectKey, _ as _sfc_main$1 } from "../tabItem/index2.js";
|
import { T as TabInjectKey, _ as _sfc_main$1 } from "../tabItem/index2.js";
|
||||||
import { R as RenderFunction } from "../dropdown/index2.js";
|
import { R as RenderFunction } from "../dropdown/index2.js";
|
||||||
import { a as useResizeObserver } from "../_chunks/@vueuse/index.js";
|
import { a as useResizeObserver } from "../_chunks/@vueuse/index.js";
|
||||||
@@ -26,15 +26,14 @@ const _sfc_main = defineComponent({
|
|||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
const slot = useSlots();
|
const slot = useSlots();
|
||||||
const childrens = ref([]);
|
|
||||||
const tabMap = reactive(/* @__PURE__ */ new Map());
|
const tabMap = reactive(/* @__PURE__ */ new Map());
|
||||||
|
const childrens = ref([]);
|
||||||
const setItemInstanceBySlot = function(nodes) {
|
const setItemInstanceBySlot = function(nodes) {
|
||||||
nodes == null ? void 0 : nodes.map((item) => {
|
nodes == null ? void 0 : nodes.map((item) => {
|
||||||
let component2 = item.type;
|
if (isArrayChildren(item, item.children)) {
|
||||||
if (item.type.toString() == "Symbol(Fragment)") {
|
|
||||||
setItemInstanceBySlot(item.children);
|
setItemInstanceBySlot(item.children);
|
||||||
} else {
|
} else {
|
||||||
if (component2.name == _sfc_main$1.name) {
|
if (item.type.name == _sfc_main$1.name) {
|
||||||
childrens.value.push(item);
|
childrens.value.push(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,11 +63,14 @@ const _sfc_main = defineComponent({
|
|||||||
const removeItem = (id) => {
|
const removeItem = (id) => {
|
||||||
tabMap.delete(id);
|
tabMap.delete(id);
|
||||||
};
|
};
|
||||||
provide(TabInjectKey, reactive({
|
provide(
|
||||||
|
TabInjectKey,
|
||||||
|
reactive({
|
||||||
active,
|
active,
|
||||||
addItem,
|
addItem,
|
||||||
removeItem
|
removeItem
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
const change = function(id) {
|
const change = function(id) {
|
||||||
if (props.beforeLeave && props.beforeLeave(id) === false) {
|
if (props.beforeLeave && props.beforeLeave(id) === false) {
|
||||||
return;
|
return;
|
||||||
@@ -226,12 +228,26 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const horizontalScroll = (e) => {
|
||||||
|
var _a, _b;
|
||||||
|
e.preventDefault();
|
||||||
|
const navSize = getNavSize();
|
||||||
|
const containerSize = navRef.value[`offset${sizeName.value}`];
|
||||||
|
const currentOffset = navOffset.value;
|
||||||
|
const scrollNextSize = (_b = (_a = scrollNextRef.value) == null ? void 0 : _a[`offset${sizeName.value}`]) != null ? _b : 0;
|
||||||
|
const direction = Math.abs(e.deltaX) >= Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
|
||||||
|
const distance = 50 * (direction > 0 ? 1 : -1);
|
||||||
|
const newOffset = Math.max(currentOffset + distance, 0);
|
||||||
|
if (navSize - currentOffset <= containerSize - scrollNextSize && direction > 0)
|
||||||
|
return;
|
||||||
|
navOffset.value = newOffset;
|
||||||
|
};
|
||||||
const renderTabIcon = (attrs) => {
|
const renderTabIcon = (attrs) => {
|
||||||
const tab = attrs.tabData;
|
const tab = attrs.tabData;
|
||||||
if (typeof tab.icon === "function") {
|
if (typeof tab.icon === "function") {
|
||||||
return tab.icon();
|
return tab.icon();
|
||||||
} else if (typeof tab.icon === "string") {
|
} else if (typeof tab.icon === "string") {
|
||||||
return h(_sfc_main$2E, {
|
return h(_sfc_main$2W, {
|
||||||
type: tab.icon,
|
type: tab.icon,
|
||||||
style: "margin-right: 8px;"
|
style: "margin-right: 8px;"
|
||||||
});
|
});
|
||||||
@@ -250,19 +266,26 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
useResizeObserver(navRef, update);
|
useResizeObserver(navRef, update);
|
||||||
watch(tabMap, function() {
|
watch(
|
||||||
|
tabMap,
|
||||||
|
() => {
|
||||||
childrens.value = [];
|
childrens.value = [];
|
||||||
setItemInstanceBySlot(slot.default && slot.default());
|
setItemInstanceBySlot(slot.default && slot.default());
|
||||||
}, { immediate: true });
|
},
|
||||||
watch(() => [
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => [
|
||||||
props.modelValue,
|
props.modelValue,
|
||||||
props.tabPosition,
|
props.tabPosition,
|
||||||
props.type,
|
props.type,
|
||||||
childrens.value.length
|
childrens.value.length
|
||||||
], async () => {
|
],
|
||||||
|
async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
update();
|
update();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
update();
|
update();
|
||||||
scrollToActiveTab();
|
scrollToActiveTab();
|
||||||
@@ -283,6 +306,7 @@ const _sfc_main = defineComponent({
|
|||||||
createElementVNode("ul", {
|
createElementVNode("ul", {
|
||||||
ref_key: "navRef",
|
ref_key: "navRef",
|
||||||
ref: navRef,
|
ref: navRef,
|
||||||
|
onWheel: horizontalScroll,
|
||||||
class: normalizeClass([
|
class: normalizeClass([
|
||||||
"layui-tab-title",
|
"layui-tab-title",
|
||||||
props.tabPosition ? `is-${__props.tabPosition}` : ""
|
props.tabPosition ? `is-${__props.tabPosition}` : ""
|
||||||
@@ -320,7 +344,7 @@ const _sfc_main = defineComponent({
|
|||||||
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
||||||
], 10, _hoisted_1);
|
], 10, _hoisted_1);
|
||||||
}), 128))
|
}), 128))
|
||||||
], 6),
|
], 38),
|
||||||
scrollable.value ? (openBlock(), createElementBlock("span", {
|
scrollable.value ? (openBlock(), createElementBlock("span", {
|
||||||
key: 0,
|
key: 0,
|
||||||
ref_key: "scrollPrevRef",
|
ref_key: "scrollPrevRef",
|
||||||
@@ -328,7 +352,7 @@ const _sfc_main = defineComponent({
|
|||||||
class: "layui-unselect layui-tab-bar prev",
|
class: "layui-unselect layui-tab-bar prev",
|
||||||
onClick: scrollPrev
|
onClick: scrollPrev
|
||||||
}, [
|
}, [
|
||||||
createVNode(unref(_sfc_main$2E), { type: "layui-icon-left" })
|
createVNode(unref(_sfc_main$2W), { type: "layui-icon-left" })
|
||||||
], 512)) : createCommentVNode("", true),
|
], 512)) : createCommentVNode("", true),
|
||||||
scrollable.value ? (openBlock(), createElementBlock("span", {
|
scrollable.value ? (openBlock(), createElementBlock("span", {
|
||||||
key: 1,
|
key: 1,
|
||||||
@@ -337,7 +361,7 @@ const _sfc_main = defineComponent({
|
|||||||
class: "layui-unselect layui-tab-bar",
|
class: "layui-unselect layui-tab-bar",
|
||||||
onClick: scrollNext
|
onClick: scrollNext
|
||||||
}, [
|
}, [
|
||||||
createVNode(unref(_sfc_main$2E), { type: "layui-icon-right" })
|
createVNode(unref(_sfc_main$2W), { type: "layui-icon-right" })
|
||||||
], 512)) : createCommentVNode("", true)
|
], 512)) : createCommentVNode("", true)
|
||||||
], 2),
|
], 2),
|
||||||
createElementVNode("div", _hoisted_3, [
|
createElementVNode("div", _hoisted_3, [
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
.layui-tag{--layui-tag-bg-color: #fafafa;--layui-tag-border-color: #f0f0f0;--layui-tag-hover-color: #FFF;--layui-tag-text-color: currentColor;display:inline-flex;align-items:baseline;vertical-align:middle;box-sizing:border-box;height:26px;line-height:26px;padding:0 8px;font-size:14px;font-weight:500;color:var(--layui-tag-text-color);background-color:var(--layui-tag-bg-color);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--global-border-radius)}.layui-tag-icon{margin-right:4px}.layui-tag-bordered{border-color:var(--layui-tag-border-color)}.layui-tag-disabled{opacity:.4;cursor:not-allowed}.layui-tag-disabled .layui-tag-close-icon .layui-icon:hover{cursor:not-allowed!important;opacity:1}.layui-tag-shap-square{border-radius:var(--global-border-radius)}.layui-tag-shap-round{border-radius:12px}.layui-tag-ellipsis .layui-tag-text{display:inline-block;white-space:nowrap;word-wrap:normal;overflow:hidden;text-overflow:ellipsis}.layui-tag .layui-tag-close-icon{margin-left:4px;font-size:14px}.layui-tag .layui-tag-close-icon .layui-icon:hover{cursor:pointer;opacity:.5}.layui-tag-size-lg{height:30px;font-size:14px;line-height:30px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-md{height:26px;font-size:14px;line-height:26px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-sm{height:22px;font-size:12px;line-height:22px}.layui-tag-size-xs{height:18px;font-size:12px;line-height:18px}.layui-tag .layui-icon{font-size:12px}.layui-tag-primary{--layui-tag-bg-color: #009688;--layui-tag-border-color: transparent;--layui-tag-hover-color: #009688;--layui-tag-text-color: #FFF}.layui-tag-primary-bordered{--layui-tag-border-color: #009688}.layui-tag-primary.layui-tag-variant-light{--layui-tag-bg-color: #e6f5f3;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e6f5f3;--layui-tag-text-color: #009688}.layui-tag-primary.layui-tag-variant-light-bordered{--layui-tag-border-color: #80cbc4}.layui-tag-primary.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #009688;--layui-tag-border-color: transparent}.layui-tag-primary.layui-tag-variant-plain-bordered{--layui-tag-border-color: #009688}.layui-tag-normal{--layui-tag-bg-color: #1e9fff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #1e9fff;--layui-tag-text-color: #FFF}.layui-tag-normal-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light{--layui-tag-bg-color: #e9f5ff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e9f5ff;--layui-tag-text-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light-bordered{--layui-tag-border-color: #8fcfff}.layui-tag-normal.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #1e9fff;--layui-tag-border-color: transparent}.layui-tag-normal.layui-tag-variant-plain-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-warm{--layui-tag-bg-color: #ffb800;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffb800;--layui-tag-text-color: #FFF}.layui-tag-warm-bordered{--layui-tag-border-color: #ffb800}.layui-tag-warm.layui-tag-variant-light{--layui-tag-bg-color: #fff8e6;--layui-tag-border-color: transparent;--layui-tag-hover-color: #fff8e6;--layui-tag-text-color: #ffb800}.layui-tag-warm.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffdc80}.layui-tag-warm.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ffb800;--layui-tag-border-color: transparent}.layui-tag-warm.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ffb800}.layui-tag-danger{--layui-tag-bg-color: #ff5722;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ff5722;--layui-tag-text-color: #FFF}.layui-tag-danger-bordered{--layui-tag-border-color: #ff5722}.layui-tag-danger.layui-tag-variant-light{--layui-tag-bg-color: #ffeee9;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffeee9;--layui-tag-text-color: #ff5722}.layui-tag-danger.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffab91}.layui-tag-danger.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ff5722;--layui-tag-border-color: transparent}.layui-tag-danger.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ff5722}
|
.layui-tag{--layui-tag-bg-color: #fafafa;--layui-tag-border-color: #f0f0f0;--layui-tag-hover-color: #FFF;--layui-tag-text-color: currentColor;display:inline-flex;align-items:baseline;vertical-align:middle;box-sizing:border-box;height:26px;line-height:26px;padding:0 8px;font-size:14px;font-weight:500;color:var(--layui-tag-text-color);background-color:var(--layui-tag-bg-color);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--global-border-radius)}.layui-tag-icon{margin-right:4px}.layui-tag-bordered{border-color:var(--layui-tag-border-color)}.layui-tag-disabled{opacity:.4;cursor:not-allowed}.layui-tag-disabled .layui-tag-close-icon .layui-icon:hover{cursor:not-allowed!important;opacity:1}.layui-tag-shap-square{border-radius:var(--global-border-radius)}.layui-tag-shap-round{border-radius:12px}.layui-tag .layui-tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-tag .layui-tag-close-icon{margin-left:4px;font-size:14px}.layui-tag .layui-tag-close-icon .layui-icon:hover{cursor:pointer;opacity:.5}.layui-tag-size-lg{height:30px;font-size:14px;line-height:30px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-md{height:26px;font-size:14px;line-height:26px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-sm{height:22px;font-size:12px;line-height:22px}.layui-tag-size-xs{height:18px;font-size:12px;line-height:18px}.layui-tag .layui-icon{font-size:12px}.layui-tag-primary{--layui-tag-bg-color: #009688;--layui-tag-border-color: transparent;--layui-tag-hover-color: #009688;--layui-tag-text-color: #FFF}.layui-tag-primary-bordered{--layui-tag-border-color: #009688}.layui-tag-primary.layui-tag-variant-light{--layui-tag-bg-color: #e6f5f3;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e6f5f3;--layui-tag-text-color: #009688}.layui-tag-primary.layui-tag-variant-light-bordered{--layui-tag-border-color: #80cbc4}.layui-tag-primary.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #009688;--layui-tag-border-color: transparent}.layui-tag-primary.layui-tag-variant-plain-bordered{--layui-tag-border-color: #009688}.layui-tag-normal{--layui-tag-bg-color: #1e9fff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #1e9fff;--layui-tag-text-color: #FFF}.layui-tag-normal-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light{--layui-tag-bg-color: #e9f5ff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e9f5ff;--layui-tag-text-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light-bordered{--layui-tag-border-color: #8fcfff}.layui-tag-normal.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #1e9fff;--layui-tag-border-color: transparent}.layui-tag-normal.layui-tag-variant-plain-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-warm{--layui-tag-bg-color: #ffb800;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffb800;--layui-tag-text-color: #FFF}.layui-tag-warm-bordered{--layui-tag-border-color: #ffb800}.layui-tag-warm.layui-tag-variant-light{--layui-tag-bg-color: #fff8e6;--layui-tag-border-color: transparent;--layui-tag-hover-color: #fff8e6;--layui-tag-text-color: #ffb800}.layui-tag-warm.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffdc80}.layui-tag-warm.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ffb800;--layui-tag-border-color: transparent}.layui-tag-warm.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ffb800}.layui-tag-danger{--layui-tag-bg-color: #ff5722;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ff5722;--layui-tag-text-color: #FFF}.layui-tag-danger-bordered{--layui-tag-border-color: #ff5722}.layui-tag-danger.layui-tag-variant-light{--layui-tag-bg-color: #ffeee9;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffeee9;--layui-tag-text-color: #ff5722}.layui-tag-danger.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffab91}.layui-tag-danger.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ff5722;--layui-tag-border-color: transparent}.layui-tag-danger.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ff5722}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../badge/index2.js";
|
import "../badge/index2.js";
|
||||||
export { c as default } from "./index2.js";
|
export { c as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../_chunks/@ctrl/index.js";
|
import "../_chunks/@ctrl/index.js";
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, renderSlot, createCommentVNode, withModifiers, createVNode } from "vue";
|
import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, renderSlot, createCommentVNode, createElementVNode, withModifiers, createVNode } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
import { T as TinyColor } from "../_chunks/@ctrl/index.js";
|
import { T as TinyColor } from "../_chunks/@ctrl/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ".layui-tag{--layui-tag-bg-color: #fafafa;--layui-tag-border-color: #f0f0f0;--layui-tag-hover-color: #FFF;--layui-tag-text-color: currentColor;display:inline-flex;align-items:baseline;vertical-align:middle;box-sizing:border-box;height:26px;line-height:26px;padding:0 8px;font-size:14px;font-weight:500;color:var(--layui-tag-text-color);background-color:var(--layui-tag-bg-color);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--global-border-radius)}.layui-tag-icon{margin-right:4px}.layui-tag-bordered{border-color:var(--layui-tag-border-color)}.layui-tag-disabled{opacity:.4;cursor:not-allowed}.layui-tag-disabled .layui-tag-close-icon .layui-icon:hover{cursor:not-allowed!important;opacity:1}.layui-tag-shap-square{border-radius:var(--global-border-radius)}.layui-tag-shap-round{border-radius:12px}.layui-tag-ellipsis .layui-tag-text{display:inline-block;white-space:nowrap;word-wrap:normal;overflow:hidden;text-overflow:ellipsis}.layui-tag .layui-tag-close-icon{margin-left:4px;font-size:14px}.layui-tag .layui-tag-close-icon .layui-icon:hover{cursor:pointer;opacity:.5}.layui-tag-size-lg{height:30px;font-size:14px;line-height:30px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-md{height:26px;font-size:14px;line-height:26px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-sm{height:22px;font-size:12px;line-height:22px}.layui-tag-size-xs{height:18px;font-size:12px;line-height:18px}.layui-tag .layui-icon{font-size:12px}.layui-tag-primary{--layui-tag-bg-color: #009688;--layui-tag-border-color: transparent;--layui-tag-hover-color: #009688;--layui-tag-text-color: #FFF}.layui-tag-primary-bordered{--layui-tag-border-color: #009688}.layui-tag-primary.layui-tag-variant-light{--layui-tag-bg-color: #e6f5f3;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e6f5f3;--layui-tag-text-color: #009688}.layui-tag-primary.layui-tag-variant-light-bordered{--layui-tag-border-color: #80cbc4}.layui-tag-primary.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #009688;--layui-tag-border-color: transparent}.layui-tag-primary.layui-tag-variant-plain-bordered{--layui-tag-border-color: #009688}.layui-tag-normal{--layui-tag-bg-color: #1e9fff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #1e9fff;--layui-tag-text-color: #FFF}.layui-tag-normal-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light{--layui-tag-bg-color: #e9f5ff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e9f5ff;--layui-tag-text-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light-bordered{--layui-tag-border-color: #8fcfff}.layui-tag-normal.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #1e9fff;--layui-tag-border-color: transparent}.layui-tag-normal.layui-tag-variant-plain-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-warm{--layui-tag-bg-color: #ffb800;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffb800;--layui-tag-text-color: #FFF}.layui-tag-warm-bordered{--layui-tag-border-color: #ffb800}.layui-tag-warm.layui-tag-variant-light{--layui-tag-bg-color: #fff8e6;--layui-tag-border-color: transparent;--layui-tag-hover-color: #fff8e6;--layui-tag-text-color: #ffb800}.layui-tag-warm.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffdc80}.layui-tag-warm.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ffb800;--layui-tag-border-color: transparent}.layui-tag-warm.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ffb800}.layui-tag-danger{--layui-tag-bg-color: #ff5722;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ff5722;--layui-tag-text-color: #FFF}.layui-tag-danger-bordered{--layui-tag-border-color: #ff5722}.layui-tag-danger.layui-tag-variant-light{--layui-tag-bg-color: #ffeee9;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffeee9;--layui-tag-text-color: #ff5722}.layui-tag-danger.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffab91}.layui-tag-danger.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ff5722;--layui-tag-border-color: transparent}.layui-tag-danger.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ff5722}\n")();
|
var index = /* @__PURE__ */ (() => ".layui-tag{--layui-tag-bg-color: #fafafa;--layui-tag-border-color: #f0f0f0;--layui-tag-hover-color: #FFF;--layui-tag-text-color: currentColor;display:inline-flex;align-items:baseline;vertical-align:middle;box-sizing:border-box;height:26px;line-height:26px;padding:0 8px;font-size:14px;font-weight:500;color:var(--layui-tag-text-color);background-color:var(--layui-tag-bg-color);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--global-border-radius)}.layui-tag-icon{margin-right:4px}.layui-tag-bordered{border-color:var(--layui-tag-border-color)}.layui-tag-disabled{opacity:.4;cursor:not-allowed}.layui-tag-disabled .layui-tag-close-icon .layui-icon:hover{cursor:not-allowed!important;opacity:1}.layui-tag-shap-square{border-radius:var(--global-border-radius)}.layui-tag-shap-round{border-radius:12px}.layui-tag .layui-tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-tag .layui-tag-close-icon{margin-left:4px;font-size:14px}.layui-tag .layui-tag-close-icon .layui-icon:hover{cursor:pointer;opacity:.5}.layui-tag-size-lg{height:30px;font-size:14px;line-height:30px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-md{height:26px;font-size:14px;line-height:26px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-sm{height:22px;font-size:12px;line-height:22px}.layui-tag-size-xs{height:18px;font-size:12px;line-height:18px}.layui-tag .layui-icon{font-size:12px}.layui-tag-primary{--layui-tag-bg-color: #009688;--layui-tag-border-color: transparent;--layui-tag-hover-color: #009688;--layui-tag-text-color: #FFF}.layui-tag-primary-bordered{--layui-tag-border-color: #009688}.layui-tag-primary.layui-tag-variant-light{--layui-tag-bg-color: #e6f5f3;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e6f5f3;--layui-tag-text-color: #009688}.layui-tag-primary.layui-tag-variant-light-bordered{--layui-tag-border-color: #80cbc4}.layui-tag-primary.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #009688;--layui-tag-border-color: transparent}.layui-tag-primary.layui-tag-variant-plain-bordered{--layui-tag-border-color: #009688}.layui-tag-normal{--layui-tag-bg-color: #1e9fff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #1e9fff;--layui-tag-text-color: #FFF}.layui-tag-normal-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light{--layui-tag-bg-color: #e9f5ff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e9f5ff;--layui-tag-text-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light-bordered{--layui-tag-border-color: #8fcfff}.layui-tag-normal.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #1e9fff;--layui-tag-border-color: transparent}.layui-tag-normal.layui-tag-variant-plain-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-warm{--layui-tag-bg-color: #ffb800;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffb800;--layui-tag-text-color: #FFF}.layui-tag-warm-bordered{--layui-tag-border-color: #ffb800}.layui-tag-warm.layui-tag-variant-light{--layui-tag-bg-color: #fff8e6;--layui-tag-border-color: transparent;--layui-tag-hover-color: #fff8e6;--layui-tag-text-color: #ffb800}.layui-tag-warm.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffdc80}.layui-tag-warm.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ffb800;--layui-tag-border-color: transparent}.layui-tag-warm.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ffb800}.layui-tag-danger{--layui-tag-bg-color: #ff5722;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ff5722;--layui-tag-text-color: #FFF}.layui-tag-danger-bordered{--layui-tag-border-color: #ff5722}.layui-tag-danger.layui-tag-variant-light{--layui-tag-bg-color: #ffeee9;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffeee9;--layui-tag-text-color: #ff5722}.layui-tag-danger.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffab91}.layui-tag-danger.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ff5722;--layui-tag-border-color: transparent}.layui-tag-danger.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ff5722}\n")();
|
||||||
const _hoisted_1 = {
|
const _hoisted_1 = {
|
||||||
key: 0,
|
key: 0,
|
||||||
class: "layui-tag-icon"
|
class: "layui-tag-icon"
|
||||||
};
|
};
|
||||||
const _hoisted_2 = ["onClick"];
|
const _hoisted_2 = { class: "layui-tag-text" };
|
||||||
|
const _hoisted_3 = ["onClick"];
|
||||||
const __default__ = {
|
const __default__ = {
|
||||||
name: "LayTag"
|
name: "LayTag"
|
||||||
};
|
};
|
||||||
@@ -43,15 +44,14 @@ const _sfc_main = defineComponent({
|
|||||||
[`layui-tag-${props.type}-bordered`]: props.bordered,
|
[`layui-tag-${props.type}-bordered`]: props.bordered,
|
||||||
[`layui-tag-${props.type}`]: props.type,
|
[`layui-tag-${props.type}`]: props.type,
|
||||||
"layui-tag-bordered": props.bordered,
|
"layui-tag-bordered": props.bordered,
|
||||||
"layui-tag-disabled": props.disabled,
|
"layui-tag-disabled": props.disabled
|
||||||
"layui-tag-ellipsis": props.maxWidth
|
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const styleTag = computed(() => {
|
const styleTag = computed(() => {
|
||||||
var _a;
|
var _a;
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"max-width": (_a = props.maxWidth) != null ? _a : "unset",
|
"max-width": (_a = props.maxWidth) != null ? _a : "100%",
|
||||||
...useTagCustomStyle(props).value
|
...useTagCustomStyle(props).value
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -99,22 +99,18 @@ const _sfc_main = defineComponent({
|
|||||||
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_1, [
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_1, [
|
||||||
renderSlot(_ctx.$slots, "icon")
|
renderSlot(_ctx.$slots, "icon")
|
||||||
])) : createCommentVNode("", true),
|
])) : createCommentVNode("", true),
|
||||||
__props.maxWidth ? (openBlock(), createElementBlock("span", {
|
createElementVNode("span", _hoisted_2, [
|
||||||
key: 1,
|
|
||||||
style: normalizeStyle(unref(styleTag)),
|
|
||||||
class: "layui-tag-text"
|
|
||||||
}, [
|
|
||||||
renderSlot(_ctx.$slots, "default")
|
renderSlot(_ctx.$slots, "default")
|
||||||
], 4)) : renderSlot(_ctx.$slots, "default", { key: 2 }),
|
]),
|
||||||
__props.closable ? (openBlock(), createElementBlock("span", {
|
__props.closable ? (openBlock(), createElementBlock("span", {
|
||||||
key: 3,
|
key: 1,
|
||||||
class: "layui-tag-close-icon",
|
class: "layui-tag-close-icon",
|
||||||
onClick: withModifiers(handleClose, ["stop"])
|
onClick: withModifiers(handleClose, ["stop"])
|
||||||
}, [
|
}, [
|
||||||
renderSlot(_ctx.$slots, "close-icon", {}, () => [
|
renderSlot(_ctx.$slots, "close-icon", {}, () => [
|
||||||
createVNode(unref(_sfc_main$2E), { type: "layui-icon-close" })
|
createVNode(unref(_sfc_main$2W), { type: "layui-icon-close" })
|
||||||
])
|
])
|
||||||
], 8, _hoisted_2)) : createCommentVNode("", true)
|
], 8, _hoisted_3)) : createCommentVNode("", true)
|
||||||
], 6)) : createCommentVNode("", true);
|
], 6)) : createCommentVNode("", true);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@ import "../badge/index2.js";
|
|||||||
export { c as default } from "./index2.js";
|
export { c as default } from "./index2.js";
|
||||||
import "vue";
|
import "vue";
|
||||||
import "../tag/index2.js";
|
import "../tag/index2.js";
|
||||||
import "../checkbox/index2.js";
|
import "../_chunks/@layui/index.js";
|
||||||
import "../_chunks/@ctrl/index.js";
|
import "../_chunks/@ctrl/index.js";
|
||||||
import "../tooltip/index2.js";
|
import "../tooltip/index2.js";
|
||||||
import "../_chunks/@vueuse/index.js";
|
import "../_chunks/@vueuse/index.js";
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
:root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative}.layui-textarea-wrapper{position:relative}.layui-textarea:hover,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{color:inherit;white-space:nowrap;pointer-events:none;text-align:right;margin-top:4px}.layui-textarea-disabled{cursor:not-allowed!important;opacity:.6}
|
:root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative;transition:none;-webkit-transition:none}.layui-textarea-wrapper{position:relative}.layui-textarea:hover,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{color:inherit;white-space:nowrap;pointer-events:none;text-align:right;margin-top:4px}.layui-textarea-disabled{cursor:not-allowed!important;opacity:.6}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, ref, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, unref, createVNode, createCommentVNode, toDisplayString } from "vue";
|
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createElementVNode, normalizeClass, unref, createVNode, createCommentVNode, toDisplayString } from "vue";
|
||||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
|
||||||
var index = /* @__PURE__ */ (() => ":root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative}.layui-textarea-wrapper{position:relative}.layui-textarea:hover,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{color:inherit;white-space:nowrap;pointer-events:none;text-align:right;margin-top:4px}.layui-textarea-disabled{cursor:not-allowed!important;opacity:.6}\n")();
|
import { g as isObject } from "../_chunks/@vueuse/index.js";
|
||||||
|
var index = /* @__PURE__ */ (() => ":root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative;transition:none;-webkit-transition:none}.layui-textarea-wrapper{position:relative}.layui-textarea:hover,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{color:inherit;white-space:nowrap;pointer-events:none;text-align:right;margin-top:4px}.layui-textarea-disabled{cursor:not-allowed!important;opacity:.6}\n")();
|
||||||
const _hoisted_1 = { class: "layui-textarea-wrapper" };
|
const _hoisted_1 = { class: "layui-textarea-wrapper" };
|
||||||
const _hoisted_2 = ["value", "placeholder", "name", "disabled", "maxlength"];
|
const _hoisted_2 = ["value", "placeholder", "name", "disabled", "maxlength"];
|
||||||
const _hoisted_3 = {
|
const _hoisted_3 = {
|
||||||
@@ -24,11 +25,13 @@ const _sfc_main = defineComponent({
|
|||||||
disabled: { type: Boolean },
|
disabled: { type: Boolean },
|
||||||
showCount: { type: Boolean },
|
showCount: { type: Boolean },
|
||||||
allowClear: { type: Boolean },
|
allowClear: { type: Boolean },
|
||||||
maxlength: null
|
maxlength: null,
|
||||||
|
autosize: { type: [Boolean, Object] }
|
||||||
},
|
},
|
||||||
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
|
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
|
||||||
setup(__props, { emit }) {
|
setup(__props, { emit }) {
|
||||||
const props = __props;
|
const props = __props;
|
||||||
|
const textareaRef = ref(null);
|
||||||
const composing = ref(false);
|
const composing = ref(false);
|
||||||
const onInput = function(event) {
|
const onInput = function(event) {
|
||||||
const inputElement = event.target;
|
const inputElement = event.target;
|
||||||
@@ -71,9 +74,30 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
});
|
});
|
||||||
|
watch(
|
||||||
|
[() => props.modelValue, textareaRef],
|
||||||
|
() => {
|
||||||
|
var _a, _b;
|
||||||
|
if (!textareaRef.value || !props.autosize)
|
||||||
|
return;
|
||||||
|
const height = ((_a = textareaRef.value) == null ? void 0 : _a.scrollHeight) + 2;
|
||||||
|
if (isObject(props.autosize)) {
|
||||||
|
const { minHeight, maxHeight } = props.autosize;
|
||||||
|
if (height < minHeight || height > maxHeight)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
textareaRef.value.style.height = "1px";
|
||||||
|
textareaRef.value.style.height = `${((_b = textareaRef.value) == null ? void 0 : _b.scrollHeight) + 2}px`;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
);
|
||||||
return (_ctx, _cache) => {
|
return (_ctx, _cache) => {
|
||||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||||
createElementVNode("textarea", {
|
createElementVNode("textarea", {
|
||||||
|
ref_key: "textareaRef",
|
||||||
|
ref: textareaRef,
|
||||||
class: normalizeClass(["layui-textarea", { "layui-textarea-disabled": __props.disabled }]),
|
class: normalizeClass(["layui-textarea", { "layui-textarea-disabled": __props.disabled }]),
|
||||||
value: __props.modelValue,
|
value: __props.modelValue,
|
||||||
placeholder: __props.placeholder,
|
placeholder: __props.placeholder,
|
||||||
@@ -88,7 +112,7 @@ const _sfc_main = defineComponent({
|
|||||||
onBlur
|
onBlur
|
||||||
}, null, 42, _hoisted_2),
|
}, null, 42, _hoisted_2),
|
||||||
__props.allowClear && unref(hasContent) ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
__props.allowClear && unref(hasContent) ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
||||||
createVNode(unref(_sfc_main$2E), {
|
createVNode(unref(_sfc_main$2W), {
|
||||||
type: "layui-icon-close-fill",
|
type: "layui-icon-close-fill",
|
||||||
onClick: onClear
|
onClick: onClear
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { w as withInstall } from "../badge/index2.js";
|
import { w as withInstall } from "../badge/index2.js";
|
||||||
import { defineComponent, useSlots, ref, toRef, shallowRef, computed, watch, onMounted, openBlock, createBlock, Teleport, withDirectives, createVNode, Transition, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createTextVNode, toDisplayString, vShow, createCommentVNode, nextTick, getCurrentInstance, createElementBlock, Fragment, normalizeProps, mergeProps, unref } from "vue";
|
import { defineComponent, useSlots, ref, toRef, shallowRef, computed, watch, onMounted, openBlock, createBlock, Teleport, withDirectives, createVNode, Transition, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createTextVNode, toDisplayString, vShow, createCommentVNode, nextTick, getCurrentInstance, createElementBlock, Fragment, mergeProps, unref } from "vue";
|
||||||
import { o as onClickOutside, a as useResizeObserver, c as useEventListener, b as useThrottleFn } from "../_chunks/@vueuse/index.js";
|
import { o as onClickOutside, a as useResizeObserver, c as useEventListener, b as useThrottleFn } from "../_chunks/@vueuse/index.js";
|
||||||
var index$1 = /* @__PURE__ */ (() => ".lay-tooltip-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}\n")();
|
var index$1 = /* @__PURE__ */ (() => ".lay-tooltip-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}\n")();
|
||||||
var index = /* @__PURE__ */ (() => '.layui-popper{position:fixed;padding:10px;border-radius:3px;word-wrap:break-word;min-width:12px;min-height:12px;font-size:14px;box-sizing:border-box;box-shadow:0 2px 12px #00000026;background-color:#fff;color:#3a3a3a;border:1px solid #cecece;max-width:300px;z-index:99999}.layui-popper[position=top]{margin-bottom:6px}.layui-popper[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#cecece}.layui-popper[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#fff}.layui-popper[position=bottom]{margin-top:6px}.layui-popper[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#cecece}.layui-popper[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#fff}.layui-popper[position=right]{margin-left:6px}.layui-popper[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#cecece}.layui-popper[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#fff}.layui-popper[position=left]{margin-right:6px}.layui-popper[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#cecece}.layui-popper[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#fff}.layui-popper[position=top] .layui-popper-arrow,.layui-popper[position=bottom] .layui-popper-arrow{left:-moz-calc(44%);left:-webkit-calc(44%);left:calc(50% - 6px)}.layui-popper[position=left] .layui-popper-arrow,.layui-popper[position=right] .layui-popper-arrow{top:-moz-calc(44%);top:-webkit-calc(44%);top:calc(50% - 6px)}.layui-popper:after{content:" ";position:absolute;display:block}.layui-popper[position=top]:after{bottom:-7px;left:0;width:100%;height:7px}.layui-popper[position=bottom]:after{top:-7px;left:0;width:100%;height:7px}.layui-popper[position=left]:after{right:-7px;bottom:0;height:100%;width:7px}.layui-popper[position=right]:after{left:-7px;bottom:0;height:100%;width:7px}.layui-popper .layui-popper-arrow,.layui-popper .layui-popper-arrow:after{position:absolute;display:block;width:0;height:0;border-width:6px;border-style:solid;border-color:transparent}.layui-popper .layui-popper-arrow:after{content:" "}.layui-popper.layui-dark{background-color:#353535;color:#fff;border:1px solid #353535}.layui-popper.layui-dark[position=top]{margin-bottom:6px}.layui-popper.layui-dark[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#353535}.layui-popper.layui-dark[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#353535}.layui-popper.layui-dark[position=bottom]{margin-top:6px}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#353535}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#353535}.layui-popper.layui-dark[position=right]{margin-left:6px}.layui-popper.layui-dark[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#353535}.layui-popper.layui-dark[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#353535}.layui-popper.layui-dark[position=left]{margin-right:6px}.layui-popper.layui-dark[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#353535}.layui-popper.layui-dark[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#353535}\n')();
|
var index = /* @__PURE__ */ (() => '.layui-popper{position:fixed;padding:10px;border-radius:3px;word-wrap:break-word;min-width:12px;min-height:12px;font-size:14px;box-sizing:border-box;box-shadow:0 2px 12px #00000026;background-color:#fff;color:#3a3a3a;border:1px solid #cecece;max-width:300px;z-index:99999}.layui-popper[position=top]{margin-bottom:6px}.layui-popper[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#cecece}.layui-popper[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#fff}.layui-popper[position=bottom]{margin-top:6px}.layui-popper[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#cecece}.layui-popper[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#fff}.layui-popper[position=right]{margin-left:6px}.layui-popper[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#cecece}.layui-popper[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#fff}.layui-popper[position=left]{margin-right:6px}.layui-popper[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#cecece}.layui-popper[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#fff}.layui-popper[position=top] .layui-popper-arrow,.layui-popper[position=bottom] .layui-popper-arrow{left:-moz-calc(44%);left:-webkit-calc(44%);left:calc(50% - 6px)}.layui-popper[position=left] .layui-popper-arrow,.layui-popper[position=right] .layui-popper-arrow{top:-moz-calc(44%);top:-webkit-calc(44%);top:calc(50% - 6px)}.layui-popper:after{content:" ";position:absolute;display:block}.layui-popper[position=top]:after{bottom:-7px;left:0;width:100%;height:7px}.layui-popper[position=bottom]:after{top:-7px;left:0;width:100%;height:7px}.layui-popper[position=left]:after{right:-7px;bottom:0;height:100%;width:7px}.layui-popper[position=right]:after{left:-7px;bottom:0;height:100%;width:7px}.layui-popper .layui-popper-arrow,.layui-popper .layui-popper-arrow:after{position:absolute;display:block;width:0;height:0;border-width:6px;border-style:solid;border-color:transparent}.layui-popper .layui-popper-arrow:after{content:" "}.layui-popper.layui-dark{background-color:#353535;color:#fff;border:1px solid #353535}.layui-popper.layui-dark[position=top]{margin-bottom:6px}.layui-popper.layui-dark[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#353535}.layui-popper.layui-dark[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#353535}.layui-popper.layui-dark[position=bottom]{margin-top:6px}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#353535}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#353535}.layui-popper.layui-dark[position=right]{margin-left:6px}.layui-popper.layui-dark[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#353535}.layui-popper.layui-dark[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#353535}.layui-popper.layui-dark[position=left]{margin-right:6px}.layui-popper.layui-dark[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#353535}.layui-popper.layui-dark[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#353535}\n')();
|
||||||
@@ -90,7 +90,9 @@ const _sfc_main$1 = defineComponent({
|
|||||||
const innerVisible = ref(props.visible);
|
const innerVisible = ref(props.visible);
|
||||||
const isExist = ref(props.visible);
|
const isExist = ref(props.visible);
|
||||||
let scrollElements;
|
let scrollElements;
|
||||||
const triggerMethods = computed(() => [].concat(props.trigger));
|
const triggerMethods = computed(
|
||||||
|
() => [].concat(props.trigger)
|
||||||
|
);
|
||||||
const doShow = function() {
|
const doShow = function() {
|
||||||
if (!props.disabled) {
|
if (!props.disabled) {
|
||||||
if (!isExist.value) {
|
if (!isExist.value) {
|
||||||
@@ -112,7 +114,11 @@ const _sfc_main$1 = defineComponent({
|
|||||||
style.value = { top: -window.innerHeight + "px", left: 0 };
|
style.value = { top: -window.innerHeight + "px", left: 0 };
|
||||||
};
|
};
|
||||||
const calcPosistion = function() {
|
const calcPosistion = function() {
|
||||||
postionFns[props.position] && (style.value = postionFns[props.position](triggerRefEl.value, popperRefEl.value, innnerPosition));
|
postionFns[props.position] && (style.value = postionFns[props.position](
|
||||||
|
triggerRefEl.value,
|
||||||
|
popperRefEl.value,
|
||||||
|
innnerPosition
|
||||||
|
));
|
||||||
};
|
};
|
||||||
const updatePosistion = function() {
|
const updatePosistion = function() {
|
||||||
if (innerVisible.value) {
|
if (innerVisible.value) {
|
||||||
@@ -184,14 +190,18 @@ const _sfc_main$1 = defineComponent({
|
|||||||
updatePosistion();
|
updatePosistion();
|
||||||
}
|
}
|
||||||
}, 15);
|
}, 15);
|
||||||
onClickOutside(triggerRefEl.value, (e) => {
|
onClickOutside(
|
||||||
|
triggerRefEl.value,
|
||||||
|
(e) => {
|
||||||
if (!innerVisible.value || triggerRefEl.value.contains(e.target) || popperRefEl.value.contains(e.target)) {
|
if (!innerVisible.value || triggerRefEl.value.contains(e.target) || popperRefEl.value.contains(e.target)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
doHidden();
|
doHidden();
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
ignore: [popperRefEl.value]
|
ignore: [popperRefEl.value]
|
||||||
});
|
}
|
||||||
|
);
|
||||||
useResizeObserver(triggerRefEl, () => {
|
useResizeObserver(triggerRefEl, () => {
|
||||||
updatePosistion();
|
updatePosistion();
|
||||||
});
|
});
|
||||||
@@ -206,10 +216,16 @@ const _sfc_main$1 = defineComponent({
|
|||||||
popperObserver && popperObserver.stop();
|
popperObserver && popperObserver.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
watch(() => props.visible, (isShow) => isShow ? doShow() : doHidden());
|
watch(
|
||||||
watch(() => props.content, () => {
|
() => props.visible,
|
||||||
|
(isShow) => isShow ? doShow() : doHidden()
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.content,
|
||||||
|
() => {
|
||||||
updatePosistion();
|
updatePosistion();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
const isScrollElement = function(element) {
|
const isScrollElement = function(element) {
|
||||||
return element.scrollHeight > element.offsetHeight || element.scrollWidth > element.offsetWidth;
|
return element.scrollHeight > element.offsetHeight || element.scrollWidth > element.offsetWidth;
|
||||||
};
|
};
|
||||||
@@ -360,12 +376,15 @@ const _sfc_main = defineComponent({
|
|||||||
renderSlot(_ctx.$slots, "default")
|
renderSlot(_ctx.$slots, "default")
|
||||||
])
|
])
|
||||||
], 512)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
], 512)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
||||||
isMounted.value ? (openBlock(), createBlock(_sfc_main$1, normalizeProps(mergeProps({ key: 2 }, unref(innerProps))), {
|
isMounted.value ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
||||||
|
key: 2,
|
||||||
|
positio: __props.position
|
||||||
|
}, unref(innerProps)), {
|
||||||
default: withCtx(() => [
|
default: withCtx(() => [
|
||||||
renderSlot(_ctx.$slots, "content")
|
renderSlot(_ctx.$slots, "content")
|
||||||
]),
|
]),
|
||||||
_: 3
|
_: 3
|
||||||
}, 16)) : createCommentVNode("", true)
|
}, 16, ["positio"])) : createCommentVNode("", true)
|
||||||
], 64);
|
], 64);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -80,7 +80,9 @@ const _sfc_main = defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
watch(selectedValue, () => {
|
watch(
|
||||||
|
selectedValue,
|
||||||
|
() => {
|
||||||
if (props.multiple) {
|
if (props.multiple) {
|
||||||
multipleValue.value = selectedValue.value.map((value) => {
|
multipleValue.value = selectedValue.value.map((value) => {
|
||||||
const node = getNode(props.data, value);
|
const node = getNode(props.data, value);
|
||||||
@@ -94,7 +96,9 @@ const _sfc_main = defineComponent({
|
|||||||
singleValue.value = node.title;
|
singleValue.value = node.title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, { immediate: true, deep: true });
|
},
|
||||||
|
{ immediate: true, deep: true }
|
||||||
|
);
|
||||||
const handleClick = (node) => {
|
const handleClick = (node) => {
|
||||||
dropdownRef.value.hide();
|
dropdownRef.value.hide();
|
||||||
selectedValue.value = node.id;
|
selectedValue.value = node.id;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2689
es/upload/index2.js
2689
es/upload/index2.js
File diff suppressed because one or more lines are too long
@@ -2,9 +2,12 @@ import { inject, computed, isRef, provide, reactive } from "vue";
|
|||||||
const LevelInjectionKey = Symbol("menuLevelKey");
|
const LevelInjectionKey = Symbol("menuLevelKey");
|
||||||
function provideLevel(level) {
|
function provideLevel(level) {
|
||||||
const computedLevel = computed(() => isRef(level) ? level.value : level);
|
const computedLevel = computed(() => isRef(level) ? level.value : level);
|
||||||
provide(LevelInjectionKey, reactive({
|
provide(
|
||||||
|
LevelInjectionKey,
|
||||||
|
reactive({
|
||||||
level: computedLevel
|
level: computedLevel
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
function useLevel(props) {
|
function useLevel(props) {
|
||||||
const { provideNextLevel } = props || {};
|
const { provideNextLevel } = props || {};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
26060
lib/index.js
26060
lib/index.js
File diff suppressed because one or more lines are too long
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@layui/layui-vue",
|
"name": "@layui/layui-vue",
|
||||||
"version": "1.7.7",
|
"version": "1.7.11",
|
||||||
"author": "就眠儀式",
|
"author": "就眠儀式",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "a component library for Vue 3 base on layui-vue",
|
"description": "a component library for Vue 3 base on layui-vue",
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
],
|
],
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"import": "./es/index.js"
|
"import": "./es/index.js",
|
||||||
|
"types": "./types/index.d.ts"
|
||||||
},
|
},
|
||||||
"./lib/": "./lib/",
|
"./lib/": "./lib/",
|
||||||
"./es/": "./es/"
|
"./es/": "./es/"
|
||||||
@@ -33,16 +34,19 @@
|
|||||||
"build:types": "rimraf types && tsc -d"
|
"build:types": "rimraf types && tsc -d"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@layui/icons-vue": "^1.0.9",
|
|
||||||
"@layui/layer-vue": "git+https://git.theluyuan.com/luyuan/layui-layer.git",
|
|
||||||
"@vueuse/core": "^9.2.0",
|
|
||||||
"@umijs/ssr-darkreader": "^4.9.45",
|
|
||||||
"@ctrl/tinycolor": "^3.4.1",
|
"@ctrl/tinycolor": "^3.4.1",
|
||||||
|
"@layui/icons-vue": "^1.0.9",
|
||||||
|
"@layui/layer-vue": "git+https://git.theluyuan.com/theluyuan/layui-layer.git",
|
||||||
|
"@layui/layui-vue": "file:",
|
||||||
|
"@umijs/ssr-darkreader": "^4.9.45",
|
||||||
|
"@vueuse/core": "^9.2.0",
|
||||||
"async-validator": "^4.1.1",
|
"async-validator": "^4.1.1",
|
||||||
"cropperjs": "^1.5.12",
|
"cropperjs": "^1.5.12",
|
||||||
"dayjs": "^1.11.0",
|
"dayjs": "^1.11.0",
|
||||||
"evtd": "^0.2.3",
|
"evtd": "^0.2.3",
|
||||||
"vue-i18n": "^9.1.10"
|
"js-image-compressor": "^2.0.0",
|
||||||
|
"vue-i18n": "^9.1.10",
|
||||||
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"lib",
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
:size="size"
|
:size="size"
|
||||||
@clear="onClear"
|
@clear="onClear"
|
||||||
></lay-input>
|
></lay-input>
|
||||||
<slot v-else></slot>
|
<div class="slot-area" v-else>
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="layui-cascader-panel">
|
<div class="layui-cascader-panel">
|
||||||
@@ -137,12 +139,19 @@ watch(
|
|||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
() => {
|
() => {
|
||||||
|
if (watchModelValue.value) {
|
||||||
if (props.modelValue === null || props.modelValue === "") {
|
if (props.modelValue === null || props.modelValue === "") {
|
||||||
onClear();
|
onClear();
|
||||||
|
} else {
|
||||||
|
updateDisplayByModelValue();
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
watchModelValue.value = true;
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const watchModelValue = ref(true);
|
||||||
const treeData = ref<any>([]);
|
const treeData = ref<any>([]);
|
||||||
const initTreeData = () => {
|
const initTreeData = () => {
|
||||||
let treeLvNum = getMaxFloor(props.options);
|
let treeLvNum = getMaxFloor(props.options);
|
||||||
@@ -159,31 +168,28 @@ const initTreeData = () => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateDisplayByModelValue();
|
||||||
|
};
|
||||||
|
|
||||||
|
function updateDisplayByModelValue() {
|
||||||
if (props.modelValue) {
|
if (props.modelValue) {
|
||||||
try {
|
try {
|
||||||
let valueData = props.modelValue.split(props.decollator);
|
let valueData = props.modelValue.split(props.decollator);
|
||||||
let data: any[] = [];
|
for (let index = 0; index < valueData.length; index++) {
|
||||||
for (let index = 0; index < treeData.value.length; index++) {
|
const element = valueData[index];
|
||||||
const element = treeData.value[index];
|
let selectIndex = treeData.value[index].data.findIndex(
|
||||||
const nowValue = valueData[index];
|
(e: { value: string }) => e.value === element
|
||||||
for (let i = 0; i < element.length; i++) {
|
);
|
||||||
const ele = element[i];
|
if (selectIndex == -1) {
|
||||||
if (nowValue === ele.value) {
|
break;
|
||||||
data.push(ele);
|
|
||||||
element.selectIndex = i;
|
|
||||||
}
|
}
|
||||||
|
selectBar(treeData.value[index].data[selectIndex], selectIndex, index);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
displayValue.value = data
|
|
||||||
.map((e) => {
|
|
||||||
return e.label;
|
|
||||||
})
|
|
||||||
.join(` ${props.decollator} `);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function getMaxFloor(treeData: any) {
|
function getMaxFloor(treeData: any) {
|
||||||
//let floor = 0;
|
//let floor = 0;
|
||||||
@@ -274,6 +280,7 @@ const selectBar = (item: any, selectIndex: number, parentIndex: number) => {
|
|||||||
return e.value;
|
return e.value;
|
||||||
})
|
})
|
||||||
.join(props.decollator);
|
.join(props.decollator);
|
||||||
|
watchModelValue.value = false;
|
||||||
emit("update:modelValue", value);
|
emit("update:modelValue", value);
|
||||||
let evt = {
|
let evt = {
|
||||||
display: displayValue.value,
|
display: displayValue.value,
|
||||||
|
|||||||
@@ -79,7 +79,9 @@
|
|||||||
width: 29px;
|
width: 29px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 1px solid var(--global-neutral-color-6);
|
border-top: 1px solid var(--global-neutral-color-6);
|
||||||
|
border-bottom: 1px solid var(--global-neutral-color-6);
|
||||||
|
border-right: 1px solid var(--global-neutral-color-6);
|
||||||
border-radius: 0 2px 2px 0;
|
border-radius: 0 2px 2px 0;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
|||||||
@@ -104,7 +104,10 @@ watch(
|
|||||||
|
|
||||||
//关闭回调
|
//关闭回调
|
||||||
const footOnOk = () => {
|
const footOnOk = () => {
|
||||||
emits("update:modelValue", Month.value ? Month.value : -1);
|
emits(
|
||||||
|
"update:modelValue",
|
||||||
|
Month.value || Month.value === 0 ? Month.value : -1
|
||||||
|
);
|
||||||
if (datePicker.range) {
|
if (datePicker.range) {
|
||||||
//关闭菜单
|
//关闭菜单
|
||||||
emits("ok");
|
emits("ok");
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ html #layuicss-laydate {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
input{
|
input{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0;
|
// padding: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.layui-input {
|
.layui-input {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import {
|
|||||||
cloneVNode,
|
cloneVNode,
|
||||||
useAttrs,
|
useAttrs,
|
||||||
StyleValue,
|
StyleValue,
|
||||||
PropType,
|
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
@@ -45,9 +44,8 @@ import {
|
|||||||
DropdownContext,
|
DropdownContext,
|
||||||
} from "./interface";
|
} from "./interface";
|
||||||
import TeleportWrapper from "../_components/teleportWrapper.vue";
|
import TeleportWrapper from "../_components/teleportWrapper.vue";
|
||||||
import { useFirstElement, isScrollElement, getScrollElements } from "./util";
|
import { useFirstElement, getScrollElements, transformPlacement } from "./util";
|
||||||
import RenderFunction, { RenderFunc } from "../_components/renderFunction";
|
import RenderFunction from "../_components/renderFunction";
|
||||||
import { transformPlacement } from "./util";
|
|
||||||
|
|
||||||
export type DropdownTrigger = "click" | "hover" | "focus" | "contextMenu";
|
export type DropdownTrigger = "click" | "hover" | "focus" | "contextMenu";
|
||||||
|
|
||||||
@@ -105,7 +103,6 @@ const dropdownCtx = inject<DropdownContext | undefined>(
|
|||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
const { children, firstElement: dropdownRef } = useFirstElement();
|
const { children, firstElement: dropdownRef } = useFirstElement();
|
||||||
//const dropdownRef = shallowRef<HTMLElement | undefined>();
|
|
||||||
const contentRef = shallowRef<HTMLElement | undefined>();
|
const contentRef = shallowRef<HTMLElement | undefined>();
|
||||||
const contentStyle = ref<CSSProperties>({});
|
const contentStyle = ref<CSSProperties>({});
|
||||||
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
||||||
|
|||||||
@@ -1,27 +1,12 @@
|
|||||||
import { DropdownPlacement } from "./interface";
|
import { DropdownPlacement } from "./interface";
|
||||||
|
|
||||||
import { Component, onMounted, onUpdated, ref, VNode, VNodeTypes } from "vue";
|
import { Component, onMounted, onUpdated, ref, VNode, VNodeTypes } from "vue";
|
||||||
|
import { isArrayChildren, isComponent, isElement } from "../../utils";
|
||||||
|
|
||||||
export interface SlotChildren {
|
export interface SlotChildren {
|
||||||
value?: VNode[];
|
value?: VNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quoted from arco-vue
|
|
||||||
// https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/_utils/vue-utils.ts
|
|
||||||
export enum ShapeFlags {
|
|
||||||
ELEMENT = 1,
|
|
||||||
FUNCTIONAL_COMPONENT = 1 << 1,
|
|
||||||
STATEFUL_COMPONENT = 1 << 2,
|
|
||||||
COMPONENT = ShapeFlags.STATEFUL_COMPONENT | ShapeFlags.FUNCTIONAL_COMPONENT,
|
|
||||||
TEXT_CHILDREN = 1 << 3,
|
|
||||||
ARRAY_CHILDREN = 1 << 4,
|
|
||||||
SLOTS_CHILDREN = 1 << 5,
|
|
||||||
TELEPORT = 1 << 6,
|
|
||||||
SUSPENSE = 1 << 7,
|
|
||||||
COMPONENT_SHOULD_KEEP_ALIVE = 1 << 8,
|
|
||||||
COMPONENT_KEPT_ALIVE = 1 << 9,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const isScrollElement = (element: HTMLElement) => {
|
export const isScrollElement = (element: HTMLElement) => {
|
||||||
return (
|
return (
|
||||||
element.scrollHeight > element.offsetHeight ||
|
element.scrollHeight > element.offsetHeight ||
|
||||||
@@ -41,24 +26,6 @@ export const getScrollElements = (container: HTMLElement | undefined) => {
|
|||||||
return scrollElements;
|
return scrollElements;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isElement = (vn: VNode) => {
|
|
||||||
return Boolean(vn && vn.shapeFlag & ShapeFlags.ELEMENT);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isComponent = (
|
|
||||||
vn: VNode,
|
|
||||||
type?: VNodeTypes
|
|
||||||
): type is Component => {
|
|
||||||
return Boolean(vn && vn.shapeFlag & ShapeFlags.COMPONENT);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isArrayChildren = (
|
|
||||||
vn: VNode,
|
|
||||||
children: VNode["children"]
|
|
||||||
): children is VNode[] => {
|
|
||||||
return Boolean(vn && vn.shapeFlag & ShapeFlags.ARRAY_CHILDREN);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getChildrenArray = (vn: VNode): VNode[] | undefined => {
|
export const getChildrenArray = (vn: VNode): VNode[] | undefined => {
|
||||||
if (isArrayChildren(vn, vn.children)) {
|
if (isArrayChildren(vn, vn.children)) {
|
||||||
return vn.children;
|
return vn.children;
|
||||||
@@ -140,6 +107,5 @@ export const transformPlacement = (
|
|||||||
placementMap[separated[1]] || separated[1]
|
placementMap[separated[1]] || separated[1]
|
||||||
}` as DropdownPlacement;
|
}` as DropdownPlacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
return placement;
|
return placement;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: rgba(0, 0, 0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down {
|
.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down {
|
||||||
@@ -151,6 +152,15 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layui-icon-picker-clear {
|
||||||
|
color: rgba(0, 0, 0, 0.45);
|
||||||
|
padding: 0px 0px 0px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-icon-picker-clear:hover {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
.layui-colorpicker-disabled {
|
.layui-colorpicker-disabled {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
@@ -159,3 +169,7 @@
|
|||||||
.layui-colorpicker-disabled * {
|
.layui-colorpicker-disabled * {
|
||||||
cursor: not-allowed !important;
|
cursor: not-allowed !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.transform{
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ export interface IconPickerProps {
|
|||||||
modelValue?: string;
|
modelValue?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
showSearch?: boolean;
|
showSearch?: boolean;
|
||||||
|
allowClear?: boolean;
|
||||||
contentClass?: string | Array<string | object> | object;
|
contentClass?: string | Array<string | object> | object;
|
||||||
contentStyle?: StyleValue;
|
contentStyle?: StyleValue;
|
||||||
}
|
}
|
||||||
@@ -30,6 +31,7 @@ const props = withDefaults(defineProps<IconPickerProps>(), {
|
|||||||
const emit = defineEmits(["update:modelValue", "change"]);
|
const emit = defineEmits(["update:modelValue", "change"]);
|
||||||
const selectedIcon = computed(() => props.modelValue);
|
const selectedIcon = computed(() => props.modelValue);
|
||||||
const dropdownRef = ref<any>(null);
|
const dropdownRef = ref<any>(null);
|
||||||
|
const openState = ref<boolean>(false);
|
||||||
|
|
||||||
const selectIcon = function (icon: string): void {
|
const selectIcon = function (icon: string): void {
|
||||||
emit("update:modelValue", icon);
|
emit("update:modelValue", icon);
|
||||||
@@ -37,6 +39,14 @@ const selectIcon = function (icon: string): void {
|
|||||||
dropdownRef.value?.hide();
|
dropdownRef.value?.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onClear = function (): void {
|
||||||
|
emit("update:modelValue", "");
|
||||||
|
};
|
||||||
|
|
||||||
|
const hasContent = computed(() => {
|
||||||
|
return props.modelValue != null && props.modelValue != "";
|
||||||
|
});
|
||||||
|
|
||||||
const icones: Ref = ref([]);
|
const icones: Ref = ref([]);
|
||||||
const total: Ref<number> = ref(icons.length);
|
const total: Ref<number> = ref(icons.length);
|
||||||
const totalPage: Ref<number> = ref(total.value / 12);
|
const totalPage: Ref<number> = ref(total.value / 12);
|
||||||
@@ -143,6 +153,8 @@ const searchList = (str: string, container: any) => {
|
|||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:contentClass="contentClass"
|
:contentClass="contentClass"
|
||||||
:contentStyle="contentStyle"
|
:contentStyle="contentStyle"
|
||||||
|
@hide="openState = false"
|
||||||
|
@show="openState = true"
|
||||||
updateAtScroll
|
updateAtScroll
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -152,8 +164,17 @@ const searchList = (str: string, container: any) => {
|
|||||||
<div class="layui-inline layui-iconpicker-main">
|
<div class="layui-inline layui-iconpicker-main">
|
||||||
<i class="layui-inline layui-icon" :class="[selectedIcon]"></i>
|
<i class="layui-inline layui-icon" :class="[selectedIcon]"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<span
|
||||||
|
class="layui-icon-picker-clear"
|
||||||
|
v-if="allowClear && hasContent && !disabled"
|
||||||
|
>
|
||||||
|
<lay-icon type="layui-icon-close-fill" @click.stop="onClear"></lay-icon>
|
||||||
|
</span>
|
||||||
<span class="layui-inline layui-iconpicker-suffix"
|
<span class="layui-inline layui-iconpicker-suffix"
|
||||||
><i class="layui-icon layui-icon-down layui-anim"></i
|
><i
|
||||||
|
class="layui-icon layui-icon-down"
|
||||||
|
:class="[openState ? 'transform' : '']"
|
||||||
|
></i
|
||||||
></span>
|
></span>
|
||||||
</div>
|
</div>
|
||||||
<template #content>
|
<template #content>
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ export interface InputProps {
|
|||||||
maxlength?: number;
|
maxlength?: number;
|
||||||
max?: number;
|
max?: number;
|
||||||
min?: number;
|
min?: number;
|
||||||
|
qfw?: boolean;
|
||||||
|
align?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<InputProps>(), {
|
const props = withDefaults(defineProps<InputProps>(), {
|
||||||
@@ -39,6 +41,8 @@ const props = withDefaults(defineProps<InputProps>(), {
|
|||||||
password: false,
|
password: false,
|
||||||
modelValue: "",
|
modelValue: "",
|
||||||
size: "md",
|
size: "md",
|
||||||
|
qfw: false,
|
||||||
|
align: "left",
|
||||||
});
|
});
|
||||||
|
|
||||||
interface InputEmits {
|
interface InputEmits {
|
||||||
@@ -61,16 +65,52 @@ const hasContent = computed(() => (props.modelValue as string)?.length > 0);
|
|||||||
const isPassword = computed(() => type.value == "password");
|
const isPassword = computed(() => type.value == "password");
|
||||||
const composing = ref(false);
|
const composing = ref(false);
|
||||||
|
|
||||||
|
const formatMoney = function (s: string) {
|
||||||
|
if (s == "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
var noNegative = true;
|
||||||
|
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||||
|
if (parseFloat(s) < 0) {
|
||||||
|
s = Math.abs(parseFloat(s)) + "";
|
||||||
|
noNegative = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var l = s.split(".")[0].split("").reverse(),
|
||||||
|
r = s.split(".")[1];
|
||||||
|
var t = "";
|
||||||
|
for (let i = 0; i < l.length; i++) {
|
||||||
|
if (i % 3 == 2 && i != l.length - 1) {
|
||||||
|
t += l[i] + ",";
|
||||||
|
} else {
|
||||||
|
t += l[i] + ""; //加上空格
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let z: any = (noNegative ? "" : "-") + t.split("").reverse().join("");
|
||||||
|
// z = isNaN(z) ? 0 : z;
|
||||||
|
if (r) {
|
||||||
|
return z + "." + r;
|
||||||
|
} else {
|
||||||
|
return isNaN(parseInt(z)) ? 0 : z;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.type,
|
() => props.type,
|
||||||
() => {
|
() => {
|
||||||
type.value = props.type;
|
type.value = props.type;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const input: any = ref<Element>();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
() => {
|
() => {
|
||||||
|
console.log(input);
|
||||||
|
if (!(input.value == document.activeElement) && props.qfw) {
|
||||||
|
currentValue.value = formatMoney(props.modelValue.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
currentValue.value = String(
|
currentValue.value = String(
|
||||||
props.modelValue == null ? "" : props.modelValue
|
props.modelValue == null ? "" : props.modelValue
|
||||||
);
|
);
|
||||||
@@ -79,9 +119,12 @@ watch(
|
|||||||
|
|
||||||
const onInput = function (event: Event) {
|
const onInput = function (event: Event) {
|
||||||
const inputElement = event.target as HTMLInputElement;
|
const inputElement = event.target as HTMLInputElement;
|
||||||
const value = inputElement.value;
|
let value = inputElement.value;
|
||||||
emit("input", value);
|
emit("input", value);
|
||||||
if (composing.value) return;
|
if (composing.value) return;
|
||||||
|
if (props.qfw) {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
emit("update:modelValue", value);
|
emit("update:modelValue", value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -91,12 +134,16 @@ const onClear = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFocus = (event: Event) => {
|
const onFocus = (event: Event) => {
|
||||||
|
currentValue.value = new String(props.modelValue).replace(/,/g, "");
|
||||||
emit("focus", event);
|
emit("focus", event);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (event: Event) => {
|
const onChange = (event: Event) => {
|
||||||
const inputElement = event.target as HTMLInputElement;
|
const inputElement = event.target as HTMLInputElement;
|
||||||
const value = inputElement.value;
|
let value = inputElement.value;
|
||||||
|
if (props.qfw) {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
emit("change", value);
|
emit("change", value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -104,6 +151,17 @@ const onBlur = (event: Event) => {
|
|||||||
if (props.type === "number") {
|
if (props.type === "number") {
|
||||||
onNumberBlur(event);
|
onNumberBlur(event);
|
||||||
}
|
}
|
||||||
|
if (props.qfw) {
|
||||||
|
try {
|
||||||
|
let reg = /\d{1,3}(?=(\d{3})+$)/g;
|
||||||
|
// new String(props.modelValue).replace(reg, '$&,');
|
||||||
|
console.log("添加,", formatMoney(props.modelValue.toString()));
|
||||||
|
currentValue.value = formatMoney(props.modelValue.toString());
|
||||||
|
} catch {
|
||||||
|
currentValue.value = "输入错误";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
emit("blur", event);
|
emit("blur", event);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -115,6 +173,9 @@ const onNumberBlur = (event: Event) => {
|
|||||||
if (props.max && props.max < Number(value)) value = props.max.toString();
|
if (props.max && props.max < Number(value)) value = props.max.toString();
|
||||||
if (props.min && props.min > Number(value)) value = props.min.toString();
|
if (props.min && props.min > Number(value)) value = props.min.toString();
|
||||||
}
|
}
|
||||||
|
if (props.qfw) {
|
||||||
|
value = value.replace(/,/g, "");
|
||||||
|
}
|
||||||
emit("update:modelValue", value);
|
emit("update:modelValue", value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -158,6 +219,9 @@ const showPassword = () => {
|
|||||||
></lay-icon>
|
></lay-icon>
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
|
:style="{
|
||||||
|
textAlign: align,
|
||||||
|
}"
|
||||||
:type="type"
|
:type="type"
|
||||||
:name="name"
|
:name="name"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@@ -175,6 +239,7 @@ const showPassword = () => {
|
|||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@compositionstart="onCompositionstart"
|
@compositionstart="onCompositionstart"
|
||||||
@compositionend="onCompositionend"
|
@compositionend="onCompositionend"
|
||||||
|
ref="input"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class="layui-input-password"
|
class="layui-input-password"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="lay-page-header">
|
<div class="lay-page-header">
|
||||||
<div class="lay-page-header__left" @click="emits('back')">
|
<div class="lay-page-header__left" @click="emits('back')">
|
||||||
<slot name="backIcon"
|
<slot :name="backIconSlotName"
|
||||||
><i class="layui-icon" :class="[backIcon]"></i
|
><i class="layui-icon" :class="[backIcon]"></i
|
||||||
></slot>
|
></slot>
|
||||||
<div class="lay-page-header__title">{{ backText }}</div>
|
<div class="lay-page-header__title">{{ backText }}</div>
|
||||||
@@ -19,7 +19,8 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSlots } from "vue";
|
import { convertSlotName } from "../../utils";
|
||||||
|
import { getCurrentInstance, useSlots } from "vue";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
export interface PageHeaderProps {
|
export interface PageHeaderProps {
|
||||||
@@ -34,6 +35,7 @@ const props = withDefaults(defineProps<PageHeaderProps>(), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(["back"]);
|
const emits = defineEmits(["back"]);
|
||||||
|
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
|
const instance = getCurrentInstance()!;
|
||||||
|
const backIconSlotName = convertSlotName(instance, "backIcon");
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
watch,
|
watch,
|
||||||
onUnmounted,
|
onUnmounted,
|
||||||
StyleValue,
|
StyleValue,
|
||||||
|
Fragment,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { LayIcon } from "@layui/icons-vue";
|
import { LayIcon } from "@layui/icons-vue";
|
||||||
import LayInput from "../input/index.vue";
|
import LayInput from "../input/index.vue";
|
||||||
@@ -25,12 +26,14 @@ import LayTagInput from "../tagInput/index.vue";
|
|||||||
import LayDropdown from "../dropdown/index.vue";
|
import LayDropdown from "../dropdown/index.vue";
|
||||||
import LaySelectOption, { SelectOptionProps } from "../selectOption/index.vue";
|
import LaySelectOption, { SelectOptionProps } from "../selectOption/index.vue";
|
||||||
import { SelectSize } from "./interface";
|
import { SelectSize } from "./interface";
|
||||||
|
import { isArrayChildren } from "../../utils";
|
||||||
|
|
||||||
export interface SelectProps {
|
export interface SelectProps {
|
||||||
name?: string;
|
name?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
searchPlaceholder?: string;
|
searchPlaceholder?: string;
|
||||||
|
searchMethod?: Function;
|
||||||
modelValue?: any;
|
modelValue?: any;
|
||||||
multiple?: boolean;
|
multiple?: boolean;
|
||||||
items?: SelectOptionProps[];
|
items?: SelectOptionProps[];
|
||||||
@@ -41,6 +44,7 @@ export interface SelectProps {
|
|||||||
showSearch?: boolean;
|
showSearch?: boolean;
|
||||||
contentClass?: string | Array<string | object> | object;
|
contentClass?: string | Array<string | object> | object;
|
||||||
contentStyle?: StyleValue;
|
contentStyle?: StyleValue;
|
||||||
|
position?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SelectEmits {
|
export interface SelectEmits {
|
||||||
@@ -58,6 +62,7 @@ const props = withDefaults(defineProps<SelectProps>(), {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
size: "md",
|
size: "md",
|
||||||
|
position: "top",
|
||||||
});
|
});
|
||||||
|
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
@@ -73,15 +78,13 @@ var timer: any;
|
|||||||
|
|
||||||
const getOption = (nodes: VNode[], newOptions: any[]) => {
|
const getOption = (nodes: VNode[], newOptions: any[]) => {
|
||||||
nodes?.map((item) => {
|
nodes?.map((item) => {
|
||||||
let component = item.type as Component;
|
if (isArrayChildren(item, item.children)) {
|
||||||
if (item.type.toString() == "Symbol(Fragment)") {
|
|
||||||
getOption(item.children as VNode[], newOptions);
|
getOption(item.children as VNode[], newOptions);
|
||||||
} else {
|
} else {
|
||||||
if (component.name == LaySelectOption.name) {
|
if ((item.type as Component).name == LaySelectOption.name) {
|
||||||
if (item.children) {
|
if (item.children) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const label = item.children.default()[0].children;
|
const label = item.children.default()[0].children;
|
||||||
|
|
||||||
if (typeof label == "string") {
|
if (typeof label == "string") {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
item.props.label = label;
|
item.props.label = label;
|
||||||
@@ -122,7 +125,6 @@ const onCompositionend = (event: Event) => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
intOption();
|
intOption();
|
||||||
timer = setInterval(intOption, 500);
|
timer = setInterval(intOption, 500);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[selectedValue, options],
|
[selectedValue, options],
|
||||||
() => {
|
() => {
|
||||||
@@ -178,11 +180,17 @@ const handleClear = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleHide = () => {
|
||||||
|
searchValue.value = "";
|
||||||
|
openState.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
provide("selectRef", selectRef);
|
provide("selectRef", selectRef);
|
||||||
provide("openState", openState);
|
provide("openState", openState);
|
||||||
provide("selectedValue", selectedValue);
|
provide("selectedValue", selectedValue);
|
||||||
provide("searchValue", searchValue);
|
provide("searchValue", searchValue);
|
||||||
provide("multiple", multiple);
|
provide("multiple", multiple);
|
||||||
|
provide("searchMethod", props.searchMethod);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -194,22 +202,28 @@ provide("multiple", multiple);
|
|||||||
:contentStyle="contentStyle"
|
:contentStyle="contentStyle"
|
||||||
:update-at-scroll="true"
|
:update-at-scroll="true"
|
||||||
:autoFitWidth="true"
|
:autoFitWidth="true"
|
||||||
@hide="openState = false"
|
@hide="handleHide"
|
||||||
@show="openState = true"
|
@show="openState = true"
|
||||||
>
|
>
|
||||||
<lay-tag-input
|
<lay-tag-input
|
||||||
v-if="multiple"
|
v-if="multiple"
|
||||||
v-model="multipleValue"
|
v-model="multipleValue"
|
||||||
|
v-model:input-value="searchValue"
|
||||||
:allow-clear="allowClear"
|
:allow-clear="allowClear"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:collapseTagsTooltip="collapseTagsTooltip"
|
:collapseTagsTooltip="collapseTagsTooltip"
|
||||||
:minCollapsedNum="minCollapsedNum"
|
:minCollapsedNum="minCollapsedNum"
|
||||||
:disabledInput="true"
|
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
:disabledInput="!showSearch"
|
||||||
:size="size"
|
:size="size"
|
||||||
:class="{ 'layui-unselect': true }"
|
:class="{ 'layui-unselect': true }"
|
||||||
|
:position="position"
|
||||||
@remove="handleRemove"
|
@remove="handleRemove"
|
||||||
@clear="handleClear"
|
@clear="handleClear"
|
||||||
|
@input-value-change="handleSearch"
|
||||||
|
@keyup.delete.capture.prevent.stop
|
||||||
|
@keyup.backspace.capture.prevent.stop
|
||||||
|
@keydown.enter.capture.prevent.stop
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<lay-icon
|
<lay-icon
|
||||||
@@ -220,13 +234,13 @@ provide("multiple", multiple);
|
|||||||
</lay-tag-input>
|
</lay-tag-input>
|
||||||
<lay-input
|
<lay-input
|
||||||
v-else
|
v-else
|
||||||
:modelValue="singleValue"
|
|
||||||
:placeholder="placeholder"
|
|
||||||
:allow-clear="allowClear"
|
|
||||||
:readonly="!showSearch"
|
|
||||||
:disabled="disabled"
|
|
||||||
:class="{ 'layui-unselect': !showSearch }"
|
|
||||||
:size="size"
|
:size="size"
|
||||||
|
:disabled="disabled"
|
||||||
|
:readonly="!showSearch"
|
||||||
|
:modelValue="singleValue"
|
||||||
|
:allow-clear="allowClear"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:class="{ 'layui-unselect': !showSearch }"
|
||||||
@compositionstart="onCompositionstart"
|
@compositionstart="onCompositionstart"
|
||||||
@compositionend="onCompositionend"
|
@compositionend="onCompositionend"
|
||||||
@Input="handleSearch"
|
@Input="handleSearch"
|
||||||
@@ -241,17 +255,6 @@ provide("multiple", multiple);
|
|||||||
</lay-input>
|
</lay-input>
|
||||||
<template #content>
|
<template #content>
|
||||||
<dl class="layui-select-content">
|
<dl class="layui-select-content">
|
||||||
<div class="layui-select-search" v-if="multiple && showSearch">
|
|
||||||
<lay-input
|
|
||||||
:modelValue="searchValue"
|
|
||||||
:placeholder="searchPlaceholder"
|
|
||||||
@Input="handleSearch"
|
|
||||||
@compositionstart="onCompositionstart"
|
|
||||||
@compositionend="onCompositionend"
|
|
||||||
prefix-icon="layui-icon-search"
|
|
||||||
size="sm"
|
|
||||||
></lay-input>
|
|
||||||
</div>
|
|
||||||
<template v-if="items">
|
<template v-if="items">
|
||||||
<lay-select-option
|
<lay-select-option
|
||||||
v-for="(item, index) in items"
|
v-for="(item, index) in items"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user