element-ps 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +251 -183
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +252 -184
- package/es/components/button/index.d.ts +4 -0
- package/es/components/button/src/button.d.ts +1 -0
- package/es/components/button/src/button.vue.d.ts +4 -0
- package/es/index.mjs +5 -5
- package/es/packages/components/badge/index.mjs +2 -2
- package/es/packages/components/badge/src/badge.mjs +20 -5
- package/es/packages/components/badge/src/badge.mjs.map +1 -1
- package/es/packages/components/badge/src/badge.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/badge/src/badge2.mjs +5 -20
- package/es/packages/components/badge/src/badge2.mjs.map +1 -1
- package/es/packages/components/breadcrumb/index.mjs +2 -2
- package/es/packages/components/breadcrumb/src/breadcrumb.mjs +13 -5
- package/es/packages/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/packages/components/breadcrumb/src/breadcrumb.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/breadcrumb/src/breadcrumb2.mjs +5 -13
- package/es/packages/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/packages/components/button/index.mjs +3 -3
- package/es/packages/components/button/src/button-group.mjs +5 -7
- package/es/packages/components/button/src/button-group.mjs.map +1 -1
- package/es/packages/components/button/src/button-group.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/button/src/button-group2.mjs +7 -5
- package/es/packages/components/button/src/button-group2.mjs.map +1 -1
- package/es/packages/components/button/src/button.mjs +46 -5
- package/es/packages/components/button/src/button.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs +40 -1
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.mjs +4 -3
- package/es/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.mjs.map +1 -1
- package/es/packages/components/button/src/button2.mjs +5 -45
- package/es/packages/components/button/src/button2.mjs.map +1 -1
- package/es/packages/components/image/index.mjs +2 -2
- package/es/packages/components/image/src/image.mjs +44 -5
- package/es/packages/components/image/src/image.mjs.map +1 -1
- package/es/packages/components/image/src/image.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/image/src/image2.mjs +5 -44
- package/es/packages/components/image/src/image2.mjs.map +1 -1
- package/es/packages/components/index.mjs +5 -5
- package/es/packages/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/packages/components/tag/index.mjs +2 -2
- package/es/packages/components/tag/src/tag.mjs +26 -5
- package/es/packages/components/tag/src/tag.mjs.map +1 -1
- package/es/packages/components/tag/src/tag.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/tag/src/tag2.mjs +5 -26
- package/es/packages/components/tag/src/tag2.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/button/index.d.ts +4 -0
- package/lib/components/button/src/button.d.ts +1 -0
- package/lib/components/button/src/button.vue.d.ts +4 -0
- package/lib/index.js +5 -5
- package/lib/packages/components/badge/index.js +2 -2
- package/lib/packages/components/badge/src/badge.js +19 -5
- package/lib/packages/components/badge/src/badge.js.map +1 -1
- package/lib/packages/components/badge/src/badge.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/badge/src/badge2.js +5 -19
- package/lib/packages/components/badge/src/badge2.js.map +1 -1
- package/lib/packages/components/breadcrumb/index.js +2 -2
- package/lib/packages/components/breadcrumb/src/breadcrumb.js +12 -5
- package/lib/packages/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/packages/components/breadcrumb/src/breadcrumb.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/breadcrumb/src/breadcrumb2.js +5 -12
- package/lib/packages/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/packages/components/button/index.js +3 -3
- package/lib/packages/components/button/src/button-group.js +5 -6
- package/lib/packages/components/button/src/button-group.js.map +1 -1
- package/lib/packages/components/button/src/button-group.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/button/src/button-group2.js +6 -5
- package/lib/packages/components/button/src/button-group2.js.map +1 -1
- package/lib/packages/components/button/src/button.js +49 -5
- package/lib/packages/components/button/src/button.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js +40 -1
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js +3 -2
- package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js.map +1 -1
- package/lib/packages/components/button/src/button2.js +5 -48
- package/lib/packages/components/button/src/button2.js.map +1 -1
- package/lib/packages/components/image/index.js +2 -2
- package/lib/packages/components/image/src/image.js +44 -5
- package/lib/packages/components/image/src/image.js.map +1 -1
- package/lib/packages/components/image/src/image.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/image/src/image2.js +5 -44
- package/lib/packages/components/image/src/image2.js.map +1 -1
- package/lib/packages/components/index.js +5 -5
- package/lib/packages/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/packages/components/tag/index.js +2 -2
- package/lib/packages/components/tag/src/tag.js +25 -5
- package/lib/packages/components/tag/src/tag.js.map +1 -1
- package/lib/packages/components/tag/src/tag.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/tag/src/tag2.js +5 -25
- package/lib/packages/components/tag/src/tag2.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
package/dist/index.full.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Element Plus v1.0.
|
|
1
|
+
/*! Element Plus v1.0.6 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -3124,7 +3124,7 @@
|
|
|
3124
3124
|
return vue.inject(configProviderContextKey, defaultConfig);
|
|
3125
3125
|
};
|
|
3126
3126
|
|
|
3127
|
-
const version$1 = "1.0.
|
|
3127
|
+
const version$1 = "1.0.6";
|
|
3128
3128
|
|
|
3129
3129
|
const makeInstaller = (components = []) => {
|
|
3130
3130
|
const apps = [];
|
|
@@ -5273,6 +5273,214 @@
|
|
|
5273
5273
|
});
|
|
5274
5274
|
const PsBreadcrumbItem = withNoopInstall(script$1w);
|
|
5275
5275
|
|
|
5276
|
+
function tryOnScopeDispose(fn) {
|
|
5277
|
+
if (vue.getCurrentScope()) {
|
|
5278
|
+
vue.onScopeDispose(fn);
|
|
5279
|
+
return true;
|
|
5280
|
+
}
|
|
5281
|
+
return false;
|
|
5282
|
+
}
|
|
5283
|
+
|
|
5284
|
+
const isClient = typeof window !== "undefined";
|
|
5285
|
+
const isString = (val) => typeof val === "string";
|
|
5286
|
+
const noop = () => {
|
|
5287
|
+
};
|
|
5288
|
+
|
|
5289
|
+
function createFilterWrapper(filter, fn) {
|
|
5290
|
+
function wrapper(...args) {
|
|
5291
|
+
filter(() => fn.apply(this, args), { fn, thisArg: this, args });
|
|
5292
|
+
}
|
|
5293
|
+
return wrapper;
|
|
5294
|
+
}
|
|
5295
|
+
function throttleFilter(ms, trailing = true, leading = true) {
|
|
5296
|
+
let lastExec = 0;
|
|
5297
|
+
let timer;
|
|
5298
|
+
let preventLeading = !leading;
|
|
5299
|
+
const clear = () => {
|
|
5300
|
+
if (timer) {
|
|
5301
|
+
clearTimeout(timer);
|
|
5302
|
+
timer = void 0;
|
|
5303
|
+
}
|
|
5304
|
+
};
|
|
5305
|
+
const filter = (invoke) => {
|
|
5306
|
+
const duration = vue.unref(ms);
|
|
5307
|
+
const elapsed = Date.now() - lastExec;
|
|
5308
|
+
clear();
|
|
5309
|
+
if (duration <= 0) {
|
|
5310
|
+
lastExec = Date.now();
|
|
5311
|
+
return invoke();
|
|
5312
|
+
}
|
|
5313
|
+
if (elapsed > duration) {
|
|
5314
|
+
lastExec = Date.now();
|
|
5315
|
+
if (preventLeading)
|
|
5316
|
+
preventLeading = false;
|
|
5317
|
+
else
|
|
5318
|
+
invoke();
|
|
5319
|
+
} else if (trailing) {
|
|
5320
|
+
timer = setTimeout(() => {
|
|
5321
|
+
lastExec = Date.now();
|
|
5322
|
+
if (!leading)
|
|
5323
|
+
preventLeading = true;
|
|
5324
|
+
clear();
|
|
5325
|
+
invoke();
|
|
5326
|
+
}, duration);
|
|
5327
|
+
}
|
|
5328
|
+
if (!leading && !timer)
|
|
5329
|
+
timer = setTimeout(() => preventLeading = true, duration);
|
|
5330
|
+
};
|
|
5331
|
+
return filter;
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5334
|
+
function useThrottleFn(fn, ms = 200, trailing = true, leading = true) {
|
|
5335
|
+
return createFilterWrapper(throttleFilter(ms, trailing, leading), fn);
|
|
5336
|
+
}
|
|
5337
|
+
|
|
5338
|
+
function useTimeoutFn(cb, interval, options = {}) {
|
|
5339
|
+
const {
|
|
5340
|
+
immediate = true
|
|
5341
|
+
} = options;
|
|
5342
|
+
const isPending = vue.ref(false);
|
|
5343
|
+
let timer = null;
|
|
5344
|
+
function clear() {
|
|
5345
|
+
if (timer) {
|
|
5346
|
+
clearTimeout(timer);
|
|
5347
|
+
timer = null;
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
function stop() {
|
|
5351
|
+
isPending.value = false;
|
|
5352
|
+
clear();
|
|
5353
|
+
}
|
|
5354
|
+
function start(...args) {
|
|
5355
|
+
clear();
|
|
5356
|
+
isPending.value = true;
|
|
5357
|
+
timer = setTimeout(() => {
|
|
5358
|
+
isPending.value = false;
|
|
5359
|
+
timer = null;
|
|
5360
|
+
cb(...args);
|
|
5361
|
+
}, vue.unref(interval));
|
|
5362
|
+
}
|
|
5363
|
+
if (immediate) {
|
|
5364
|
+
isPending.value = true;
|
|
5365
|
+
if (isClient)
|
|
5366
|
+
start();
|
|
5367
|
+
}
|
|
5368
|
+
tryOnScopeDispose(stop);
|
|
5369
|
+
return {
|
|
5370
|
+
isPending,
|
|
5371
|
+
start,
|
|
5372
|
+
stop
|
|
5373
|
+
};
|
|
5374
|
+
}
|
|
5375
|
+
|
|
5376
|
+
function unrefElement(elRef) {
|
|
5377
|
+
var _a;
|
|
5378
|
+
const plain = vue.unref(elRef);
|
|
5379
|
+
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
const defaultWindow = isClient ? window : void 0;
|
|
5383
|
+
isClient ? window.document : void 0;
|
|
5384
|
+
isClient ? window.navigator : void 0;
|
|
5385
|
+
|
|
5386
|
+
function useEventListener(...args) {
|
|
5387
|
+
let target;
|
|
5388
|
+
let event;
|
|
5389
|
+
let listener;
|
|
5390
|
+
let options;
|
|
5391
|
+
if (isString(args[0])) {
|
|
5392
|
+
[event, listener, options] = args;
|
|
5393
|
+
target = defaultWindow;
|
|
5394
|
+
} else {
|
|
5395
|
+
[target, event, listener, options] = args;
|
|
5396
|
+
}
|
|
5397
|
+
if (!target)
|
|
5398
|
+
return noop;
|
|
5399
|
+
let cleanup = noop;
|
|
5400
|
+
const stopWatch = vue.watch(() => vue.unref(target), (el) => {
|
|
5401
|
+
cleanup();
|
|
5402
|
+
if (!el)
|
|
5403
|
+
return;
|
|
5404
|
+
el.addEventListener(event, listener, options);
|
|
5405
|
+
cleanup = () => {
|
|
5406
|
+
el.removeEventListener(event, listener, options);
|
|
5407
|
+
cleanup = noop;
|
|
5408
|
+
};
|
|
5409
|
+
}, { immediate: true, flush: "post" });
|
|
5410
|
+
const stop = () => {
|
|
5411
|
+
stopWatch();
|
|
5412
|
+
cleanup();
|
|
5413
|
+
};
|
|
5414
|
+
tryOnScopeDispose(stop);
|
|
5415
|
+
return stop;
|
|
5416
|
+
}
|
|
5417
|
+
|
|
5418
|
+
function useCssVar(prop, target, { window = defaultWindow } = {}) {
|
|
5419
|
+
const variable = vue.ref("");
|
|
5420
|
+
const elRef = vue.computed(() => {
|
|
5421
|
+
var _a;
|
|
5422
|
+
return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
|
|
5423
|
+
});
|
|
5424
|
+
vue.watch(elRef, (el) => {
|
|
5425
|
+
if (el && window)
|
|
5426
|
+
variable.value = window.getComputedStyle(el).getPropertyValue(prop);
|
|
5427
|
+
}, { immediate: true });
|
|
5428
|
+
vue.watch(variable, (val) => {
|
|
5429
|
+
var _a;
|
|
5430
|
+
if ((_a = elRef.value) == null ? void 0 : _a.style)
|
|
5431
|
+
elRef.value.style.setProperty(prop, val);
|
|
5432
|
+
});
|
|
5433
|
+
return variable;
|
|
5434
|
+
}
|
|
5435
|
+
|
|
5436
|
+
var SwipeDirection;
|
|
5437
|
+
(function(SwipeDirection2) {
|
|
5438
|
+
SwipeDirection2["UP"] = "UP";
|
|
5439
|
+
SwipeDirection2["RIGHT"] = "RIGHT";
|
|
5440
|
+
SwipeDirection2["DOWN"] = "DOWN";
|
|
5441
|
+
SwipeDirection2["LEFT"] = "LEFT";
|
|
5442
|
+
SwipeDirection2["NONE"] = "NONE";
|
|
5443
|
+
})(SwipeDirection || (SwipeDirection = {}));
|
|
5444
|
+
|
|
5445
|
+
function calcColorChannels(c) {
|
|
5446
|
+
let rawColor = c.replace("#", "");
|
|
5447
|
+
if (/^[0-9a-fA-F]{3}$/.test(rawColor)) {
|
|
5448
|
+
rawColor = rawColor[0].repeat(2) + rawColor[1].repeat(2) + rawColor[2].repeat(2);
|
|
5449
|
+
}
|
|
5450
|
+
if (/^[0-9a-fA-F]{6}$/.test(rawColor)) {
|
|
5451
|
+
return {
|
|
5452
|
+
red: parseInt(rawColor.slice(0, 2), 16),
|
|
5453
|
+
green: parseInt(rawColor.slice(2, 4), 16),
|
|
5454
|
+
blue: parseInt(rawColor.slice(4, 6), 16)
|
|
5455
|
+
};
|
|
5456
|
+
}
|
|
5457
|
+
return {
|
|
5458
|
+
red: 255,
|
|
5459
|
+
green: 255,
|
|
5460
|
+
blue: 255
|
|
5461
|
+
};
|
|
5462
|
+
}
|
|
5463
|
+
function mixColor(color, percent = 0.2) {
|
|
5464
|
+
let { red, green, blue } = calcColorChannels(color);
|
|
5465
|
+
if (percent > 0) {
|
|
5466
|
+
red *= 1 - percent;
|
|
5467
|
+
green *= 1 - percent;
|
|
5468
|
+
blue *= 1 - percent;
|
|
5469
|
+
} else {
|
|
5470
|
+
const value = Math.abs(percent);
|
|
5471
|
+
red += (255 - red) * Math.abs(percent);
|
|
5472
|
+
green += (255 - green) * value;
|
|
5473
|
+
blue += (255 - blue) * value;
|
|
5474
|
+
}
|
|
5475
|
+
return `rgb(${Math.round(red)}, ${Math.round(green)}, ${Math.round(blue)})`;
|
|
5476
|
+
}
|
|
5477
|
+
function lighten(color, percent = 0.2) {
|
|
5478
|
+
return mixColor(color, -percent);
|
|
5479
|
+
}
|
|
5480
|
+
function darken(color, percent = 0.2) {
|
|
5481
|
+
return mixColor(color, percent);
|
|
5482
|
+
}
|
|
5483
|
+
|
|
5276
5484
|
const buttonType = [
|
|
5277
5485
|
"default",
|
|
5278
5486
|
"primary",
|
|
@@ -5306,6 +5514,7 @@
|
|
|
5306
5514
|
autofocus: Boolean,
|
|
5307
5515
|
round: Boolean,
|
|
5308
5516
|
circle: Boolean,
|
|
5517
|
+
color: String,
|
|
5309
5518
|
autoInsertSpace: {
|
|
5310
5519
|
type: Boolean
|
|
5311
5520
|
}
|
|
@@ -5344,7 +5553,44 @@
|
|
|
5344
5553
|
size: vue.computed(() => elBtnGroup == null ? void 0 : elBtnGroup.size)
|
|
5345
5554
|
});
|
|
5346
5555
|
const buttonType = vue.computed(() => props.type || (elBtnGroup == null ? void 0 : elBtnGroup.type) || "default");
|
|
5556
|
+
const typeColor = vue.computed(() => useCssVar(`--el-color-${props.type}`).value);
|
|
5557
|
+
const buttonStyle = vue.computed(() => {
|
|
5558
|
+
let styles = {};
|
|
5559
|
+
const buttonColor = props.color || typeColor.value;
|
|
5560
|
+
if (buttonColor) {
|
|
5561
|
+
const darkenBgColor = darken(buttonColor, 0.1);
|
|
5562
|
+
if (props.plain) {
|
|
5563
|
+
styles = {
|
|
5564
|
+
"--el-button-bg-color": lighten(buttonColor, 0.9),
|
|
5565
|
+
"--el-button-text-color": buttonColor,
|
|
5566
|
+
"--el-button-hover-text-color": "var(--el-color-white)",
|
|
5567
|
+
"--el-button-hover-bg-color": buttonColor,
|
|
5568
|
+
"--el-button-hover-border-color": buttonColor,
|
|
5569
|
+
"--el-button-active-bg-color": darkenBgColor,
|
|
5570
|
+
"--el-button-active-text-color": "var(--el-color-white)",
|
|
5571
|
+
"--el-button-active-border-color": darkenBgColor
|
|
5572
|
+
};
|
|
5573
|
+
} else {
|
|
5574
|
+
const lightenBgColor = lighten(buttonColor);
|
|
5575
|
+
styles = {
|
|
5576
|
+
"--el-button-bg-color": buttonColor,
|
|
5577
|
+
"--el-button-border-color": buttonColor,
|
|
5578
|
+
"--el-button-hover-bg-color": lightenBgColor,
|
|
5579
|
+
"--el-button-hover-border-color": lightenBgColor,
|
|
5580
|
+
"--el-button-active-bg-color": darkenBgColor,
|
|
5581
|
+
"--el-button-active-border-color": darkenBgColor
|
|
5582
|
+
};
|
|
5583
|
+
}
|
|
5584
|
+
if (buttonDisabled.value) {
|
|
5585
|
+
const disabledButtonColor = lighten(buttonColor, 0.5);
|
|
5586
|
+
styles["--el-button-disabled-bg-color"] = disabledButtonColor;
|
|
5587
|
+
styles["--el-button-disabled-border-color"] = disabledButtonColor;
|
|
5588
|
+
}
|
|
5589
|
+
}
|
|
5590
|
+
return styles;
|
|
5591
|
+
});
|
|
5347
5592
|
return {
|
|
5593
|
+
buttonStyle,
|
|
5348
5594
|
buttonSize,
|
|
5349
5595
|
buttonType,
|
|
5350
5596
|
buttonDisabled,
|
|
@@ -5372,7 +5618,8 @@
|
|
|
5372
5618
|
]),
|
|
5373
5619
|
disabled: _ctx.buttonDisabled || _ctx.loading,
|
|
5374
5620
|
autofocus: _ctx.autofocus,
|
|
5375
|
-
type: _ctx.nativeType
|
|
5621
|
+
type: _ctx.nativeType,
|
|
5622
|
+
style: vue.normalizeStyle(_ctx.buttonStyle)
|
|
5376
5623
|
}, [
|
|
5377
5624
|
_ctx.loading ? (vue.openBlock(), vue.createBlock(_component_ps_icon, {
|
|
5378
5625
|
key: 0,
|
|
@@ -5394,7 +5641,7 @@
|
|
|
5394
5641
|
}, [
|
|
5395
5642
|
vue.renderSlot(_ctx.$slots, "default")
|
|
5396
5643
|
], 2)) : vue.createCommentVNode("v-if", true)
|
|
5397
|
-
],
|
|
5644
|
+
], 14, _hoisted_1$11);
|
|
5398
5645
|
}
|
|
5399
5646
|
|
|
5400
5647
|
script$1v.render = render$1o;
|
|
@@ -10552,149 +10799,6 @@
|
|
|
10552
10799
|
}
|
|
10553
10800
|
});
|
|
10554
10801
|
|
|
10555
|
-
function tryOnScopeDispose(fn) {
|
|
10556
|
-
if (vue.getCurrentScope()) {
|
|
10557
|
-
vue.onScopeDispose(fn);
|
|
10558
|
-
return true;
|
|
10559
|
-
}
|
|
10560
|
-
return false;
|
|
10561
|
-
}
|
|
10562
|
-
|
|
10563
|
-
const isClient = typeof window !== "undefined";
|
|
10564
|
-
const isString = (val) => typeof val === "string";
|
|
10565
|
-
const noop = () => {
|
|
10566
|
-
};
|
|
10567
|
-
|
|
10568
|
-
function createFilterWrapper(filter, fn) {
|
|
10569
|
-
function wrapper(...args) {
|
|
10570
|
-
filter(() => fn.apply(this, args), { fn, thisArg: this, args });
|
|
10571
|
-
}
|
|
10572
|
-
return wrapper;
|
|
10573
|
-
}
|
|
10574
|
-
function throttleFilter(ms, trailing = true, leading = true) {
|
|
10575
|
-
let lastExec = 0;
|
|
10576
|
-
let timer;
|
|
10577
|
-
let preventLeading = !leading;
|
|
10578
|
-
const clear = () => {
|
|
10579
|
-
if (timer) {
|
|
10580
|
-
clearTimeout(timer);
|
|
10581
|
-
timer = void 0;
|
|
10582
|
-
}
|
|
10583
|
-
};
|
|
10584
|
-
const filter = (invoke) => {
|
|
10585
|
-
const duration = vue.unref(ms);
|
|
10586
|
-
const elapsed = Date.now() - lastExec;
|
|
10587
|
-
clear();
|
|
10588
|
-
if (duration <= 0) {
|
|
10589
|
-
lastExec = Date.now();
|
|
10590
|
-
return invoke();
|
|
10591
|
-
}
|
|
10592
|
-
if (elapsed > duration) {
|
|
10593
|
-
lastExec = Date.now();
|
|
10594
|
-
if (preventLeading)
|
|
10595
|
-
preventLeading = false;
|
|
10596
|
-
else
|
|
10597
|
-
invoke();
|
|
10598
|
-
} else if (trailing) {
|
|
10599
|
-
timer = setTimeout(() => {
|
|
10600
|
-
lastExec = Date.now();
|
|
10601
|
-
if (!leading)
|
|
10602
|
-
preventLeading = true;
|
|
10603
|
-
clear();
|
|
10604
|
-
invoke();
|
|
10605
|
-
}, duration);
|
|
10606
|
-
}
|
|
10607
|
-
if (!leading && !timer)
|
|
10608
|
-
timer = setTimeout(() => preventLeading = true, duration);
|
|
10609
|
-
};
|
|
10610
|
-
return filter;
|
|
10611
|
-
}
|
|
10612
|
-
|
|
10613
|
-
function useThrottleFn(fn, ms = 200, trailing = true, leading = true) {
|
|
10614
|
-
return createFilterWrapper(throttleFilter(ms, trailing, leading), fn);
|
|
10615
|
-
}
|
|
10616
|
-
|
|
10617
|
-
function useTimeoutFn(cb, interval, options = {}) {
|
|
10618
|
-
const {
|
|
10619
|
-
immediate = true
|
|
10620
|
-
} = options;
|
|
10621
|
-
const isPending = vue.ref(false);
|
|
10622
|
-
let timer = null;
|
|
10623
|
-
function clear() {
|
|
10624
|
-
if (timer) {
|
|
10625
|
-
clearTimeout(timer);
|
|
10626
|
-
timer = null;
|
|
10627
|
-
}
|
|
10628
|
-
}
|
|
10629
|
-
function stop() {
|
|
10630
|
-
isPending.value = false;
|
|
10631
|
-
clear();
|
|
10632
|
-
}
|
|
10633
|
-
function start(...args) {
|
|
10634
|
-
clear();
|
|
10635
|
-
isPending.value = true;
|
|
10636
|
-
timer = setTimeout(() => {
|
|
10637
|
-
isPending.value = false;
|
|
10638
|
-
timer = null;
|
|
10639
|
-
cb(...args);
|
|
10640
|
-
}, vue.unref(interval));
|
|
10641
|
-
}
|
|
10642
|
-
if (immediate) {
|
|
10643
|
-
isPending.value = true;
|
|
10644
|
-
if (isClient)
|
|
10645
|
-
start();
|
|
10646
|
-
}
|
|
10647
|
-
tryOnScopeDispose(stop);
|
|
10648
|
-
return {
|
|
10649
|
-
isPending,
|
|
10650
|
-
start,
|
|
10651
|
-
stop
|
|
10652
|
-
};
|
|
10653
|
-
}
|
|
10654
|
-
|
|
10655
|
-
const defaultWindow = isClient ? window : void 0;
|
|
10656
|
-
|
|
10657
|
-
function useEventListener(...args) {
|
|
10658
|
-
let target;
|
|
10659
|
-
let event;
|
|
10660
|
-
let listener;
|
|
10661
|
-
let options;
|
|
10662
|
-
if (isString(args[0])) {
|
|
10663
|
-
[event, listener, options] = args;
|
|
10664
|
-
target = defaultWindow;
|
|
10665
|
-
} else {
|
|
10666
|
-
[target, event, listener, options] = args;
|
|
10667
|
-
}
|
|
10668
|
-
if (!target)
|
|
10669
|
-
return noop;
|
|
10670
|
-
let cleanup = noop;
|
|
10671
|
-
const stopWatch = vue.watch(() => vue.unref(target), (el) => {
|
|
10672
|
-
cleanup();
|
|
10673
|
-
if (!el)
|
|
10674
|
-
return;
|
|
10675
|
-
el.addEventListener(event, listener, options);
|
|
10676
|
-
cleanup = () => {
|
|
10677
|
-
el.removeEventListener(event, listener, options);
|
|
10678
|
-
cleanup = noop;
|
|
10679
|
-
};
|
|
10680
|
-
}, { immediate: true, flush: "post" });
|
|
10681
|
-
const stop = () => {
|
|
10682
|
-
stopWatch();
|
|
10683
|
-
cleanup();
|
|
10684
|
-
};
|
|
10685
|
-
tryOnScopeDispose(stop);
|
|
10686
|
-
return stop;
|
|
10687
|
-
}
|
|
10688
|
-
|
|
10689
|
-
var SwipeDirection;
|
|
10690
|
-
(function(SwipeDirection2) {
|
|
10691
|
-
SwipeDirection2["UP"] = "UP";
|
|
10692
|
-
SwipeDirection2["RIGHT"] = "RIGHT";
|
|
10693
|
-
SwipeDirection2["DOWN"] = "DOWN";
|
|
10694
|
-
SwipeDirection2["LEFT"] = "LEFT";
|
|
10695
|
-
SwipeDirection2["NONE"] = "NONE";
|
|
10696
|
-
})(SwipeDirection || (SwipeDirection = {}));
|
|
10697
|
-
|
|
10698
10802
|
const onTouchMove = (e) => {
|
|
10699
10803
|
e.preventDefault();
|
|
10700
10804
|
e.stopPropagation();
|
|
@@ -15280,42 +15384,6 @@
|
|
|
15280
15384
|
};
|
|
15281
15385
|
}
|
|
15282
15386
|
|
|
15283
|
-
function calcColorChannels(c) {
|
|
15284
|
-
let rawColor = c.replace("#", "");
|
|
15285
|
-
if (/^[0-9a-fA-F]{3}$/.test(rawColor)) {
|
|
15286
|
-
rawColor = rawColor[0].repeat(2) + rawColor[1].repeat(2) + rawColor[2].repeat(2);
|
|
15287
|
-
}
|
|
15288
|
-
if (/^[0-9a-fA-F]{6}$/.test(rawColor)) {
|
|
15289
|
-
return {
|
|
15290
|
-
red: parseInt(rawColor.slice(0, 2), 16),
|
|
15291
|
-
green: parseInt(rawColor.slice(2, 4), 16),
|
|
15292
|
-
blue: parseInt(rawColor.slice(4, 6), 16)
|
|
15293
|
-
};
|
|
15294
|
-
}
|
|
15295
|
-
return {
|
|
15296
|
-
red: 255,
|
|
15297
|
-
green: 255,
|
|
15298
|
-
blue: 255
|
|
15299
|
-
};
|
|
15300
|
-
}
|
|
15301
|
-
function mixColor(color, percent = 0.2) {
|
|
15302
|
-
let { red, green, blue } = calcColorChannels(color);
|
|
15303
|
-
if (percent > 0) {
|
|
15304
|
-
red *= 1 - percent;
|
|
15305
|
-
green *= 1 - percent;
|
|
15306
|
-
blue *= 1 - percent;
|
|
15307
|
-
} else {
|
|
15308
|
-
const value = Math.abs(percent);
|
|
15309
|
-
red += (255 - red) * Math.abs(percent);
|
|
15310
|
-
green += (255 - green) * value;
|
|
15311
|
-
blue += (255 - blue) * value;
|
|
15312
|
-
}
|
|
15313
|
-
return `rgb(${Math.round(red)}, ${Math.round(green)}, ${Math.round(blue)})`;
|
|
15314
|
-
}
|
|
15315
|
-
function darken(color, percent = 0.2) {
|
|
15316
|
-
return mixColor(color, percent);
|
|
15317
|
-
}
|
|
15318
|
-
|
|
15319
15387
|
function useMenuColor(props) {
|
|
15320
15388
|
const menuBarColor = vue.computed(() => {
|
|
15321
15389
|
const color = props.backgroundColor;
|