@cldemo/ui-kit 1.1.3 → 1.1.4
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/buildLibs/all/index.cjs +8 -8
- package/buildLibs/all/index.js +12157 -12048
- package/buildLibs/common/globalConfig.cjs +1 -1
- package/buildLibs/common/globalConfig.js +29 -15
- package/buildLibs/common/i18n/en.cjs +1 -1
- package/buildLibs/common/i18n/en.js +3 -1
- package/buildLibs/common/i18n/zh_CN.cjs +1 -1
- package/buildLibs/common/i18n/zh_CN.js +3 -1
- package/buildLibs/common/index.cjs +1 -1
- package/buildLibs/common/index.js +26 -24
- package/buildLibs/mobile/index.cjs +5 -5
- package/buildLibs/mobile/index.js +5902 -5852
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-CKoVf-v1.js → Index.vue_vue_type_script_setup_true_lang-88gNFuK4.js} +2 -2
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-BQXxDHbe.js +254 -0
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-D0g1xGPL.js → Index.vue_vue_type_script_setup_true_lang-BR0S3Sfl.js} +3 -3
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-RRUPY9bd.js → Index.vue_vue_type_script_setup_true_lang-BrfAVhNV.js} +153 -145
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-DdLVG0R0.js → Index.vue_vue_type_script_setup_true_lang-Bw_jRoEX.js} +67 -59
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-C6Zd584S.js +2536 -0
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-BOcOO9-n.js → Index.vue_vue_type_script_setup_true_lang-CD66oCaI.js} +386 -375
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-CEBiLDTm.js +310 -0
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-C0DgaU5I.js → Index.vue_vue_type_script_setup_true_lang-CRlBvcCg.js} +53 -47
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-DqZBB8fM.js → Index.vue_vue_type_script_setup_true_lang-CdYh3Pzs.js} +1 -1
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-XiSSYx4X.js → Index.vue_vue_type_script_setup_true_lang-D7YeNBdk.js} +120 -113
- package/buildLibs/{utils/Shared/Index.vue_vue_type_script_setup_true_lang-DKMVQrVU.js → modules/shared/Index.vue_vue_type_script_setup_true_lang-D9sq4n9i.js} +66 -60
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-CRKrLCa6.js → Index.vue_vue_type_script_setup_true_lang-DFeBj9IN.js} +209 -201
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-D7bJ5UAn.js → Index.vue_vue_type_script_setup_true_lang-DY3tZQZe.js} +63 -55
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-D_73B6av.js +1533 -0
- package/buildLibs/modules/shared/{Validate.vue_vue_type_script_setup_true_lang-3s_3ut9M.js → Validate.vue_vue_type_script_setup_true_lang-hn1Tat7L.js} +102 -92
- package/buildLibs/types/All/index.d.ts +1 -1
- package/buildLibs/types/Common/globalConfig.d.ts +29 -0
- package/buildLibs/types/Common/globalTypes.d.ts +11 -0
- package/buildLibs/types/Common/i18n/en.d.ts +2 -0
- package/buildLibs/types/Common/i18n/zh_CN.d.ts +2 -0
- package/buildLibs/types/Common/index.d.ts +1 -1
- package/buildLibs/types/Element/CheckBox/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/Input/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/InputNumber/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/InputNumberStepper/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/InputTextarea/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/Radio/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/DateTime/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/FileUpload/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/Select/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectCascade/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectMove/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectTag/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectTree/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/Tree/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/componentsInstalls.d.ts +90 -0
- package/buildLibs/utils/Element/ClCheckbox.cjs +1 -1
- package/buildLibs/utils/Element/ClCheckbox.js +1 -1
- package/buildLibs/utils/Element/ClInput.cjs +1 -1
- package/buildLibs/utils/Element/ClInput.js +1 -1
- package/buildLibs/utils/Element/ClInputCaptcha.cjs +1 -1
- package/buildLibs/utils/Element/ClInputCaptcha.js +1 -1
- package/buildLibs/utils/Element/ClInputNumber.cjs +1 -1
- package/buildLibs/utils/Element/ClInputNumber.js +1 -1
- package/buildLibs/utils/Element/ClInputNumberStepper.cjs +1 -1
- package/buildLibs/utils/Element/ClInputNumberStepper.js +1 -1
- package/buildLibs/utils/Element/ClInputPassword.cjs +1 -1
- package/buildLibs/utils/Element/ClInputPassword.js +1 -1
- package/buildLibs/utils/Element/ClInputSearch.cjs +1 -1
- package/buildLibs/utils/Element/ClInputSearch.js +1 -1
- package/buildLibs/utils/Element/ClInputTextarea.cjs +1 -1
- package/buildLibs/utils/Element/ClInputTextarea.js +1 -1
- package/buildLibs/utils/Element/ClRadio.cjs +1 -1
- package/buildLibs/utils/Element/ClRadio.js +1 -1
- package/buildLibs/utils/Element/__provide__/Validate.cjs +1 -1
- package/buildLibs/utils/Element/__provide__/Validate.js +13 -3
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C1OgPpoJ.js → Index.vue_vue_type_script_setup_true_lang-0S6ab-Lp.js} +120 -113
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-neC9NxKi.js → Index.vue_vue_type_script_setup_true_lang-2Fe9SkjL.js} +209 -201
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-2THK822S.js +254 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BO4cal3i.js → Index.vue_vue_type_script_setup_true_lang-2dwwjiTV.js} +386 -375
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-5itnjwU_.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-ChnRq_PS.js → Index.vue_vue_type_script_setup_true_lang-B0MJO0JM.js} +2 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BIO6Me43.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BN9ybiKv.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BpG7AHvM.js +1 -0
- package/buildLibs/{modules/shared/Index.vue_vue_type_script_setup_true_lang-CAe8mhTl.js → utils/Shared/Index.vue_vue_type_script_setup_true_lang-CATwJnes.js} +66 -60
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CW4fM0by.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DxYJbPyJ.js → Index.vue_vue_type_script_setup_true_lang-C_exHzjc.js} +3 -3
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CsCn637u.js +2 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D_XMW7K4.js → Index.vue_vue_type_script_setup_true_lang-D4a5Iaue.js} +153 -145
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DXPZYc0c.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DY4m6Xyj.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DZCt32jb.js +1533 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DZF2gj7X.js +2536 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-De1eNjwC.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C6Evk0-z.js → Index.vue_vue_type_script_setup_true_lang-DtAy8lm9.js} +53 -47
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DvN-fBNd.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DwBf338f.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Cg_benGj.js → Index.vue_vue_type_script_setup_true_lang-F9tBnc_7.js} +63 -55
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-HfnOtuMz.js +310 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dwkuei2j.js → Index.vue_vue_type_script_setup_true_lang-VjIva6RM.js} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-j7gxlOeM.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CgdGs-U2.js → Index.vue_vue_type_script_setup_true_lang-lKDQFZtY.js} +67 -59
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dzm58mMQ.js → Index.vue_vue_type_script_setup_true_lang-nAMiORzN.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CizRrQsH.js → Index.vue_vue_type_script_setup_true_lang-oovIcT38.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BIFHYrzc.js → Index.vue_vue_type_script_setup_true_lang-qqnmaRnk.js} +1 -1
- package/buildLibs/utils/Web/ClColorPicker.cjs +1 -1
- package/buildLibs/utils/Web/ClColorPicker.js +1 -1
- package/buildLibs/utils/Web/ClCropperPreview.cjs +1 -1
- package/buildLibs/utils/Web/ClCropperPreview.js +1 -1
- package/buildLibs/utils/Web/ClDateTime.cjs +1 -1
- package/buildLibs/utils/Web/ClDateTime.js +1 -1
- package/buildLibs/utils/Web/ClFileUpload.cjs +1 -1
- package/buildLibs/utils/Web/ClFileUpload.js +1 -1
- package/buildLibs/utils/Web/ClInputTag.cjs +1 -1
- package/buildLibs/utils/Web/ClInputTag.js +1 -1
- package/buildLibs/utils/Web/ClPaginate.cjs +1 -1
- package/buildLibs/utils/Web/ClPaginate.js +1 -1
- package/buildLibs/utils/Web/ClSelect.cjs +1 -1
- package/buildLibs/utils/Web/ClSelect.js +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.js +1 -1
- package/buildLibs/utils/Web/ClSelectMove.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectMove.js +655 -647
- package/buildLibs/utils/Web/ClSelectTag.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTag.js +1 -1
- package/buildLibs/utils/Web/ClSelectTree.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTree.js +71 -63
- package/buildLibs/utils/Web/ClTable.cjs +1 -1
- package/buildLibs/utils/Web/ClTable.js +1 -1
- package/buildLibs/utils/Web/ClTree.cjs +1 -1
- package/buildLibs/utils/Web/ClTree.js +1 -1
- package/buildLibs/utils/Web/ClXEditable.cjs +1 -1
- package/buildLibs/utils/Web/ClXEditable.js +10 -10
- package/buildLibs/web/index.cjs +7 -7
- package/buildLibs/web/index.js +10792 -10685
- package/docs/components/Element/Checkbox.md +2 -1
- package/docs/components/Element/Form.md +15 -0
- package/docs/components/Element/Input.md +2 -1
- package/docs/components/Element/InputNumber.md +2 -1
- package/docs/components/Element/InputNumberStepper.md +2 -1
- package/docs/components/Element/InputTextarea.md +2 -1
- package/docs/components/Element/Radio.md +2 -1
- package/docs/components/Web/DateTime.md +2 -1
- package/docs/components/Web/FileUpload.md +2 -1
- package/docs/components/Web/Select.md +2 -1
- package/docs/components/Web/SelectCascade.md +1 -0
- package/docs/components/Web/SelectMove.md +2 -1
- package/docs/components/Web/SelectTag.md +1 -0
- package/docs/components/Web/SelectTree.md +2 -1
- package/docs/components/Web/Tree.md +2 -1
- package/package.json +1 -1
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-CiNidFJt.js +0 -246
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-DC6727pS.js +0 -2528
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-EXqjkKwS.js +0 -302
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-Hg16dgRQ.js +0 -1527
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-5aX79Fcf.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BRvOcf4B.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-Ba8Z8fOP.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BjNP5odR.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CQ3RGLek.js +0 -302
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CYN4r-Mx.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-C_7ArHlU.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CuJjJvft.js +0 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CwjigRBx.js +0 -2528
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-D6cmq0Tf.js +0 -1527
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-Dbf-3Nik.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DgD_gHit.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-FowII7_3.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-c7oxeU_j.js +0 -246
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-vLqCsSbV.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var Ie=Object.create;var Se=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var xe=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var Te=(c,O,L,r)=>{if(O&&typeof O=="object"||typeof O=="function")for(let s of ke(O))!_e.call(c,s)&&s!==L&&Se(c,s,{get:()=>O[s],enumerable:!(r=Ee(O,s))||r.enumerable});return c};var we=(c,O,L)=>(L=c!=null?Ie(xe(c)):{},Te(O||!c||!c.__esModule?Se(L,"default",{value:c,enumerable:!0}):L,c));const t=require("vue"),j=require("@cldemo/ui-kit/common/log"),n=require("@cldemo/ui-kit/common/base"),R=require("@cldemo/ui-kit/common/Element"),Be=require("./Index.vue_vue_type_script_setup_true_lang-BPTL5eCB.js"),Ve=require("./List.vue_vue_type_script_setup_true_lang-CFCST05R.js"),Me=require("./Index.vue_vue_type_script_setup_true_lang-BIFHYrzc.js"),Ce=require("./One.vue_vue_type_script_setup_true_lang-D9zWNf0s.js"),De=require("./language-BJ4aVgHI.js"),Le=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),Oe=require("./Index.vue_vue_type_script_setup_true_lang-CYFgnd30.js");;/* empty css */const Fe=["id"],Pe={key:0,class:"select-inDropdown-search",role:"search","aria-label":"搜索选项"},Ae={key:2,class:"select-inDropdown-checkboxAll"},Ke=["aria-selected","aria-disabled","onClick"],Ne={class:"select-inDropdown-item-inner"},Re={key:0,class:"select-inDropdown-checkbox"},$e=["innerHTML"],qe={key:5,class:"select-inDropdown-body"},He={class:"select-inDropdown-empty"},ve=35,Je=210,je=20,We=t.defineComponent({name:"ClSelectInDropdown",__name:"Dropdown",props:{id:String,disabled:{type:Boolean,default:!1},isSearch:{type:Boolean,default:!1},searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},isMultiple:{type:Boolean,default:!1},isCheckBoxAll:{type:Boolean,default:!0},showDropDownTextFormat:String,showDropDownTextFormatSub:String,isCascade:{type:Boolean,default:!1},parentSelectable:{type:Boolean,default:!1},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"},originalData:{type:Array,default:()=>[]},keyIndex:String,isOpen:{type:Boolean,default:!1},selectId:{type:Array,default:()=>[]},serverCallback:Function},emits:{onChange:c=>!0,onInitComplete:()=>!0,onError:c=>!0},setup(c,{expose:O,emit:L}){const r=t.defineAsyncComponent(()=>import("vue-virtual-scroller").then(l=>(Promise.resolve().then(()=>require("./vue-virtual-scroller-C_hlZMj5.js")),l.RecycleScroller))),s=c,_=L,{optPageLanguage:W,getPageLanguage:G}=De.useLanguage();G("common");const T=t.inject("$SelectTop",{}),M=typeof T.getSelectData=="function",I=t.useTemplateRef("refElSearch"),F=t.useTemplateRef("refElScroller"),E=t.useTemplateRef("refElRoot");let S=!0;const w={isScrollLoading:!1,hasMoreData:!0};let p=[],P=0,B=0;const X=s.id,Q=`select-inList-${s.keyIndex||""}`;let $=!1;const H=t.ref(""),x=t.ref([]),Y=t.ref([]);let Z={};const se=l=>{const o=l.id.toString();if(s.isMultiple&&s.isCascade&&l._hasChildren&&M){const f=T.getAllChildIds(o).filter(g=>!T.getSelectValueInfo(g)?.isDisabled);if(f.length===0)return 0;const m=f.filter(g=>n.isExistValue(s.selectId,g)).length;return m===0?0:m===f.length?2:1}return n.isExistValue(s.selectId,o)?2:0},oe=l=>se(l)===2,he=l=>se(l)===1,ge=t.computed(()=>{let l=!1;return Y.value.length>0&&s.selectId.length>=Y.value.length&&(l=n.isContainArr(s.selectId,Y.value)),l}),ae=l=>{if(!l||typeof l!="object")return"";let o=n.isNonEmptyString(s.showDropDownTextFormat)?s.showDropDownTextFormat:"";l._level>=1&&n.isNonEmptyString(s.showDropDownTextFormatSub)&&(o=s.showDropDownTextFormatSub);let a=n.isEmpty(o)?l.name:n.convertStringFormat(o,l);return n.isHtml(a)?n.isEmpty(o)&&n.isHtml(l.name)?a=n.encodeHTML(l.name):a=n.convertStringFormatEncodeHTML(o,l):typeof a=="string"&&a.indexOf("<")>-1&&(a=n.encodeHTML(a)),a},J=l=>{const o=Z[l]||{};if(n.isBoolean(o._isTypeRadio))return o._isTypeRadio;if(M){const a=T.getSelectValueInfo(l);if(n.isBoolean(a?._isTypeRadio))return a._isTypeRadio}return!1},ee=()=>{const l=[];Z=n.getJsonByList(x.value),x.value.forEach(o=>{if(!n.isObject(o))return;const a=typeof o.id;if(o.id==null||a!=="string"&&(a!=="number"||!n.isFinite(o.id)))return;const f=o.id.toString();if(!(s.isCascade&&o._hasChildren)&&!J(f)){if(n.isExistValue(l,f))return;o.isDisabled?n.isExistValue(s.selectId,f)&&l.push(f):l.push(f)}}),Y.value=l},z=l=>{const o=s.parentKey,a=s.topParentValue,f={};l.forEach(y=>{if(!n.isObject(y)||y.id==null||typeof y.id!="string"&&(typeof y.id!="number"||!n.isFinite(y.id)))return;const k=y[o],V=k!=null&&(typeof k=="string"||typeof k=="number")?k.toString():"";V!==""&&V!==String(a)&&(f[V]||(f[V]=[]),f[V].push(y))});const m=[],g=(y,k,V,C)=>{y.forEach(N=>{const le=N.id.toString();if(C.has(le))return;C.add(le);const e=f[le]||[];m.push({...N,_level:k,_parentName:V,_hasChildren:e.length>0}),e.length>0&&g(e,k+1,N.name,C)})},D=l.filter(y=>{if(!n.isObject(y)||y.id==null||typeof y.id!="string"&&(typeof y.id!="number"||!n.isFinite(y.id)))return!1;const k=y[o],V=k!=null&&(typeof k=="string"||typeof k=="number")?k.toString():"";return n.isEmpty(V)||V===String(a)});return g(D,0,"",new Set),m},ie=(l,o)=>{if(!M)return l;const a=l.filter(C=>C!=null&&C.id!=null&&(typeof C.id=="string"||typeof C.id=="number"&&n.isFinite(C.id))),f=o.filter(C=>C!=null&&C.id!=null&&(typeof C.id=="string"||typeof C.id=="number"&&n.isFinite(C.id))),m=s.parentKey,g=s.topParentValue,D=new Set,y=new Set(a.map(C=>C.id.toString()));a.forEach(C=>{const N=C.id.toString();D.add(N);const le=new Set;let e=C[m];for(;e!=null&&(typeof e=="string"||typeof e=="number")&&e.toString()!==String(g);){const u=e.toString();if(le.has(u))break;le.add(u),y.has(u)||D.add(u),e=T.getSelectValueInfo(u)?.[m]}T.getAllChildIds(N).forEach(u=>{D.add(u)})});const k=f.filter(C=>D.has(C.id.toString())),V=new Set(k.map(C=>C.id.toString()));return D.forEach(C=>{if(!V.has(C)){const N=T.getSelectValueInfo(C);N&&Object.keys(N).length>0&&k.push(N)}}),k},ce=()=>{S&&(S=!1,w.hasMoreData=!0,s.isCascade?(p=[...s.originalData||[]],x.value=z(p)):x.value=n.getListClone(s.originalData).filter(l=>l!=null&&l.id!=null&&(typeof l.id=="string"||typeof l.id=="number"&&n.isFinite(l.id))),ee(),re(),H.value="",t.nextTick(()=>{I.value&&I.value.setValue("")}))},re=()=>{t.nextTick(()=>{if(F.value&&s.selectId.length>0){const l=x.value.findIndex(o=>o.id!=null&&n.isExistValue(s.selectId,o.id.toString()));l>-1&&F.value.scrollToItem(l)}})},te=l=>{const o=[],a=Z[l]||{},f=s.isCascade&&a._hasChildren;if(s.isMultiple)if(J(l))n.isExistValue(s.selectId,l)?s.selectId.forEach(m=>{m!==l&&o.push(m)}):(s.selectId.forEach(m=>{J(m)||o.push(m)}),o.push(l));else if(f&&M){const m=T.getAllChildIds(l),g=m.filter(y=>!T.getSelectValueInfo(y)?.isDisabled),D=g.length>0&&g.every(y=>n.isExistValue(s.selectId,y));s.selectId.forEach(y=>{m.includes(y)?m.includes(y)&&T.getSelectValueInfo(y)?.isDisabled&&o.push(y):o.push(y)}),D||g.forEach(y=>{n.isExistValue(o,y)||o.push(y)})}else s.selectId.forEach(m=>{m!==l&&o.push(m)}),n.isExistValue(s.selectId,l)||o.push(l);else{if(f&&!s.parentSelectable)return[...s.selectId];o.push(l)}return o},ne=l=>{const o=x.value;if(o.length===0)return;let a=-1;const f=H.value;f.length>0?(o.forEach((m,g)=>{m.id.toString()===f&&(a=g)}),a+=l,a<0?a=0:a>=o.length&&(a=o.length-1)):a=0,H.value=o[a].id.toString(),F.value&&F.value.scrollToItem(a)},q=l=>{let o=l.keyCode;if(!n.isUndefined(o))switch(o=o.toString(),o){case"13":{const a=E.value&&l.target instanceof Node&&E.value.contains(l.target);(l.target===document.body||a)&&(l.preventDefault(),l.stopPropagation());break}case"38":l.preventDefault(),l.stopPropagation(),ne(-1);break;case"40":l.preventDefault(),l.stopPropagation(),ne(1);break}},K=l=>{let o=l.keyCode;if(!n.isUndefined(o))switch(o=o.toString(),o){case"27":M&&T.closeDropdown?.();break;case"13":{const a=H.value;if(!a||s.disabled||!s.isOpen)break;const f=E.value&&l.target instanceof Node&&E.value.contains(l.target);if(l.target!==document.body&&!f||!x.value.some(D=>D.id.toString()===a)||Z[a]?.isDisabled)break;const g=te(a);_("onChange",g);break}}},ue=l=>l.map(o=>{const{_level:a,_parentName:f,_hasChildren:m,...g}=o;return g}),de=async()=>{if(s.serverCallback&&!(w.isScrollLoading||!w.hasMoreData)&&(w.isScrollLoading=!0,s.serverCallback)){const l=++B,o=x.value;try{const a={offset:o.length};if(s.isSearch&&I.value){const D=I.value.getValue();n.isEmpty(D)||(a.search=D)}const f=await s.serverCallback(a);if(l!==B||o!==x.value)return;if(!Array.isArray(f)){j.error("ClSelect","_loadMore 服务端返回数据格式异常(非数组):",typeof f),_("onError","服务端加载失败:返回数据格式异常");return}if(f.length===0){w.hasMoreData=!1;return}const m=new Set(o.map(D=>D?.id?.toString()).filter(Boolean)),g=f.filter(D=>{if(D?.id==null)return!1;const y=typeof D.id;return y!=="string"&&(y!=="number"||!n.isFinite(D.id))?!1:!m.has(D.id.toString())});if(g.length===0){w.hasMoreData=!1;return}s.isCascade?a.search?x.value=z([...x.value,...g]):(p.length===0&&(p=ue(x.value)),p.length===0&&(p=[...s.originalData]),p.push(...g),x.value=z(p)):x.value.push(...g),ee(),M&&(T.convertListToJson(g),T.refreshDisplayLabels?.())}catch(a){j.error("ClSelect","_loadMore 服务端加载失败:",a),_("onError","服务端加载失败,请稍后重试")}finally{w.isScrollLoading=!1}}},ye=()=>{ce(),_("onInitComplete")};t.onMounted(()=>{ye()}),t.onBeforeUnmount(()=>{R.offListener(window,"keydown",q),R.offListener(window,"keyup",K),$=!1}),t.onDeactivated(()=>{R.offListener(window,"keydown",q),R.offListener(window,"keyup",K),$=!1}),t.onActivated(()=>{s.isOpen&&!$&&(R.onListener(window,"keydown",q),R.onListener(window,"keyup",K),$=!0)}),t.watch(()=>s.isOpen,l=>{l?(S=!0,ce()):w.isScrollLoading=!1}),t.watch(()=>s.originalData,l=>{S=!0,s.isCascade?(p=[...l||[]],x.value=z(p)):x.value=n.getListClone(l).filter(o=>o!=null&&o.id!=null&&(typeof o.id=="string"||typeof o.id=="number"&&n.isFinite(o.id))),ee(),w.hasMoreData=!0,H.value="",t.nextTick(()=>{I.value&&I.value.setValue("")})});const fe=async l=>{const o=++P;B=Math.max(B,o+1);let a=[];if(s.isCascade&&(p=[]),w.hasMoreData=!0,s.serverCallback){try{if(a=await s.serverCallback({search:l,offset:0}),Array.isArray(a)||(j.error("ClSelect","onSearch 服务端返回数据格式异常(非数组):",typeof a),_("onError","服务端搜索失败:返回数据格式异常"),a=[]),o!==P)return;M&&T.convertListToJson(a)}catch(f){j.error("ClSelect","onSearch 服务端搜索失败:",f),_("onError","服务端搜索失败,请稍后重试"),a=[]}if(o!==P)return;s.isCascade&&(a=ie(a,s.originalData),a=z(a))}else{const f=s.originalData.filter(m=>m!=null&&m.id!=null&&(typeof m.id=="string"||typeof m.id=="number"&&n.isFinite(m.id)));if(n.isEmpty(l))a=f;else{s.searchKeyType!=="||"&&s.searchKeyType!=="&&"&&j.warn("ClSelect","onSearch searchKeyType 未知值,已降级为 OR 匹配:",s.searchKeyType);const m=l.toLowerCase(),g=n.isArray(s.searchKey)?s.searchKey:["name"],D=g.length;f.forEach(y=>{const k=[];for(let V=0;V<D;V++){const C=y[g[V]];if(C==null)continue;String(C).toLowerCase().indexOf(m)>-1&&k.push(!0)}if(k.length>0)switch(s.searchKeyType){case"||":a.push(y);break;case"&&":k.length===D&&a.push(y);break;default:a.push(y)}})}s.isCascade&&(n.isEmpty(l)||(a=ie(a,s.originalData)),a=z(a))}x.value=a.filter(f=>f!=null&&f.id!=null&&(typeof f.id=="string"||typeof f.id=="number"&&n.isFinite(f.id))),ee(),H.value="",M&&T.calculationDropdownPosition()},U=l=>{if(!s.disabled&&s.isMultiple){const o=[],a=[];Y.value.forEach(g=>{l.value?n.isExistValue(s.selectId,g)||o.push(g):n.isExistValue(s.selectId,g)&&(Z[g]?.isDisabled||a.push(g))});const f=n.getArrClone(s.selectId);a.length>0&&a.forEach(g=>{const D=f.indexOf(g);D>-1&&f.splice(D,1)}),o.length>0&&o.forEach(g=>{n.isExistValue(f,g)||f.push(g)});const m=[];f.forEach(g=>{(!J(g)||n.isExistValue(s.selectId,g))&&m.push(g)}),_("onChange",m)}},pe=l=>{if(l.id==null||typeof l.id!="string"&&(typeof l.id!="number"||!n.isFinite(l.id))||l.isDisabled||s.disabled)return;const o=l.id.toString(),a=te(o);_("onChange",a)};return O({initOpenShow:l=>{l?$||(R.onListener(window,"keydown",q),R.onListener(window,"keyup",K),$=!0):$&&(R.offListener(window,"keydown",q),R.offListener(window,"keyup",K),$=!1)}}),(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"select-inDropdown-container",id:t.unref(X),ref_key:"refElRoot",ref:E},[c.isSearch?(t.openBlock(),t.createElementBlock("div",Pe,[t.createVNode(Me._sfc_main,{ref_key:"refElSearch",ref:I,placeholder:c.searchPlaceholder,disabled:c.disabled,onOnChange:fe},null,8,["placeholder","disabled"])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[],64)),c.isMultiple&&c.isCheckBoxAll&&x.value.length>0?(t.openBlock(),t.createElementBlock("div",Ae,[t.createVNode(Ce._sfc_main,{forId:`${Q}-cb-all`,label:t.unref(W).checkboxAll,value:ge.value,disabled:c.disabled,onOnChange:U},null,8,["forId","label","value","disabled"])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[],64)),x.value.length>0?(t.openBlock(),t.createBlock(t.unref(r),{key:4,class:"select-inDropdown-body select-inDropdown-scroller",role:"listbox",style:t.normalizeStyle({height:Math.min(x.value.length*ve,Je)+"px"}),items:x.value,"item-size":ve,"key-field":"id",ref_key:"refElScroller",ref:F,onScrollEnd:de},{default:t.withCtx(({item:a})=>[t.createElementVNode("div",{role:"option","aria-selected":oe(a),"aria-disabled":a.isDisabled||!1,class:t.normalizeClass({"option-selected":oe(a),"option-disabled":a.isDisabled,"option-hoverKeydown":H.value===a.id.toString(),"select-inDropdown-item-child":a._level>=1}),style:t.normalizeStyle({height:ve+"px",paddingLeft:a._level?a._level*je+"px":void 0}),onClick:f=>pe(a)},[t.createElementVNode("div",Ne,[c.isMultiple?(t.openBlock(),t.createElementBlock("div",Re,[t.createVNode(Ce._sfc_main,{name:`${Q}-cb`,forId:`${Q}-cb-${a.id}`,value:oe(a),indeterminate:he(a),disabled:a.isDisabled},null,8,["name","forId","value","indeterminate","disabled"])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[],64)),t.createElementVNode("div",{class:"select-inDropdown-title",innerHTML:ae(a)},null,8,$e)])],14,Ke)]),_:1},8,["style","items"])):(t.openBlock(),t.createElementBlock("div",qe,[t.createElementVNode("div",He,t.toDisplayString(t.unref(W).noResultsText),1)]))],8,Fe))}}),ze=["id"],Ue={class:"select-inTag-title"},Ge={class:"select-inTag-operate"},Xe={class:"select-inTag-body"},Qe=t.defineComponent({name:"ClSelectInTags",__name:"Tags",props:{id:String,showTextFormat:String,selectId:{type:Array,default:()=>[]}},emits:{onRemove:c=>!0},setup(c,{emit:O}){const L=c,r=O,s=L.id,{optPageLanguage:_,getPageLanguage:W}=De.useLanguage();W("common");const G=t.inject("$SelectTop",{}),T=typeof G.getSelectData=="function",M=t.computed(()=>T?n.isArray(L.selectId)?G.getSelectData(L.selectId):[]:[]),I=t.computed(()=>T?M.value.length:0),F=t.computed(()=>n.isArray(M.value)?M.value.some(w=>n.isObject(w)?!(n.isBoolean(w.isDisabled)&&w.isDisabled):!1):!1),E=()=>{const w=M.value;if(!n.isArray(w))return;const p=[];let P=!1;w.forEach(B=>{if(!n.isObject(B))return;(n.isBoolean(B.isDisabled)?!!B.isDisabled:!1)?(typeof B.id=="string"&&!n.isEmpty(B.id)||typeof B.id=="number"&&n.isFinite(B.id))&&p.push(B.id.toString()):P=!0}),P&&r("onRemove",p)},S=w=>{if(!n.isArray(L.selectId)||n.isEmpty(w))return;const p=String(w),P=L.selectId.findIndex(X=>String(X)===p);if(P===-1)return;const B=n.getArrClone(L.selectId);B.splice(P,1),r("onRemove",B)};return(w,p)=>(t.openBlock(),t.createElementBlock("div",{class:"select-inTag-container",id:t.unref(s)},[t.createElementVNode("div",Ue,[t.createElementVNode("span",null,t.toDisplayString(t.unref(_).selected)+" "+t.toDisplayString(I.value)+" "+t.toDisplayString(t.unref(_).count),1),t.createElementVNode("span",Ge,[F.value?(t.openBlock(),t.createBlock(Le._sfc_main,{key:0,class:"select-inTag-deleteAll",name:"remove",title:t.unref(_).deleteAll,"aria-label":t.unref(_).deleteAll,onClick:E},null,8,["title","aria-label"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[],64))])]),t.createElementVNode("div",Xe,[t.createVNode(Oe._sfc_main,{showTextFormat:c.showTextFormat,list:M.value,onOnRemove:S},null,8,["showTextFormat","list"])])],8,ze))}}),Ye=["id"],Ze={key:0,class:"select-inText-num"},et=t.defineComponent({name:"ClSelect",__name:"Index",props:{id:String,value:[String,Number],className:String,disabled:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},placeholder:String,classDropDown:String,theme:{type:String,default:"default",validator:c=>["default","noBorder"].includes(c)},multiple:{type:Boolean,default:!1},isClear:{type:Boolean,default:!1},isSearch:{type:Boolean,default:!1},isCheckBoxAll:{type:Boolean,default:!0},isShowTag:{type:Boolean,default:!0},arrowDirection:{type:String,default:"right",validator:c=>["left","right"].includes(c)},transitionLeave:{type:String,default:"zoomOutTop"},searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||",validator:c=>["||","&&"].includes(c)},showTextFormat:String,showDropDownTextFormat:String,multipleRealTimeChange:{type:Boolean,default:!1},isCascade:{type:Boolean,default:!1},parentSelectable:{type:Boolean,default:!1},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"},showDropDownTextFormatSub:String,isOutMerge:{type:Boolean,default:!0},isPlaintext:{type:Boolean,default:!1},plaintextSeparator:{type:String,default:","},plaintextLevelSeparator:{type:String,default:" > "},onOpenBefore:Function,serverCallback:Function,appendContainer:{type:String,default:""}},emits:{"update:value":c=>!0,"update:modelValue":c=>!0,onChange:(c,O)=>!0,onInit:()=>!0,onOpen:c=>!0,onError:c=>!0},setup(c,{expose:O,emit:L}){const r=c,s=L,_=t.useTemplateRef("refElDropdownLayer"),W=t.useTemplateRef("refElList"),G=t.useTemplateRef("refElTags"),T=`select-${n.getRandom(8)}`,M=r.id,I=t.reactive({isOpen:!1,dropDownPos:"down",tagHeight:"",tagLeft:"",tagDirection:"right"});let F=[],E={};const S={childrenMap:{},parentMap:{},lastChildMap:{},allChildMap:{}},w=t.ref(!1),p=t.ref([]),P=t.ref([]),B=t.ref([]);let X=!1;const Q=t.computed(()=>n.isNonEmptyString(r.showTextFormat)?r.showTextFormat:r.isCascade?"${name}(${parentName})":""),$=t.computed(()=>{let e={"panel-select":!0};return r.theme==="noBorder"&&(e["select-theme-noBorder"]=!0),e=n.getJsonMerge(e,R.getClassNameJson(r.className)),n.getStringByJson(e," ")}),H=t.computed(()=>`${$.value} cl-plaintext-value`),x=t.computed(()=>{const e=n.isString(r.plaintextSeparator)?r.plaintextSeparator:",";return B.value.join(e)}),Y=t.computed(()=>{let e={"select-inDropdown":!0};return r.theme==="noBorder"&&(e["select-inDropdown-noBorder"]=!0),I.isOpen&&r.multiple&&r.isShowTag&&(e["select-inTag-ext"]=!0,e[`select-inTag-${I.tagDirection}`]=!0),e=n.getJsonMerge(e,R.getClassNameJson(r.classDropDown)),n.getStringByJson(e," ")}),Z=t.computed(()=>{const e={"select-inTag":!0,"select-inTag-open":I.isOpen};return e[`select-inTag-${I.dropDownPos}`]=!0,e[`select-inTag-${I.tagDirection}`]=!0,e}),se=e=>{s("update:value",e),s("update:modelValue",e)},oe=(e,i)=>{se(e),s("onChange",e,i)},he=()=>{X||(X=!0,t.nextTick(()=>{s("onInit")}))},ge=e=>{t.nextTick(()=>{s("onOpen",e)})},ae=()=>{const e=[];return p.value.forEach(i=>{n.isExistJsonKey(E,i)&&e.push(i)}),e},J=e=>{if(n.isEmpty(e)||!n.isArray(e))return;const i={},u=r.parentKey,h=r.topParentValue;if(e.forEach(d=>{if(!n.isObject(d)){j.warn("ClSelect","_convertListToJson 跳过非对象数据项:",d);return}if(!(typeof d.id=="string"||typeof d.id=="number"&&n.isFinite(d.id))){j.warn("ClSelect","_convertListToJson 跳过无 id 或 id 类型异常的数据项:",d);return}const b=d.id.toString();i[b]=n.getJsonClone(d)}),E=n.getJsonMerge(E,i),r.serverCallback&&!w.value&&!n.isEmpty(i)&&(w.value=!0,r.value!=null&&r.value!==""&&(q(r.value),ne())),r.isCascade&&Object.keys(E).forEach(d=>{const v=E[d][u],b=v!=null&&(typeof v=="string"||typeof v=="number")?v.toString():"";if(b!==""&&b!==String(h)){const A=E[b];A?.name&&(E[d].parentName=A.name)}}),r.isCascade&&(ee(),r.isOutMerge&&r.multiple&&p.value.length>0)){const d=re(p.value);n.isEqualArr(p.value,d)||(p.value=d,F=d)}if(r.multiple&&p.value.length>1){const d=p.value.filter(v=>{const b=E[v];return n.isBoolean(b?._isTypeRadio)&&b._isTypeRadio});if(d.length>1){const v=d[d.length-1],b=p.value.filter(A=>A===v||!d.includes(A));n.isEqualArr(p.value,b)||(p.value=b,U())}}p.value.length>0&&(p.value=[...p.value])},ee=()=>{const e=r.parentKey,i=r.topParentValue;S.childrenMap={},S.parentMap={},S.lastChildMap={},S.allChildMap={},Object.keys(E).forEach(h=>{const v=E[h][e],b=v!=null&&(typeof v=="string"||typeof v=="number")?v.toString():"";b!==""&&b!==String(i)&&(S.parentMap[h]=b,S.childrenMap[b]||(S.childrenMap[b]=[]),S.childrenMap[b].push(h))})},z=e=>{const i=(u,h)=>{if(S.lastChildMap[u])return S.lastChildMap[u];if(h.has(u))return[];h.add(u);const d=S.childrenMap[u];if(!d||d.length===0)return S.lastChildMap[u]=[u],[u];const v=[];return d.forEach(b=>{v.push(...i(b,new Set(h)))}),S.lastChildMap[u]=v,v};return i(e,new Set)},ie=e=>{const i=(u,h)=>{if(S.allChildMap[u])return S.allChildMap[u];if(h.has(u))return[];h.add(u);const d=S.childrenMap[u];if(!d||d.length===0)return S.allChildMap[u]=[],[];const v=[];d.forEach(A=>{v.push(A),v.push(...i(A,new Set(h)))});const b=Array.from(new Set(v));return S.allChildMap[u]=b,b};return i(e,new Set)},ce=e=>{if(e.length===0)return[];const i=new Set(e),u=new Set,h=new Set;for(const d of i){const v=S.parentMap[d];v&&!h.has(v)&&u.add(v)}for(;u.size>0;){const d=u.values().next().value;if(u.delete(d),h.has(d))continue;h.add(d);const v=S.childrenMap[d];if(!v||v.length===0)continue;let b=!0;for(const A of v)if(!i.has(A)){b=!1;break}if(b){for(const be of v)i.delete(be);i.add(d);const A=S.parentMap[d];A&&!h.has(A)&&u.add(A)}}return[...i]},re=e=>{if(e.length===0)return[];const i=[];return e.forEach(u=>{i.push(...z(u))}),n.getArrUnique(i)},te=e=>!r.isCascade||!r.multiple?e:r.isOutMerge?ce(e):re(e),ne=()=>{if(w.value&&!n.isEmpty(p.value)){if(n.isEmpty(E)||r.serverCallback)return;const e=ae();if(!n.isEqualArr(p.value,e)){const i=p.value.filter(h=>!e.includes(h));i.length>0&&j.warn("ClSelect","以下 id 在数据列表中不存在,已自动清除:",i),p.value=e,F=e;const u=te(e);se(u.join(","))}}},q=e=>{if(e!=null&&typeof e!="string"&&(typeof e!="number"||!n.isFinite(e))){j.warn("ClSelect","setValue 收到非预期类型值:",typeof e,e);return}let i=e==null||e===""?[]:e.toString().split(",").filter(h=>h!=="");i=n.getArrUnique(i),r.isCascade&&r.isOutMerge&&i.length>0&&r.multiple&&(i=re(i));let u=n.isEqualArr(p.value,i);u&&(u=i.join(",")===p.value.join(",")),u||(F=i,p.value=i)},K=e=>n.isExistJsonKey(E,e)?n.getJsonClone(E[e]):{},ue=e=>{const i=n.isArray(e)?e:p.value,u=[];return i.forEach(h=>{const d=K(h);n.isEmpty(d)||u.push(d)}),u},de=e=>{const u=r.isCascade&&!r.multiple&&(S.childrenMap[e.id?.toString()]?.length>0||!S.parentMap[e.id?.toString()])&&n.isEmpty(r.showTextFormat)?"":Q.value;let h=n.isEmpty(u)?e.name??"":n.convertStringFormat(u,e);return n.isHtml(h)?h=n.isEmpty(u)?n.encodeHTML(e.name):n.convertStringFormatEncodeHTML(u,e):typeof h=="string"&&h.indexOf("<")>-1&&(h=n.encodeHTML(h)),h},ye=e=>{if(n.isNonEmptyString(r.showTextFormat))return n.removeHTMLTags(de(e));const i=n.isString(r.plaintextLevelSeparator)?r.plaintextLevelSeparator:" > ",u=n.isString(e?.name)?e.name:"",h=n.isString(e?.parentName)?e.parentName:"",d=r.isCascade&&n.isNonEmptyString(h)?`${h}${i}${u}`:u;return n.removeHTMLTags(d)},fe=()=>{const e=ue();P.value=e.map(i=>de(i)),B.value=e.map(i=>ye(i))},U=()=>{const e=ae();F=e,p.value=e;const i=te(e),u=i.join(",");let h;if(r.multiple){const d=[];i.forEach(v=>{const b=K(v);n.isEmpty(b)||d.push(b)}),h=d}else h=K(u),n.isEmpty(h)&&(h=null);oe(u,h)},pe=()=>{I.isOpen||!n.isEqualArr(p.value,F)&&U()},me=()=>{w.value||(w.value=!0,J(r.list),q(r.value),ne())},l=()=>{!w.value&&r.list&&r.list.length>0&&me()},o=()=>{import("vue-virtual-scroller").then(()=>{Promise.resolve().then(()=>require("./vue-virtual-scroller-C_hlZMj5.js"))})};t.onMounted(()=>{r.isPlaintext||o(),t.nextTick(()=>{l()})}),t.watch(w,e=>{e&&he()}),t.watch(()=>r.list,(e,i)=>{w.value||(e&&e.length>0||i===void 0)&&(w.value=!0)}),t.watch([()=>r.value,()=>r.list],([e,i],[u,h])=>{const d=i||[];!w.value&&d.length>0&&(w.value=!0),i!==h&&(E={},S.childrenMap={},S.parentMap={},S.lastChildMap={},S.allChildMap={}),J(d),e!==void 0&&q(e),ne()}),t.watch([p,()=>r.list],([e,i])=>{i&&i.length>0&&n.isEmpty(E)&&J(i),fe()}),t.watch(()=>r.isOutMerge,()=>{r.isCascade&&r.multiple&&p.value.length>0&&te(ae()).join(",")!==String(r.value??"")&&U()}),t.watch([()=>r.parentKey,()=>r.topParentValue],()=>{r.isCascade&&!n.isEmpty(E)&&ee()});const a=e=>{e&&r.disabled||(I.isOpen=e,e?F=p.value:pe(),t.nextTick(()=>{W.value&&W.value.initOpenShow(e)}),ge(e))},f=()=>{r.disabled||(p.value=[],r.multiple&&r.multipleRealTimeChange?U():pe())},m=e=>{if(I.dropDownPos=e.use.dropDownPos,r.multiple&&r.isShowTag){const i=G.value?.$el?.offsetWidth||0;I.tagHeight=r.theme==="default"?`${e.original.dropDownHeight+1}px`:`${e.original.dropDownHeight}px`;const u=e.original.winWidth-(e.original.controlOffset.left+e.original.dropDownWidth)>=i?"right":"left";I.tagDirection=u,u==="right"?I.tagLeft=`${e.original.dropDownWidth-1}px`:I.tagLeft=`${(e.original.dropDownWidth-e.original.textWidth+i+1)*-1}px`}},g=e=>{p.value=e,r.multiple?r.multipleRealTimeChange&&U():_.value?.setOpen(!1)},D=e=>{r.disabled||(p.value=e,U())},y=e=>{s("onError",e)},k=()=>{_.value&&(_.value.checkIsShowOpen()||_.value.initCompleteOpen())};t.provide("$SelectTop",{getSelectData:ue,getSelectValueInfo:K,getAllChildIds:ie,calculationDropdownPosition:()=>{_.value?.calculationPosition()},convertListToJson:J,closeDropdown:()=>{_.value?.setOpen(!1)},refreshDisplayLabels:()=>{fe()}});const V=()=>{const e=ae();return te(e).join(",")};return O({getValue:V,getValueData:()=>{const e=V();if(r.multiple){const u=e?e.split(","):[],h=[];return u.forEach(d=>{const v=K(d);n.isEmpty(v)||h.push(v)}),h}if(!e)return null;const i=K(e);return n.isEmpty(i)?null:i},setValue:e=>{q(e),ne()},runInitComplete:()=>{me()}}),(e,i)=>c.isPlaintext?(t.openBlock(),t.createElementBlock("div",{key:0,id:t.unref(M),class:t.normalizeClass(H.value)},t.toDisplayString(x.value),11,Ye)):(t.openBlock(),t.createBlock(Ve._sfc_main,{key:1,id:t.unref(M),ref_key:"refElDropdownLayer",ref:_,classParent:$.value,classText:"select-inText",classDropDown:Y.value,placeholder:c.placeholder,isDisabled:c.disabled,isClear:c.isClear,textLabel:P.value.join(","),textArrowDirection:c.arrowDirection,transitionLeave:c.transitionLeave,appendContainer:c.appendContainer,appendFollowWidth:c.theme!=="noBorder",onOpenBeforeCallback:c.onOpenBefore,onOnChangeOpen:a,onOnClear:f,onOnChangePosition:m},{textExtend:t.withCtx(()=>[c.multiple?(t.openBlock(),t.createElementBlock("span",Ze,[P.value.length>1?(t.openBlock(),t.createBlock(Be._sfc_main,{key:0,num:P.value.length},null,8,["num"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[],64))])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[],64))]),dropdown:t.withCtx(()=>[t.createVNode(We,{ref_key:"refElList",ref:W,isSearch:c.isSearch,searchPlaceholder:c.searchPlaceholder,searchKey:c.searchKey,searchKeyType:c.searchKeyType,isMultiple:c.multiple,isCheckBoxAll:c.isCheckBoxAll,showDropDownTextFormat:c.showDropDownTextFormat,showDropDownTextFormatSub:c.showDropDownTextFormatSub,isCascade:c.isCascade,parentSelectable:c.parentSelectable,parentKey:c.parentKey,topParentValue:c.topParentValue,originalData:c.list,keyIndex:T,selectId:p.value,disabled:c.disabled,isOpen:I.isOpen,serverCallback:c.serverCallback,onOnChange:g,onOnInitComplete:k,onOnError:y},null,8,["isSearch","searchPlaceholder","searchKey","searchKeyType","isMultiple","isCheckBoxAll","showDropDownTextFormat","showDropDownTextFormatSub","isCascade","parentSelectable","parentKey","topParentValue","originalData","selectId","disabled","isOpen","serverCallback"])]),dropdownExtend:t.withCtx(()=>[c.multiple&&c.isShowTag?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(Z.value),style:t.normalizeStyle({height:I.tagHeight,left:I.tagLeft}),ref_key:"refElTags",ref:G},[t.createVNode(Qe,{showTextFormat:Q.value,selectId:p.value,onOnRemove:D},null,8,["showTextFormat","selectId"])],6)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[],64))]),_:1},8,["id","classParent","classDropDown","placeholder","isDisabled","isClear","textLabel","textArrowDirection","transitionLeave","appendContainer","appendFollowWidth","onOpenBeforeCallback"]))}});exports._sfc_main=et;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue");;/* empty css */;/* empty css */const i=require("@cldemo/ui-kit/common/base"),P=require("@cldemo/ui-kit/common/Element"),h=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),L=require("./index-q2CbfC2a.js"),K=["id"],R={key:0,class:"cl-plaintext-value"},z=["id","name","value","disabled","checked","onClick"],A=["for"],U={key:0},W=e.defineComponent({name:"ClRadio",directives:{cltooltip:L.tooltipDirectives},__name:"Index",props:{id:String,name:{type:String,required:!0},value:{type:[String,Number],required:!0},className:String,disabled:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},width:String,isInline:{type:Boolean,default:!0},tipMode:{type:String,default:"tooltip",validator:d=>["tooltip","clickCallback"].includes(d)},checkChangeBefore:{type:Function,default:void 0},isPlaintext:{type:Boolean,default:!1}},emits:["update:value","update:modelValue","onChange","onInit","onError","onTipClick"],setup(d,{expose:C,emit:S}){const l=d,m=S,v=`rd-${i.getRandom(8)}`,k=i.isEmpty(l.name)?v+"_name":l.name,N=l.id,a=e.ref(l.value?.toString()||"");let c={};const E=e.ref(0),r=e.ref(!1),u={isProcessing:!1,_initEmitted:!1},x=e.computed(()=>{if(l.isPlaintext)return[];const t=l.list;return i.isArray(t)?t.filter(s=>!i.isEmpty(s)):[]}),I=e.computed(()=>{l.list,E.value;const t=a.value;if(i.isEmpty(t))return"";const s=i.isExistJsonKey(c,t)?c[t]:void 0;return s&&i.isNonEmptyString(s.name)?s.name:t}),V=e.computed(()=>i.getJsonMerge({"panel-radio":!0},P.getClassNameJson(l.className))),w=e.computed(()=>{const t={radio:!0,"radio-default":!0};return t["radio-inline"]=l.isInline??!0,t}),f=t=>{m("update:value",t),m("update:modelValue",t)},D=t=>{const s=t.id?.toString()??"";f(s),m("onChange",s,i.getJsonClone(t))},g=()=>{u._initEmitted||(u._initEmitted=!0,e.nextTick(()=>{m("onInit")}))},b=t=>{const s={},{width:o}=l;return t&&!i.isEmpty(t.width)?s.width=t.width:i.isEmpty(o)||(s.width=l.width),s},$=()=>i.isExistJsonKey(c,a.value)?a.value:"",_=t=>{c=i.isEmpty(t)?{}:i.getJsonByList(t),E.value+=1},p=()=>{if(r.value){const t=i.isEmpty(a.value)?"":a.value;i.isExistJsonKey(c,t)||(a.value="",f(""))}},y=t=>{t!==a.value&&(a.value=t?.toString()||"")},q=()=>{r.value=l.list.length!==0,_(l.list),p()};e.onMounted(()=>{e.nextTick(()=>{q()})}),e.onBeforeUnmount(()=>{c={},r.value=!1,u._initEmitted=!1}),e.watch(r,t=>{t&&g()}),e.watch(()=>l.list,t=>{r.value||(r.value=!0,t.length===0&&p(),g())},{deep:!0}),e.watch([()=>l.value,()=>l.list],([t,s])=>{const o=s||[];!r.value&&o.length>0&&(r.value=!0,g()),_(o),y(t),p()},{deep:!0});const F=t=>{m("onTipClick",t)},J=async t=>{if(!(!t||t.isDisabled||l.disabled||u.isProcessing)&&!i.isEmpty(t.id)){u.isProcessing=!0;try{const s=String(t.id??"");if(s===a.value)return;let o=!0;if(l.checkChangeBefore)try{o=await l.checkChangeBefore(s),o=i.isBoolean(o)?o:!0}catch{o=!1}if(l.disabled||t.isDisabled)return;o&&(a.value=s,D(t))}catch(s){m("onError",s)}finally{u.isProcessing=!1}}},B=()=>$();return C({getValue:B,getValueData:()=>{const t=B();return i.isExistJsonKey(c,t)?i.getJsonClone(c[t]):{}},setValue:t=>{u.isProcessing||(y(t),p())},runInitComplete:()=>{r.value||(r.value=!0,_(l.list),y(l.value),p(),g())}}),(t,s)=>{const o=e.resolveDirective("cltooltip");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(V.value),id:e.unref(N)},[d.isPlaintext?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(I.value),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(n,T)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${v}-${n.id??""}-${T}`},[n&&(n.isShow||n.isShow===void 0)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(w.value),style:e.normalizeStyle(b(n))},[e.createElementVNode("span",null,[e.createElementVNode("span",null,[e.createElementVNode("input",{type:"radio",id:`${v}_${e.unref(k)}_${n.id??""}`,name:e.unref(k),value:n.id??"",disabled:n.isDisabled||d.disabled,checked:(n.id?.toString()??"")===a.value,onClick:M=>J(n)},null,8,z),e.createElementVNode("label",{for:`${v}_${e.unref(k)}_${n.id??""}`},[e.renderSlot(t.$slots,"default",{data:n},()=>[n.icon&&n.icon.length>0?e.withDirectives((e.openBlock(),e.createElementBlock("span",U,[e.createVNode(h._sfc_main,{name:n.icon},null,8,["name"])])),[[o,{html:n.name,className:"tooltip-modal"}]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.name),1)],64))])],8,A)]),n.tipMsg&&n.tipMsg.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d.tipMode==="tooltip"?e.withDirectives((e.openBlock(),e.createBlock(h._sfc_main,{key:0,name:e.unref(i).isNonEmptyString(n.tipIcon)?void 0:"question-circle",className:e.unref(i).isNonEmptyString(n.tipIcon)?n.tipIcon:void 0,class:"radio-icon-tip"},null,8,["name","className"])),[[o,{html:n.tipMsg,className:"tooltip-modal"}]]):(e.openBlock(),e.createBlock(h._sfc_main,{key:1,name:e.unref(i).isNonEmptyString(n.tipIcon)?void 0:"question-circle",className:e.unref(i).isNonEmptyString(n.tipIcon)?n.tipIcon:void 0,class:"radio-icon-tip",onClick:e.withModifiers(M=>F(n),["stop"])},null,8,["name","className","onClick"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])],6)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],64))),128))],10,K)}}});exports._sfc_main=W;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),de=require("@cldemo/ui-kit/common/log"),H=require("dayjs"),l=require("@cldemo/ui-kit/common/base"),pe=require("@cldemo/ui-kit/common/Element"),Ee=require("./List.vue_vue_type_script_setup_true_lang-CFCST05R.js"),he=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),ve=require("./language-BJ4aVgHI.js"),we=require("./Index.vue_vue_type_script_setup_true_lang-5aX79Fcf.js"),Ve=require("@cldemo/ui-kit/common/day"),Ce=require("./Index.vue_vue_type_script_setup_true_lang-D_YbdXMB.js");;/* empty css */;/* empty css */const xe=["id"],be={class:"table-base"},_e={class:"time-head time-head-day",colspan:"7"},Te={class:"time-prev"},Be=["title"],$e=["title"],Ye={class:"time-next"},Ne=["title"],Oe=["title"],Ie=["aria-disabled","onClick","onKeydown","onMouseover"],Pe=e.defineComponent({name:"ClCalendarsDays",__name:"CalendarsDays",props:{className:String,viewValue:String,selectValue:String,startValue:String,endValue:String,hoverValue:String,minValue:String,maxValue:String},emits:{onChangeDate:f=>!0,onChangeType:f=>!0,onSelectDate:(f,ne)=>!0,onHoverDate:(f,ne)=>!0,onInitComplete:f=>!0},setup(f,{emit:ne}){const v=f,i=ne,{optPageLanguage:I,getPageLanguage:_}=ve.useLanguage();_("dataTime");const O=e.inject("$DateTimeTop"),x=e.inject("$DateTimeTopBase"),h=e.inject("$DateTimeBase");(!O||!x||!h)&&de.warn("ClCalendarsDays","未找到 $DateTimeTop/$DateTimeTopBase/$DateTimeBase 注入,请确保组件在 ClDateTime 组件树内使用");const C=`calendarsDays-${l.getRandom(5)}`,k=O?.elId?`${O.elId}-calendarsDays-${l.getRandom(5)}`:void 0,c=e.computed(()=>{let r={"panel-calendarsdays":!0};return r=l.getJsonMerge(r,pe.getClassNameJson(v.className)),r}),a=e.reactive({isPrevYear:!1,isPrevMonth:!1,titleYear:"",titleMonth:"",isNextYear:!1,isNextMonth:!1}),m=e.ref([]),n=e.ref([]),t={viewDate:null,selectDate:null,startDate:null,endDate:null,hoverDate:null},B=()=>{if(!t.viewDate)return;const r=t.viewDate.year(),$=t.viewDate.localeData().monthsShort(t.viewDate),T=t.viewDate.clone().subtract(1,"years").endOf("month"),Y=h.checkDataMinMax(T,"day"),se=t.viewDate.clone().subtract(1,"months").endOf("month"),G=h.checkDataMinMax(se,"day"),j=t.viewDate.clone().add(1,"months").startOf("month"),J=h.checkDataMinMax(j,"day"),K=t.viewDate.clone().add(1,"years").startOf("month"),re=h.checkDataMinMax(K,"day");a.isPrevYear=!Y,a.isPrevMonth=!G,a.titleYear=`${r}${I.value.year}`,a.titleMonth=$,a.isNextMonth=!J,a.isNextYear=!re},te=()=>{if(!t.viewDate)return;const r=t.viewDate.localeData(),w=r.weekdaysMin(),$=r.firstDayOfWeek(),T=[];w.forEach((Y,se)=>{T[(7+se-$)%7]=Y}),m.value=T},X=()=>{if(!t.viewDate)return;const r=t.viewDate.clone(),w=t.selectDate,$=r.year(),T=r.month();let Y=r.clone().subtract(1,"months");const se=[];let G=[];Y=Y.date(Y.daysInMonth()).startOf("week");for(let j=0;j<42;j+=1){j>0&&(Y=Y.add(1,"days"));const J=Y.clone(),K=J.date(),re=Y.year()===$&&Y.month()<T||Y.year()<$,ce=Y.year()===$&&Y.month()>T||Y.year()>$;let ye=w&&Y.isSame(w,"day");const D=h.checkDataMinMax(J,"day");let b=!1,E=!1,N=!1;x.isRange&&(t.hoverDate?t.startDate&&t.endDate&&t.startDate.isSame(t.hoverDate,"day")&&t.hoverDate.isBefore(t.endDate,"day")?(b=Y.isSame(t.startDate,"day"),E=Y.isSame(t.endDate,"day"),N=b||E||Y.isAfter(t.startDate,"day")&&Y.isBefore(t.endDate,"day")):t.startDate?(b=Y.isSame(t.startDate,"day"),N=b||Y.isSame(t.hoverDate,"day"),N=N||Y.isAfter(t.startDate,"day")&&Y.isBefore(t.hoverDate,"day"),E=t.hoverDate.isSame(t.startDate,"day")&&b):t.endDate&&(E=Y.isSame(t.endDate,"day"),N=E||Y.isSame(t.hoverDate,"day"),N=N||Y.isAfter(t.hoverDate,"day")&&Y.isBefore(t.endDate,"day"),b=t.hoverDate.isSame(t.endDate,"day")&&E):(b=!!(t.startDate&&Y.isSame(t.startDate,"day")),t.endDate&&(E=Y.isSame(t.endDate,"day"),N=b||E||!!(t.startDate&&Y.isAfter(t.startDate,"day")&&Y.isBefore(t.endDate,"day")))),ye=b||E);const s=pe.getAddClass("day",{old:re,new:ce,active:ye&&!re&&!ce&&!D,disabled:D,"date-start":b&&!re&&!ce,"date-end":E&&!re&&!ce,"range-in":N&&!re&&!ce});G.push({cls:s,day:K,value:K,isDisabled:D,isOld:re,isNew:ce}),G.length===7&&(se.push({days:G}),G=[])}n.value=se},Z=(r,w,$)=>{if(!t.viewDate)return;const T=t.viewDate.clone()[r](w,$);i("onChangeDate",T)};let ee=!1;const oe=()=>{ee||(ee=!0,e.nextTick(()=>{i("onInitComplete","days")}))},ie=()=>{t.selectDate=O.getMomentDate(v.selectValue),t.startDate=O.getMomentDate(v.startValue),t.endDate=O.getMomentDate(v.endValue),t.hoverDate=O.getMomentDate(v.hoverValue)},R=(r,w,$)=>{if(w!==$){const T=O.getMomentDate(w);T&&T.isValid()&&(t[r]=T,ie(),te(),B(),X(),oe())}},W=()=>{if(l.isNonEmptyString(v.viewValue)){const r=O.getMomentDate(v.viewValue);r&&r.isValid()&&(t.viewDate=r,ie(),te(),B(),X(),oe())}};e.onMounted(()=>{e.nextTick(()=>{W()})}),e.watch(()=>v.viewValue,(r,w)=>{R("viewDate",r,w)}),e.watch([()=>v.selectValue,()=>v.startValue,()=>v.endValue],()=>{t.viewDate&&(t.selectDate=O.getMomentDate(v.selectValue),t.startDate=O.getMomentDate(v.startValue),t.endDate=O.getMomentDate(v.endValue),t.hoverDate=O.getMomentDate(v.hoverValue),X())}),e.watch(()=>v.hoverValue,()=>{t.viewDate&&(t.hoverDate=O.getMomentDate(v.hoverValue),x.isRange&&X())}),e.watch([()=>v.minValue,()=>v.maxValue],()=>{t.viewDate&&(B(),X())});const q=r=>{r.preventDefault(),r.stopPropagation(),Z("subtract",1,"years")},ae=r=>{r.preventDefault(),r.stopPropagation(),Z("subtract",1,"months")},L=r=>{r.preventDefault(),r.stopPropagation(),Z("add",1,"months")},V=r=>{r.preventDefault(),r.stopPropagation(),Z("add",1,"years")},u=(r,w)=>{r.preventDefault(),r.stopPropagation(),i("onChangeType",w)},p=(r,w)=>{r.preventDefault(),r.stopPropagation(),w.isDisabled||i("onSelectDate","days",w)},S=(r,w)=>{r.preventDefault(),r.stopPropagation(),w.isDisabled||i("onHoverDate","days",w)};return(r,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value),id:e.unref(k)},[e.createElementVNode("table",be,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",_e,[e.createElementVNode("span",Te,[a.isPrevYear?(e.openBlock(),e.createElementBlock("span",{key:0,class:"prev-year",title:e.unref(I).prevYear,onClick:q},[e.createVNode(he._sfc_main,{name:"angle-double-left"})],8,Be)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),a.isPrevMonth?(e.openBlock(),e.createElementBlock("span",{key:2,class:"prev-month",title:e.unref(I).prevMonth,onClick:ae},[e.createVNode(he._sfc_main,{name:"angle-left"})],8,$e)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64))]),e.createElementVNode("span",{class:"datetime-switch-year",onClick:w[0]||(w[0]=$=>u($,"years"))},e.toDisplayString(a.titleYear),1),e.createElementVNode("span",{class:"datetime-switch-month",onClick:w[1]||(w[1]=$=>u($,"months"))},e.toDisplayString(a.titleMonth),1),e.createElementVNode("span",Ye,[a.isNextYear?(e.openBlock(),e.createElementBlock("span",{key:0,class:"next-year",title:e.unref(I).nextYear,onClick:V},[e.createVNode(he._sfc_main,{name:"angle-double-right"})],8,Ne)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),a.isNextMonth?(e.openBlock(),e.createElementBlock("span",{key:2,class:"next-month",title:e.unref(I).nextMonth,onClick:L},[e.createVNode(he._sfc_main,{name:"angle-right"})],8,Oe)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64))])])]),e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,($,T)=>(e.openBlock(),e.createElementBlock("th",{key:`${C}-week-${T}`},e.toDisplayString($),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,($,T)=>(e.openBlock(),e.createElementBlock("tr",{key:`${C}-days-${T}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.days,(Y,se)=>(e.openBlock(),e.createElementBlock("td",{key:`${C}-day-${se}`,role:"gridcell",tabindex:"0","aria-disabled":Y.isDisabled,class:e.normalizeClass(Y.cls),onClick:G=>p(G,Y),onKeydown:[e.withKeys(e.withModifiers(G=>p(G,Y),["prevent"]),["enter"]),e.withKeys(e.withModifiers(G=>p(G,Y),["prevent"]),["space"])],onMouseover:G=>S(G,Y)},e.toDisplayString(Y.day),43,Ie))),128))]))),128))])])],10,xe))}}),Re=["id"],Ae={class:"table-base"},Le={class:"time-head time-head-month"},Fe={class:"time-prev"},He=["title"],Qe={class:"time-next"},je=["title"],Ke={class:"time-body-month"},ze=["aria-disabled","onClick","onKeydown","onMouseover"],Je=e.defineComponent({name:"ClCalendarsMonths",__name:"CalendarsMonths",props:{className:String,viewValue:String,selectValue:String,startValue:String,endValue:String,hoverValue:String,minValue:String,maxValue:String},emits:{onChangeDate:f=>!0,onChangeType:f=>!0,onSelectDate:(f,ne)=>!0,onHoverDate:(f,ne)=>!0,onInitComplete:f=>!0},setup(f,{emit:ne}){const v=f,i=ne,I=`calendarsMonths-${l.getRandom(5)}`,{optPageLanguage:_,getPageLanguage:O}=ve.useLanguage();O("dataTime");const x=e.inject("$DateTimeTop"),h=e.inject("$DateTimeTopBase"),C=e.inject("$DateTimeBase");(!x||!h||!C)&&de.warn("ClCalendarsMonths","未找到 $DateTimeTop/$DateTimeTopBase/$DateTimeBase 注入,请确保组件在 ClDateTime 组件树内使用");const k=x?.elId?`${x.elId}-calendarsMonths-${l.getRandom(5)}`:void 0,c=e.computed(()=>{let V={"panel-calendarsmonths":!0};return V=l.getJsonMerge(V,pe.getClassNameJson(v.className)),V}),a=e.reactive({isPrevYear:!1,titleYear:"",isNextYear:!1}),m=e.ref([]),n={viewDate:null,selectDate:null,startDate:null,endDate:null,hoverDate:null},t=()=>{if(!n.viewDate)return;const V=n.viewDate.year(),u=n.viewDate.clone().subtract(1,"years").endOf("year"),p=C.checkDataMinMax(u,"month"),S=n.viewDate.clone().add(1,"years").startOf("year"),r=C.checkDataMinMax(S,"month");a.isPrevYear=!p,a.titleYear=`${V}${_.value.year}`,a.isNextYear=!r},B=()=>{if(!n.viewDate)return;const V=n.viewDate.clone(),u=C.getFocusDate(),p=n.selectDate,S=V.year(),r=[];V.localeData().monthsShort().forEach((w,$)=>{const T=C.getViewMin(S,$);let Y=!!(p&&T.isSame(p,"month")),se=!!(u&&T.isSame(u,"month"));const G=C.checkDataMinMax(T,"month");let j=!1,J=!1,K=!1;h.isRange&&(se=!1,n.hoverDate?n.startDate&&n.endDate&&n.startDate.isSame(n.hoverDate,"month")&&n.hoverDate.isBefore(n.endDate,"month")?(j=T.isSame(n.startDate,"month"),J=T.isSame(n.endDate,"month"),K=j||J||T.isAfter(n.startDate,"month")&&T.isBefore(n.endDate,"month")):n.startDate?(j=T.isSame(n.startDate,"month"),K=j||T.isSame(n.hoverDate,"month"),K=K||T.isAfter(n.startDate,"month")&&T.isBefore(n.hoverDate,"month"),J=!!(n.hoverDate&&n.hoverDate.isSame(n.startDate,"month"))&&j):n.endDate&&(J=T.isSame(n.endDate,"month"),K=J||T.isSame(n.hoverDate,"month"),K=K||T.isAfter(n.hoverDate,"month")&&T.isBefore(n.endDate,"month"),j=!!(n.hoverDate&&n.hoverDate.isSame(n.endDate,"month"))&&J):(j=!!(n.startDate&&T.isSame(n.startDate,"month")),n.endDate&&n.startDate&&(J=T.isSame(n.endDate,"month"),K=T.isAfter(n.startDate,"month")&&T.isBefore(n.endDate,"month"))),Y=j||J),h.layerType==="months"&&(se=!1);const re=pe.getAddClass("month",{active:Y&&!G,focused:se,disabled:G,"date-start":j,"date-end":J,"range-in":K});r.push({cls:re,month:w,isDisabled:G,value:$})}),m.value=r},te=(V,u,p)=>{if(!n.viewDate)return;const S=n.viewDate.clone()[V](u,p);i("onChangeDate",S)};let X=!1;const Z=()=>{X||(X=!0,e.nextTick(()=>{i("onInitComplete","months")}))},ee=()=>{n.selectDate=x.getMomentDate(v.selectValue),n.startDate=x.getMomentDate(v.startValue),n.endDate=x.getMomentDate(v.endValue),n.hoverDate=x.getMomentDate(v.hoverValue)},oe=(V,u,p)=>{if(u!==p){const S=x.getMomentDate(u);S&&S.isValid()&&(n[V]=S,ee(),t(),B(),Z())}},ie=()=>{const V=x.getMomentDate(v.viewValue);V&&V.isValid()&&(n.viewDate=V,ee(),t(),B(),Z())};e.onMounted(()=>{e.nextTick(()=>{ie()})}),e.watch(()=>v.viewValue,(V,u)=>{oe("viewDate",V,u)}),e.watch([()=>v.selectValue,()=>v.startValue,()=>v.endValue,()=>v.hoverValue],()=>{n.viewDate&&(n.selectDate=x.getMomentDate(v.selectValue),n.startDate=x.getMomentDate(v.startValue),n.endDate=x.getMomentDate(v.endValue),n.hoverDate=x.getMomentDate(v.hoverValue),B())}),e.watch([()=>v.minValue,()=>v.maxValue],()=>{n.viewDate&&(t(),B())});const R=V=>{V.preventDefault(),V.stopPropagation(),te("subtract",1,"years")},W=V=>{V.preventDefault(),V.stopPropagation(),te("add",1,"years")},q=(V,u)=>{V.preventDefault(),V.stopPropagation(),i("onChangeType",u)},ae=(V,u)=>{V.preventDefault(),V.stopPropagation(),u.isDisabled||i("onSelectDate","months",u)},L=(V,u)=>{V.preventDefault(),V.stopPropagation(),u.isDisabled||i("onHoverDate","months",u)};return(V,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value),id:e.unref(k)},[e.createElementVNode("table",Ae,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",Le,[e.createElementVNode("span",Fe,[a.isPrevYear?(e.openBlock(),e.createElementBlock("span",{key:0,class:"prev-year",title:e.unref(_).prevYear,onClick:R},[e.createVNode(he._sfc_main,{name:"angle-left"})],8,He)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))]),e.createElementVNode("span",{class:"datetime-switch-year",onClick:u[0]||(u[0]=p=>q(p,"years"))},e.toDisplayString(a.titleYear),1),e.createElementVNode("span",Qe,[a.isNextYear?(e.openBlock(),e.createElementBlock("span",{key:0,class:"next-year",title:e.unref(_).nextYear,onClick:W},[e.createVNode(he._sfc_main,{name:"angle-right"})],8,je)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])])])]),e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",Ke,[e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(p,S)=>(e.openBlock(),e.createElementBlock("span",{key:`${I}-month-${S}`,role:"button",tabindex:"0","aria-disabled":p.isDisabled,class:e.normalizeClass(p.cls),onClick:r=>ae(r,p),onKeydown:[e.withKeys(e.withModifiers(r=>ae(r,p),["prevent"]),["enter"]),e.withKeys(e.withModifiers(r=>ae(r,p),["prevent"]),["space"])],onMouseover:r=>L(r,p)},e.toDisplayString(p.month),43,ze))),128))])])])])])],10,Re))}}),qe=["id"],Ue={class:"table-base"},Ze={class:"time-head time-head-year"},We={class:"time-prev"},Ge=["title"],Xe={class:"time-next"},et=["title"],tt={class:"time-body-year"},at=["aria-disabled","onClick","onKeydown","onMouseover"],nt=e.defineComponent({name:"ClCalendarsYears",__name:"CalendarsYears",props:{className:String,viewValue:String,selectValue:String,startValue:String,endValue:String,hoverValue:String,minValue:String,maxValue:String},emits:{onChangeDate:f=>!0,onSelectDate:(f,ne)=>!0,onHoverDate:(f,ne)=>!0,onInitComplete:f=>!0},setup(f,{emit:ne}){const v=f,i=ne,{optPageLanguage:I,getPageLanguage:_}=ve.useLanguage();_("dataTime");const O=e.inject("$DateTimeTop"),x=e.inject("$DateTimeTopBase"),h=e.inject("$DateTimeBase");(!O||!x||!h)&&de.warn("ClCalendarsYears","未找到 $DateTimeTop/$DateTimeTopBase/$DateTimeBase 注入,请确保组件在 ClDateTime 组件树内使用");const C=`calendarsYears-${l.getRandom(5)}`,k=O?.elId?`${O.elId}-calendarsYears-${l.getRandom(5)}`:void 0,c=e.computed(()=>{let V={"panel-calendarsyears":!0};return V=l.getJsonMerge(V,pe.getClassNameJson(v.className)),V}),a=e.reactive({isPrevYear:!1,titleYear:"",isNextYear:!1}),m=e.ref([]),n={startYear:0,viewDate:null,selectDate:null,startDate:null,endDate:null,hoverDate:null},t=()=>{if(!n.viewDate)return;const V=`${n.startYear}-${n.startYear+9}`,u=O.getMomentDate({year:n.startYear-1,month:11}),p=O.getMomentDate({year:n.startYear+10,month:0}),S=u?h.checkDataMinMax(u.endOf("month"),"year"):!1,r=p?h.checkDataMinMax(p.startOf("month"),"year"):!1;a.isPrevYear=!S,a.titleYear=V,a.isNextYear=!r},B=()=>{const V=h.getFocusDate(),u=n.selectDate,p=[];for(let S=-1;S<11;S+=1){const r=n.startYear+S,w=h.getViewMin(r),$=S===-1,T=S>9;let Y=u?w.isSame(u,"year"):!1,se=!!(V&&w.isSame(V,"year"));const G=h.checkDataMinMax(w,"year");let j=!1,J=!1,K=!1;if(x.isRange){if(se=!1,n.hoverDate){const ce=parseInt(n.hoverDate.format("YYYY"),10);n.startDate&&n.endDate&&n.startDate.isSame(n.hoverDate,"year")&&n.hoverDate.isBefore(n.endDate,"year")?(j=r===parseInt(n.startDate.format("YYYY"),10),J=r===parseInt(n.endDate.format("YYYY"),10),K=j||J||r>parseInt(n.startDate.format("YYYY"),10)&&r<parseInt(n.endDate.format("YYYY"),10)):n.startDate?(j=r===parseInt(n.startDate.format("YYYY"),10),K=j||r===ce,K=K||w.isAfter(n.startDate,"year")&&w.isBefore(n.hoverDate,"year"),J=!1):n.endDate&&(J=r===parseInt(n.endDate.format("YYYY"),10),K=J||r===ce,K=K||w.isAfter(n.hoverDate,"year")&&w.isBefore(n.endDate,"year"),j=!!(n.hoverDate&&n.hoverDate.isSame(n.endDate,"year"))&&J)}else j=!!(n.startDate&&w.isSame(n.startDate,"year")),n.endDate&&n.startDate&&(J=w.isSame(n.endDate,"year"),K=w.isAfter(n.startDate,"year")&&w.isBefore(n.endDate,"year"));Y=j||J}x.layerType==="years"&&(se=!1);const re=pe.getAddClass("year",{old:$,new:T,active:Y&&!$&&!T,focused:se,disabled:G,"date-start":j&&!$&&!T,"date-end":J&&!$&&!T,"range-in":K&&!$&&!T});p.push({cls:re,year:r,isDisabled:G,value:r})}m.value=p},te=()=>{n.viewDate&&(n.startYear=Math.floor(n.viewDate.year()/10)*10,t(),B())},X=(V,u,p)=>{n.viewDate&&(n.viewDate=n.viewDate.clone()[V](u,p),te(),i("onChangeDate",n.viewDate))};let Z=!1;const ee=()=>{Z||(Z=!0,e.nextTick(()=>{i("onInitComplete","years")}))},oe=()=>{n.selectDate=O.getMomentDate(v.selectValue),n.startDate=O.getMomentDate(v.startValue),n.endDate=O.getMomentDate(v.endValue),n.hoverDate=O.getMomentDate(v.hoverValue)},ie=(V,u,p)=>{if(u!==p){const S=O.getMomentDate(u);S&&S.isValid()?(n[V]=S,oe(),te(),ee()):(n.viewDate=null,n.startYear=0,m.value=[],a.isPrevYear=!1,a.isNextYear=!1,a.titleYear="")}},R=()=>{const V=O.getMomentDate(v.viewValue);V&&V.isValid()&&(n.viewDate=V,oe(),te(),ee())};e.onMounted(()=>{e.nextTick(()=>{R()})}),e.watch(()=>v.viewValue,(V,u)=>{ie("viewDate",V,u)}),e.watch([()=>v.selectValue,()=>v.startValue,()=>v.endValue,()=>v.hoverValue],()=>{n.viewDate&&(n.selectDate=O.getMomentDate(v.selectValue),n.startDate=O.getMomentDate(v.startValue),n.endDate=O.getMomentDate(v.endValue),n.hoverDate=O.getMomentDate(v.hoverValue),B())}),e.watch([()=>v.minValue,()=>v.maxValue],()=>{n.viewDate&&(t(),B())});const W=V=>{V.preventDefault(),V.stopPropagation(),X("subtract",10,"years")},q=V=>{V.preventDefault(),V.stopPropagation(),X("add",10,"years")},ae=(V,u)=>{V.preventDefault(),V.stopPropagation(),u.isDisabled||i("onSelectDate","years",u)},L=(V,u)=>{V.preventDefault(),V.stopPropagation(),u.isDisabled||i("onHoverDate","years",u)};return(V,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value),id:e.unref(k)},[e.createElementVNode("table",Ue,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",Ze,[e.createElementVNode("span",We,[a.isPrevYear?(e.openBlock(),e.createElementBlock("span",{key:0,class:"prev-year",title:e.unref(I).prevYear10,onClick:W},[e.createVNode(he._sfc_main,{name:"angle-left"})],8,Ge)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))]),e.createElementVNode("span",null,e.toDisplayString(a.titleYear),1),e.createElementVNode("span",Xe,[a.isNextYear?(e.openBlock(),e.createElementBlock("span",{key:0,class:"next-year",title:e.unref(I).nextYear10,onClick:q},[e.createVNode(he._sfc_main,{name:"angle-right"})],8,et)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])])])]),e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(p,S)=>(e.openBlock(),e.createElementBlock("span",{key:`${C}-${p.year}-${S}`,role:"button",tabindex:"0","aria-disabled":p.isDisabled,class:e.normalizeClass(p.cls),onClick:r=>ae(r,p),onKeydown:[e.withKeys(e.withModifiers(r=>ae(r,p),["prevent"]),["enter"]),e.withKeys(e.withModifiers(r=>ae(r,p),["prevent"]),["space"])],onMouseover:r=>L(r,p)},e.toDisplayString(p.year),43,at))),128))])])])])],10,qe))}}),st=["id"],ot={class:"times-container"},it=["title"],lt=["title"],rt={class:"times-clock"},ct={class:"clock-nums"},ut=["aria-disabled","onClick","onKeydown"],mt={class:"clock-pointer"},dt={class:"clock-am"},ft="2000-01-01",Dt=e.defineComponent({name:"ClCalendarsClocks",__name:"CalendarsClock",props:{className:String,selectDay:String,selectValue:String,minValue:String,maxValue:String,isShowPointer:{type:Boolean,default:!0},isShowSubmit:{type:Boolean,default:!1},isShowCancel:{type:Boolean,default:!1},isClickOverlay:{type:Boolean,default:!1}},emits:{onSubmit:f=>!0,onInitComplete:f=>!0},setup(f,{emit:ne}){const v=f,i=ne,I=`calendarsClock-${l.getRandom(5)}`,{optPageLanguage:_,getPageLanguage:O}=ve.useLanguage();O("dataTime");const x=e.inject("$DateTimeTop"),h=e.inject("$DateTimeTopBase");(!x||!h)&&de.warn("ClCalendarsClocks","未找到 $DateTimeTop/$DateTimeTopBase 注入,请确保组件在 ClDateTime 组件树内使用");const C=x?.elId?`${x.elId}-calendarsClock-${l.getRandom(5)}`:void 0,k=e.reactive({isOpen:!1,activePointer:"hour",activeAm:"am"}),c=e.reactive({hour:!0,hourDisabled:!1,minute:!0,minuteDisabled:!1,minuteShowAddSub:!0,second:!0,secondDisabled:!1}),a=e.reactive({hour:-90,hourMinute:0,minute:-90,minuteSecond:0,second:-90}),m=e.reactive({hour:"00",minute:"00",second:"00"}),n=e.ref([]),t={selectDayDate:null,minDate:null,maxDate:null,timeAngle:{hour:30,minute:6,second:6},num:{hourAm:[0,1,2,3,4,5,6,7,8,9,10,11],hourPm:[12,13,14,15,16,17,18,19,20,21,22,23],minute:[0,5,10,15,20,25,30,35,40,45,50,55],second:[0,5,10,15,20,25,30,35,40,45,50,55]},origValue:{hour:"00",minute:"00",second:"00"},lastValue:{hour:"00",minute:"00",second:"00"},isCheckMin:!1,checkMinDiff:null,min:{hour:0,minute:0,second:0},isCheckMax:!1,checkMaxDiff:null,max:{hour:0,minute:0,second:0}},B=e.computed(()=>{let o={"panel-calendarsclocks":!0,"datetime-times":!0};return o["times-open"]=k.isOpen,o=l.getJsonMerge(o,pe.getClassNameJson(v.className)),o}),te=e.computed(()=>{const o={"pointer-hour":!0};return o["pointer-active"]=k.activePointer==="hour",o["pointer-disabled"]=c.hourDisabled,o}),X=e.computed(()=>{const o={"pointer-minute":!0};return o["pointer-active"]=k.activePointer==="minute",o["pointer-disabled"]=c.minuteDisabled,o}),Z=e.computed(()=>{const o={"pointer-second":!0};return o["pointer-active"]=k.activePointer==="second",o["pointer-disabled"]=c.secondDisabled,o}),ee=e.computed(()=>{const o={"am-am":!0};return o["am-active"]=k.activeAm==="am",o}),oe=e.computed(()=>{const o={"am-pm":!0};return o["am-active"]=k.activeAm==="pm",o}),ie=e.computed(()=>{const o={"clock-set":!0,"clock-set-hour":!0};return o["clock-set-active"]=k.activePointer==="hour",o["clock-set-disabled"]=c.hourDisabled,o}),R=e.computed(()=>{const o={"clock-set":!0,"clock-set-minute":!0};return o["clock-set-active"]=k.activePointer==="minute",o["clock-set-disabled"]=c.minuteDisabled,o}),W=e.computed(()=>{const o={"clock-set":!0,"clock-set-second":!0};return o["clock-set-active"]=k.activePointer==="second",o["clock-set-disabled"]=c.secondDisabled,o}),q=(o,d)=>{t[o]=x.getMomentDate(d)},ae=o=>{let d=parseInt(t.lastValue[o],10),y=parseInt(m[o],10),A=0;return o==="hour"?(y===0&&d===23&&(y=24),d===0&&y===23&&(d=24),y-d>6&&(d+=12),d-y>=6&&(y+=12),A=y-d):(y-d>30&&(d+=60),d-y>=30&&(y+=60),A=y-d),A},L=o=>{const y=ae(o)*t.timeAngle[o];return a[o]+(y>=360?y%360:y)},V=()=>{const o=L("hour"),d=t.timeAngle.hour*parseFloat((parseInt(m.minute,10)/60).toString()),y=L("minute"),A=t.timeAngle.second*parseFloat((parseInt(m.second,10)/60).toString()),U=L("second");a.hour=o,a.hourMinute=d,a.minute=y,a.minuteSecond=A,a.second=U},u=o=>parseInt(o,10)<12?"am":"pm",p=(o,d)=>{let y=!0;switch(o){case"hour":y=!0;break;case"minute":y=parseInt(m.hour,10)===t[d].hour;break;case"second":y=parseInt(m.hour,10)===t[d].hour&&parseInt(m.minute,10)===t[d].minute;break}return y},S=()=>t.isCheckMin&&t.isCheckMax&&t.checkMinDiff===0&&t.checkMaxDiff===0&&t.min.hour>t.max.hour,r=(o,d)=>{let y=!1;return S()&&o==="hour"?y=d<t.min[o]&&d>t.max[o]:t.isCheckMin&&(t.checkMinDiff===0?p(o,"min")&&(y=d<t.min[o]):t.checkMinDiff<0&&(y=!0)),!y&&t.isCheckMax&&(t.checkMaxDiff===0?p(o,"max")&&(y=d>t.max[o]):t.checkMaxDiff>0&&(y=!0)),y},w=o=>{let d=o;d==="hour"&&(d=k.activeAm==="am"?"hourAm":"hourPm");const y=c[`${o}Disabled`],A=[];t.num[d].forEach((U,Q)=>{const le={num:U,cls:"clock-num",isDisabled:!1};le.cls+=` clock-num${Q+1} `,le.isDisabled=y?!0:r(o,U),le.isDisabled&&(le.cls+=" clock-nums-disabled "),A.push(le)}),n.value=A},$=o=>{k.activePointer=o,o==="hour"&&(k.activeAm=u(m.hour)),w(o)},T=o=>{let d=null;if(!l.isUndefined(o)&&!l.isUndefined(t.selectDayDate)){const y=t.selectDayDate.clone().format("YYYY-MM-DD 00:00:00"),A=o.clone().format("YYYY-MM-DD 00:00:00");d=x.Dayjs(y).diff(x.Dayjs(A))}return d},Y=(o=!0)=>{a.hour=-90,a.hourMinute=0,a.minute=-90,a.minuteSecond=0,a.second=-90,t.lastValue={hour:"00",minute:"00",second:"00"},V(),e.nextTick(()=>{const d=m.hour,y=m.minute,A=m.second;t.lastValue={hour:d,minute:y,second:A},o&&(t.origValue={hour:d,minute:y,second:A})})},se=(o,d)=>{t.lastValue.hour=m.hour,t.lastValue.minute=m.minute,t.lastValue.second=m.second,m[o]=l.getFillZero(d),V(),v.isShowSubmit||i("onSubmit",`${m.hour}:${m.minute}:${m.second}`)},G=o=>{let d=0,y=0,A=0;if(!l.isEmpty(o)){const U=(l.isEmpty(t.selectDayDate)?x.getNow():t.selectDayDate).format("YYYY-MM-DD"),Q=x.getMomentDate(`${U} ${o}`);Q&&Q.isValid()&&(d=Q.hour(),y=Q.minute(),A=Q.second())}return{HH:d,mm:y,ss:A}},j=()=>{let o=!0,d=!0;const y=l.isEmpty(t.selectDayDate),A=G(v.selectValue),U=A.HH,Q=A.mm,le=A.ss;switch(h.layerType){case"hours":o=!1,d=!1;break;case"minutes":d=!1;break}t.isCheckMin=!l.isUndefined(t.minDate),t.isCheckMin&&(t.checkMinDiff=x.checkIsTimes()?0:T(t.minDate),t.min={hour:t.minDate.hour(),minute:t.minDate.minute(),second:t.minDate.second()}),t.isCheckMax=!l.isUndefined(t.maxDate),t.isCheckMax&&(t.checkMaxDiff=x.checkIsTimes()?0:T(t.maxDate),t.max={hour:t.maxDate.hour(),minute:t.maxDate.minute(),second:t.maxDate.second()});const ke=l.getFillZero(U);let fe=l.getFillZero(Q),ge=l.getFillZero(le);o||(fe="00"),d||(ge="00"),t.origValue={hour:ke,minute:fe,second:ge},c.hour=!0,c.minute=o,c.second=d,m.hour=ke,m.minute=fe,m.second=ge,x.checkIsTimes()||(c.hourDisabled=y,c.minuteDisabled=y,c.secondDisabled=y),h.layerType==="hours"&&(c.minute=!0,c.minuteDisabled=!0,c.minuteShowAddSub=!1),J(),K()},J=()=>{t.lastValue={hour:"00",minute:"00",second:"00"},a.hour=-90,a.hourMinute=0,a.minute=-90,a.minuteSecond=0,a.second=-90},K=()=>{V(),k.activeAm=u(m.hour),w(k.activePointer)},re=()=>{k.isOpen=v.isShowPointer,q("selectDayDate",x.checkIsTimes()?ft:v.selectDay),q("minDate",x.getValueEffective(v.minValue)),q("maxDate",x.getValueEffective(v.maxValue)),j(),$("hour"),Y(),e.nextTick(()=>{i("onInitComplete","times")})},ce=o=>{let d=!1;return c[o]&&!c[`${o}Disabled`]&&(k.isOpen?d=!0:(Y(!1),k.isOpen=!0,$(o))),d},ye=(o,d)=>{if(c[o]&&!c[`${o}Disabled`]&&k.isOpen){let y=!0,A=0,U=o==="hour"?23:59;if(t.isCheckMin&&(t.checkMinDiff===0?p(o,"min")&&(A=t.min[o]):t.checkMinDiff<0&&(y=!1)),t.isCheckMax&&(t.checkMaxDiff===0?p(o,"max")&&(U=t.max[o]):t.checkMaxDiff>0&&(y=!1)),y){const Q=parseInt(m[o],10);let le=0;S()&&o==="hour"?le=d==="add"?Q>=23?0:Q+1:Q<=0?23:Q-1:d==="add"?le=Q<A||Q>=U?A:Q+1:le=Q>U||Q<=A?U:Q-1,r(o,le)||(se(o,le),$(o))}}};e.onMounted(()=>{e.nextTick(()=>{re()})}),e.watch(()=>v.selectDay,(o,d)=>{q("selectDayDate",o),j()}),e.watch(()=>v.minValue,(o,d)=>{const y=x.getValueEffective(o);q("minDate",y),j()}),e.watch(()=>v.maxValue,(o,d)=>{const y=x.getValueEffective(o);q("maxDate",y),j()}),e.watch(()=>v.selectValue,(o,d)=>{const y=G(o),A=l.getFillZero(y.HH),U=l.getFillZero(y.mm),Q=l.getFillZero(y.ss);(m.hour!==A||m.minute!==U||m.second!==Q)&&(m.hour=A,m.minute=U,m.second=Q,t.origValue={hour:A,minute:U,second:Q},J(),K())});const D=o=>{c[o]&&!c[`${o}Disabled`]&&($(o),k.isOpen||(Y(),k.isOpen=!0))},b=o=>{if(!o.isDisabled){const d=k.activePointer,y=parseInt(m[d],10),A=o.num;A!==y&&se(d,A)}},E=o=>{k.activeAm=o,k.activePointer="hour";const d=parseInt(m.hour,10);o==="pm"&&d<12?m.hour=l.getFillZero(d+12):o==="am"&&d>=12&&(m.hour=l.getFillZero(d-12)),V(),w("hour")},N=()=>ce("hour"),s=o=>{let d=!1,y=!1;const A=S();if(t.isCheckMin){if(t.checkMinDiff<0)d=!0,y=!0;else if(t.checkMinDiff===0){const U=parseInt(m[o],10);p(o,"min")&&(d=A?U===t.min[o]:U<=t.min[o])}}if(t.isCheckMax){if(t.checkMaxDiff>0)d=!0,y=!0;else if(t.checkMaxDiff===0){const U=parseInt(m[o],10);p(o,"max")&&(y=A?U===t.max[o]:U>=t.max[o])}}return{subtractDisabled:d,addDisabled:y}},g=o=>(l.isEmpty(o.type)||ye("hour",o.type),{value:m.hour,...s("hour")}),M=()=>ce("minute"),P=o=>(l.isEmpty(o.type)||ye("minute",o.type),{value:m.minute,...s("minute")}),F=()=>ce("second"),z=o=>(l.isEmpty(o.type)||ye("second",o.type),{value:m.second,...s("second")}),ue=()=>{v.isClickOverlay&&k.isOpen&&(x.checkIsTimes()||(k.isOpen=!1),i("onSubmit",`${m.hour}:${m.minute}:${m.second}`))},me=()=>{x.checkIsTimes()||(k.isOpen=!1),i("onSubmit",`${m.hour}:${m.minute}:${m.second}`)},De=()=>{(m.hour!==t.origValue.hour||m.minute!==t.origValue.minute||m.second!==t.origValue.second)&&(t.lastValue.hour=m.hour,t.lastValue.minute=m.minute,t.lastValue.second=m.second,m.hour=t.origValue.hour,m.minute=t.origValue.minute,m.second=t.origValue.second,K()),x.checkIsTimes()||(k.isOpen=!1)};return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(B.value),id:e.unref(C)},[d[15]||(d[15]=e.createElementVNode("div",{class:"datetime-times-inner"},null,-1)),e.createElementVNode("div",null,[e.createElementVNode("div",ot,[e.createElementVNode("div",{class:"times-overlay",onClick:ue}),f.isShowCancel?(e.openBlock(),e.createElementBlock("div",{key:0,class:"times-cancel",title:e.unref(_).common.cancel,onClick:De},[e.createVNode(he._sfc_main,{name:"close1"})],8,it)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),f.isShowSubmit?(e.openBlock(),e.createElementBlock("div",{key:2,class:"times-submit",title:e.unref(_).common.submit,onClick:me},[e.createVNode(he._sfc_main,{name:"check1"})],8,lt)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),e.createElementVNode("div",rt,[e.createElementVNode("div",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(y,A)=>(e.openBlock(),e.createElementBlock("div",{key:`${I}-clock-${A}`,role:"button",tabindex:"0","aria-disabled":y.isDisabled,class:e.normalizeClass(y.cls),onClick:U=>b(y),onKeydown:[e.withKeys(e.withModifiers(U=>b(y),["prevent"]),["enter"]),e.withKeys(e.withModifiers(U=>b(y),["prevent"]),["space"])]},e.toDisplayString(y.num),43,ut))),128))]),e.createElementVNode("div",mt,[c.hour?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(te.value),onClick:d[0]||(d[0]=y=>D("hour")),style:e.normalizeStyle({transform:`rotate(${a.hour+a.hourMinute}deg)`})},null,6)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),c.minute?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(X.value),onClick:d[1]||(d[1]=y=>D("minute")),style:e.normalizeStyle({transform:`rotate(${a.minute+a.minuteSecond}deg)`})},null,6)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),c.second?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(Z.value),onClick:d[2]||(d[2]=y=>D("second")),style:e.normalizeStyle({transform:`rotate(${a.second}deg)`})},null,6)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[],64))]),e.withDirectives(e.createElementVNode("div",dt,[e.createElementVNode("small",{role:"button",tabindex:"0",class:e.normalizeClass(ee.value),onClick:d[3]||(d[3]=y=>E("am")),onKeydown:[d[4]||(d[4]=e.withKeys(e.withModifiers(y=>E("am"),["prevent"]),["enter"])),d[5]||(d[5]=e.withKeys(e.withModifiers(y=>E("am"),["prevent"]),["space"]))]},e.toDisplayString(e.unref(_).am),35),e.createElementVNode("small",{role:"button",tabindex:"0",class:e.normalizeClass(oe.value),onClick:d[6]||(d[6]=y=>E("pm")),onKeydown:[d[7]||(d[7]=e.withKeys(e.withModifiers(y=>E("pm"),["prevent"]),["enter"])),d[8]||(d[8]=e.withKeys(e.withModifiers(y=>E("pm"),["prevent"]),["space"]))]},e.toDisplayString(e.unref(_).pm),35)],512),[[e.vShow,k.activePointer==="hour"]])])]),c.hour?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ie.value),onClick:d[10]||(d[10]=y=>D("hour"))},[e.createVNode(we._sfc_main,{value:m.hour,"onUpdate:value":d[9]||(d[9]=y=>m.hour=y),size:"small",isClean:!1,disabled:c.hourDisabled,isTextRead:!0,fillZeroCount:2,isLoop:!0,btnTheme:"upDown",operateBtnDownBeforeCallback:N,calculationOperateValueCallback:g},null,8,["value","disabled"])],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),c.minute&&c.minuteShowAddSub?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(R.value),onClick:d[12]||(d[12]=y=>D("minute"))},[e.createVNode(we._sfc_main,{value:m.minute,"onUpdate:value":d[11]||(d[11]=y=>m.minute=y),size:"small",isClean:!1,disabled:c.minuteDisabled,isTextRead:!0,fillZeroCount:2,isLoop:!0,btnTheme:"upDown",operateBtnDownBeforeCallback:M,calculationOperateValueCallback:P},null,8,["value","disabled"])],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),c.second?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(W.value),onClick:d[14]||(d[14]=y=>D("second"))},[e.createVNode(we._sfc_main,{value:m.second,"onUpdate:value":d[13]||(d[13]=y=>m.second=y),size:"small",isClean:!1,disabled:c.secondDisabled,isTextRead:!0,fillZeroCount:2,isLoop:!0,btnTheme:"upDown",operateBtnDownBeforeCallback:F,calculationOperateValueCallback:z},null,8,["value","disabled"])],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[],64))])],10,st))}}),ht=["id"],Se=e.defineComponent({name:"ClCalendarsBase",__name:"CalendarsBase",props:{className:String,viewValue:String,selectValue:String,startValue:String,endValue:String,hoverValue:String,minValue:String,maxValue:String},emits:{onSelectDate:f=>!0,onChangeViewValue:f=>!0,onHoverDate:f=>!0,onChangeViewType:f=>!0,onSelectTime:f=>!0,onInitComplete:f=>!0},setup(f,{emit:ne}){const v=f,i=ne,I=e.inject("$DateTimeTop"),_=e.inject("$DateTimeTopBase");(!I||!_)&&de.warn("ClCalendarsBase","未找到 $DateTimeTop/$DateTimeTopBase 注入,请确保组件在 ClDateTime 组件树内使用");const O=I?.elId?`${I.elId}-calendarsBase-${l.getRandom(5)}`:void 0,x=e.computed(()=>{let u={"panel-calendarsbase":!0};return u=l.getJsonMerge(u,pe.getClassNameJson(v.className)),u}),h=e.reactive({currentView:"",viewValue:"",selectValue:"",selectClockDay:"",selectClockTime:""}),C=e.reactive({isShow:!1,isViewDay:!1,isShowClockPointer:!1,isShowClockSubmit:!1,isShowClockCancel:!1,isClockClickOverlay:!1}),k={viewDate:null,selectDate:null,focusDate:null,minDate:null,maxDate:null},c=(u,p)=>{k[u]=l.isString(p)?I.getMomentDate(p):null},a=u=>{const p=Object.keys(u);l.isExistValue(p,"viewValue")&&_.layerView===u.currentView&&i("onChangeViewValue",u.viewValue),p.forEach(S=>{const r=S,w=u[r];l.isExistJsonKey(h,r)&&h[r]!==w&&(h[r]=w),l.isExistJsonKey(k,r)&&(k[r]=w)})},m=(u,p)=>{let S=!1;return l.isEmpty(u)||l.isNaN(u)||(l.isEmpty(k.minDate)||(S=I.Dayjs(u).isBefore(k.minDate,p)),!S&&!l.isEmpty(k.maxDate)&&(S=I.Dayjs(u).isAfter(k.maxDate,p))),S},n=(u,p)=>{let S=0,r=1;if(l.isEmpty(k.minDate))l.isUndefined(p)||(S=p);else{const w=u===k.minDate.year();let $=!0;l.isUndefined(p)?S=w?k.minDate.month():0:($=p===k.minDate.month(),S=p),r=w&&$?k.minDate.date():1}return I.getMomentDate({year:u,month:S,day:r})??I.getNow().startOf("year")},t=u=>{let p="";switch(u){case"months":p="days";break;case"years":p="months";break;default:p="days";break}return p},B=u=>{const S=(u||k.selectDate||k.viewDate).format("YYYY-MM-DD")+" "+(l.isEmpty(h.selectClockTime)?"00:00:00":h.selectClockTime);return I.Dayjs(S)},te=(u,p)=>{const S=k.viewDate.clone(),r=parseInt(p.value,10);if(l.isNaN(r))return B(S);let w;switch(u){case"days":{let $=0;p.isNew?$=1:p.isOld&&($=-1),w=S.month(S.month()+$).date(r);break}case"months":{const $=k.selectDate||S,T=S.month(r);w=T.date(Math.min($.date(),T.daysInMonth()));break}case"years":w=S.month(0).date(1).year(r);break;default:w=S;break}return B(w)},X=()=>{h.viewValue=k.viewDate.format(_.formatIn),k.focusDate=k.viewDate.clone()},Z=u=>{c("selectDate",u==="-1"?"":u);const p=k.selectDate?k.selectDate.format("YYYY-MM-DD"):"";h.selectValue=p,h.selectClockDay=p,h.selectClockTime=k.selectDate?k.selectDate.format("HH:mm:ss"):""},ee=()=>{let u=!1,p=!1,S=!1,r=!1,w=!1,$=!1;h.currentView==="times"?(u=!0,S=!0,$=!1,r=_.isDefault&&_.isShowPopup,w=_.isDefault&&_.isShowPopup,_.layerType==="hours"&&(w=!1,r=!1)):h.currentView==="days"&&(p=_.timeType==="datetime",p&&(w=!0,r=!0,S=!1,$=!0)),C.isShow=u,C.isViewDay=p,C.isShowClockPointer=S,C.isShowClockSubmit=r,C.isShowClockCancel=w,C.isClockClickOverlay=$},oe=()=>{h.currentView=_.layerView,k.viewDate=I.getViewDate(v.viewValue),X(),Z(v.selectValue),c("minDate",v.minValue),c("maxDate",v.maxValue),ee()};e.onMounted(()=>{e.nextTick(()=>{oe()})}),e.watch(()=>v.viewValue,(u,p)=>{k.viewDate=I.getViewDate(u),X()}),e.watch(()=>v.selectValue,(u,p)=>{const S=_.isRange&&u==="-1";let r=u;const w=h.selectClockTime;S&&(r=""),Z(r),S&&(h.selectClockTime=w)}),e.watch(()=>v.minValue,(u,p)=>{c("minDate",u)}),e.watch(()=>v.maxValue,(u,p)=>{c("maxDate",u)});const ie=u=>{a({currentView:h.currentView,viewDate:u.clone(),viewValue:u.format(_.formatIn)})},R=u=>{h.currentView=u,k.focusDate=k.viewDate.clone(),ee(),i("onChangeViewType",u)},W=(u,p)=>{const S=te(u,p),r=S.format("YYYY-MM-DD"),w={};if(_.layerView===u)w.selectDate=S,w.selectValue=r,_.isRange||(w.selectClockDay=r),a(w),i("onSelectDate",r);else{const $=t(u);if($===u){w.selectDate=S,w.selectValue=r,_.isRange||(w.selectClockDay=r),a(w),i("onSelectDate",r);return}w.viewDate=S.clone().startOf("month"),w.viewValue=w.viewDate.format(_.formatIn),w.currentView=$,a(w),ee(),i("onChangeViewType",w.currentView)}},q=(u,p)=>{const S=te(u,p);i("onHoverDate",S)},ae=u=>{a({selectClockTime:u}),i("onSelectTime",u)},L=new Set,V=u=>{_.layerView===u&&!L.has(u)&&(L.add(u),i("onInitComplete",u))};return e.provide("$DateTimeBase",{checkDataMinMax:m,getViewMin:n,getFocusDate:()=>k.focusDate&&k.focusDate.clone()}),(u,p)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(O),class:e.normalizeClass(x.value)},[h.currentView==="days"?(e.openBlock(),e.createBlock(Pe,{key:0,viewValue:h.viewValue,selectValue:h.selectValue,startValue:f.startValue,endValue:f.endValue,hoverValue:f.hoverValue,minValue:f.minValue,maxValue:f.maxValue,onOnChangeDate:ie,onOnChangeType:R,onOnSelectDate:W,onOnHoverDate:q,onOnInitComplete:V},null,8,["viewValue","selectValue","startValue","endValue","hoverValue","minValue","maxValue"])):h.currentView==="months"?(e.openBlock(),e.createBlock(Je,{key:1,viewValue:h.viewValue,selectValue:h.selectValue,startValue:f.startValue,endValue:f.endValue,hoverValue:f.hoverValue,minValue:f.minValue,maxValue:f.maxValue,onOnChangeDate:ie,onOnChangeType:R,onOnSelectDate:W,onOnHoverDate:q,onOnInitComplete:V},null,8,["viewValue","selectValue","startValue","endValue","hoverValue","minValue","maxValue"])):h.currentView==="years"?(e.openBlock(),e.createBlock(nt,{key:2,viewValue:h.viewValue,selectValue:h.selectValue,startValue:f.startValue,endValue:f.endValue,hoverValue:f.hoverValue,minValue:f.minValue,maxValue:f.maxValue,onOnChangeDate:ie,onOnSelectDate:W,onOnHoverDate:q,onOnInitComplete:V},null,8,["viewValue","selectValue","startValue","endValue","hoverValue","minValue","maxValue"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),C.isShow||C.isViewDay?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass({"datetime-days-times":C.isViewDay})},[e.createVNode(Dt,{selectDay:h.selectClockDay,selectValue:h.selectClockTime,minValue:f.minValue,maxValue:f.maxValue,isShowPointer:C.isShowClockPointer,isShowSubmit:C.isShowClockSubmit,isShowCancel:C.isShowClockCancel,isClickOverlay:C.isClockClickOverlay,onOnSubmit:ae,onOnInitComplete:V},null,8,["selectDay","selectValue","minValue","maxValue","isShowPointer","isShowSubmit","isShowCancel","isClickOverlay"])],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[],64))],10,ht))}}),pt=["tabindex","aria-disabled","onKeydown"],yt=e.defineComponent({name:"ClDateTimeDefault",__name:"DateTimeDefault",props:{className:String,value:String,minValue:String,maxValue:String},emits:{onSelectValue:f=>!0,onInitComplete:()=>!0},setup(f,{expose:ne,emit:v}){const i=f,I=v,{optPageLanguage:_,getPageLanguage:O}=ve.useLanguage();O("dataTime");const x=e.inject("$DateTimeTop"),h=e.inject("$DateTimeTopBase");(!x||!h)&&de.warn("ClDateTimeDefault","未找到 $DateTimeTop/$DateTimeTopBase 注入,请确保组件在 ClDateTime 组件树内使用");const C=e.reactive({isShowSubmit:!1,isSubmitDisplay:!1}),k=e.reactive({day:"",time:""}),c=e.computed(()=>{let R={"panel-date-time-default":!0,"datetime-default":!0,"datetime-panel-body":!0};return R=l.getJsonMerge(R,pe.getClassNameJson(i.className)),R}),a=()=>{const R=x.getMergeDayTime(k.day,k.time),W=x.checkValue(R);C.isSubmitDisplay=l.isEmpty(k.day)||W.errMsg.length>0},m=R=>{let W=!1;h.timeType==="datetime"&&(W=R==="days"),C.isShowSubmit=W},n=R=>{let W="",q="",ae=!0;if(l.isNonEmptyString(R)){const L=x.getMomentDate(R);L&&(W=L.format("YYYY-MM-DD"),q=L.format("HH:mm:ss"),ae=!1)}k.day=W,k.time=q,C.isSubmitDisplay=ae,a()},t=()=>{m(h.layerView),n(i.value)},B=()=>{const R=x.getMomentDate(x.getMergeDayTime(k.day,k.time));R&&I("onSelectValue",R)};e.onMounted(()=>{e.nextTick(()=>{t()})}),e.watch(()=>i.value,(R,W)=>{R!==W&&n(R)}),e.watch([()=>i.minValue,()=>i.maxValue],()=>{a()});const te=R=>{k.day=R,a(),h.timeType==="date"&&B()},X=R=>{k.time=R,a(),(h.timeType==="time"||h.timeType==="datetime"&&!C.isSubmitDisplay)&&B()},Z=R=>{m(R)},ee=()=>{C.isShowSubmit&&!C.isSubmitDisplay&&B()},oe=()=>{I("onInitComplete")};return ne({getValue:()=>{const R=x.getMergeDayTime(k.day,k.time);return x.getMomentDate(R)}}),(R,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Se,{class:e.normalizeClass(c.value),selectValue:f.value,viewValue:f.value,minValue:f.minValue,maxValue:f.maxValue,onOnSelectDate:te,onOnSelectTime:X,onOnChangeViewType:Z,onOnInitComplete:oe},null,8,["class","selectValue","viewValue","minValue","maxValue"]),C.isShowSubmit?(e.openBlock(),e.createElementBlock("div",{key:0,role:"button",tabindex:C.isSubmitDisplay?-1:0,"aria-disabled":C.isSubmitDisplay,class:e.normalizeClass({"datetime-days-submit":!0,"days-submit-disabled":C.isSubmitDisplay}),onClick:ee,onKeydown:[e.withKeys(e.withModifiers(ee,["prevent"]),["enter"]),e.withKeys(e.withModifiers(ee,["prevent"]),["space"])]},[e.createElementVNode("span",null,e.toDisplayString(e.unref(_).common.submit),1)],42,pt)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],64))}}),gt=["id"],vt={class:"calendar-range calendar-left"},kt={class:"calendar-text"},Vt={class:"time-input-base"},wt=["value","name"],St={class:"calendar-panel"},Ct={class:"calendar-range calendar-right"},Mt={class:"calendar-text"},Et={class:"time-input-base"},xt=["value","name"],bt={class:"calendar-panel"},_t={class:"calendar-range calendar-quick"},Tt=["onClick","onKeydown"],Bt={key:0,class:"panel-quick-btn"},$t=e.defineComponent({name:"ClDateTimeRange",__name:"DateTimeRange",props:{className:String,startValue:String,endValue:String,minValue:String,maxValue:String,rangeQuick:{type:Array,default:()=>[]}},emits:{onSubmit:f=>!0,onCancel:()=>!0,onInitComplete:()=>!0},setup(f,{expose:ne,emit:v}){const i=f,I=v,_=`dateTimeRange-${l.getRandom(5)}`,{optPageLanguage:O,getPageLanguage:x}=ve.useLanguage();x("dataTime");const h=e.inject("$DateTimeTop"),C=e.inject("$DateTimeTopBase");(!h||!C)&&de.warn("ClDateTimeRange","未找到 $DateTimeTop/$DateTimeTopBase 注入,请确保组件在 ClDateTime 组件树内使用");const k=h?.elId?`${h.elId}-dateTimeRange-${l.getRandom(5)}`:void 0,c=e.computed(()=>{let D={"panel-date-time-range":!0,"panel-range-calendar":!0,"datetime-range":!0,"datetime-panel-body":!0};return D=l.getJsonMerge(D,pe.getClassNameJson(i.className)),D}),a=e.reactive({operateViewDataType:"",selectCount:0,hoverValue:"",activeQuick:"",isCheck:!0,isShowQuickBtn:C.isShowPopup||C.timeType==="datetime",previewStart:"",previewEnd:""}),m=e.reactive({view:"",text:"",name:`input_${l.getRandom(8)}`}),n=e.reactive({view:"",text:"",name:`input_${l.getRandom(8)}`}),t=e.reactive({day:"",time:"",value:""}),B=e.reactive({day:"",time:"",value:""}),te=e.ref([]),X=(D,b)=>{const E=h.getViewDate(D),N=C.layerView==="years"?10:1,s=a.operateViewDataType;return E[b](N,s).format(C.formatIn)},Z=(D,b)=>{if(l.isEmpty(D))return"";const E=b==="right"?C.formatOutEnd:C.formatOut;if(l.isString(D)){const N=h.getMomentDate(D);return N?N.format(E):""}return D.format(E)},ee=()=>{const D=h.getMergeDayTime(t.day,t.time);t.value=D,m.text=Z(D,"left")},oe=()=>{const D=h.getMergeDayTime(B.day,B.time);B.value=D,n.text=Z(D,"right")},ie=()=>{if(a.selectCount===2){let D="-1";if(!l.isEmpty(t.day)&&!l.isEmpty(B.day)&&!l.isEmpty(te.value)){const b="YYYY-MM-DD";let E=h.getMomentDate(t.day,b),N=h.getMomentDate(B.day,b);if(E&&N){switch(C.layerType){case"years":if(E=h.getMomentDate(E.startOf("year").format(b),b),N=h.getMomentDate(N.endOf("year").format(b),b),!E||!N){a.activeQuick="-1";return}break;case"months":if(E=h.getMomentDate(E.startOf("month").format(b),b),N=h.getMomentDate(N.endOf("month").format(b),b),!E||!N){a.activeQuick="-1";return}break}const s=E,g=N;s&&g&&te.value.forEach(M=>{M.start&&M.end&&s.isSame(Ve.getDayjsObject(M.start).format(b))&&g.isSame(Ve.getDayjsObject(M.end).format(b))&&(D=M.id)})}}a.activeQuick=D}},R=D=>{const b=t.value,E=B.value,N=l.isEmpty(b),s=l.isEmpty(E),g=!N&&s,M=N&&!s;let P=!1,F=!1;if(D&&(g||M)){const z=h.getMomentDate(g?b:E);z&&(P=D.isBefore(z,"day"),F=D.isSame(z,"day"))}return{isStart:g,isEnd:M,isBefore:P,isSame:F}},W=D=>{if(a.selectCount===1){const b=D.format("YYYY-MM-DD"),E=t.day,N=B.day,s=R(D);a.hoverValue=b;let g="",M="";s.isBefore?(g=b,M=s.isStart?E:N):(g=s.isEnd?N:E,M=b),a.previewStart=g,a.previewEnd=M,m.text=Z(h.getMergeDayTime(g,t.time),"left"),n.text=Z(h.getMergeDayTime(M,B.time),"right")}},q=D=>{switch(a.previewStart="",a.previewEnd="",a.selectCount){case 0:case 2:{a.selectCount=1,a.activeQuick="",t.day=D,ee(),B.day="",B.time="",B.value="",n.text=Z(h.getMergeDayTime(D,""),"right"),a.hoverValue=D;break}case 1:{a.selectCount=2;const b=h.getMomentDate(D);if(!b){a.selectCount=1;break}const E=R(b);E.isSame?(t.day=D,ee(),B.day=D,oe()):E.isBefore?(B.day=t.day,B.time=t.time,t.day=D,ee(),oe()):(B.day=D,oe()),a.hoverValue="";break}}a.selectCount===2&&ie()},ae=()=>{!a.isShowQuickBtn&&a.selectCount===2&&a.isCheck&&I("onSubmit",{start:t.value,end:B.value})},L=(D,b)=>{const E=h.getMomentDate(b),N=E?E.format("YYYY-MM-DD"):"",s=E?E.format("HH:mm:ss"):"",g=E?h.getMergeDayTime(N,s):"";D?(t.day=N,t.time=s,t.value=g,m.text=Z(g,"left")):(B.day=N,B.time=s,B.value=g,n.text=Z(g,"right"))},V=()=>{let D="";switch(C.layerType){case"days":D="months";break;case"months":D="years";break;case"years":D="years";break;default:D="months"}a.operateViewDataType=D;const b=i.startValue||"",E=i.endValue||"",N=!l.isEmpty(b),s=!l.isEmpty(E);if(a.selectCount=N&&s?2:N||s?1:0,m.view=h.getViewDate(b).format(C.formatIn),n.view=X(m.view,"add"),L(!0,b),L(!1,E),C.timeType==="time"){a.selectCount=2;const g=C.layerType==="seconds"?"00:00:00":"00:00";l.isEmpty(m.text)&&L(!0,h.getValueEffective(g)),l.isEmpty(n.text)&&L(!1,h.getValueEffective(g))}u()},u=()=>{let D=[];l.isArray(i.rangeQuick)&&(D=l.getListClone(i.rangeQuick).filter(b=>l.isObject(b)&&l.isNonEmptyString(b.id)),D.length>0&&D.push({id:"-1",text:O.value.common.custom})),te.value=D},p=()=>{V(),ie(),e.nextTick(()=>{e.nextTick(()=>{I("onInitComplete")})})},S=()=>{if(a.selectCount===2){const D=h.checkValue(t.value,B.value);a.isCheck=D.errMsg.length===0}};e.onMounted(()=>{e.nextTick(()=>{p()})}),e.watch([()=>i.startValue,()=>i.endValue],([D,b])=>{L(!0,D),L(!1,b);const E=!l.isEmpty(D),N=!l.isEmpty(b);a.selectCount=E&&N?2:E||N?1:0,a.selectCount!==2&&(a.activeQuick=""),a.hoverValue="",a.previewStart="",a.previewEnd="",ie(),S()}),e.watch(()=>i.rangeQuick,()=>{a.operateViewDataType&&u()});const r=()=>{a.hoverValue="",a.previewStart="",a.previewEnd="",m.text=Z(h.getMergeDayTime(t.day,t.time),"left"),n.text=Z(h.getMergeDayTime(B.day,B.time),"right")},w=D=>{m.view=D,n.view=X(D,"add")},$=D=>{q(D),S(),ae()},T=D=>{t.time=D,ee(),S(),ae()},Y=D=>{W(D)},se=D=>{m.view=X(D,"subtract"),n.view=D},G=D=>{q(D),S(),ae()},j=D=>{B.time=D,oe(),S(),ae()},J=D=>{W(D)},K=D=>{if(D.id!=="-1"){if(l.isEmpty(D.start)||l.isEmpty(D.end))return;const b=Ve.getDayjsObject(D.start),E=Ve.getDayjsObject(D.end);if(!b.isValid()||!E.isValid()){de.warn("ClDateTimeRange",`快捷项 "${D.text}" 日期无效,已忽略`);return}let N=b.format("YYYY-MM-DD"),s=E.format("YYYY-MM-DD");const g=h.checkMinMax(N,s,"YYYY-MM-DD");if(!g.isStartMax||!g.isEndMin){de.warn("ClDateTimeRange",`快捷项 "${D.text}" 超出可选范围,已忽略`);return}g.isStartMin||(N=g.minDay),g.isEndMax||(s=g.maxDay),t.day=N,ee(),B.day=s,oe(),m.view=N;const M=l.isEmpty(s)?null:h.getMomentDate(s);n.view=M?M.startOf("month").format(C.formatIn):X(N,"add"),a.hoverValue="",a.previewStart="",a.previewEnd="",a.selectCount=2,a.activeQuick=D.id,S(),ae()}},re=()=>{a.selectCount===2&&a.isCheck&&(I("onSubmit",{start:t.value,end:B.value}),a.isCheck=!1)},ce=()=>{I("onCancel")};return ne({getValue:()=>({start:t.value,end:B.value})}),(D,b)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(k),class:e.normalizeClass(c.value),onMouseleave:r},[e.createElementVNode("div",vt,[e.createElementVNode("div",kt,[e.createElementVNode("div",Vt,[e.createElementVNode("input",{class:"form-control time-input",type:"text",readonly:!0,value:m.text,name:m.name},null,8,wt),e.createVNode(he._sfc_main,{name:"calendar",className:"time-icon"})])]),e.createElementVNode("div",St,[e.createVNode(Se,{selectValue:a.selectCount===2?t.value:"-1",startValue:a.previewStart||t.value,endValue:a.previewEnd||B.value,viewValue:m.view,hoverValue:a.hoverValue,minValue:f.minValue,maxValue:f.maxValue,onOnChangeViewValue:w,onOnSelectDate:$,onOnSelectTime:T,onOnHoverDate:Y},null,8,["selectValue","startValue","endValue","viewValue","hoverValue","minValue","maxValue"])])]),e.createElementVNode("div",Ct,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Et,[e.createElementVNode("input",{class:"form-control time-input",type:"text",readonly:!0,value:n.text,name:n.name},null,8,xt),e.createVNode(he._sfc_main,{name:"calendar",className:"time-icon"})])]),e.createElementVNode("div",bt,[e.createVNode(Se,{selectValue:a.selectCount===2?B.value:"-1",startValue:a.previewStart||t.value,endValue:a.previewEnd||B.value,viewValue:n.view,hoverValue:a.hoverValue,minValue:f.minValue,maxValue:f.maxValue,onOnChangeViewValue:se,onOnSelectDate:G,onOnSelectTime:j,onOnHoverDate:J},null,8,["selectValue","startValue","endValue","viewValue","hoverValue","minValue","maxValue"])])]),e.createElementVNode("div",_t,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(E,N)=>(e.openBlock(),e.createElementBlock("li",{key:`${_}-${E.id}-${N}`,role:"button",tabindex:"0",class:e.normalizeClass({active:E.id===a.activeQuick,"calendar-quick-special":E.id==="-1"}),onClick:s=>K(E),onKeydown:[e.withKeys(e.withModifiers(s=>K(E),["prevent"]),["enter"]),e.withKeys(e.withModifiers(s=>K(E),["prevent"]),["space"])]},e.toDisplayString(E.text),43,Tt))),128))]),a.isShowQuickBtn?(e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(Ce._sfc_main,{className:"quick-submit",label:e.unref(O).common.submit,size:"small",disabled:a.selectCount!==2||!a.isCheck,onOnClick:re},null,8,["label","disabled"]),e.createVNode(Ce._sfc_main,{className:"quick-cancel",label:e.unref(O).common.cancel,size:"small",color:"grayLight",onOnClick:ce},null,8,["label"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])],42,gt))}}),Yt={key:3,class:"datetime-errmsg",role:"alert"},Me=e.defineComponent({name:"ClDateTimeBase",__name:"DateTimeBase",props:{isDefault:{type:Boolean,default:!1},isRange:{type:Boolean,default:!1},start:String,end:String,minDate:String,maxDate:String,rangeQuick:{type:Array,default:()=>[]},errMsg:{type:Array,default:()=>[]}},emits:{onSelectValue:f=>!0,onClose:()=>!0,onInitComplete:()=>!0},setup(f,{expose:ne,emit:v}){const i=f,I=v,_=`clDatetimeBase-${l.getRandom(5)}`,O=e.inject("$DateTimeTop");O||de.warn("ClDateTimeBase","未找到 $DateTimeTop 注入,请确保组件在 ClDateTime 组件树内使用");const x=e.computed(()=>!!O);i.isDefault===i.isRange&&de.warn("ClDateTimeBase",`isDefault(${i.isDefault}) 与 isRange(${i.isRange}) 必须恰好一个为 true`);const h=e.useTemplateRef("refEl");let C=!1;const k=e.computed(()=>l.isArray(i.errMsg)&&i.errMsg.length>0),c=t=>{I("onSelectValue",t)},a=()=>{I("onClose")},m=()=>{C||(C=!0,I("onInitComplete"))};return ne({getValue:()=>h.value?h.value.getValue():i.isDefault?l.isNonEmptyString(i.start)?O?.getMomentDate(i.start)??i.start:null:l.isNonEmptyString(i.start)||l.isNonEmptyString(i.end)?{start:i.start,end:i.end}:""}),(t,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[x.value&&f.isDefault?(e.openBlock(),e.createBlock(yt,{key:0,ref_key:"refEl",ref:h,value:f.start,minValue:f.minDate,maxValue:f.maxDate,onOnSelectValue:c,onOnInitComplete:m},null,8,["value","minValue","maxValue"])):x.value&&f.isRange?(e.openBlock(),e.createBlock($t,{key:1,ref_key:"refEl",ref:h,rangeQuick:f.rangeQuick,minValue:f.minDate,maxValue:f.maxDate,startValue:f.start,endValue:f.end,onOnSubmit:c,onOnCancel:a,onOnInitComplete:m},null,8,["rangeQuick","minValue","maxValue","startValue","endValue"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64)),k.value?(e.openBlock(),e.createElementBlock("ul",Yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.errMsg,(te,X)=>(e.openBlock(),e.createElementBlock("li",{key:`${_}-err-${X}`},e.toDisplayString(te),1))),128))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[],64))],64))}}),Nt=["id"],Ot=["id"],It="2000-01-01",Pt=e.defineComponent({name:"ClDateTime",__name:"Index",props:{id:String,value:String,className:String,placeholder:String,disabled:{type:Boolean,default:!1},theme:{type:String,default:"default",validator:f=>["default","range"].includes(f)},layerType:{type:String,default:"days",validator:f=>["years","months","days","hours","minutes","seconds"].includes(f)},timeType:{type:String,default:"date",validator:f=>["date","time","datetime"].includes(f)},format:String,formatEnd:String,direction:{type:String,default:"left"},minDate:String,maxDate:String,isClear:{type:Boolean,default:!1},rangeQuick:{type:Array,default:()=>[]},isDropdown:{type:Boolean,default:!0},themeStyle:{type:String,default:"default",validator:f=>["default","noBorder"].includes(f)},arrowDirection:{type:String,default:"right"},isUseDropdownArrow:{type:Boolean,default:!0},checkCallback:Function,isPlaintext:{type:Boolean,default:!1},plaintextSeparator:{type:String,default:" ~ "},appendContainer:{type:String,default:""}},emits:{"update:value":f=>!0,"update:modelValue":f=>!0,onChange:(f,ne)=>!0,onInit:()=>!0},setup(f,{expose:ne,emit:v}){const i=f,I=v,{optPageLanguage:_,getPageLanguage:O}=ve.useLanguage();O("dataTime");const x=`datetime-${l.getRandom(8)}`,h=i.id,C=e.useTemplateRef("refElDropdownLayer"),k=e.useTemplateRef("refElDatetime"),c=e.reactive({isInit:!1,isDefault:i.theme!=="range",isRange:i.theme==="range",isShowPopup:i.isDropdown,timeType:"",layerType:i.layerType,layerView:"",formatIn:"",formatOut:"",formatOutEnd:"",rangeQuick:[],errMsg:[]}),a=e.reactive({showText:"",start:"",end:""}),m={lastStart:"",lastEnd:""},n=e.computed(()=>{let s=i.arrowDirection;return l.isEmpty(s)&&(s=i.themeStyle==="noBorder"?"left":"right"),s}),t=e.computed(()=>{let s={"panel-date-time":!0};return i.themeStyle==="noBorder"&&(s["datetime-themeStyle-noBorder"]=!0),i.themeStyle==="noBorder"&&l.isEmpty(a.showText)&&(s["datetime-empty"]=!0),i.isDropdown||(s["datetime-noPopup"]=!0,s[`datetime-${i.theme}`]=!0),s=l.getJsonMerge(s,pe.getClassNameJson(i.className)),l.getStringByJson(s," ")}),B=e.computed(()=>`datetime-dropdown datetime-${i.theme} datetime-dropdown-${i.theme}`),te=e.computed(()=>{let s={"panel-date-time":!0};return s=l.getJsonMerge(s,pe.getClassNameJson(i.className)),`${l.getStringByJson(s," ")} cl-plaintext-value`}),X=e.computed(()=>{const s=a.showText,g=l.isString(i.plaintextSeparator)?i.plaintextSeparator:" ~ ";return!c.isRange||g===" ~ "?s:s.split(" ~ ").join(g)}),Z=()=>[{id:"today",text:_.value.today,start:H(),end:H()},{id:"yesterDay",text:_.value.yesterDay,start:H().subtract(1,"day"),end:H().subtract(1,"day")},{id:"pastDays7",text:_.value.pastDays7,start:H().subtract(7,"day"),end:H().subtract(1,"day")},{id:"pastDays30",text:_.value.pastDays30,start:H().subtract(30,"day"),end:H().subtract(1,"day")},{id:"mont",text:_.value.montCurrent,start:H().startOf("month"),end:H().endOf("month")},{id:"montLast",text:_.value.montLast,start:H().subtract(1,"month").startOf("month"),end:H().subtract(1,"month").endOf("month")}],ee=()=>[{id:"mont",text:_.value.montCurrent,start:H().startOf("month"),end:H().endOf("month")},{id:"montLast",text:_.value.montLast,start:H().subtract(1,"month").startOf("month"),end:H().subtract(1,"month").endOf("month")},{id:"montLately6",text:_.value.montLately6,start:H().subtract(5,"month").startOf("month"),end:H().endOf("month")},{id:"year",text:_.value.yearCurrent,start:H().startOf("year"),end:H().endOf("year")},{id:"yearLast",text:_.value.yearLast,start:H().subtract(1,"year").startOf("year"),end:H().subtract(1,"year").endOf("year")}],oe=()=>[{id:"year",text:_.value.yearCurrent,start:H().startOf("year"),end:H().endOf("year")},{id:"yearLast",text:_.value.yearLast,start:H().subtract(1,"year").startOf("year"),end:H().subtract(1,"year").endOf("year")}],ie=s=>{const g=l.isEmpty(s.start),M=l.isEmpty(s.end),P=g?"":H(s.start).format(c.formatIn),F=M?"":H(s.end).format(c.formatIn),z=c.isDefault?P:g||M?"":`${P}~${F}`,ue=c.isDefault?{value:P}:{start:P,end:F,value:z};return{value:z,info:ue}},R=()=>{C.value&&C.value.setOpen(!1)},W=()=>c.timeType==="time",q=s=>{if(!s)return"";const g=l.isString(s)?l.trim(s):"";return W()?/^\d{4}-\d{2}-\d{2}/.test(g)?g:`${It} ${g}`:g},ae=()=>H(),L=(s,g)=>{let M=null;if(!l.isEmpty(s)){const P=l.isUndefined(g)?c.formatIn:g;M=l.isString(s)?H(s,P):H(s),M&&!M.isValid()&&(M=null)}return M},V=s=>{const g=L(s);return g?g.startOf("month"):ae().startOf("month")},u=(s,g,M)=>{const P=l.isEmpty(M)?c.formatIn:M;let F="";if(!l.isEmpty(i.minDate)){const fe=L(q(i.minDate));F=fe?fe.format(P):""}let z="";if(!l.isEmpty(i.maxDate)){const fe=L(q(i.maxDate));z=fe?fe.format(P):""}let ue=!0,me=!0,De=!0,o=!0,d=!0,y=!1;const A=l.isEmpty(s),U=l.isEmpty(g);let Q;switch(i.layerType){case"years":Q="year";break;case"months":Q="month";break;case"days":Q="day";break;case"hours":Q="hour";break;case"minutes":Q="minute";break;case"seconds":Q="second";break;default:Q="day";break}if(!A){const fe=H(s);if(fe.isValid()&&(l.isEmpty(F)||(ue=fe.isSameOrAfter(F,Q)),l.isEmpty(z)||(me=fe.isSameOrBefore(z,Q)),!U)){const ge=H(g);ge.isValid()&&(l.isEmpty(F)||(De=ge.isSameOrAfter(F,Q)),l.isEmpty(z)||(o=ge.isSameOrBefore(z,Q)),ge.isBefore(fe)&&(d=!1))}}const le=[],ke=c.isRange?_.value.rangeStartLabel:"";return me?De?(ue||le.push(`${ke}${_.value.checkStartMinLabel}(${L(F,P)?.format(c.formatOut)??F})`),o||le.push(`${_.value.checkEndMaxLabel}(${L(z,P)?.format(c.formatOut)??z})`)):le.push(`${_.value.checkEndMinLabel}(${L(F,P)?.format(c.formatOut)??F})`):le.push(`${ke}${_.value.checkStartMaxLabel}(${L(z,P)?.format(c.formatOut)??z})`),c.isRange&&((A||U)&&(y=!0,le.push(_.value.checkRangeEmptyLabel)),d||le.push(_.value.checkStartEndLabel)),{isStartMin:ue,isStartMax:me,isEndMin:De,isEndMax:o,isStartEnd:d,isRangeEmpty:y,errMsg:le,minDay:F,maxDay:z}},p=(s,g,M)=>{const P=u(s,g||"",M);return c.errMsg=P.errMsg,C.value&&e.nextTick(()=>{C.value?.calculationPosition()}),P},S=()=>{let s=[];switch(i.layerType){case"days":case"hours":case"minutes":case"seconds":s=c.timeType==="time"?[]:Z();break;case"months":s=ee();break;case"years":s=oe();break}return s},r=()=>{let s=[];c.isRange&&(l.isArray(i.rangeQuick)&&i.rangeQuick.length>0?s=[...i.rangeQuick]:s=S()),c.rangeQuick=s},w=()=>{["default","range"].includes(i.theme)||de.warn("ClDateTime",`theme 非法值 "${i.theme}",可选值 default/range`),["years","months","days","hours","minutes","seconds"].includes(i.layerType)||de.warn("ClDateTime",`layerType 非法值 "${i.layerType}"`),["date","time","datetime"].includes(i.timeType)||de.warn("ClDateTime",`timeType 非法值 "${i.timeType}"`),["default","noBorder"].includes(i.themeStyle)||de.warn("ClDateTime",`themeStyle 非法值 "${i.themeStyle}"`)},$=()=>{w();let s="",g="",M="";switch(i.layerType){case"years":s="date",g="YYYY",M=i.layerType;break;case"months":s="date",g="YYYY-MM",M=i.layerType;break;case"days":s="date",g="YYYY-MM-DD",M=i.layerType;break;case"hours":s=i.timeType==="date"?"datetime":i.timeType,g=s==="time"?"HH:00":"YYYY-MM-DD HH:00",M=s==="datetime"?"days":"times";break;case"minutes":s=i.timeType==="date"?"datetime":i.timeType,g=s==="time"?"HH:mm":"YYYY-MM-DD HH:mm",M=s==="datetime"?"days":"times";break;case"seconds":s=i.timeType==="date"?"datetime":i.timeType,g=s==="time"?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss",M=s==="datetime"?"days":"times";break;default:s="date",g="YYYY-MM-DD",M=i.layerType;break}c.timeType=s,c.layerView=M,c.formatIn=s==="date"?"YYYY-MM-DD":"YYYY-MM-DD HH:mm:ss",c.formatOut=l.isNonEmptyString(i.format)?i.format:g,c.formatOutEnd=l.isNonEmptyString(i.formatEnd)?i.formatEnd:g},T=s=>{let g="",M="",P="";if(l.isNonEmptyString(s)){if(c.isDefault){const F=q(s),z=H(F);z.isValid()&&(M=z.format(c.formatIn),g=z.format(c.formatOut))}else if(c.isRange){const F=s.split("~");if(F.length===2){const z=q(F[0]),ue=q(F[1]),me=H(z),De=H(ue);me.isValid()&&De.isValid()&&(M=me.format(c.formatIn),P=De.format(c.formatIn),g=`${me.format(c.formatOut)} ~ ${De.format(c.formatOutEnd)}`)}}}a.start=M,a.end=P,a.showText=g},Y=s=>{let g=!0;if(i.checkCallback&&!l.isEmpty(s)){try{c.isDefault?g=i.checkCallback(s):c.isRange&&(g=i.checkCallback(s.start,s.end))}catch(M){de.warn("ClDateTime","checkCallback 回调执行异常,本次选择不生效",M),g=!1}g=l.isBoolean(g)?g:!0}return g},se=s=>{let g="",M="",P="",F=!1;if(c.isDefault){if(!l.isEmpty(s)){const me=L(s);me&&(M=me.format(c.formatIn),g=me.format(c.formatOut))}F=M!==m.lastStart}else if(c.isRange){if(!l.isEmpty(s)&&!l.isEmpty(s.start)&&!l.isEmpty(s.end)){const me=L(s.start),De=L(s.end);me&&De&&(M=me.format(c.formatIn),P=De.format(c.formatIn),g=`${me.format(c.formatOut)} ~ ${De.format(c.formatOutEnd)}`)}F=M!==m.lastStart||P!==m.lastEnd}const z=u(M,P);let ue=!1;return z.errMsg.length===0&&(ue=Y(s)),c.errMsg=z.errMsg,C.value&&e.nextTick(()=>{C.value?.calculationPosition()}),{start:M,end:P,text:g,isChange:F,checkInfo:z,isCheck:ue}},G=()=>{$(),r(),T(i.value),e.nextTick(()=>{c.isInit=!0})},j=()=>{const s=k.value?.getValue();let g="",M="";if(c.isDefault){if(!l.isEmpty(s)){const P=L(s);P&&(g=P.format(c.formatIn))}}else if(c.isRange){const P=s;if(!l.isEmpty(P?.start)&&!l.isEmpty(P?.end)){const F=L(P?.start),z=L(P?.end);F&&z&&(g=F.format(c.formatIn),M=z.format(c.formatIn))}}return ie({start:g,end:M})};e.onMounted(()=>{e.nextTick(()=>{G()})}),e.watch(()=>i.value,(s,g)=>{s!==g&&(T(s),m.lastStart=a.start,m.lastEnd=a.end)}),e.watch(()=>i.isDropdown,s=>{c.isShowPopup=s}),e.watch([()=>i.theme,()=>i.layerType,()=>i.timeType,()=>i.format,()=>i.formatEnd],()=>{c.isDefault=i.theme!=="range",c.isRange=i.theme==="range",$(),r(),T(i.value),m.lastStart=a.start,m.lastEnd=a.end});const J=s=>{i.disabled||s&&(c.errMsg=[],m.lastStart=a.start,m.lastEnd=a.end,r())},K=()=>{if(!i.disabled){a.start="",a.end="",a.showText="",m.lastStart="",m.lastEnd="";const s=ie(a);I("update:value",s.value),I("update:modelValue",s.value),I("onChange",s.value,s.info)}},re=s=>{if(!i.disabled){const{start:g,end:M,text:P,isChange:F,isCheck:z}=se(s);if(z&&(a.start=g,a.end=M,a.showText=P,m.lastStart=g,m.lastEnd=M,R(),F)){const ue=ie(a);I("update:value",ue.value),I("update:modelValue",ue.value),I("onChange",ue.value,ue.info)}}},ce=()=>{R()};let ye=!1;const D=()=>{c.isShowPopup&&C.value&&(C.value.checkIsShowOpen()||C.value.initCompleteOpen()),ye||(ye=!0,I("onInit"))};return e.provide("$DateTimeTop",{keyIndex:x,elId:i.id,getMomentDate:L,getViewDate:V,getNow:ae,checkIsTimes:W,checkValue:p,checkMinMax:u,getValueEffective:q,getMergeDayTime:(s,g)=>{let M="";const P=l.isString(s)?l.trim(s):"";let F=l.isString(g)?l.trim(g):"";switch(c.timeType){case"date":M=P;break;case"time":M=q(F)||"";break;case"datetime":l.isEmpty(P)||(F=l.isEmpty(g)?"00:00:00":F,M=`${P} ${F}`);break}return M},Dayjs:H}),e.provide("$DateTimeTopBase",e.readonly(c)),ne({getValue:()=>j().value,getValueData:()=>j().info,setValue:s=>{T(s),m.lastStart=a.start,m.lastEnd=a.end}}),(s,g)=>f.isPlaintext?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(h),class:e.normalizeClass(te.value)},e.toDisplayString(X.value),11,Nt)):f.isDropdown?(e.openBlock(),e.createBlock(Ee._sfc_main,{key:1,ref_key:"refElDropdownLayer",ref:C,id:e.unref(h),classParent:t.value,classDropDown:B.value,placeholder:f.placeholder,isDisabled:f.disabled,isClear:f.isClear,textLabel:a.showText,textArrowDirection:n.value,dropdownArrowPos:f.direction,isUseDropdownArrow:f.isUseDropdownArrow,appendContainer:f.appendContainer,appendFollowWidth:!1,onOnChangeOpen:J,onOnClear:K},{textExtend:e.withCtx(()=>[e.createVNode(he._sfc_main,{name:c.timeType==="time"?"clock":"calendar",className:"datetime-icon","aria-hidden":"true"},null,8,["name"])]),dropdown:e.withCtx(()=>[e.createVNode(Me,{ref_key:"refElDatetime",ref:k,isDefault:c.isDefault,isRange:c.isRange,start:a.start,end:a.end,minDate:f.minDate,maxDate:f.maxDate,rangeQuick:c.rangeQuick,errMsg:c.errMsg,onOnSelectValue:re,onOnClose:ce,onOnInitComplete:D},null,8,["isDefault","isRange","start","end","minDate","maxDate","rangeQuick","errMsg"])]),_:1},8,["id","classParent","classDropDown","placeholder","isDisabled","isClear","textLabel","textArrowDirection","dropdownArrowPos","isUseDropdownArrow","appendContainer"])):(e.openBlock(),e.createElementBlock("div",{key:2,id:e.unref(h),class:e.normalizeClass(t.value)},[c.isInit?(e.openBlock(),e.createBlock(Me,{key:0,ref_key:"refElDatetime",ref:k,isDefault:c.isDefault,isRange:c.isRange,start:a.start,end:a.end,minDate:f.minDate,maxDate:f.maxDate,rangeQuick:c.rangeQuick,errMsg:c.errMsg,onOnSelectValue:re,onOnClose:ce,onOnInitComplete:D},null,8,["isDefault","isRange","start","end","minDate","maxDate","rangeQuick","errMsg"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],10,Ot))}});exports._sfc_main=Pt;
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { defineComponent as W, ref as x, computed as k, onMounted as X, nextTick as B, onBeforeUnmount as Y, watch as N, resolveDirective as Z, openBlock as l, createElementBlock as r, unref as d, normalizeClass as b, toDisplayString as D, Fragment as p, renderList as ee, normalizeStyle as te, createElementVNode as f, renderSlot as ie, withDirectives as J, createVNode as ne, createTextVNode as se, createBlock as M, withModifiers as ae } from "vue";
|
|
2
|
-
/* empty css */
|
|
3
|
-
/* empty css */
|
|
4
|
-
import i from "@cldemo/ui-kit/common/base";
|
|
5
|
-
import le from "@cldemo/ui-kit/common/Element";
|
|
6
|
-
import { _ as I } from "./Index.vue_vue_type_script_setup_true_lang-C2LGy18j.js";
|
|
7
|
-
import { t as oe } from "./index-BGMnJZqC.js";
|
|
8
|
-
const re = ["id"], ce = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "cl-plaintext-value"
|
|
11
|
-
}, ue = ["id", "name", "value", "disabled", "checked", "onClick"], de = ["for"], me = { key: 0 }, Se = /* @__PURE__ */ W({
|
|
12
|
-
name: "ClRadio",
|
|
13
|
-
directives: {
|
|
14
|
-
cltooltip: oe
|
|
15
|
-
},
|
|
16
|
-
__name: "Index",
|
|
17
|
-
props: {
|
|
18
|
-
id: String,
|
|
19
|
-
// desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定
|
|
20
|
-
name: {
|
|
21
|
-
type: String,
|
|
22
|
-
required: !0
|
|
23
|
-
// desc: 表单name属性
|
|
24
|
-
},
|
|
25
|
-
value: {
|
|
26
|
-
type: [String, Number],
|
|
27
|
-
required: !0
|
|
28
|
-
// desc: 当前选中值
|
|
29
|
-
},
|
|
30
|
-
className: String,
|
|
31
|
-
// desc: 自定义CSS类名
|
|
32
|
-
disabled: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: !1
|
|
35
|
-
// desc: 是否禁用整个单选框组
|
|
36
|
-
},
|
|
37
|
-
list: {
|
|
38
|
-
type: Array,
|
|
39
|
-
default: () => []
|
|
40
|
-
// desc: 单选项数据列表
|
|
41
|
-
},
|
|
42
|
-
width: String,
|
|
43
|
-
// desc: 单选项宽度
|
|
44
|
-
isInline: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: !0
|
|
47
|
-
// desc: 是否行内显示
|
|
48
|
-
},
|
|
49
|
-
tipMode: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "tooltip",
|
|
52
|
-
// desc: tipMsg 交互方式 | enum: tooltip, clickCallback
|
|
53
|
-
validator: (v) => ["tooltip", "clickCallback"].includes(v)
|
|
54
|
-
},
|
|
55
|
-
checkChangeBefore: {
|
|
56
|
-
type: Function,
|
|
57
|
-
// desc: 选中切换前的校验回调,返回false阻止切换 | param: (selectValue: string) => boolean | Promise<boolean>
|
|
58
|
-
default: void 0
|
|
59
|
-
},
|
|
60
|
-
isPlaintext: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: !1
|
|
63
|
-
// desc: 是否纯文本只读模式,只渲染选中项文本不挂载单选框
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
emits: ["update:value", "update:modelValue", "onChange", "onInit", "onError", "onTipClick"],
|
|
67
|
-
setup(v, { expose: P, emit: T }) {
|
|
68
|
-
const n = v, y = T, h = `rd-${i.getRandom(8)}`, C = i.isEmpty(n.name) ? h + "_name" : n.name, q = n.id, o = x(n.value?.toString() || "");
|
|
69
|
-
let u = {};
|
|
70
|
-
const V = x(0), c = x(!1), m = {
|
|
71
|
-
isProcessing: !1,
|
|
72
|
-
// 防止并发点击
|
|
73
|
-
_initEmitted: !1
|
|
74
|
-
// 防止重复 emit onInit
|
|
75
|
-
}, F = k(() => {
|
|
76
|
-
if (n.isPlaintext)
|
|
77
|
-
return [];
|
|
78
|
-
const e = n.list;
|
|
79
|
-
return i.isArray(e) ? e.filter((s) => !i.isEmpty(s)) : [];
|
|
80
|
-
}), L = k(() => {
|
|
81
|
-
n.list, V.value;
|
|
82
|
-
const e = o.value;
|
|
83
|
-
if (i.isEmpty(e)) return "";
|
|
84
|
-
const s = i.isExistJsonKey(u, e) ? u[e] : void 0;
|
|
85
|
-
return s && i.isNonEmptyString(s.name) ? s.name : e;
|
|
86
|
-
}), K = k(() => i.getJsonMerge(
|
|
87
|
-
{ "panel-radio": !0 },
|
|
88
|
-
le.getClassNameJson(n.className)
|
|
89
|
-
)), R = k(() => {
|
|
90
|
-
const e = {
|
|
91
|
-
radio: !0,
|
|
92
|
-
"radio-default": !0
|
|
93
|
-
};
|
|
94
|
-
return e["radio-inline"] = n.isInline ?? !0, e;
|
|
95
|
-
}), $ = (e) => {
|
|
96
|
-
y("update:value", e), y("update:modelValue", e);
|
|
97
|
-
}, z = (e) => {
|
|
98
|
-
const s = e.id?.toString() ?? "";
|
|
99
|
-
$(s), y("onChange", s, i.getJsonClone(e));
|
|
100
|
-
}, _ = () => {
|
|
101
|
-
m._initEmitted || (m._initEmitted = !0, B(() => {
|
|
102
|
-
y("onInit");
|
|
103
|
-
}));
|
|
104
|
-
}, A = (e) => {
|
|
105
|
-
const s = {}, { width: a } = n;
|
|
106
|
-
return e && !i.isEmpty(e.width) ? s.width = e.width : i.isEmpty(a) || (s.width = n.width), s;
|
|
107
|
-
}, U = () => i.isExistJsonKey(u, o.value) ? o.value : "", E = (e) => {
|
|
108
|
-
u = i.isEmpty(e) ? {} : i.getJsonByList(e), V.value += 1;
|
|
109
|
-
}, g = () => {
|
|
110
|
-
if (c.value) {
|
|
111
|
-
const e = i.isEmpty(o.value) ? "" : o.value;
|
|
112
|
-
i.isExistJsonKey(u, e) || (o.value = "", $(""));
|
|
113
|
-
}
|
|
114
|
-
}, S = (e) => {
|
|
115
|
-
e !== o.value && (o.value = e?.toString() || "");
|
|
116
|
-
}, j = () => {
|
|
117
|
-
c.value = n.list.length !== 0, E(n.list), g();
|
|
118
|
-
};
|
|
119
|
-
X(() => {
|
|
120
|
-
B(() => {
|
|
121
|
-
j();
|
|
122
|
-
});
|
|
123
|
-
}), Y(() => {
|
|
124
|
-
u = {}, c.value = !1, m._initEmitted = !1;
|
|
125
|
-
}), N(c, (e) => {
|
|
126
|
-
e && _();
|
|
127
|
-
}), N(
|
|
128
|
-
() => n.list,
|
|
129
|
-
(e) => {
|
|
130
|
-
c.value || (c.value = !0, e.length === 0 && g(), _());
|
|
131
|
-
},
|
|
132
|
-
{ deep: !0 }
|
|
133
|
-
), N(
|
|
134
|
-
[() => n.value, () => n.list],
|
|
135
|
-
([e, s]) => {
|
|
136
|
-
const a = s || [];
|
|
137
|
-
!c.value && a.length > 0 && (c.value = !0, _()), E(a), S(e), g();
|
|
138
|
-
},
|
|
139
|
-
{ deep: !0 }
|
|
140
|
-
);
|
|
141
|
-
const G = (e) => {
|
|
142
|
-
y("onTipClick", e);
|
|
143
|
-
}, H = async (e) => {
|
|
144
|
-
if (!(!e || e.isDisabled || n.disabled || m.isProcessing) && !i.isEmpty(e.id)) {
|
|
145
|
-
m.isProcessing = !0;
|
|
146
|
-
try {
|
|
147
|
-
const s = String(e.id ?? "");
|
|
148
|
-
if (s === o.value)
|
|
149
|
-
return;
|
|
150
|
-
let a = !0;
|
|
151
|
-
if (n.checkChangeBefore)
|
|
152
|
-
try {
|
|
153
|
-
a = await n.checkChangeBefore(s), a = i.isBoolean(a) ? a : !0;
|
|
154
|
-
} catch {
|
|
155
|
-
a = !1;
|
|
156
|
-
}
|
|
157
|
-
if (n.disabled || e.isDisabled)
|
|
158
|
-
return;
|
|
159
|
-
a && (o.value = s, z(e));
|
|
160
|
-
} catch (s) {
|
|
161
|
-
y("onError", s);
|
|
162
|
-
} finally {
|
|
163
|
-
m.isProcessing = !1;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}, w = () => U();
|
|
167
|
-
return P({
|
|
168
|
-
getValue: w,
|
|
169
|
-
getValueData: () => {
|
|
170
|
-
const e = w();
|
|
171
|
-
return i.isExistJsonKey(u, e) ? i.getJsonClone(u[e]) : {};
|
|
172
|
-
},
|
|
173
|
-
setValue: (e) => {
|
|
174
|
-
m.isProcessing || (S(e), g());
|
|
175
|
-
},
|
|
176
|
-
runInitComplete: () => {
|
|
177
|
-
c.value || (c.value = !0, E(n.list), S(n.value), g(), _());
|
|
178
|
-
}
|
|
179
|
-
}), (e, s) => {
|
|
180
|
-
const a = Z("cltooltip");
|
|
181
|
-
return l(), r("div", {
|
|
182
|
-
class: b(K.value),
|
|
183
|
-
id: d(q)
|
|
184
|
-
}, [
|
|
185
|
-
v.isPlaintext ? (l(), r("div", ce, D(L.value), 1)) : (l(), r(p, { key: 1 }, [], 64)),
|
|
186
|
-
(l(!0), r(p, null, ee(F.value, (t, O) => (l(), r(p, {
|
|
187
|
-
key: `${h}-${t.id ?? ""}-${O}`
|
|
188
|
-
}, [
|
|
189
|
-
t && (t.isShow || t.isShow === void 0) ? (l(), r("div", {
|
|
190
|
-
key: 0,
|
|
191
|
-
class: b(R.value),
|
|
192
|
-
style: te(A(t))
|
|
193
|
-
}, [
|
|
194
|
-
f("span", null, [
|
|
195
|
-
f("span", null, [
|
|
196
|
-
f("input", {
|
|
197
|
-
type: "radio",
|
|
198
|
-
id: `${h}_${d(C)}_${t.id ?? ""}`,
|
|
199
|
-
name: d(C),
|
|
200
|
-
value: t.id ?? "",
|
|
201
|
-
disabled: t.isDisabled || v.disabled,
|
|
202
|
-
checked: (t.id?.toString() ?? "") === o.value,
|
|
203
|
-
onClick: (Q) => H(t)
|
|
204
|
-
}, null, 8, ue),
|
|
205
|
-
f("label", {
|
|
206
|
-
for: `${h}_${d(C)}_${t.id ?? ""}`
|
|
207
|
-
}, [
|
|
208
|
-
ie(e.$slots, "default", { data: t }, () => [
|
|
209
|
-
t.icon && t.icon.length > 0 ? J((l(), r("span", me, [
|
|
210
|
-
ne(I, {
|
|
211
|
-
name: t.icon
|
|
212
|
-
}, null, 8, ["name"])
|
|
213
|
-
])), [
|
|
214
|
-
[a, { html: t.name, className: "tooltip-modal" }]
|
|
215
|
-
]) : (l(), r(p, { key: 1 }, [
|
|
216
|
-
se(D(t.name), 1)
|
|
217
|
-
], 64))
|
|
218
|
-
])
|
|
219
|
-
], 8, de)
|
|
220
|
-
]),
|
|
221
|
-
t.tipMsg && t.tipMsg.length > 0 ? (l(), r(p, { key: 0 }, [
|
|
222
|
-
v.tipMode === "tooltip" ? J((l(), M(I, {
|
|
223
|
-
key: 0,
|
|
224
|
-
name: d(i).isNonEmptyString(t.tipIcon) ? void 0 : "question-circle",
|
|
225
|
-
className: d(i).isNonEmptyString(t.tipIcon) ? t.tipIcon : void 0,
|
|
226
|
-
class: "radio-icon-tip"
|
|
227
|
-
}, null, 8, ["name", "className"])), [
|
|
228
|
-
[a, { html: t.tipMsg, className: "tooltip-modal" }]
|
|
229
|
-
]) : (l(), M(I, {
|
|
230
|
-
key: 1,
|
|
231
|
-
name: d(i).isNonEmptyString(t.tipIcon) ? void 0 : "question-circle",
|
|
232
|
-
className: d(i).isNonEmptyString(t.tipIcon) ? t.tipIcon : void 0,
|
|
233
|
-
class: "radio-icon-tip",
|
|
234
|
-
onClick: ae((Q) => G(t), ["stop"])
|
|
235
|
-
}, null, 8, ["name", "className", "onClick"]))
|
|
236
|
-
], 64)) : (l(), r(p, { key: 1 }, [], 64))
|
|
237
|
-
])
|
|
238
|
-
], 6)) : (l(), r(p, { key: 1 }, [], 64))
|
|
239
|
-
], 64))), 128))
|
|
240
|
-
], 10, re);
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
export {
|
|
245
|
-
Se as _
|
|
246
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("vue"),l=require("@cldemo/ui-kit/common/base"),N=require("@cldemo/ui-kit/common/Element"),E=require("./Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js"),A=i.defineComponent({name:"ClInputNumber",components:{ClInput:E._sfc_main},__name:"Index",props:{id:String,name:{type:String,default:""},value:{type:[String,Number],default:""},className:{type:String,default:""},disabled:{type:Boolean,default:!1},theme:{type:String,default:"default"},inputType:{type:String,default:""},inputmode:{type:String,default:""},autocomplete:{type:String,default:"off"},width:{type:String,default:""},placeholder:{type:String,default:""},label:String,isFloating:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isClean:{type:Boolean,default:!0},isNumber:{type:Boolean,default:!0},decimal:{type:Number,default:0,validator:s=>s>=-1&&s<=100&&s%1===0},isThousand:{type:Boolean,default:!0},isImmediateThousand:{type:Boolean,default:!0},changeDelayTime:{type:Number,default:200,validator:s=>l.isFinite(s)&&s>=0},isPlaintext:{type:Boolean,default:!1}},emits:["update:value","update:modelValue","onChange","onFocus","onBlur","onChangeBlur","onKeyupEnter","onClear","onInit","onKeydown","onKeyup","onChangeDelay"],setup(s,{expose:S,emit:T}){const o=s,d=T,F=o.id,h=i.useTemplateRef("refElInput"),m=i.ref(o.value),f=i.ref(o.value),B=i.computed(()=>{let e={"panel-input-number":!0};return e=l.getJsonMerge(e,N.getClassNameJson(o.className)),l.getStringByJson(e," ")}),w=i.computed(()=>l.isNonEmptyString(o.inputmode)?o.inputmode:o.decimal===0?"numeric":"decimal"),C=e=>{if(e!==f.value){f.value=e;const t=g(e);d("update:value",t),d("update:modelValue",t),d("onChange",t)}},V=e=>{let t=l.isNumber(e);if(!t)if(l.isNaN(+e))e==="-"&&(t=!0);else{const n=e.split(".");n.length===2&&(t=(l.isNumber(n[0])||l.isEmpty(n[0]))&&(l.isEmpty(n[1])||l.isNumber(n[1])))}return t},v=(e,t,n=!0,a=!0)=>{let r=e;if(o.isNumber){let u=l.removeReplace(e);if(u.length>0)if(V(u)){if(u!=="-"){const{decimal:c}=o;if(n&&c!==0&&(c===-1||c>=0&&c<=100)&&c!==-1){const y=parseFloat(u);if(l.isFinite(y)){const I=y.toFixed(c);u=I.indexOf("e")>-1?u:I}}if(a){const y=u.split("."),I=l.isEmpty(y[0])?"0":y[0];if(u=o.isThousand?l.getFormatThousands(I):I,y.length===2&&c!==0){const z=c===-1?y[1]:y[1].slice(0,c);u+=`.${z}`}}}}else u=t;else u="";r=u}return r},O=(e,t)=>{const n=t.split(""),a=new RegExp("^"+n.map(p=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*?")),r=e.match(a);let u;return r&&(u=r[0].length),u},R=(e,t,n)=>{const a=N.getFocusSelection(e);let r=t.substring(0,a.start);r=l.removeReplace(r);const u=t.substring(a.start);let p=V(r);r.indexOf(".")>-1&&u.indexOf(".")>-1&&(p=!1);let c=a.start;p?c=O(n,r):c=n.lastIndexOf(u),(l.isUndefined(c)||c>n.length||c<0)&&(c=n.length),i.nextTick(()=>{N.setFocusSelection(e,c,c)})},x=()=>{const e=m.value;if(l.isEmpty(e))return e;{let t=e.toString();if(o.isNumber){const{decimal:n}=o;if(t=l.removeReplace(t),t==="-")return t;if(n!==0&&n!==-1){const u=parseFloat(t);if(l.isFinite(u)&&n>=0&&n<=100){const p=u.toFixed(n);t=p.indexOf("e")>-1?t:p}}const a=t.split("."),r=l.isEmpty(a[0])?"0":a[0];a[0]=o.isThousand?l.getFormatThousands(r):r,n===0?t=a[0]:a.length===2?(a[1]=n===-1?a[1]:l.getFillZero(a[1],n,"r"),t=a.join(".")):t=a[0]}return t}},g=e=>{let t="";if(!l.isEmpty(e)&&(t=e.toString(),o.isNumber&&t!=="-")){const{decimal:n}=o,a=t.split(".");let r=l.removeReplace(a[0]);if(a.length===2&&n!==0){let u="";n===-1?u=a[1]:u=l.getFillZero(a[1],n,"r"),r+=`.${u}`}t=r}return t},k=()=>{h.value?.focus()},K=()=>{if(!l.isEmpty(o.value)){const e=v(o.value,"");m.value=e,f.value=e}};i.onMounted(()=>{K()}),i.watch(()=>o.value,(e,t)=>{if(e!==t&&e!==m.value){let n=!0;if(o.isNumber){const a=l.removeReplace(e),r=l.removeReplace(m.value),u=l.isEmpty(a),p=l.isEmpty(r);u&&p?n=!1:!u&&!p&&(n=Number(a)!==Number(r))}if(n){const a=v(e,t);m.value=a,f.value=a}}}),i.watch([()=>o.isNumber,()=>o.decimal,()=>o.isThousand],()=>{const e=v(m.value,"");m.value=e,C(e)});const D=e=>{const t=v(e,f.value,!1,o.isImmediateThousand);m.value=t,h.value?.setValue(t),o.isNumber&&i.nextTick(()=>{const n=h.value?.getInputElement();n&&m.value===t&&R(n,e,String(t))}),C(t)},$=()=>{const e=x();m.value=e,f.value=e;const t=g(e);d("onFocus",t)},L=()=>{const e=x();m.value=e,f.value=e;const t=g(e);d("onBlur",t)},P=e=>{d("onChangeBlur",g(e))},q=e=>{d("onKeyupEnter",g(e))},J=e=>{d("onKeydown",e)},M=e=>{d("onKeyup",e)},U=()=>{d("onClear")},j=()=>{d("onInit")},Z=e=>{d("onChangeDelay",g(e))},b=()=>g(m.value);return S({getValue:b,getValueData:()=>({value:b(),show:l.isEmpty(m.value)?"":m.value.toString()}),setValue:(e,t)=>{const n=l.isEmpty(e)?"":v(e,"");if(m.value=n,f.value=n,h.value?.setValue(n),t){const a=g(n);d("update:value",a),d("update:modelValue",a),d("onChange",a)}},focus:()=>{k()},getInputElement:()=>h.value?.getInputElement()??null}),(e,t)=>(i.openBlock(),i.createBlock(E._sfc_main,{ref_key:"refElInput",ref:h,id:i.unref(F),value:m.value,name:s.name,className:B.value,inputType:s.inputType,inputmode:w.value,autocomplete:s.autocomplete,placeholder:s.placeholder,label:s.label,isFloating:s.isFloating,disabled:s.disabled,isReadonly:s.isReadonly,isClean:s.isClean,width:s.width,theme:s.theme,isPlaintext:s.isPlaintext,changeDelayTime:s.changeDelayTime,onOnChange:D,onOnFocus:$,onOnBlur:L,onOnChangeBlur:P,onOnKeyupEnter:q,onOnKeydown:J,onOnKeyup:M,onOnClear:U,onOnInit:j,onOnChangeDelay:Z},i.createSlots({_:2},[e.$slots.prepend?{name:"prepend",fn:i.withCtx(()=>[i.renderSlot(e.$slots,"prepend")]),key:"0"}:void 0,e.$slots.append?{name:"append",fn:i.withCtx(()=>[i.renderSlot(e.$slots,"append")]),key:"1"}:void 0,e.$slots.suffix?{name:"suffix",fn:i.withCtx(()=>[i.renderSlot(e.$slots,"suffix")]),key:"2"}:void 0]),1032,["id","value","name","className","inputType","inputmode","autocomplete","placeholder","label","isFloating","disabled","isReadonly","isClean","width","theme","isPlaintext","changeDelayTime"]))}});exports._sfc_main=A;
|