centui 0.0.0-stage → 3.0.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/LICENSE +433 -0
- package/README.md +54 -2
- package/dist/Agree-DT46e5q5.cjs +1 -0
- package/dist/Agree-yTGTi4e6.js +44 -0
- package/dist/Amount-De-oObat.cjs +1 -0
- package/dist/Amount-wOtRYOdx.js +62 -0
- package/dist/Button-BIi6CrwM.js +61 -0
- package/dist/Button-Blpwwbnw.cjs +1 -0
- package/dist/CellItem-T78DHako.cjs +1 -0
- package/dist/CellItem-YZD-BxKt.js +72 -0
- package/dist/CheckBoxBase-BDsytL_r.cjs +1 -0
- package/dist/CheckBoxBase-BjyVzGqj.js +40 -0
- package/dist/CheckList-Bfy3B-eN.js +239 -0
- package/dist/CheckList-DEmLmccw.cjs +1 -0
- package/dist/Codebox-Cgj7wyzd.cjs +1 -0
- package/dist/Codebox-D0UtCj11.js +189 -0
- package/dist/DatePicker-B1AVbKhK.cjs +1 -0
- package/dist/DatePicker-TAHuve5t.js +177 -0
- package/dist/Field-CseJzTZz.js +51 -0
- package/dist/Field-DDmHa4zB.cjs +1 -0
- package/dist/FieldItem-Cc7bw5vU.js +88 -0
- package/dist/FieldItem-Dkpx5Kxk.cjs +1 -0
- package/dist/Icon-dWGSK6Ou.js +119 -0
- package/dist/Icon-jaEPn7d7.cjs +31 -0
- package/dist/InputItem-EJ4Y3tpU.cjs +1 -0
- package/dist/InputItem-bhFtp97z.js +322 -0
- package/dist/NoticeBar-DSf_EjTL.cjs +1 -0
- package/dist/NoticeBar-PEYcjXwD.js +84 -0
- package/dist/NumberKeyboard-BX0c0l2r.cjs +1 -0
- package/dist/NumberKeyboard-C7TRF5iC.js +320 -0
- package/dist/Picker-D-TPtSxf.cjs +1 -0
- package/dist/Picker-Dam0LEcc.js +476 -0
- package/dist/Popup-Cm4BuaOo.cjs +1 -0
- package/dist/Popup-DPYBBL95.js +116 -0
- package/dist/PopupTitleBar-B4vwxKC7.cjs +1 -0
- package/dist/PopupTitleBar-nVurLaOe.js +85 -0
- package/dist/Progress-CwIC6scr.js +67 -0
- package/dist/Progress-DukssNvl.cjs +1 -0
- package/dist/Radio-ZHivLdvi.cjs +1 -0
- package/dist/Radio-fsc7_N5K.js +65 -0
- package/dist/RadioGroup-BR_jSDR4.cjs +1 -0
- package/dist/RadioGroup-CMPmk8X_.js +82 -0
- package/dist/RadioList-CkerkQEY.js +127 -0
- package/dist/RadioList-upQgua8Z.cjs +1 -0
- package/dist/Roller-DALhjhfg.cjs +1 -0
- package/dist/Roller-DFJ7jMV0.js +92 -0
- package/dist/RollerSuccess--JecJ7bz.cjs +1 -0
- package/dist/RollerSuccess-CVEmS9gU.js +224 -0
- package/dist/ScrollViewMore-BWph-i1-.cjs +1 -0
- package/dist/ScrollViewMore-BgYJx-TP.js +278 -0
- package/dist/Skeleton--SCiydNl.cjs +1 -0
- package/dist/Skeleton-BG_j23KI.js +55 -0
- package/dist/Slider-D3wrE8hn.cjs +1 -0
- package/dist/Slider-DteN8p-L.js +95 -0
- package/dist/Stepper-1EOk4pCY.js +127 -0
- package/dist/Stepper-BJr4I6_8.cjs +1 -0
- package/dist/SwiperItem-B6TgjCsM.cjs +1 -0
- package/dist/SwiperItem-CKd-XKT7.js +337 -0
- package/dist/Switch-B6DvVj2p.js +30 -0
- package/dist/Switch-BVPjF8CM.cjs +1 -0
- package/dist/Tag-CPv77lC8.cjs +1 -0
- package/dist/Tag-bs5j40pF.js +66 -0
- package/dist/Tip-BFZSiRc1.js +166 -0
- package/dist/Tip-C3brAF9N.cjs +1 -0
- package/dist/action-sheet-DKpi2GLQ.js +118 -0
- package/dist/action-sheet-LJilF3EQ.cjs +1 -0
- package/dist/action-sheet.cjs +1 -0
- package/dist/action-sheet.d.ts +2 -0
- package/dist/action-sheet.js +2 -0
- package/dist/activity-indicator.cjs +1 -0
- package/dist/activity-indicator.d.ts +1 -0
- package/dist/activity-indicator.js +3 -0
- package/dist/agree.cjs +1 -0
- package/dist/agree.d.ts +1 -0
- package/dist/agree.js +2 -0
- package/dist/amount.cjs +1 -0
- package/dist/amount.d.ts +1 -0
- package/dist/amount.js +2 -0
- package/dist/button.cjs +1 -0
- package/dist/button.d.ts +1 -0
- package/dist/button.js +2 -0
- package/dist/cell-item.cjs +1 -0
- package/dist/cell-item.d.ts +1 -0
- package/dist/cell-item.js +2 -0
- package/dist/check-base.cjs +1 -0
- package/dist/check-base.d.ts +1 -0
- package/dist/check-base.js +2 -0
- package/dist/check.cjs +1 -0
- package/dist/check.d.ts +1 -0
- package/dist/check.js +2 -0
- package/dist/codebox.cjs +1 -0
- package/dist/codebox.d.ts +1 -0
- package/dist/codebox.js +2 -0
- package/dist/components/action-bar/ActionBar.vue.d.ts +34 -0
- package/dist/components/action-bar/index.d.ts +2 -0
- package/dist/components/action-sheet/ActionSheet.vue.d.ts +44 -0
- package/dist/components/action-sheet/index.d.ts +25 -0
- package/dist/components/activity-indicator/ActivityIndicator.vue.d.ts +31 -0
- package/dist/components/activity-indicator/Carousel.vue.d.ts +10 -0
- package/dist/components/activity-indicator/CarouselCircle.vue.d.ts +12 -0
- package/dist/components/activity-indicator/Roller.vue.d.ts +37 -0
- package/dist/components/activity-indicator/RollerSuccess.vue.d.ts +14 -0
- package/dist/components/activity-indicator/Spinning.vue.d.ts +10 -0
- package/dist/components/activity-indicator/index.d.ts +5 -0
- package/dist/components/agree/Agree.vue.d.ts +35 -0
- package/dist/components/agree/index.d.ts +1 -0
- package/dist/components/amount/Amount.vue.d.ts +25 -0
- package/dist/components/amount/index.d.ts +1 -0
- package/dist/components/bill/Bill.vue.d.ts +33 -0
- package/dist/components/bill/index.d.ts +1 -0
- package/dist/components/button/Button.vue.d.ts +38 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/captcha/Captcha.vue.d.ts +76 -0
- package/dist/components/captcha/index.d.ts +1 -0
- package/dist/components/cashier/Cashier.vue.d.ts +101 -0
- package/dist/components/cashier/CashierChannel.vue.d.ts +54 -0
- package/dist/components/cashier/CashierChannelButton.vue.d.ts +14 -0
- package/dist/components/cashier/CashierChannelItem.vue.d.ts +30 -0
- package/dist/components/cashier/index.d.ts +4 -0
- package/dist/components/cell-item/CellItem.vue.d.ts +38 -0
- package/dist/components/cell-item/index.d.ts +1 -0
- package/dist/components/chart/Chart.vue.d.ts +30 -0
- package/dist/components/chart/index.d.ts +2 -0
- package/dist/components/check/Check.vue.d.ts +38 -0
- package/dist/components/check/CheckBox.vue.d.ts +31 -0
- package/dist/components/check/CheckGroup.vue.d.ts +27 -0
- package/dist/components/check/CheckList.vue.d.ts +58 -0
- package/dist/components/check/index.d.ts +6 -0
- package/dist/components/check/shared.d.ts +52 -0
- package/dist/components/check-base/CheckBoxBase.vue.d.ts +25 -0
- package/dist/components/check-base/index.d.ts +1 -0
- package/dist/components/codebox/Codebox.vue.d.ts +58 -0
- package/dist/components/codebox/index.d.ts +1 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +70 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/detail-item/DetailItem.vue.d.ts +22 -0
- package/dist/components/detail-item/index.d.ts +1 -0
- package/dist/components/dialog/Dialog.vue.d.ts +78 -0
- package/dist/components/dialog/index.d.ts +40 -0
- package/dist/components/drop-menu/DropMenu.vue.d.ts +55 -0
- package/dist/components/drop-menu/index.d.ts +1 -0
- package/dist/components/field/Field.vue.d.ts +30 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field-item/FieldItem.vue.d.ts +42 -0
- package/dist/components/field-item/index.d.ts +1 -0
- package/dist/components/icon/Icon.vue.d.ts +20 -0
- package/dist/components/icon/default-svg-list.d.ts +2 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/load-sprite.d.ts +6 -0
- package/dist/components/image-reader/ImageReader.vue.d.ts +46 -0
- package/dist/components/image-reader/index.d.ts +1 -0
- package/dist/components/image-viewer/ImageViewer.vue.d.ts +25 -0
- package/dist/components/image-viewer/index.d.ts +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/input-item/InputItem.vue.d.ts +97 -0
- package/dist/components/input-item/cursor.d.ts +7 -0
- package/dist/components/input-item/index.d.ts +1 -0
- package/dist/components/landscape/Landscape.vue.d.ts +38 -0
- package/dist/components/landscape/index.d.ts +1 -0
- package/dist/components/license-plate/LicensePlate.vue.d.ts +32 -0
- package/dist/components/license-plate/LicensePlateInput.vue.d.ts +14 -0
- package/dist/components/license-plate/LicensePlateKeyboard.vue.d.ts +30 -0
- package/dist/components/license-plate/index.d.ts +3 -0
- package/dist/components/notice-bar/NoticeBar.vue.d.ts +44 -0
- package/dist/components/notice-bar/index.d.ts +1 -0
- package/dist/components/number-keyboard/KeyboardBoard.vue.d.ts +33 -0
- package/dist/components/number-keyboard/KeyboardKey.vue.d.ts +16 -0
- package/dist/components/number-keyboard/NumberKeyboard.vue.d.ts +59 -0
- package/dist/components/number-keyboard/index.d.ts +3 -0
- package/dist/components/picker/Picker.vue.d.ts +64 -0
- package/dist/components/picker/PickerColumn.vue.d.ts +64 -0
- package/dist/components/picker/index.d.ts +3 -0
- package/dist/components/popup/Popup.vue.d.ts +50 -0
- package/dist/components/popup/PopupTitleBar.vue.d.ts +41 -0
- package/dist/components/popup/index.d.ts +2 -0
- package/dist/components/progress/Progress.vue.d.ts +39 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/radio/Radio.vue.d.ts +39 -0
- package/dist/components/radio/RadioBox.vue.d.ts +31 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +24 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio-list/RadioList.vue.d.ts +72 -0
- package/dist/components/radio-list/index.d.ts +2 -0
- package/dist/components/result-page/ResultPage.vue.d.ts +28 -0
- package/dist/components/result-page/index.d.ts +1 -0
- package/dist/components/ruler/Ruler.vue.d.ts +34 -0
- package/dist/components/ruler/index.d.ts +1 -0
- package/dist/components/scroll-view/ScrollView.vue.d.ts +84 -0
- package/dist/components/scroll-view/ScrollViewMore.vue.d.ts +12 -0
- package/dist/components/scroll-view/ScrollViewRefresh.vue.d.ts +20 -0
- package/dist/components/scroll-view/index.d.ts +3 -0
- package/dist/components/selector/Selector.vue.d.ts +88 -0
- package/dist/components/selector/index.d.ts +2 -0
- package/dist/components/skeleton/Skeleton.vue.d.ts +30 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/slider/Slider.vue.d.ts +24 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/stepper/Stepper.vue.d.ts +32 -0
- package/dist/components/stepper/index.d.ts +1 -0
- package/dist/components/steps/Steps.vue.d.ts +56 -0
- package/dist/components/steps/index.d.ts +2 -0
- package/dist/components/swiper/Swiper.vue.d.ts +57 -0
- package/dist/components/swiper/SwiperItem.vue.d.ts +26 -0
- package/dist/components/swiper/index.d.ts +2 -0
- package/dist/components/switch/Switch.vue.d.ts +16 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/tab-picker/TabPicker.vue.d.ts +78 -0
- package/dist/components/tab-picker/index.d.ts +1 -0
- package/dist/components/tabs/TabBar.vue.d.ts +50 -0
- package/dist/components/tabs/TabPane.vue.d.ts +31 -0
- package/dist/components/tabs/Tabs.vue.d.ts +34 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tag/Tag.vue.d.ts +39 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/textarea-item/TextareaItem.vue.d.ts +80 -0
- package/dist/components/textarea-item/index.d.ts +1 -0
- package/dist/components/tip/Tip.vue.d.ts +98 -0
- package/dist/components/tip/TipContent.vue.d.ts +33 -0
- package/dist/components/tip/index.d.ts +2 -0
- package/dist/components/toast/Toast.vue.d.ts +45 -0
- package/dist/components/toast/index.d.ts +129 -0
- package/dist/components/transition/Transition.vue.d.ts +13 -0
- package/dist/components/transition/index.d.ts +1 -0
- package/dist/components/water-mark/WaterMark.vue.d.ts +35 -0
- package/dist/components/water-mark/index.d.ts +1 -0
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.d.ts +1 -0
- package/dist/date-picker.js +2 -0
- package/dist/dialog-0-E4Vyc-.cjs +1 -0
- package/dist/dialog-DHIZ2SMK.js +227 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dialog.js +2 -0
- package/dist/field-item.cjs +1 -0
- package/dist/field-item.d.ts +1 -0
- package/dist/field-item.js +2 -0
- package/dist/field.cjs +1 -0
- package/dist/field.d.ts +1 -0
- package/dist/field.js +2 -0
- package/dist/icon.cjs +1 -0
- package/dist/icon.d.ts +1 -0
- package/dist/icon.js +2 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +2669 -0
- package/dist/input-item.cjs +1 -0
- package/dist/input-item.d.ts +1 -0
- package/dist/input-item.js +2 -0
- package/dist/notice-bar.cjs +1 -0
- package/dist/notice-bar.d.ts +1 -0
- package/dist/notice-bar.js +2 -0
- package/dist/number-keyboard.cjs +1 -0
- package/dist/number-keyboard.d.ts +1 -0
- package/dist/number-keyboard.js +2 -0
- package/dist/picker.cjs +1 -0
- package/dist/picker.d.ts +1 -0
- package/dist/picker.js +2 -0
- package/dist/popup.cjs +1 -0
- package/dist/popup.d.ts +1 -0
- package/dist/popup.js +3 -0
- package/dist/progress.cjs +1 -0
- package/dist/progress.d.ts +1 -0
- package/dist/progress.js +2 -0
- package/dist/radio-list.cjs +1 -0
- package/dist/radio-list.d.ts +1 -0
- package/dist/radio-list.js +2 -0
- package/dist/radio.cjs +1 -0
- package/dist/radio.d.ts +1 -0
- package/dist/radio.js +3 -0
- package/dist/scroll-view.cjs +1 -0
- package/dist/scroll-view.d.ts +1 -0
- package/dist/scroll-view.js +2 -0
- package/dist/shared-BtSkmaWC.js +37 -0
- package/dist/shared-k9cbQbvK.cjs +1 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +1 -0
- package/dist/skeleton.js +2 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.d.ts +1 -0
- package/dist/slider.js +2 -0
- package/dist/stepper.cjs +1 -0
- package/dist/stepper.d.ts +1 -0
- package/dist/stepper.js +2 -0
- package/dist/swiper.cjs +1 -0
- package/dist/swiper.d.ts +1 -0
- package/dist/swiper.js +2 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.d.ts +1 -0
- package/dist/switch.js +2 -0
- package/dist/tag.cjs +1 -0
- package/dist/tag.d.ts +1 -0
- package/dist/tag.js +2 -0
- package/dist/tip.cjs +1 -0
- package/dist/tip.d.ts +1 -0
- package/dist/tip.js +2 -0
- package/dist/toast-CAeyMc5r.cjs +1 -0
- package/dist/toast-DX-RoB7Q.js +146 -0
- package/dist/toast.cjs +1 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +2 -0
- package/package.json +195 -3
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { t as e } from "./Popup-DPYBBL95.js";
|
|
2
|
+
import { t } from "./PopupTitleBar-nVurLaOe.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, onMounted as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
|
|
4
|
+
import { cascade as S, compareObjects as C, inArray as w, t as T, traverse as E, warn as D } from "@centui/core";
|
|
5
|
+
import { Scroller as O, getDpr as k, render as A } from "@centui/core/web";
|
|
6
|
+
//#region src/components/picker/PickerColumn.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var j = { class: "cu-picker-column-container" }, M = { class: "cu-picker-column-list" }, N = ["textContent"], P = { class: "cu-picker-column-hooks" }, F = [
|
|
8
|
+
"onTouchstart",
|
|
9
|
+
"onMousedown",
|
|
10
|
+
"onTouchmove",
|
|
11
|
+
"onMousemove",
|
|
12
|
+
"onTouchend",
|
|
13
|
+
"onMouseup"
|
|
14
|
+
], I = /* @__PURE__ */ l({
|
|
15
|
+
name: "cu-picker-column",
|
|
16
|
+
__name: "PickerColumn",
|
|
17
|
+
props: {
|
|
18
|
+
data: { default: () => [] },
|
|
19
|
+
cols: { default: 1 },
|
|
20
|
+
defaultValue: { default: () => [] },
|
|
21
|
+
defaultIndex: { default: () => [] },
|
|
22
|
+
invalidIndex: { default: () => [] },
|
|
23
|
+
lineHeight: { default: 45 },
|
|
24
|
+
keepIndex: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["initialed", "change"],
|
|
30
|
+
setup(e, { expose: t, emit: i }) {
|
|
31
|
+
let c = e, l = i, m = k(), y = g(), x = g([]), S = [], C = g(1), T = g(0), I = g([]), L = g(!1), R = g(!1), z = g(!1), B = r(() => ({
|
|
32
|
+
maskerHeight: (c.lineHeight * 2 + 10) * m,
|
|
33
|
+
indicatorHeight: c.lineHeight * m
|
|
34
|
+
}));
|
|
35
|
+
b(() => c.data, (e) => {
|
|
36
|
+
x.value = [...e];
|
|
37
|
+
}, { deep: !0 }), p(() => {
|
|
38
|
+
x.value = [...c.data];
|
|
39
|
+
});
|
|
40
|
+
function V() {
|
|
41
|
+
return y.value ? Array.from(y.value.querySelectorAll(".cu-picker-column-hook")) : [];
|
|
42
|
+
}
|
|
43
|
+
function H(e = 0) {
|
|
44
|
+
let t = V();
|
|
45
|
+
for (let n = e, r = t.length; n < r; n++) {
|
|
46
|
+
let e = t[n];
|
|
47
|
+
e && U(e, n);
|
|
48
|
+
}
|
|
49
|
+
e || (W(), L.value || (L.value = !0, setTimeout(() => {
|
|
50
|
+
l("initialed");
|
|
51
|
+
}, 0))), R.value = !0;
|
|
52
|
+
}
|
|
53
|
+
function U(e, t) {
|
|
54
|
+
if (!y.value) return;
|
|
55
|
+
let n = y.value.querySelectorAll(".column-list"), r = n[t];
|
|
56
|
+
if (t === void 0 || !n || !e || !r) return;
|
|
57
|
+
let i = e.getBoundingClientRect(), a = new O((e, t) => {
|
|
58
|
+
A(r, e, t);
|
|
59
|
+
}, {
|
|
60
|
+
scrollingX: !1,
|
|
61
|
+
snapping: !0,
|
|
62
|
+
snappingVelocity: 1,
|
|
63
|
+
animationDuration: 350,
|
|
64
|
+
scrollingComplete: () => {
|
|
65
|
+
ae(t);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
a.setPosition(i.left + e.clientLeft, i.top + e.clientTop), a.setDimensions(e.clientWidth, e.clientHeight, r.offsetWidth, r.offsetHeight + B.value.maskerHeight), a.setSnapSize(0, B.value.indicatorHeight), S[t] = a, re(t);
|
|
69
|
+
}
|
|
70
|
+
function W() {
|
|
71
|
+
let e = x.value, t = S;
|
|
72
|
+
G(e, c.defaultIndex, c.defaultValue, (e, n) => {
|
|
73
|
+
let r = t[e];
|
|
74
|
+
if (!r) {
|
|
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);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function G(e, t = [], n, r = () => {}) {
|
|
82
|
+
e && E(e, (e, i, a) => {
|
|
83
|
+
let o = a[0], s = a[1], c = t[o], l = n[o];
|
|
84
|
+
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
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function ee(e) {
|
|
88
|
+
return Math.round(e / B.value.indicatorHeight);
|
|
89
|
+
}
|
|
90
|
+
function K(e) {
|
|
91
|
+
return e * B.value.indicatorHeight;
|
|
92
|
+
}
|
|
93
|
+
function te(e, t) {
|
|
94
|
+
return I.value[e] === t;
|
|
95
|
+
}
|
|
96
|
+
function q(e, t) {
|
|
97
|
+
let n = c.invalidIndex[e];
|
|
98
|
+
return w(n, t);
|
|
99
|
+
}
|
|
100
|
+
function ne(e) {
|
|
101
|
+
for (let t of c.data[e].keys()) if (!q(e, t)) return !0;
|
|
102
|
+
return D(`hasValidIndex: has no valid items in column index ${e}`), !1;
|
|
103
|
+
}
|
|
104
|
+
function J(e, t) {
|
|
105
|
+
if (!ne(e)) return t;
|
|
106
|
+
let n = t;
|
|
107
|
+
for (; q(e, n);) n += C.value;
|
|
108
|
+
return n < 0 || n > c.data[e].length - 1 ? (C.value = -C.value, J(e, t)) : n;
|
|
109
|
+
}
|
|
110
|
+
function re(e) {
|
|
111
|
+
let t = S[e], n = x.value[e] || [], r = I.value[e] || 0;
|
|
112
|
+
t && r && (r > n.length - 1 && (r = n.length - 1), Y(t, e, r), I.value[e] = r);
|
|
113
|
+
}
|
|
114
|
+
function Y(e, t, n) {
|
|
115
|
+
let r = K(n);
|
|
116
|
+
e.scrollTo(0, r);
|
|
117
|
+
}
|
|
118
|
+
function X(e, t, n) {
|
|
119
|
+
let r = K(J(t, n));
|
|
120
|
+
e.scrollTo(0, Z(e, r), !0);
|
|
121
|
+
}
|
|
122
|
+
function Z(e, t) {
|
|
123
|
+
let n = e.getScrollMax().top;
|
|
124
|
+
return t < 0 ? 0 : t > n ? n : t;
|
|
125
|
+
}
|
|
126
|
+
function Q(e, t, n = !1) {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
let r = S[t], i = n ? [{
|
|
129
|
+
pageX: e.pageX,
|
|
130
|
+
pageY: e.pageY
|
|
131
|
+
}] : Array.from(e.touches);
|
|
132
|
+
if (!r) {
|
|
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);
|
|
137
|
+
}
|
|
138
|
+
function $(e, t, n = !1) {
|
|
139
|
+
let r = S[t], i = n ? [{
|
|
140
|
+
pageX: e.pageX,
|
|
141
|
+
pageY: e.pageY
|
|
142
|
+
}] : Array.from(e.touches);
|
|
143
|
+
if (!r || n && !z.value) return;
|
|
144
|
+
let a = T.value - (n ? e.pageY : e.touches[0].pageY);
|
|
145
|
+
C.value = a ? a / Math.abs(a) : 1, r.doTouchMove(i, e.timeStamp), n && (z.value = !0);
|
|
146
|
+
}
|
|
147
|
+
function ie(e, t, n = !1) {
|
|
148
|
+
let r = S[t];
|
|
149
|
+
!r || n && !z.value || (r.doTouchEnd(e.timeStamp), n && (z.value = !1));
|
|
150
|
+
}
|
|
151
|
+
function ae(e) {
|
|
152
|
+
let t = S[e];
|
|
153
|
+
if (!t) return;
|
|
154
|
+
let n = t.getValues().top, r = ee(Z(t, n)), i = q(e, r);
|
|
155
|
+
if (i || r === I.value[e]) {
|
|
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));
|
|
160
|
+
}
|
|
161
|
+
function oe(e = 0) {
|
|
162
|
+
return se()[e];
|
|
163
|
+
}
|
|
164
|
+
function se() {
|
|
165
|
+
let e = x.value, t = I.value, n = [];
|
|
166
|
+
return e.forEach((e, r) => {
|
|
167
|
+
n[r] = e[t[r]];
|
|
168
|
+
}), n;
|
|
169
|
+
}
|
|
170
|
+
function ce(e = 0) {
|
|
171
|
+
return I.value[e];
|
|
172
|
+
}
|
|
173
|
+
function le() {
|
|
174
|
+
return I.value;
|
|
175
|
+
}
|
|
176
|
+
function ue(e, t, n = () => {}) {
|
|
177
|
+
e !== void 0 && t !== void 0 && (c.keepIndex || (I.value[e] = 0), x.value[e] = t, u(() => {
|
|
178
|
+
n();
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
function de(e, t = 0) {
|
|
182
|
+
u(() => {
|
|
183
|
+
H(t), e && e();
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return t({
|
|
187
|
+
refresh: de,
|
|
188
|
+
getColumnValue: oe,
|
|
189
|
+
getColumnValues: se,
|
|
190
|
+
getColumnIndex: ce,
|
|
191
|
+
getColumnIndexs: le,
|
|
192
|
+
getColumnIndexByDefault: G,
|
|
193
|
+
setColumnValues: ue,
|
|
194
|
+
isScrollInitialed: R,
|
|
195
|
+
activedIndexs: I,
|
|
196
|
+
scrollers: S
|
|
197
|
+
}), (t, r) => (h(), o("div", {
|
|
198
|
+
ref_key: "root",
|
|
199
|
+
ref: y,
|
|
200
|
+
class: "cu-picker-column",
|
|
201
|
+
style: f({ height: `${B.value.indicatorHeight + 2 * B.value.maskerHeight}px` })
|
|
202
|
+
}, [s("div", j, [
|
|
203
|
+
s("div", {
|
|
204
|
+
class: "cu-picker-column-masker top",
|
|
205
|
+
style: f({ height: `${B.value.maskerHeight}px` })
|
|
206
|
+
}, null, 4),
|
|
207
|
+
s("div", {
|
|
208
|
+
class: "cu-picker-column-masker bottom",
|
|
209
|
+
style: f({ height: `${B.value.maskerHeight}px` })
|
|
210
|
+
}, null, 4),
|
|
211
|
+
s("div", M, [(h(!0), o(n, null, _(x.value, (e, t) => (h(), o("div", {
|
|
212
|
+
key: t,
|
|
213
|
+
class: "cu-picker-column-item"
|
|
214
|
+
}, [s("ul", {
|
|
215
|
+
class: "column-list",
|
|
216
|
+
style: f({ "padding-top": `${B.value.maskerHeight}px` })
|
|
217
|
+
}, [(h(!0), o(n, null, _(e, (e, n) => (h(), o("li", {
|
|
218
|
+
key: n,
|
|
219
|
+
class: d(["column-item", {
|
|
220
|
+
active: te(t, n),
|
|
221
|
+
disabled: q(t, n)
|
|
222
|
+
}]),
|
|
223
|
+
style: f({
|
|
224
|
+
height: `${B.value.indicatorHeight}px`,
|
|
225
|
+
"line-height": `${B.value.indicatorHeight}px`
|
|
226
|
+
}),
|
|
227
|
+
textContent: v(e.text || e.label)
|
|
228
|
+
}, null, 14, N))), 128))], 4)]))), 128)), e.cols ? (h(!0), o(n, { key: 0 }, _(e.cols - x.value.length, (e) => (h(), o("div", {
|
|
229
|
+
key: e + x.value.length - 1,
|
|
230
|
+
class: "cu-picker-column-item"
|
|
231
|
+
}, [s("ul", {
|
|
232
|
+
class: "column-list",
|
|
233
|
+
style: f({ "padding-top": `${B.value.maskerHeight}px` })
|
|
234
|
+
}, null, 4)]))), 128)) : a("", !0)]),
|
|
235
|
+
s("div", P, [e.cols ? (h(!0), o(n, { key: 0 }, _(e.cols, (e) => (h(), o("div", {
|
|
236
|
+
key: e - 1,
|
|
237
|
+
class: "cu-picker-column-hook",
|
|
238
|
+
onTouchstart: (t) => Q(t, e - 1),
|
|
239
|
+
onMousedown: (t) => Q(t, e - 1, !0),
|
|
240
|
+
onTouchmove: (t) => $(t, e - 1),
|
|
241
|
+
onMousemove: (t) => $(t, e - 1, !0),
|
|
242
|
+
onTouchend: (t) => ie(t, e - 1),
|
|
243
|
+
onMouseup: (t) => ie(t, e - 1, !0)
|
|
244
|
+
}, null, 40, F))), 128)) : a("", !0)])
|
|
245
|
+
])], 4));
|
|
246
|
+
}
|
|
247
|
+
}), L = /* @__PURE__ */ l({
|
|
248
|
+
name: "cu-picker",
|
|
249
|
+
__name: "Picker",
|
|
250
|
+
props: {
|
|
251
|
+
modelValue: {
|
|
252
|
+
type: Boolean,
|
|
253
|
+
default: !1
|
|
254
|
+
},
|
|
255
|
+
isView: {
|
|
256
|
+
type: Boolean,
|
|
257
|
+
default: !1
|
|
258
|
+
},
|
|
259
|
+
title: { default: "" },
|
|
260
|
+
describe: { default: "" },
|
|
261
|
+
okText: { default: void 0 },
|
|
262
|
+
cancelText: { default: void 0 },
|
|
263
|
+
maskClosable: {
|
|
264
|
+
type: Boolean,
|
|
265
|
+
default: !0
|
|
266
|
+
},
|
|
267
|
+
lineHeight: { default: void 0 },
|
|
268
|
+
keepIndex: {
|
|
269
|
+
type: Boolean,
|
|
270
|
+
default: !1
|
|
271
|
+
},
|
|
272
|
+
largeRadius: {
|
|
273
|
+
type: Boolean,
|
|
274
|
+
default: !1
|
|
275
|
+
},
|
|
276
|
+
data: { default: () => [] },
|
|
277
|
+
cols: { default: 1 },
|
|
278
|
+
defaultValue: { default: () => [] },
|
|
279
|
+
defaultIndex: { default: () => [] },
|
|
280
|
+
invalidIndex: { default: () => [] },
|
|
281
|
+
isCascade: {
|
|
282
|
+
type: Boolean,
|
|
283
|
+
default: !1
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
emits: [
|
|
287
|
+
"update:modelValue",
|
|
288
|
+
"initialed",
|
|
289
|
+
"confirm",
|
|
290
|
+
"cancel",
|
|
291
|
+
"change",
|
|
292
|
+
"show",
|
|
293
|
+
"hide"
|
|
294
|
+
],
|
|
295
|
+
setup(n, { expose: r, emit: a }) {
|
|
296
|
+
let s = n, l = a, u = s.okText ?? T("md.picker.confirm"), f = s.cancelText ?? T("md.picker.cancel"), p = s.lineHeight ?? 45, _ = g(), v = g(!1), w = g(!0), E = g(null);
|
|
297
|
+
b(() => s.modelValue, (e) => {
|
|
298
|
+
v.value = e, e && O();
|
|
299
|
+
}), b(v, (e) => {
|
|
300
|
+
e || l("update:modelValue", e);
|
|
301
|
+
}), b(() => s.data, (e, t) => {
|
|
302
|
+
C(e, t) || k();
|
|
303
|
+
}, {
|
|
304
|
+
deep: !0,
|
|
305
|
+
immediate: !0
|
|
306
|
+
}), b(() => s.defaultIndex, () => {
|
|
307
|
+
k();
|
|
308
|
+
}, { deep: !0 }), m(() => {
|
|
309
|
+
O(), s.isView && setTimeout(() => {
|
|
310
|
+
_.value?.refresh();
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
function D() {
|
|
314
|
+
return _.value;
|
|
315
|
+
}
|
|
316
|
+
function O() {
|
|
317
|
+
!s.isView && s.modelValue && (v.value = s.modelValue), w.value ? w.value = !1 : setTimeout(() => {
|
|
318
|
+
E.value = [...D()?.activedIndexs ?? []];
|
|
319
|
+
}, 100);
|
|
320
|
+
}
|
|
321
|
+
function k() {
|
|
322
|
+
if (!s.isCascade) return;
|
|
323
|
+
let e = j(), t = M();
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
let n = D();
|
|
326
|
+
n && S(n, {
|
|
327
|
+
currentLevel: -1,
|
|
328
|
+
maxLevel: s.cols,
|
|
329
|
+
values: s.data || [],
|
|
330
|
+
defaultIndex: e,
|
|
331
|
+
defaultValue: t
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function A() {
|
|
336
|
+
k();
|
|
337
|
+
}
|
|
338
|
+
function j() {
|
|
339
|
+
return E.value || s.defaultIndex;
|
|
340
|
+
}
|
|
341
|
+
function M() {
|
|
342
|
+
return E.value ? [] : s.defaultValue;
|
|
343
|
+
}
|
|
344
|
+
function N() {
|
|
345
|
+
let e = D();
|
|
346
|
+
if (!e) return;
|
|
347
|
+
let t = e.getColumnValues(), n = !1;
|
|
348
|
+
e.scrollers.forEach((e) => {
|
|
349
|
+
(e._isAnimating !== !1 || e._isDecelerating !== !1 || e._isDragging !== !1 || e._isGesturing !== !1) && (n = !0);
|
|
350
|
+
}), n || (v.value = !1, l("confirm", t));
|
|
351
|
+
}
|
|
352
|
+
function P() {
|
|
353
|
+
l("initialed");
|
|
354
|
+
}
|
|
355
|
+
function F() {
|
|
356
|
+
v.value = !1, l("cancel"), setTimeout(() => {
|
|
357
|
+
A(), D()?.refresh();
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function L(e, t, n) {
|
|
361
|
+
if (s.isCascade) {
|
|
362
|
+
let t = D();
|
|
363
|
+
t && S(t, {
|
|
364
|
+
currentLevel: e,
|
|
365
|
+
maxLevel: s.cols,
|
|
366
|
+
values: [n]
|
|
367
|
+
}, () => {
|
|
368
|
+
t.refresh(void 0, e + 1);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
l("change", e, t, n);
|
|
372
|
+
}
|
|
373
|
+
function R() {
|
|
374
|
+
D()?.isScrollInitialed || setTimeout(() => {
|
|
375
|
+
D()?.refresh();
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function z() {
|
|
379
|
+
l("hide");
|
|
380
|
+
}
|
|
381
|
+
function B() {
|
|
382
|
+
l("show");
|
|
383
|
+
}
|
|
384
|
+
function V(e, t) {
|
|
385
|
+
let n = D();
|
|
386
|
+
n && (s.isView || v.value) && n.refresh(e, t);
|
|
387
|
+
}
|
|
388
|
+
function H() {
|
|
389
|
+
return D()?.getColumnValues() ?? [];
|
|
390
|
+
}
|
|
391
|
+
function U(e = 0) {
|
|
392
|
+
return D()?.getColumnIndex(e);
|
|
393
|
+
}
|
|
394
|
+
function W() {
|
|
395
|
+
return D()?.getColumnIndexs() ?? [];
|
|
396
|
+
}
|
|
397
|
+
return r({
|
|
398
|
+
refresh: V,
|
|
399
|
+
getColumnValues: H,
|
|
400
|
+
getColumnIndex: U,
|
|
401
|
+
getColumnIndexs: W
|
|
402
|
+
}), (r, a) => (h(), o("div", { class: d(["cu-picker", { "with-popup": !n.isView }]) }, [n.isView ? (h(), i(I, {
|
|
403
|
+
key: 0,
|
|
404
|
+
ref_key: "pickerColumn",
|
|
405
|
+
ref: _,
|
|
406
|
+
data: n.data,
|
|
407
|
+
"default-value": n.defaultValue,
|
|
408
|
+
"default-index": n.defaultIndex,
|
|
409
|
+
"invalid-index": n.invalidIndex,
|
|
410
|
+
"line-height": y(p),
|
|
411
|
+
"keep-index": n.keepIndex,
|
|
412
|
+
cols: n.cols,
|
|
413
|
+
onInitialed: a[0] ||= (e) => l("initialed"),
|
|
414
|
+
onChange: L
|
|
415
|
+
}, null, 8, [
|
|
416
|
+
"data",
|
|
417
|
+
"default-value",
|
|
418
|
+
"default-index",
|
|
419
|
+
"invalid-index",
|
|
420
|
+
"line-height",
|
|
421
|
+
"keep-index",
|
|
422
|
+
"cols"
|
|
423
|
+
])) : (h(), i(e, {
|
|
424
|
+
key: 1,
|
|
425
|
+
"model-value": v.value,
|
|
426
|
+
class: "inner-popup",
|
|
427
|
+
position: "bottom",
|
|
428
|
+
"mask-closable": n.maskClosable,
|
|
429
|
+
"prevent-scroll": "",
|
|
430
|
+
"onUpdate:modelValue": a[1] ||= (e) => v.value = e,
|
|
431
|
+
onBeforeShow: R,
|
|
432
|
+
onShow: B,
|
|
433
|
+
onHide: z,
|
|
434
|
+
onMaskClick: F
|
|
435
|
+
}, {
|
|
436
|
+
default: x(() => [c(t, {
|
|
437
|
+
title: n.title,
|
|
438
|
+
describe: n.describe,
|
|
439
|
+
"ok-text": y(u),
|
|
440
|
+
"cancel-text": y(f),
|
|
441
|
+
"large-radius": n.largeRadius,
|
|
442
|
+
onConfirm: N,
|
|
443
|
+
onCancel: F
|
|
444
|
+
}, null, 8, [
|
|
445
|
+
"title",
|
|
446
|
+
"describe",
|
|
447
|
+
"ok-text",
|
|
448
|
+
"cancel-text",
|
|
449
|
+
"large-radius"
|
|
450
|
+
]), c(I, {
|
|
451
|
+
ref_key: "pickerColumn",
|
|
452
|
+
ref: _,
|
|
453
|
+
data: n.data,
|
|
454
|
+
"default-value": M(),
|
|
455
|
+
"default-index": j(),
|
|
456
|
+
"invalid-index": n.invalidIndex,
|
|
457
|
+
"line-height": y(p),
|
|
458
|
+
"keep-index": n.keepIndex,
|
|
459
|
+
cols: n.cols,
|
|
460
|
+
onInitialed: P,
|
|
461
|
+
onChange: L
|
|
462
|
+
}, null, 8, [
|
|
463
|
+
"data",
|
|
464
|
+
"default-value",
|
|
465
|
+
"default-index",
|
|
466
|
+
"invalid-index",
|
|
467
|
+
"line-height",
|
|
468
|
+
"keep-index",
|
|
469
|
+
"cols"
|
|
470
|
+
])]),
|
|
471
|
+
_: 1
|
|
472
|
+
}, 8, ["model-value", "mask-closable"]))], 2));
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
//#endregion
|
|
476
|
+
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=(0,e.ref)(!1),c=(0,e.ref)(!1),l=(0,e.ref)(!1),u=(0,e.ref)(!1);(0,e.provide)(`mdPopupLargeRadius`,u);let d=(0,e.computed)(()=>r.transition??f(r.position));function f(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?l.value?setTimeout(()=>{p()},50):p():m()}),(0,e.watch)(()=>r.preventScrollExclude,(e,t)=>{g(!1,t),g(!0,e)}),(0,e.onMounted)(()=>{r.modelValue&&p()});function p(){s.value=!0,l.value=!0,c.value=!0,a&&(y(),b()),r.preventScroll&&h(!0)}function m(){l.value=!0,c.value=!1,r.preventScroll&&h(!1),i(`update:modelValue`,!1),a&&(y(),b())}function h(e){let t=e?`addEventListener`:`removeEventListener`,n=o.value?.querySelector(`.cu-popup-mask`),r=o.value?.querySelector(`.cu-popup-box`);n&&n[t](`touchmove`,_,!1),r&&r[t](`touchmove`,_,!1),g(e)}function g(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`,v,!1)}function _(e){e.preventDefault()}function v(e){e.stopImmediatePropagation()}function y(){c.value?(i(`beforeShow`),i(`before-show`)):(i(`beforeHide`),i(`before-hide`))}function b(){l.value&&=(c.value?i(`show`):(s.value=!1,i(`hide`)),!1)}function x(){r.maskClosable&&(m(),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`:``,u.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:x},null,512),[[e.vShow,t.hasMask&&c.value]])]),_:1}),(0,e.createVNode)(e.Transition,{name:d.value,onBeforeEnter:y,onBeforeLeave:y,onAfterEnter:b,onAfterLeave:b},{default:(0,e.withCtx)(()=>[(0,e.withDirectives)((0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`cu-popup-box`,[d.value]])},[(0,e.renderSlot)(n.$slots,`default`)],2),[[e.vShow,c.value]])]),_:3},8,[`name`])],2)),[[e.vShow,s.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, onMounted as s, openBlock as c, provide as l, ref as u, renderSlot as d, vShow as f, watch as p, withCtx as m, withDirectives as h } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/components/popup/Popup.vue
|
|
4
|
+
var g = /* @__PURE__ */ a({
|
|
5
|
+
name: "cu-popup",
|
|
6
|
+
__name: "Popup",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: !1
|
|
11
|
+
},
|
|
12
|
+
hasMask: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !0
|
|
15
|
+
},
|
|
16
|
+
maskClosable: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !0
|
|
19
|
+
},
|
|
20
|
+
position: { default: "center" },
|
|
21
|
+
transition: { default: void 0 },
|
|
22
|
+
preventScroll: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
preventScrollExclude: { default: "" }
|
|
27
|
+
},
|
|
28
|
+
emits: [
|
|
29
|
+
"update:modelValue",
|
|
30
|
+
"beforeShow",
|
|
31
|
+
"before-show",
|
|
32
|
+
"beforeHide",
|
|
33
|
+
"before-hide",
|
|
34
|
+
"show",
|
|
35
|
+
"hide",
|
|
36
|
+
"maskClick"
|
|
37
|
+
],
|
|
38
|
+
setup(a, { emit: g }) {
|
|
39
|
+
let _ = a, v = g, y = typeof process < "u" && process.env.MAND_ENV === "test", b = u(), x = u(!1), S = u(!1), C = u(!1), w = u(!1);
|
|
40
|
+
l("mdPopupLargeRadius", w);
|
|
41
|
+
let T = t(() => _.transition ?? E(_.position));
|
|
42
|
+
function E(e) {
|
|
43
|
+
switch (e) {
|
|
44
|
+
case "bottom": return "cu-slide-up";
|
|
45
|
+
case "top": return "cu-slide-down";
|
|
46
|
+
case "left": return "cu-slide-right";
|
|
47
|
+
case "right": return "cu-slide-left";
|
|
48
|
+
default: return "cu-fade";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
p(() => _.modelValue, (e) => {
|
|
52
|
+
e ? C.value ? setTimeout(() => {
|
|
53
|
+
D();
|
|
54
|
+
}, 50) : D() : O();
|
|
55
|
+
}), p(() => _.preventScrollExclude, (e, t) => {
|
|
56
|
+
A(!1, t), A(!0, e);
|
|
57
|
+
}), s(() => {
|
|
58
|
+
_.modelValue && D();
|
|
59
|
+
});
|
|
60
|
+
function D() {
|
|
61
|
+
x.value = !0, C.value = !0, S.value = !0, y && (N(), P()), _.preventScroll && k(!0);
|
|
62
|
+
}
|
|
63
|
+
function O() {
|
|
64
|
+
C.value = !0, S.value = !1, _.preventScroll && k(!1), v("update:modelValue", !1), y && (N(), P());
|
|
65
|
+
}
|
|
66
|
+
function k(e) {
|
|
67
|
+
let t = e ? "addEventListener" : "removeEventListener", n = b.value?.querySelector(".cu-popup-mask"), r = b.value?.querySelector(".cu-popup-box");
|
|
68
|
+
n && n[t]("touchmove", j, !1), r && r[t]("touchmove", j, !1), A(e);
|
|
69
|
+
}
|
|
70
|
+
function A(e, t = _.preventScrollExclude) {
|
|
71
|
+
let n = e ? "addEventListener" : "removeEventListener", r = typeof t == "string" ? t ? b.value?.querySelector(t) : void 0 : t;
|
|
72
|
+
r && r[n]("touchmove", M, !1);
|
|
73
|
+
}
|
|
74
|
+
function j(e) {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
}
|
|
77
|
+
function M(e) {
|
|
78
|
+
e.stopImmediatePropagation();
|
|
79
|
+
}
|
|
80
|
+
function N() {
|
|
81
|
+
S.value ? (v("beforeShow"), v("before-show")) : (v("beforeHide"), v("before-hide"));
|
|
82
|
+
}
|
|
83
|
+
function P() {
|
|
84
|
+
C.value &&= (S.value ? v("show") : (x.value = !1, v("hide")), !1);
|
|
85
|
+
}
|
|
86
|
+
function F() {
|
|
87
|
+
_.maskClosable && (O(), v("maskClick"));
|
|
88
|
+
}
|
|
89
|
+
return (t, s) => h((c(), n("div", {
|
|
90
|
+
ref_key: "root",
|
|
91
|
+
ref: b,
|
|
92
|
+
class: o(["cu-popup", [
|
|
93
|
+
a.hasMask ? "with-mask" : "",
|
|
94
|
+
w.value ? "large-radius" : "",
|
|
95
|
+
a.position
|
|
96
|
+
]])
|
|
97
|
+
}, [i(e, { name: "cu-mask-fade" }, {
|
|
98
|
+
default: m(() => [h(r("div", {
|
|
99
|
+
class: "cu-popup-mask",
|
|
100
|
+
onClick: F
|
|
101
|
+
}, null, 512), [[f, a.hasMask && S.value]])]),
|
|
102
|
+
_: 1
|
|
103
|
+
}), i(e, {
|
|
104
|
+
name: T.value,
|
|
105
|
+
onBeforeEnter: N,
|
|
106
|
+
onBeforeLeave: N,
|
|
107
|
+
onAfterEnter: P,
|
|
108
|
+
onAfterLeave: P
|
|
109
|
+
}, {
|
|
110
|
+
default: m(() => [h(r("div", { class: o(["cu-popup-box", [T.value]]) }, [d(t.$slots, "default")], 2), [[f, S.value]])]),
|
|
111
|
+
_: 3
|
|
112
|
+
}, 8, ["name"])], 2)), [[f, x.value]]);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
//#endregion
|
|
116
|
+
export { g as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Icon-jaEPn7d7.cjs");let t=require("vue");var n=[`innerHTML`],r={key:1,class:`title-bar-title`},i=[`innerHTML`],a=[`innerHTML`],o={key:2,class:`title-bar-title`},s=[`innerHTML`],c=(0,t.defineComponent)({name:`cu-popup-title-bar`,__name:`PopupTitleBar`,props:{title:{default:``},describe:{default:``},okText:{default:``},cancelText:{default:``},largeRadius:{type:Boolean,default:!1},onlyClose:{type:Boolean,default:!1},titleAlign:{default:`center`}},emits:[`confirm`,`cancel`],setup(c,{emit:l}){let u=c,d=l,f=(0,t.inject)(`mdPopupLargeRadius`,null);(0,t.watch)(()=>u.largeRadius,e=>{f&&(f.value=e)},{immediate:!0});function p(e){e.preventDefault()}return(l,u)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`cu-popup-title-bar`,[`title-align-${c.titleAlign}`,{large:!!c.describe,"large-radius":c.largeRadius}]]),onTouchmove:p},[c.onlyClose?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[c.cancelText?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`title-bar-left cu-popup-cancel`,innerHTML:c.cancelText,onClick:u[0]||=e=>d(`cancel`)},null,8,n)):l.$slots.cancel?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`title-bar-left cu-popup-cancel`,onClick:u[1]||=e=>d(`cancel`)},[(0,t.renderSlot)(l.$slots,`cancel`)])):(0,t.createCommentVNode)(``,!0)],64)),c.title?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[c.title?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:0,class:`title`,innerHTML:c.title},null,8,i)):(0,t.createCommentVNode)(``,!0),c.describe?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,{key:1,class:`describe`,innerHTML:c.describe},null,8,a)):(0,t.createCommentVNode)(``,!0)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,o,[(0,t.renderSlot)(l.$slots,`title`)])),c.onlyClose?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:3},[c.okText?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`title-bar-right cu-popup-confirm`,innerHTML:c.okText,onClick:u[2]||=e=>d(`confirm`)},null,8,s)):l.$slots.confirm?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`title-bar-right cu-popup-confirm`,onClick:u[3]||=e=>d(`confirm`)},[(0,t.renderSlot)(l.$slots,`confirm`)])):(0,t.createCommentVNode)(``,!0)],64)),c.onlyClose?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:4,class:`title-bar-right cu-popup-close`,onClick:u[4]||=e=>d(`cancel`)},[(0,t.createVNode)(e.t,{name:`close`,size:`lg`})])):(0,t.createCommentVNode)(``,!0)],34))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { t as e } from "./Icon-dWGSK6Ou.js";
|
|
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
|
+
//#region src/components/popup/PopupTitleBar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var d = ["innerHTML"], f = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "title-bar-title"
|
|
7
|
+
}, p = ["innerHTML"], m = ["innerHTML"], h = {
|
|
8
|
+
key: 2,
|
|
9
|
+
class: "title-bar-title"
|
|
10
|
+
}, g = ["innerHTML"], _ = /* @__PURE__ */ a({
|
|
11
|
+
name: "cu-popup-title-bar",
|
|
12
|
+
__name: "PopupTitleBar",
|
|
13
|
+
props: {
|
|
14
|
+
title: { default: "" },
|
|
15
|
+
describe: { default: "" },
|
|
16
|
+
okText: { default: "" },
|
|
17
|
+
cancelText: { default: "" },
|
|
18
|
+
largeRadius: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
onlyClose: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
titleAlign: { default: "center" }
|
|
27
|
+
},
|
|
28
|
+
emits: ["confirm", "cancel"],
|
|
29
|
+
setup(a, { emit: _ }) {
|
|
30
|
+
let v = a, y = _, b = o("mdPopupLargeRadius", null);
|
|
31
|
+
u(() => v.largeRadius, (e) => {
|
|
32
|
+
b && (b.value = e);
|
|
33
|
+
}, { immediate: !0 });
|
|
34
|
+
function x(e) {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
}
|
|
37
|
+
return (o, u) => (c(), r("div", {
|
|
38
|
+
class: s(["cu-popup-title-bar", [`title-align-${a.titleAlign}`, {
|
|
39
|
+
large: !!a.describe,
|
|
40
|
+
"large-radius": a.largeRadius
|
|
41
|
+
}]]),
|
|
42
|
+
onTouchmove: x
|
|
43
|
+
}, [
|
|
44
|
+
a.onlyClose ? n("", !0) : (c(), r(t, { key: 0 }, [a.cancelText ? (c(), r("div", {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "title-bar-left cu-popup-cancel",
|
|
47
|
+
innerHTML: a.cancelText,
|
|
48
|
+
onClick: u[0] ||= (e) => y("cancel")
|
|
49
|
+
}, null, 8, d)) : o.$slots.cancel ? (c(), r("div", {
|
|
50
|
+
key: 1,
|
|
51
|
+
class: "title-bar-left cu-popup-cancel",
|
|
52
|
+
onClick: u[1] ||= (e) => y("cancel")
|
|
53
|
+
}, [l(o.$slots, "cancel")])) : n("", !0)], 64)),
|
|
54
|
+
a.title ? (c(), r("div", f, [a.title ? (c(), r("p", {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "title",
|
|
57
|
+
innerHTML: a.title
|
|
58
|
+
}, null, 8, p)) : n("", !0), a.describe ? (c(), r("p", {
|
|
59
|
+
key: 1,
|
|
60
|
+
class: "describe",
|
|
61
|
+
innerHTML: a.describe
|
|
62
|
+
}, null, 8, m)) : n("", !0)])) : (c(), r("div", h, [l(o.$slots, "title")])),
|
|
63
|
+
a.onlyClose ? n("", !0) : (c(), r(t, { key: 3 }, [a.okText ? (c(), r("div", {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: "title-bar-right cu-popup-confirm",
|
|
66
|
+
innerHTML: a.okText,
|
|
67
|
+
onClick: u[2] ||= (e) => y("confirm")
|
|
68
|
+
}, null, 8, g)) : o.$slots.confirm ? (c(), r("div", {
|
|
69
|
+
key: 1,
|
|
70
|
+
class: "title-bar-right cu-popup-confirm",
|
|
71
|
+
onClick: u[3] ||= (e) => y("confirm")
|
|
72
|
+
}, [l(o.$slots, "confirm")])) : n("", !0)], 64)),
|
|
73
|
+
a.onlyClose ? (c(), r("div", {
|
|
74
|
+
key: 4,
|
|
75
|
+
class: "title-bar-right cu-popup-close",
|
|
76
|
+
onClick: u[4] ||= (e) => y("cancel")
|
|
77
|
+
}, [i(e, {
|
|
78
|
+
name: "close",
|
|
79
|
+
size: "lg"
|
|
80
|
+
})])) : n("", !0)
|
|
81
|
+
], 34));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
export { _ as t };
|