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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as e } from "./Popup-
|
|
2
|
-
import { t } from "./PopupTitleBar-
|
|
3
|
-
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeMount as p,
|
|
4
|
-
import { cascade as
|
|
5
|
-
import { Scroller as
|
|
6
|
-
|
|
7
|
-
var
|
|
1
|
+
import { t as e } from "./Popup-qLk-BsRS.js";
|
|
2
|
+
import { t } from "./PopupTitleBar-9P4RUMC1.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeMount as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, toDisplayString as y, unref as b, watch as x, withCtx as S } from "vue";
|
|
4
|
+
import { cascade as C, compareObjects as w, inArray as T, t as E, traverse as D, warn as O } from "@centui/core";
|
|
5
|
+
import { Scroller as k, getDpr as A, render as j } from "@centui/core/web";
|
|
6
|
+
// src/components/picker/PickerColumn.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var M = { class: "cu-picker-column-container" }, N = { class: "cu-picker-column-list" }, P = ["textContent"], ee = { class: "cu-picker-column-hooks" }, F = [
|
|
8
8
|
"onTouchstart",
|
|
9
9
|
"onMousedown",
|
|
10
10
|
"onTouchmove",
|
|
@@ -28,219 +28,233 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["initialed", "change"],
|
|
30
30
|
setup(e, { expose: t, emit: i }) {
|
|
31
|
-
let c = e, l = i,
|
|
32
|
-
maskerHeight: (c.lineHeight * 2 + 10) *
|
|
33
|
-
indicatorHeight: c.lineHeight *
|
|
31
|
+
let c = e, l = i, h = A(), b = _(), S = _([]), C = [], w = null, E = _(1), I = _(0), L = _([]), R = _(!1), z = _(!1), B = _(!1), V = r(() => ({
|
|
32
|
+
maskerHeight: (c.lineHeight * 2 + 10) * h,
|
|
33
|
+
indicatorHeight: c.lineHeight * h
|
|
34
34
|
}));
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
x(() => c.data, (e) => {
|
|
36
|
+
S.value = [...e], u(() => {
|
|
37
|
+
he();
|
|
38
|
+
});
|
|
37
39
|
}, { deep: !0 }), p(() => {
|
|
38
|
-
|
|
40
|
+
S.value = [...c.data];
|
|
41
|
+
}), m(() => {
|
|
42
|
+
w &&= (clearTimeout(w), null), C.forEach((e) => {
|
|
43
|
+
H(e);
|
|
44
|
+
}), C.length = 0;
|
|
39
45
|
});
|
|
40
|
-
function
|
|
41
|
-
|
|
46
|
+
function H(e) {
|
|
47
|
+
if (!e) return;
|
|
48
|
+
let t = e.stop;
|
|
49
|
+
if (typeof t == "function") {
|
|
50
|
+
t.call(e);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
let n = e.getValues();
|
|
54
|
+
e.scrollTo(n.left, n.top, !1, n.zoom);
|
|
55
|
+
}
|
|
56
|
+
function U() {
|
|
57
|
+
return b.value ? Array.from(b.value.querySelectorAll(".cu-picker-column-hook")) : [];
|
|
42
58
|
}
|
|
43
|
-
function
|
|
44
|
-
let t =
|
|
59
|
+
function W(e = 0) {
|
|
60
|
+
let t = U();
|
|
45
61
|
for (let n = e, r = t.length; n < r; n++) {
|
|
46
62
|
let e = t[n];
|
|
47
|
-
e &&
|
|
63
|
+
e && te(e, n);
|
|
48
64
|
}
|
|
49
|
-
e || (
|
|
50
|
-
l("initialed");
|
|
51
|
-
}, 0))),
|
|
65
|
+
e || (ne(), R.value || (R.value = !0, w && clearTimeout(w), w = setTimeout(() => {
|
|
66
|
+
w = null, l("initialed");
|
|
67
|
+
}, 0))), z.value = !0;
|
|
52
68
|
}
|
|
53
|
-
function
|
|
54
|
-
if (!
|
|
55
|
-
let n =
|
|
69
|
+
function te(e, t) {
|
|
70
|
+
if (!b.value) return;
|
|
71
|
+
let n = b.value.querySelectorAll(".column-list"), r = n[t];
|
|
56
72
|
if (t === void 0 || !n || !e || !r) return;
|
|
57
|
-
let i = e.getBoundingClientRect()
|
|
58
|
-
|
|
73
|
+
let i = e.getBoundingClientRect();
|
|
74
|
+
H(C[t]);
|
|
75
|
+
let a = new k((e, t) => {
|
|
76
|
+
j(r, e, t);
|
|
59
77
|
}, {
|
|
60
78
|
scrollingX: !1,
|
|
61
79
|
snapping: !0,
|
|
62
80
|
snappingVelocity: 1,
|
|
63
81
|
animationDuration: 350,
|
|
64
82
|
scrollingComplete: () => {
|
|
65
|
-
|
|
83
|
+
ce(t);
|
|
66
84
|
}
|
|
67
85
|
});
|
|
68
|
-
a.setPosition(i.left + e.clientLeft, i.top + e.clientTop), a.setDimensions(e.clientWidth, e.clientHeight, r.offsetWidth, r.offsetHeight +
|
|
86
|
+
a.setPosition(i.left + e.clientLeft, i.top + e.clientTop), a.setDimensions(e.clientWidth, e.clientHeight, r.offsetWidth, r.offsetHeight + V.value.maskerHeight), a.setSnapSize(0, V.value.indicatorHeight), C[t] = a, Y(t);
|
|
69
87
|
}
|
|
70
|
-
function
|
|
71
|
-
let e =
|
|
88
|
+
function ne() {
|
|
89
|
+
let e = S.value, t = C;
|
|
72
90
|
G(e, c.defaultIndex, c.defaultValue, (e, n) => {
|
|
73
91
|
let r = t[e];
|
|
74
|
-
|
|
75
|
-
D(`initialColumnIndex: scroller of column ${e} is undefined`);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
q(e, n) ? X(r, e, n) : (Y(r, e, n), I.value[e] = n);
|
|
92
|
+
r ? q(e, n) ? Z(r, e, n) : (X(r, e, n), L.value[e] = n) : O(`initialColumnIndex: scroller of column ${e} is undefined`);
|
|
79
93
|
});
|
|
80
94
|
}
|
|
81
95
|
function G(e, t = [], n, r = () => {}) {
|
|
82
|
-
e &&
|
|
96
|
+
e && D(e, (e, i, a) => {
|
|
83
97
|
let o = a[0], s = a[1], c = t[o], l = n[o];
|
|
84
98
|
if (c === void 0 && l === void 0 && (c = 0), c !== void 0 && s === c || l !== void 0 && (e.text === l || e.label === l || e.value === l)) return r(o, s), 2;
|
|
85
99
|
});
|
|
86
100
|
}
|
|
87
|
-
function
|
|
88
|
-
return Math.round(e /
|
|
101
|
+
function re(e) {
|
|
102
|
+
return Math.round(e / V.value.indicatorHeight);
|
|
89
103
|
}
|
|
90
104
|
function K(e) {
|
|
91
|
-
return e *
|
|
105
|
+
return e * V.value.indicatorHeight;
|
|
92
106
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
107
|
+
function ie(e, t) {
|
|
108
|
+
return L.value[e] === t;
|
|
95
109
|
}
|
|
96
110
|
function q(e, t) {
|
|
97
111
|
let n = c.invalidIndex[e];
|
|
98
|
-
return
|
|
112
|
+
return T(n, t);
|
|
99
113
|
}
|
|
100
|
-
function
|
|
114
|
+
function ae(e) {
|
|
101
115
|
for (let t of c.data[e].keys()) if (!q(e, t)) return !0;
|
|
102
|
-
return
|
|
116
|
+
return O(`hasValidIndex: has no valid items in column index ${e}`), !1;
|
|
103
117
|
}
|
|
104
118
|
function J(e, t) {
|
|
105
|
-
if (!
|
|
119
|
+
if (!ae(e)) return t;
|
|
106
120
|
let n = t;
|
|
107
|
-
for (; q(e, n);) n +=
|
|
108
|
-
return n < 0 || n > c.data[e].length - 1 ? (
|
|
121
|
+
for (; q(e, n);) n += E.value;
|
|
122
|
+
return n < 0 || n > c.data[e].length - 1 ? (E.value = -E.value, J(e, t)) : n;
|
|
109
123
|
}
|
|
110
|
-
function
|
|
111
|
-
let t =
|
|
112
|
-
t && r && (r > n.length - 1 && (r = n.length - 1),
|
|
124
|
+
function Y(e) {
|
|
125
|
+
let t = C[e], n = S.value[e] || [], r = L.value[e] || 0;
|
|
126
|
+
t && r && (r > n.length - 1 && (r = n.length - 1), X(t, e, r), L.value[e] = r);
|
|
113
127
|
}
|
|
114
|
-
function
|
|
128
|
+
function X(e, t, n) {
|
|
115
129
|
let r = K(n);
|
|
116
130
|
e.scrollTo(0, r);
|
|
117
131
|
}
|
|
118
|
-
function
|
|
132
|
+
function Z(e, t, n) {
|
|
119
133
|
let r = K(J(t, n));
|
|
120
|
-
e.scrollTo(0,
|
|
134
|
+
e.scrollTo(0, Q(e, r), !0);
|
|
121
135
|
}
|
|
122
|
-
function
|
|
136
|
+
function Q(e, t) {
|
|
123
137
|
let n = e.getScrollMax().top;
|
|
124
138
|
return t < 0 ? 0 : t > n ? n : t;
|
|
125
139
|
}
|
|
126
|
-
function
|
|
140
|
+
function oe(e, t, n = !1) {
|
|
127
141
|
e.preventDefault();
|
|
128
|
-
let r =
|
|
142
|
+
let r = C[t], i = n ? [{
|
|
129
143
|
pageX: e.pageX,
|
|
130
144
|
pageY: e.pageY
|
|
131
145
|
}] : Array.from(e.touches);
|
|
132
|
-
|
|
133
|
-
D(`touchstart: scroller of column ${t} is undefined`);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
T.value = n ? e.pageY : e.touches[0].pageY, r.doTouchStart(i, e.timeStamp), n && (z.value = !0);
|
|
146
|
+
r ? (I.value = n ? e.pageY : e.touches[0].pageY, r.doTouchStart(i, e.timeStamp), n && (B.value = !0)) : O(`touchstart: scroller of column ${t} is undefined`);
|
|
137
147
|
}
|
|
138
148
|
function $(e, t, n = !1) {
|
|
139
|
-
let r =
|
|
149
|
+
let r = C[t], i = n ? [{
|
|
140
150
|
pageX: e.pageX,
|
|
141
151
|
pageY: e.pageY
|
|
142
152
|
}] : Array.from(e.touches);
|
|
143
|
-
if (!r || n && !
|
|
144
|
-
let a =
|
|
145
|
-
|
|
153
|
+
if (!r || n && !B.value) return;
|
|
154
|
+
let a = I.value - (n ? e.pageY : e.touches[0].pageY);
|
|
155
|
+
E.value = a ? a / Math.abs(a) : 1, r.doTouchMove(i, e.timeStamp), n && (B.value = !0);
|
|
146
156
|
}
|
|
147
|
-
function
|
|
148
|
-
let r =
|
|
149
|
-
!r || n && !
|
|
157
|
+
function se(e, t, n = !1) {
|
|
158
|
+
let r = C[t];
|
|
159
|
+
!r || n && !B.value || (r.doTouchEnd(e.timeStamp), n && (B.value = !1));
|
|
150
160
|
}
|
|
151
|
-
function
|
|
152
|
-
let t =
|
|
161
|
+
function ce(e) {
|
|
162
|
+
let t = C[e];
|
|
153
163
|
if (!t) return;
|
|
154
|
-
let n = t.getValues().top, r =
|
|
155
|
-
|
|
156
|
-
i && X(t, e, r), r === I.value[e] && Y(t, e, r);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
I.value[e] = r, l("change", e, r, oe(e));
|
|
164
|
+
let n = t.getValues().top, r = re(Q(t, n)), i = q(e, r);
|
|
165
|
+
i || r === L.value[e] ? (i && Z(t, e, r), r === L.value[e] && X(t, e, r)) : (L.value[e] = r, l("change", e, r, le(e)));
|
|
160
166
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
167
|
+
function le(e = 0) {
|
|
168
|
+
return ue()[e];
|
|
163
169
|
}
|
|
164
|
-
function
|
|
165
|
-
let e =
|
|
170
|
+
function ue() {
|
|
171
|
+
let e = S.value, t = L.value, n = [];
|
|
166
172
|
return e.forEach((e, r) => {
|
|
167
173
|
n[r] = e[t[r]];
|
|
168
174
|
}), n;
|
|
169
175
|
}
|
|
170
|
-
function
|
|
171
|
-
return
|
|
176
|
+
function de(e = 0) {
|
|
177
|
+
return L.value[e];
|
|
172
178
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
179
|
+
function fe() {
|
|
180
|
+
return L.value;
|
|
175
181
|
}
|
|
176
|
-
function
|
|
177
|
-
e !== void 0 && t !== void 0 && (c.keepIndex || (
|
|
182
|
+
function pe(e, t, n = () => {}) {
|
|
183
|
+
e !== void 0 && t !== void 0 && (c.keepIndex || (L.value[e] = 0), S.value[e] = t, u(() => {
|
|
178
184
|
n();
|
|
179
185
|
}));
|
|
180
186
|
}
|
|
181
|
-
function
|
|
187
|
+
function me(e, t = 0) {
|
|
182
188
|
u(() => {
|
|
183
|
-
|
|
189
|
+
W(t), e && e();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function he() {
|
|
193
|
+
if (!b.value) return;
|
|
194
|
+
let e = U(), t = b.value.querySelectorAll(".column-list");
|
|
195
|
+
e.forEach((e, n) => {
|
|
196
|
+
let r = C[n], i = t[n];
|
|
197
|
+
r && e && i && (r.setDimensions(e.clientWidth, e.clientHeight, i.offsetWidth, i.offsetHeight + V.value.maskerHeight), Y(n));
|
|
184
198
|
});
|
|
185
199
|
}
|
|
186
200
|
return t({
|
|
187
|
-
refresh:
|
|
188
|
-
getColumnValue:
|
|
189
|
-
getColumnValues:
|
|
190
|
-
getColumnIndex:
|
|
191
|
-
getColumnIndexs:
|
|
201
|
+
refresh: me,
|
|
202
|
+
getColumnValue: le,
|
|
203
|
+
getColumnValues: ue,
|
|
204
|
+
getColumnIndex: de,
|
|
205
|
+
getColumnIndexs: fe,
|
|
192
206
|
getColumnIndexByDefault: G,
|
|
193
|
-
setColumnValues:
|
|
194
|
-
isScrollInitialed:
|
|
195
|
-
activedIndexs:
|
|
196
|
-
scrollers:
|
|
197
|
-
}), (t, r) => (
|
|
207
|
+
setColumnValues: pe,
|
|
208
|
+
isScrollInitialed: z,
|
|
209
|
+
activedIndexs: L,
|
|
210
|
+
scrollers: C
|
|
211
|
+
}), (t, r) => (g(), o("div", {
|
|
198
212
|
ref_key: "root",
|
|
199
|
-
ref:
|
|
213
|
+
ref: b,
|
|
200
214
|
class: "cu-picker-column",
|
|
201
|
-
style: f({ height: `${
|
|
202
|
-
}, [s("div",
|
|
215
|
+
style: f({ height: `${V.value.indicatorHeight + 2 * V.value.maskerHeight}px` })
|
|
216
|
+
}, [s("div", M, [
|
|
203
217
|
s("div", {
|
|
204
218
|
class: "cu-picker-column-masker top",
|
|
205
|
-
style: f({ height: `${
|
|
219
|
+
style: f({ height: `${V.value.maskerHeight}px` })
|
|
206
220
|
}, null, 4),
|
|
207
221
|
s("div", {
|
|
208
222
|
class: "cu-picker-column-masker bottom",
|
|
209
|
-
style: f({ height: `${
|
|
223
|
+
style: f({ height: `${V.value.maskerHeight}px` })
|
|
210
224
|
}, null, 4),
|
|
211
|
-
s("div",
|
|
225
|
+
s("div", N, [(g(!0), o(n, null, v(S.value, (e, t) => (g(), o("div", {
|
|
212
226
|
key: t,
|
|
213
227
|
class: "cu-picker-column-item"
|
|
214
228
|
}, [s("ul", {
|
|
215
229
|
class: "column-list",
|
|
216
|
-
style: f({ "padding-top": `${
|
|
217
|
-
}, [(
|
|
230
|
+
style: f({ "padding-top": `${V.value.maskerHeight}px` })
|
|
231
|
+
}, [(g(!0), o(n, null, v(e, (e, n) => (g(), o("li", {
|
|
218
232
|
key: n,
|
|
219
233
|
class: d(["column-item", {
|
|
220
|
-
active:
|
|
234
|
+
active: ie(t, n),
|
|
221
235
|
disabled: q(t, n)
|
|
222
236
|
}]),
|
|
223
237
|
style: f({
|
|
224
|
-
height: `${
|
|
225
|
-
"line-height": `${
|
|
238
|
+
height: `${V.value.indicatorHeight}px`,
|
|
239
|
+
"line-height": `${V.value.indicatorHeight}px`
|
|
226
240
|
}),
|
|
227
|
-
textContent:
|
|
228
|
-
}, null, 14,
|
|
229
|
-
key: e +
|
|
241
|
+
textContent: y(e.text || e.label)
|
|
242
|
+
}, null, 14, P))), 128))], 4)]))), 128)), e.cols ? (g(!0), o(n, { key: 0 }, v(e.cols - S.value.length, (e) => (g(), o("div", {
|
|
243
|
+
key: e + S.value.length - 1,
|
|
230
244
|
class: "cu-picker-column-item"
|
|
231
245
|
}, [s("ul", {
|
|
232
246
|
class: "column-list",
|
|
233
|
-
style: f({ "padding-top": `${
|
|
247
|
+
style: f({ "padding-top": `${V.value.maskerHeight}px` })
|
|
234
248
|
}, null, 4)]))), 128)) : a("", !0)]),
|
|
235
|
-
s("div",
|
|
249
|
+
s("div", ee, [e.cols ? (g(!0), o(n, { key: 0 }, v(e.cols, (e) => (g(), o("div", {
|
|
236
250
|
key: e - 1,
|
|
237
251
|
class: "cu-picker-column-hook",
|
|
238
|
-
onTouchstart: (t) =>
|
|
239
|
-
onMousedown: (t) =>
|
|
252
|
+
onTouchstart: (t) => oe(t, e - 1),
|
|
253
|
+
onMousedown: (t) => oe(t, e - 1, !0),
|
|
240
254
|
onTouchmove: (t) => $(t, e - 1),
|
|
241
255
|
onMousemove: (t) => $(t, e - 1, !0),
|
|
242
|
-
onTouchend: (t) =>
|
|
243
|
-
onMouseup: (t) =>
|
|
256
|
+
onTouchend: (t) => se(t, e - 1),
|
|
257
|
+
onMouseup: (t) => se(t, e - 1, !0)
|
|
244
258
|
}, null, 40, F))), 128)) : a("", !0)])
|
|
245
259
|
])], 4));
|
|
246
260
|
}
|
|
@@ -293,29 +307,29 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
293
307
|
"hide"
|
|
294
308
|
],
|
|
295
309
|
setup(n, { expose: r, emit: a }) {
|
|
296
|
-
let s = n, l = a, u = s.okText ??
|
|
297
|
-
|
|
310
|
+
let s = n, l = a, u = s.okText ?? String(E("md.picker.confirm")), f = s.cancelText ?? String(E("md.picker.cancel")), p = s.lineHeight ?? 45, m = _(), v = _(!1), y = _(!0), T = _(null);
|
|
311
|
+
x(() => s.modelValue, (e) => {
|
|
298
312
|
v.value = e, e && O();
|
|
299
|
-
}),
|
|
313
|
+
}), x(v, (e) => {
|
|
300
314
|
e || l("update:modelValue", e);
|
|
301
|
-
}),
|
|
302
|
-
|
|
315
|
+
}), x(() => s.data, (e, t) => {
|
|
316
|
+
w(e, t) || k();
|
|
303
317
|
}, {
|
|
304
318
|
deep: !0,
|
|
305
319
|
immediate: !0
|
|
306
|
-
}),
|
|
320
|
+
}), x(() => s.defaultIndex, () => {
|
|
307
321
|
k();
|
|
308
|
-
}, { deep: !0 }),
|
|
322
|
+
}, { deep: !0 }), h(() => {
|
|
309
323
|
O(), s.isView && setTimeout(() => {
|
|
310
|
-
|
|
324
|
+
m.value?.refresh();
|
|
311
325
|
});
|
|
312
326
|
});
|
|
313
327
|
function D() {
|
|
314
|
-
return
|
|
328
|
+
return m.value;
|
|
315
329
|
}
|
|
316
330
|
function O() {
|
|
317
|
-
!s.isView && s.modelValue && (v.value = s.modelValue),
|
|
318
|
-
|
|
331
|
+
!s.isView && s.modelValue && (v.value = s.modelValue), y.value ? y.value = !1 : setTimeout(() => {
|
|
332
|
+
T.value = [...D()?.activedIndexs ?? []];
|
|
319
333
|
}, 100);
|
|
320
334
|
}
|
|
321
335
|
function k() {
|
|
@@ -323,7 +337,7 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
323
337
|
let e = j(), t = M();
|
|
324
338
|
setTimeout(() => {
|
|
325
339
|
let n = D();
|
|
326
|
-
n &&
|
|
340
|
+
n && C(n, {
|
|
327
341
|
currentLevel: -1,
|
|
328
342
|
maxLevel: s.cols,
|
|
329
343
|
values: s.data || [],
|
|
@@ -336,20 +350,24 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
336
350
|
k();
|
|
337
351
|
}
|
|
338
352
|
function j() {
|
|
339
|
-
return
|
|
353
|
+
return T.value || s.defaultIndex;
|
|
340
354
|
}
|
|
341
355
|
function M() {
|
|
342
|
-
return
|
|
356
|
+
return T.value ? [] : s.defaultValue;
|
|
343
357
|
}
|
|
344
|
-
function N() {
|
|
358
|
+
function N(e) {
|
|
359
|
+
let t = e;
|
|
360
|
+
if (typeof t.isScrolling == "function") return t.isScrolling();
|
|
361
|
+
let n = e;
|
|
362
|
+
return n._isAnimating !== !1 || n._isDecelerating !== !1 || n._isDragging !== !1 || n._isGesturing !== !1;
|
|
363
|
+
}
|
|
364
|
+
function P() {
|
|
345
365
|
let e = D();
|
|
346
366
|
if (!e) return;
|
|
347
|
-
let t = e.getColumnValues()
|
|
348
|
-
e.scrollers.
|
|
349
|
-
(e._isAnimating !== !1 || e._isDecelerating !== !1 || e._isDragging !== !1 || e._isGesturing !== !1) && (n = !0);
|
|
350
|
-
}), n || (v.value = !1, l("confirm", t));
|
|
367
|
+
let t = e.getColumnValues();
|
|
368
|
+
e.scrollers.some((e) => N(e)) || (v.value = !1, l("confirm", t));
|
|
351
369
|
}
|
|
352
|
-
function
|
|
370
|
+
function ee() {
|
|
353
371
|
l("initialed");
|
|
354
372
|
}
|
|
355
373
|
function F() {
|
|
@@ -360,7 +378,7 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
360
378
|
function L(e, t, n) {
|
|
361
379
|
if (s.isCascade) {
|
|
362
380
|
let t = D();
|
|
363
|
-
t &&
|
|
381
|
+
t && C(t, {
|
|
364
382
|
currentLevel: e,
|
|
365
383
|
maxLevel: s.cols,
|
|
366
384
|
values: [n]
|
|
@@ -399,15 +417,15 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
399
417
|
getColumnValues: H,
|
|
400
418
|
getColumnIndex: U,
|
|
401
419
|
getColumnIndexs: W
|
|
402
|
-
}), (r, a) => (
|
|
420
|
+
}), (r, a) => (g(), o("div", { class: d(["cu-picker", { "with-popup": !n.isView }]) }, [n.isView ? (g(), i(I, {
|
|
403
421
|
key: 0,
|
|
404
422
|
ref_key: "pickerColumn",
|
|
405
|
-
ref:
|
|
423
|
+
ref: m,
|
|
406
424
|
data: n.data,
|
|
407
425
|
"default-value": n.defaultValue,
|
|
408
426
|
"default-index": n.defaultIndex,
|
|
409
427
|
"invalid-index": n.invalidIndex,
|
|
410
|
-
"line-height":
|
|
428
|
+
"line-height": b(p),
|
|
411
429
|
"keep-index": n.keepIndex,
|
|
412
430
|
cols: n.cols,
|
|
413
431
|
onInitialed: a[0] ||= (e) => l("initialed"),
|
|
@@ -420,7 +438,7 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
420
438
|
"line-height",
|
|
421
439
|
"keep-index",
|
|
422
440
|
"cols"
|
|
423
|
-
])) : (
|
|
441
|
+
])) : (g(), i(e, {
|
|
424
442
|
key: 1,
|
|
425
443
|
"model-value": v.value,
|
|
426
444
|
class: "inner-popup",
|
|
@@ -433,13 +451,13 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
433
451
|
onHide: z,
|
|
434
452
|
onMaskClick: F
|
|
435
453
|
}, {
|
|
436
|
-
default:
|
|
454
|
+
default: S(() => [c(t, {
|
|
437
455
|
title: n.title,
|
|
438
456
|
describe: n.describe,
|
|
439
|
-
"ok-text":
|
|
440
|
-
"cancel-text":
|
|
457
|
+
"ok-text": b(u),
|
|
458
|
+
"cancel-text": b(f),
|
|
441
459
|
"large-radius": n.largeRadius,
|
|
442
|
-
onConfirm:
|
|
460
|
+
onConfirm: P,
|
|
443
461
|
onCancel: F
|
|
444
462
|
}, null, 8, [
|
|
445
463
|
"title",
|
|
@@ -449,15 +467,15 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
449
467
|
"large-radius"
|
|
450
468
|
]), c(I, {
|
|
451
469
|
ref_key: "pickerColumn",
|
|
452
|
-
ref:
|
|
470
|
+
ref: m,
|
|
453
471
|
data: n.data,
|
|
454
472
|
"default-value": M(),
|
|
455
473
|
"default-index": j(),
|
|
456
474
|
"invalid-index": n.invalidIndex,
|
|
457
|
-
"line-height":
|
|
475
|
+
"line-height": b(p),
|
|
458
476
|
"keep-index": n.keepIndex,
|
|
459
477
|
cols: n.cols,
|
|
460
|
-
onInitialed:
|
|
478
|
+
onInitialed: ee,
|
|
461
479
|
onChange: L
|
|
462
480
|
}, null, 8, [
|
|
463
481
|
"data",
|
|
@@ -472,5 +490,4 @@ var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-
|
|
|
472
490
|
}, 8, ["model-value", "mask-closable"]))], 2));
|
|
473
491
|
}
|
|
474
492
|
});
|
|
475
|
-
//#endregion
|
|
476
493
|
export { I as n, L as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue");var t=(0,e.defineComponent)({name:`cu-popup`,__name:`Popup`,props:{modelValue:{type:Boolean,default:!1},hasMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},position:{default:`center`},transition:{default:void 0},preventScroll:{type:Boolean,default:!1},preventScrollExclude:{default:``}},emits:[`update:modelValue`,`beforeShow`,`before-show`,`beforeHide`,`before-hide`,`show`,`hide`,`maskClick`],setup(t,{emit:n}){let r=t,i=n,a=typeof process<`u`&&process.env.MAND_ENV===`test`,o=(0,e.ref)(),s=null,c=(0,e.ref)(!1),l=(0,e.ref)(!1),u=(0,e.ref)(!1),d=(0,e.ref)(!1);(0,e.provide)(`mdPopupLargeRadius`,d);let f=(0,e.computed)(()=>r.transition??p(r.position));function p(e){switch(e){case`bottom`:return`cu-slide-up`;case`top`:return`cu-slide-down`;case`left`:return`cu-slide-right`;case`right`:return`cu-slide-left`;default:return`cu-fade`}}(0,e.watch)(()=>r.modelValue,e=>{e?u.value?(s&&clearTimeout(s),s=setTimeout(()=>{s=null,m()},50)):m():h()}),(0,e.watch)(()=>r.preventScrollExclude,(e,t)=>{_(!1,t),_(!0,e)}),(0,e.onMounted)(()=>{r.modelValue&&m()}),(0,e.onBeforeUnmount)(()=>{s&&=(clearTimeout(s),null)});function m(){c.value=!0,u.value=!0,l.value=!0,a&&(b(),x()),r.preventScroll&&g(!0)}function h(){u.value=!0,l.value=!1,r.preventScroll&&g(!1),i(`update:modelValue`,!1),a&&(b(),x())}function g(e){let t=e?`addEventListener`:`removeEventListener`,n=o.value?.querySelector(`.cu-popup-mask`),r=o.value?.querySelector(`.cu-popup-box`);n&&n[t](`touchmove`,v,!1),r&&r[t](`touchmove`,v,!1),_(e)}function _(e,t=r.preventScrollExclude){let n=e?`addEventListener`:`removeEventListener`,i=typeof t==`string`?t?o.value?.querySelector(t):void 0:t;i&&i[n](`touchmove`,y,!1)}function v(e){e.preventDefault()}function y(e){e.stopImmediatePropagation()}function b(){l.value?(i(`beforeShow`),i(`before-show`)):(i(`beforeHide`),i(`before-hide`))}function x(){u.value&&=(l.value?i(`show`):(c.value=!1,i(`hide`)),!1)}function S(){r.maskClosable&&(h(),i(`maskClick`))}return(n,r)=>(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{ref_key:`root`,ref:o,class:(0,e.normalizeClass)([`cu-popup`,[t.hasMask?`with-mask`:``,d.value?`large-radius`:``,t.position]])},[(0,e.createVNode)(e.Transition,{name:`cu-mask-fade`},{default:(0,e.withCtx)(()=>[(0,e.withDirectives)((0,e.createElementVNode)(`div`,{class:`cu-popup-mask`,onClick:S},null,512),[[e.vShow,t.hasMask&&l.value]])]),_:1}),(0,e.createVNode)(e.Transition,{name:f.value,onBeforeEnter:b,onBeforeLeave:b,onAfterEnter:x,onAfterLeave:x},{default:(0,e.withCtx)(()=>[(0,e.withDirectives)((0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-popup-box`,[f.value]])},[(0,e.renderSlot)(n.$slots,`default`)],2),[[e.vShow,l.value]])]),_:3},8,[`name`])],2)),[[e.vShow,c.value]])}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Transition as e, computed as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, onBeforeUnmount as s, onMounted as c, openBlock as l, provide as u, ref as d, renderSlot as f, vShow as p, watch as m, withCtx as h, withDirectives as g } from "vue";
|
|
2
|
+
// src/components/popup/Popup.vue
|
|
3
|
+
var _ = /* @__PURE__ */ a({
|
|
4
|
+
name: "cu-popup",
|
|
5
|
+
__name: "Popup",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
hasMask: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !0
|
|
14
|
+
},
|
|
15
|
+
maskClosable: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
},
|
|
19
|
+
position: { default: "center" },
|
|
20
|
+
transition: { default: void 0 },
|
|
21
|
+
preventScroll: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
preventScrollExclude: { default: "" }
|
|
26
|
+
},
|
|
27
|
+
emits: [
|
|
28
|
+
"update:modelValue",
|
|
29
|
+
"beforeShow",
|
|
30
|
+
"before-show",
|
|
31
|
+
"beforeHide",
|
|
32
|
+
"before-hide",
|
|
33
|
+
"show",
|
|
34
|
+
"hide",
|
|
35
|
+
"maskClick"
|
|
36
|
+
],
|
|
37
|
+
setup(a, { emit: _ }) {
|
|
38
|
+
let v = a, y = _, b = typeof process < "u" && process.env.MAND_ENV === "test", x = d(), S = null, C = d(!1), w = d(!1), T = d(!1), E = d(!1);
|
|
39
|
+
u("mdPopupLargeRadius", E);
|
|
40
|
+
let D = t(() => v.transition ?? O(v.position));
|
|
41
|
+
function O(e) {
|
|
42
|
+
switch (e) {
|
|
43
|
+
case "bottom": return "cu-slide-up";
|
|
44
|
+
case "top": return "cu-slide-down";
|
|
45
|
+
case "left": return "cu-slide-right";
|
|
46
|
+
case "right": return "cu-slide-left";
|
|
47
|
+
default: return "cu-fade";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
m(() => v.modelValue, (e) => {
|
|
51
|
+
e ? T.value ? (S && clearTimeout(S), S = setTimeout(() => {
|
|
52
|
+
S = null, k();
|
|
53
|
+
}, 50)) : k() : A();
|
|
54
|
+
}), m(() => v.preventScrollExclude, (e, t) => {
|
|
55
|
+
M(!1, t), M(!0, e);
|
|
56
|
+
}), c(() => {
|
|
57
|
+
v.modelValue && k();
|
|
58
|
+
}), s(() => {
|
|
59
|
+
S &&= (clearTimeout(S), null);
|
|
60
|
+
});
|
|
61
|
+
function k() {
|
|
62
|
+
C.value = !0, T.value = !0, w.value = !0, b && (F(), I()), v.preventScroll && j(!0);
|
|
63
|
+
}
|
|
64
|
+
function A() {
|
|
65
|
+
T.value = !0, w.value = !1, v.preventScroll && j(!1), y("update:modelValue", !1), b && (F(), I());
|
|
66
|
+
}
|
|
67
|
+
function j(e) {
|
|
68
|
+
let t = e ? "addEventListener" : "removeEventListener", n = x.value?.querySelector(".cu-popup-mask"), r = x.value?.querySelector(".cu-popup-box");
|
|
69
|
+
n && n[t]("touchmove", N, !1), r && r[t]("touchmove", N, !1), M(e);
|
|
70
|
+
}
|
|
71
|
+
function M(e, t = v.preventScrollExclude) {
|
|
72
|
+
let n = e ? "addEventListener" : "removeEventListener", r = typeof t == "string" ? t ? x.value?.querySelector(t) : void 0 : t;
|
|
73
|
+
r && r[n]("touchmove", P, !1);
|
|
74
|
+
}
|
|
75
|
+
function N(e) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
function P(e) {
|
|
79
|
+
e.stopImmediatePropagation();
|
|
80
|
+
}
|
|
81
|
+
function F() {
|
|
82
|
+
w.value ? (y("beforeShow"), y("before-show")) : (y("beforeHide"), y("before-hide"));
|
|
83
|
+
}
|
|
84
|
+
function I() {
|
|
85
|
+
T.value &&= (w.value ? y("show") : (C.value = !1, y("hide")), !1);
|
|
86
|
+
}
|
|
87
|
+
function L() {
|
|
88
|
+
v.maskClosable && (A(), y("maskClick"));
|
|
89
|
+
}
|
|
90
|
+
return (t, s) => g((l(), n("div", {
|
|
91
|
+
ref_key: "root",
|
|
92
|
+
ref: x,
|
|
93
|
+
class: o(["cu-popup", [
|
|
94
|
+
a.hasMask ? "with-mask" : "",
|
|
95
|
+
E.value ? "large-radius" : "",
|
|
96
|
+
a.position
|
|
97
|
+
]])
|
|
98
|
+
}, [i(e, { name: "cu-mask-fade" }, {
|
|
99
|
+
default: h(() => [g(r("div", {
|
|
100
|
+
class: "cu-popup-mask",
|
|
101
|
+
onClick: L
|
|
102
|
+
}, null, 512), [[p, a.hasMask && w.value]])]),
|
|
103
|
+
_: 1
|
|
104
|
+
}), i(e, {
|
|
105
|
+
name: D.value,
|
|
106
|
+
onBeforeEnter: F,
|
|
107
|
+
onBeforeLeave: F,
|
|
108
|
+
onAfterEnter: I,
|
|
109
|
+
onAfterLeave: I
|
|
110
|
+
}, {
|
|
111
|
+
default: h(() => [g(r("div", { class: o(["cu-popup-box", [D.value]]) }, [f(t.$slots, "default")], 2), [[p, w.value]])]),
|
|
112
|
+
_: 3
|
|
113
|
+
}, 8, ["name"])], 2)), [[p, C.value]]);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
export { _ as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./Icon-
|
|
1
|
+
import { t as e } from "./Icon-BgCtu0ZV.js";
|
|
2
2
|
import { Fragment as t, createCommentVNode as n, createElementBlock as r, createVNode as i, defineComponent as a, inject as o, normalizeClass as s, openBlock as c, renderSlot as l, watch as u } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/components/popup/PopupTitleBar.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var d = ["innerHTML"], f = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "title-bar-title"
|
|
@@ -81,5 +81,4 @@ var d = ["innerHTML"], f = {
|
|
|
81
81
|
], 34));
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
//#endregion
|
|
85
84
|
export { _ as t };
|