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 @@
|
|
|
1
|
+
const e=require("./Icon-jaEPn7d7.cjs"),t=require("./FieldItem-Dkpx5Kxk.cjs"),n=require("./NumberKeyboard-BX0c0l2r.cjs");let r=require("vue"),i=require("@centui/core");function a(e){return e&&(e.selectionStart||e.selectionStart===0)?e.selectionStart:0}var o=null;function s(e,t){e&&(o&&clearTimeout(o),o=setTimeout(()=>{e.setSelectionRange&&(e.focus(),e.setSelectionRange(t,t))},0))}var c=[`type`,`name`,`value`,`placeholder`,`disabled`,`readonly`,`maxlength`],l=[`textContent`],u=[`textContent`],d={key:0,class:`cu-input-item-msg`},f=[`textContent`],p={key:1,class:`cu-input-item-brief`},m=[`textContent`],h=(0,r.defineComponent)({name:`cu-input-item`,__name:`InputItem`,props:{type:{default:`text`},previewType:{default:``},name:{default:void 0},title:{default:``},brief:{default:``},modelValue:{default:``},placeholder:{default:``},maxlength:{default:``},size:{default:`normal`},align:{default:`left`},error:{default:``},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},solid:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},isVirtualKeyboard:{type:Boolean,default:!1},virtualKeyboardDisorder:{type:Boolean,default:!1},virtualKeyboardOkText:{default:void 0},virtualKeyboardVm:{default:null},isTitleLatent:{type:Boolean,default:!1},isFormative:{type:Boolean,default:!1},isHighlight:{type:Boolean,default:!1},isAmount:{type:Boolean,default:!1},formation:{type:Function,default:()=>void 0}},emits:[`update:modelValue`,`change`,`focus`,`blur`,`confirm`,`keyup`,`keydown`],setup(o,{expose:h,emit:g}){let _=o,v=g,y=(0,r.inject)(`rootField`,null),b=(0,r.ref)(),x=(0,r.ref)(),S=_.name??(0,i.randomId)(`input-item`),C=(0,r.ref)(``),w=(0,r.ref)(``),T=(0,r.ref)(null),E=(0,r.ref)(!1),D=(0,r.ref)(!1),O=(0,r.ref)(!1),k=null,A=(0,r.computed)(()=>(O.value?_.previewType:_.type)||`text`),j=(0,r.computed)(()=>{let e=A.value||`text`;return e===`bankCard`||e===`phone`||e===`digit`?e=`tel`:e===`money`&&(e=`text`),e}),M=(0,r.computed)(()=>A.value===`phone`?11:_.maxlength),N=(0,r.computed)(()=>_.isTitleLatent&&P.value?``:_.placeholder),P=(0,r.computed)(()=>!F.value||E.value),F=(0,r.computed)(()=>!C.value.length),I=(0,r.computed)(()=>{let e=A.value;return _.isFormative||e===`bankCard`||e===`phone`||e===`money`||e===`digit`}),L=(0,r.computed)(()=>!!y?.disabled||_.disabled),R=(0,r.computed)(()=>!!ee.value||_.error!==``),z=(0,r.computed)(()=>!!te.value||_.brief!==``),B=(0,r.useSlots)(),ee=(0,r.computed)(()=>!!B.error),te=(0,r.computed)(()=>!!B.brief);(0,r.watch)(()=>_.modelValue,e=>{e!==(0,i.trimValue)(C.value,`\\s|,`)&&(C.value=V(H(`${e}`)).value)}),(0,r.watch)(()=>_.previewType,e=>{O.value=!!e},{immediate:!0}),(0,r.watch)(C,e=>{w.value=e;let t=I.value?(0,i.trimValue)(e,`\\s|,`):e;t!==_.modelValue&&(v(`update:modelValue`,t),v(`change`,S,t))}),(0,r.watch)(E,e=>{if(!_.isVirtualKeyboard||!T.value)return;let t=T.value;e?(t.show?.(),v(`focus`,S)):(t.hide?.(),v(`blur`,S))}),C.value=V(H(`${_.modelValue}`)).value,(0,r.onMounted)(()=>{_.isVirtualKeyboard&&(0,r.nextTick)(()=>{J()})}),(0,r.onBeforeUnmount)(()=>{let e=T.value;e?.$el&&e.$el.parentNode&&e.$el.parentNode.removeChild(e.$el),k&&clearTimeout(k)});function V(e,t=0){let n=A.value,r=C.value,a=r.length>e.length?-1:1,o={value:e,range:t};if(!I.value||e===``)return o;let s=_.formation(S,e,t);if(s)return s;let c=` `;switch(n){case`bankCard`:e=H((0,i.trimValue)(e.replace(/\D/g,``))),o=(0,i.formatValueByGapStep)(4,e,c,`left`,t,a,r);break;case`phone`:e=H((0,i.trimValue)(e.replace(/\D/g,``))),o=(0,i.formatValueByGapRule)(`3|4|4`,e,c,t,a);break;case`money`:{c=`,`,e=H((0,i.trimValue)(e.replace(/[^\d.]/g,``)));let n=e.indexOf(`.`),s=e.split(`.`)[0],l=~n?`.${e.split(`.`)[1]}`:``;o=(0,i.formatValueByGapStep)(3,(0,i.trimValue)(s,c),c,`right`,t,a,r.split(`.`)[0]),o.value+=l;break}case`digit`:e=H((0,i.trimValue)(e.replace(/\D/g,``))),o.value=e}return o}function H(e){let t=M.value;return t!==``&&t!==void 0?e.substring(0,Number(t)):e}function U(){D.value=!0,k&&clearTimeout(k),k=setTimeout(()=>{D.value=!1},500)}function W(){C.value=``,!_.isTitleLatent&&$(),O.value=!1}function G(){W()}function K(){E.value=!0,setTimeout(()=>{document.addEventListener(`click`,q,!1)},0)}function q(){E.value=!1,document.removeEventListener(`click`,q,!1)}function J(){let e=_.virtualKeyboardVm&&typeof _.virtualKeyboardVm==`object`?_.virtualKeyboardVm:x.value;e&&(T.value=e,e.$el&&document.body.appendChild(e.$el))}function Y(e){let t=e.target,n=V(t.value,I.value?a(t):0);C.value=n.value,w.value=n.value,I.value&&(0,r.nextTick)(()=>{s(t,n.range)})}function X(e){v(`keyup`,S,e),(+e.keyCode==13||+e.keyCode==108)&&v(`confirm`,S,C.value)}function Z(e){v(`keydown`,S,e),+e.keyCode!=13&&+e.keyCode!=108&&(U(),O.value&&G())}function ne(){E.value=!0,v(`focus`,S)}function re(){setTimeout(()=>{E.value=!1,v(`blur`,S)},100)}function Q(){L.value||_.readonly||(q(),E.value||K())}function ie(e){O.value&&G(),!(Number(M.value)>0&&(0,i.trimValue)(C.value,`\\s|,`).length>=Number(M.value))&&(C.value=V(C.value+e).value,U())}function ae(){let e=C.value;e!==``&&(C.value=V(e.substring(0,e.length-1)).value,U(),O.value&&G())}function oe(){v(`confirm`,S,C.value)}function $(){_.isVirtualKeyboard?Q():(b.value?.$el.querySelector(`.cu-input-item-input`)?.focus(),setTimeout(()=>{E.value=!0},200))}function se(){_.isVirtualKeyboard?q():b.value?.$el.querySelector(`.cu-input-item-input`)?.blur()}function ce(){return C.value}return h({focus:$,blur:se,getValue:ce}),(i,a)=>((0,r.openBlock)(),(0,r.createBlock)(t.t,{ref_key:`root`,ref:b,class:(0,r.normalizeClass)([`cu-input-item`,[o.isHighlight?`is-highlight`:``,o.isTitleLatent?`is-title-latent`:``,P.value?`is-active`:``,E.value?`is-focus`:``,R.value?`is-error`:``,z.value&&!R.value?`with-brief`:``,L.value?`is-disabled`:``,o.isAmount?`is-amount`:``,o.clearable?`is-clear`:``,o.align,o.size]]),title:o.title,solid:o.solid&&!o.isTitleLatent},{left:(0,r.withCtx)(()=>[(0,r.renderSlot)(i.$slots,`left`)]),right:(0,r.withCtx)(()=>[o.clearable&&!L.value&&!o.readonly?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:`cu-input-item-clear`,onClick:W},[(0,r.createVNode)(e.t,{name:`clear`})],512)),[[r.vShow,!F.value&&E.value]]):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(i.$slots,`right`)]),children:(0,r.withCtx)(()=>[R.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,d,[o.error===``?(0,r.renderSlot)(i.$slots,`error`,{},void 0,void 0,1):((0,r.openBlock)(),(0,r.createElementBlock)(`p`,{key:0,textContent:(0,r.toDisplayString)(o.error)},null,8,f))])):(0,r.createCommentVNode)(``,!0),z.value&&!R.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,p,[o.brief===``?(0,r.renderSlot)(i.$slots,`brief`,{},void 0,void 0,1):((0,r.openBlock)(),(0,r.createElementBlock)(`p`,{key:0,textContent:(0,r.toDisplayString)(o.brief)},null,8,m))])):(0,r.createCommentVNode)(``,!0),o.isVirtualKeyboard&&!o.virtualKeyboardVm?((0,r.openBlock)(),(0,r.createBlock)(n.t,{key:2,ref_key:`numberKeyboard`,ref:x,id:`${(0,r.unref)(S)}-number-keyboard`,class:`cu-input-item-number-keyboard`,"ok-text":o.virtualKeyboardOkText,disorder:o.virtualKeyboardDisorder,onEnter:ie,onDelete:ae,onConfirm:oe},null,8,[`id`,`ok-text`,`disorder`])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[o.isVirtualKeyboard?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:(0,r.normalizeClass)([`cu-input-item-fake`,{"is-focus":E.value,"is-waiting":!D.value,disabled:L.value,readonly:o.readonly}]),onClick:Q},[(0,r.createElementVNode)(`span`,{textContent:(0,r.toDisplayString)(C.value)},null,8,l),C.value===``&&N.value!==``?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:`cu-input-item-fake-placeholder`,textContent:(0,r.toDisplayString)(N.value)},null,8,u)):(0,r.createCommentVNode)(``,!0)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`input`,{key:0,class:`cu-input-item-input`,type:j.value,name:String((0,r.unref)(S)),value:w.value,placeholder:N.value,disabled:L.value,readonly:o.readonly,maxlength:I.value?``:M.value,autocomplete:`off`,onFocus:ne,onBlur:re,onKeyup:X,onKeydown:Z,onInput:Y},null,40,c))]),_:3},8,[`class`,`title`,`solid`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { t as e } from "./Icon-dWGSK6Ou.js";
|
|
2
|
+
import { t } from "./FieldItem-Cc7bw5vU.js";
|
|
3
|
+
import { t as n } from "./NumberKeyboard-C7TRF5iC.js";
|
|
4
|
+
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, inject as ee, nextTick as u, normalizeClass as d, onBeforeUnmount as te, onMounted as ne, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, unref as g, useSlots as re, vShow as ie, watch as _, withCtx as v, withDirectives as ae } from "vue";
|
|
5
|
+
import { formatValueByGapRule as oe, formatValueByGapStep as y, randomId as se, trimValue as b } from "@centui/core";
|
|
6
|
+
//#region src/components/input-item/cursor.ts
|
|
7
|
+
function x(e) {
|
|
8
|
+
return e && (e.selectionStart || e.selectionStart === 0) ? e.selectionStart : 0;
|
|
9
|
+
}
|
|
10
|
+
var S = null;
|
|
11
|
+
function C(e, t) {
|
|
12
|
+
e && (S && clearTimeout(S), S = setTimeout(() => {
|
|
13
|
+
e.setSelectionRange && (e.focus(), e.setSelectionRange(t, t));
|
|
14
|
+
}, 0));
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/input-item/InputItem.vue?vue&type=script&setup=true&lang.ts
|
|
18
|
+
var ce = [
|
|
19
|
+
"type",
|
|
20
|
+
"name",
|
|
21
|
+
"value",
|
|
22
|
+
"placeholder",
|
|
23
|
+
"disabled",
|
|
24
|
+
"readonly",
|
|
25
|
+
"maxlength"
|
|
26
|
+
], le = ["textContent"], ue = ["textContent"], de = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "cu-input-item-msg"
|
|
29
|
+
}, fe = ["textContent"], pe = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "cu-input-item-brief"
|
|
32
|
+
}, me = ["textContent"], w = /* @__PURE__ */ l({
|
|
33
|
+
name: "cu-input-item",
|
|
34
|
+
__name: "InputItem",
|
|
35
|
+
props: {
|
|
36
|
+
type: { default: "text" },
|
|
37
|
+
previewType: { default: "" },
|
|
38
|
+
name: { default: void 0 },
|
|
39
|
+
title: { default: "" },
|
|
40
|
+
brief: { default: "" },
|
|
41
|
+
modelValue: { default: "" },
|
|
42
|
+
placeholder: { default: "" },
|
|
43
|
+
maxlength: { default: "" },
|
|
44
|
+
size: { default: "normal" },
|
|
45
|
+
align: { default: "left" },
|
|
46
|
+
error: { default: "" },
|
|
47
|
+
readonly: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !1
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
solid: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !0
|
|
58
|
+
},
|
|
59
|
+
clearable: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
isVirtualKeyboard: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
},
|
|
67
|
+
virtualKeyboardDisorder: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: !1
|
|
70
|
+
},
|
|
71
|
+
virtualKeyboardOkText: { default: void 0 },
|
|
72
|
+
virtualKeyboardVm: { default: null },
|
|
73
|
+
isTitleLatent: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
isFormative: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
isHighlight: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !1
|
|
84
|
+
},
|
|
85
|
+
isAmount: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: !1
|
|
88
|
+
},
|
|
89
|
+
formation: {
|
|
90
|
+
type: Function,
|
|
91
|
+
default: () => void 0
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
emits: [
|
|
95
|
+
"update:modelValue",
|
|
96
|
+
"change",
|
|
97
|
+
"focus",
|
|
98
|
+
"blur",
|
|
99
|
+
"confirm",
|
|
100
|
+
"keyup",
|
|
101
|
+
"keydown"
|
|
102
|
+
],
|
|
103
|
+
setup(l, { expose: S, emit: w }) {
|
|
104
|
+
let T = l, E = w, he = ee("rootField", null), D = p(), O = p(), k = T.name ?? se("input-item"), A = p(""), j = p(""), M = p(null), N = p(!1), P = p(!1), F = p(!1), I = null, L = r(() => (F.value ? T.previewType : T.type) || "text"), ge = r(() => {
|
|
105
|
+
let e = L.value || "text";
|
|
106
|
+
return e === "bankCard" || e === "phone" || e === "digit" ? e = "tel" : e === "money" && (e = "text"), e;
|
|
107
|
+
}), R = r(() => L.value === "phone" ? 11 : T.maxlength), z = r(() => T.isTitleLatent && B.value ? "" : T.placeholder), B = r(() => !V.value || N.value), V = r(() => !A.value.length), H = r(() => {
|
|
108
|
+
let e = L.value;
|
|
109
|
+
return T.isFormative || e === "bankCard" || e === "phone" || e === "money" || e === "digit";
|
|
110
|
+
}), U = r(() => !!he?.disabled || T.disabled), W = r(() => !!_e.value || T.error !== ""), G = r(() => !!ve.value || T.brief !== ""), K = re(), _e = r(() => !!K.error), ve = r(() => !!K.brief);
|
|
111
|
+
_(() => T.modelValue, (e) => {
|
|
112
|
+
e !== b(A.value, "\\s|,") && (A.value = q(J(`${e}`)).value);
|
|
113
|
+
}), _(() => T.previewType, (e) => {
|
|
114
|
+
F.value = !!e;
|
|
115
|
+
}, { immediate: !0 }), _(A, (e) => {
|
|
116
|
+
j.value = e;
|
|
117
|
+
let t = H.value ? b(e, "\\s|,") : e;
|
|
118
|
+
t !== T.modelValue && (E("update:modelValue", t), E("change", k, t));
|
|
119
|
+
}), _(N, (e) => {
|
|
120
|
+
if (!T.isVirtualKeyboard || !M.value) return;
|
|
121
|
+
let t = M.value;
|
|
122
|
+
e ? (t.show?.(), E("focus", k)) : (t.hide?.(), E("blur", k));
|
|
123
|
+
}), A.value = q(J(`${T.modelValue}`)).value, ne(() => {
|
|
124
|
+
T.isVirtualKeyboard && u(() => {
|
|
125
|
+
be();
|
|
126
|
+
});
|
|
127
|
+
}), te(() => {
|
|
128
|
+
let e = M.value;
|
|
129
|
+
e?.$el && e.$el.parentNode && e.$el.parentNode.removeChild(e.$el), I && clearTimeout(I);
|
|
130
|
+
});
|
|
131
|
+
function q(e, t = 0) {
|
|
132
|
+
let n = L.value, r = A.value, i = r.length > e.length ? -1 : 1, a = {
|
|
133
|
+
value: e,
|
|
134
|
+
range: t
|
|
135
|
+
};
|
|
136
|
+
if (!H.value || e === "") return a;
|
|
137
|
+
let o = T.formation(k, e, t);
|
|
138
|
+
if (o) return o;
|
|
139
|
+
let s = " ";
|
|
140
|
+
switch (n) {
|
|
141
|
+
case "bankCard":
|
|
142
|
+
e = J(b(e.replace(/\D/g, ""))), a = y(4, e, s, "left", t, i, r);
|
|
143
|
+
break;
|
|
144
|
+
case "phone":
|
|
145
|
+
e = J(b(e.replace(/\D/g, ""))), a = oe("3|4|4", e, s, t, i);
|
|
146
|
+
break;
|
|
147
|
+
case "money": {
|
|
148
|
+
s = ",", e = J(b(e.replace(/[^\d.]/g, "")));
|
|
149
|
+
let n = e.indexOf("."), o = e.split(".")[0], c = ~n ? `.${e.split(".")[1]}` : "";
|
|
150
|
+
a = y(3, b(o, s), s, "right", t, i, r.split(".")[0]), a.value += c;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case "digit": e = J(b(e.replace(/\D/g, ""))), a.value = e;
|
|
154
|
+
}
|
|
155
|
+
return a;
|
|
156
|
+
}
|
|
157
|
+
function J(e) {
|
|
158
|
+
let t = R.value;
|
|
159
|
+
return t !== "" && t !== void 0 ? e.substring(0, Number(t)) : e;
|
|
160
|
+
}
|
|
161
|
+
function Y() {
|
|
162
|
+
P.value = !0, I && clearTimeout(I), I = setTimeout(() => {
|
|
163
|
+
P.value = !1;
|
|
164
|
+
}, 500);
|
|
165
|
+
}
|
|
166
|
+
function X() {
|
|
167
|
+
A.value = "", !T.isTitleLatent && $(), F.value = !1;
|
|
168
|
+
}
|
|
169
|
+
function Z() {
|
|
170
|
+
X();
|
|
171
|
+
}
|
|
172
|
+
function ye() {
|
|
173
|
+
N.value = !0, setTimeout(() => {
|
|
174
|
+
document.addEventListener("click", Q, !1);
|
|
175
|
+
}, 0);
|
|
176
|
+
}
|
|
177
|
+
function Q() {
|
|
178
|
+
N.value = !1, document.removeEventListener("click", Q, !1);
|
|
179
|
+
}
|
|
180
|
+
function be() {
|
|
181
|
+
let e = T.virtualKeyboardVm && typeof T.virtualKeyboardVm == "object" ? T.virtualKeyboardVm : O.value;
|
|
182
|
+
e && (M.value = e, e.$el && document.body.appendChild(e.$el));
|
|
183
|
+
}
|
|
184
|
+
function xe(e) {
|
|
185
|
+
let t = e.target, n = q(t.value, H.value ? x(t) : 0);
|
|
186
|
+
A.value = n.value, j.value = n.value, H.value && u(() => {
|
|
187
|
+
C(t, n.range);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function Se(e) {
|
|
191
|
+
E("keyup", k, e), (+e.keyCode == 13 || +e.keyCode == 108) && E("confirm", k, A.value);
|
|
192
|
+
}
|
|
193
|
+
function Ce(e) {
|
|
194
|
+
E("keydown", k, e), +e.keyCode != 13 && +e.keyCode != 108 && (Y(), F.value && Z());
|
|
195
|
+
}
|
|
196
|
+
function we() {
|
|
197
|
+
N.value = !0, E("focus", k);
|
|
198
|
+
}
|
|
199
|
+
function Te() {
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
N.value = !1, E("blur", k);
|
|
202
|
+
}, 100);
|
|
203
|
+
}
|
|
204
|
+
function Ee() {
|
|
205
|
+
U.value || T.readonly || (Q(), N.value || ye());
|
|
206
|
+
}
|
|
207
|
+
function De(e) {
|
|
208
|
+
F.value && Z(), !(Number(R.value) > 0 && b(A.value, "\\s|,").length >= Number(R.value)) && (A.value = q(A.value + e).value, Y());
|
|
209
|
+
}
|
|
210
|
+
function Oe() {
|
|
211
|
+
let e = A.value;
|
|
212
|
+
e !== "" && (A.value = q(e.substring(0, e.length - 1)).value, Y(), F.value && Z());
|
|
213
|
+
}
|
|
214
|
+
function ke() {
|
|
215
|
+
E("confirm", k, A.value);
|
|
216
|
+
}
|
|
217
|
+
function $() {
|
|
218
|
+
T.isVirtualKeyboard ? Ee() : (D.value?.$el.querySelector(".cu-input-item-input")?.focus(), setTimeout(() => {
|
|
219
|
+
N.value = !0;
|
|
220
|
+
}, 200));
|
|
221
|
+
}
|
|
222
|
+
function Ae() {
|
|
223
|
+
T.isVirtualKeyboard ? Q() : D.value?.$el.querySelector(".cu-input-item-input")?.blur();
|
|
224
|
+
}
|
|
225
|
+
function je() {
|
|
226
|
+
return A.value;
|
|
227
|
+
}
|
|
228
|
+
return S({
|
|
229
|
+
focus: $,
|
|
230
|
+
blur: Ae,
|
|
231
|
+
getValue: je
|
|
232
|
+
}), (r, ee) => (f(), i(t, {
|
|
233
|
+
ref_key: "root",
|
|
234
|
+
ref: D,
|
|
235
|
+
class: d(["cu-input-item", [
|
|
236
|
+
l.isHighlight ? "is-highlight" : "",
|
|
237
|
+
l.isTitleLatent ? "is-title-latent" : "",
|
|
238
|
+
B.value ? "is-active" : "",
|
|
239
|
+
N.value ? "is-focus" : "",
|
|
240
|
+
W.value ? "is-error" : "",
|
|
241
|
+
G.value && !W.value ? "with-brief" : "",
|
|
242
|
+
U.value ? "is-disabled" : "",
|
|
243
|
+
l.isAmount ? "is-amount" : "",
|
|
244
|
+
l.clearable ? "is-clear" : "",
|
|
245
|
+
l.align,
|
|
246
|
+
l.size
|
|
247
|
+
]]),
|
|
248
|
+
title: l.title,
|
|
249
|
+
solid: l.solid && !l.isTitleLatent
|
|
250
|
+
}, {
|
|
251
|
+
left: v(() => [m(r.$slots, "left")]),
|
|
252
|
+
right: v(() => [l.clearable && !U.value && !l.readonly ? ae((f(), o("div", {
|
|
253
|
+
key: 0,
|
|
254
|
+
class: "cu-input-item-clear",
|
|
255
|
+
onClick: X
|
|
256
|
+
}, [c(e, { name: "clear" })], 512)), [[ie, !V.value && N.value]]) : a("", !0), m(r.$slots, "right")]),
|
|
257
|
+
children: v(() => [
|
|
258
|
+
W.value ? (f(), o("div", de, [l.error === "" ? m(r.$slots, "error", {}, void 0, void 0, 1) : (f(), o("p", {
|
|
259
|
+
key: 0,
|
|
260
|
+
textContent: h(l.error)
|
|
261
|
+
}, null, 8, fe))])) : a("", !0),
|
|
262
|
+
G.value && !W.value ? (f(), o("div", pe, [l.brief === "" ? m(r.$slots, "brief", {}, void 0, void 0, 1) : (f(), o("p", {
|
|
263
|
+
key: 0,
|
|
264
|
+
textContent: h(l.brief)
|
|
265
|
+
}, null, 8, me))])) : a("", !0),
|
|
266
|
+
l.isVirtualKeyboard && !l.virtualKeyboardVm ? (f(), i(n, {
|
|
267
|
+
key: 2,
|
|
268
|
+
ref_key: "numberKeyboard",
|
|
269
|
+
ref: O,
|
|
270
|
+
id: `${g(k)}-number-keyboard`,
|
|
271
|
+
class: "cu-input-item-number-keyboard",
|
|
272
|
+
"ok-text": l.virtualKeyboardOkText,
|
|
273
|
+
disorder: l.virtualKeyboardDisorder,
|
|
274
|
+
onEnter: De,
|
|
275
|
+
onDelete: Oe,
|
|
276
|
+
onConfirm: ke
|
|
277
|
+
}, null, 8, [
|
|
278
|
+
"id",
|
|
279
|
+
"ok-text",
|
|
280
|
+
"disorder"
|
|
281
|
+
])) : a("", !0)
|
|
282
|
+
]),
|
|
283
|
+
default: v(() => [l.isVirtualKeyboard ? (f(), o("div", {
|
|
284
|
+
key: 1,
|
|
285
|
+
class: d(["cu-input-item-fake", {
|
|
286
|
+
"is-focus": N.value,
|
|
287
|
+
"is-waiting": !P.value,
|
|
288
|
+
disabled: U.value,
|
|
289
|
+
readonly: l.readonly
|
|
290
|
+
}]),
|
|
291
|
+
onClick: Ee
|
|
292
|
+
}, [s("span", { textContent: h(A.value) }, null, 8, le), A.value === "" && z.value !== "" ? (f(), o("span", {
|
|
293
|
+
key: 0,
|
|
294
|
+
class: "cu-input-item-fake-placeholder",
|
|
295
|
+
textContent: h(z.value)
|
|
296
|
+
}, null, 8, ue)) : a("", !0)], 2)) : (f(), o("input", {
|
|
297
|
+
key: 0,
|
|
298
|
+
class: "cu-input-item-input",
|
|
299
|
+
type: ge.value,
|
|
300
|
+
name: String(g(k)),
|
|
301
|
+
value: j.value,
|
|
302
|
+
placeholder: z.value,
|
|
303
|
+
disabled: U.value,
|
|
304
|
+
readonly: l.readonly,
|
|
305
|
+
maxlength: H.value ? "" : R.value,
|
|
306
|
+
autocomplete: "off",
|
|
307
|
+
onFocus: we,
|
|
308
|
+
onBlur: Te,
|
|
309
|
+
onKeyup: Se,
|
|
310
|
+
onKeydown: Ce,
|
|
311
|
+
onInput: xe
|
|
312
|
+
}, null, 40, ce))]),
|
|
313
|
+
_: 3
|
|
314
|
+
}, 8, [
|
|
315
|
+
"class",
|
|
316
|
+
"title",
|
|
317
|
+
"solid"
|
|
318
|
+
]));
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
//#endregion
|
|
322
|
+
export { x as n, C as r, w as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Icon-jaEPn7d7.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`);function h(e){setTimeout(()=>{u.value=!1},e)}function g(){(a.mode===`closable`||a.closable)&&(u.value=!1),o(`close`)}function _(){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];d.value=t.scrollWidth-n>Math.ceil(e.getBoundingClientRect().width)}return(0,t.onMounted)(()=>{a.time&&h(a.time),_()}),(0,t.onUpdated)(()=>{_()}),(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)(g,[`stop`])},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)])],2)):(0,t.createCommentVNode)(``,!0)}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { t as e } from "./Icon-dWGSK6Ou.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, onMounted as c, onUpdated as l, openBlock as u, ref as d, renderSlot as f, useSlots as p, withModifiers as m } from "vue";
|
|
3
|
+
//#region src/components/notice-bar/NoticeBar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var h = { class: "cu-notice-bar-right" }, g = /* @__PURE__ */ o({
|
|
5
|
+
name: "cu-notice-bar",
|
|
6
|
+
__name: "NoticeBar",
|
|
7
|
+
props: {
|
|
8
|
+
mode: { default: "" },
|
|
9
|
+
type: { default: "default" },
|
|
10
|
+
time: { default: 0 },
|
|
11
|
+
round: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
multiRows: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
scrollable: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
icon: { default: "" },
|
|
24
|
+
iconSvg: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
closable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["close"],
|
|
34
|
+
setup(o, { emit: g }) {
|
|
35
|
+
let _ = o, v = g, y = p(), b = d(), x = d(), S = d(!0), C = d(!1), w = t(() => !!y.left), T = t(() => !!y.right), E = t(() => _.mode === "link" ? "arrow" : "close");
|
|
36
|
+
function D(e) {
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
S.value = !1;
|
|
39
|
+
}, e);
|
|
40
|
+
}
|
|
41
|
+
function O() {
|
|
42
|
+
(_.mode === "closable" || _.closable) && (S.value = !1), v("close");
|
|
43
|
+
}
|
|
44
|
+
function k() {
|
|
45
|
+
if (!_.scrollable) return;
|
|
46
|
+
let e = b.value, t = x.value;
|
|
47
|
+
if (!e || !t) return;
|
|
48
|
+
let n = +(window.getComputedStyle(t, null).getPropertyValue("padding").split(" ")[3] || "0px").match(/\d+/g)[0];
|
|
49
|
+
C.value = t.scrollWidth - n > Math.ceil(e.getBoundingClientRect().width);
|
|
50
|
+
}
|
|
51
|
+
return c(() => {
|
|
52
|
+
_.time && D(_.time), k();
|
|
53
|
+
}), l(() => {
|
|
54
|
+
k();
|
|
55
|
+
}), (t, c) => S.value ? (u(), i("div", {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: s(["cu-notice-bar", [o.round && "cu-notice-bar-round", o.type]])
|
|
58
|
+
}, [
|
|
59
|
+
a("div", { class: s(["cu-notice-bar-left", [!w.value && !o.icon && "cu-notice-bar-empty"]]) }, [w.value ? f(t.$slots, "left", {}, void 0, void 0, 0) : o.icon ? (u(), n(e, {
|
|
60
|
+
key: 1,
|
|
61
|
+
class: "cu-notice-icon",
|
|
62
|
+
name: o.icon,
|
|
63
|
+
svg: o.iconSvg
|
|
64
|
+
}, null, 8, ["name", "svg"])) : r("", !0)], 2),
|
|
65
|
+
a("div", {
|
|
66
|
+
ref_key: "wrap",
|
|
67
|
+
ref: b,
|
|
68
|
+
class: s(["cu-notice-bar-content", [o.multiRows && "cu-notice-bar-multi-content"]])
|
|
69
|
+
}, [a("div", {
|
|
70
|
+
ref_key: "content",
|
|
71
|
+
ref: x,
|
|
72
|
+
class: s([C.value && o.scrollable && "cu-notice-bar-content-animate"])
|
|
73
|
+
}, [f(t.$slots, "default")], 2)], 2),
|
|
74
|
+
a("div", h, [T.value ? f(t.$slots, "right", {}, void 0, void 0, 0) : o.mode || o.closable ? (u(), n(e, {
|
|
75
|
+
key: 1,
|
|
76
|
+
class: "cu-notice-icon cu-notice-icon-right",
|
|
77
|
+
name: E.value,
|
|
78
|
+
onClick: m(O, ["stop"])
|
|
79
|
+
}, null, 8, ["name"])) : r("", !0)])
|
|
80
|
+
], 2)) : r("", !0);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
//#endregion
|
|
84
|
+
export { g as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./Popup-Cm4BuaOo.cjs");let t=require("vue"),n=require("@centui/core");var r=[`textContent`],i=[`textContent`],a=(0,t.defineComponent)({name:`cu-number-key`,__name:`KeyboardKey`,props:{value:{default:``},noTouch:{type:Boolean,default:!1},noPrevent:{type:Boolean,default:!1}},emits:[`press`],setup(e,{emit:n}){let a=e,o=n,s=(0,t.ref)(!1),c=(0,t.ref)(``);function l(e,t){a.noPrevent||(e.preventDefault(),e.stopImmediatePropagation()),!(c.value&&c.value!==t)&&(c.value=t,a.noTouch||(s.value=!0),o(`press`,a.value))}function u(){s.value=!1}return(n,a)=>e.noTouch?((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:0,class:(0,t.normalizeClass)([s.value?`active`:``]),onClick:a[0]||=e=>l(e,`click`)},[(0,t.createElementVNode)(`span`,{textContent:(0,t.toDisplayString)(e.value)},null,8,r)],2)):((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:1,class:(0,t.normalizeClass)([s.value?`active`:``]),onTouchstart:a[1]||=e=>l(e,`touch`),onTouchmove:u,onTouchend:u,onTouchcancel:u,onClick:a[2]||=e=>l(e,`click`)},[(0,t.createElementVNode)(`span`,{textContent:(0,t.toDisplayString)(e.value)},null,8,i)],34))}}),o={class:`keyboard-number`},s={class:`keyboard-number-list`},c={key:0,class:`keyboard-number-item`},l={key:0,class:`keyboard-operate`},u={class:`keyboard-operate-list`},d=(0,t.defineComponent)({name:`cu-number-keyboard-container`,__name:`KeyboardBoard`,props:{type:{default:`professional`},disorder:{type:Boolean,default:!1},hideDot:{type:Boolean,default:!1},okText:{default:void 0},isView:{type:Boolean,default:!1},textRender:{type:Function,default:()=>void 0},disabled:{type:Boolean,default:!1},duplicateZero:{type:Boolean,default:!1}},emits:[`enter`,`delete`,`confirm`,`hide`],setup(e,{emit:r}){let i=e,d=r,f=i.okText??(0,n.t)(`md.number_keyboard.confirm`),p=(0,t.ref)([]),m=(0,t.computed)(()=>i.textRender(`.`)||`.`),h=(0,t.computed)(()=>i.textRender(`00`)||`00`),g=(0,t.computed)(()=>i.textRender(`0`)||`0`);_();function _(){let e=[1,2,3,4,5,6,7,8,9,0],t=[...e];p.value=e.map(e=>{let n=i.disorder?t.splice(parseInt(`${Math.random()*t.length}`),1)[0]??0:e;return i.textRender(n)||n})}function v(e){i.disabled||d(`enter`,e)}function y(){i.disabled||d(`delete`)}function b(){i.disabled||d(`confirm`)}function x(){d(`hide`)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`cu-number-keyboard-container`,[e.type,e.disabled?`disabled`:``]])},[(0,t.createElementVNode)(`div`,o,[(0,t.createElementVNode)(`ul`,s,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(9,e=>(0,t.createVNode)(a,{key:e-1,class:`keyboard-number-item`,value:p.value[e-1],onPress:v},null,8,[`value`])),64)),e.type===`professional`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.hideDot?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(a,{key:0,class:`keyboard-number-item`,value:e.duplicateZero?g.value:m.value,onPress:v},null,8,[`value`])),(0,t.createVNode)(a,{class:(0,t.normalizeClass)([`keyboard-number-item`,{"large-item":e.hideDot}]),value:e.duplicateZero?h.value:p.value[9],onPress:v},null,8,[`class`,`value`]),e.duplicateZero?((0,t.openBlock)(),(0,t.createBlock)(a,{key:1,class:`keyboard-number-item`,value:m.value,onPress:v},null,8,[`value`])):(0,t.createCommentVNode)(``,!0),e.duplicateZero?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[e.isView?((0,t.openBlock)(),(0,t.createElementBlock)(`li`,c)):((0,t.openBlock)(),(0,t.createBlock)(a,{key:1,class:`keyboard-number-item slidedown`,"no-touch":``,"no-prevent":``,onPress:x}))],64))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[r[0]||=(0,t.createElementVNode)(`li`,{class:`keyboard-number-item no-bg`},null,-1),(0,t.createVNode)(a,{class:`keyboard-number-item`,value:p.value[9],onPress:v},null,8,[`value`]),(0,t.createVNode)(a,{class:`keyboard-number-item no-bg delete`,onPress:y})],64))])]),e.type===`professional`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,l,[(0,t.createElementVNode)(`ul`,u,[(0,t.createVNode)(a,{class:`keyboard-operate-item delete`,onPress:y}),(0,t.createVNode)(a,{class:`keyboard-operate-item confirm`,value:(0,t.unref)(f),"no-touch":``,"no-prevent":``,onPress:b},null,8,[`value`])])])):(0,t.createCommentVNode)(``,!0)],2))}}),f={key:0,class:`cu-number-keyboard-slot`},p={key:0,class:`cu-number-keyboard-slot`},m=(0,t.defineComponent)({name:`cu-number-keyboard`,__name:`NumberKeyboard`,props:{modelValue:{type:Boolean,default:!1},type:{default:void 0},isView:{type:Boolean,default:!1},hideDot:{type:Boolean,default:!1},disorder:{type:Boolean,default:!1},isHideConfirm:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},okText:{default:void 0},textRender:{type:Function,default:void 0},duplicateZero:{type:Boolean,default:!1}},emits:[`update:modelValue`,`enter`,`delete`,`confirm`,`show`,`hide`],setup(n,{expose:r,emit:i}){let a=n,o=i,s=(0,t.ref)(),c=(0,t.ref)(!1);(0,t.watch)(()=>a.modelValue,e=>{c.value=e}),(0,t.watch)(c,e=>{o(`update:modelValue`,e)}),(0,t.onMounted)(()=>{a.modelValue&&(c.value=a.modelValue)});function l(e){c.value=e}function u(e){o(`enter`,e)}function m(){o(`delete`)}function h(){o(`confirm`),a.isHideConfirm&&_()}function g(){c.value=!0}function _(){c.value=!1}return r({show:g,hide:_,$el:s}),(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`root`,ref:s,class:(0,t.normalizeClass)([`cu-number-keyboard`,{"in-view":n.isView}])},[n.isView?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[r.$slots.default?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,f,[(0,t.renderSlot)(r.$slots,`default`)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(d,{ref:`keyboard`,type:n.type,disorder:n.disorder,"ok-text":n.okText,"is-view":n.isView,"hide-dot":n.hideDot,"text-render":n.textRender,disabled:n.disabled,"duplicate-zero":n.duplicateZero,onEnter:u,onDelete:m,onConfirm:h,onHide:i[0]||=e=>c.value=!1},null,8,[`type`,`disorder`,`ok-text`,`is-view`,`hide-dot`,`text-render`,`disabled`,`duplicate-zero`])],64)):((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:1,"model-value":c.value,position:`bottom`,"has-mask":!1,"onUpdate:modelValue":l,onShow:i[3]||=e=>o(`show`),onHide:i[4]||=e=>o(`hide`)},{default:(0,t.withCtx)(()=>[r.$slots.default?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,p,[(0,t.renderSlot)(r.$slots,`default`)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(d,{ref:`keyboard`,type:n.type,disorder:n.disorder,"ok-text":n.okText,"is-view":n.isView,"hide-dot":n.hideDot,"text-render":n.textRender,disabled:n.disabled,"duplicate-zero":n.duplicateZero,onEnter:u,onDelete:m,onConfirm:h,onHide:i[1]||=e=>c.value=!1,onTouchmove:i[2]||=(0,t.withModifiers)(()=>{},[`prevent`])},null,8,[`type`,`disorder`,`ok-text`,`is-view`,`hide-dot`,`text-render`,`disabled`,`duplicate-zero`])]),_:3},8,[`model-value`]))],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});
|