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,327 @@
|
|
|
1
|
+
import { t as e } from "./FieldItem-D79w330m.js";
|
|
2
|
+
import { t } from "./Icon-BgCtu0ZV.js";
|
|
3
|
+
import { t as n } from "./NumberKeyboard-B_TJXxki.js";
|
|
4
|
+
import { n as r, t as i } from "./cursor-BIPoNm8V.js";
|
|
5
|
+
import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as ee, createVNode as te, defineComponent as l, inject as ne, nextTick as u, normalizeClass as d, onBeforeUnmount as re, onMounted as ie, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, unref as g, useSlots as ae, vShow as oe, watch as _, withCtx as v, withDirectives as se } from "vue";
|
|
6
|
+
import { formatValueByGapRule as ce, formatValueByGapStep as y, randomId as le, trimValue as b } from "@centui/core";
|
|
7
|
+
// src/components/input-item/InputItem.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var ue = [
|
|
9
|
+
"type",
|
|
10
|
+
"name",
|
|
11
|
+
"value",
|
|
12
|
+
"placeholder",
|
|
13
|
+
"disabled",
|
|
14
|
+
"readonly",
|
|
15
|
+
"maxlength"
|
|
16
|
+
], de = ["textContent"], fe = ["textContent"], pe = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "cu-input-item-msg"
|
|
19
|
+
}, me = ["textContent"], he = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "cu-input-item-brief"
|
|
22
|
+
}, ge = ["textContent"], x = /* @__PURE__ */ l({
|
|
23
|
+
name: "cu-input-item",
|
|
24
|
+
__name: "InputItem",
|
|
25
|
+
props: {
|
|
26
|
+
type: { default: "text" },
|
|
27
|
+
previewType: { default: "" },
|
|
28
|
+
name: { default: void 0 },
|
|
29
|
+
title: { default: "" },
|
|
30
|
+
brief: { default: "" },
|
|
31
|
+
modelValue: { default: "" },
|
|
32
|
+
placeholder: { default: "" },
|
|
33
|
+
maxlength: { default: "" },
|
|
34
|
+
size: { default: "normal" },
|
|
35
|
+
align: { default: "left" },
|
|
36
|
+
error: { default: "" },
|
|
37
|
+
readonly: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
solid: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
},
|
|
49
|
+
clearable: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
isVirtualKeyboard: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
virtualKeyboardDisorder: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
virtualKeyboardOkText: { default: void 0 },
|
|
62
|
+
virtualKeyboardVm: { default: null },
|
|
63
|
+
isTitleLatent: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
},
|
|
67
|
+
isFormative: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: !1
|
|
70
|
+
},
|
|
71
|
+
isHighlight: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !1
|
|
74
|
+
},
|
|
75
|
+
isAmount: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !1
|
|
78
|
+
},
|
|
79
|
+
formation: {
|
|
80
|
+
type: Function,
|
|
81
|
+
default: () => void 0
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
emits: [
|
|
85
|
+
"update:modelValue",
|
|
86
|
+
"change",
|
|
87
|
+
"focus",
|
|
88
|
+
"blur",
|
|
89
|
+
"confirm",
|
|
90
|
+
"keyup",
|
|
91
|
+
"keydown"
|
|
92
|
+
],
|
|
93
|
+
setup(l, { expose: x, emit: _e }) {
|
|
94
|
+
function S(e) {
|
|
95
|
+
return e.replace(/[\s,]/g, "");
|
|
96
|
+
}
|
|
97
|
+
let C = l, w = _e, ve = ne("rootField", null), T = p(), E = p(), D = C.name ?? le("input-item"), O = p(""), k = p(""), A = p(null), j = p(!1), M = p(!1), N = p(!1), P = !1, F = null, I = null, L = a(() => (N.value ? C.previewType : C.type) || "text"), ye = a(() => {
|
|
98
|
+
let e = L.value || "text";
|
|
99
|
+
return e === "bankCard" || e === "phone" || e === "digit" ? e = "tel" : e === "money" && (e = "text"), e;
|
|
100
|
+
}), R = a(() => L.value === "phone" ? 11 : C.maxlength), z = a(() => C.isTitleLatent && B.value ? "" : C.placeholder), B = a(() => !V.value || j.value), V = a(() => !O.value.length), H = a(() => {
|
|
101
|
+
let e = L.value;
|
|
102
|
+
return C.isFormative || e === "bankCard" || e === "phone" || e === "money" || e === "digit";
|
|
103
|
+
}), U = a(() => !!ve?.disabled || C.disabled), W = a(() => !!be.value || C.error !== ""), G = a(() => !!xe.value || C.brief !== ""), K = ae(), be = a(() => !!K.error), xe = a(() => !!K.brief);
|
|
104
|
+
_(() => C.modelValue, (e) => {
|
|
105
|
+
e !== S(O.value) && (O.value = q(J(`${e}`)).value);
|
|
106
|
+
}), _(() => C.previewType, (e) => {
|
|
107
|
+
N.value = !!e;
|
|
108
|
+
}, { immediate: !0 }), _(O, (e) => {
|
|
109
|
+
k.value = e;
|
|
110
|
+
let t = H.value ? S(e) : e;
|
|
111
|
+
t !== C.modelValue && (w("update:modelValue", t), w("change", D, t));
|
|
112
|
+
}), _(j, (e) => {
|
|
113
|
+
if (!C.isVirtualKeyboard || !A.value) return;
|
|
114
|
+
let t = A.value;
|
|
115
|
+
e ? (t.show?.(), w("focus", D)) : (t.hide?.(), w("blur", D));
|
|
116
|
+
}), O.value = q(J(`${C.modelValue}`)).value, ie(() => {
|
|
117
|
+
C.isVirtualKeyboard && u(() => {
|
|
118
|
+
Ce();
|
|
119
|
+
});
|
|
120
|
+
}), re(() => {
|
|
121
|
+
let e = A.value;
|
|
122
|
+
e?.$el && e.$el.parentNode && e.$el.parentNode.removeChild(e.$el), F && clearTimeout(F), I && clearTimeout(I), document.removeEventListener("click", Q, !1);
|
|
123
|
+
});
|
|
124
|
+
function q(e, t = 0) {
|
|
125
|
+
let n = L.value, r = O.value, i = r.length > e.length ? -1 : 1, a = {
|
|
126
|
+
value: e,
|
|
127
|
+
range: t
|
|
128
|
+
};
|
|
129
|
+
if (!H.value || e === "") return a;
|
|
130
|
+
let o = C.formation(D, e, t);
|
|
131
|
+
if (o) return o;
|
|
132
|
+
let s = " ";
|
|
133
|
+
switch (n) {
|
|
134
|
+
case "bankCard":
|
|
135
|
+
e = J(b(e.replace(/\D/g, ""))), a = y(4, e, s, "left", t, i, r);
|
|
136
|
+
break;
|
|
137
|
+
case "phone":
|
|
138
|
+
e = J(b(e.replace(/\D/g, ""))), a = ce("3|4|4", e, s, t, i);
|
|
139
|
+
break;
|
|
140
|
+
case "money": {
|
|
141
|
+
s = ",", e = J(b(e.replace(/[^\d.]/g, "")));
|
|
142
|
+
let n = e.indexOf("."), o = e.split(".")[0], c = ~n ? `.${e.split(".")[1]}` : "";
|
|
143
|
+
a = y(3, b(o, s), s, "right", t, i, r.split(".")[0]), a.value += c;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
case "digit": e = J(b(e.replace(/\D/g, ""))), a.value = e;
|
|
147
|
+
}
|
|
148
|
+
return a;
|
|
149
|
+
}
|
|
150
|
+
function J(e) {
|
|
151
|
+
let t = R.value;
|
|
152
|
+
return t !== "" && t !== void 0 ? e.substring(0, Number(t)) : e;
|
|
153
|
+
}
|
|
154
|
+
function Y() {
|
|
155
|
+
M.value = !0, F && clearTimeout(F), F = setTimeout(() => {
|
|
156
|
+
M.value = !1;
|
|
157
|
+
}, 500);
|
|
158
|
+
}
|
|
159
|
+
function X() {
|
|
160
|
+
O.value = "", !C.isTitleLatent && $(), N.value = !1;
|
|
161
|
+
}
|
|
162
|
+
function Z() {
|
|
163
|
+
X();
|
|
164
|
+
}
|
|
165
|
+
function Se() {
|
|
166
|
+
j.value = !0, setTimeout(() => {
|
|
167
|
+
document.addEventListener("click", Q, !1);
|
|
168
|
+
}, 0);
|
|
169
|
+
}
|
|
170
|
+
function Q() {
|
|
171
|
+
j.value = !1, document.removeEventListener("click", Q, !1);
|
|
172
|
+
}
|
|
173
|
+
function Ce() {
|
|
174
|
+
let e = C.virtualKeyboardVm && typeof C.virtualKeyboardVm == "object" ? C.virtualKeyboardVm : E.value;
|
|
175
|
+
e && (A.value = e, e.$el && document.body.appendChild(e.$el));
|
|
176
|
+
}
|
|
177
|
+
function we(e) {
|
|
178
|
+
let t = e.target;
|
|
179
|
+
if (P) {
|
|
180
|
+
O.value = t.value, k.value = t.value;
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
let n = q(t.value, H.value ? i(t) : 0);
|
|
184
|
+
O.value = n.value, k.value = n.value, H.value && u(() => {
|
|
185
|
+
r(t, n.range);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function Te() {
|
|
189
|
+
P = !0;
|
|
190
|
+
}
|
|
191
|
+
function Ee(e) {
|
|
192
|
+
P = !1, we(e);
|
|
193
|
+
}
|
|
194
|
+
function De(e) {
|
|
195
|
+
w("keyup", D, e), (+e.keyCode == 13 || +e.keyCode == 108) && w("confirm", D, O.value);
|
|
196
|
+
}
|
|
197
|
+
function Oe(e) {
|
|
198
|
+
w("keydown", D, e), +e.keyCode != 13 && +e.keyCode != 108 && (Y(), N.value && Z());
|
|
199
|
+
}
|
|
200
|
+
function ke() {
|
|
201
|
+
j.value = !0, w("focus", D);
|
|
202
|
+
}
|
|
203
|
+
function Ae() {
|
|
204
|
+
I && clearTimeout(I), I = setTimeout(() => {
|
|
205
|
+
I = null, j.value = !1, w("blur", D);
|
|
206
|
+
}, 100);
|
|
207
|
+
}
|
|
208
|
+
function je() {
|
|
209
|
+
U.value || C.readonly || (Q(), j.value || Se());
|
|
210
|
+
}
|
|
211
|
+
function Me(e) {
|
|
212
|
+
N.value && Z(), Number(R.value) > 0 && S(O.value).length >= Number(R.value) || (O.value = q(O.value + e).value, Y());
|
|
213
|
+
}
|
|
214
|
+
function Ne() {
|
|
215
|
+
let e = O.value;
|
|
216
|
+
e !== "" && (O.value = q(e.substring(0, e.length - 1)).value, Y(), N.value && Z());
|
|
217
|
+
}
|
|
218
|
+
function Pe() {
|
|
219
|
+
w("confirm", D, O.value);
|
|
220
|
+
}
|
|
221
|
+
function $() {
|
|
222
|
+
C.isVirtualKeyboard ? je() : (T.value?.$el.querySelector(".cu-input-item-input")?.focus(), setTimeout(() => {
|
|
223
|
+
j.value = !0;
|
|
224
|
+
}, 200));
|
|
225
|
+
}
|
|
226
|
+
function Fe() {
|
|
227
|
+
C.isVirtualKeyboard ? Q() : T.value?.$el.querySelector(".cu-input-item-input")?.blur();
|
|
228
|
+
}
|
|
229
|
+
function Ie() {
|
|
230
|
+
return O.value;
|
|
231
|
+
}
|
|
232
|
+
return x({
|
|
233
|
+
focus: $,
|
|
234
|
+
blur: Fe,
|
|
235
|
+
getValue: Ie
|
|
236
|
+
}), (r, i) => (f(), o(e, {
|
|
237
|
+
ref_key: "root",
|
|
238
|
+
ref: T,
|
|
239
|
+
class: d(["cu-input-item", [
|
|
240
|
+
l.isHighlight ? "is-highlight" : "",
|
|
241
|
+
l.isTitleLatent ? "is-title-latent" : "",
|
|
242
|
+
B.value ? "is-active" : "",
|
|
243
|
+
j.value ? "is-focus" : "",
|
|
244
|
+
W.value ? "is-error" : "",
|
|
245
|
+
G.value && !W.value ? "with-brief" : "",
|
|
246
|
+
U.value ? "is-disabled" : "",
|
|
247
|
+
l.isAmount ? "is-amount" : "",
|
|
248
|
+
l.clearable ? "is-clear" : "",
|
|
249
|
+
l.align,
|
|
250
|
+
l.size
|
|
251
|
+
]]),
|
|
252
|
+
title: l.title,
|
|
253
|
+
solid: l.solid && !l.isTitleLatent
|
|
254
|
+
}, {
|
|
255
|
+
left: v(() => [m(r.$slots, "left")]),
|
|
256
|
+
right: v(() => [l.clearable && !U.value && !l.readonly ? se((f(), c("div", {
|
|
257
|
+
key: 0,
|
|
258
|
+
class: "cu-input-item-clear",
|
|
259
|
+
onClick: X
|
|
260
|
+
}, [te(t, { name: "clear" })], 512)), [[oe, !V.value && j.value]]) : s("", !0), m(r.$slots, "right")]),
|
|
261
|
+
children: v(() => [
|
|
262
|
+
W.value ? (f(), c("div", pe, [l.error === "" ? m(r.$slots, "error", {}, void 0, void 0, 1) : (f(), c("p", {
|
|
263
|
+
key: 0,
|
|
264
|
+
textContent: h(l.error)
|
|
265
|
+
}, null, 8, me))])) : s("", !0),
|
|
266
|
+
G.value && !W.value ? (f(), c("div", he, [l.brief === "" ? m(r.$slots, "brief", {}, void 0, void 0, 1) : (f(), c("p", {
|
|
267
|
+
key: 0,
|
|
268
|
+
textContent: h(l.brief)
|
|
269
|
+
}, null, 8, ge))])) : s("", !0),
|
|
270
|
+
l.isVirtualKeyboard && !l.virtualKeyboardVm ? (f(), o(n, {
|
|
271
|
+
key: 2,
|
|
272
|
+
ref_key: "numberKeyboard",
|
|
273
|
+
ref: E,
|
|
274
|
+
id: `${g(D)}-number-keyboard`,
|
|
275
|
+
class: "cu-input-item-number-keyboard",
|
|
276
|
+
"ok-text": l.virtualKeyboardOkText,
|
|
277
|
+
disorder: l.virtualKeyboardDisorder,
|
|
278
|
+
onEnter: Me,
|
|
279
|
+
onDelete: Ne,
|
|
280
|
+
onConfirm: Pe
|
|
281
|
+
}, null, 8, [
|
|
282
|
+
"id",
|
|
283
|
+
"ok-text",
|
|
284
|
+
"disorder"
|
|
285
|
+
])) : s("", !0)
|
|
286
|
+
]),
|
|
287
|
+
default: v(() => [l.isVirtualKeyboard ? (f(), c("div", {
|
|
288
|
+
key: 1,
|
|
289
|
+
class: d(["cu-input-item-fake", {
|
|
290
|
+
"is-focus": j.value,
|
|
291
|
+
"is-waiting": !M.value,
|
|
292
|
+
disabled: U.value,
|
|
293
|
+
readonly: l.readonly
|
|
294
|
+
}]),
|
|
295
|
+
onClick: je
|
|
296
|
+
}, [ee("span", { textContent: h(O.value) }, null, 8, de), O.value === "" && z.value !== "" ? (f(), c("span", {
|
|
297
|
+
key: 0,
|
|
298
|
+
class: "cu-input-item-fake-placeholder",
|
|
299
|
+
textContent: h(z.value)
|
|
300
|
+
}, null, 8, fe)) : s("", !0)], 2)) : (f(), c("input", {
|
|
301
|
+
key: 0,
|
|
302
|
+
class: "cu-input-item-input",
|
|
303
|
+
type: ye.value,
|
|
304
|
+
name: String(g(D)),
|
|
305
|
+
value: k.value,
|
|
306
|
+
placeholder: z.value,
|
|
307
|
+
disabled: U.value,
|
|
308
|
+
readonly: l.readonly,
|
|
309
|
+
maxlength: H.value ? "" : R.value,
|
|
310
|
+
autocomplete: "off",
|
|
311
|
+
onFocus: ke,
|
|
312
|
+
onBlur: Ae,
|
|
313
|
+
onKeyup: De,
|
|
314
|
+
onKeydown: Oe,
|
|
315
|
+
onInput: we,
|
|
316
|
+
onCompositionstart: Te,
|
|
317
|
+
onCompositionend: Ee
|
|
318
|
+
}, null, 40, ue))]),
|
|
319
|
+
_: 3
|
|
320
|
+
}, 8, [
|
|
321
|
+
"class",
|
|
322
|
+
"title",
|
|
323
|
+
"solid"
|
|
324
|
+
]));
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
export { x as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Popup-Ca1jPi0t.cjs"),t=require("./Icon-83WWqE5z.cjs");let n=require("vue");var r={class:`cu-landscape-content`},i=(0,n.defineComponent)({name:`cu-landscape`,__name:`Landscape`,props:{modelValue:{type:Boolean,default:!1},scroll:{type:Boolean,default:!1},fullScreen:{type:Boolean,default:!1},hasMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!1},transition:{default:void 0}},emits:[`update:modelValue`,`input`,`show`,`hide`],setup(i,{emit:a}){let o=i,s=a,c=(0,n.ref)(o.modelValue),l=(0,n.computed)(()=>o.transition??(o.fullScreen?`cu-fade`:`cu-punch`));(0,n.watch)(()=>o.modelValue,e=>{c.value=e});function u(e){c.value=e,s(`update:modelValue`,!1),s(`input`,!1)}function d(){c.value=!1}return(a,o)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`cu-landscape`,{"is-full":i.fullScreen}])},[(0,n.createVNode)(e.t,{modelValue:c.value,"onUpdate:modelValue":[o[0]||=e=>c.value=e,u],"mask-closable":i.maskClosable,"prevent-scroll":``,"prevent-scroll-exclude":`.cu-landscape-content`,"has-mask":!i.fullScreen&&i.hasMask,transition:l.value,onShow:o[1]||=e=>a.$emit(`show`),onHide:o[2]||=e=>a.$emit(`hide`)},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)([`cu-landscape-body`,{scroll:i.scroll}])},[(0,n.createElementVNode)(`div`,r,[(0,n.renderSlot)(a.$slots,`default`)]),(0,n.createVNode)(t.t,{class:(0,n.normalizeClass)([`cu-landscape-close`,{dark:!i.hasMask||i.fullScreen}]),name:i.fullScreen?`clear`:`close`,onClick:d},null,8,[`class`,`name`])],2)]),_:3},8,[`modelValue`,`mask-closable`,`has-mask`,`transition`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as e } from "./Popup-qLk-BsRS.js";
|
|
2
|
+
import { t } from "./Icon-BgCtu0ZV.js";
|
|
3
|
+
import { computed as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, watch as d, withCtx as f } from "vue";
|
|
4
|
+
// src/components/landscape/Landscape.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var p = { class: "cu-landscape-content" }, m = /* @__PURE__ */ o({
|
|
6
|
+
name: "cu-landscape",
|
|
7
|
+
__name: "Landscape",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: !1
|
|
12
|
+
},
|
|
13
|
+
scroll: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
fullScreen: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
hasMask: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
maskClosable: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
transition: { default: void 0 }
|
|
30
|
+
},
|
|
31
|
+
emits: [
|
|
32
|
+
"update:modelValue",
|
|
33
|
+
"input",
|
|
34
|
+
"show",
|
|
35
|
+
"hide"
|
|
36
|
+
],
|
|
37
|
+
setup(o, { emit: m }) {
|
|
38
|
+
let h = o, g = m, _ = l(h.modelValue), v = n(() => h.transition ?? (h.fullScreen ? "cu-fade" : "cu-punch"));
|
|
39
|
+
d(() => h.modelValue, (e) => {
|
|
40
|
+
_.value = e;
|
|
41
|
+
});
|
|
42
|
+
function y(e) {
|
|
43
|
+
_.value = e, g("update:modelValue", !1), g("input", !1);
|
|
44
|
+
}
|
|
45
|
+
function b() {
|
|
46
|
+
_.value = !1;
|
|
47
|
+
}
|
|
48
|
+
return (n, l) => (c(), r("div", { class: s(["cu-landscape", { "is-full": o.fullScreen }]) }, [a(e, {
|
|
49
|
+
modelValue: _.value,
|
|
50
|
+
"onUpdate:modelValue": [l[0] ||= (e) => _.value = e, y],
|
|
51
|
+
"mask-closable": o.maskClosable,
|
|
52
|
+
"prevent-scroll": "",
|
|
53
|
+
"prevent-scroll-exclude": ".cu-landscape-content",
|
|
54
|
+
"has-mask": !o.fullScreen && o.hasMask,
|
|
55
|
+
transition: v.value,
|
|
56
|
+
onShow: l[1] ||= (e) => n.$emit("show"),
|
|
57
|
+
onHide: l[2] ||= (e) => n.$emit("hide")
|
|
58
|
+
}, {
|
|
59
|
+
default: f(() => [i("div", { class: s(["cu-landscape-body", { scroll: o.scroll }]) }, [i("div", p, [u(n.$slots, "default")]), a(t, {
|
|
60
|
+
class: s(["cu-landscape-close", { dark: !o.hasMask || o.fullScreen }]),
|
|
61
|
+
name: o.fullScreen ? "clear" : "close",
|
|
62
|
+
onClick: b
|
|
63
|
+
}, null, 8, ["class", "name"])], 2)]),
|
|
64
|
+
_: 3
|
|
65
|
+
}, 8, [
|
|
66
|
+
"modelValue",
|
|
67
|
+
"mask-closable",
|
|
68
|
+
"has-mask",
|
|
69
|
+
"transition"
|
|
70
|
+
])], 2));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export { m as t };
|
|
@@ -0,0 +1,201 @@
|
|
|
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, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, watch as m, withCtx as h } from "vue";
|
|
4
|
+
// src/components/license-plate/LicensePlateInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var g = { class: "cu-license-plate-input" }, _ = ["onClick"], v = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "cu-license-plate-input-item_content"
|
|
8
|
+
}, y = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "cu-license-plate-input-item_content"
|
|
11
|
+
}, b = { key: 0 }, x = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "emptyValue"
|
|
14
|
+
}, S = /* @__PURE__ */ c({
|
|
15
|
+
name: "cu-license-plate-input",
|
|
16
|
+
__name: "LicensePlateInput",
|
|
17
|
+
props: {
|
|
18
|
+
keyArray: { default: () => [] },
|
|
19
|
+
selectedIndex: { default: 0 }
|
|
20
|
+
},
|
|
21
|
+
emits: ["key-mapping"],
|
|
22
|
+
setup(e) {
|
|
23
|
+
return (t, r) => (u(), a("div", g, [(u(!0), a(n, null, f(e.keyArray, (n, r) => (u(), a("div", {
|
|
24
|
+
key: r,
|
|
25
|
+
class: l(["cu-license-plate-input-item", {
|
|
26
|
+
active: e.selectedIndex === r,
|
|
27
|
+
animation: e.selectedIndex === r && !n
|
|
28
|
+
}]),
|
|
29
|
+
onClick: (e) => t.$emit("key-mapping", r)
|
|
30
|
+
}, [r === e.keyArray.length - 1 ? (u(), a("div", y, [n && n !== " " ? (u(), a("div", b, p(n), 1)) : (u(), a("div", x))])) : (u(), a("div", v, p(n), 1))], 10, _))), 128))]));
|
|
31
|
+
}
|
|
32
|
+
}), C = { class: "cu-license-plate-keyboard" }, w = {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "cu-shortcut-row"
|
|
35
|
+
}, T = ["onClick"], E = {
|
|
36
|
+
key: 1,
|
|
37
|
+
class: "cu-mixed-key-board"
|
|
38
|
+
}, D = ["onClick"], O = { key: 0 }, k = ["onClick"], A = /* @__PURE__ */ c({
|
|
39
|
+
name: "cu-license-plate-keyboard",
|
|
40
|
+
__name: "LicensePlateKeyboard",
|
|
41
|
+
props: { keyboard: { default: () => ({}) } },
|
|
42
|
+
emits: [
|
|
43
|
+
"enter",
|
|
44
|
+
"delete",
|
|
45
|
+
"confirm"
|
|
46
|
+
],
|
|
47
|
+
setup(e) {
|
|
48
|
+
let t = e, o = r(() => t.keyboard.shortcuts || []), s = r(() => t.keyboard.keyboardType || 1), c = r(() => t.keyboard.mixedKeyboard || []);
|
|
49
|
+
return (e, t) => (u(), a("div", C, [s.value === 1 ? (u(), a("div", w, [(u(!0), a(n, null, f(o.value, (t, n) => (u(), a("div", {
|
|
50
|
+
key: n,
|
|
51
|
+
class: "cu-shortcut-row-item",
|
|
52
|
+
onClick: (n) => e.$emit("enter", t)
|
|
53
|
+
}, p(t), 9, T))), 128))])) : (u(), a("div", E, [(u(!0), a(n, null, f(c.value, (t, n) => (u(), a("div", {
|
|
54
|
+
key: n,
|
|
55
|
+
class: l(["cu-mixed-key-board-item", { disabled: t.disabled }])
|
|
56
|
+
}, [t.type ? (u(), a("div", {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: l(t.type),
|
|
59
|
+
onClick: (n) => t.type === "delete" ? e.$emit("delete") : e.$emit("confirm")
|
|
60
|
+
}, [t.type === "confirm" && t.text ? (u(), a("div", O, p(t.text), 1)) : i("", !0)], 10, D)) : (u(), a("div", {
|
|
61
|
+
key: 1,
|
|
62
|
+
onClick: (n) => !t.disabled && e.$emit("enter", t.value)
|
|
63
|
+
}, p(t.value), 9, k))], 2))), 128))]))]));
|
|
64
|
+
}
|
|
65
|
+
}), j = { class: "cu-license-plate" }, M = { key: 0 }, N = { class: "cu-license-plate-input-container division" }, P = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "cu-license-plate-keyboard-container division"
|
|
68
|
+
}, F = { key: 1 }, I = { class: "cu-popup-content" }, L = { class: "cu-license-plate-input-container popUp" }, R = { class: "cu-license-plate-keyboard-container popUp" }, z = /* @__PURE__ */ c({
|
|
69
|
+
name: "cu-license-plate",
|
|
70
|
+
__name: "LicensePlate",
|
|
71
|
+
props: {
|
|
72
|
+
shortcuts: { default: () => /* @__PURE__ */ "京.津.渝.沪.冀.晋.辽.吉.黑.苏.浙.皖.闽.赣.鲁.豫.鄂.湘.粤.琼.川.贵.云.陕.甘.青.蒙.桂.宁.新.藏".split(".") },
|
|
73
|
+
modeShow: { default: "division" },
|
|
74
|
+
showPopUp: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !1
|
|
77
|
+
},
|
|
78
|
+
title: { default: "请输入车牌号码" },
|
|
79
|
+
subtitle: { default: "" },
|
|
80
|
+
defaultValue: { default: "" },
|
|
81
|
+
disorderClick: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !0
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
emits: [
|
|
87
|
+
"confirm",
|
|
88
|
+
"hide",
|
|
89
|
+
"sd-keyboard",
|
|
90
|
+
"hd-keyboard"
|
|
91
|
+
],
|
|
92
|
+
setup(n, { emit: c }) {
|
|
93
|
+
let l = n, f = c, p = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((e) => ({
|
|
94
|
+
value: e,
|
|
95
|
+
disabled: e === "I" || e === "O"
|
|
96
|
+
})), g = [
|
|
97
|
+
1,
|
|
98
|
+
2,
|
|
99
|
+
3,
|
|
100
|
+
4,
|
|
101
|
+
5,
|
|
102
|
+
6,
|
|
103
|
+
7,
|
|
104
|
+
8,
|
|
105
|
+
9,
|
|
106
|
+
0
|
|
107
|
+
].map((e) => ({
|
|
108
|
+
value: e,
|
|
109
|
+
disabled: !1
|
|
110
|
+
})), _ = d([
|
|
111
|
+
"",
|
|
112
|
+
"",
|
|
113
|
+
"",
|
|
114
|
+
"",
|
|
115
|
+
"",
|
|
116
|
+
"",
|
|
117
|
+
"",
|
|
118
|
+
""
|
|
119
|
+
]), v = d(0), y = d(!1), b = r(() => {
|
|
120
|
+
let e = [], t;
|
|
121
|
+
if (v.value === 0) t = 1;
|
|
122
|
+
else {
|
|
123
|
+
t = 2;
|
|
124
|
+
let n = JSON.parse(JSON.stringify(p));
|
|
125
|
+
n.splice(19, 0, {
|
|
126
|
+
type: "delete",
|
|
127
|
+
disabled: !1
|
|
128
|
+
}), n.push({
|
|
129
|
+
type: "confirm",
|
|
130
|
+
text: "确定",
|
|
131
|
+
disabled: !1
|
|
132
|
+
});
|
|
133
|
+
let r = g;
|
|
134
|
+
v.value === 1 && (r = g.map((e) => ({
|
|
135
|
+
value: e.value,
|
|
136
|
+
disabled: !0
|
|
137
|
+
}))), e = r.concat(n);
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
shortcuts: l.shortcuts,
|
|
141
|
+
mixedKeyboard: e,
|
|
142
|
+
keyboardType: t
|
|
143
|
+
};
|
|
144
|
+
}), x = r(() => _.value.map((e) => e || " "));
|
|
145
|
+
m(() => l.defaultValue, (e) => {
|
|
146
|
+
if (e !== "") {
|
|
147
|
+
let t = e.split(""), n = JSON.parse(JSON.stringify(_.value));
|
|
148
|
+
n.forEach((e, r) => {
|
|
149
|
+
n[r] = t[r] ?? "";
|
|
150
|
+
}), _.value = n;
|
|
151
|
+
}
|
|
152
|
+
}, { immediate: !0 });
|
|
153
|
+
function C(e) {
|
|
154
|
+
y.value ||= !0, !l.disorderClick && !_.value[e + 1] && !_.value[e - 1] && e > 0 || (v.value = e);
|
|
155
|
+
}
|
|
156
|
+
function w(e) {
|
|
157
|
+
_.value[v.value] = String(e ?? ""), v.value === _.value.length - 1 ? E() : v.value += 1;
|
|
158
|
+
}
|
|
159
|
+
function T() {
|
|
160
|
+
_.value[v.value] = "", v.value <= 0 ? l.modeShow === "division" && (y.value = !1) : --v.value;
|
|
161
|
+
}
|
|
162
|
+
function E() {
|
|
163
|
+
l.modeShow === "division" && (y.value = !1), f("confirm", x.value.join(""));
|
|
164
|
+
}
|
|
165
|
+
return (r, c) => (u(), a("div", j, [n.modeShow === "division" ? (u(), a("div", M, [o("div", N, [s(S, {
|
|
166
|
+
"key-array": _.value,
|
|
167
|
+
"selected-index": v.value,
|
|
168
|
+
onKeyMapping: C
|
|
169
|
+
}, null, 8, ["key-array", "selected-index"])]), y.value ? (u(), a("div", P, [s(A, {
|
|
170
|
+
keyboard: b.value,
|
|
171
|
+
onEnter: w,
|
|
172
|
+
onDelete: T,
|
|
173
|
+
onConfirm: E
|
|
174
|
+
}, null, 8, ["keyboard"])])) : i("", !0)])) : i("", !0), n.modeShow === "popUp" ? (u(), a("div", F, [s(e, {
|
|
175
|
+
"model-value": n.showPopUp,
|
|
176
|
+
"has-mask": !0,
|
|
177
|
+
position: "bottom",
|
|
178
|
+
"mask-closable": !1
|
|
179
|
+
}, {
|
|
180
|
+
default: h(() => [s(t, {
|
|
181
|
+
"only-close": "",
|
|
182
|
+
"large-radius": "",
|
|
183
|
+
title: n.title,
|
|
184
|
+
describe: n.subtitle,
|
|
185
|
+
"title-align": "left",
|
|
186
|
+
onCancel: c[0] ||= (e) => r.$emit("hide")
|
|
187
|
+
}, null, 8, ["title", "describe"]), o("div", I, [o("div", L, [s(S, {
|
|
188
|
+
"key-array": _.value,
|
|
189
|
+
"selected-index": v.value,
|
|
190
|
+
onKeyMapping: C
|
|
191
|
+
}, null, 8, ["key-array", "selected-index"])]), o("div", R, [s(A, {
|
|
192
|
+
keyboard: b.value,
|
|
193
|
+
onEnter: w,
|
|
194
|
+
onDelete: T,
|
|
195
|
+
onConfirm: E
|
|
196
|
+
}, null, 8, ["keyboard"])])])]),
|
|
197
|
+
_: 1
|
|
198
|
+
}, 8, ["model-value"])])) : i("", !0)]));
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
export { A as n, S as r, z as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Popup-Ca1jPi0t.cjs"),t=require("./PopupTitleBar-Bfl49eYJ.cjs");let n=require("vue");var r={class:`cu-license-plate-input`},i=[`onClick`],a={key:0,class:`cu-license-plate-input-item_content`},o={key:1,class:`cu-license-plate-input-item_content`},s={key:0},c={key:1,class:`emptyValue`},l=(0,n.defineComponent)({name:`cu-license-plate-input`,__name:`LicensePlateInput`,props:{keyArray:{default:()=>[]},selectedIndex:{default:0}},emits:[`key-mapping`],setup(e){return(t,l)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,r,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.keyArray,(r,l)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:l,class:(0,n.normalizeClass)([`cu-license-plate-input-item`,{active:e.selectedIndex===l,animation:e.selectedIndex===l&&!r}]),onClick:e=>t.$emit(`key-mapping`,l)},[l===e.keyArray.length-1?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,o,[r&&r!==` `?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,s,(0,n.toDisplayString)(r),1)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,c))])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,a,(0,n.toDisplayString)(r),1))],10,i))),128))]))}}),u={class:`cu-license-plate-keyboard`},d={key:0,class:`cu-shortcut-row`},f=[`onClick`],p={key:1,class:`cu-mixed-key-board`},m=[`onClick`],h={key:0},g=[`onClick`],_=(0,n.defineComponent)({name:`cu-license-plate-keyboard`,__name:`LicensePlateKeyboard`,props:{keyboard:{default:()=>({})}},emits:[`enter`,`delete`,`confirm`],setup(e){let t=e,r=(0,n.computed)(()=>t.keyboard.shortcuts||[]),i=(0,n.computed)(()=>t.keyboard.keyboardType||1),a=(0,n.computed)(()=>t.keyboard.mixedKeyboard||[]);return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,[i.value===1?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,d,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r.value,(t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:r,class:`cu-shortcut-row-item`,onClick:n=>e.$emit(`enter`,t)},(0,n.toDisplayString)(t),9,f))),128))])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,p,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(a.value,(t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:r,class:(0,n.normalizeClass)([`cu-mixed-key-board-item`,{disabled:t.disabled}])},[t.type?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:(0,n.normalizeClass)(t.type),onClick:n=>t.type===`delete`?e.$emit(`delete`):e.$emit(`confirm`)},[t.type===`confirm`&&t.text?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,h,(0,n.toDisplayString)(t.text),1)):(0,n.createCommentVNode)(``,!0)],10,m)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:1,onClick:n=>!t.disabled&&e.$emit(`enter`,t.value)},(0,n.toDisplayString)(t.value),9,g))],2))),128))]))]))}}),v={class:`cu-license-plate`},y={key:0},b={class:`cu-license-plate-input-container division`},x={key:0,class:`cu-license-plate-keyboard-container division`},S={key:1},C={class:`cu-popup-content`},w={class:`cu-license-plate-input-container popUp`},T={class:`cu-license-plate-keyboard-container popUp`},E=(0,n.defineComponent)({name:`cu-license-plate`,__name:`LicensePlate`,props:{shortcuts:{default:()=>`京.津.渝.沪.冀.晋.辽.吉.黑.苏.浙.皖.闽.赣.鲁.豫.鄂.湘.粤.琼.川.贵.云.陕.甘.青.蒙.桂.宁.新.藏`.split(`.`)},modeShow:{default:`division`},showPopUp:{type:Boolean,default:!1},title:{default:`请输入车牌号码`},subtitle:{default:``},defaultValue:{default:``},disorderClick:{type:Boolean,default:!0}},emits:[`confirm`,`hide`,`sd-keyboard`,`hd-keyboard`],setup(r,{emit:i}){let a=r,o=i,s=`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``).map(e=>({value:e,disabled:e===`I`||e===`O`})),c=[1,2,3,4,5,6,7,8,9,0].map(e=>({value:e,disabled:!1})),u=(0,n.ref)([``,``,``,``,``,``,``,``]),d=(0,n.ref)(0),f=(0,n.ref)(!1),p=(0,n.computed)(()=>{let e=[],t;if(d.value===0)t=1;else{t=2;let n=JSON.parse(JSON.stringify(s));n.splice(19,0,{type:`delete`,disabled:!1}),n.push({type:`confirm`,text:`确定`,disabled:!1});let r=c;d.value===1&&(r=c.map(e=>({value:e.value,disabled:!0}))),e=r.concat(n)}return{shortcuts:a.shortcuts,mixedKeyboard:e,keyboardType:t}}),m=(0,n.computed)(()=>u.value.map(e=>e||` `));(0,n.watch)(()=>a.defaultValue,e=>{if(e!==``){let t=e.split(``),n=JSON.parse(JSON.stringify(u.value));n.forEach((e,r)=>{n[r]=t[r]??``}),u.value=n}},{immediate:!0});function h(e){f.value||=!0,!a.disorderClick&&!u.value[e+1]&&!u.value[e-1]&&e>0||(d.value=e)}function g(e){u.value[d.value]=String(e??``),d.value===u.value.length-1?D():d.value+=1}function E(){u.value[d.value]=``,d.value<=0?a.modeShow===`division`&&(f.value=!1):--d.value}function D(){a.modeShow===`division`&&(f.value=!1),o(`confirm`,m.value.join(``))}return(i,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,v,[r.modeShow===`division`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,y,[(0,n.createElementVNode)(`div`,b,[(0,n.createVNode)(l,{"key-array":u.value,"selected-index":d.value,onKeyMapping:h},null,8,[`key-array`,`selected-index`])]),f.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,x,[(0,n.createVNode)(_,{keyboard:p.value,onEnter:g,onDelete:E,onConfirm:D},null,8,[`keyboard`])])):(0,n.createCommentVNode)(``,!0)])):(0,n.createCommentVNode)(``,!0),r.modeShow===`popUp`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,S,[(0,n.createVNode)(e.t,{"model-value":r.showPopUp,"has-mask":!0,position:`bottom`,"mask-closable":!1},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(t.t,{"only-close":``,"large-radius":``,title:r.title,describe:r.subtitle,"title-align":`left`,onCancel:a[0]||=e=>i.$emit(`hide`)},null,8,[`title`,`describe`]),(0,n.createElementVNode)(`div`,C,[(0,n.createElementVNode)(`div`,w,[(0,n.createVNode)(l,{"key-array":u.value,"selected-index":d.value,onKeyMapping:h},null,8,[`key-array`,`selected-index`])]),(0,n.createElementVNode)(`div`,T,[(0,n.createVNode)(_,{keyboard:p.value,onEnter:g,onDelete:E,onConfirm:D},null,8,[`keyboard`])])])]),_:1},8,[`model-value`])])):(0,n.createCommentVNode)(``,!0)]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return E}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Icon-83WWqE5z.cjs");let t=require("vue");var n={class:`cu-notice-bar-right`},r=(0,t.defineComponent)({name:`cu-notice-bar`,__name:`NoticeBar`,props:{mode:{default:``},type:{default:`default`},time:{default:0},round:{type:Boolean,default:!1},multiRows:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},icon:{default:``},iconSvg:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},emits:[`close`],setup(r,{emit:i}){let a=r,o=i,s=(0,t.useSlots)(),c=(0,t.ref)(),l=(0,t.ref)(),u=(0,t.ref)(!0),d=(0,t.ref)(!1),f=(0,t.computed)(()=>!!s.left),p=(0,t.computed)(()=>!!s.right),m=(0,t.computed)(()=>a.mode===`link`?`arrow`:`close`),h=null;function g(e){h&&clearTimeout(h),h=setTimeout(()=>{h=null,u.value=!1},e)}function _(){(a.mode===`closable`||a.closable)&&(u.value=!1),o(`close`)}let v=``;function y(){if(!a.scrollable)return;let e=c.value,t=l.value;if(!e||!t)return;let n=+(window.getComputedStyle(t,null).getPropertyValue(`padding`).split(` `)[3]||`0px`).match(/\d+/g)[0],r=t.scrollWidth-n>Math.ceil(e.getBoundingClientRect().width),i=`${t.scrollWidth}|${n}|${r}`;i!==v&&(v=i,d.value=r)}(0,t.onMounted)(()=>{a.time&&g(a.time),y(),l.value&&typeof MutationObserver<`u`&&(b=new MutationObserver(()=>y()),b.observe(l.value,{childList:!0,subtree:!0,characterData:!0}))}),(0,t.onBeforeUnmount)(()=>{h&&=(clearTimeout(h),null),b?.disconnect(),b=null}),(0,t.watch)(()=>[a.scrollable,a.multiRows],()=>{y()},{flush:`post`});let b=null;return(i,a)=>u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`cu-notice-bar`,[r.round&&`cu-notice-bar-round`,r.type]])},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`cu-notice-bar-left`,[!f.value&&!r.icon&&`cu-notice-bar-empty`]])},[f.value?(0,t.renderSlot)(i.$slots,`left`,{},void 0,void 0,0):r.icon?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:1,class:`cu-notice-icon`,name:r.icon,svg:r.iconSvg},null,8,[`name`,`svg`])):(0,t.createCommentVNode)(``,!0)],2),(0,t.createElementVNode)(`div`,{ref_key:`wrap`,ref:c,class:(0,t.normalizeClass)([`cu-notice-bar-content`,[r.multiRows&&`cu-notice-bar-multi-content`]])},[(0,t.createElementVNode)(`div`,{ref_key:`content`,ref:l,class:(0,t.normalizeClass)([d.value&&r.scrollable&&`cu-notice-bar-content-animate`])},[(0,t.renderSlot)(i.$slots,`default`)],2)],2),(0,t.createElementVNode)(`div`,n,[p.value?(0,t.renderSlot)(i.$slots,`right`,{},void 0,void 0,0):r.mode||r.closable?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:1,class:`cu-notice-icon cu-notice-icon-right`,name:m.value,onClick:(0,t.withModifiers)(_,[`stop`])},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)])],2)):(0,t.createCommentVNode)(``,!0)}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|