snail.vue 2.0.31 → 2.0.32
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 +155 -129
- package/dist/snail.vue.js +332 -291
- package/dist/snail.vue.umd.js +330 -289
- package/dist/styles/snail.vue.vue.css +5 -5
- package/package.json +2 -2
package/dist/snail.vue.umd.js
CHANGED
|
@@ -33,10 +33,6 @@
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
var addLink = href => setTimeout(snail_view.link.register, 0, href);
|
|
37
|
-
|
|
38
|
-
addLink("/styles/snail.vue.vue.css");
|
|
39
|
-
|
|
40
36
|
function getBuiltinIcon(iconType) {
|
|
41
37
|
switch (iconType) {
|
|
42
38
|
case "success":
|
|
@@ -265,6 +261,10 @@
|
|
|
265
261
|
}
|
|
266
262
|
});
|
|
267
263
|
|
|
264
|
+
var addLink = href => setTimeout(snail_view.link.register, 0, href);
|
|
265
|
+
|
|
266
|
+
addLink("/styles/snail.vue.vue.css");
|
|
267
|
+
|
|
268
268
|
var _sfc_main$D = vue.defineComponent({
|
|
269
269
|
...{
|
|
270
270
|
name: "Footer",
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
class: "input-body"
|
|
377
377
|
};
|
|
378
378
|
const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
|
|
379
|
-
const _hoisted_5$
|
|
379
|
+
const _hoisted_5$4 = ["title"];
|
|
380
380
|
var _sfc_main$B = vue.defineComponent({
|
|
381
381
|
...{
|
|
382
382
|
name: "Input",
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
button: "",
|
|
448
448
|
size: 16,
|
|
449
449
|
color: "red"
|
|
450
|
-
})], 8, _hoisted_5$
|
|
450
|
+
})], 8, _hoisted_5$4)) : vue.createCommentVNode("", true)])], 2);
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
453
|
});
|
|
@@ -662,8 +662,8 @@
|
|
|
662
662
|
key: 1,
|
|
663
663
|
class: "number-suffix"
|
|
664
664
|
};
|
|
665
|
-
const _hoisted_5$
|
|
666
|
-
const _hoisted_6$
|
|
665
|
+
const _hoisted_5$3 = ["textContent"];
|
|
666
|
+
const _hoisted_6$3 = ["title", "textContent"];
|
|
667
667
|
const _hoisted_7$1 = ["title", "textContent"];
|
|
668
668
|
var _sfc_main$A = vue.defineComponent({
|
|
669
669
|
__name: "number",
|
|
@@ -864,12 +864,12 @@
|
|
|
864
864
|
})])], 64)) : vue.createCommentVNode("", true)], 2), vue.unref(hasSuffix) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [vue.createElementVNode("span", {
|
|
865
865
|
class: "ellipsis",
|
|
866
866
|
textContent: vue.toDisplayString(vue.unref(suffix))
|
|
867
|
-
}, null, 8, _hoisted_5$
|
|
867
|
+
}, null, 8, _hoisted_5$3)])) : vue.createCommentVNode("", true), vue.unref(upper) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
868
868
|
key: 2,
|
|
869
869
|
class: "number-util ellipsis",
|
|
870
870
|
title: upperTextRef.value,
|
|
871
871
|
textContent: vue.toDisplayString(`大写:${upperTextRef.value || ""}`)
|
|
872
|
-
}, null, 8, _hoisted_6$
|
|
872
|
+
}, null, 8, _hoisted_6$3)) : vue.createCommentVNode("", true), vue.unref(thousands) == "below" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
873
873
|
key: 3,
|
|
874
874
|
class: "number-util ellipsis",
|
|
875
875
|
title: thousandsTextRef.value,
|
|
@@ -1609,6 +1609,11 @@
|
|
|
1609
1609
|
onBeforeClose
|
|
1610
1610
|
});
|
|
1611
1611
|
let fn_onBuildData = void 0;
|
|
1612
|
+
let mousedownTarget = void 0;
|
|
1613
|
+
function onDialogRootClick(evt) {
|
|
1614
|
+
evt.target === mousedownTarget && __props.options.closeOnMask && closePopup();
|
|
1615
|
+
mousedownTarget = void 0;
|
|
1616
|
+
}
|
|
1612
1617
|
const registerBuildDataFunc = fn => {
|
|
1613
1618
|
snail_core.mustFunction(fn, "fn");
|
|
1614
1619
|
fn_onBuildData = fn;
|
|
@@ -1626,6 +1631,7 @@
|
|
|
1626
1631
|
onEvent(window, "keyup", event => {
|
|
1627
1632
|
event.key === "Escape" && __props.popupStatus.value == "active" && __props.options.closeOnEscape && closePopup();
|
|
1628
1633
|
});
|
|
1634
|
+
onEvent(window, "click", () => mousedownTarget = void 0);
|
|
1629
1635
|
});
|
|
1630
1636
|
return (_ctx, _cache) => {
|
|
1631
1637
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -1633,9 +1639,8 @@
|
|
|
1633
1639
|
style: vue.normalizeStyle({
|
|
1634
1640
|
"z-index": __props.zIndex
|
|
1635
1641
|
}),
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
}, ["self"]))
|
|
1642
|
+
onMousedown: _cache[3] || (_cache[3] = vue.withModifiers(evt => vue.isRef(mousedownTarget) ? mousedownTarget.value = evt.target : mousedownTarget = evt.target, ["self"])),
|
|
1643
|
+
onClick: vue.withModifiers(onDialogRootClick, ["self"])
|
|
1639
1644
|
}, [__props.options.wrapper == void 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$v, vue.mergeProps({
|
|
1640
1645
|
key: 0,
|
|
1641
1646
|
class: "dialog-body",
|
|
@@ -1667,7 +1672,7 @@
|
|
|
1667
1672
|
"on-build-data": registerBuildDataFunc
|
|
1668
1673
|
}), null, 16, ["name", "component", "url", "props", "popup-status", "modelValue"])]),
|
|
1669
1674
|
_: 1
|
|
1670
|
-
}, 16))],
|
|
1675
|
+
}, 16))], 38);
|
|
1671
1676
|
};
|
|
1672
1677
|
}
|
|
1673
1678
|
});
|
|
@@ -2741,173 +2746,7 @@
|
|
|
2741
2746
|
}
|
|
2742
2747
|
});
|
|
2743
2748
|
|
|
2744
|
-
const _hoisted_1$c = ["onClick"];
|
|
2745
|
-
const _hoisted_2$9 = ["textContent"];
|
|
2746
2749
|
var _sfc_main$i = vue.defineComponent({
|
|
2747
|
-
__name: "action-items",
|
|
2748
|
-
props: {
|
|
2749
|
-
mode: {},
|
|
2750
|
-
actions: {},
|
|
2751
|
-
inPopup: {},
|
|
2752
|
-
closePopup: {
|
|
2753
|
-
type: Function
|
|
2754
|
-
},
|
|
2755
|
-
popupStatus: {},
|
|
2756
|
-
target: {},
|
|
2757
|
-
followX: {},
|
|
2758
|
-
followY: {},
|
|
2759
|
-
pinned: {}
|
|
2760
|
-
},
|
|
2761
|
-
emits: ["trigger"],
|
|
2762
|
-
setup(__props, _ref) {
|
|
2763
|
-
let {
|
|
2764
|
-
emit: __emit
|
|
2765
|
-
} = _ref;
|
|
2766
|
-
const props = __props;
|
|
2767
|
-
const emits = __emit;
|
|
2768
|
-
function onActionItemClick(code) {
|
|
2769
|
-
emits("trigger", code);
|
|
2770
|
-
props.inPopup && props.closePopup(code);
|
|
2771
|
-
}
|
|
2772
|
-
return (_ctx, _cache) => {
|
|
2773
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2774
|
-
class: vue.normalizeClass(["snail-action-items", [vue.unref(snail_core.correctString)(__props.mode, "vertical", true), vue.unref(snail_core.isStringNotEmpty)(__props.inPopup) ? "in-popup" : ""]])
|
|
2775
|
-
}, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, action => {
|
|
2776
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2777
|
-
class: "action-item flex-cross-center",
|
|
2778
|
-
key: action.code,
|
|
2779
|
-
style: vue.normalizeStyle({
|
|
2780
|
-
"--color": vue.unref(snail_core.correctString)(action.color, null, true),
|
|
2781
|
-
"--hcolor": vue.unref(snail_core.correctString)(action.hoverColor, null, true)
|
|
2782
|
-
}),
|
|
2783
|
-
onClick: $event => onActionItemClick(action.code)
|
|
2784
|
-
}, [action.icon != void 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$F, vue.mergeProps({
|
|
2785
|
-
key: 0,
|
|
2786
|
-
ref_for: true
|
|
2787
|
-
}, action.icon, {
|
|
2788
|
-
custom: false,
|
|
2789
|
-
size: 20
|
|
2790
|
-
}), null, 16)) : vue.createCommentVNode("", true), vue.createElementVNode("span", {
|
|
2791
|
-
class: "ellipsis",
|
|
2792
|
-
textContent: vue.toDisplayString(action.name)
|
|
2793
|
-
}, null, 8, _hoisted_2$9)], 12, _hoisted_1$c);
|
|
2794
|
-
}), 128))], 2);
|
|
2795
|
-
};
|
|
2796
|
-
}
|
|
2797
|
-
});
|
|
2798
|
-
|
|
2799
|
-
const _hoisted_1$b = {
|
|
2800
|
-
class: "snail-action flex-cross-center",
|
|
2801
|
-
ref: "snail-action"
|
|
2802
|
-
};
|
|
2803
|
-
const _hoisted_2$8 = {
|
|
2804
|
-
class: "action-slot flex-cross-center"
|
|
2805
|
-
};
|
|
2806
|
-
var _sfc_main$h = vue.defineComponent({
|
|
2807
|
-
__name: "action",
|
|
2808
|
-
props: {
|
|
2809
|
-
disabled: {
|
|
2810
|
-
type: Boolean
|
|
2811
|
-
},
|
|
2812
|
-
trigger: {},
|
|
2813
|
-
actions: {},
|
|
2814
|
-
followX: {},
|
|
2815
|
-
followY: {},
|
|
2816
|
-
spaceX: {},
|
|
2817
|
-
spaceY: {}
|
|
2818
|
-
},
|
|
2819
|
-
emits: ["trigger"],
|
|
2820
|
-
setup(__props, _ref) {
|
|
2821
|
-
let {
|
|
2822
|
-
emit: __emit
|
|
2823
|
-
} = _ref;
|
|
2824
|
-
const props = __props;
|
|
2825
|
-
const emits = __emit;
|
|
2826
|
-
const {
|
|
2827
|
-
follow
|
|
2828
|
-
} = usePopup();
|
|
2829
|
-
const {
|
|
2830
|
-
onEvent
|
|
2831
|
-
} = snail_view.useObserver();
|
|
2832
|
-
const rootDom = vue.useTemplateRef("snail-action");
|
|
2833
|
-
const popupScopeRef = vue.shallowRef(void 0);
|
|
2834
|
-
let pressStartDate = void 0;
|
|
2835
|
-
const slotHandle = Object.freeze({
|
|
2836
|
-
isActived: () => popupScopeRef.value != void 0,
|
|
2837
|
-
trigger: () => onFollowShow(props.trigger == "long-press")
|
|
2838
|
-
});
|
|
2839
|
-
async function onFollowShow(longPress) {
|
|
2840
|
-
if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
|
|
2841
|
-
popupScopeRef.value.destroy();
|
|
2842
|
-
} else if (props.disabled != true) {
|
|
2843
|
-
popupScopeRef.value = follow(rootDom.value, {
|
|
2844
|
-
component: _sfc_main$i,
|
|
2845
|
-
closeOnEscape: true,
|
|
2846
|
-
closeOnMask: true,
|
|
2847
|
-
closeOnResize: true,
|
|
2848
|
-
closeOnTarget: true,
|
|
2849
|
-
followX: props.followX || ["center", "start", "end", "after", "before", "ratio"],
|
|
2850
|
-
followY: props.followY || ["after", "before", "center", "end", "start", "ratio"],
|
|
2851
|
-
spaceX: props.spaceX,
|
|
2852
|
-
spaceY: props.spaceY,
|
|
2853
|
-
props: {
|
|
2854
|
-
mode: "vertical",
|
|
2855
|
-
actions: props.actions
|
|
2856
|
-
}
|
|
2857
|
-
});
|
|
2858
|
-
const code = await popupScopeRef.value;
|
|
2859
|
-
snail_core.isStringNotEmpty(code) && emits("trigger", code);
|
|
2860
|
-
}
|
|
2861
|
-
popupScopeRef.value = void 0;
|
|
2862
|
-
}
|
|
2863
|
-
function onMouseDown() {
|
|
2864
|
-
if (props.trigger == "long-press" && pressStartDate == void 0) {
|
|
2865
|
-
pressStartDate = new Date();
|
|
2866
|
-
}
|
|
2867
|
-
}
|
|
2868
|
-
function onMouseUp() {
|
|
2869
|
-
if (pressStartDate != void 0) {
|
|
2870
|
-
const time = ((new Date()).getTime() - pressStartDate.getTime()) / 1e3;
|
|
2871
|
-
pressStartDate = void 0;
|
|
2872
|
-
if (time >= 0.5) {
|
|
2873
|
-
navigator.vibrate && navigator.vibrate(200);
|
|
2874
|
-
onFollowShow();
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
function onMouseCancel() {
|
|
2879
|
-
setTimeout(() => pressStartDate = void 0, 10);
|
|
2880
|
-
}
|
|
2881
|
-
vue.onMounted(() => {
|
|
2882
|
-
onEvent(rootDom.value, "mousedown", onMouseDown);
|
|
2883
|
-
onEvent(rootDom.value, "mouseup", onMouseUp);
|
|
2884
|
-
if ("ontouchstart" in window) {
|
|
2885
|
-
onEvent(rootDom.value, "touchstart", onMouseDown);
|
|
2886
|
-
onEvent(rootDom.value, "touchend", onMouseUp);
|
|
2887
|
-
}
|
|
2888
|
-
onEvent(window, "mouseup", onMouseCancel);
|
|
2889
|
-
if ("ontouchstart" in window) {
|
|
2890
|
-
onEvent(window, "touchend", onMouseCancel);
|
|
2891
|
-
onEvent(window, "touchcancel", onMouseCancel);
|
|
2892
|
-
}
|
|
2893
|
-
});
|
|
2894
|
-
return (_ctx, _cache) => {
|
|
2895
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [vue.createElementVNode("div", _hoisted_2$8, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotHandle))))]), __props.disabled != true && (__props.trigger == "hover" || __props.trigger == "always") ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2896
|
-
key: 0,
|
|
2897
|
-
class: vue.normalizeClass(["trigger-area", {
|
|
2898
|
-
hidden: __props.trigger == "hover"
|
|
2899
|
-
}])
|
|
2900
|
-
}, [vue.renderSlot(_ctx.$slots, "trigger", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotHandle))), () => [vue.createVNode(_sfc_main$F, {
|
|
2901
|
-
button: "",
|
|
2902
|
-
type: "more",
|
|
2903
|
-
size: 16,
|
|
2904
|
-
onClick: _cache[0] || (_cache[0] = $event => onFollowShow())
|
|
2905
|
-
})])], 2)) : vue.createCommentVNode("", true)], 512);
|
|
2906
|
-
};
|
|
2907
|
-
}
|
|
2908
|
-
});
|
|
2909
|
-
|
|
2910
|
-
var _sfc_main$g = vue.defineComponent({
|
|
2911
2750
|
...{
|
|
2912
2751
|
name: "Elastic",
|
|
2913
2752
|
inheritAttrs: false
|
|
@@ -3113,7 +2952,7 @@
|
|
|
3113
2952
|
}
|
|
3114
2953
|
});
|
|
3115
2954
|
|
|
3116
|
-
var _sfc_main$
|
|
2955
|
+
var _sfc_main$h = vue.defineComponent({
|
|
3117
2956
|
...{
|
|
3118
2957
|
name: "Flex",
|
|
3119
2958
|
inheritAttrs: false
|
|
@@ -3208,13 +3047,13 @@
|
|
|
3208
3047
|
}
|
|
3209
3048
|
});
|
|
3210
3049
|
|
|
3211
|
-
const _hoisted_1$
|
|
3212
|
-
const _hoisted_2$
|
|
3050
|
+
const _hoisted_1$c = ["textContent"];
|
|
3051
|
+
const _hoisted_2$9 = ["textContent"];
|
|
3213
3052
|
const _hoisted_3$4 = {
|
|
3214
3053
|
key: 1,
|
|
3215
3054
|
class: "status"
|
|
3216
3055
|
};
|
|
3217
|
-
var _sfc_main$
|
|
3056
|
+
var _sfc_main$g = vue.defineComponent({
|
|
3218
3057
|
...{
|
|
3219
3058
|
name: "Fold",
|
|
3220
3059
|
inheritAttrs: true
|
|
@@ -3306,11 +3145,11 @@
|
|
|
3306
3145
|
}, [vue.renderSlot(_ctx.$slots, "header", vue.normalizeProps(vue.guardReactiveProps(slotHandle)), () => [vue.createElementVNode("div", {
|
|
3307
3146
|
class: "title ellipsis",
|
|
3308
3147
|
textContent: vue.toDisplayString(__props.title)
|
|
3309
|
-
}, null, 8, _hoisted_1$
|
|
3148
|
+
}, null, 8, _hoisted_1$c), !!__props.subtitle ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3310
3149
|
key: 0,
|
|
3311
3150
|
class: "subtitle ellipsis",
|
|
3312
3151
|
textContent: vue.toDisplayString(__props.subtitle)
|
|
3313
|
-
}, null, 8, _hoisted_2$
|
|
3152
|
+
}, null, 8, _hoisted_2$9)) : vue.createCommentVNode("", true), __props.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, [vue.createVNode(_sfc_main$F, {
|
|
3314
3153
|
type: "arrow",
|
|
3315
3154
|
button: "",
|
|
3316
3155
|
title: statusModel.value == "expand" ? "收起" : "展开",
|
|
@@ -3324,7 +3163,7 @@
|
|
|
3324
3163
|
}
|
|
3325
3164
|
});
|
|
3326
3165
|
|
|
3327
|
-
var _sfc_main$
|
|
3166
|
+
var _sfc_main$f = vue.defineComponent({
|
|
3328
3167
|
__name: "layout",
|
|
3329
3168
|
props: {
|
|
3330
3169
|
direction: {},
|
|
@@ -3420,7 +3259,7 @@
|
|
|
3420
3259
|
}
|
|
3421
3260
|
});
|
|
3422
3261
|
|
|
3423
|
-
var _sfc_main$
|
|
3262
|
+
var _sfc_main$e = vue.defineComponent({
|
|
3424
3263
|
...{
|
|
3425
3264
|
name: "Sort",
|
|
3426
3265
|
inheritAttrs: true
|
|
@@ -3521,10 +3360,10 @@
|
|
|
3521
3360
|
}
|
|
3522
3361
|
});
|
|
3523
3362
|
|
|
3524
|
-
const _hoisted_1$
|
|
3363
|
+
const _hoisted_1$b = {
|
|
3525
3364
|
class: "table-body"
|
|
3526
3365
|
};
|
|
3527
|
-
var _sfc_main$
|
|
3366
|
+
var _sfc_main$d = vue.defineComponent({
|
|
3528
3367
|
...{
|
|
3529
3368
|
name: "Table",
|
|
3530
3369
|
inheritAttrs: true
|
|
@@ -3554,7 +3393,7 @@
|
|
|
3554
3393
|
default: vue.withCtx(() => [vue.createElementVNode("div", {
|
|
3555
3394
|
class: "table-header",
|
|
3556
3395
|
style: vue.normalizeStyle(hStyleRef.value)
|
|
3557
|
-
}, [vue.renderSlot(_ctx.$slots, "header")], 4), vue.createElementVNode("div", _hoisted_1$
|
|
3396
|
+
}, [vue.renderSlot(_ctx.$slots, "header")], 4), vue.createElementVNode("div", _hoisted_1$b, [vue.renderSlot(_ctx.$slots, "default")]), vue.createElementVNode("div", {
|
|
3558
3397
|
class: "table-footer",
|
|
3559
3398
|
style: vue.normalizeStyle(fStyleRef.value)
|
|
3560
3399
|
}, [vue.renderSlot(_ctx.$slots, "footer")], 4)]),
|
|
@@ -3564,7 +3403,7 @@
|
|
|
3564
3403
|
}
|
|
3565
3404
|
});
|
|
3566
3405
|
|
|
3567
|
-
var _sfc_main$
|
|
3406
|
+
var _sfc_main$c = vue.defineComponent({
|
|
3568
3407
|
...{
|
|
3569
3408
|
name: "TableRow",
|
|
3570
3409
|
inheritAttrs: true
|
|
@@ -3587,7 +3426,7 @@
|
|
|
3587
3426
|
}
|
|
3588
3427
|
});
|
|
3589
3428
|
|
|
3590
|
-
var _sfc_main$
|
|
3429
|
+
var _sfc_main$b = vue.defineComponent({
|
|
3591
3430
|
...{
|
|
3592
3431
|
name: "TableCol",
|
|
3593
3432
|
inheritAttrs: true
|
|
@@ -3633,11 +3472,11 @@
|
|
|
3633
3472
|
}
|
|
3634
3473
|
});
|
|
3635
3474
|
|
|
3636
|
-
const _hoisted_1$
|
|
3475
|
+
const _hoisted_1$a = {
|
|
3637
3476
|
key: 0,
|
|
3638
3477
|
class: "node-fold"
|
|
3639
3478
|
};
|
|
3640
|
-
const _hoisted_2$
|
|
3479
|
+
const _hoisted_2$8 = ["title", "textContent"];
|
|
3641
3480
|
const _hoisted_3$3 = {
|
|
3642
3481
|
class: "node-slot ellipsis"
|
|
3643
3482
|
};
|
|
@@ -3645,7 +3484,7 @@
|
|
|
3645
3484
|
class: "snail-tree-children",
|
|
3646
3485
|
ref: "children"
|
|
3647
3486
|
};
|
|
3648
|
-
var _sfc_main$
|
|
3487
|
+
var _sfc_main$a = vue.defineComponent({
|
|
3649
3488
|
...{
|
|
3650
3489
|
name: "TreeNode",
|
|
3651
3490
|
inheritAttrs: true
|
|
@@ -3753,7 +3592,7 @@
|
|
|
3753
3592
|
key: 1
|
|
3754
3593
|
}, [_cache[5] || (_cache[5] = vue.createElementVNode("div", {
|
|
3755
3594
|
class: "indent"
|
|
3756
|
-
}, null, -1)), __props.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3595
|
+
}, null, -1)), __props.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [showChildrenRef.value ? (vue.openBlock(), vue.createBlock(_sfc_main$F, {
|
|
3757
3596
|
key: 0,
|
|
3758
3597
|
class: vue.normalizeClass(statusRef.value),
|
|
3759
3598
|
custom: "",
|
|
@@ -3768,7 +3607,7 @@
|
|
|
3768
3607
|
class: "node-text ellipsis",
|
|
3769
3608
|
title: __props.node.text,
|
|
3770
3609
|
textContent: vue.toDisplayString(__props.node.text)
|
|
3771
|
-
}, null, 8, _hoisted_2$
|
|
3610
|
+
}, null, 8, _hoisted_2$8), vue.createElementVNode("div", _hoisted_3$3, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))))])], 64))], 34), [[vue.vShow, showRef.value]]), vue.withDirectives(vue.createElementVNode("div", _hoisted_4$3, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.node.children, child => {
|
|
3772
3611
|
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
3773
3612
|
key: __props.context.getKey(child),
|
|
3774
3613
|
node: child,
|
|
@@ -3788,10 +3627,10 @@
|
|
|
3788
3627
|
}
|
|
3789
3628
|
});
|
|
3790
3629
|
|
|
3791
|
-
const _hoisted_1$
|
|
3630
|
+
const _hoisted_1$9 = {
|
|
3792
3631
|
class: "snail-tree"
|
|
3793
3632
|
};
|
|
3794
|
-
var _sfc_main$
|
|
3633
|
+
var _sfc_main$9 = vue.defineComponent({
|
|
3795
3634
|
...{
|
|
3796
3635
|
name: "Tree",
|
|
3797
3636
|
inheritAttrs: true
|
|
@@ -3825,7 +3664,7 @@
|
|
|
3825
3664
|
emits("click", node, parents);
|
|
3826
3665
|
}
|
|
3827
3666
|
return (_ctx, _cache) => {
|
|
3828
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3667
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [__props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$z, vue.mergeProps({
|
|
3829
3668
|
key: 0
|
|
3830
3669
|
}, __props.search, {
|
|
3831
3670
|
onSearch
|
|
@@ -3833,7 +3672,7 @@
|
|
|
3833
3672
|
scroll: "y"
|
|
3834
3673
|
}, {
|
|
3835
3674
|
default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.nodes || [], node => {
|
|
3836
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3675
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$a, {
|
|
3837
3676
|
key: vue.unref(context).getKey(node),
|
|
3838
3677
|
node,
|
|
3839
3678
|
parent: void 0,
|
|
@@ -3866,49 +3705,57 @@
|
|
|
3866
3705
|
return scope;
|
|
3867
3706
|
}
|
|
3868
3707
|
|
|
3869
|
-
const _hoisted_1$
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
var _sfc_main$6 = vue.defineComponent({
|
|
3874
|
-
__name: "flash-number",
|
|
3708
|
+
const _hoisted_1$8 = ["onClick"];
|
|
3709
|
+
const _hoisted_2$7 = ["textContent"];
|
|
3710
|
+
var _sfc_main$8 = vue.defineComponent({
|
|
3711
|
+
__name: "action-items",
|
|
3875
3712
|
props: {
|
|
3876
|
-
|
|
3713
|
+
mode: {},
|
|
3714
|
+
actions: {},
|
|
3715
|
+
inPopup: {},
|
|
3716
|
+
closePopup: {
|
|
3717
|
+
type: Function
|
|
3718
|
+
},
|
|
3719
|
+
popupStatus: {},
|
|
3720
|
+
target: {},
|
|
3721
|
+
followX: {},
|
|
3722
|
+
followY: {},
|
|
3723
|
+
pinned: {}
|
|
3877
3724
|
},
|
|
3878
|
-
|
|
3725
|
+
emits: ["trigger"],
|
|
3726
|
+
setup(__props, _ref) {
|
|
3727
|
+
let {
|
|
3728
|
+
emit: __emit
|
|
3729
|
+
} = _ref;
|
|
3879
3730
|
const props = __props;
|
|
3880
|
-
const
|
|
3881
|
-
function
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
if (snail_core.isStringNotEmpty(value) == true) {
|
|
3885
|
-
for (const item of value) {
|
|
3886
|
-
const number = parseInt(item);
|
|
3887
|
-
const isNumber = 0 <= number && number <= 9;
|
|
3888
|
-
itemsRef.value.push({
|
|
3889
|
-
id: snail_core.newId(),
|
|
3890
|
-
text: item,
|
|
3891
|
-
number: isNumber ? number : void 0
|
|
3892
|
-
});
|
|
3893
|
-
}
|
|
3894
|
-
}
|
|
3895
|
-
if (snail_core.isArrayNotEmpty(itemsRef.value) == true) ;
|
|
3731
|
+
const emits = __emit;
|
|
3732
|
+
function onActionItemClick(code) {
|
|
3733
|
+
emits("trigger", code);
|
|
3734
|
+
props.inPopup && props.closePopup(code);
|
|
3896
3735
|
}
|
|
3897
|
-
vue.onMounted(() => {
|
|
3898
|
-
buildNumberItems();
|
|
3899
|
-
});
|
|
3900
3736
|
return (_ctx, _cache) => {
|
|
3901
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
class:
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3737
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3738
|
+
class: vue.normalizeClass(["snail-action-items", [vue.unref(snail_core.correctString)(__props.mode, "vertical", true), vue.unref(snail_core.isStringNotEmpty)(__props.inPopup) ? "in-popup" : ""]])
|
|
3739
|
+
}, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, action => {
|
|
3740
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3741
|
+
class: "action-item flex-cross-center",
|
|
3742
|
+
key: action.code,
|
|
3743
|
+
style: vue.normalizeStyle({
|
|
3744
|
+
"--color": vue.unref(snail_core.correctString)(action.color, null, true),
|
|
3745
|
+
"--hcolor": vue.unref(snail_core.correctString)(action.hoverColor, null, true)
|
|
3746
|
+
}),
|
|
3747
|
+
onClick: $event => onActionItemClick(action.code)
|
|
3748
|
+
}, [action.icon != void 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$F, vue.mergeProps({
|
|
3749
|
+
key: 0,
|
|
3750
|
+
ref_for: true
|
|
3751
|
+
}, action.icon, {
|
|
3752
|
+
custom: false,
|
|
3753
|
+
size: 20
|
|
3754
|
+
}), null, 16)) : vue.createCommentVNode("", true), vue.createElementVNode("span", {
|
|
3755
|
+
class: "ellipsis",
|
|
3756
|
+
textContent: vue.toDisplayString(action.name)
|
|
3757
|
+
}, null, 8, _hoisted_2$7)], 12, _hoisted_1$8);
|
|
3758
|
+
}), 128))], 2);
|
|
3912
3759
|
};
|
|
3913
3760
|
}
|
|
3914
3761
|
});
|
|
@@ -4029,23 +3876,23 @@
|
|
|
4029
3876
|
return items;
|
|
4030
3877
|
}
|
|
4031
3878
|
|
|
4032
|
-
const _hoisted_1$
|
|
3879
|
+
const _hoisted_1$7 = {
|
|
4033
3880
|
class: "tz-item",
|
|
4034
3881
|
ref: "hour-items"
|
|
4035
3882
|
};
|
|
4036
|
-
const _hoisted_2$
|
|
3883
|
+
const _hoisted_2$6 = ["textContent", "onClick", "onDblclick"];
|
|
4037
3884
|
const _hoisted_3$2 = {
|
|
4038
3885
|
class: "tz-item",
|
|
4039
3886
|
ref: "minute-items"
|
|
4040
3887
|
};
|
|
4041
3888
|
const _hoisted_4$2 = ["textContent", "onClick", "onDblclick"];
|
|
4042
|
-
const _hoisted_5$
|
|
3889
|
+
const _hoisted_5$2 = {
|
|
4043
3890
|
key: 0,
|
|
4044
3891
|
class: "tz-item",
|
|
4045
3892
|
ref: "second-items"
|
|
4046
3893
|
};
|
|
4047
|
-
const _hoisted_6$
|
|
4048
|
-
var _sfc_main$
|
|
3894
|
+
const _hoisted_6$2 = ["textContent", "onClick", "onDblclick"];
|
|
3895
|
+
var _sfc_main$7 = vue.defineComponent({
|
|
4049
3896
|
__name: "time-pc",
|
|
4050
3897
|
props: {
|
|
4051
3898
|
value: {},
|
|
@@ -4147,7 +3994,7 @@
|
|
|
4147
3994
|
}
|
|
4148
3995
|
vue.onMounted(rebuildItems);
|
|
4149
3996
|
return (_ctx, _cache) => {
|
|
4150
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3997
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$f, {
|
|
4151
3998
|
class: vue.normalizeClass(["time-picker pc", {
|
|
4152
3999
|
"second-disabled": vue.unref(format) != "HH:mm:ss"
|
|
4153
4000
|
}]),
|
|
@@ -4157,7 +4004,7 @@
|
|
|
4157
4004
|
multiple: "",
|
|
4158
4005
|
effect: vue.unref(MOTION).top
|
|
4159
4006
|
}, {
|
|
4160
|
-
default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1$
|
|
4007
|
+
default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_1$7, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(hourItems.value, item => {
|
|
4161
4008
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4162
4009
|
class: vue.normalizeClass(["tzi-number", {
|
|
4163
4010
|
active: item.hour == timeRef.value.hour,
|
|
@@ -4167,7 +4014,7 @@
|
|
|
4167
4014
|
textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.hour, 2, "0")),
|
|
4168
4015
|
onClick: $event => onHourClick(item),
|
|
4169
4016
|
onDblclick: $event => onHourClick(item)
|
|
4170
|
-
}, null, 42, _hoisted_2$
|
|
4017
|
+
}, null, 42, _hoisted_2$6);
|
|
4171
4018
|
}), 128))], 512), vue.createElementVNode("div", _hoisted_3$2, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(minuteItems.value, item => {
|
|
4172
4019
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4173
4020
|
class: vue.normalizeClass(["tzi-number", {
|
|
@@ -4179,7 +4026,7 @@
|
|
|
4179
4026
|
onClick: $event => onMinuteClick(item),
|
|
4180
4027
|
onDblclick: $event => onMinuteClick(item, true)
|
|
4181
4028
|
}, null, 42, _hoisted_4$2);
|
|
4182
|
-
}), 128))], 512), vue.unref(format) == "HH:mm:ss" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$
|
|
4029
|
+
}), 128))], 512), vue.unref(format) == "HH:mm:ss" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$2, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(secondItems.value, item => {
|
|
4183
4030
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4184
4031
|
class: vue.normalizeClass(["tzi-number", {
|
|
4185
4032
|
active: item.second == timeRef.value.second,
|
|
@@ -4189,7 +4036,7 @@
|
|
|
4189
4036
|
textContent: vue.toDisplayString(vue.unref(snail_core.padStart)(item.second, 2, "0")),
|
|
4190
4037
|
onClick: $event => onSecondClick(item),
|
|
4191
4038
|
onDblclick: $event => onSecondClick(item, true)
|
|
4192
|
-
}, null, 42, _hoisted_6$
|
|
4039
|
+
}, null, 42, _hoisted_6$2);
|
|
4193
4040
|
}), 128))], 512)) : vue.createCommentVNode("", true)]),
|
|
4194
4041
|
_: 1
|
|
4195
4042
|
}, 8, ["effect"])]),
|
|
@@ -4223,15 +4070,15 @@
|
|
|
4223
4070
|
}
|
|
4224
4071
|
});
|
|
4225
4072
|
|
|
4226
|
-
const _hoisted_1$
|
|
4227
|
-
const _hoisted_2$
|
|
4073
|
+
const _hoisted_1$6 = ["textContent"];
|
|
4074
|
+
const _hoisted_2$5 = ["textContent"];
|
|
4228
4075
|
const _hoisted_3$1 = ["textContent"];
|
|
4229
4076
|
const _hoisted_4$1 = ["textContent", "onClick", "onDblclick"];
|
|
4230
|
-
const _hoisted_5 = ["textContent", "onClick", "onDblclick"];
|
|
4231
|
-
const _hoisted_6 = ["textContent"];
|
|
4077
|
+
const _hoisted_5$1 = ["textContent", "onClick", "onDblclick"];
|
|
4078
|
+
const _hoisted_6$1 = ["textContent"];
|
|
4232
4079
|
const _hoisted_7 = ["textContent", "onClick", "onDblclick"];
|
|
4233
4080
|
const _hoisted_8 = ["textContent"];
|
|
4234
|
-
var _sfc_main$
|
|
4081
|
+
var _sfc_main$6 = vue.defineComponent({
|
|
4235
4082
|
__name: "date-pc",
|
|
4236
4083
|
props: {
|
|
4237
4084
|
value: {},
|
|
@@ -4448,7 +4295,7 @@
|
|
|
4448
4295
|
dateRef.value == void 0 && (dateRef.value = electDateValue());
|
|
4449
4296
|
buildPickerItems(stepRef.value, 0);
|
|
4450
4297
|
return (_ctx, _cache) => {
|
|
4451
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4298
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$f, {
|
|
4452
4299
|
class: vue.normalizeClass(["date-picker pc", {
|
|
4453
4300
|
"time-now": __props.pinned && __props.pinned.value == true
|
|
4454
4301
|
}]),
|
|
@@ -4473,12 +4320,12 @@
|
|
|
4473
4320
|
}, [stepRef.value == "year" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4474
4321
|
key: 0,
|
|
4475
4322
|
textContent: vue.toDisplayString(`${yearItems.value[0].year}年 - ${vue.unref(snail_core.getFromArray)(yearItems.value, -1).year}年`)
|
|
4476
|
-
}, null, 8, _hoisted_1$
|
|
4323
|
+
}, null, 8, _hoisted_1$6)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
4477
4324
|
key: 1
|
|
4478
4325
|
}, [vue.createElementVNode("div", {
|
|
4479
4326
|
textContent: vue.toDisplayString(`${dateRef.value.year}年`),
|
|
4480
4327
|
onClick: _cache[1] || (_cache[1] = $event => onSwitchStepClick("year"))
|
|
4481
|
-
}, null, 8, _hoisted_2$
|
|
4328
|
+
}, null, 8, _hoisted_2$5), stepRef.value == "day" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4482
4329
|
key: 0,
|
|
4483
4330
|
textContent: vue.toDisplayString(`${dateRef.value.month}月`),
|
|
4484
4331
|
onClick: _cache[2] || (_cache[2] = $event => onSwitchStepClick("month"))
|
|
@@ -4518,7 +4365,7 @@
|
|
|
4518
4365
|
textContent: vue.toDisplayString(item.text),
|
|
4519
4366
|
onClick: $event => onMonthItemClick(item),
|
|
4520
4367
|
onDblclick: $event => onMonthItemClick(item, true)
|
|
4521
|
-
}, null, 40, _hoisted_5)], 2);
|
|
4368
|
+
}, null, 40, _hoisted_5$1)], 2);
|
|
4522
4369
|
}), 128)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
4523
4370
|
key: 2
|
|
4524
4371
|
}, [(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
|
|
@@ -4526,7 +4373,7 @@
|
|
|
4526
4373
|
class: "day-item week",
|
|
4527
4374
|
key: item,
|
|
4528
4375
|
textContent: vue.toDisplayString(item)
|
|
4529
|
-
}, null, 8, _hoisted_6);
|
|
4376
|
+
}, null, 8, _hoisted_6$1);
|
|
4530
4377
|
}), 64)), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(dayItemsRef.value, item => {
|
|
4531
4378
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4532
4379
|
class: vue.normalizeClass(["day-item", {
|
|
@@ -4581,25 +4428,32 @@
|
|
|
4581
4428
|
}
|
|
4582
4429
|
});
|
|
4583
4430
|
|
|
4584
|
-
const _hoisted_1$
|
|
4431
|
+
const _hoisted_1$5 = {
|
|
4432
|
+
class: "snail-scroll-picker"
|
|
4433
|
+
};
|
|
4434
|
+
const _hoisted_2$4 = {
|
|
4585
4435
|
key: 0,
|
|
4586
4436
|
class: "pick-header"
|
|
4587
4437
|
};
|
|
4588
|
-
const
|
|
4438
|
+
const _hoisted_3 = ["textContent"];
|
|
4439
|
+
const _hoisted_4 = {
|
|
4589
4440
|
class: "pick-body"
|
|
4590
4441
|
};
|
|
4591
|
-
const
|
|
4442
|
+
const _hoisted_5 = {
|
|
4592
4443
|
class: "pick-items",
|
|
4593
4444
|
ref: "pick-items"
|
|
4594
4445
|
};
|
|
4595
|
-
const
|
|
4446
|
+
const _hoisted_6 = ["textContent"];
|
|
4596
4447
|
const itemHeight = 32;
|
|
4597
|
-
var _sfc_main$
|
|
4448
|
+
var _sfc_main$5 = vue.defineComponent({
|
|
4598
4449
|
__name: "scroll-picker",
|
|
4599
4450
|
props: {
|
|
4600
4451
|
items: {},
|
|
4601
4452
|
value: {},
|
|
4602
4453
|
title: {},
|
|
4454
|
+
clearDisabled: {
|
|
4455
|
+
type: Boolean
|
|
4456
|
+
},
|
|
4603
4457
|
inPopup: {},
|
|
4604
4458
|
closePopup: {
|
|
4605
4459
|
type: Function
|
|
@@ -4655,20 +4509,32 @@
|
|
|
4655
4509
|
index != -1 && onTimeout(() => elasticRef.value.scrollTo(void 0, -itemHeight * index), 50);
|
|
4656
4510
|
});
|
|
4657
4511
|
return (_ctx, _cache) => {
|
|
4658
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4659
|
-
class:
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
},
|
|
4512
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [__props.inPopup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [vue.createElementVNode("span", {
|
|
4513
|
+
class: "pick-button",
|
|
4514
|
+
textContent: "取消",
|
|
4515
|
+
onClick: _cache[0] || (_cache[0] = $event => __props.closePopup(void 0))
|
|
4516
|
+
}), __props.clearDisabled != true ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
4517
|
+
key: 0,
|
|
4518
|
+
class: "pick-button",
|
|
4519
|
+
textContent: "清空",
|
|
4520
|
+
onClick: _cache[1] || (_cache[1] = $event => __props.closePopup(""))
|
|
4521
|
+
})) : vue.createCommentVNode("", true), vue.createElementVNode("span", {
|
|
4522
|
+
class: "pick-title ellipsis",
|
|
4523
|
+
textContent: vue.toDisplayString(__props.title)
|
|
4524
|
+
}, null, 8, _hoisted_3), vue.createElementVNode("span", {
|
|
4525
|
+
class: "pick-button",
|
|
4526
|
+
textContent: "确定",
|
|
4527
|
+
onClick: _cache[2] || (_cache[2] = $event => __props.closePopup(valueRef.value))
|
|
4528
|
+
})])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_4, [vue.createElementVNode("div", _hoisted_5, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.items, item => {
|
|
4663
4529
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
4664
4530
|
class: vue.normalizeClass(["pick-item", {
|
|
4665
4531
|
selected: item.code === valueRef.value,
|
|
4666
4532
|
disabled: item.disabled
|
|
4667
4533
|
}]),
|
|
4668
4534
|
key: item.code,
|
|
4669
|
-
textContent: vue.toDisplayString(item.
|
|
4670
|
-
}, null, 10,
|
|
4671
|
-
}), 128))], 512), _cache[
|
|
4535
|
+
textContent: vue.toDisplayString(item.name)
|
|
4536
|
+
}, null, 10, _hoisted_6);
|
|
4537
|
+
}), 128))], 512), _cache[3] || (_cache[3] = vue.createElementVNode("div", {
|
|
4672
4538
|
class: "pick-layer"
|
|
4673
4539
|
}, [vue.createElementVNode("span", {
|
|
4674
4540
|
class: "layer-top"
|
|
@@ -4676,7 +4542,7 @@
|
|
|
4676
4542
|
class: "layer-selection"
|
|
4677
4543
|
}), vue.createElementVNode("span", {
|
|
4678
4544
|
class: "layer-bottom"
|
|
4679
|
-
})], -1))])]
|
|
4545
|
+
})], -1))])]);
|
|
4680
4546
|
};
|
|
4681
4547
|
}
|
|
4682
4548
|
});
|
|
@@ -4687,13 +4553,13 @@
|
|
|
4687
4553
|
options = {
|
|
4688
4554
|
...options
|
|
4689
4555
|
};
|
|
4690
|
-
return showPicker(target, _sfc_main$
|
|
4556
|
+
return showPicker(target, _sfc_main$6, options, popupOptions);
|
|
4691
4557
|
}
|
|
4692
4558
|
function showTime(target, options, popupOptions) {
|
|
4693
4559
|
options = {
|
|
4694
4560
|
...options
|
|
4695
4561
|
};
|
|
4696
|
-
return showPicker(target, _sfc_main$
|
|
4562
|
+
return showPicker(target, _sfc_main$7, options, popupOptions);
|
|
4697
4563
|
}
|
|
4698
4564
|
function showScroll(options) {
|
|
4699
4565
|
const popupOptions = {
|
|
@@ -4703,7 +4569,7 @@
|
|
|
4703
4569
|
closeOnMask: true
|
|
4704
4570
|
}
|
|
4705
4571
|
};
|
|
4706
|
-
return showPicker(void 0, _sfc_main$
|
|
4572
|
+
return showPicker(void 0, _sfc_main$5, options, popupOptions);
|
|
4707
4573
|
}
|
|
4708
4574
|
function showPicker(target, component, options, popupOptions) {
|
|
4709
4575
|
if (popupOptions && popupOptions.mode == "dialog") {
|
|
@@ -4748,6 +4614,181 @@
|
|
|
4748
4614
|
return manager;
|
|
4749
4615
|
}
|
|
4750
4616
|
|
|
4617
|
+
const _hoisted_1$4 = {
|
|
4618
|
+
class: "action-slot flex-cross-center"
|
|
4619
|
+
};
|
|
4620
|
+
const _hoisted_2$3 = ["textContent"];
|
|
4621
|
+
var _sfc_main$4 = vue.defineComponent({
|
|
4622
|
+
__name: "action",
|
|
4623
|
+
props: {
|
|
4624
|
+
disabled: {
|
|
4625
|
+
type: Boolean
|
|
4626
|
+
},
|
|
4627
|
+
value: {},
|
|
4628
|
+
actions: {},
|
|
4629
|
+
mode: {},
|
|
4630
|
+
icon: {},
|
|
4631
|
+
popup: {},
|
|
4632
|
+
follow: {}
|
|
4633
|
+
},
|
|
4634
|
+
emits: ["trigger"],
|
|
4635
|
+
setup(__props, _ref) {
|
|
4636
|
+
let {
|
|
4637
|
+
emit: __emit
|
|
4638
|
+
} = _ref;
|
|
4639
|
+
const props = __props;
|
|
4640
|
+
const emits = __emit;
|
|
4641
|
+
const {
|
|
4642
|
+
follow
|
|
4643
|
+
} = usePopup();
|
|
4644
|
+
const {
|
|
4645
|
+
showScroll
|
|
4646
|
+
} = usePicker();
|
|
4647
|
+
const {
|
|
4648
|
+
onTouch
|
|
4649
|
+
} = snail_view.useObserver();
|
|
4650
|
+
const valueRef = vue.shallowRef(props.value);
|
|
4651
|
+
const rootDom = vue.useTemplateRef("snail-action");
|
|
4652
|
+
const popupScopeRef = vue.shallowRef(void 0);
|
|
4653
|
+
const slotHandle = Object.freeze({
|
|
4654
|
+
isActived: () => popupScopeRef.value != void 0,
|
|
4655
|
+
trigger: () => onShowActions(props.mode == "press")
|
|
4656
|
+
});
|
|
4657
|
+
function buildDefaultText() {
|
|
4658
|
+
if (snail_core.isArrayNotEmpty(props.actions) == true) {
|
|
4659
|
+
const item = props.actions.find(item2 => item2.code == valueRef.value) || props.actions[0];
|
|
4660
|
+
return item.name;
|
|
4661
|
+
}
|
|
4662
|
+
return void 0;
|
|
4663
|
+
}
|
|
4664
|
+
async function onShowActions(longPress) {
|
|
4665
|
+
if (popupScopeRef.value && popupScopeRef.value.destroyed != true) {
|
|
4666
|
+
popupScopeRef.value.destroy();
|
|
4667
|
+
popupScopeRef.value = void 0;
|
|
4668
|
+
}
|
|
4669
|
+
if (props.disabled != true) {
|
|
4670
|
+
switch (props.popup) {
|
|
4671
|
+
case "picker":
|
|
4672
|
+
{
|
|
4673
|
+
popupScopeRef.value = showScroll({
|
|
4674
|
+
value: valueRef.value,
|
|
4675
|
+
items: props.actions,
|
|
4676
|
+
clearDisabled: true
|
|
4677
|
+
});
|
|
4678
|
+
break;
|
|
4679
|
+
}
|
|
4680
|
+
default:
|
|
4681
|
+
{
|
|
4682
|
+
const followOptions = props.follow || Object.create(null);
|
|
4683
|
+
popupScopeRef.value = follow(rootDom.value, {
|
|
4684
|
+
component: _sfc_main$8,
|
|
4685
|
+
closeOnEscape: true,
|
|
4686
|
+
closeOnMask: true,
|
|
4687
|
+
closeOnResize: true,
|
|
4688
|
+
closeOnTarget: true,
|
|
4689
|
+
followX: followOptions.followX || ["center", "start", "end", "after", "before", "ratio"],
|
|
4690
|
+
followY: followOptions.followY || ["after", "before", "center", "end", "start", "ratio"],
|
|
4691
|
+
spaceX: followOptions.spaceX,
|
|
4692
|
+
spaceY: followOptions.spaceY,
|
|
4693
|
+
props: {
|
|
4694
|
+
mode: "vertical",
|
|
4695
|
+
actions: props.actions
|
|
4696
|
+
}
|
|
4697
|
+
});
|
|
4698
|
+
break;
|
|
4699
|
+
}
|
|
4700
|
+
}
|
|
4701
|
+
const code = await popupScopeRef.value;
|
|
4702
|
+
popupScopeRef.value = void 0;
|
|
4703
|
+
if (snail_core.isStringNotEmpty(code) == true) {
|
|
4704
|
+
valueRef.value = code;
|
|
4705
|
+
emits("trigger", code);
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
vue.onMounted(() => {
|
|
4710
|
+
onTouch(rootDom.value, {}, detail => {
|
|
4711
|
+
if (props.mode == "press" && detail.status == "end") {
|
|
4712
|
+
const time = detail.now.timestamp - detail.start.timestamp;
|
|
4713
|
+
if (time > 500) {
|
|
4714
|
+
navigator.vibrate && navigator.vibrate(200);
|
|
4715
|
+
onShowActions();
|
|
4716
|
+
}
|
|
4717
|
+
}
|
|
4718
|
+
});
|
|
4719
|
+
});
|
|
4720
|
+
return (_ctx, _cache) => {
|
|
4721
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4722
|
+
class: vue.normalizeClass(["snail-action flex-cross-center", {
|
|
4723
|
+
button: __props.mode == "whole" && __props.disabled != true
|
|
4724
|
+
}]),
|
|
4725
|
+
ref: "snail-action",
|
|
4726
|
+
onClick: _cache[1] || (_cache[1] = $event => __props.mode == "whole" && onShowActions())
|
|
4727
|
+
}, [vue.createElementVNode("div", _hoisted_1$4, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotHandle))), () => [vue.createElementVNode("span", {
|
|
4728
|
+
class: "ellipsis",
|
|
4729
|
+
textContent: vue.toDisplayString(buildDefaultText())
|
|
4730
|
+
}, null, 8, _hoisted_2$3)])]), __props.disabled != true && __props.mode != "press" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4731
|
+
key: 0,
|
|
4732
|
+
class: vue.normalizeClass(["trigger-slot", {
|
|
4733
|
+
"hover-show": __props.icon != "always"
|
|
4734
|
+
}])
|
|
4735
|
+
}, [vue.renderSlot(_ctx.$slots, "trigger", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotHandle))), () => [vue.createVNode(_sfc_main$F, {
|
|
4736
|
+
button: "",
|
|
4737
|
+
type: "more",
|
|
4738
|
+
size: 16,
|
|
4739
|
+
onClick: _cache[0] || (_cache[0] = $event => __props.mode != "whole" && onShowActions())
|
|
4740
|
+
})])], 2)) : vue.createCommentVNode("", true)], 2);
|
|
4741
|
+
};
|
|
4742
|
+
}
|
|
4743
|
+
});
|
|
4744
|
+
|
|
4745
|
+
const _hoisted_1$3 = {
|
|
4746
|
+
class: "snail-flash-number"
|
|
4747
|
+
};
|
|
4748
|
+
const _hoisted_2$2 = ["textContent"];
|
|
4749
|
+
var _sfc_main$3 = vue.defineComponent({
|
|
4750
|
+
__name: "flash-number",
|
|
4751
|
+
props: {
|
|
4752
|
+
value: {}
|
|
4753
|
+
},
|
|
4754
|
+
setup(__props) {
|
|
4755
|
+
const props = __props;
|
|
4756
|
+
const itemsRef = vue.ref();
|
|
4757
|
+
function buildNumberItems() {
|
|
4758
|
+
itemsRef.value = [];
|
|
4759
|
+
const value = snail_core.isNullish(props.value) ? null : String(props.value);
|
|
4760
|
+
if (snail_core.isStringNotEmpty(value) == true) {
|
|
4761
|
+
for (const item of value) {
|
|
4762
|
+
const number = parseInt(item);
|
|
4763
|
+
const isNumber = 0 <= number && number <= 9;
|
|
4764
|
+
itemsRef.value.push({
|
|
4765
|
+
id: snail_core.newId(),
|
|
4766
|
+
text: item,
|
|
4767
|
+
number: isNumber ? number : void 0
|
|
4768
|
+
});
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
if (snail_core.isArrayNotEmpty(itemsRef.value) == true) ;
|
|
4772
|
+
}
|
|
4773
|
+
vue.onMounted(() => {
|
|
4774
|
+
buildNumberItems();
|
|
4775
|
+
});
|
|
4776
|
+
return (_ctx, _cache) => {
|
|
4777
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(itemsRef.value, item => {
|
|
4778
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
4779
|
+
key: item.id,
|
|
4780
|
+
textContent: vue.toDisplayString(item.text),
|
|
4781
|
+
class: vue.normalizeClass(vue.unref(snail_core.isNullish)(item.number) ? "" : "number-item")
|
|
4782
|
+
}, null, 10, _hoisted_2$2);
|
|
4783
|
+
}), 128)), _cache[0] || (_cache[0] = vue.createElementVNode("span", {
|
|
4784
|
+
style: {
|
|
4785
|
+
"color": "red"
|
|
4786
|
+
}
|
|
4787
|
+
}, "-----还没实现,别用", -1))]);
|
|
4788
|
+
};
|
|
4789
|
+
}
|
|
4790
|
+
});
|
|
4791
|
+
|
|
4751
4792
|
const _hoisted_1$2 = ["title"];
|
|
4752
4793
|
const _hoisted_2$1 = ["textContent"];
|
|
4753
4794
|
var _sfc_main$2 = vue.defineComponent({
|
|
@@ -5034,7 +5075,6 @@
|
|
|
5034
5075
|
});
|
|
5035
5076
|
|
|
5036
5077
|
const components = {
|
|
5037
|
-
Action: _sfc_main$h,
|
|
5038
5078
|
Button: _sfc_main$G,
|
|
5039
5079
|
Choose: _sfc_main$E,
|
|
5040
5080
|
Footer: _sfc_main$D,
|
|
@@ -5047,21 +5087,22 @@
|
|
|
5047
5087
|
Switch: _sfc_main$k,
|
|
5048
5088
|
Textarea: _sfc_main$j,
|
|
5049
5089
|
Dynamic: _sfc_main$v,
|
|
5050
|
-
Elastic: _sfc_main$
|
|
5051
|
-
Flex: _sfc_main$
|
|
5052
|
-
Fold: _sfc_main$
|
|
5090
|
+
Elastic: _sfc_main$i,
|
|
5091
|
+
Flex: _sfc_main$h,
|
|
5092
|
+
Fold: _sfc_main$g,
|
|
5053
5093
|
Motion: _sfc_main$x,
|
|
5054
|
-
Layout: _sfc_main$
|
|
5094
|
+
Layout: _sfc_main$f,
|
|
5055
5095
|
Scroll: _sfc_main$u,
|
|
5056
|
-
Sort: _sfc_main$
|
|
5057
|
-
Table: _sfc_main$
|
|
5058
|
-
TableRow: _sfc_main$
|
|
5059
|
-
TableCol: _sfc_main$
|
|
5060
|
-
Tree: _sfc_main$
|
|
5096
|
+
Sort: _sfc_main$e,
|
|
5097
|
+
Table: _sfc_main$d,
|
|
5098
|
+
TableRow: _sfc_main$c,
|
|
5099
|
+
TableCol: _sfc_main$b,
|
|
5100
|
+
Tree: _sfc_main$9,
|
|
5061
5101
|
Wrapper: _sfc_main$t,
|
|
5062
|
-
|
|
5102
|
+
Action: _sfc_main$4,
|
|
5103
|
+
FlashNumber: _sfc_main$3,
|
|
5063
5104
|
DatePicker: _sfc_main$2,
|
|
5064
|
-
ScrollPicker: _sfc_main$
|
|
5105
|
+
ScrollPicker: _sfc_main$5,
|
|
5065
5106
|
TimePicker: _sfc_main$1,
|
|
5066
5107
|
DragVerify: _sfc_main,
|
|
5067
5108
|
Empty: _sfc_main$o,
|