snail.vue 2.0.31 → 2.0.33
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/snail.vue.d.ts +160 -132
- package/dist/snail.vue.js +587 -524
- package/dist/snail.vue.umd.js +585 -522
- package/dist/styles/snail.vue.vue.css +9 -9
- package/package.json +3 -3
package/dist/snail.vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//@ sourceURL=/snail.vue.js
|
|
2
2
|
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, computed, mergeProps, unref, createElementVNode, toDisplayString, Fragment, renderList, mergeModels, useModel, normalizeStyle, createCommentVNode, createBlock, nextTick, useTemplateRef, shallowRef, createVNode, watch, withDirectives, isRef, vModelText, withCtx, createApp, resolveDynamicComponent, TransitionGroup, Transition, normalizeProps, guardReactiveProps, ref, onErrorCaptured, createSlots, onMounted, withModifiers, getCurrentInstance, resolveComponent, vShow, onBeforeUnmount, onActivated, getCurrentScope, onScopeDispose } from 'vue';
|
|
3
|
-
import { throwError, isObject, correctNumber, correctString, useKey, isArray,
|
|
4
|
-
import {
|
|
3
|
+
import { throwError, isObject, correctNumber, correctString, useKey, isArray, useScopes, mountScope, throwIfFalse, isPromise, wait, isNumberNotNaN, isStringNotEmpty, hasAny, mustFunction, useScope, removeFromArray, mustObject, isArrayNotEmpty, hasOwnProperty, isString, script, delay, useTimer, runAsync, defer, useAsyncScope, useHook, newId, throwIfTrue, isFunction, getDateValue, parseDate, formatDateValue, getDateByValue, getTimeNumber, parseDateValue, correctDateFormat, parseTimeValue, isValidTime, getFromArray, formatTimeValue, getTimeValue, padStart, isNullish, onMountScope } from 'snail.core';
|
|
4
|
+
import { css, link, useObserver, useScroll, useAnimation, useElastic } from 'snail.view';
|
|
5
5
|
|
|
6
6
|
const _hoisted_1$p = ["title"];
|
|
7
7
|
var _sfc_main$G = defineComponent({
|
|
@@ -31,10 +31,6 @@ var _sfc_main$G = defineComponent({
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
var addLink = href => setTimeout(link.register, 0, href);
|
|
35
|
-
|
|
36
|
-
addLink("/styles/snail.vue.vue.css");
|
|
37
|
-
|
|
38
34
|
function getBuiltinIcon(iconType) {
|
|
39
35
|
switch (iconType) {
|
|
40
36
|
case "success":
|
|
@@ -263,6 +259,10 @@ var _sfc_main$E = defineComponent({
|
|
|
263
259
|
}
|
|
264
260
|
});
|
|
265
261
|
|
|
262
|
+
var addLink = href => setTimeout(link.register, 0, href);
|
|
263
|
+
|
|
264
|
+
addLink("/styles/snail.vue.vue.css");
|
|
265
|
+
|
|
266
266
|
var _sfc_main$D = defineComponent({
|
|
267
267
|
...{
|
|
268
268
|
name: "Footer",
|
|
@@ -374,7 +374,7 @@ const _hoisted_3$9 = {
|
|
|
374
374
|
class: "input-body"
|
|
375
375
|
};
|
|
376
376
|
const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
|
|
377
|
-
const _hoisted_5$
|
|
377
|
+
const _hoisted_5$4 = ["title"];
|
|
378
378
|
var _sfc_main$B = defineComponent({
|
|
379
379
|
...{
|
|
380
380
|
name: "Input",
|
|
@@ -445,12 +445,13 @@ var _sfc_main$B = defineComponent({
|
|
|
445
445
|
button: "",
|
|
446
446
|
size: 16,
|
|
447
447
|
color: "red"
|
|
448
|
-
})], 8, _hoisted_5$
|
|
448
|
+
})], 8, _hoisted_5$4)) : createCommentVNode("", true)])], 2);
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
451
|
});
|
|
452
452
|
|
|
453
453
|
function useReactive() {
|
|
454
|
+
const scopes = useScopes();
|
|
454
455
|
function transition(rv, effect, time) {
|
|
455
456
|
throwIfFalse(isObject(effect), "transition: effect must be an object.");
|
|
456
457
|
const scope = scopes.get();
|
|
@@ -477,14 +478,17 @@ function useReactive() {
|
|
|
477
478
|
});
|
|
478
479
|
return scopes.get().onDestroy(stop);
|
|
479
480
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
481
|
+
{
|
|
482
|
+
const manager = mountScope({
|
|
483
|
+
transition,
|
|
484
|
+
load,
|
|
485
|
+
watcher
|
|
486
|
+
}, {
|
|
487
|
+
type: "IReactiveManager"
|
|
488
|
+
});
|
|
489
|
+
manager.onDestroy(scopes.destroy);
|
|
490
|
+
return Object.freeze(manager);
|
|
491
|
+
}
|
|
488
492
|
}
|
|
489
493
|
|
|
490
494
|
function useFormatter(options) {
|
|
@@ -646,7 +650,9 @@ function useFormatter(options) {
|
|
|
646
650
|
buildUpper,
|
|
647
651
|
buildThousands,
|
|
648
652
|
calcByStep
|
|
649
|
-
},
|
|
653
|
+
}, {
|
|
654
|
+
type: "INumberFormatter"
|
|
655
|
+
}));
|
|
650
656
|
return formatter;
|
|
651
657
|
}
|
|
652
658
|
|
|
@@ -660,8 +666,8 @@ const _hoisted_4$5 = {
|
|
|
660
666
|
key: 1,
|
|
661
667
|
class: "number-suffix"
|
|
662
668
|
};
|
|
663
|
-
const _hoisted_5$
|
|
664
|
-
const _hoisted_6$
|
|
669
|
+
const _hoisted_5$3 = ["textContent"];
|
|
670
|
+
const _hoisted_6$3 = ["title", "textContent"];
|
|
665
671
|
const _hoisted_7$1 = ["title", "textContent"];
|
|
666
672
|
var _sfc_main$A = defineComponent({
|
|
667
673
|
__name: "number",
|
|
@@ -862,12 +868,12 @@ var _sfc_main$A = defineComponent({
|
|
|
862
868
|
})])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$5, [createElementVNode("span", {
|
|
863
869
|
class: "ellipsis",
|
|
864
870
|
textContent: toDisplayString(unref(suffix))
|
|
865
|
-
}, null, 8, _hoisted_5$
|
|
871
|
+
}, null, 8, _hoisted_5$3)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
|
|
866
872
|
key: 2,
|
|
867
873
|
class: "number-util ellipsis",
|
|
868
874
|
title: upperTextRef.value,
|
|
869
875
|
textContent: toDisplayString(`大写:${upperTextRef.value || ""}`)
|
|
870
|
-
}, null, 8, _hoisted_6$
|
|
876
|
+
}, null, 8, _hoisted_6$3)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
|
|
871
877
|
key: 3,
|
|
872
878
|
class: "number-util ellipsis",
|
|
873
879
|
title: thousandsTextRef.value,
|
|
@@ -1607,6 +1613,11 @@ var _sfc_main$s = defineComponent({
|
|
|
1607
1613
|
onBeforeClose
|
|
1608
1614
|
});
|
|
1609
1615
|
let fn_onBuildData = void 0;
|
|
1616
|
+
let mousedownTarget = void 0;
|
|
1617
|
+
function onDialogRootClick(evt) {
|
|
1618
|
+
evt.target === mousedownTarget && __props.options.closeOnMask && closePopup();
|
|
1619
|
+
mousedownTarget = void 0;
|
|
1620
|
+
}
|
|
1610
1621
|
const registerBuildDataFunc = fn => {
|
|
1611
1622
|
mustFunction(fn, "fn");
|
|
1612
1623
|
fn_onBuildData = fn;
|
|
@@ -1624,6 +1635,7 @@ var _sfc_main$s = defineComponent({
|
|
|
1624
1635
|
onEvent(window, "keyup", event => {
|
|
1625
1636
|
event.key === "Escape" && __props.popupStatus.value == "active" && __props.options.closeOnEscape && closePopup();
|
|
1626
1637
|
});
|
|
1638
|
+
onEvent(window, "click", () => mousedownTarget = void 0);
|
|
1627
1639
|
});
|
|
1628
1640
|
return (_ctx, _cache) => {
|
|
1629
1641
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1631,9 +1643,8 @@ var _sfc_main$s = defineComponent({
|
|
|
1631
1643
|
style: normalizeStyle({
|
|
1632
1644
|
"z-index": __props.zIndex
|
|
1633
1645
|
}),
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
}, ["self"]))
|
|
1646
|
+
onMousedown: _cache[3] || (_cache[3] = withModifiers(evt => isRef(mousedownTarget) ? mousedownTarget.value = evt.target : mousedownTarget = evt.target, ["self"])),
|
|
1647
|
+
onClick: withModifiers(onDialogRootClick, ["self"])
|
|
1637
1648
|
}, [__props.options.wrapper == void 0 ? (openBlock(), createBlock(_sfc_main$v, mergeProps({
|
|
1638
1649
|
key: 0,
|
|
1639
1650
|
class: "dialog-body",
|
|
@@ -1665,7 +1676,7 @@ var _sfc_main$s = defineComponent({
|
|
|
1665
1676
|
"on-build-data": registerBuildDataFunc
|
|
1666
1677
|
}), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])]),
|
|
1667
1678
|
_: 1
|
|
1668
|
-
}, 16))],
|
|
1679
|
+
}, 16))], 38);
|
|
1669
1680
|
};
|
|
1670
1681
|
}
|
|
1671
1682
|
});
|
|
@@ -1911,13 +1922,17 @@ var _sfc_main$p = defineComponent({
|
|
|
1911
1922
|
}
|
|
1912
1923
|
});
|
|
1913
1924
|
|
|
1914
|
-
function usePopup() {
|
|
1915
|
-
|
|
1916
|
-
|
|
1925
|
+
function usePopup(options) {
|
|
1926
|
+
const global = options ? options.global : false;
|
|
1927
|
+
const scopes = useScopes({
|
|
1928
|
+
global
|
|
1929
|
+
});
|
|
1930
|
+
function popup(options2) {
|
|
1931
|
+
const scope = checkOptions(options2, checkPopup) || popupInCustomContainer(_sfc_main$q, options2);
|
|
1917
1932
|
return addScope2Scopes(scope);
|
|
1918
1933
|
}
|
|
1919
|
-
function dialog(
|
|
1920
|
-
var scope = checkOptions(
|
|
1934
|
+
function dialog(options2) {
|
|
1935
|
+
var scope = checkOptions(options2, checkDialog);
|
|
1921
1936
|
if (scope == void 0) {
|
|
1922
1937
|
const deferred = defer();
|
|
1923
1938
|
const hook = useHook();
|
|
@@ -1946,13 +1961,13 @@ function usePopup() {
|
|
|
1946
1961
|
},
|
|
1947
1962
|
onBeforeClose: fn => hook.register("onBeforeClose", fn)
|
|
1948
1963
|
});
|
|
1949
|
-
const descriptor = openPopup(_sfc_main$s,
|
|
1964
|
+
const descriptor = openPopup(_sfc_main$s, options2, extOptions);
|
|
1950
1965
|
scope = useAsyncScope(deferred.promise);
|
|
1951
1966
|
monitorDialog(descriptor, scope, deferred);
|
|
1952
1967
|
}
|
|
1953
1968
|
return addScope2Scopes(scope);
|
|
1954
1969
|
}
|
|
1955
|
-
function follow(target,
|
|
1970
|
+
function follow(target, options2) {
|
|
1956
1971
|
var scope = void 0;
|
|
1957
1972
|
if (target instanceof Element == false) {
|
|
1958
1973
|
const deferred = defer();
|
|
@@ -1964,34 +1979,34 @@ function usePopup() {
|
|
|
1964
1979
|
inPopup: "follow",
|
|
1965
1980
|
target
|
|
1966
1981
|
};
|
|
1967
|
-
scope = checkOptions(
|
|
1982
|
+
scope = checkOptions(options2, checkFollow) || popupInCustomContainer(_sfc_main$r, options2, extOptions);
|
|
1968
1983
|
}
|
|
1969
1984
|
return addScope2Scopes(scope);
|
|
1970
1985
|
}
|
|
1971
|
-
function confirm(title, message,
|
|
1972
|
-
|
|
1986
|
+
function confirm(title, message, options2) {
|
|
1987
|
+
options2 = options2 || Object.create(null);
|
|
1973
1988
|
return dialog({
|
|
1974
1989
|
component: _sfc_main$y,
|
|
1975
1990
|
closeOnEscape: true,
|
|
1976
1991
|
props: {
|
|
1977
|
-
...
|
|
1992
|
+
...options2,
|
|
1978
1993
|
title,
|
|
1979
1994
|
message
|
|
1980
1995
|
}
|
|
1981
1996
|
});
|
|
1982
1997
|
}
|
|
1983
|
-
function toast(type, message,
|
|
1998
|
+
function toast(type, message, options2) {
|
|
1984
1999
|
return popupInCustomContainer(_sfc_main$p, {
|
|
1985
2000
|
url: "#ToastContainer",
|
|
1986
2001
|
props: {
|
|
1987
|
-
...(
|
|
2002
|
+
...(options2 || Object.create(null)),
|
|
1988
2003
|
type,
|
|
1989
2004
|
message
|
|
1990
2005
|
}
|
|
1991
2006
|
});
|
|
1992
2007
|
}
|
|
1993
|
-
function checkOptions(
|
|
1994
|
-
const message = manager.destroyed == true ? "checkOptions: manager destroyed." : checkFunc(
|
|
2008
|
+
function checkOptions(options2, checkFunc) {
|
|
2009
|
+
const message = manager.destroyed == true ? "checkOptions: manager destroyed." : checkFunc(options2);
|
|
1995
2010
|
if (isStringNotEmpty(message) == true) {
|
|
1996
2011
|
const deferred = defer();
|
|
1997
2012
|
deferred.reject(message);
|
|
@@ -2002,7 +2017,7 @@ function usePopup() {
|
|
|
2002
2017
|
function addScope2Scopes(scope) {
|
|
2003
2018
|
return scope.destroyed || manager.destroyed ? scope : scopes.add(scope);
|
|
2004
2019
|
}
|
|
2005
|
-
function popupInCustomContainer(container,
|
|
2020
|
+
function popupInCustomContainer(container, options2, extOptions) {
|
|
2006
2021
|
const deferred = defer();
|
|
2007
2022
|
extOptions = Object.freeze({
|
|
2008
2023
|
inPopup: "popup",
|
|
@@ -2014,7 +2029,7 @@ function usePopup() {
|
|
|
2014
2029
|
},
|
|
2015
2030
|
...extOptions
|
|
2016
2031
|
});
|
|
2017
|
-
const descriptor = openPopup(container || _sfc_main$q,
|
|
2032
|
+
const descriptor = openPopup(container || _sfc_main$q, options2, extOptions);
|
|
2018
2033
|
const scope = useAsyncScope(deferred.promise);
|
|
2019
2034
|
scope.onDestroy(() => destroyPopup(descriptor, deferred));
|
|
2020
2035
|
return scope;
|
|
@@ -2025,8 +2040,10 @@ function usePopup() {
|
|
|
2025
2040
|
follow,
|
|
2026
2041
|
confirm,
|
|
2027
2042
|
toast
|
|
2028
|
-
},
|
|
2029
|
-
|
|
2043
|
+
}, {
|
|
2044
|
+
global: options ? options.global : false,
|
|
2045
|
+
type: "IPopupManager"
|
|
2046
|
+
});
|
|
2030
2047
|
manager.onDestroy(scopes.destroy);
|
|
2031
2048
|
return Object.freeze(manager);
|
|
2032
2049
|
}
|
|
@@ -2074,7 +2091,9 @@ function useTreeContext(nodes, activeNodeRef) {
|
|
|
2074
2091
|
isShowChildren,
|
|
2075
2092
|
getPath,
|
|
2076
2093
|
getKey
|
|
2077
|
-
},
|
|
2094
|
+
}, {
|
|
2095
|
+
type: "ITreeBaseContext"
|
|
2096
|
+
});
|
|
2078
2097
|
context.onDestroy(() => {
|
|
2079
2098
|
failed.value = void 0;
|
|
2080
2099
|
patched.value = void 0;
|
|
@@ -2138,7 +2157,9 @@ function useSelectContext(items, selectsRef, separator) {
|
|
|
2138
2157
|
selected,
|
|
2139
2158
|
selectedText
|
|
2140
2159
|
});
|
|
2141
|
-
mountScope(context,
|
|
2160
|
+
mountScope(context, {
|
|
2161
|
+
type: "ISelectContext"
|
|
2162
|
+
});
|
|
2142
2163
|
treeContxt.onDestroy(() => context.destroyed || context.destroy());
|
|
2143
2164
|
context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
|
|
2144
2165
|
}
|
|
@@ -2739,173 +2760,7 @@ var _sfc_main$j = defineComponent({
|
|
|
2739
2760
|
}
|
|
2740
2761
|
});
|
|
2741
2762
|
|
|
2742
|
-
const _hoisted_1$c = ["onClick"];
|
|
2743
|
-
const _hoisted_2$9 = ["textContent"];
|
|
2744
2763
|
var _sfc_main$i = defineComponent({
|
|
2745
|
-
__name: "action-items",
|
|
2746
|
-
props: {
|
|
2747
|
-
mode: {},
|
|
2748
|
-
actions: {},
|
|
2749
|
-
inPopup: {},
|
|
2750
|
-
closePopup: {
|
|
2751
|
-
type: Function
|
|
2752
|
-
},
|
|
2753
|
-
popupStatus: {},
|
|
2754
|
-
target: {},
|
|
2755
|
-
followX: {},
|
|
2756
|
-
followY: {},
|
|
2757
|
-
pinned: {}
|
|
2758
|
-
},
|
|
2759
|
-
emits: ["trigger"],
|
|
2760
|
-
setup(__props, _ref) {
|
|
2761
|
-
let {
|
|
2762
|
-
emit: __emit
|
|
2763
|
-
} = _ref;
|
|
2764
|
-
const props = __props;
|
|
2765
|
-
const emits = __emit;
|
|
2766
|
-
function onActionItemClick(code) {
|
|
2767
|
-
emits("trigger", code);
|
|
2768
|
-
props.inPopup && props.closePopup(code);
|
|
2769
|
-
}
|
|
2770
|
-
return (_ctx, _cache) => {
|
|
2771
|
-
return openBlock(), createElementBlock("div", {
|
|
2772
|
-
class: normalizeClass(["snail-action-items", [unref(correctString)(__props.mode, "vertical", true), unref(isStringNotEmpty)(__props.inPopup) ? "in-popup" : ""]])
|
|
2773
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, action => {
|
|
2774
|
-
return openBlock(), createElementBlock("div", {
|
|
2775
|
-
class: "action-item flex-cross-center",
|
|
2776
|
-
key: action.code,
|
|
2777
|
-
style: normalizeStyle({
|
|
2778
|
-
"--color": unref(correctString)(action.color, null, true),
|
|
2779
|
-
"--hcolor": unref(correctString)(action.hoverColor, null, true)
|
|
2780
|
-
}),
|
|
2781
|
-
onClick: $event => onActionItemClick(action.code)
|
|
2782
|
-
}, [action.icon != void 0 ? (openBlock(), createBlock(_sfc_main$F, mergeProps({
|
|
2783
|
-
key: 0,
|
|
2784
|
-
ref_for: true
|
|
2785
|
-
}, action.icon, {
|
|
2786
|
-
custom: false,
|
|
2787
|
-
size: 20
|
|
2788
|
-
}), null, 16)) : createCommentVNode("", true), createElementVNode("span", {
|
|
2789
|
-
class: "ellipsis",
|
|
2790
|
-
textContent: toDisplayString(action.name)
|
|
2791
|
-
}, null, 8, _hoisted_2$9)], 12, _hoisted_1$c);
|
|
2792
|
-
}), 128))], 2);
|
|
2793
|
-
};
|
|
2794
|
-
}
|
|
2795
|
-
});
|
|
2796
|
-
|
|
2797
|
-
const _hoisted_1$b = {
|
|
2798
|
-
class: "snail-action flex-cross-center",
|
|
2799
|
-
ref: "snail-action"
|
|
2800
|
-
};
|
|
2801
|
-
const _hoisted_2$8 = {
|
|
2802
|
-
class: "action-slot flex-cross-center"
|
|
2803
|
-
};
|
|
2804
|
-
var _sfc_main$h = defineComponent({
|
|
2805
|
-
__name: "action",
|
|
2806
|
-
props: {
|
|
2807
|
-
disabled: {
|
|
2808
|
-
type: Boolean
|
|
2809
|
-
},
|
|
2810
|
-
trigger: {},
|
|
2811
|
-
actions: {},
|
|
2812
|
-
followX: {},
|
|
2813
|
-
followY: {},
|
|
2814
|
-
spaceX: {},
|
|
2815
|
-
spaceY: {}
|
|
2816
|
-
},
|
|
2817
|
-
emits: ["trigger"],
|
|
2818
|
-
setup(__props, _ref) {
|
|
2819
|
-
let {
|
|
2820
|
-
emit: __emit
|
|
2821
|
-
} = _ref;
|
|
2822
|
-
const props = __props;
|
|
2823
|
-
const emits = __emit;
|
|
2824
|
-
const {
|
|
2825
|
-
follow
|
|
2826
|
-
} = usePopup();
|
|
2827
|
-
const {
|
|
2828
|
-
onEvent
|
|
2829
|
-
} = useObserver();
|
|
2830
|
-
const rootDom = useTemplateRef("snail-action");
|
|
2831
|
-
const popupScopeRef = shallowRef(void 0);
|
|
2832
|
-
let pressStartDate = void 0;
|
|
2833
|
-
const slotHandle = Object.freeze({
|
|
2834
|
-
isActived: () => popupScopeRef.value != void 0,
|
|
2835
|
-
trigger: () => onFollowShow(props.trigger == "long-press")
|
|
2836
|
-
});
|
|
2837
|
-
async function onFollowShow(longPress) {
|
|
2838
|
-
if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
|
|
2839
|
-
popupScopeRef.value.destroy();
|
|
2840
|
-
} else if (props.disabled != true) {
|
|
2841
|
-
popupScopeRef.value = follow(rootDom.value, {
|
|
2842
|
-
component: _sfc_main$i,
|
|
2843
|
-
closeOnEscape: true,
|
|
2844
|
-
closeOnMask: true,
|
|
2845
|
-
closeOnResize: true,
|
|
2846
|
-
closeOnTarget: true,
|
|
2847
|
-
followX: props.followX || ["center", "start", "end", "after", "before", "ratio"],
|
|
2848
|
-
followY: props.followY || ["after", "before", "center", "end", "start", "ratio"],
|
|
2849
|
-
spaceX: props.spaceX,
|
|
2850
|
-
spaceY: props.spaceY,
|
|
2851
|
-
props: {
|
|
2852
|
-
mode: "vertical",
|
|
2853
|
-
actions: props.actions
|
|
2854
|
-
}
|
|
2855
|
-
});
|
|
2856
|
-
const code = await popupScopeRef.value;
|
|
2857
|
-
isStringNotEmpty(code) && emits("trigger", code);
|
|
2858
|
-
}
|
|
2859
|
-
popupScopeRef.value = void 0;
|
|
2860
|
-
}
|
|
2861
|
-
function onMouseDown() {
|
|
2862
|
-
if (props.trigger == "long-press" && pressStartDate == void 0) {
|
|
2863
|
-
pressStartDate = new Date();
|
|
2864
|
-
}
|
|
2865
|
-
}
|
|
2866
|
-
function onMouseUp() {
|
|
2867
|
-
if (pressStartDate != void 0) {
|
|
2868
|
-
const time = ((new Date()).getTime() - pressStartDate.getTime()) / 1e3;
|
|
2869
|
-
pressStartDate = void 0;
|
|
2870
|
-
if (time >= 0.5) {
|
|
2871
|
-
navigator.vibrate && navigator.vibrate(200);
|
|
2872
|
-
onFollowShow();
|
|
2873
|
-
}
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
function onMouseCancel() {
|
|
2877
|
-
setTimeout(() => pressStartDate = void 0, 10);
|
|
2878
|
-
}
|
|
2879
|
-
onMounted(() => {
|
|
2880
|
-
onEvent(rootDom.value, "mousedown", onMouseDown);
|
|
2881
|
-
onEvent(rootDom.value, "mouseup", onMouseUp);
|
|
2882
|
-
if ("ontouchstart" in window) {
|
|
2883
|
-
onEvent(rootDom.value, "touchstart", onMouseDown);
|
|
2884
|
-
onEvent(rootDom.value, "touchend", onMouseUp);
|
|
2885
|
-
}
|
|
2886
|
-
onEvent(window, "mouseup", onMouseCancel);
|
|
2887
|
-
if ("ontouchstart" in window) {
|
|
2888
|
-
onEvent(window, "touchend", onMouseCancel);
|
|
2889
|
-
onEvent(window, "touchcancel", onMouseCancel);
|
|
2890
|
-
}
|
|
2891
|
-
});
|
|
2892
|
-
return (_ctx, _cache) => {
|
|
2893
|
-
return openBlock(), createElementBlock("div", _hoisted_1$b, [createElementVNode("div", _hoisted_2$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotHandle))))]), __props.disabled != true && (__props.trigger == "hover" || __props.trigger == "always") ? (openBlock(), createElementBlock("div", {
|
|
2894
|
-
key: 0,
|
|
2895
|
-
class: normalizeClass(["trigger-area", {
|
|
2896
|
-
hidden: __props.trigger == "hover"
|
|
2897
|
-
}])
|
|
2898
|
-
}, [renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createVNode(_sfc_main$F, {
|
|
2899
|
-
button: "",
|
|
2900
|
-
type: "more",
|
|
2901
|
-
size: 16,
|
|
2902
|
-
onClick: _cache[0] || (_cache[0] = $event => onFollowShow())
|
|
2903
|
-
})])], 2)) : createCommentVNode("", true)], 512);
|
|
2904
|
-
};
|
|
2905
|
-
}
|
|
2906
|
-
});
|
|
2907
|
-
|
|
2908
|
-
var _sfc_main$g = defineComponent({
|
|
2909
2764
|
...{
|
|
2910
2765
|
name: "Elastic",
|
|
2911
2766
|
inheritAttrs: false
|
|
@@ -3111,7 +2966,7 @@ var _sfc_main$g = defineComponent({
|
|
|
3111
2966
|
}
|
|
3112
2967
|
});
|
|
3113
2968
|
|
|
3114
|
-
var _sfc_main$
|
|
2969
|
+
var _sfc_main$h = defineComponent({
|
|
3115
2970
|
...{
|
|
3116
2971
|
name: "Flex",
|
|
3117
2972
|
inheritAttrs: false
|
|
@@ -3206,13 +3061,13 @@ var _sfc_main$f = defineComponent({
|
|
|
3206
3061
|
}
|
|
3207
3062
|
});
|
|
3208
3063
|
|
|
3209
|
-
const _hoisted_1$
|
|
3210
|
-
const _hoisted_2$
|
|
3064
|
+
const _hoisted_1$c = ["textContent"];
|
|
3065
|
+
const _hoisted_2$9 = ["textContent"];
|
|
3211
3066
|
const _hoisted_3$4 = {
|
|
3212
3067
|
key: 1,
|
|
3213
3068
|
class: "status"
|
|
3214
3069
|
};
|
|
3215
|
-
var _sfc_main$
|
|
3070
|
+
var _sfc_main$g = defineComponent({
|
|
3216
3071
|
...{
|
|
3217
3072
|
name: "Fold",
|
|
3218
3073
|
inheritAttrs: true
|
|
@@ -3304,11 +3159,11 @@ var _sfc_main$e = defineComponent({
|
|
|
3304
3159
|
}, [renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(slotHandle)), () => [createElementVNode("div", {
|
|
3305
3160
|
class: "title ellipsis",
|
|
3306
3161
|
textContent: toDisplayString(__props.title)
|
|
3307
|
-
}, null, 8, _hoisted_1$
|
|
3162
|
+
}, null, 8, _hoisted_1$c), !!__props.subtitle ? (openBlock(), createElementBlock("div", {
|
|
3308
3163
|
key: 0,
|
|
3309
3164
|
class: "subtitle ellipsis",
|
|
3310
3165
|
textContent: toDisplayString(__props.subtitle)
|
|
3311
|
-
}, null, 8, _hoisted_2$
|
|
3166
|
+
}, null, 8, _hoisted_2$9)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_3$4, [createVNode(_sfc_main$F, {
|
|
3312
3167
|
type: "arrow",
|
|
3313
3168
|
button: "",
|
|
3314
3169
|
title: statusModel.value == "expand" ? "收起" : "展开",
|
|
@@ -3322,7 +3177,7 @@ var _sfc_main$e = defineComponent({
|
|
|
3322
3177
|
}
|
|
3323
3178
|
});
|
|
3324
3179
|
|
|
3325
|
-
var _sfc_main$
|
|
3180
|
+
var _sfc_main$f = defineComponent({
|
|
3326
3181
|
__name: "layout",
|
|
3327
3182
|
props: {
|
|
3328
3183
|
direction: {},
|
|
@@ -3418,7 +3273,7 @@ var _sfc_main$d = defineComponent({
|
|
|
3418
3273
|
}
|
|
3419
3274
|
});
|
|
3420
3275
|
|
|
3421
|
-
var _sfc_main$
|
|
3276
|
+
var _sfc_main$e = defineComponent({
|
|
3422
3277
|
...{
|
|
3423
3278
|
name: "Sort",
|
|
3424
3279
|
inheritAttrs: true
|
|
@@ -3519,10 +3374,10 @@ var _sfc_main$c = defineComponent({
|
|
|
3519
3374
|
}
|
|
3520
3375
|
});
|
|
3521
3376
|
|
|
3522
|
-
const _hoisted_1$
|
|
3377
|
+
const _hoisted_1$b = {
|
|
3523
3378
|
class: "table-body"
|
|
3524
3379
|
};
|
|
3525
|
-
var _sfc_main$
|
|
3380
|
+
var _sfc_main$d = defineComponent({
|
|
3526
3381
|
...{
|
|
3527
3382
|
name: "Table",
|
|
3528
3383
|
inheritAttrs: true
|
|
@@ -3552,7 +3407,7 @@ var _sfc_main$b = defineComponent({
|
|
|
3552
3407
|
default: withCtx(() => [createElementVNode("div", {
|
|
3553
3408
|
class: "table-header",
|
|
3554
3409
|
style: normalizeStyle(hStyleRef.value)
|
|
3555
|
-
}, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$
|
|
3410
|
+
}, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$b, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
|
|
3556
3411
|
class: "table-footer",
|
|
3557
3412
|
style: normalizeStyle(fStyleRef.value)
|
|
3558
3413
|
}, [renderSlot(_ctx.$slots, "footer")], 4)]),
|
|
@@ -3562,7 +3417,7 @@ var _sfc_main$b = defineComponent({
|
|
|
3562
3417
|
}
|
|
3563
3418
|
});
|
|
3564
3419
|
|
|
3565
|
-
var _sfc_main$
|
|
3420
|
+
var _sfc_main$c = defineComponent({
|
|
3566
3421
|
...{
|
|
3567
3422
|
name: "TableRow",
|
|
3568
3423
|
inheritAttrs: true
|
|
@@ -3585,7 +3440,7 @@ var _sfc_main$a = defineComponent({
|
|
|
3585
3440
|
}
|
|
3586
3441
|
});
|
|
3587
3442
|
|
|
3588
|
-
var _sfc_main$
|
|
3443
|
+
var _sfc_main$b = defineComponent({
|
|
3589
3444
|
...{
|
|
3590
3445
|
name: "TableCol",
|
|
3591
3446
|
inheritAttrs: true
|
|
@@ -3631,11 +3486,11 @@ var _sfc_main$9 = defineComponent({
|
|
|
3631
3486
|
}
|
|
3632
3487
|
});
|
|
3633
3488
|
|
|
3634
|
-
const _hoisted_1$
|
|
3489
|
+
const _hoisted_1$a = {
|
|
3635
3490
|
key: 0,
|
|
3636
3491
|
class: "node-fold"
|
|
3637
3492
|
};
|
|
3638
|
-
const _hoisted_2$
|
|
3493
|
+
const _hoisted_2$8 = ["title", "textContent"];
|
|
3639
3494
|
const _hoisted_3$3 = {
|
|
3640
3495
|
class: "node-slot ellipsis"
|
|
3641
3496
|
};
|
|
@@ -3643,7 +3498,7 @@ const _hoisted_4$3 = {
|
|
|
3643
3498
|
class: "snail-tree-children",
|
|
3644
3499
|
ref: "children"
|
|
3645
3500
|
};
|
|
3646
|
-
var _sfc_main$
|
|
3501
|
+
var _sfc_main$a = defineComponent({
|
|
3647
3502
|
...{
|
|
3648
3503
|
name: "TreeNode",
|
|
3649
3504
|
inheritAttrs: true
|
|
@@ -3751,7 +3606,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
3751
3606
|
key: 1
|
|
3752
3607
|
}, [_cache[5] || (_cache[5] = createElementVNode("div", {
|
|
3753
3608
|
class: "indent"
|
|
3754
|
-
}, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3609
|
+
}, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$a, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$F, {
|
|
3755
3610
|
key: 0,
|
|
3756
3611
|
class: normalizeClass(statusRef.value),
|
|
3757
3612
|
custom: "",
|
|
@@ -3766,7 +3621,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
3766
3621
|
class: "node-text ellipsis",
|
|
3767
3622
|
title: __props.node.text,
|
|
3768
3623
|
textContent: toDisplayString(__props.node.text)
|
|
3769
|
-
}, null, 8, _hoisted_2$
|
|
3624
|
+
}, null, 8, _hoisted_2$8), createElementVNode("div", _hoisted_3$3, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34), [[vShow, showRef.value]]), withDirectives(createElementVNode("div", _hoisted_4$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.node.children, child => {
|
|
3770
3625
|
return openBlock(), createBlock(_component_TreeNode, {
|
|
3771
3626
|
key: __props.context.getKey(child),
|
|
3772
3627
|
node: child,
|
|
@@ -3786,10 +3641,10 @@ var _sfc_main$8 = defineComponent({
|
|
|
3786
3641
|
}
|
|
3787
3642
|
});
|
|
3788
3643
|
|
|
3789
|
-
const _hoisted_1$
|
|
3644
|
+
const _hoisted_1$9 = {
|
|
3790
3645
|
class: "snail-tree"
|
|
3791
3646
|
};
|
|
3792
|
-
var _sfc_main$
|
|
3647
|
+
var _sfc_main$9 = defineComponent({
|
|
3793
3648
|
...{
|
|
3794
3649
|
name: "Tree",
|
|
3795
3650
|
inheritAttrs: true
|
|
@@ -3823,7 +3678,7 @@ var _sfc_main$7 = defineComponent({
|
|
|
3823
3678
|
emits("click", node, parents);
|
|
3824
3679
|
}
|
|
3825
3680
|
return (_ctx, _cache) => {
|
|
3826
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3681
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [__props.search ? (openBlock(), createBlock(_sfc_main$z, mergeProps({
|
|
3827
3682
|
key: 0
|
|
3828
3683
|
}, __props.search, {
|
|
3829
3684
|
onSearch
|
|
@@ -3831,7 +3686,7 @@ var _sfc_main$7 = defineComponent({
|
|
|
3831
3686
|
scroll: "y"
|
|
3832
3687
|
}, {
|
|
3833
3688
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
|
|
3834
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3689
|
+
return openBlock(), createBlock(_sfc_main$a, {
|
|
3835
3690
|
key: unref(context).getKey(node),
|
|
3836
3691
|
node,
|
|
3837
3692
|
parent: void 0,
|
|
@@ -3864,49 +3719,57 @@ function mount(target, options, onDestroyed) {
|
|
|
3864
3719
|
return scope;
|
|
3865
3720
|
}
|
|
3866
3721
|
|
|
3867
|
-
const _hoisted_1$
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
var _sfc_main$6 = defineComponent({
|
|
3872
|
-
__name: "flash-number",
|
|
3722
|
+
const _hoisted_1$8 = ["onClick"];
|
|
3723
|
+
const _hoisted_2$7 = ["textContent"];
|
|
3724
|
+
var _sfc_main$8 = defineComponent({
|
|
3725
|
+
__name: "action-items",
|
|
3873
3726
|
props: {
|
|
3874
|
-
|
|
3727
|
+
mode: {},
|
|
3728
|
+
actions: {},
|
|
3729
|
+
inPopup: {},
|
|
3730
|
+
closePopup: {
|
|
3731
|
+
type: Function
|
|
3732
|
+
},
|
|
3733
|
+
popupStatus: {},
|
|
3734
|
+
target: {},
|
|
3735
|
+
followX: {},
|
|
3736
|
+
followY: {},
|
|
3737
|
+
pinned: {}
|
|
3875
3738
|
},
|
|
3876
|
-
|
|
3739
|
+
emits: ["trigger"],
|
|
3740
|
+
setup(__props, _ref) {
|
|
3741
|
+
let {
|
|
3742
|
+
emit: __emit
|
|
3743
|
+
} = _ref;
|
|
3877
3744
|
const props = __props;
|
|
3878
|
-
const
|
|
3879
|
-
function
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
if (isStringNotEmpty(value) == true) {
|
|
3883
|
-
for (const item of value) {
|
|
3884
|
-
const number = parseInt(item);
|
|
3885
|
-
const isNumber = 0 <= number && number <= 9;
|
|
3886
|
-
itemsRef.value.push({
|
|
3887
|
-
id: newId(),
|
|
3888
|
-
text: item,
|
|
3889
|
-
number: isNumber ? number : void 0
|
|
3890
|
-
});
|
|
3891
|
-
}
|
|
3892
|
-
}
|
|
3893
|
-
if (isArrayNotEmpty(itemsRef.value) == true) ;
|
|
3745
|
+
const emits = __emit;
|
|
3746
|
+
function onActionItemClick(code) {
|
|
3747
|
+
emits("trigger", code);
|
|
3748
|
+
props.inPopup && props.closePopup(code);
|
|
3894
3749
|
}
|
|
3895
|
-
onMounted(() => {
|
|
3896
|
-
buildNumberItems();
|
|
3897
|
-
});
|
|
3898
3750
|
return (_ctx, _cache) => {
|
|
3899
|
-
return openBlock(), createElementBlock("div",
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
class:
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3751
|
+
return openBlock(), createElementBlock("div", {
|
|
3752
|
+
class: normalizeClass(["snail-action-items", [unref(correctString)(__props.mode, "vertical", true), unref(isStringNotEmpty)(__props.inPopup) ? "in-popup" : ""]])
|
|
3753
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, action => {
|
|
3754
|
+
return openBlock(), createElementBlock("div", {
|
|
3755
|
+
class: "action-item flex-cross-center",
|
|
3756
|
+
key: action.code,
|
|
3757
|
+
style: normalizeStyle({
|
|
3758
|
+
"--color": unref(correctString)(action.color, null, true),
|
|
3759
|
+
"--hcolor": unref(correctString)(action.hoverColor, null, true)
|
|
3760
|
+
}),
|
|
3761
|
+
onClick: $event => onActionItemClick(action.code)
|
|
3762
|
+
}, [action.icon != void 0 ? (openBlock(), createBlock(_sfc_main$F, mergeProps({
|
|
3763
|
+
key: 0,
|
|
3764
|
+
ref_for: true
|
|
3765
|
+
}, action.icon, {
|
|
3766
|
+
custom: false,
|
|
3767
|
+
size: 20
|
|
3768
|
+
}), null, 16)) : createCommentVNode("", true), createElementVNode("span", {
|
|
3769
|
+
class: "ellipsis",
|
|
3770
|
+
textContent: toDisplayString(action.name)
|
|
3771
|
+
}, null, 8, _hoisted_2$7)], 12, _hoisted_1$8);
|
|
3772
|
+
}), 128))], 2);
|
|
3910
3773
|
};
|
|
3911
3774
|
}
|
|
3912
3775
|
});
|
|
@@ -4027,210 +3890,16 @@ function buildSecondItems(minuteItem, min, max) {
|
|
|
4027
3890
|
return items;
|
|
4028
3891
|
}
|
|
4029
3892
|
|
|
4030
|
-
const _hoisted_1$
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
};
|
|
4034
|
-
const _hoisted_2$4 = ["textContent", "onClick", "onDblclick"];
|
|
4035
|
-
const _hoisted_3$2 = {
|
|
4036
|
-
class: "tz-item",
|
|
4037
|
-
ref: "minute-items"
|
|
4038
|
-
};
|
|
3893
|
+
const _hoisted_1$7 = ["textContent"];
|
|
3894
|
+
const _hoisted_2$6 = ["textContent"];
|
|
3895
|
+
const _hoisted_3$2 = ["textContent"];
|
|
4039
3896
|
const _hoisted_4$2 = ["textContent", "onClick", "onDblclick"];
|
|
4040
|
-
const _hoisted_5$
|
|
4041
|
-
|
|
4042
|
-
class: "tz-item",
|
|
4043
|
-
ref: "second-items"
|
|
4044
|
-
};
|
|
4045
|
-
const _hoisted_6$1 = ["textContent", "onClick", "onDblclick"];
|
|
4046
|
-
var _sfc_main$5 = defineComponent({
|
|
4047
|
-
__name: "time-pc",
|
|
4048
|
-
props: {
|
|
4049
|
-
value: {},
|
|
4050
|
-
format: {},
|
|
4051
|
-
mode: {},
|
|
4052
|
-
min: {},
|
|
4053
|
-
max: {},
|
|
4054
|
-
toolbarDisabled: {
|
|
4055
|
-
type: Boolean
|
|
4056
|
-
},
|
|
4057
|
-
nowDisabled: {
|
|
4058
|
-
type: Boolean
|
|
4059
|
-
},
|
|
4060
|
-
clearDisabled: {
|
|
4061
|
-
type: Boolean
|
|
4062
|
-
},
|
|
4063
|
-
popup: {},
|
|
4064
|
-
picker: {},
|
|
4065
|
-
inPopup: {},
|
|
4066
|
-
closePopup: {
|
|
4067
|
-
type: Function
|
|
4068
|
-
},
|
|
4069
|
-
popupStatus: {},
|
|
4070
|
-
target: {},
|
|
4071
|
-
followX: {},
|
|
4072
|
-
followY: {},
|
|
4073
|
-
pinned: {}
|
|
4074
|
-
},
|
|
4075
|
-
emits: ["clear", "confirm"],
|
|
4076
|
-
setup(__props, _ref) {
|
|
4077
|
-
let {
|
|
4078
|
-
emit: __emit
|
|
4079
|
-
} = _ref;
|
|
4080
|
-
const props = __props;
|
|
4081
|
-
const emits = __emit;
|
|
4082
|
-
const format = props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss";
|
|
4083
|
-
const min = parseTimeValue(props.min, "min");
|
|
4084
|
-
const max = parseTimeValue(props.max, "max");
|
|
4085
|
-
const timeRef = ref(parseTimeValue(props.value, "min") || getTimeValue(new Date()));
|
|
4086
|
-
const isValidTimeRef = computed(() => format == "HH:mm" ? minuteItems.value && minuteItems.value[timeRef.value.minute].disabled != true : secondItems.value && secondItems.value[timeRef.value.second].disabled != true);
|
|
4087
|
-
const hourItems = shallowRef(buildHourItems(min, max));
|
|
4088
|
-
const minuteItems = shallowRef();
|
|
4089
|
-
const secondItems = shallowRef();
|
|
4090
|
-
const hItemsDom = useTemplateRef("hour-items");
|
|
4091
|
-
const mItemsDom = useTemplateRef("minute-items");
|
|
4092
|
-
const sItemsDom = useTemplateRef("second-items");
|
|
4093
|
-
async function rebuildItems(time) {
|
|
4094
|
-
time != void 0 && (timeRef.value = time);
|
|
4095
|
-
minuteItems.value = buildMinuteItems(hourItems.value[timeRef.value.hour], min, max);
|
|
4096
|
-
secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
|
|
4097
|
-
await nextTick();
|
|
4098
|
-
scrollIntoView(hItemsDom.value);
|
|
4099
|
-
scrollIntoView(mItemsDom.value);
|
|
4100
|
-
scrollIntoView(sItemsDom.value);
|
|
4101
|
-
}
|
|
4102
|
-
function scrollIntoView(items) {
|
|
4103
|
-
let activeIndex = void 0;
|
|
4104
|
-
for (var index = 0; index < (items ? items.children.length : 0); index++) {
|
|
4105
|
-
const ele = items.children[index];
|
|
4106
|
-
if (ele.classList.contains("active") == true) {
|
|
4107
|
-
activeIndex = index;
|
|
4108
|
-
break;
|
|
4109
|
-
}
|
|
4110
|
-
}
|
|
4111
|
-
activeIndex != void 0 && items.children[activeIndex].scrollIntoView({
|
|
4112
|
-
behavior: "smooth",
|
|
4113
|
-
block: "center"
|
|
4114
|
-
});
|
|
4115
|
-
}
|
|
4116
|
-
function onHourClick(item, dbClick) {
|
|
4117
|
-
if (item.disabled != true && timeRef.value.hour != item.hour) {
|
|
4118
|
-
timeRef.value.hour = item.hour;
|
|
4119
|
-
minuteItems.value = buildMinuteItems(item, min, max);
|
|
4120
|
-
secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
|
|
4121
|
-
}
|
|
4122
|
-
}
|
|
4123
|
-
function onMinuteClick(item, dbClick) {
|
|
4124
|
-
if (item.disabled != true) {
|
|
4125
|
-
timeRef.value.minute = item.minute;
|
|
4126
|
-
if (format == "HH:mm") {
|
|
4127
|
-
dbClick && onConfirm();
|
|
4128
|
-
} else if (timeRef.value.minute != item.minute) {
|
|
4129
|
-
secondItems.value = buildSecondItems(item, min, max);
|
|
4130
|
-
}
|
|
4131
|
-
}
|
|
4132
|
-
}
|
|
4133
|
-
function onSecondClick(item, dbClick) {
|
|
4134
|
-
if (item.disabled != true) {
|
|
4135
|
-
timeRef.value.second = item.second;
|
|
4136
|
-
dbClick && onConfirm();
|
|
4137
|
-
}
|
|
4138
|
-
}
|
|
4139
|
-
function onConfirm() {
|
|
4140
|
-
if (isValidTimeRef.value == true) {
|
|
4141
|
-
const value = formatTimeValue(timeRef.value, format);
|
|
4142
|
-
emits("confirm", value);
|
|
4143
|
-
props.inPopup && props.closePopup(value);
|
|
4144
|
-
}
|
|
4145
|
-
}
|
|
4146
|
-
onMounted(rebuildItems);
|
|
4147
|
-
return (_ctx, _cache) => {
|
|
4148
|
-
return openBlock(), createBlock(_sfc_main$d, {
|
|
4149
|
-
class: normalizeClass(["time-picker pc", {
|
|
4150
|
-
"second-disabled": unref(format) != "HH:mm:ss"
|
|
4151
|
-
}]),
|
|
4152
|
-
direction: "vertical"
|
|
4153
|
-
}, createSlots({
|
|
4154
|
-
main: withCtx(() => [createVNode(_sfc_main$x, {
|
|
4155
|
-
multiple: "",
|
|
4156
|
-
effect: unref(MOTION).top
|
|
4157
|
-
}, {
|
|
4158
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1$5, [(openBlock(true), createElementBlock(Fragment, null, renderList(hourItems.value, item => {
|
|
4159
|
-
return openBlock(), createElementBlock("div", {
|
|
4160
|
-
class: normalizeClass(["tzi-number", {
|
|
4161
|
-
active: item.hour == timeRef.value.hour,
|
|
4162
|
-
disabled: item.disabled
|
|
4163
|
-
}]),
|
|
4164
|
-
key: item.hour,
|
|
4165
|
-
textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
|
|
4166
|
-
onClick: $event => onHourClick(item),
|
|
4167
|
-
onDblclick: $event => onHourClick(item)
|
|
4168
|
-
}, null, 42, _hoisted_2$4);
|
|
4169
|
-
}), 128))], 512), createElementVNode("div", _hoisted_3$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
|
|
4170
|
-
return openBlock(), createElementBlock("div", {
|
|
4171
|
-
class: normalizeClass(["tzi-number", {
|
|
4172
|
-
active: item.minute == timeRef.value.minute,
|
|
4173
|
-
disabled: item.disabled
|
|
4174
|
-
}]),
|
|
4175
|
-
key: `${item.hour}:${item.minute}`,
|
|
4176
|
-
textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
|
|
4177
|
-
onClick: $event => onMinuteClick(item),
|
|
4178
|
-
onDblclick: $event => onMinuteClick(item, true)
|
|
4179
|
-
}, null, 42, _hoisted_4$2);
|
|
4180
|
-
}), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
|
|
4181
|
-
return openBlock(), createElementBlock("div", {
|
|
4182
|
-
class: normalizeClass(["tzi-number", {
|
|
4183
|
-
active: item.second == timeRef.value.second,
|
|
4184
|
-
disabled: item.disabled
|
|
4185
|
-
}]),
|
|
4186
|
-
key: `${item.hour}:${item.minute}:${item.second}`,
|
|
4187
|
-
textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
|
|
4188
|
-
onClick: $event => onSecondClick(item),
|
|
4189
|
-
onDblclick: $event => onSecondClick(item, true)
|
|
4190
|
-
}, null, 42, _hoisted_6$1);
|
|
4191
|
-
}), 128))], 512)) : createCommentVNode("", true)]),
|
|
4192
|
-
_: 1
|
|
4193
|
-
}, 8, ["effect"])]),
|
|
4194
|
-
_: 2
|
|
4195
|
-
}, [__props.toolbarDisabled != true ? {
|
|
4196
|
-
name: "bottom",
|
|
4197
|
-
fn: withCtx(() => [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
|
|
4198
|
-
key: 0,
|
|
4199
|
-
type: "link",
|
|
4200
|
-
size: "small",
|
|
4201
|
-
textContent: "清空",
|
|
4202
|
-
onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), __props.inPopup && __props.closePopup("")))
|
|
4203
|
-
})) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
|
|
4204
|
-
key: 1,
|
|
4205
|
-
type: "link",
|
|
4206
|
-
size: "small",
|
|
4207
|
-
textContent: "现在",
|
|
4208
|
-
onClick: _cache[1] || (_cache[1] = $event => rebuildItems(unref(getTimeValue)(new Date())))
|
|
4209
|
-
})) : createCommentVNode("", true), createVNode(_sfc_main$G, {
|
|
4210
|
-
type: "link",
|
|
4211
|
-
size: "small",
|
|
4212
|
-
textContent: "确定",
|
|
4213
|
-
class: normalizeClass({
|
|
4214
|
-
disabled: isValidTimeRef.value != true
|
|
4215
|
-
}),
|
|
4216
|
-
onClick: onConfirm
|
|
4217
|
-
}, null, 8, ["class"])]),
|
|
4218
|
-
key: "0"
|
|
4219
|
-
} : void 0]), 1032, ["class"]);
|
|
4220
|
-
};
|
|
4221
|
-
}
|
|
4222
|
-
});
|
|
4223
|
-
|
|
4224
|
-
const _hoisted_1$4 = ["textContent"];
|
|
4225
|
-
const _hoisted_2$3 = ["textContent"];
|
|
4226
|
-
const _hoisted_3$1 = ["textContent"];
|
|
4227
|
-
const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
|
|
4228
|
-
const _hoisted_5 = ["textContent", "onClick", "onDblclick"];
|
|
4229
|
-
const _hoisted_6 = ["textContent"];
|
|
3897
|
+
const _hoisted_5$2 = ["textContent", "onClick", "onDblclick"];
|
|
3898
|
+
const _hoisted_6$2 = ["textContent"];
|
|
4230
3899
|
const _hoisted_7 = ["textContent", "onClick", "onDblclick"];
|
|
4231
3900
|
const _hoisted_8 = ["textContent"];
|
|
4232
|
-
var _sfc_main$
|
|
4233
|
-
__name: "date-
|
|
3901
|
+
var _sfc_main$7 = defineComponent({
|
|
3902
|
+
__name: "date-popup",
|
|
4234
3903
|
props: {
|
|
4235
3904
|
value: {},
|
|
4236
3905
|
format: {},
|
|
@@ -4446,8 +4115,8 @@ var _sfc_main$4 = defineComponent({
|
|
|
4446
4115
|
dateRef.value == void 0 && (dateRef.value = electDateValue());
|
|
4447
4116
|
buildPickerItems(stepRef.value, 0);
|
|
4448
4117
|
return (_ctx, _cache) => {
|
|
4449
|
-
return openBlock(), createBlock(_sfc_main$
|
|
4450
|
-
class: normalizeClass(["date-picker
|
|
4118
|
+
return openBlock(), createBlock(_sfc_main$f, {
|
|
4119
|
+
class: normalizeClass(["snail-date-picker-popup", {
|
|
4451
4120
|
"time-now": __props.pinned && __props.pinned.value == true
|
|
4452
4121
|
}]),
|
|
4453
4122
|
direction: "vertical",
|
|
@@ -4471,16 +4140,16 @@ var _sfc_main$4 = defineComponent({
|
|
|
4471
4140
|
}, [stepRef.value == "year" ? (openBlock(), createElementBlock("div", {
|
|
4472
4141
|
key: 0,
|
|
4473
4142
|
textContent: toDisplayString(`${yearItems.value[0].year}年 - ${unref(getFromArray)(yearItems.value, -1).year}年`)
|
|
4474
|
-
}, null, 8, _hoisted_1$
|
|
4143
|
+
}, null, 8, _hoisted_1$7)) : (openBlock(), createElementBlock(Fragment, {
|
|
4475
4144
|
key: 1
|
|
4476
4145
|
}, [createElementVNode("div", {
|
|
4477
4146
|
textContent: toDisplayString(`${dateRef.value.year}年`),
|
|
4478
4147
|
onClick: _cache[1] || (_cache[1] = $event => onSwitchStepClick("year"))
|
|
4479
|
-
}, null, 8, _hoisted_2$
|
|
4148
|
+
}, null, 8, _hoisted_2$6), stepRef.value == "day" ? (openBlock(), createElementBlock("div", {
|
|
4480
4149
|
key: 0,
|
|
4481
4150
|
textContent: toDisplayString(`${dateRef.value.month}月`),
|
|
4482
4151
|
onClick: _cache[2] || (_cache[2] = $event => onSwitchStepClick("month"))
|
|
4483
|
-
}, null, 8, _hoisted_3$
|
|
4152
|
+
}, null, 8, _hoisted_3$2)) : createCommentVNode("", true)], 64))], 2), createVNode(_sfc_main$F, {
|
|
4484
4153
|
class: "flex-0",
|
|
4485
4154
|
type: "arrow",
|
|
4486
4155
|
button: "",
|
|
@@ -4502,7 +4171,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
4502
4171
|
textContent: toDisplayString(item.year),
|
|
4503
4172
|
onClick: $event => onYearItemClick(item),
|
|
4504
4173
|
onDblclick: $event => onYearItemClick(item, true)
|
|
4505
|
-
}, null, 40, _hoisted_4$
|
|
4174
|
+
}, null, 40, _hoisted_4$2)], 2);
|
|
4506
4175
|
}), 128)) : stepRef.value == "month" ? (openBlock(true), createElementBlock(Fragment, {
|
|
4507
4176
|
key: 1
|
|
4508
4177
|
}, renderList(monthItems.value, item => {
|
|
@@ -4516,7 +4185,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
4516
4185
|
textContent: toDisplayString(item.text),
|
|
4517
4186
|
onClick: $event => onMonthItemClick(item),
|
|
4518
4187
|
onDblclick: $event => onMonthItemClick(item, true)
|
|
4519
|
-
}, null, 40, _hoisted_5)], 2);
|
|
4188
|
+
}, null, 40, _hoisted_5$2)], 2);
|
|
4520
4189
|
}), 128)) : (openBlock(), createElementBlock(Fragment, {
|
|
4521
4190
|
key: 2
|
|
4522
4191
|
}, [(openBlock(), createElementBlock(Fragment, null, renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
|
|
@@ -4524,7 +4193,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
4524
4193
|
class: "day-item week",
|
|
4525
4194
|
key: item,
|
|
4526
4195
|
textContent: toDisplayString(item)
|
|
4527
|
-
}, null, 8, _hoisted_6);
|
|
4196
|
+
}, null, 8, _hoisted_6$2);
|
|
4528
4197
|
}), 64)), (openBlock(true), createElementBlock(Fragment, null, renderList(dayItemsRef.value, item => {
|
|
4529
4198
|
return openBlock(), createElementBlock("div", {
|
|
4530
4199
|
class: normalizeClass(["day-item", {
|
|
@@ -4579,25 +4248,226 @@ var _sfc_main$4 = defineComponent({
|
|
|
4579
4248
|
}
|
|
4580
4249
|
});
|
|
4581
4250
|
|
|
4582
|
-
const _hoisted_1$
|
|
4251
|
+
const _hoisted_1$6 = {
|
|
4252
|
+
class: "tz-item",
|
|
4253
|
+
ref: "hour-items"
|
|
4254
|
+
};
|
|
4255
|
+
const _hoisted_2$5 = ["textContent", "onClick", "onDblclick"];
|
|
4256
|
+
const _hoisted_3$1 = {
|
|
4257
|
+
class: "tz-item",
|
|
4258
|
+
ref: "minute-items"
|
|
4259
|
+
};
|
|
4260
|
+
const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
|
|
4261
|
+
const _hoisted_5$1 = {
|
|
4262
|
+
key: 0,
|
|
4263
|
+
class: "tz-item",
|
|
4264
|
+
ref: "second-items"
|
|
4265
|
+
};
|
|
4266
|
+
const _hoisted_6$1 = ["textContent", "onClick", "onDblclick"];
|
|
4267
|
+
var _sfc_main$6 = defineComponent({
|
|
4268
|
+
__name: "time-popup",
|
|
4269
|
+
props: {
|
|
4270
|
+
value: {},
|
|
4271
|
+
format: {},
|
|
4272
|
+
mode: {},
|
|
4273
|
+
min: {},
|
|
4274
|
+
max: {},
|
|
4275
|
+
toolbarDisabled: {
|
|
4276
|
+
type: Boolean
|
|
4277
|
+
},
|
|
4278
|
+
nowDisabled: {
|
|
4279
|
+
type: Boolean
|
|
4280
|
+
},
|
|
4281
|
+
clearDisabled: {
|
|
4282
|
+
type: Boolean
|
|
4283
|
+
},
|
|
4284
|
+
popup: {},
|
|
4285
|
+
picker: {},
|
|
4286
|
+
inPopup: {},
|
|
4287
|
+
closePopup: {
|
|
4288
|
+
type: Function
|
|
4289
|
+
},
|
|
4290
|
+
popupStatus: {},
|
|
4291
|
+
target: {},
|
|
4292
|
+
followX: {},
|
|
4293
|
+
followY: {},
|
|
4294
|
+
pinned: {}
|
|
4295
|
+
},
|
|
4296
|
+
emits: ["clear", "confirm"],
|
|
4297
|
+
setup(__props, _ref) {
|
|
4298
|
+
let {
|
|
4299
|
+
emit: __emit
|
|
4300
|
+
} = _ref;
|
|
4301
|
+
const props = __props;
|
|
4302
|
+
const emits = __emit;
|
|
4303
|
+
const format = props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss";
|
|
4304
|
+
const min = parseTimeValue(props.min, "min");
|
|
4305
|
+
const max = parseTimeValue(props.max, "max");
|
|
4306
|
+
const timeRef = ref(parseTimeValue(props.value, "min") || getTimeValue(new Date()));
|
|
4307
|
+
const isValidTimeRef = computed(() => format == "HH:mm" ? minuteItems.value && minuteItems.value[timeRef.value.minute].disabled != true : secondItems.value && secondItems.value[timeRef.value.second].disabled != true);
|
|
4308
|
+
const hourItems = shallowRef(buildHourItems(min, max));
|
|
4309
|
+
const minuteItems = shallowRef();
|
|
4310
|
+
const secondItems = shallowRef();
|
|
4311
|
+
const hItemsDom = useTemplateRef("hour-items");
|
|
4312
|
+
const mItemsDom = useTemplateRef("minute-items");
|
|
4313
|
+
const sItemsDom = useTemplateRef("second-items");
|
|
4314
|
+
async function rebuildItems(time) {
|
|
4315
|
+
time != void 0 && (timeRef.value = time);
|
|
4316
|
+
minuteItems.value = buildMinuteItems(hourItems.value[timeRef.value.hour], min, max);
|
|
4317
|
+
secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
|
|
4318
|
+
await nextTick();
|
|
4319
|
+
scrollIntoView(hItemsDom.value);
|
|
4320
|
+
scrollIntoView(mItemsDom.value);
|
|
4321
|
+
scrollIntoView(sItemsDom.value);
|
|
4322
|
+
}
|
|
4323
|
+
function scrollIntoView(items) {
|
|
4324
|
+
let activeIndex = void 0;
|
|
4325
|
+
for (var index = 0; index < (items ? items.children.length : 0); index++) {
|
|
4326
|
+
const ele = items.children[index];
|
|
4327
|
+
if (ele.classList.contains("active") == true) {
|
|
4328
|
+
activeIndex = index;
|
|
4329
|
+
break;
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
activeIndex != void 0 && items.children[activeIndex].scrollIntoView({
|
|
4333
|
+
behavior: "smooth",
|
|
4334
|
+
block: "center"
|
|
4335
|
+
});
|
|
4336
|
+
}
|
|
4337
|
+
function onHourClick(item, dbClick) {
|
|
4338
|
+
if (item.disabled != true && timeRef.value.hour != item.hour) {
|
|
4339
|
+
timeRef.value.hour = item.hour;
|
|
4340
|
+
minuteItems.value = buildMinuteItems(item, min, max);
|
|
4341
|
+
secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
function onMinuteClick(item, dbClick) {
|
|
4345
|
+
if (item.disabled != true) {
|
|
4346
|
+
timeRef.value.minute = item.minute;
|
|
4347
|
+
if (format == "HH:mm") {
|
|
4348
|
+
dbClick && onConfirm();
|
|
4349
|
+
} else if (timeRef.value.minute != item.minute) {
|
|
4350
|
+
secondItems.value = buildSecondItems(item, min, max);
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
function onSecondClick(item, dbClick) {
|
|
4355
|
+
if (item.disabled != true) {
|
|
4356
|
+
timeRef.value.second = item.second;
|
|
4357
|
+
dbClick && onConfirm();
|
|
4358
|
+
}
|
|
4359
|
+
}
|
|
4360
|
+
function onConfirm() {
|
|
4361
|
+
if (isValidTimeRef.value == true) {
|
|
4362
|
+
const value = formatTimeValue(timeRef.value, format);
|
|
4363
|
+
emits("confirm", value);
|
|
4364
|
+
props.inPopup && props.closePopup(value);
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4367
|
+
onMounted(rebuildItems);
|
|
4368
|
+
return (_ctx, _cache) => {
|
|
4369
|
+
return openBlock(), createBlock(_sfc_main$f, {
|
|
4370
|
+
class: normalizeClass(["snail-time-picker-popup", {
|
|
4371
|
+
"second-disabled": unref(format) != "HH:mm:ss"
|
|
4372
|
+
}]),
|
|
4373
|
+
direction: "vertical"
|
|
4374
|
+
}, createSlots({
|
|
4375
|
+
main: withCtx(() => [createVNode(_sfc_main$x, {
|
|
4376
|
+
multiple: "",
|
|
4377
|
+
effect: unref(MOTION).top
|
|
4378
|
+
}, {
|
|
4379
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$6, [(openBlock(true), createElementBlock(Fragment, null, renderList(hourItems.value, item => {
|
|
4380
|
+
return openBlock(), createElementBlock("div", {
|
|
4381
|
+
class: normalizeClass(["tzi-number", {
|
|
4382
|
+
active: item.hour == timeRef.value.hour,
|
|
4383
|
+
disabled: item.disabled
|
|
4384
|
+
}]),
|
|
4385
|
+
key: item.hour,
|
|
4386
|
+
textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
|
|
4387
|
+
onClick: $event => onHourClick(item),
|
|
4388
|
+
onDblclick: $event => onHourClick(item)
|
|
4389
|
+
}, null, 42, _hoisted_2$5);
|
|
4390
|
+
}), 128))], 512), createElementVNode("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
|
|
4391
|
+
return openBlock(), createElementBlock("div", {
|
|
4392
|
+
class: normalizeClass(["tzi-number", {
|
|
4393
|
+
active: item.minute == timeRef.value.minute,
|
|
4394
|
+
disabled: item.disabled
|
|
4395
|
+
}]),
|
|
4396
|
+
key: `${item.hour}:${item.minute}`,
|
|
4397
|
+
textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
|
|
4398
|
+
onClick: $event => onMinuteClick(item),
|
|
4399
|
+
onDblclick: $event => onMinuteClick(item, true)
|
|
4400
|
+
}, null, 42, _hoisted_4$1);
|
|
4401
|
+
}), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
|
|
4402
|
+
return openBlock(), createElementBlock("div", {
|
|
4403
|
+
class: normalizeClass(["tzi-number", {
|
|
4404
|
+
active: item.second == timeRef.value.second,
|
|
4405
|
+
disabled: item.disabled
|
|
4406
|
+
}]),
|
|
4407
|
+
key: `${item.hour}:${item.minute}:${item.second}`,
|
|
4408
|
+
textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
|
|
4409
|
+
onClick: $event => onSecondClick(item),
|
|
4410
|
+
onDblclick: $event => onSecondClick(item, true)
|
|
4411
|
+
}, null, 42, _hoisted_6$1);
|
|
4412
|
+
}), 128))], 512)) : createCommentVNode("", true)]),
|
|
4413
|
+
_: 1
|
|
4414
|
+
}, 8, ["effect"])]),
|
|
4415
|
+
_: 2
|
|
4416
|
+
}, [__props.toolbarDisabled != true ? {
|
|
4417
|
+
name: "bottom",
|
|
4418
|
+
fn: withCtx(() => [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
|
|
4419
|
+
key: 0,
|
|
4420
|
+
type: "link",
|
|
4421
|
+
size: "small",
|
|
4422
|
+
textContent: "清空",
|
|
4423
|
+
onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), __props.inPopup && __props.closePopup("")))
|
|
4424
|
+
})) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$G, {
|
|
4425
|
+
key: 1,
|
|
4426
|
+
type: "link",
|
|
4427
|
+
size: "small",
|
|
4428
|
+
textContent: "现在",
|
|
4429
|
+
onClick: _cache[1] || (_cache[1] = $event => rebuildItems(unref(getTimeValue)(new Date())))
|
|
4430
|
+
})) : createCommentVNode("", true), createVNode(_sfc_main$G, {
|
|
4431
|
+
type: "link",
|
|
4432
|
+
size: "small",
|
|
4433
|
+
textContent: "确定",
|
|
4434
|
+
class: normalizeClass({
|
|
4435
|
+
disabled: isValidTimeRef.value != true
|
|
4436
|
+
}),
|
|
4437
|
+
onClick: onConfirm
|
|
4438
|
+
}, null, 8, ["class"])]),
|
|
4439
|
+
key: "0"
|
|
4440
|
+
} : void 0]), 1032, ["class"]);
|
|
4441
|
+
};
|
|
4442
|
+
}
|
|
4443
|
+
});
|
|
4444
|
+
|
|
4445
|
+
const _hoisted_1$5 = {
|
|
4446
|
+
class: "snail-scroll-picker"
|
|
4447
|
+
};
|
|
4448
|
+
const _hoisted_2$4 = {
|
|
4583
4449
|
key: 0,
|
|
4584
4450
|
class: "pick-header"
|
|
4585
4451
|
};
|
|
4586
|
-
const
|
|
4452
|
+
const _hoisted_3 = ["textContent"];
|
|
4453
|
+
const _hoisted_4 = {
|
|
4587
4454
|
class: "pick-body"
|
|
4588
4455
|
};
|
|
4589
|
-
const
|
|
4456
|
+
const _hoisted_5 = {
|
|
4590
4457
|
class: "pick-items",
|
|
4591
4458
|
ref: "pick-items"
|
|
4592
4459
|
};
|
|
4593
|
-
const
|
|
4460
|
+
const _hoisted_6 = ["textContent"];
|
|
4594
4461
|
const itemHeight = 32;
|
|
4595
|
-
var _sfc_main$
|
|
4462
|
+
var _sfc_main$5 = defineComponent({
|
|
4596
4463
|
__name: "scroll-picker",
|
|
4597
4464
|
props: {
|
|
4598
4465
|
items: {},
|
|
4599
4466
|
value: {},
|
|
4600
4467
|
title: {},
|
|
4468
|
+
clearDisabled: {
|
|
4469
|
+
type: Boolean
|
|
4470
|
+
},
|
|
4601
4471
|
inPopup: {},
|
|
4602
4472
|
closePopup: {
|
|
4603
4473
|
type: Function
|
|
@@ -4653,20 +4523,32 @@ var _sfc_main$3 = defineComponent({
|
|
|
4653
4523
|
index != -1 && onTimeout(() => elasticRef.value.scrollTo(void 0, -itemHeight * index), 50);
|
|
4654
4524
|
});
|
|
4655
4525
|
return (_ctx, _cache) => {
|
|
4656
|
-
return openBlock(), createElementBlock("div", {
|
|
4657
|
-
class:
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
},
|
|
4526
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [__props.inPopup ? (openBlock(), createElementBlock("div", _hoisted_2$4, [createElementVNode("span", {
|
|
4527
|
+
class: "pick-button",
|
|
4528
|
+
textContent: "取消",
|
|
4529
|
+
onClick: _cache[0] || (_cache[0] = $event => __props.closePopup(void 0))
|
|
4530
|
+
}), __props.clearDisabled != true ? (openBlock(), createElementBlock("span", {
|
|
4531
|
+
key: 0,
|
|
4532
|
+
class: "pick-button",
|
|
4533
|
+
textContent: "清空",
|
|
4534
|
+
onClick: _cache[1] || (_cache[1] = $event => __props.closePopup(""))
|
|
4535
|
+
})) : createCommentVNode("", true), createElementVNode("span", {
|
|
4536
|
+
class: "pick-title ellipsis",
|
|
4537
|
+
textContent: toDisplayString(__props.title)
|
|
4538
|
+
}, null, 8, _hoisted_3), createElementVNode("span", {
|
|
4539
|
+
class: "pick-button",
|
|
4540
|
+
textContent: "确定",
|
|
4541
|
+
onClick: _cache[2] || (_cache[2] = $event => __props.closePopup(valueRef.value))
|
|
4542
|
+
})])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, item => {
|
|
4661
4543
|
return openBlock(), createElementBlock("span", {
|
|
4662
4544
|
class: normalizeClass(["pick-item", {
|
|
4663
4545
|
selected: item.code === valueRef.value,
|
|
4664
4546
|
disabled: item.disabled
|
|
4665
4547
|
}]),
|
|
4666
4548
|
key: item.code,
|
|
4667
|
-
textContent: toDisplayString(item.
|
|
4668
|
-
}, null, 10,
|
|
4669
|
-
}), 128))], 512), _cache[
|
|
4549
|
+
textContent: toDisplayString(item.name)
|
|
4550
|
+
}, null, 10, _hoisted_6);
|
|
4551
|
+
}), 128))], 512), _cache[3] || (_cache[3] = createElementVNode("div", {
|
|
4670
4552
|
class: "pick-layer"
|
|
4671
4553
|
}, [createElementVNode("span", {
|
|
4672
4554
|
class: "layer-top"
|
|
@@ -4674,26 +4556,29 @@ var _sfc_main$3 = defineComponent({
|
|
|
4674
4556
|
class: "layer-selection"
|
|
4675
4557
|
}), createElementVNode("span", {
|
|
4676
4558
|
class: "layer-bottom"
|
|
4677
|
-
})], -1))])]
|
|
4559
|
+
})], -1))])]);
|
|
4678
4560
|
};
|
|
4679
4561
|
}
|
|
4680
4562
|
});
|
|
4681
4563
|
|
|
4682
|
-
function usePicker() {
|
|
4683
|
-
const
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4564
|
+
function usePicker(options) {
|
|
4565
|
+
const global = options ? options.global : false;
|
|
4566
|
+
const popup = usePopup({
|
|
4567
|
+
global
|
|
4568
|
+
});
|
|
4569
|
+
function showDate(target, options2, popupOptions) {
|
|
4570
|
+
options2 = {
|
|
4571
|
+
...options2
|
|
4687
4572
|
};
|
|
4688
|
-
return showPicker(target, _sfc_main$
|
|
4573
|
+
return showPicker(target, _sfc_main$7, options2, popupOptions);
|
|
4689
4574
|
}
|
|
4690
|
-
function showTime(target,
|
|
4691
|
-
|
|
4692
|
-
...
|
|
4575
|
+
function showTime(target, options2, popupOptions) {
|
|
4576
|
+
options2 = {
|
|
4577
|
+
...options2
|
|
4693
4578
|
};
|
|
4694
|
-
return showPicker(target, _sfc_main$
|
|
4579
|
+
return showPicker(target, _sfc_main$6, options2, popupOptions);
|
|
4695
4580
|
}
|
|
4696
|
-
function showScroll(
|
|
4581
|
+
function showScroll(options2) {
|
|
4697
4582
|
const popupOptions = {
|
|
4698
4583
|
mode: "dialog",
|
|
4699
4584
|
dialog: {
|
|
@@ -4701,9 +4586,9 @@ function usePicker() {
|
|
|
4701
4586
|
closeOnMask: true
|
|
4702
4587
|
}
|
|
4703
4588
|
};
|
|
4704
|
-
return showPicker(void 0, _sfc_main$
|
|
4589
|
+
return showPicker(void 0, _sfc_main$5, options2, popupOptions);
|
|
4705
4590
|
}
|
|
4706
|
-
function showPicker(target, component,
|
|
4591
|
+
function showPicker(target, component, options2, popupOptions) {
|
|
4707
4592
|
if (popupOptions && popupOptions.mode == "dialog") {
|
|
4708
4593
|
return popup.dialog({
|
|
4709
4594
|
component,
|
|
@@ -4712,7 +4597,7 @@ function usePicker() {
|
|
|
4712
4597
|
closeOnMask: true
|
|
4713
4598
|
}),
|
|
4714
4599
|
props: {
|
|
4715
|
-
...
|
|
4600
|
+
...options2,
|
|
4716
4601
|
picker: manager,
|
|
4717
4602
|
popup
|
|
4718
4603
|
}
|
|
@@ -4730,7 +4615,7 @@ function usePicker() {
|
|
|
4730
4615
|
...follow,
|
|
4731
4616
|
component,
|
|
4732
4617
|
props: {
|
|
4733
|
-
...
|
|
4618
|
+
...options2,
|
|
4734
4619
|
picker: manager,
|
|
4735
4620
|
popup
|
|
4736
4621
|
}
|
|
@@ -4741,11 +4626,189 @@ function usePicker() {
|
|
|
4741
4626
|
showDate,
|
|
4742
4627
|
showTime,
|
|
4743
4628
|
showScroll
|
|
4744
|
-
},
|
|
4629
|
+
}, {
|
|
4630
|
+
global,
|
|
4631
|
+
type: "IPickerManager"
|
|
4632
|
+
}));
|
|
4745
4633
|
manager.onDestroy(popup.destroy);
|
|
4746
4634
|
return manager;
|
|
4747
4635
|
}
|
|
4748
4636
|
|
|
4637
|
+
const _hoisted_1$4 = {
|
|
4638
|
+
class: "action-slot flex-cross-center"
|
|
4639
|
+
};
|
|
4640
|
+
const _hoisted_2$3 = ["textContent"];
|
|
4641
|
+
var _sfc_main$4 = defineComponent({
|
|
4642
|
+
__name: "action",
|
|
4643
|
+
props: {
|
|
4644
|
+
disabled: {
|
|
4645
|
+
type: Boolean
|
|
4646
|
+
},
|
|
4647
|
+
value: {},
|
|
4648
|
+
actions: {},
|
|
4649
|
+
mode: {},
|
|
4650
|
+
icon: {},
|
|
4651
|
+
popup: {},
|
|
4652
|
+
follow: {}
|
|
4653
|
+
},
|
|
4654
|
+
emits: ["trigger"],
|
|
4655
|
+
setup(__props, _ref) {
|
|
4656
|
+
let {
|
|
4657
|
+
emit: __emit
|
|
4658
|
+
} = _ref;
|
|
4659
|
+
const props = __props;
|
|
4660
|
+
const emits = __emit;
|
|
4661
|
+
const {
|
|
4662
|
+
follow
|
|
4663
|
+
} = usePopup();
|
|
4664
|
+
const {
|
|
4665
|
+
showScroll
|
|
4666
|
+
} = usePicker();
|
|
4667
|
+
const {
|
|
4668
|
+
onTouch
|
|
4669
|
+
} = useObserver();
|
|
4670
|
+
const valueRef = shallowRef(props.value);
|
|
4671
|
+
const rootDom = useTemplateRef("snail-action");
|
|
4672
|
+
const popupScopeRef = shallowRef(void 0);
|
|
4673
|
+
const slotHandle = Object.freeze({
|
|
4674
|
+
isActived: () => popupScopeRef.value != void 0,
|
|
4675
|
+
trigger: () => onShowActions(props.mode == "press")
|
|
4676
|
+
});
|
|
4677
|
+
function buildDefaultText() {
|
|
4678
|
+
if (isArrayNotEmpty(props.actions) == true) {
|
|
4679
|
+
const item = props.actions.find(item2 => item2.code == valueRef.value) || props.actions[0];
|
|
4680
|
+
return item.name;
|
|
4681
|
+
}
|
|
4682
|
+
return void 0;
|
|
4683
|
+
}
|
|
4684
|
+
async function onShowActions(longPress) {
|
|
4685
|
+
if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
|
|
4686
|
+
popupScopeRef.value.destroy();
|
|
4687
|
+
popupScopeRef.value = void 0;
|
|
4688
|
+
}
|
|
4689
|
+
if (props.disabled != true) {
|
|
4690
|
+
switch (props.popup) {
|
|
4691
|
+
case "picker":
|
|
4692
|
+
{
|
|
4693
|
+
popupScopeRef.value = showScroll({
|
|
4694
|
+
value: valueRef.value,
|
|
4695
|
+
items: props.actions,
|
|
4696
|
+
clearDisabled: true
|
|
4697
|
+
});
|
|
4698
|
+
break;
|
|
4699
|
+
}
|
|
4700
|
+
default:
|
|
4701
|
+
{
|
|
4702
|
+
const followOptions = props.follow || Object.create(null);
|
|
4703
|
+
popupScopeRef.value = follow(rootDom.value, {
|
|
4704
|
+
component: _sfc_main$8,
|
|
4705
|
+
closeOnEscape: true,
|
|
4706
|
+
closeOnMask: true,
|
|
4707
|
+
closeOnResize: true,
|
|
4708
|
+
closeOnTarget: true,
|
|
4709
|
+
followX: followOptions.followX || ["center", "start", "end", "after", "before", "ratio"],
|
|
4710
|
+
followY: followOptions.followY || ["after", "before", "center", "end", "start", "ratio"],
|
|
4711
|
+
spaceX: followOptions.spaceX,
|
|
4712
|
+
spaceY: followOptions.spaceY,
|
|
4713
|
+
props: {
|
|
4714
|
+
mode: "vertical",
|
|
4715
|
+
actions: props.actions
|
|
4716
|
+
}
|
|
4717
|
+
});
|
|
4718
|
+
break;
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
const code = await popupScopeRef.value;
|
|
4722
|
+
popupScopeRef.value = void 0;
|
|
4723
|
+
if (isStringNotEmpty(code) == true) {
|
|
4724
|
+
valueRef.value = code;
|
|
4725
|
+
emits("trigger", code);
|
|
4726
|
+
}
|
|
4727
|
+
}
|
|
4728
|
+
}
|
|
4729
|
+
onMounted(() => {
|
|
4730
|
+
onTouch(rootDom.value, {}, detail => {
|
|
4731
|
+
if (props.mode == "press" && detail.status == "end") {
|
|
4732
|
+
const time = detail.now.timestamp - detail.start.timestamp;
|
|
4733
|
+
if (time > 500) {
|
|
4734
|
+
navigator.vibrate && navigator.vibrate(200);
|
|
4735
|
+
onShowActions();
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
});
|
|
4739
|
+
});
|
|
4740
|
+
return (_ctx, _cache) => {
|
|
4741
|
+
return openBlock(), createElementBlock("div", {
|
|
4742
|
+
class: normalizeClass(["snail-action flex-cross-center", {
|
|
4743
|
+
button: __props.mode == "whole" && __props.disabled != true
|
|
4744
|
+
}]),
|
|
4745
|
+
ref: "snail-action",
|
|
4746
|
+
onClick: _cache[1] || (_cache[1] = $event => __props.mode == "whole" && onShowActions())
|
|
4747
|
+
}, [createElementVNode("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createElementVNode("span", {
|
|
4748
|
+
class: "ellipsis",
|
|
4749
|
+
textContent: toDisplayString(buildDefaultText())
|
|
4750
|
+
}, null, 8, _hoisted_2$3)])]), __props.disabled != true && __props.mode != "press" ? (openBlock(), createElementBlock("div", {
|
|
4751
|
+
key: 0,
|
|
4752
|
+
class: normalizeClass(["trigger-slot", {
|
|
4753
|
+
"hover-show": __props.icon != "always"
|
|
4754
|
+
}])
|
|
4755
|
+
}, [renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(unref(slotHandle))), () => [createVNode(_sfc_main$F, {
|
|
4756
|
+
button: "",
|
|
4757
|
+
type: "more",
|
|
4758
|
+
size: 16,
|
|
4759
|
+
onClick: _cache[0] || (_cache[0] = $event => __props.mode != "whole" && onShowActions())
|
|
4760
|
+
})])], 2)) : createCommentVNode("", true)], 2);
|
|
4761
|
+
};
|
|
4762
|
+
}
|
|
4763
|
+
});
|
|
4764
|
+
|
|
4765
|
+
const _hoisted_1$3 = {
|
|
4766
|
+
class: "snail-flash-number"
|
|
4767
|
+
};
|
|
4768
|
+
const _hoisted_2$2 = ["textContent"];
|
|
4769
|
+
var _sfc_main$3 = defineComponent({
|
|
4770
|
+
__name: "flash-number",
|
|
4771
|
+
props: {
|
|
4772
|
+
value: {}
|
|
4773
|
+
},
|
|
4774
|
+
setup(__props) {
|
|
4775
|
+
const props = __props;
|
|
4776
|
+
const itemsRef = ref();
|
|
4777
|
+
function buildNumberItems() {
|
|
4778
|
+
itemsRef.value = [];
|
|
4779
|
+
const value = isNullish(props.value) ? null : String(props.value);
|
|
4780
|
+
if (isStringNotEmpty(value) == true) {
|
|
4781
|
+
for (const item of value) {
|
|
4782
|
+
const number = parseInt(item);
|
|
4783
|
+
const isNumber = 0 <= number && number <= 9;
|
|
4784
|
+
itemsRef.value.push({
|
|
4785
|
+
id: newId(),
|
|
4786
|
+
text: item,
|
|
4787
|
+
number: isNumber ? number : void 0
|
|
4788
|
+
});
|
|
4789
|
+
}
|
|
4790
|
+
}
|
|
4791
|
+
if (isArrayNotEmpty(itemsRef.value) == true) ;
|
|
4792
|
+
}
|
|
4793
|
+
onMounted(() => {
|
|
4794
|
+
buildNumberItems();
|
|
4795
|
+
});
|
|
4796
|
+
return (_ctx, _cache) => {
|
|
4797
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
|
|
4798
|
+
return openBlock(), createElementBlock("span", {
|
|
4799
|
+
key: item.id,
|
|
4800
|
+
textContent: toDisplayString(item.text),
|
|
4801
|
+
class: normalizeClass(unref(isNullish)(item.number) ? "" : "number-item")
|
|
4802
|
+
}, null, 10, _hoisted_2$2);
|
|
4803
|
+
}), 128)), _cache[0] || (_cache[0] = createElementVNode("span", {
|
|
4804
|
+
style: {
|
|
4805
|
+
"color": "red"
|
|
4806
|
+
}
|
|
4807
|
+
}, "-----还没实现,别用", -1))]);
|
|
4808
|
+
};
|
|
4809
|
+
}
|
|
4810
|
+
});
|
|
4811
|
+
|
|
4749
4812
|
const _hoisted_1$2 = ["title"];
|
|
4750
4813
|
const _hoisted_2$1 = ["textContent"];
|
|
4751
4814
|
var _sfc_main$2 = defineComponent({
|
|
@@ -5032,7 +5095,6 @@ var _sfc_main = defineComponent({
|
|
|
5032
5095
|
});
|
|
5033
5096
|
|
|
5034
5097
|
const components = {
|
|
5035
|
-
Action: _sfc_main$h,
|
|
5036
5098
|
Button: _sfc_main$G,
|
|
5037
5099
|
Choose: _sfc_main$E,
|
|
5038
5100
|
Footer: _sfc_main$D,
|
|
@@ -5045,21 +5107,22 @@ const components = {
|
|
|
5045
5107
|
Switch: _sfc_main$k,
|
|
5046
5108
|
Textarea: _sfc_main$j,
|
|
5047
5109
|
Dynamic: _sfc_main$v,
|
|
5048
|
-
Elastic: _sfc_main$
|
|
5049
|
-
Flex: _sfc_main$
|
|
5050
|
-
Fold: _sfc_main$
|
|
5110
|
+
Elastic: _sfc_main$i,
|
|
5111
|
+
Flex: _sfc_main$h,
|
|
5112
|
+
Fold: _sfc_main$g,
|
|
5051
5113
|
Motion: _sfc_main$x,
|
|
5052
|
-
Layout: _sfc_main$
|
|
5114
|
+
Layout: _sfc_main$f,
|
|
5053
5115
|
Scroll: _sfc_main$u,
|
|
5054
|
-
Sort: _sfc_main$
|
|
5055
|
-
Table: _sfc_main$
|
|
5056
|
-
TableRow: _sfc_main$
|
|
5057
|
-
TableCol: _sfc_main$
|
|
5058
|
-
Tree: _sfc_main$
|
|
5116
|
+
Sort: _sfc_main$e,
|
|
5117
|
+
Table: _sfc_main$d,
|
|
5118
|
+
TableRow: _sfc_main$c,
|
|
5119
|
+
TableCol: _sfc_main$b,
|
|
5120
|
+
Tree: _sfc_main$9,
|
|
5059
5121
|
Wrapper: _sfc_main$t,
|
|
5060
|
-
|
|
5122
|
+
Action: _sfc_main$4,
|
|
5123
|
+
FlashNumber: _sfc_main$3,
|
|
5061
5124
|
DatePicker: _sfc_main$2,
|
|
5062
|
-
ScrollPicker: _sfc_main$
|
|
5125
|
+
ScrollPicker: _sfc_main$5,
|
|
5063
5126
|
TimePicker: _sfc_main$1,
|
|
5064
5127
|
DragVerify: _sfc_main,
|
|
5065
5128
|
Empty: _sfc_main$o,
|
|
@@ -5067,7 +5130,7 @@ const components = {
|
|
|
5067
5130
|
};
|
|
5068
5131
|
|
|
5069
5132
|
onMountScope(scope => {
|
|
5070
|
-
getCurrentScope() && onScopeDispose(scope.destroy);
|
|
5133
|
+
scope.global != true && getCurrentScope() && onScopeDispose(scope.destroy);
|
|
5071
5134
|
});
|
|
5072
5135
|
|
|
5073
5136
|
export { MOTION, components, getBuiltinIcon, mount, onAppCreated, triggerAppCreated, usePicker, usePopup, useReactive, useTreeContext };
|