centui 3.0.0 → 3.1.0
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/ActionBar-Bs5fkyFH.cjs +1 -0
- package/dist/ActionBar-CF1zMUMC.js +56 -0
- package/dist/ActivityIndicator-BOZRJBDn.cjs +1 -0
- package/dist/{RollerSuccess-CVEmS9gU.js → ActivityIndicator-Cp20c1E0.js} +30 -92
- package/dist/{Agree-DT46e5q5.cjs → Agree-ZswFiFNy.cjs} +1 -1
- package/dist/{Agree-yTGTi4e6.js → Agree-lAcOo38C.js} +2 -3
- package/dist/Amount-B2StZGGW.js +56 -0
- package/dist/Amount-CU7Oc4vv.cjs +1 -0
- package/dist/Bill-DDVs3Lu3.cjs +1 -0
- package/dist/Bill-qQ4LdkmR.js +58 -0
- package/dist/{Button-Blpwwbnw.cjs → Button-Bu8liJQE.cjs} +1 -1
- package/dist/{Button-BIi6CrwM.js → Button-D7e-cuA1.js} +5 -6
- package/dist/Captcha-BEF-de8-.cjs +1 -0
- package/dist/Captcha-CgpynYTc.js +283 -0
- package/dist/Cashier-CJLfQOXm.js +363 -0
- package/dist/Cashier-CLJngM0n.cjs +1 -0
- package/dist/{CellItem-YZD-BxKt.js → CellItem-BHEh4Cp-.js} +2 -3
- package/dist/{CellItem-T78DHako.cjs → CellItem-J0LkwZNL.cjs} +1 -1
- package/dist/Chart-BINJAx7V.js +135 -0
- package/dist/Chart-DJ0Q1g1P.cjs +1 -0
- package/dist/CheckBox-D5bCJUXD.js +55 -0
- package/dist/CheckBox-DDeCshDK.cjs +1 -0
- package/dist/CheckBoxBase-BIPGJ-TD.js +43 -0
- package/dist/CheckBoxBase-CobK6-tL.cjs +1 -0
- package/dist/CheckList-BsKo_Fl3.cjs +1 -0
- package/dist/{CheckList-Bfy3B-eN.js → CheckList-ViiCo4yi.js} +47 -91
- package/dist/{Codebox-D0UtCj11.js → Codebox-BLPrFnIv.js} +4 -5
- package/dist/Codebox-yLkdTU7w.cjs +1 -0
- package/dist/{DatePicker-B1AVbKhK.cjs → DatePicker-CCU6gqG3.cjs} +1 -1
- package/dist/{DatePicker-TAHuve5t.js → DatePicker-CYvPJatt.js} +2 -4
- package/dist/DetailItem-D6-zbZmd.js +21 -0
- package/dist/DetailItem-DDJXXao0.cjs +1 -0
- package/dist/Dialog-208_XUAL.cjs +1 -0
- package/dist/Dialog-Bb7Gth3j.js +148 -0
- package/dist/DropMenu-5TA_6bas.js +95 -0
- package/dist/DropMenu-D_ZMGOOi.cjs +1 -0
- package/dist/{Field-CseJzTZz.js → Field-0hdNWFNm.js} +1 -2
- package/dist/{FieldItem-Cc7bw5vU.js → FieldItem-D79w330m.js} +2 -3
- package/dist/{FieldItem-Dkpx5Kxk.cjs → FieldItem-UFKrl_5J.cjs} +1 -1
- package/dist/{Icon-jaEPn7d7.cjs → Icon-83WWqE5z.cjs} +1 -1
- package/dist/{Icon-dWGSK6Ou.js → Icon-BgCtu0ZV.js} +3 -5
- package/dist/ImageReader-DjshA_hh.cjs +1 -0
- package/dist/ImageReader-hUb5CEbV.js +122 -0
- package/dist/ImageViewer-BCEK4DOF.cjs +1 -0
- package/dist/ImageViewer-_dTRCIsV.js +68 -0
- package/dist/InputItem-DO5Yo_IH.cjs +1 -0
- package/dist/InputItem-yHsLFvKt.js +327 -0
- package/dist/Landscape-BsHyoM4N.cjs +1 -0
- package/dist/Landscape-Dd0abEy1.js +73 -0
- package/dist/LicensePlate-CTcAIbcb.js +201 -0
- package/dist/LicensePlate-CfwpVw0G.cjs +1 -0
- package/dist/NoticeBar-CV355FeO.cjs +1 -0
- package/dist/NoticeBar-G5aKL6VO.js +92 -0
- package/dist/NumberKeyboard-BWpxsbYt.cjs +1 -0
- package/dist/{NumberKeyboard-C7TRF5iC.js → NumberKeyboard-B_TJXxki.js} +77 -62
- package/dist/Picker-BOEGTBaN.cjs +1 -0
- package/dist/{Picker-Dam0LEcc.js → Picker-CA-JQ_OC.js} +168 -151
- package/dist/Popup-Ca1jPi0t.cjs +1 -0
- package/dist/Popup-qLk-BsRS.js +116 -0
- package/dist/{PopupTitleBar-nVurLaOe.js → PopupTitleBar-9P4RUMC1.js} +2 -3
- package/dist/{PopupTitleBar-B4vwxKC7.cjs → PopupTitleBar-Bfl49eYJ.cjs} +1 -1
- package/dist/Progress-CT-LHaQ0.cjs +1 -0
- package/dist/{Progress-CwIC6scr.js → Progress-Clet0W_n.js} +20 -22
- package/dist/Radio-B_MxJ65X.cjs +1 -0
- package/dist/{Radio-fsc7_N5K.js → Radio-DY-ZX0BP.js} +16 -14
- package/dist/{RadioGroup-CMPmk8X_.js → RadioGroup-B00aqM9e.js} +8 -6
- package/dist/RadioGroup-B6ukqnm5.cjs +1 -0
- package/dist/{RadioList-upQgua8Z.cjs → RadioList-D-9PITpr.cjs} +1 -1
- package/dist/{RadioList-CkerkQEY.js → RadioList-DNGsEzgf.js} +6 -8
- package/dist/ResultPage-DUs8ok5R.js +64 -0
- package/dist/ResultPage-YQWDaFmz.cjs +1 -0
- package/dist/{Roller-DFJ7jMV0.js → Roller-BznN57fL.js} +1 -2
- package/dist/RollerSuccess-BbMzNlkv.cjs +1 -0
- package/dist/RollerSuccess-CTh43Rh0.js +65 -0
- package/dist/Ruler-Bhf5J7hU.js +136 -0
- package/dist/Ruler-CEzB0oqG.cjs +1 -0
- package/dist/ScrollView-BNY62f7B.js +228 -0
- package/dist/ScrollView-BnadVBJC.cjs +1 -0
- package/dist/ScrollViewMore-BL1vpyMj.cjs +1 -0
- package/dist/ScrollViewMore-DBhoiI1X.js +54 -0
- package/dist/Selector-DOU8Af55.js +209 -0
- package/dist/Selector-DnFvOGbv.cjs +1 -0
- package/dist/{Skeleton-BG_j23KI.js → Skeleton-DqA5IxL5.js} +1 -2
- package/dist/Slider-BB2Nhpys.js +100 -0
- package/dist/Slider-vV7_nULf.cjs +1 -0
- package/dist/Stepper-BnDhL8IO.js +137 -0
- package/dist/Stepper-n_mc16V2.cjs +1 -0
- package/dist/Steps-BPQwab3T.js +157 -0
- package/dist/Steps-Dfpmgl8B.cjs +1 -0
- package/dist/SwiperItem-BY5cUoGn.cjs +1 -0
- package/dist/SwiperItem-BydyBdYU.js +323 -0
- package/dist/Switch-B1rsBY-M.js +31 -0
- package/dist/Switch-CghubImq.cjs +1 -0
- package/dist/TabPane-BCVsdptu.cjs +1 -0
- package/dist/TabPane-Q7oUFzmP.js +237 -0
- package/dist/TabPicker-BcL9assY.cjs +1 -0
- package/dist/TabPicker-BicPrto7.js +173 -0
- package/dist/Tag-C7ygxOwU.js +78 -0
- package/dist/Tag-CIA2npnD.cjs +1 -0
- package/dist/TextareaItem-Dl-PCLl-.js +168 -0
- package/dist/TextareaItem-Du5nl7tv.cjs +1 -0
- package/dist/{Tip-BFZSiRc1.js → Tip-DHPmevlv.js} +2 -3
- package/dist/{Tip-C3brAF9N.cjs → Tip-De_3tKtb.cjs} +1 -1
- package/dist/Transition-B-baX512.js +14 -0
- package/dist/Transition-Bwbqr4Xr.cjs +1 -0
- package/dist/WaterMark-CgkuQjv3.js +103 -0
- package/dist/WaterMark-M81jg6T5.cjs +1 -0
- package/dist/action-bar.cjs +1 -0
- package/dist/action-bar.d.ts +1 -0
- package/dist/action-bar.js +1 -0
- package/dist/{action-sheet-LJilF3EQ.cjs → action-sheet-BjaReHkr.cjs} +1 -1
- package/dist/{action-sheet-DKpi2GLQ.js → action-sheet-Da8dHevy.js} +15 -12
- package/dist/action-sheet.cjs +1 -1
- package/dist/action-sheet.js +1 -2
- package/dist/activity-indicator.cjs +1 -1
- package/dist/activity-indicator.js +4 -3
- package/dist/agree.cjs +1 -1
- package/dist/agree.js +1 -2
- package/dist/amount.cjs +1 -1
- package/dist/amount.js +1 -2
- package/dist/bill.cjs +1 -0
- package/dist/bill.d.ts +1 -0
- package/dist/bill.js +1 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -2
- package/dist/captcha.cjs +1 -0
- package/dist/captcha.d.ts +1 -0
- package/dist/captcha.js +1 -0
- package/dist/cashier.cjs +1 -0
- package/dist/cashier.d.ts +1 -0
- package/dist/cashier.js +1 -0
- package/dist/cell-item.cjs +1 -1
- package/dist/cell-item.js +1 -2
- package/dist/chart.cjs +1 -0
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +1 -0
- package/dist/check-base.cjs +1 -1
- package/dist/check-base.js +1 -2
- package/dist/check.cjs +1 -1
- package/dist/check.js +3 -2
- package/dist/codebox.cjs +1 -1
- package/dist/codebox.js +1 -2
- package/dist/components/action-sheet/ActionSheet.vue.d.ts +5 -0
- package/dist/components/cashier/CashierChannel.vue.d.ts +4 -0
- package/dist/components/dialog/Dialog.vue.d.ts +10 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/number-keyboard/KeyboardKey.vue.d.ts +3 -0
- package/dist/components/popup/PopupTitleBar.vue.d.ts +4 -0
- package/dist/components/swiper/Swiper.vue.d.ts +2 -2
- package/dist/cursor-BIPoNm8V.js +11 -0
- package/dist/cursor-tQE3LcbU.cjs +1 -0
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +1 -2
- package/dist/detail-item.cjs +1 -0
- package/dist/detail-item.d.ts +1 -0
- package/dist/detail-item.js +1 -0
- package/dist/dialog-C38EDWGJ.cjs +1 -0
- package/dist/dialog-DdNA6YSe.js +91 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +2 -1
- package/dist/drop-menu.cjs +1 -0
- package/dist/drop-menu.d.ts +1 -0
- package/dist/drop-menu.js +1 -0
- package/dist/field-item.cjs +1 -1
- package/dist/field-item.js +1 -2
- package/dist/field.js +1 -2
- package/dist/icon.cjs +1 -1
- package/dist/icon.js +1 -2
- package/dist/image-reader.cjs +1 -0
- package/dist/image-reader.d.ts +1 -0
- package/dist/image-reader.js +1 -0
- package/dist/image-viewer.cjs +1 -0
- package/dist/image-viewer.d.ts +1 -0
- package/dist/image-viewer.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +61 -2669
- package/dist/input-item.cjs +1 -1
- package/dist/input-item.js +1 -2
- package/dist/landscape.cjs +1 -0
- package/dist/landscape.d.ts +1 -0
- package/dist/landscape.js +1 -0
- package/dist/license-plate.cjs +1 -0
- package/dist/license-plate.d.ts +1 -0
- package/dist/license-plate.js +1 -0
- package/dist/notice-bar.cjs +1 -1
- package/dist/notice-bar.js +1 -2
- package/dist/number-keyboard.cjs +1 -1
- package/dist/number-keyboard.js +1 -2
- package/dist/picker.cjs +1 -1
- package/dist/picker.js +1 -2
- package/dist/popup.cjs +1 -1
- package/dist/popup.js +2 -2
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -2
- package/dist/radio-list.cjs +1 -1
- package/dist/radio-list.js +1 -2
- package/dist/radio.cjs +1 -1
- package/dist/radio.js +2 -2
- package/dist/result-page.cjs +1 -0
- package/dist/result-page.d.ts +1 -0
- package/dist/result-page.js +1 -0
- package/dist/ruler.cjs +1 -0
- package/dist/ruler.d.ts +1 -0
- package/dist/ruler.js +1 -0
- package/dist/scroll-view.cjs +1 -1
- package/dist/scroll-view.js +3 -2
- package/dist/selector.cjs +1 -0
- package/dist/selector.d.ts +1 -0
- package/dist/selector.js +1 -0
- package/dist/{shared-BtSkmaWC.js → shared-C9XlLe7F.js} +1 -2
- package/dist/skeleton.js +1 -2
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -2
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +1 -2
- package/dist/steps.cjs +1 -0
- package/dist/steps.d.ts +1 -0
- package/dist/steps.js +1 -0
- package/dist/swiper.cjs +1 -1
- package/dist/swiper.js +1 -2
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -2
- package/dist/tab-picker.cjs +1 -0
- package/dist/tab-picker.d.ts +1 -0
- package/dist/tab-picker.js +1 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.d.ts +1 -0
- package/dist/tabs.js +1 -0
- package/dist/tag.cjs +1 -1
- package/dist/tag.js +1 -2
- package/dist/textarea-item.cjs +1 -0
- package/dist/textarea-item.d.ts +1 -0
- package/dist/textarea-item.js +1 -0
- package/dist/tip.cjs +1 -1
- package/dist/tip.js +1 -2
- package/dist/{toast-DX-RoB7Q.js → toast-ByIFvpMs.js} +6 -6
- package/dist/toast-C1K2_cOo.cjs +1 -0
- package/dist/toast.cjs +1 -1
- package/dist/toast.js +1 -2
- package/dist/transition.cjs +1 -0
- package/dist/transition.d.ts +1 -0
- package/dist/transition.js +1 -0
- package/dist/water-mark.cjs +1 -0
- package/dist/water-mark.d.ts +1 -0
- package/dist/water-mark.js +1 -0
- package/package.json +105 -4
- package/dist/Amount-De-oObat.cjs +0 -1
- package/dist/Amount-wOtRYOdx.js +0 -62
- package/dist/CheckBoxBase-BDsytL_r.cjs +0 -1
- package/dist/CheckBoxBase-BjyVzGqj.js +0 -40
- package/dist/CheckList-DEmLmccw.cjs +0 -1
- package/dist/Codebox-Cgj7wyzd.cjs +0 -1
- package/dist/InputItem-EJ4Y3tpU.cjs +0 -1
- package/dist/InputItem-bhFtp97z.js +0 -322
- package/dist/NoticeBar-DSf_EjTL.cjs +0 -1
- package/dist/NoticeBar-PEYcjXwD.js +0 -84
- package/dist/NumberKeyboard-BX0c0l2r.cjs +0 -1
- package/dist/Picker-D-TPtSxf.cjs +0 -1
- package/dist/Popup-Cm4BuaOo.cjs +0 -1
- package/dist/Popup-DPYBBL95.js +0 -116
- package/dist/Progress-DukssNvl.cjs +0 -1
- package/dist/Radio-ZHivLdvi.cjs +0 -1
- package/dist/RadioGroup-BR_jSDR4.cjs +0 -1
- package/dist/RollerSuccess--JecJ7bz.cjs +0 -1
- package/dist/ScrollViewMore-BWph-i1-.cjs +0 -1
- package/dist/ScrollViewMore-BgYJx-TP.js +0 -278
- package/dist/Slider-D3wrE8hn.cjs +0 -1
- package/dist/Slider-DteN8p-L.js +0 -95
- package/dist/Stepper-1EOk4pCY.js +0 -127
- package/dist/Stepper-BJr4I6_8.cjs +0 -1
- package/dist/SwiperItem-B6TgjCsM.cjs +0 -1
- package/dist/SwiperItem-CKd-XKT7.js +0 -337
- package/dist/Switch-B6DvVj2p.js +0 -30
- package/dist/Switch-BVPjF8CM.cjs +0 -1
- package/dist/Tag-CPv77lC8.cjs +0 -1
- package/dist/Tag-bs5j40pF.js +0 -66
- package/dist/dialog-0-E4Vyc-.cjs +0 -1
- package/dist/dialog-DHIZ2SMK.js +0 -227
- package/dist/toast-CAeyMc5r.cjs +0 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, onBeforeUnmount as o, onMounted as s, openBlock as c, ref as l, renderSlot as u, useSlots as ee, watch as d } from "vue";
|
|
2
|
+
import { debounce as f } from "@centui/core";
|
|
3
|
+
import { Scroller as te, render as p } from "@centui/core/web";
|
|
4
|
+
// src/components/scroll-view/ScrollView.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var ne = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "scroll-view-header"
|
|
8
|
+
}, m = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "scroll-view-footer"
|
|
11
|
+
}, h = /* @__PURE__ */ i({
|
|
12
|
+
name: "cu-scroll-view",
|
|
13
|
+
__name: "ScrollView",
|
|
14
|
+
props: {
|
|
15
|
+
scrollingX: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
},
|
|
19
|
+
scrollingY: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !0
|
|
22
|
+
},
|
|
23
|
+
bouncing: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !0
|
|
26
|
+
},
|
|
27
|
+
autoReflow: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
manualInit: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !1
|
|
34
|
+
},
|
|
35
|
+
endReachedThreshold: { default: 0 },
|
|
36
|
+
immediateCheckEndReaching: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
touchAngle: { default: 45 },
|
|
41
|
+
isPrevent: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !0
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
emits: [
|
|
47
|
+
"refreshActive",
|
|
48
|
+
"refreshing",
|
|
49
|
+
"endReached",
|
|
50
|
+
"end-reached",
|
|
51
|
+
"scroll"
|
|
52
|
+
],
|
|
53
|
+
setup(i, { expose: h, emit: g }) {
|
|
54
|
+
let _ = i, v = g, y = ee(), b = l(), x = l(null), S = l(!1), C = l(!1), w = l(!1), T = l(!1), E = l(!1), D = l(!1), O = l(null), k = l(null), A = null, j = null, M = 0, N = 0, P = 0, F = 0, I = 0, L = 0, R = 0, z = 0, B = 0, V = null, H = null, U = e(() => !!y.refresh), W = e(() => !!y.more);
|
|
55
|
+
d(() => _.autoReflow, (e) => {
|
|
56
|
+
e ? K() : q();
|
|
57
|
+
}), s(() => {
|
|
58
|
+
_.manualInit || G();
|
|
59
|
+
}), o(() => {
|
|
60
|
+
q();
|
|
61
|
+
});
|
|
62
|
+
function G() {
|
|
63
|
+
if (S.value) return;
|
|
64
|
+
A = b.value ?? null;
|
|
65
|
+
let e = A?.querySelector(".scroll-view-refresh") ?? null, t = A?.querySelector(".scroll-view-more") ?? null;
|
|
66
|
+
j = A?.querySelector(".scroll-view-container") ?? null;
|
|
67
|
+
let n = e ? e.clientHeight : 0;
|
|
68
|
+
if (M = t ? t.clientHeight : 0, !A || !j) return;
|
|
69
|
+
let r = A.getBoundingClientRect(), i = new te((e, t) => {
|
|
70
|
+
p(j, e, t), S.value && oe(e, t);
|
|
71
|
+
}, {
|
|
72
|
+
scrollingX: _.scrollingX,
|
|
73
|
+
scrollingY: _.scrollingY,
|
|
74
|
+
bouncing: _.bouncing,
|
|
75
|
+
zooming: !1,
|
|
76
|
+
animationDuration: 200,
|
|
77
|
+
speedMultiplier: 1.2,
|
|
78
|
+
inRequestAnimationFrame: !0
|
|
79
|
+
});
|
|
80
|
+
i.setPosition(r.left + A.clientLeft, r.top + A.clientTop), U.value && i.activatePullToRefresh(n, () => {
|
|
81
|
+
T.value = !0, w.value = !1, v("refreshActive");
|
|
82
|
+
}, () => {
|
|
83
|
+
T.value = !1, w.value = !1;
|
|
84
|
+
}, () => {
|
|
85
|
+
T.value = !1, w.value = !0, v("refreshing");
|
|
86
|
+
}), x.value = i, $(!0), _.autoReflow && K(), H = f(() => {
|
|
87
|
+
D.value = !0, v("endReached"), v("end-reached");
|
|
88
|
+
}, 50), setTimeout(() => {
|
|
89
|
+
S.value = !0;
|
|
90
|
+
}, 50), _.immediateCheckEndReaching && J();
|
|
91
|
+
}
|
|
92
|
+
function K() {
|
|
93
|
+
q(), V = setInterval(() => {
|
|
94
|
+
$();
|
|
95
|
+
}, 100);
|
|
96
|
+
}
|
|
97
|
+
function q() {
|
|
98
|
+
V &&= (clearInterval(V), null);
|
|
99
|
+
}
|
|
100
|
+
function J() {
|
|
101
|
+
let e = x.value;
|
|
102
|
+
if (!e) return;
|
|
103
|
+
let t = e._clientHeight, n = e._contentHeight, r = e._scrollTop, i = _.endReachedThreshold, a = n - t - (r + M + i);
|
|
104
|
+
r >= 0 && !D.value && a <= 0 && H && (E.value = !0, H());
|
|
105
|
+
}
|
|
106
|
+
function Y() {
|
|
107
|
+
let e = F - N, t = I - P, n = Math.atan2(Math.abs(t), Math.abs(e)) * 180 / Math.PI;
|
|
108
|
+
return _.scrollingX ? 90 - n : n;
|
|
109
|
+
}
|
|
110
|
+
function X(e) {
|
|
111
|
+
let t = x.value;
|
|
112
|
+
t && (N = e.targetTouches[0].pageX, P = e.targetTouches[0].pageY, t.doTouchStart(Array.from(e.touches), e.timeStamp));
|
|
113
|
+
}
|
|
114
|
+
function re(e) {
|
|
115
|
+
let t = x.value;
|
|
116
|
+
if (!t) return;
|
|
117
|
+
let n = !1;
|
|
118
|
+
if (_.isPrevent && (e.preventDefault(), n = !0), F = e.targetTouches[0].pageX, I = e.targetTouches[0].pageY, (!_.scrollingX || !_.scrollingY) && Y() < _.touchAngle) return;
|
|
119
|
+
!n && e.cancelable && e.preventDefault(), t.doTouchMove(Array.from(e.touches), e.timeStamp, e.scale);
|
|
120
|
+
let r = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, i = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, a = F - r, o = I - i;
|
|
121
|
+
(a > document.documentElement.clientWidth - 15 || o > document.documentElement.clientHeight - 15 || a < 15 || o < 15) && t.doTouchEnd(e.timeStamp);
|
|
122
|
+
}
|
|
123
|
+
function Z(e) {
|
|
124
|
+
let t = x.value;
|
|
125
|
+
t && t.doTouchEnd(e.timeStamp);
|
|
126
|
+
}
|
|
127
|
+
function ie(e) {
|
|
128
|
+
let t = x.value;
|
|
129
|
+
t && (N = e.pageX, P = e.pageY, t.doTouchStart([{
|
|
130
|
+
pageX: e.pageX,
|
|
131
|
+
pageY: e.pageY
|
|
132
|
+
}], e.timeStamp), C.value = !0);
|
|
133
|
+
}
|
|
134
|
+
function ae(e) {
|
|
135
|
+
let t = x.value;
|
|
136
|
+
t && C.value && (F = e.pageX, I = e.pageY, (!_.scrollingX || !_.scrollingY) && Y() < _.touchAngle || (t.doTouchMove([{
|
|
137
|
+
pageX: e.pageX,
|
|
138
|
+
pageY: e.pageY
|
|
139
|
+
}], e.timeStamp), C.value = !0));
|
|
140
|
+
}
|
|
141
|
+
function Q(e) {
|
|
142
|
+
let t = x.value;
|
|
143
|
+
t && C.value && (t.doTouchEnd(e.timeStamp), C.value = !1);
|
|
144
|
+
}
|
|
145
|
+
function oe(e, t) {
|
|
146
|
+
e = +e.toFixed(2), t = +t.toFixed(2), (O.value !== e || k.value !== t) && (O.value = e, k.value = t, J(), v("scroll", {
|
|
147
|
+
scrollLeft: e,
|
|
148
|
+
scrollTop: t
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
function se() {
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
G();
|
|
154
|
+
}, 0);
|
|
155
|
+
}
|
|
156
|
+
function ce(e, t, n = !1) {
|
|
157
|
+
x.value?.scrollTo(e, t, n);
|
|
158
|
+
}
|
|
159
|
+
function le() {
|
|
160
|
+
return x.value?.getValues() ?? {
|
|
161
|
+
left: 0,
|
|
162
|
+
top: 0
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function $(e = !1) {
|
|
166
|
+
let t = x.value;
|
|
167
|
+
t && A && j && setTimeout(() => {
|
|
168
|
+
let n = A.clientWidth, r = A.clientHeight, i = j.offsetWidth, a = j.offsetHeight;
|
|
169
|
+
(e || L !== n || R !== r || z !== i || B !== a) && (t.setDimensions(A.clientWidth, A.clientHeight, j.offsetWidth, j.offsetHeight), L = n, R = r, z = i, B = a);
|
|
170
|
+
}, 0);
|
|
171
|
+
}
|
|
172
|
+
function ue() {
|
|
173
|
+
x.value?.triggerPullToRefresh();
|
|
174
|
+
}
|
|
175
|
+
function de() {
|
|
176
|
+
x.value?.finishPullToRefresh(), $();
|
|
177
|
+
}
|
|
178
|
+
function fe() {
|
|
179
|
+
E.value = !1, D.value = !1, $();
|
|
180
|
+
}
|
|
181
|
+
return h({
|
|
182
|
+
init: se,
|
|
183
|
+
scrollTo: ce,
|
|
184
|
+
getOffsets: le,
|
|
185
|
+
reflowScroller: $,
|
|
186
|
+
triggerRefresh: ue,
|
|
187
|
+
finishRefresh: de,
|
|
188
|
+
finishLoadMore: fe
|
|
189
|
+
}), (e, o) => (c(), n("div", {
|
|
190
|
+
ref_key: "root",
|
|
191
|
+
ref: b,
|
|
192
|
+
class: "cu-scroll-view",
|
|
193
|
+
onTouchstart: X,
|
|
194
|
+
onTouchmove: re,
|
|
195
|
+
onTouchend: Z,
|
|
196
|
+
onTouchcancel: Z,
|
|
197
|
+
onMousedown: ie,
|
|
198
|
+
onMousemove: ae,
|
|
199
|
+
onMouseup: Q,
|
|
200
|
+
onMouseleave: Q
|
|
201
|
+
}, [
|
|
202
|
+
e.$slots.header ? (c(), n("div", ne, [u(e.$slots, "header")])) : t("", !0),
|
|
203
|
+
r("div", {
|
|
204
|
+
class: a(["scroll-view-container", { horizon: i.scrollingX && !i.scrollingY }]),
|
|
205
|
+
"scroll-wrapper": ""
|
|
206
|
+
}, [
|
|
207
|
+
U.value ? (c(), n("div", {
|
|
208
|
+
key: 0,
|
|
209
|
+
class: a(["scroll-view-refresh", {
|
|
210
|
+
refreshing: w.value,
|
|
211
|
+
"refresh-active": T.value
|
|
212
|
+
}])
|
|
213
|
+
}, [u(e.$slots, "refresh", {
|
|
214
|
+
scrollTop: k.value ?? 0,
|
|
215
|
+
isRefreshing: w.value,
|
|
216
|
+
isRefreshActive: T.value
|
|
217
|
+
})], 2)) : t("", !0),
|
|
218
|
+
u(e.$slots, "default"),
|
|
219
|
+
W.value ? (c(), n("div", {
|
|
220
|
+
key: 1,
|
|
221
|
+
class: a(["scroll-view-more", { active: E.value || D.value }])
|
|
222
|
+
}, [u(e.$slots, "more", { isEndReaching: E.value || D.value })], 2)) : t("", !0)
|
|
223
|
+
], 2),
|
|
224
|
+
e.$slots.footer ? (c(), n("div", m, [u(e.$slots, "footer")])) : t("", !0)
|
|
225
|
+
], 544));
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
export { h as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue"),t=require("@centui/core"),n=require("@centui/core/web");var r={key:0,class:`scroll-view-header`},i={key:1,class:`scroll-view-footer`},a=(0,e.defineComponent)({name:`cu-scroll-view`,__name:`ScrollView`,props:{scrollingX:{type:Boolean,default:!0},scrollingY:{type:Boolean,default:!0},bouncing:{type:Boolean,default:!0},autoReflow:{type:Boolean,default:!1},manualInit:{type:Boolean,default:!1},endReachedThreshold:{default:0},immediateCheckEndReaching:{type:Boolean,default:!1},touchAngle:{default:45},isPrevent:{type:Boolean,default:!0}},emits:[`refreshActive`,`refreshing`,`endReached`,`end-reached`,`scroll`],setup(a,{expose:o,emit:s}){let c=a,l=s,u=(0,e.useSlots)(),d=(0,e.ref)(),f=(0,e.ref)(null),p=(0,e.ref)(!1),m=(0,e.ref)(!1),h=(0,e.ref)(!1),g=(0,e.ref)(!1),_=(0,e.ref)(!1),v=(0,e.ref)(!1),y=(0,e.ref)(null),b=(0,e.ref)(null),x=null,S=null,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=null,N=null,P=(0,e.computed)(()=>!!u.refresh),F=(0,e.computed)(()=>!!u.more);(0,e.watch)(()=>c.autoReflow,e=>{e?L():R()}),(0,e.onMounted)(()=>{c.manualInit||I()}),(0,e.onBeforeUnmount)(()=>{R()});function I(){if(p.value)return;x=d.value??null;let e=x?.querySelector(`.scroll-view-refresh`)??null,r=x?.querySelector(`.scroll-view-more`)??null;S=x?.querySelector(`.scroll-view-container`)??null;let i=e?e.clientHeight:0;if(C=r?r.clientHeight:0,!x||!S)return;let a=x.getBoundingClientRect(),o=new n.Scroller((e,t)=>{(0,n.render)(S,e,t),p.value&&q(e,t)},{scrollingX:c.scrollingX,scrollingY:c.scrollingY,bouncing:c.bouncing,zooming:!1,animationDuration:200,speedMultiplier:1.2,inRequestAnimationFrame:!0});o.setPosition(a.left+x.clientLeft,a.top+x.clientTop),P.value&&o.activatePullToRefresh(i,()=>{g.value=!0,h.value=!1,l(`refreshActive`)},()=>{g.value=!1,h.value=!1},()=>{g.value=!1,h.value=!0,l(`refreshing`)}),f.value=o,Z(!0),c.autoReflow&&L(),N=(0,t.debounce)(()=>{v.value=!0,l(`endReached`),l(`end-reached`)},50),setTimeout(()=>{p.value=!0},50),c.immediateCheckEndReaching&&z()}function L(){R(),M=setInterval(()=>{Z()},100)}function R(){M&&=(clearInterval(M),null)}function z(){let e=f.value;if(!e)return;let t=e._clientHeight,n=e._contentHeight,r=e._scrollTop,i=c.endReachedThreshold,a=n-t-(r+C+i);r>=0&&!v.value&&a<=0&&N&&(_.value=!0,N())}function B(){let e=E-w,t=D-T,n=Math.atan2(Math.abs(t),Math.abs(e))*180/Math.PI;return c.scrollingX?90-n:n}function V(e){let t=f.value;t&&(w=e.targetTouches[0].pageX,T=e.targetTouches[0].pageY,t.doTouchStart(Array.from(e.touches),e.timeStamp))}function H(e){let t=f.value;if(!t)return;let n=!1;if(c.isPrevent&&(e.preventDefault(),n=!0),E=e.targetTouches[0].pageX,D=e.targetTouches[0].pageY,(!c.scrollingX||!c.scrollingY)&&B()<c.touchAngle)return;!n&&e.cancelable&&e.preventDefault(),t.doTouchMove(Array.from(e.touches),e.timeStamp,e.scale);let r=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,i=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,a=E-r,o=D-i;(a>document.documentElement.clientWidth-15||o>document.documentElement.clientHeight-15||a<15||o<15)&&t.doTouchEnd(e.timeStamp)}function U(e){let t=f.value;t&&t.doTouchEnd(e.timeStamp)}function W(e){let t=f.value;t&&(w=e.pageX,T=e.pageY,t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),m.value=!0)}function G(e){let t=f.value;t&&m.value&&(E=e.pageX,D=e.pageY,(!c.scrollingX||!c.scrollingY)&&B()<c.touchAngle||(t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),m.value=!0))}function K(e){let t=f.value;t&&m.value&&(t.doTouchEnd(e.timeStamp),m.value=!1)}function q(e,t){e=+e.toFixed(2),t=+t.toFixed(2),(y.value!==e||b.value!==t)&&(y.value=e,b.value=t,z(),l(`scroll`,{scrollLeft:e,scrollTop:t}))}function J(){setTimeout(()=>{I()},0)}function Y(e,t,n=!1){f.value?.scrollTo(e,t,n)}function X(){return f.value?.getValues()??{left:0,top:0}}function Z(e=!1){let t=f.value;t&&x&&S&&setTimeout(()=>{let n=x.clientWidth,r=x.clientHeight,i=S.offsetWidth,a=S.offsetHeight;(e||O!==n||k!==r||A!==i||j!==a)&&(t.setDimensions(x.clientWidth,x.clientHeight,S.offsetWidth,S.offsetHeight),O=n,k=r,A=i,j=a)},0)}function Q(){f.value?.triggerPullToRefresh()}function $(){f.value?.finishPullToRefresh(),Z()}function ee(){_.value=!1,v.value=!1,Z()}return o({init:J,scrollTo:Y,getOffsets:X,reflowScroller:Z,triggerRefresh:Q,finishRefresh:$,finishLoadMore:ee}),(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{ref_key:`root`,ref:d,class:`cu-scroll-view`,onTouchstart:V,onTouchmove:H,onTouchend:U,onTouchcancel:U,onMousedown:W,onMousemove:G,onMouseup:K,onMouseleave:K},[t.$slots.header?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,r,[(0,e.renderSlot)(t.$slots,`header`)])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`scroll-view-container`,{horizon:a.scrollingX&&!a.scrollingY}]),"scroll-wrapper":``},[P.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:(0,e.normalizeClass)([`scroll-view-refresh`,{refreshing:h.value,"refresh-active":g.value}])},[(0,e.renderSlot)(t.$slots,`refresh`,{scrollTop:b.value??0,isRefreshing:h.value,isRefreshActive:g.value})],2)):(0,e.createCommentVNode)(``,!0),(0,e.renderSlot)(t.$slots,`default`),F.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:1,class:(0,e.normalizeClass)([`scroll-view-more`,{active:_.value||v.value}])},[(0,e.renderSlot)(t.$slots,`more`,{isEndReaching:_.value||v.value})],2)):(0,e.createCommentVNode)(``,!0)],2),t.$slots.footer?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,i,[(0,e.renderSlot)(t.$slots,`footer`)])):(0,e.createCommentVNode)(``,!0)],544))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Roller-DALhjhfg.cjs");let t=require("vue"),n=require("@centui/core");var r={class:`refresh-tip`},i=(0,t.defineComponent)({name:`cu-scroll-view-refresh`,__name:`ScrollViewRefresh`,props:{scrollTop:{default:0},isRefreshing:{type:Boolean,default:!1},isRefreshActive:{type:Boolean,default:!1},refreshText:{default:void 0},refreshActiveText:{default:void 0},refreshingText:{default:void 0},rollerColor:{default:`#2F86F6`}},setup(i){let a=i,o=(0,t.ref)(),s=(0,t.computed)(()=>{if(!o.value||o.value.clientHeight<=0||!a.scrollTop)return+a.scrollTop;let e=o.value.clientHeight;return Math.abs(a.scrollTop)<e/2?0:(Math.abs(a.scrollTop)-e/2)/(e/2)}),c=(0,t.computed)(()=>a.isRefreshing?a.refreshingText??(0,n.t)(`md.scroll_view.refresh.refreshing`):a.isRefreshActive?a.refreshActiveText??(0,n.t)(`md.scroll_view.refresh.freedRefresh`):a.refreshText??(0,n.t)(`md.scroll_view.refresh.pullDownRefresh`));return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`el`,ref:o,class:`cu-scroll-view-refresh`},[(0,t.createVNode)(e.t,{process:i.isRefreshing?void 0:s.value,width:10,color:i.rollerColor},null,8,[`process`,`color`]),(0,t.createElementVNode)(`p`,r,(0,t.toDisplayString)(c.value),1)],512))}}),a={class:`cu-scroll-view-more`},o=(0,t.defineComponent)({name:`cu-scroll-view-more`,__name:`ScrollViewMore`,props:{loadingText:{default:()=>String((0,n.t)(`md.scroll_view.more.loading`))},finishedText:{default:()=>String((0,n.t)(`md.scroll_view.more.allLoaded`))},isFinished:{type:Boolean,default:!1}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,a,[e.isFinished?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createTextVNode)((0,t.toDisplayString)(e.finishedText),1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)((0,t.toDisplayString)(e.loadingText),1)],64))]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as e } from "./Roller-BznN57fL.js";
|
|
2
|
+
import { Fragment as t, computed as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, openBlock as c, ref as l, toDisplayString as u } from "vue";
|
|
3
|
+
import { t as d } from "@centui/core";
|
|
4
|
+
// src/components/scroll-view/ScrollViewRefresh.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var f = { class: "refresh-tip" }, p = /* @__PURE__ */ s({
|
|
6
|
+
name: "cu-scroll-view-refresh",
|
|
7
|
+
__name: "ScrollViewRefresh",
|
|
8
|
+
props: {
|
|
9
|
+
scrollTop: { default: 0 },
|
|
10
|
+
isRefreshing: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
},
|
|
14
|
+
isRefreshActive: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
refreshText: { default: void 0 },
|
|
19
|
+
refreshActiveText: { default: void 0 },
|
|
20
|
+
refreshingText: { default: void 0 },
|
|
21
|
+
rollerColor: { default: "#2F86F6" }
|
|
22
|
+
},
|
|
23
|
+
setup(t) {
|
|
24
|
+
let a = t, s = l(), p = n(() => {
|
|
25
|
+
if (!s.value || s.value.clientHeight <= 0 || !a.scrollTop) return +a.scrollTop;
|
|
26
|
+
let e = s.value.clientHeight;
|
|
27
|
+
return Math.abs(a.scrollTop) < e / 2 ? 0 : (Math.abs(a.scrollTop) - e / 2) / (e / 2);
|
|
28
|
+
}), m = n(() => a.isRefreshing ? a.refreshingText ?? d("md.scroll_view.refresh.refreshing") : a.isRefreshActive ? a.refreshActiveText ?? d("md.scroll_view.refresh.freedRefresh") : a.refreshText ?? d("md.scroll_view.refresh.pullDownRefresh"));
|
|
29
|
+
return (n, a) => (c(), r("div", {
|
|
30
|
+
ref_key: "el",
|
|
31
|
+
ref: s,
|
|
32
|
+
class: "cu-scroll-view-refresh"
|
|
33
|
+
}, [o(e, {
|
|
34
|
+
process: t.isRefreshing ? void 0 : p.value,
|
|
35
|
+
width: 10,
|
|
36
|
+
color: t.rollerColor
|
|
37
|
+
}, null, 8, ["process", "color"]), i("p", f, u(m.value), 1)], 512));
|
|
38
|
+
}
|
|
39
|
+
}), m = { class: "cu-scroll-view-more" }, h = /* @__PURE__ */ s({
|
|
40
|
+
name: "cu-scroll-view-more",
|
|
41
|
+
__name: "ScrollViewMore",
|
|
42
|
+
props: {
|
|
43
|
+
loadingText: { default: () => String(d("md.scroll_view.more.loading")) },
|
|
44
|
+
finishedText: { default: () => String(d("md.scroll_view.more.allLoaded")) },
|
|
45
|
+
isFinished: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
setup(e) {
|
|
51
|
+
return (n, i) => (c(), r("div", m, [e.isFinished ? (c(), r(t, { key: 1 }, [a(u(e.finishedText), 1)], 64)) : (c(), r(t, { key: 0 }, [a(u(e.loadingText), 1)], 64))]));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export { p as n, h as t };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { t as e } from "./Popup-qLk-BsRS.js";
|
|
2
|
+
import { t } from "./PopupTitleBar-9P4RUMC1.js";
|
|
3
|
+
import { t as n } from "./ScrollView-BNY62f7B.js";
|
|
4
|
+
import { t as r } from "./RadioList-DNGsEzgf.js";
|
|
5
|
+
import { t as i } from "./CheckList-ViiCo4yi.js";
|
|
6
|
+
import { computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, openBlock as m, ref as h, renderSlot as g, useSlots as _, vShow as v, watch as y, withCtx as b, withDirectives as x } from "vue";
|
|
7
|
+
import { t as S } from "@centui/core";
|
|
8
|
+
// src/components/selector/Selector.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var C = { class: "cu-selector-container" }, w = /* @__PURE__ */ d({
|
|
10
|
+
name: "cu-selector",
|
|
11
|
+
__name: "Selector",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
data: { default: () => [] },
|
|
18
|
+
defaultValue: {
|
|
19
|
+
type: [
|
|
20
|
+
String,
|
|
21
|
+
Number,
|
|
22
|
+
Boolean,
|
|
23
|
+
Array
|
|
24
|
+
],
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
isCheck: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
maxHeight: { default: "auto" },
|
|
32
|
+
minHeight: { default: "auto" },
|
|
33
|
+
title: { default: "" },
|
|
34
|
+
describe: { default: "" },
|
|
35
|
+
okText: { default: "" },
|
|
36
|
+
cancelText: { default: void 0 },
|
|
37
|
+
maskClosable: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
hideTitleBar: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
multi: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
icon: { default: "checked" },
|
|
50
|
+
iconInverse: { default: "check" },
|
|
51
|
+
iconDisabled: { default: "check-disabled" },
|
|
52
|
+
iconSvg: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
},
|
|
56
|
+
iconSize: { default: "md" },
|
|
57
|
+
iconPosition: { default: "right" },
|
|
58
|
+
largeRadius: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
emits: [
|
|
64
|
+
"update:modelValue",
|
|
65
|
+
"choose",
|
|
66
|
+
"confirm",
|
|
67
|
+
"cancel",
|
|
68
|
+
"show",
|
|
69
|
+
"hide"
|
|
70
|
+
],
|
|
71
|
+
setup(d, { emit: w }) {
|
|
72
|
+
let T = d, E = w, D = _(), O = h(null), k = h(T.modelValue), A = h(Date.now()), j = h(Date.now() + 1), M = h(-1), N = h(-1), P = h([]), F = a(() => T.okText !== ""), I = a(() => {
|
|
73
|
+
let e = D.default;
|
|
74
|
+
return !!e && e({
|
|
75
|
+
option: {},
|
|
76
|
+
index: -1,
|
|
77
|
+
selected: !1
|
|
78
|
+
}).some((e) => e.type !== Comment);
|
|
79
|
+
}), L = a(() => T.cancelText ?? (T.okText ? String(S("md.selector.cancel")) : ""));
|
|
80
|
+
y(() => T.modelValue, (e) => {
|
|
81
|
+
k.value = e;
|
|
82
|
+
}), y(k, (e) => {
|
|
83
|
+
E("update:modelValue", e);
|
|
84
|
+
}), y(() => T.defaultValue, (e) => {
|
|
85
|
+
T.multi && e !== "" && (P.value = Array.isArray(e) ? e : [e]);
|
|
86
|
+
}, { immediate: !0 });
|
|
87
|
+
function R() {
|
|
88
|
+
T.multi ? (E("confirm", P.value.slice()), k.value = !1) : N.value > -1 && (M.value = N.value, k.value = !1, E("confirm", T.data[M.value]));
|
|
89
|
+
}
|
|
90
|
+
function z() {
|
|
91
|
+
k.value = !1, N.value = M.value, N.value === -1 ? (A.value = Date.now(), j.value = Date.now() + 1) : O.value?.selectByIndex(N.value), E("cancel");
|
|
92
|
+
}
|
|
93
|
+
function B(e, t) {
|
|
94
|
+
N.value = t, F.value || (M.value = t, k.value = !1), E("choose", e);
|
|
95
|
+
}
|
|
96
|
+
return (a, h) => (m(), s("div", { class: f(["cu-selector", {
|
|
97
|
+
"is-normal": !d.isCheck,
|
|
98
|
+
"is-check": d.isCheck
|
|
99
|
+
}]) }, [u(e, {
|
|
100
|
+
class: "inner-popup",
|
|
101
|
+
modelValue: k.value,
|
|
102
|
+
"onUpdate:modelValue": h[1] ||= (e) => k.value = e,
|
|
103
|
+
position: "bottom",
|
|
104
|
+
"mask-closable": d.maskClosable,
|
|
105
|
+
onShow: h[2] ||= (e) => a.$emit("show"),
|
|
106
|
+
onHide: h[3] ||= (e) => a.$emit("hide"),
|
|
107
|
+
onMaskClick: z
|
|
108
|
+
}, {
|
|
109
|
+
default: b(() => [x(u(t, {
|
|
110
|
+
title: d.title,
|
|
111
|
+
describe: d.describe,
|
|
112
|
+
"ok-text": d.okText,
|
|
113
|
+
"cancel-text": L.value,
|
|
114
|
+
"large-radius": d.largeRadius,
|
|
115
|
+
"only-close": !d.isCheck && !F.value && !d.cancelText,
|
|
116
|
+
onConfirm: R,
|
|
117
|
+
onCancel: z
|
|
118
|
+
}, null, 8, [
|
|
119
|
+
"title",
|
|
120
|
+
"describe",
|
|
121
|
+
"ok-text",
|
|
122
|
+
"cancel-text",
|
|
123
|
+
"large-radius",
|
|
124
|
+
"only-close"
|
|
125
|
+
]), [[v, !d.hideTitleBar || F.value]]), c("div", C, [u(n, {
|
|
126
|
+
ref: "scroll",
|
|
127
|
+
"scrolling-x": !1,
|
|
128
|
+
style: p({
|
|
129
|
+
maxHeight: `${d.maxHeight}`,
|
|
130
|
+
minHeight: `${d.minHeight}`
|
|
131
|
+
})
|
|
132
|
+
}, {
|
|
133
|
+
default: b(() => [
|
|
134
|
+
g(a.$slots, "header"),
|
|
135
|
+
d.multi ? (m(), o(i, {
|
|
136
|
+
class: "cu-selector-list",
|
|
137
|
+
ref: "check",
|
|
138
|
+
key: j.value,
|
|
139
|
+
modelValue: P.value,
|
|
140
|
+
"onUpdate:modelValue": h[0] ||= (e) => P.value = e,
|
|
141
|
+
options: d.data,
|
|
142
|
+
"is-slot-scope": I.value,
|
|
143
|
+
icon: d.icon,
|
|
144
|
+
"icon-disabled": d.iconDisabled,
|
|
145
|
+
"icon-inverse": d.iconInverse,
|
|
146
|
+
"icon-position": d.iconPosition,
|
|
147
|
+
"icon-size": d.iconSize,
|
|
148
|
+
"icon-svg": d.iconSvg
|
|
149
|
+
}, l({ _: 2 }, [I.value ? {
|
|
150
|
+
name: "default",
|
|
151
|
+
fn: b(({ option: e, index: t, selected: n }) => [g(a.$slots, "default", {
|
|
152
|
+
option: e,
|
|
153
|
+
index: t,
|
|
154
|
+
selected: n
|
|
155
|
+
})]),
|
|
156
|
+
key: "0"
|
|
157
|
+
} : void 0]), 1032, [
|
|
158
|
+
"modelValue",
|
|
159
|
+
"options",
|
|
160
|
+
"is-slot-scope",
|
|
161
|
+
"icon",
|
|
162
|
+
"icon-disabled",
|
|
163
|
+
"icon-inverse",
|
|
164
|
+
"icon-position",
|
|
165
|
+
"icon-size",
|
|
166
|
+
"icon-svg"
|
|
167
|
+
])) : (m(), o(r, {
|
|
168
|
+
class: "cu-selector-list",
|
|
169
|
+
ref_key: "radio",
|
|
170
|
+
ref: O,
|
|
171
|
+
key: A.value,
|
|
172
|
+
"model-value": d.defaultValue,
|
|
173
|
+
options: d.data,
|
|
174
|
+
"is-slot-scope": I.value,
|
|
175
|
+
icon: d.icon,
|
|
176
|
+
"icon-disabled": d.iconDisabled,
|
|
177
|
+
"icon-inverse": d.iconInverse,
|
|
178
|
+
"icon-position": d.iconPosition,
|
|
179
|
+
"icon-size": d.iconSize,
|
|
180
|
+
"icon-svg": d.iconSvg,
|
|
181
|
+
onChange: B
|
|
182
|
+
}, l({ _: 2 }, [I.value ? {
|
|
183
|
+
name: "default",
|
|
184
|
+
fn: b(({ option: e, index: t, selected: n }) => [g(a.$slots, "default", {
|
|
185
|
+
option: e,
|
|
186
|
+
index: t,
|
|
187
|
+
selected: n
|
|
188
|
+
})]),
|
|
189
|
+
key: "0"
|
|
190
|
+
} : void 0]), 1032, [
|
|
191
|
+
"model-value",
|
|
192
|
+
"options",
|
|
193
|
+
"is-slot-scope",
|
|
194
|
+
"icon",
|
|
195
|
+
"icon-disabled",
|
|
196
|
+
"icon-inverse",
|
|
197
|
+
"icon-position",
|
|
198
|
+
"icon-size",
|
|
199
|
+
"icon-svg"
|
|
200
|
+
])),
|
|
201
|
+
g(a.$slots, "footer")
|
|
202
|
+
]),
|
|
203
|
+
_: 3
|
|
204
|
+
}, 8, ["style"])])]),
|
|
205
|
+
_: 3
|
|
206
|
+
}, 8, ["modelValue", "mask-closable"])], 2));
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
export { w as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Popup-Ca1jPi0t.cjs"),t=require("./PopupTitleBar-Bfl49eYJ.cjs"),n=require("./ScrollView-BnadVBJC.cjs"),r=require("./RadioList-D-9PITpr.cjs"),i=require("./CheckList-BsKo_Fl3.cjs");let a=require("vue"),o=require("@centui/core");var s={class:`cu-selector-container`},c=(0,a.defineComponent)({name:`cu-selector`,__name:`Selector`,props:{modelValue:{type:Boolean,default:!1},data:{default:()=>[]},defaultValue:{type:[String,Number,Boolean,Array],default:``},isCheck:{type:Boolean,default:!1},maxHeight:{default:`auto`},minHeight:{default:`auto`},title:{default:``},describe:{default:``},okText:{default:``},cancelText:{default:void 0},maskClosable:{type:Boolean,default:!0},hideTitleBar:{type:Boolean,default:!1},multi:{type:Boolean,default:!1},icon:{default:`checked`},iconInverse:{default:`check`},iconDisabled:{default:`check-disabled`},iconSvg:{type:Boolean,default:!1},iconSize:{default:`md`},iconPosition:{default:`right`},largeRadius:{type:Boolean,default:!1}},emits:[`update:modelValue`,`choose`,`confirm`,`cancel`,`show`,`hide`],setup(c,{emit:l}){let u=c,d=l,f=(0,a.useSlots)(),p=(0,a.ref)(null),m=(0,a.ref)(u.modelValue),h=(0,a.ref)(Date.now()),g=(0,a.ref)(Date.now()+1),_=(0,a.ref)(-1),v=(0,a.ref)(-1),y=(0,a.ref)([]),b=(0,a.computed)(()=>u.okText!==``),x=(0,a.computed)(()=>{let e=f.default;return!!e&&e({option:{},index:-1,selected:!1}).some(e=>e.type!==Comment)}),S=(0,a.computed)(()=>u.cancelText??(u.okText?String((0,o.t)(`md.selector.cancel`)):``));(0,a.watch)(()=>u.modelValue,e=>{m.value=e}),(0,a.watch)(m,e=>{d(`update:modelValue`,e)}),(0,a.watch)(()=>u.defaultValue,e=>{u.multi&&e!==``&&(y.value=Array.isArray(e)?e:[e])},{immediate:!0});function C(){u.multi?(d(`confirm`,y.value.slice()),m.value=!1):v.value>-1&&(_.value=v.value,m.value=!1,d(`confirm`,u.data[_.value]))}function w(){m.value=!1,v.value=_.value,v.value===-1?(h.value=Date.now(),g.value=Date.now()+1):p.value?.selectByIndex(v.value),d(`cancel`)}function T(e,t){v.value=t,b.value||(_.value=t,m.value=!1),d(`choose`,e)}return(o,l)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:(0,a.normalizeClass)([`cu-selector`,{"is-normal":!c.isCheck,"is-check":c.isCheck}])},[(0,a.createVNode)(e.t,{class:`inner-popup`,modelValue:m.value,"onUpdate:modelValue":l[1]||=e=>m.value=e,position:`bottom`,"mask-closable":c.maskClosable,onShow:l[2]||=e=>o.$emit(`show`),onHide:l[3]||=e=>o.$emit(`hide`),onMaskClick:w},{default:(0,a.withCtx)(()=>[(0,a.withDirectives)((0,a.createVNode)(t.t,{title:c.title,describe:c.describe,"ok-text":c.okText,"cancel-text":S.value,"large-radius":c.largeRadius,"only-close":!c.isCheck&&!b.value&&!c.cancelText,onConfirm:C,onCancel:w},null,8,[`title`,`describe`,`ok-text`,`cancel-text`,`large-radius`,`only-close`]),[[a.vShow,!c.hideTitleBar||b.value]]),(0,a.createElementVNode)(`div`,s,[(0,a.createVNode)(n.t,{ref:`scroll`,"scrolling-x":!1,style:(0,a.normalizeStyle)({maxHeight:`${c.maxHeight}`,minHeight:`${c.minHeight}`})},{default:(0,a.withCtx)(()=>[(0,a.renderSlot)(o.$slots,`header`),c.multi?((0,a.openBlock)(),(0,a.createBlock)(i.t,{class:`cu-selector-list`,ref:`check`,key:g.value,modelValue:y.value,"onUpdate:modelValue":l[0]||=e=>y.value=e,options:c.data,"is-slot-scope":x.value,icon:c.icon,"icon-disabled":c.iconDisabled,"icon-inverse":c.iconInverse,"icon-position":c.iconPosition,"icon-size":c.iconSize,"icon-svg":c.iconSvg},(0,a.createSlots)({_:2},[x.value?{name:`default`,fn:(0,a.withCtx)(({option:e,index:t,selected:n})=>[(0,a.renderSlot)(o.$slots,`default`,{option:e,index:t,selected:n})]),key:`0`}:void 0]),1032,[`modelValue`,`options`,`is-slot-scope`,`icon`,`icon-disabled`,`icon-inverse`,`icon-position`,`icon-size`,`icon-svg`])):((0,a.openBlock)(),(0,a.createBlock)(r.t,{class:`cu-selector-list`,ref_key:`radio`,ref:p,key:h.value,"model-value":c.defaultValue,options:c.data,"is-slot-scope":x.value,icon:c.icon,"icon-disabled":c.iconDisabled,"icon-inverse":c.iconInverse,"icon-position":c.iconPosition,"icon-size":c.iconSize,"icon-svg":c.iconSvg,onChange:T},(0,a.createSlots)({_:2},[x.value?{name:`default`,fn:(0,a.withCtx)(({option:e,index:t,selected:n})=>[(0,a.renderSlot)(o.$slots,`default`,{option:e,index:t,selected:n})]),key:`0`}:void 0]),1032,[`model-value`,`options`,`is-slot-scope`,`icon`,`icon-disabled`,`icon-inverse`,`icon-position`,`icon-size`,`icon-svg`])),(0,a.renderSlot)(o.$slots,`footer`)]),_:3},8,[`style`])])]),_:3},8,[`modelValue`,`mask-closable`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderList as c, renderSlot as l, unref as u } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/components/skeleton/Skeleton.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var d = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "cu-skeleton"
|
|
@@ -51,5 +51,4 @@ var d = {
|
|
|
51
51
|
}, null, 4))), 128))])])) : (s(), n("div", p, [l(m.$slots, "default")]));
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
//#endregion
|
|
55
54
|
export { g as t };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, onBeforeUnmount as s, openBlock as c, ref as l, watch as u } from "vue";
|
|
2
|
+
// src/components/slider/Slider.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var d = ["data-hint"], f = ["data-hint"], p = ["data-hint"], m = /* @__PURE__ */ i({
|
|
4
|
+
name: "cu-slider",
|
|
5
|
+
__name: "Slider",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: { default: 0 },
|
|
8
|
+
min: { default: 0 },
|
|
9
|
+
max: { default: 100 },
|
|
10
|
+
step: { default: 1 },
|
|
11
|
+
range: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
format: {
|
|
16
|
+
type: Function,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue"],
|
|
25
|
+
setup(i, { emit: m }) {
|
|
26
|
+
let h = i, g = m, _ = l(), v = l(!1), y = l(!1), b = l([h.min, h.max]), x = 0, S = 0, C = (e) => h.format?.(e) ?? e;
|
|
27
|
+
u(() => h.modelValue, (e) => {
|
|
28
|
+
(Array.isArray(e) && (e[0] !== b.value[0] || e[1] !== b.value[1]) || !Array.isArray(e) && e !== b.value[0]) && D(e);
|
|
29
|
+
}, { immediate: !0 }), u(() => h.disabled, (e) => {
|
|
30
|
+
e || M();
|
|
31
|
+
}), s(() => {
|
|
32
|
+
M();
|
|
33
|
+
});
|
|
34
|
+
let w = t(() => (b.value[0] - h.min) / (h.max - h.min) * 100), T = t(() => (b.value[1] - h.min) / (h.max - h.min) * 100), E = t(() => h.range ? {
|
|
35
|
+
width: (b.value[1] - b.value[0]) / (h.max - h.min) * 100 + "%",
|
|
36
|
+
left: w.value + "%"
|
|
37
|
+
} : { width: (b.value[0] - h.min) / (h.max - h.min) * 100 + "%" });
|
|
38
|
+
function D(e) {
|
|
39
|
+
let t = [void 0, void 0];
|
|
40
|
+
Array.isArray(e) ? (t[0] = e[0], t[1] = e[1]) : t[0] = e, t[0] = typeof t[0] == "number" ? Math.round((t[0] - h.min) / h.step) * h.step + h.min : b.value[0], t[1] = typeof t[1] == "number" ? Math.round((t[1] - h.min) / h.step) * h.step + h.min : b.value[1], t[0] < h.min && (t[0] = h.min), t[1] > h.max && (t[1] = h.max), t[0] > t[1] && (t[0] === b.value[0] ? t[1] = t[0] : t[0] = t[1]), (b.value[0] !== t[0] || b.value[1] !== t[1]) && (b.value = [t[0], t[1]], h.range ? g("update:modelValue", b.value) : g("update:modelValue", b.value[0]));
|
|
41
|
+
}
|
|
42
|
+
function O(e) {
|
|
43
|
+
h.disabled || (e.preventDefault(), e.stopPropagation(), x = ("changedTouches" in e ? e.changedTouches[0] : e).pageX, S = b.value[0], y.value = !1, v.value = !0, window.addEventListener("mousemove", A), window.addEventListener("touchmove", A, { passive: !1 }), window.addEventListener("mouseup", j), window.addEventListener("touchend", j));
|
|
44
|
+
}
|
|
45
|
+
function k(e) {
|
|
46
|
+
h.disabled || (e.preventDefault(), e.stopPropagation(), x = ("changedTouches" in e ? e.changedTouches[0] : e).pageX, S = b.value[1], y.value = !0, v.value = !0, window.addEventListener("mousemove", A), window.addEventListener("touchmove", A, { passive: !1 }), window.addEventListener("mouseup", j), window.addEventListener("touchend", j));
|
|
47
|
+
}
|
|
48
|
+
function A(e) {
|
|
49
|
+
if (h.disabled || (e.preventDefault(), e.stopPropagation(), !v.value)) return;
|
|
50
|
+
let t = "changedTouches" in e ? e.changedTouches[0] : e, n = _.value, r = n?.offsetWidth ?? 0;
|
|
51
|
+
n && r !== 0 && window.requestAnimationFrame(() => {
|
|
52
|
+
let e = (t.pageX - x) / r * (h.max - h.min), n = S + e;
|
|
53
|
+
v.value && (y.value ? D([null, n]) : D([n, null]));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function j(e) {
|
|
57
|
+
e.preventDefault(), e.stopPropagation(), M();
|
|
58
|
+
}
|
|
59
|
+
function M() {
|
|
60
|
+
v.value = !1, y.value = !1, window.removeEventListener("mousemove", A), window.removeEventListener("touchmove", A), window.removeEventListener("mouseup", j), window.removeEventListener("touchend", j);
|
|
61
|
+
}
|
|
62
|
+
return (t, s) => (c(), n("div", {
|
|
63
|
+
ref_key: "root",
|
|
64
|
+
ref: _,
|
|
65
|
+
class: a(["cu-slider", { "is-disabled": i.disabled }])
|
|
66
|
+
}, [i.range ? (c(), n(e, { key: 0 }, [
|
|
67
|
+
r("div", {
|
|
68
|
+
class: "cu-slider-bar",
|
|
69
|
+
style: o(E.value)
|
|
70
|
+
}, null, 4),
|
|
71
|
+
r("div", {
|
|
72
|
+
class: a(["cu-slider-handle is-lower", { "is-active": v.value && !y.value }]),
|
|
73
|
+
"data-hint": C(b.value[0]),
|
|
74
|
+
style: o({ left: w.value + "%" })
|
|
75
|
+
}, [r("span", {
|
|
76
|
+
onMousedown: O,
|
|
77
|
+
onTouchstart: O
|
|
78
|
+
}, null, 32)], 14, d),
|
|
79
|
+
r("div", {
|
|
80
|
+
class: a(["cu-slider-handle is-higher", { "is-active": v.value && y.value }]),
|
|
81
|
+
"data-hint": C(b.value[1]),
|
|
82
|
+
style: o({ left: T.value + "%" })
|
|
83
|
+
}, [r("span", {
|
|
84
|
+
onMousedown: k,
|
|
85
|
+
onTouchstart: k
|
|
86
|
+
}, null, 32)], 14, f)
|
|
87
|
+
], 64)) : (c(), n(e, { key: 1 }, [r("div", {
|
|
88
|
+
class: "cu-slider-bar",
|
|
89
|
+
style: o(E.value)
|
|
90
|
+
}, null, 4), r("div", {
|
|
91
|
+
class: a(["cu-slider-handle", { "is-active": v.value }]),
|
|
92
|
+
"data-hint": C(b.value[0]),
|
|
93
|
+
style: o({ left: w.value + "%" })
|
|
94
|
+
}, [r("span", {
|
|
95
|
+
onMousedown: O,
|
|
96
|
+
onTouchstart: O
|
|
97
|
+
}, null, 32)], 14, p)], 64))], 2));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export { m as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue");var t=[`data-hint`],n=[`data-hint`],r=[`data-hint`],i=(0,e.defineComponent)({name:`cu-slider`,__name:`Slider`,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},range:{type:Boolean,default:!1},format:{type:Function,default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(i,{emit:a}){let o=i,s=a,c=(0,e.ref)(),l=(0,e.ref)(!1),u=(0,e.ref)(!1),d=(0,e.ref)([o.min,o.max]),f=0,p=0,m=e=>o.format?.(e)??e;(0,e.watch)(()=>o.modelValue,e=>{(Array.isArray(e)&&(e[0]!==d.value[0]||e[1]!==d.value[1])||!Array.isArray(e)&&e!==d.value[0])&&v(e)},{immediate:!0}),(0,e.watch)(()=>o.disabled,e=>{e||C()}),(0,e.onBeforeUnmount)(()=>{C()});let h=(0,e.computed)(()=>(d.value[0]-o.min)/(o.max-o.min)*100),g=(0,e.computed)(()=>(d.value[1]-o.min)/(o.max-o.min)*100),_=(0,e.computed)(()=>o.range?{width:(d.value[1]-d.value[0])/(o.max-o.min)*100+`%`,left:h.value+`%`}:{width:(d.value[0]-o.min)/(o.max-o.min)*100+`%`});function v(e){let t=[void 0,void 0];Array.isArray(e)?(t[0]=e[0],t[1]=e[1]):t[0]=e,t[0]=typeof t[0]==`number`?Math.round((t[0]-o.min)/o.step)*o.step+o.min:d.value[0],t[1]=typeof t[1]==`number`?Math.round((t[1]-o.min)/o.step)*o.step+o.min:d.value[1],t[0]<o.min&&(t[0]=o.min),t[1]>o.max&&(t[1]=o.max),t[0]>t[1]&&(t[0]===d.value[0]?t[1]=t[0]:t[0]=t[1]),(d.value[0]!==t[0]||d.value[1]!==t[1])&&(d.value=[t[0],t[1]],o.range?s(`update:modelValue`,d.value):s(`update:modelValue`,d.value[0]))}function y(e){o.disabled||(e.preventDefault(),e.stopPropagation(),f=(`changedTouches`in e?e.changedTouches[0]:e).pageX,p=d.value[0],u.value=!1,l.value=!0,window.addEventListener(`mousemove`,x),window.addEventListener(`touchmove`,x,{passive:!1}),window.addEventListener(`mouseup`,S),window.addEventListener(`touchend`,S))}function b(e){o.disabled||(e.preventDefault(),e.stopPropagation(),f=(`changedTouches`in e?e.changedTouches[0]:e).pageX,p=d.value[1],u.value=!0,l.value=!0,window.addEventListener(`mousemove`,x),window.addEventListener(`touchmove`,x,{passive:!1}),window.addEventListener(`mouseup`,S),window.addEventListener(`touchend`,S))}function x(e){if(o.disabled||(e.preventDefault(),e.stopPropagation(),!l.value))return;let t=`changedTouches`in e?e.changedTouches[0]:e,n=c.value,r=n?.offsetWidth??0;n&&r!==0&&window.requestAnimationFrame(()=>{let e=(t.pageX-f)/r*(o.max-o.min),n=p+e;l.value&&(u.value?v([null,n]):v([n,null]))})}function S(e){e.preventDefault(),e.stopPropagation(),C()}function C(){l.value=!1,u.value=!1,window.removeEventListener(`mousemove`,x),window.removeEventListener(`touchmove`,x),window.removeEventListener(`mouseup`,S),window.removeEventListener(`touchend`,S)}return(a,o)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{ref_key:`root`,ref:c,class:(0,e.normalizeClass)([`cu-slider`,{"is-disabled":i.disabled}])},[i.range?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`div`,{class:`cu-slider-bar`,style:(0,e.normalizeStyle)(_.value)},null,4),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-slider-handle is-lower`,{"is-active":l.value&&!u.value}]),"data-hint":m(d.value[0]),style:(0,e.normalizeStyle)({left:h.value+`%`})},[(0,e.createElementVNode)(`span`,{onMousedown:y,onTouchstart:y},null,32)],14,t),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-slider-handle is-higher`,{"is-active":l.value&&u.value}]),"data-hint":m(d.value[1]),style:(0,e.normalizeStyle)({left:g.value+`%`})},[(0,e.createElementVNode)(`span`,{onMousedown:b,onTouchstart:b},null,32)],14,n)],64)):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)(`div`,{class:`cu-slider-bar`,style:(0,e.normalizeStyle)(_.value)},null,4),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-slider-handle`,{"is-active":l.value}]),"data-hint":m(d.value[0]),style:(0,e.normalizeStyle)({left:h.value+`%`})},[(0,e.createElementVNode)(`span`,{onMousedown:y,onTouchstart:y},null,32)],14,r)],64))],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|