@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.
Files changed (165) hide show
  1. package/buildLibs/all/index.cjs +8 -8
  2. package/buildLibs/all/index.js +12157 -12048
  3. package/buildLibs/common/globalConfig.cjs +1 -1
  4. package/buildLibs/common/globalConfig.js +29 -15
  5. package/buildLibs/common/i18n/en.cjs +1 -1
  6. package/buildLibs/common/i18n/en.js +3 -1
  7. package/buildLibs/common/i18n/zh_CN.cjs +1 -1
  8. package/buildLibs/common/i18n/zh_CN.js +3 -1
  9. package/buildLibs/common/index.cjs +1 -1
  10. package/buildLibs/common/index.js +26 -24
  11. package/buildLibs/mobile/index.cjs +5 -5
  12. package/buildLibs/mobile/index.js +5902 -5852
  13. 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
  14. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-BQXxDHbe.js +254 -0
  15. 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
  16. 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
  17. 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
  18. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-C6Zd584S.js +2536 -0
  19. 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
  20. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-CEBiLDTm.js +310 -0
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-D_73B6av.js +1533 -0
  28. 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
  29. package/buildLibs/types/All/index.d.ts +1 -1
  30. package/buildLibs/types/Common/globalConfig.d.ts +29 -0
  31. package/buildLibs/types/Common/globalTypes.d.ts +11 -0
  32. package/buildLibs/types/Common/i18n/en.d.ts +2 -0
  33. package/buildLibs/types/Common/i18n/zh_CN.d.ts +2 -0
  34. package/buildLibs/types/Common/index.d.ts +1 -1
  35. package/buildLibs/types/Element/CheckBox/Index.vue.d.ts +9 -0
  36. package/buildLibs/types/Element/Input/Index.vue.d.ts +9 -0
  37. package/buildLibs/types/Element/InputNumber/Index.vue.d.ts +9 -0
  38. package/buildLibs/types/Element/InputNumberStepper/Index.vue.d.ts +9 -0
  39. package/buildLibs/types/Element/InputTextarea/Index.vue.d.ts +9 -0
  40. package/buildLibs/types/Element/Radio/Index.vue.d.ts +9 -0
  41. package/buildLibs/types/Web/DateTime/Index.vue.d.ts +9 -0
  42. package/buildLibs/types/Web/FileUpload/Index.vue.d.ts +9 -0
  43. package/buildLibs/types/Web/Select/Index.vue.d.ts +9 -0
  44. package/buildLibs/types/Web/SelectCascade/Index.vue.d.ts +9 -0
  45. package/buildLibs/types/Web/SelectMove/Index.vue.d.ts +9 -0
  46. package/buildLibs/types/Web/SelectTag/Index.vue.d.ts +9 -0
  47. package/buildLibs/types/Web/SelectTree/Index.vue.d.ts +9 -0
  48. package/buildLibs/types/Web/Tree/Index.vue.d.ts +9 -0
  49. package/buildLibs/types/Web/componentsInstalls.d.ts +90 -0
  50. package/buildLibs/utils/Element/ClCheckbox.cjs +1 -1
  51. package/buildLibs/utils/Element/ClCheckbox.js +1 -1
  52. package/buildLibs/utils/Element/ClInput.cjs +1 -1
  53. package/buildLibs/utils/Element/ClInput.js +1 -1
  54. package/buildLibs/utils/Element/ClInputCaptcha.cjs +1 -1
  55. package/buildLibs/utils/Element/ClInputCaptcha.js +1 -1
  56. package/buildLibs/utils/Element/ClInputNumber.cjs +1 -1
  57. package/buildLibs/utils/Element/ClInputNumber.js +1 -1
  58. package/buildLibs/utils/Element/ClInputNumberStepper.cjs +1 -1
  59. package/buildLibs/utils/Element/ClInputNumberStepper.js +1 -1
  60. package/buildLibs/utils/Element/ClInputPassword.cjs +1 -1
  61. package/buildLibs/utils/Element/ClInputPassword.js +1 -1
  62. package/buildLibs/utils/Element/ClInputSearch.cjs +1 -1
  63. package/buildLibs/utils/Element/ClInputSearch.js +1 -1
  64. package/buildLibs/utils/Element/ClInputTextarea.cjs +1 -1
  65. package/buildLibs/utils/Element/ClInputTextarea.js +1 -1
  66. package/buildLibs/utils/Element/ClRadio.cjs +1 -1
  67. package/buildLibs/utils/Element/ClRadio.js +1 -1
  68. package/buildLibs/utils/Element/__provide__/Validate.cjs +1 -1
  69. package/buildLibs/utils/Element/__provide__/Validate.js +13 -3
  70. 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
  71. 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
  72. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-2THK822S.js +254 -0
  73. 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
  74. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-5itnjwU_.js +1 -0
  75. 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
  76. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BIO6Me43.js +1 -0
  77. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BN9ybiKv.js +1 -0
  78. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BpG7AHvM.js +1 -0
  79. 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
  80. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CW4fM0by.js +1 -0
  81. 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
  82. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CsCn637u.js +2 -0
  83. 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
  84. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DXPZYc0c.js +1 -0
  85. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DY4m6Xyj.js +1 -0
  86. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DZCt32jb.js +1533 -0
  87. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DZF2gj7X.js +2536 -0
  88. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-De1eNjwC.js +1 -0
  89. 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
  90. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DvN-fBNd.js +1 -0
  91. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DwBf338f.js +1 -0
  92. 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
  93. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-HfnOtuMz.js +310 -0
  94. 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
  95. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-j7gxlOeM.js +1 -0
  96. 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
  97. 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
  98. 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
  99. 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
  100. package/buildLibs/utils/Web/ClColorPicker.cjs +1 -1
  101. package/buildLibs/utils/Web/ClColorPicker.js +1 -1
  102. package/buildLibs/utils/Web/ClCropperPreview.cjs +1 -1
  103. package/buildLibs/utils/Web/ClCropperPreview.js +1 -1
  104. package/buildLibs/utils/Web/ClDateTime.cjs +1 -1
  105. package/buildLibs/utils/Web/ClDateTime.js +1 -1
  106. package/buildLibs/utils/Web/ClFileUpload.cjs +1 -1
  107. package/buildLibs/utils/Web/ClFileUpload.js +1 -1
  108. package/buildLibs/utils/Web/ClInputTag.cjs +1 -1
  109. package/buildLibs/utils/Web/ClInputTag.js +1 -1
  110. package/buildLibs/utils/Web/ClPaginate.cjs +1 -1
  111. package/buildLibs/utils/Web/ClPaginate.js +1 -1
  112. package/buildLibs/utils/Web/ClSelect.cjs +1 -1
  113. package/buildLibs/utils/Web/ClSelect.js +1 -1
  114. package/buildLibs/utils/Web/ClSelectCascade.cjs +1 -1
  115. package/buildLibs/utils/Web/ClSelectCascade.js +1 -1
  116. package/buildLibs/utils/Web/ClSelectMove.cjs +1 -1
  117. package/buildLibs/utils/Web/ClSelectMove.js +655 -647
  118. package/buildLibs/utils/Web/ClSelectTag.cjs +1 -1
  119. package/buildLibs/utils/Web/ClSelectTag.js +1 -1
  120. package/buildLibs/utils/Web/ClSelectTree.cjs +1 -1
  121. package/buildLibs/utils/Web/ClSelectTree.js +71 -63
  122. package/buildLibs/utils/Web/ClTable.cjs +1 -1
  123. package/buildLibs/utils/Web/ClTable.js +1 -1
  124. package/buildLibs/utils/Web/ClTree.cjs +1 -1
  125. package/buildLibs/utils/Web/ClTree.js +1 -1
  126. package/buildLibs/utils/Web/ClXEditable.cjs +1 -1
  127. package/buildLibs/utils/Web/ClXEditable.js +10 -10
  128. package/buildLibs/web/index.cjs +7 -7
  129. package/buildLibs/web/index.js +10792 -10685
  130. package/docs/components/Element/Checkbox.md +2 -1
  131. package/docs/components/Element/Form.md +15 -0
  132. package/docs/components/Element/Input.md +2 -1
  133. package/docs/components/Element/InputNumber.md +2 -1
  134. package/docs/components/Element/InputNumberStepper.md +2 -1
  135. package/docs/components/Element/InputTextarea.md +2 -1
  136. package/docs/components/Element/Radio.md +2 -1
  137. package/docs/components/Web/DateTime.md +2 -1
  138. package/docs/components/Web/FileUpload.md +2 -1
  139. package/docs/components/Web/Select.md +2 -1
  140. package/docs/components/Web/SelectCascade.md +1 -0
  141. package/docs/components/Web/SelectMove.md +2 -1
  142. package/docs/components/Web/SelectTag.md +1 -0
  143. package/docs/components/Web/SelectTree.md +2 -1
  144. package/docs/components/Web/Tree.md +2 -1
  145. package/package.json +1 -1
  146. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-CiNidFJt.js +0 -246
  147. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-DC6727pS.js +0 -2528
  148. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-EXqjkKwS.js +0 -302
  149. package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-Hg16dgRQ.js +0 -1527
  150. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-5aX79Fcf.js +0 -1
  151. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BRvOcf4B.js +0 -1
  152. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-Ba8Z8fOP.js +0 -1
  153. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BjNP5odR.js +0 -1
  154. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CQ3RGLek.js +0 -302
  155. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js +0 -1
  156. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CYN4r-Mx.js +0 -1
  157. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-C_7ArHlU.js +0 -1
  158. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CuJjJvft.js +0 -2
  159. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CwjigRBx.js +0 -2528
  160. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-D6cmq0Tf.js +0 -1527
  161. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-Dbf-3Nik.js +0 -1
  162. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DgD_gHit.js +0 -1
  163. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-FowII7_3.js +0 -1
  164. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-c7oxeU_j.js +0 -246
  165. package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-vLqCsSbV.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("vue"),n=require("@cldemo/ui-kit/common/base"),ee=require("@cldemo/ui-kit/common/Element"),we=require("./List.vue_vue_type_script_setup_true_lang-CFCST05R.js"),xe=require("./Index.vue_vue_type_script_setup_true_lang-BPTL5eCB.js"),Ce=require("./Index.vue_vue_type_script_setup_true_lang-CuJjJvft.js"),Te=require("./Index.vue_vue_type_script_setup_true_lang-CYFgnd30.js"),be=require("./Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js"),Ie=require("./Index.vue_vue_type_script_setup_true_lang-Eczgr-_r.js"),_e=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),Le=require("./Index.vue_vue_type_script_setup_true_lang-BIFHYrzc.js"),he=require("./One.vue_vue_type_script_setup_true_lang-D9zWNf0s.js"),De=require("./Ing.vue_vue_type_script_setup_true_lang-DaWKYdkt.js"),Be=require("./language-BJ4aVgHI.js");;/* empty css */const Ve={key:0},Ke={key:1},Oe={class:"inputTag-operate"},ge=e.defineComponent({name:"ClInputTagInput",__name:"Input",props:{value:String,placeholder:String,disabled:Boolean,isClean:{type:Boolean,default:!0},multiple:Boolean,isCopy:Boolean,isCopyMultipleWrap:{type:Boolean,default:!0},copyJoinKey:{type:String,default:","},minHeight:String,joinKey:{type:String,default:","},isDropdownLayer:{type:Boolean,default:!0},textMaxHeight:String,tagsMaxHeight:String,isShowNum:Boolean},emits:["onInit","onChange","onChangeInput","onFocus"],setup(s,{expose:oe,emit:se}){const a=s,H=se,q=e.inject("$InputTagTop"),O=e.useTemplateRef("refElTag"),u=e.useTemplateRef("refElTextarea"),N=e.useTemplateRef("refElInput"),k=e.reactive({isFocus:!1}),_=e.ref([]),C=e.ref([]),D=e.ref(""),F=e.computed(()=>!n.isEmpty(C.value)||!n.isEmpty(D.value)),te=e.computed(()=>a.isClean&&!a.disabled&&F.value),A=e.computed(()=>({"dropdownLayer-text-container":a.isDropdownLayer,"inputTag-container":!0,"inputTag-multiple":a.multiple,"inputTag-focus":k.isFocus})),J=e.computed(()=>{const l={};return a.multiple&&(a.disabled?l["min-height"]="40px":n.isNonEmptyString(a.minHeight)&&C.value.length>0&&(l["min-height"]=a.minHeight)),l}),v=e.computed(()=>{const l={},{multiple:p,tagsMaxHeight:I}=a;return p&&n.isNonEmptyString(I)&&(l["max-height"]=I),l}),P=(l="tag")=>{const p=S();H("onChange",p,l)},G=()=>{e.nextTick(()=>{H("onInit")})},B=l=>{H("onChangeInput",l)},M=l=>{H("onFocus",l)},Q=()=>{let l="";if(a.multiple){const p=a.copyJoinKey+(a.isCopyMultipleWrap?`
1
+ "use strict";const e=require("vue"),n=require("@cldemo/ui-kit/common/base"),ee=require("@cldemo/ui-kit/common/Element"),we=require("./List.vue_vue_type_script_setup_true_lang-CFCST05R.js"),xe=require("./Index.vue_vue_type_script_setup_true_lang-BPTL5eCB.js"),Ce=require("./Index.vue_vue_type_script_setup_true_lang-CsCn637u.js"),Te=require("./Index.vue_vue_type_script_setup_true_lang-CYFgnd30.js"),be=require("./Index.vue_vue_type_script_setup_true_lang-DXPZYc0c.js"),Ie=require("./Index.vue_vue_type_script_setup_true_lang-Eczgr-_r.js"),_e=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),Le=require("./Index.vue_vue_type_script_setup_true_lang-qqnmaRnk.js"),he=require("./One.vue_vue_type_script_setup_true_lang-D9zWNf0s.js"),De=require("./Ing.vue_vue_type_script_setup_true_lang-DaWKYdkt.js"),Be=require("./language-BJ4aVgHI.js");;/* empty css */const Ve={key:0},Ke={key:1},Oe={class:"inputTag-operate"},ge=e.defineComponent({name:"ClInputTagInput",__name:"Input",props:{value:String,placeholder:String,disabled:Boolean,isClean:{type:Boolean,default:!0},multiple:Boolean,isCopy:Boolean,isCopyMultipleWrap:{type:Boolean,default:!0},copyJoinKey:{type:String,default:","},minHeight:String,joinKey:{type:String,default:","},isDropdownLayer:{type:Boolean,default:!0},textMaxHeight:String,tagsMaxHeight:String,isShowNum:Boolean},emits:["onInit","onChange","onChangeInput","onFocus"],setup(s,{expose:oe,emit:se}){const a=s,H=se,q=e.inject("$InputTagTop"),O=e.useTemplateRef("refElTag"),u=e.useTemplateRef("refElTextarea"),N=e.useTemplateRef("refElInput"),k=e.reactive({isFocus:!1}),_=e.ref([]),C=e.ref([]),D=e.ref(""),F=e.computed(()=>!n.isEmpty(C.value)||!n.isEmpty(D.value)),te=e.computed(()=>a.isClean&&!a.disabled&&F.value),A=e.computed(()=>({"dropdownLayer-text-container":a.isDropdownLayer,"inputTag-container":!0,"inputTag-multiple":a.multiple,"inputTag-focus":k.isFocus})),J=e.computed(()=>{const l={};return a.multiple&&(a.disabled?l["min-height"]="40px":n.isNonEmptyString(a.minHeight)&&C.value.length>0&&(l["min-height"]=a.minHeight)),l}),v=e.computed(()=>{const l={},{multiple:p,tagsMaxHeight:I}=a;return p&&n.isNonEmptyString(I)&&(l["max-height"]=I),l}),P=(l="tag")=>{const p=S();H("onChange",p,l)},G=()=>{e.nextTick(()=>{H("onInit")})},B=l=>{H("onChangeInput",l)},M=l=>{H("onFocus",l)},Q=()=>{let l="";if(a.multiple){const p=a.copyJoinKey+(a.isCopyMultipleWrap?`
2
2
  `:"");l=C.value.join(p)}else l=D.value;return l},S=()=>a.multiple?C.value.join(a.joinKey||","):D.value,R=l=>{if(n.isEmpty(l))_.value=[],C.value=[],D.value="";else if(l!==S())if(a.multiple){const p=[],I=[];n.split(l,a.joinKey||",").forEach(U=>{const V=n.trim(U);!n.isEmpty(V)&&!n.isExistValue(I,V)&&(p.push({id:`inputTag_${n.getRandom(8)}`,name:V}),I.push(V))}),_.value=p,C.value=Array.from(new Set(I))}else D.value=l},X=l=>{const p=n.trim(l);O.value&&O.value.addInfo({id:`inputTag_${n.getRandom(8)}`,name:p}),u.value&&(u.value.initHeight(),u.value.setValue(""))},$=()=>{a.multiple?u.value&&u.value.focus():N.value&&N.value.focus()},ne=(l,p=!0)=>{if(a.multiple){const I=e.toRaw(C.value);n.split(l,a.joinKey||",").forEach(U=>{const V=n.trim(U);if(!n.isEmpty(V))if(p)X(V),n.isExistValue(I,V)||I.push(V);else{const W=_.value.findIndex(le=>le.name===V);W>-1&&_.value.splice(W,1);const z=I.indexOf(V);z>-1&&I.splice(z,1)}}),C.value=Array.from(new Set(I))}else D.value=p?l:"";a.multiple&&$(),P("drop")},ie=()=>{R(a.value??""),G()};e.onMounted(()=>{e.nextTick(()=>{ie()})}),e.watch(()=>a.value,(l,p)=>{l!==p&&l!==S()&&(R(l??""),u.value&&(u.value.setValue(""),u.value.initHeight()))});const ae=l=>{if(a.multiple){const p=u.value?u.value.getParentElement():null;(!p||!p.contains(l.target))&&$()}else $()},re=l=>{if(l.isComposing||l.keyCode===229||l.shiftKey)return;const p=q?q.getListHoverValueKeydown():"";n.isEmpty(p)&&(l.preventDefault(),l.stopPropagation())},r=l=>{if(l.isComposing||l.keyCode===229||l.shiftKey)return;const p=l.target.value,I=q?q.getListHoverValueKeydown():"";if(n.isEmpty(I)){if(l.preventDefault(),l.stopPropagation(),!n.isEmpty(p)){const U=e.toRaw(C.value);let V=[];n.isExistValue(p,`
3
3
  `)?n.split(p,`
4
4
  `).forEach(W=>{n.isEmpty(W)||V.push(...n.split(W,a.joinKey||","))}):V=n.split(p,a.joinKey||","),V.forEach(W=>{const z=n.trim(W);n.isEmpty(z)||(X(z),n.isExistValue(U,z)||U.push(z))}),C.value=Array.from(new Set(U)),P()}}else u.value&&(u.value.initHeight(),u.value.setValue(""))},m=()=>{k.isFocus=!0,M(S())},x=()=>{k.isFocus=!1},w=()=>{if(!O.value)return;const l=O.value.getData();C.value=l.filter(p=>n.isNonEmptyString(p.name)).map(p=>p.name),_.value=l,B(""),P()},L=()=>{_.value=[],C.value=[],D.value="",u.value&&(u.value.setValue(""),u.value.initHeight()),P(),$()},K=l=>{B(l)},j=()=>{M(D.value)};return oe({getValue:()=>S(),setValue:l=>{R(l),u.value&&(u.value.setValue(""),u.value.initHeight())},focus:()=>{$()},updateValue:(l,p=!0)=>{ne(l,p)}}),(l,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(A.value),style:e.normalizeStyle(J.value),onClick:e.withModifiers(ae,["stop"])},[s.multiple?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",{class:"inputTag-tags",style:e.normalizeStyle(v.value)},[e.createVNode(Te._sfc_main,{ref_key:"refElTag",ref:O,disabled:s.disabled,list:_.value,onOnRemove:w},null,8,["disabled","list"])],4),e.withDirectives(e.createVNode(Ce._sfc_main,{ref_key:"refElTextarea",ref:u,height:"24px",heightMax:s.textMaxHeight,disabled:s.disabled,placeholder:s.disabled?"":s.placeholder,isClean:!1,isAutoHeight:!0,onOnKeydownEnter:re,onOnKeyupEnter:r,onOnFocus:m,onOnBlur:x,onOnChangeDelay:K},null,8,["heightMax","disabled","placeholder"]),[[e.vShow,!s.disabled]])])):(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(be._sfc_main,{ref_key:"refElInput",ref:N,value:D.value,"onUpdate:value":p[0]||(p[0]=I=>D.value=I),placeholder:s.placeholder,isClean:!1,disabled:s.disabled,onOnFocus:j,onOnChangeDelay:K},null,8,["value","placeholder","disabled"])])),e.createElementVNode("div",Oe,[s.isShowNum&&s.multiple&&C.value.length>1?(e.openBlock(),e.createBlock(xe._sfc_main,{key:0,num:C.value.length},null,8,["num"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),te.value?(e.openBlock(),e.createBlock(_e._sfc_main,{key:2,name:"close-circle-fill",className:"inputTag-operate-btn","aria-label":"清空",tabindex:"-1",role:"button",onClick:e.withModifiers(L,["stop"]),onKeydown:[e.withKeys(e.withModifiers(L,["stop","prevent"]),["enter"]),e.withKeys(e.withModifiers(L,["stop","prevent"]),["space"])]},null,8,["onKeydown"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),s.isCopy&&F.value?(e.openBlock(),e.createBlock(Ie._sfc_main,{key:4,className:"inputTag-operate-btn",textLabel:Q})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[],64))])],6))}}),Me={class:"dropdownLayer-list-container"},He={key:0,class:"dropdownLayer-list-search"},Fe={key:2,class:"dropdownLayer-list-checkboxAll"},Ne=["aria-activedescendant"],Pe=["id","aria-selected","aria-disabled","onClick","onMouseenter","onMouseleave"],Re={key:0,class:"dropdownLayer-list-checkbox"},$e=["innerHTML"],Ae={key:1},Je={key:0,class:"dropdownLayer-list-empty"},je={key:1,class:"inputTag-load"},qe=180,Ue=50,We=100,ze=130,Ge=e.defineComponent({name:"ClDropdownlayerSearchList",__name:"Dropdown",props:{isSearch:Boolean,searchValue:String,searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||",validator:s=>["||","&&"].indexOf(s)>-1},isMultiple:Boolean,isCheckBoxAll:Boolean,showDropDownTextFormat:String,showDropDownTextFormatSub:String,isCascade:Boolean,parentSelectable:Boolean,parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"},originalData:{type:Array,default:()=>[]},keyIndex:String,selectId:{type:Array,default:()=>[]},isShowEmptyLabel:{type:Boolean,default:!0},isShowLoading:Boolean,serverCallback:Function},emits:["onChange","onSearchResult","onError"],setup(s,{expose:oe,emit:se}){const a=s,H=se,{optPageLanguage:q,getPageLanguage:O}=Be.useLanguage();O("common");const u=e.inject("$InputTagTop"),N=e.useTemplateRef("refElSearch"),k=e.useTemplateRef("refElList"),_=`inputtag-${n.getRandom(5)}`;let C=0,D=0,F=0,te=0,A=!1,J=!1;const v={start:-1,end:-1,limit:50},P=e.reactive({isRunLoading:!1}),G=`dropdownLayer-list-${a.keyIndex||_}`,B=e.ref(""),M=e.ref([]),Q=e.ref([]);let S=[],R=[],X=!1;const $={isScrollLoadIng:!1},ne=e.computed(()=>{let t=!1;return Q.value.length>0&&a.selectId.length>=Q.value.length&&(t=n.isContainArr(a.selectId.map(i=>i.toString()),Q.value)),t}),ie=e.computed(()=>new Set(a.selectId.map(t=>t.toString()))),ae=(t,o)=>{H("onChange",t,o)},re=(t,o)=>{H("onSearchResult",{search:n.isNonEmptyString(t)?t:"",isEmpty:o})},r=t=>{H("onError",t)},m=t=>n.isEmpty(t)?[]:t.filter(o=>o?n.isString(o.id)&&!n.isEmpty(o.id)||n.isNumber(o.id)&&n.isFinite(o.id):!1),x=async t=>{F++;const o=F;let i=[];if(a.serverCallback){a.isShowLoading&&(P.isRunLoading=!0);try{if(i=await a.serverCallback({search:t,offset:0}),o!==F)return;e.nextTick(()=>{o===F&&(P.isRunLoading=!1,u&&u.convertListToJson(i),e.nextTick(()=>{w(t,i)}))})}catch{o===F&&(P.isRunLoading=!1,r("服务端搜索失败,请稍后重试"))}}else if(n.isEmpty(t))i=a.originalData,w(t,i);else if(n.isNonEmptyString(t)){const c=t.toLowerCase(),f=a.searchKey.length,y=a.searchKey;a.originalData.forEach(g=>{const h=[];for(let E=0;E<f;E++){const d=g[y[E]];n.isNonEmptyString(d)&&d.toLowerCase().indexOf(c)>-1&&h.push(!0)}if(h.length>0)switch(a.searchKeyType){case"||":i.push(g);break;case"&&":h.length===f&&i.push(g);break}}),w(t,i)}},w=(t,o)=>{a.isCascade?(n.isEmpty(t)||(o=j(o,a.originalData)),R=o,o=K(o)):o=m(o),S=o,M.value=Y(0,v.limit),k.value&&(k.value.scrollTop=0),ce(0,v.limit),L(),B.value="",re(t,o.length===0)},L=()=>{const t=[],o=a.selectId.map(i=>i.toString());S.forEach(i=>{if(n.isEmpty(i.id))return;const c=i.id.toString();i.isDisabled?n.isExistValue(o,c)&&t.push(c):t.push(c)}),Q.value=t},K=t=>{const o=a.parentKey||"parentId",i=a.topParentValue||"0",c={};t.forEach(E=>{if(n.isEmpty(E.id))return;const d=E[o];if(!n.isEmpty(d)&&d.toString()!==i){const T=d.toString();c[T]||(c[T]=[]),c[T].push(E)}});const f=[],y=t.filter(E=>{if(n.isEmpty(E.id))return!1;const d=E[o];return n.isEmpty(d)||d.toString()===i}),g=new Set,h=(E,d,T)=>{E.forEach(b=>{const Z=b.id.toString();if(g.has(Z))return;g.add(Z);const ue=c[Z]||[];f.push({...b,_level:d,_parentName:T,_hasChildren:ue.length>0,isDisabled:b.isDisabled||ue.length>0&&!a.parentSelectable}),ue.length>0&&h(ue,d+1,b.name)})};return h(y,0,""),f},j=(t,o)=>{const i=a.parentKey||"parentId",c=a.topParentValue||"0",f={},y={};o.forEach(d=>{if(n.isEmpty(d.id))return;const T=d.id.toString();f[T]=d;const b=d[i];!n.isEmpty(b)&&b.toString()!==c&&(y[b.toString()]||(y[b.toString()]=[]),y[b.toString()].push(T))});const g=new Set,h=new Set;t.forEach(d=>{n.isEmpty(d.id)||h.add(d.id.toString())});const E=d=>{let T=f[d],b=0;for(;T&&b<100;){g.add(T.id.toString());const Z=T[i];if(n.isEmpty(Z)||Z.toString()===c)break;T=f[Z.toString()],b++}};return t.forEach(d=>{if(n.isEmpty(d.id))return;const T=d.id.toString();E(T),y[T]&&y[T].forEach(b=>{g.add(b)})}),o.filter(d=>n.isEmpty(d.id)?!1:g.has(d.id.toString()))},Y=(t,o)=>{const i=[],c=S.length,f=t<0?0:t,y=o<=c?o:c;if(f<y)for(let g=f;g<y;g++)i.push(S[g]);return i},de=(t,o)=>{let i=0,c=0;switch(o){case"prev":i=t-v.limit,c=t;break;case"next":i=t,c=i+v.limit;break}return Y(i,c)},ce=(t,o)=>{let i=v.start;(i===-1||t<i)&&(i=t),i=i<=0?0:i;let c=v.end;o>c&&(c=o),c=o<=S.length?o:S.length,v.start=i,v.end=c},pe=()=>{let t=-1,o="";if(!n.isEmpty(a.selectId)){const f=a.selectId.map(y=>y.toString());S.some((y,g)=>{if(n.isEmpty(y.id))return!1;const h=y.id.toString(),E=n.isExistValue(f,h);return E&&(t=g,o=h),E})}let i=0,c=0;t===-1?(C=0,i=0,c=v.limit):(i=t-v.limit*1,c=t+v.limit*1),M.value=Y(i,c),v.start=i<=0?0:i,v.end=c>=S.length?S.length:c,n.isEmpty(o)||M.value.some((f,y)=>{if(n.isEmpty(f.id))return!1;const g=f.id.toString()===o;return g&&(C=y),g})},l=t=>{e.nextTick(()=>{const o=k.value;if(!(!o||!o.children[0]))if(t>0){const i=o.children[0].children[t];o.scrollTop=i&&i.offsetTop>qe?i.offsetTop-Ue:0}else o.scrollTop=0})},p=()=>{a.isCascade?(R=m(a.originalData),S=K(R)):S=m(a.originalData),pe(),e.nextTick(()=>{n.isEmpty(a.searchValue)&&(N.value&&N.value.setValue(""),k.value&&l(C))})},I=async t=>{const o=Date.now(),i=t.target,c=i.scrollTop;if(o-te<150){D=c;return}te=o;const f=i.offsetHeight;if(!i.children[0]){D=c;return}const y=i.children[0].offsetHeight;if(c>D){if(c+f+We>y&&!$.isScrollLoadIng){if($.isScrollLoadIng=!0,v.end>=S.length&&a.serverCallback){const g=F,h=a.searchValue,E={offset:S.length};n.isEmpty(h)||(E.search=h);try{const d=await a.serverCallback(E);if(J)return;g===F&&a.searchValue===h&&(a.isCascade?(R.push(...m(d)),S=K(R)):S.push(...m(d)),L(),u&&u.convertListToJson(S))}catch{g===F&&r("服务端加载更多失败,请稍后重试")}}if(v.end<S.length){const g=de(v.end,"next");M.value.push(...g),ce(v.start,v.end+v.limit)}$.isScrollLoadIng=!1}}else if(c<ze&&v.start>0){const g=de(v.start,"prev"),h=g.length;h>0&&(M.value.unshift(...g),ce(v.start-v.limit,v.end),e.nextTick(()=>{const E=k.value;if(!E||!E.children[0])return;let d=0;const T=E.children[0].children;for(let b=0;b<h&&T[b];b++)d+=T[b].offsetHeight;E.scrollTop+=d}))}D=c},U=()=>{X||e.nextTick(()=>{k.value&&(k.value.addEventListener("scroll",I),X=!0)})},V=t=>{let o=a.showDropDownTextFormat;if(t._level>=1&&!n.isEmpty(a.showDropDownTextFormatSub)&&(o=a.showDropDownTextFormatSub),n.isEmpty(o)){if(n.isEmpty(t.name))return"";const i=t.name;return n.isString(i)?n.encodeHTML(i):String(i)}return n.convertStringFormatEncodeHTML(o,t)},W=t=>{const o=[];return a.isMultiple?(a.selectId.forEach(i=>{i.toString()!==t&&o.push(i)}),n.isExistValue(a.selectId.map(i=>i.toString()),t)||o.push(t)):o.push(t),o},z=t=>{const o=M.value;if(o.length===0){B.value="";return}let i=-1;const c=B.value;c.length>0?(o.forEach((f,y)=>{f.id.toString()===c&&(i=y)}),i+=t,i<0?i=0:i>=o.length&&(i=o.length-1)):i=0,B.value=n.isEmpty(o[i].id)?"":o[i].id.toString(),l(i)},le=t=>{if(t.isComposing||t.keyCode===229)return;let o=t.keyCode;if(!n.isUndefined(o))switch(o=o.toString(),o){case"13":if(t.shiftKey)break;t.preventDefault(),t.stopPropagation();break;case"38":t.preventDefault(),t.stopPropagation(),z(-1);break;case"40":t.preventDefault(),t.stopPropagation(),z(1);break}},fe=t=>{if(t.isComposing||t.keyCode===229)return;let o=t.keyCode;if(!n.isUndefined(o))switch(o=o.toString(),o){case"27":u&&u.setDropdownOpen(!1);break;case"13":{if(t.shiftKey)break;const i=B.value;if(!n.isEmpty(i)){const c=M.value.find(f=>f.id.toString()===i);if(c&&!c.isDisabled){const f=W(i);ae(f,{id:i,isSelect:a.selectId.map(y=>y.toString()).indexOf(i)===-1})}}break}}},me=()=>{p(),L(),U();const{searchValue:t}=a;n.isNonEmptyString(t)&&x(t)};e.onMounted(()=>{me()}),e.onBeforeUnmount(()=>{J=!0,ee.offListener(window,"keydown",le,!0),ee.offListener(window,"keyup",fe,!0),A=!1,k.value&&k.value.removeEventListener("scroll",I)}),e.watch(()=>a.originalData,t=>{a.isCascade?(R=m(t),S=K(R)):S=m(t),pe(),L(),U()}),e.watch(()=>a.searchValue,t=>{x(t)});const ye=t=>{x(t)},ve=t=>{if(!t||!a.isMultiple)return;const o=a.selectId.map(h=>h.toString()),i=new Set;S.forEach(h=>{h.isDisabled&&!n.isEmpty(h.id)&&i.add(h.id.toString())});const c=[],f=[],y=[];Q.value.forEach(h=>{t.value?n.isExistValue(o,h)||f.push(h):n.isExistValue(o,h)&&!i.has(h)&&y.push(h),c.push(h)});const g=n.getArrClone(a.selectId);y.length>0&&y.forEach(h=>{const E=g.findIndex(d=>d.toString()===h);E>-1&&g.splice(E,1)}),f.length>0&&g.push(...f),ae(g,{id:c,isSelect:t.value})},Se=t=>{if(!t.isDisabled&&!n.isEmpty(t.id)){const o=t.id.toString(),i=W(o);ae(i,{id:o,isSelect:a.selectId.map(c=>c.toString()).indexOf(o)===-1})}},Ee=t=>{!t||n.isEmpty(t.id)||(B.value=t.id.toString())},ke=t=>{!t||n.isEmpty(t.id)||B.value===t.id.toString()&&(B.value="")};return oe({initOpenShow:t=>{t?A||(ee.onListener(window,"keydown",le,!0),ee.onListener(window,"keyup",fe,!0),A=!0):A&&(ee.offListener(window,"keydown",le,!0),ee.offListener(window,"keyup",fe,!0),A=!1)},getHoverKeydown:()=>B.value}),(t,o)=>(e.openBlock(),e.createElementBlock("div",Me,[P.isRunLoading?(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(De._sfc_main,{isLoadIng:P.isRunLoading},null,8,["isLoadIng"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.isSearch?(e.openBlock(),e.createElementBlock("div",He,[e.createVNode(Le._sfc_main,{ref_key:"refElSearch",ref:N,placeholder:s.searchPlaceholder,onOnChange:ye},null,8,["placeholder"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),s.isMultiple&&s.isCheckBoxAll?(e.openBlock(),e.createElementBlock("div",Fe,[e.createVNode(he._sfc_main,{forId:`${G}-cb-all`,label:e.unref(q).checkboxAll,value:ne.value,onOnChange:ve},null,8,["forId","label","value"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),e.createElementVNode("div",{class:"dropdownLayer-list-body",ref_key:"refElList",ref:k},[M.value.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,role:"listbox","aria-activedescendant":B.value?`${G}-opt-${B.value}`:void 0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(i,c)=>(e.openBlock(),e.createElementBlock("li",{key:`${_}-${i.id}-${c}`,id:`${G}-opt-${i.id}`,role:"option","aria-selected":ie.value.has(i.id.toString()),"aria-disabled":i.isDisabled,class:e.normalizeClass({"option-selected":ie.value.has(i.id.toString()),"option-disabled":i.isDisabled,"option-hoverKeydown":B.value===i.id.toString(),"inputTag-dropdown-item-child":i._level>=1}),style:e.normalizeStyle({paddingLeft:i._level?i._level*20+"px":void 0}),onClick:f=>Se(i),onMouseenter:f=>Ee(i),onMouseleave:f=>ke(i)},[e.createElementVNode("div",null,[s.isMultiple?(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(he._sfc_main,{name:`${G}-cb`,forId:`${G}-cb-${i.id}`,value:ie.value.has(i.id.toString()),disabled:i.isDisabled},null,8,["name","forId","value","disabled"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),e.createElementVNode("div",{class:"dropdownLayer-list-title",innerHTML:V(i)},null,8,$e)])],46,Pe))),128))],8,Ne)):(e.openBlock(),e.createElementBlock("ul",Ae,[s.isShowEmptyLabel?(e.openBlock(),e.createElementBlock("li",Je,e.toDisplayString(e.unref(q).noResultsText),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))]))],512)],64))]))}}),Qe=["id"],Xe=e.defineComponent({name:"ClInputTag",__name:"Index",props:{id:String,value:String,className:String,placeholder:String,disabled:Boolean,isClean:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},isCopy:Boolean,isCopyMultipleWrap:{type:Boolean,default:!0},copyJoinKey:{type:String,default:","},minHeight:{type:String,default:"70px"},joinKey:{type:String,default:","},isAutofill:Boolean,list:{type:Array,default:()=>[]},searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||",validator:s=>["||","&&"].indexOf(s)>-1},showDropDownTextFormat:String,showDropDownTextFormatSub:String,isCascade:Boolean,parentSelectable:Boolean,parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"},isFocusShowDrop:Boolean,textMaxHeight:String,tagsMaxHeight:String,isShowNum:Boolean,isShowLoading:Boolean,serverCallback:Function,isPlaintext:{type:Boolean,default:!1},appendContainer:{type:String,default:""}},emits:["onInit","update:value","update:modelValue","onChange","onError"],setup(s,{expose:oe,emit:se}){const a=s,H=se,q=a.id,O=e.useTemplateRef("refElDropdownLayer"),u=e.useTemplateRef("refElInput"),N=e.useTemplateRef("refElList"),k=e.reactive({keyIndex:`inputTag-${n.getRandom(8)}`,searchValue:"",dropdownSelectId:[],isUseData:!1}),_={listNameJson:{},listIdJson:{}},C=e.computed(()=>{let r={"panel-input-tag":!0,"inputTag-disabled":a.disabled||a.isPlaintext,"cl-plaintext-static":a.isPlaintext,"cl-plaintext-inputtag":a.isPlaintext};return r=n.getJsonMerge(r,ee.getClassNameJson(a.className)),n.getStringByJson(r," ")}),D=e.computed(()=>{let r="inputTag-dropdown ";return k.isUseData||(r+=" inputTag-dropdown-nodata "),r}),F=(r,m="")=>{H("update:value",r),H("update:modelValue",r),H("onChange",r,m)},te=()=>{e.nextTick(()=>{H("onInit")})},A=r=>{const x=n.isEmpty(r)?[]:r.filter(w=>{if(!w)return!1;const L=n.isString(w.id)&&!n.isEmpty(w.id)||n.isNumber(w.id)&&n.isFinite(w.id),K=n.isNonEmptyString(w.name)||n.isNumber(w.name)&&!n.isEmpty(w.name);return L&&K});_.listNameJson=n.getJsonByList(x,"name"),_.listIdJson=n.getJsonByList(x,"id")},J=r=>{if(O.value){const m=O.value.checkIsShowOpen();if(r){if(!m){const x=[],w=u.value?u.value.getValue():"",L=n.isEmpty(w)?[]:n.split(w,a.joinKey||",");L.length>0&&L.forEach(K=>{if(n.isExistJsonKey(_.listNameJson,K)){const j=_.listNameJson[K];j&&!n.isEmpty(j.id)&&x.push(j.id.toString())}}),k.dropdownSelectId=x,k.isUseData=!n.isEmpty(a.list)||!!a.serverCallback,O.value.setOpen(!0),e.nextTick(()=>{O.value&&O.value.initCompleteOpen()})}}else k.isUseData=!0,m&&O.value.setOpen(!1)}},v=()=>{n.isEmpty(a.list)||A(a.list)};e.onMounted(()=>{e.nextTick(()=>{v()})}),e.watch(()=>a.list,r=>{A(r),k.isUseData=!n.isEmpty(r)||!!a.serverCallback});const P=()=>{te()},G=r=>{r&&a.disabled||e.nextTick(()=>{N.value&&N.value.initOpenShow(r)})},B=r=>{const m=r.toLowerCase(),x=a.searchKey;let w=!1;return a.list.forEach(L=>{if(w)return;let K=0;for(let j=0;j<x.length;j++){const Y=L[x[j]];n.isNonEmptyString(Y)&&Y.toLowerCase().indexOf(m)>-1&&K++}K>0&&(a.searchKeyType==="||"||a.searchKeyType==="&&"&&K===x.length)&&(w=!0)}),w},M=r=>{k.searchValue=r;let m=!0;if(n.isNonEmptyString(r)&&(r.indexOf(`
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),o=require("@cldemo/ui-kit/common/base"),F=require("@cldemo/ui-kit/common/Element"),_=require("./Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js"),C=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),O=["id"],q=["aria-label","tabindex","onKeydown"],M=t.defineComponent({name:"ClInputSearch",components:{ClInput:_._sfc_main,ClIconFont:C._sfc_main},__name:"Index",props:{id:String,value:{type:String,default:""},className:{type:String,default:""},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""},textLabel:{type:String,default:""},changeDelayTime:{type:Number,default:200},theme:{type:String,default:"icon",validator:a=>["icon","text"].indexOf(a)!==-1},location:{type:String,default:"right",validator:a=>["left","right"].indexOf(a)!==-1}},emits:["update:value","update:modelValue","onChange","onSearch","onFocus","onBlur"],setup(a,{expose:S,emit:x}){const n=a,i=x,E=n.id,y=t.useTemplateRef("refElInput");let s=o.isNonEmptyString(n.value)?n.value:"";const l=t.ref(o.isNonEmptyString(n.value)?n.value:"");let d=null,f=null;const v=t.computed(()=>o.isFinite(n.changeDelayTime)&&n.changeDelayTime>=0?n.changeDelayTime:200),B=t.computed(()=>{let e="append";return o.isEmpty(n.location)||(e=n.location==="left"?"prepend":"append"),e}),w=t.computed(()=>{let e={"panel-input-search":!0,"input-search-disabled":n.disabled};const r=o.isEmpty(n.theme)?"icon":n.theme;return e[`input-search-${r}`]=!0,o.getJsonMerge(e,F.getClassNameJson(n.className))}),h=e=>{i("update:value",e),i("update:modelValue",e),i("onChange",e)},g=e=>{i("onSearch",e)},k=e=>{i("onFocus",e)},I=e=>{i("onBlur",e)},m=()=>{d&&(clearTimeout(d),d=null)},p=()=>{f&&(clearTimeout(f),f=null)},b=()=>{m(),p(),s!==l.value&&(s=l.value,h(l.value)),g(l.value)};t.onBeforeUnmount(()=>{m(),p()}),t.watch(()=>n.value,e=>{l.value=o.isNonEmptyString(e)?e:"",s=l.value});const T=e=>{n.disabled||(m(),d=setTimeout(()=>{!n.disabled&&l.value===e&&s!==e&&(s=e,h(e)),d=null},v.value))},K=()=>{n.disabled||(p(),f=setTimeout(()=>{n.disabled||b()},v.value))},N=e=>{n.disabled||k(e)},V=e=>{n.disabled||I(e)},u=()=>{n.disabled||b()},D=()=>{n.disabled||(m(),p(),s="",h(""),g(""))};return S({getValue:()=>l.value,setValue:(e,r)=>{const c=o.isNonEmptyString(e)?e:"";m(),p(),s=c,l.value=c,r&&(i("update:value",c),i("update:modelValue",c))},focus:()=>{y.value?.focus()}}),(e,r)=>(t.openBlock(),t.createElementBlock("div",{id:t.unref(E),class:t.normalizeClass(w.value)},[t.createVNode(_._sfc_main,{ref_key:"refElInput",ref:y,value:l.value,"onUpdate:value":r[0]||(r[0]=c=>l.value=c),theme:"icon",placeholder:a.placeholder,isClean:!0,disabled:a.disabled,onOnChange:T,onOnKeyupEnter:K,onOnFocus:N,onOnBlur:V,onOnClear:D},{[B.value]:t.withCtx(()=>[a.theme==="text"&&!t.unref(o).isEmpty(a.textLabel)?(t.openBlock(),t.createElementBlock("span",{key:0,role:"button","aria-label":a.textLabel,tabindex:a.disabled?-1:0,onClick:u,onKeydown:[t.withKeys(t.withModifiers(u,["prevent"]),["enter"]),t.withKeys(t.withModifiers(u,["prevent"]),["space"])]},t.toDisplayString(a.textLabel),41,q)):(t.openBlock(),t.createBlock(C._sfc_main,{key:1,name:"search",role:"button","aria-label":"搜索",tabindex:a.disabled?-1:0,onClick:u,onKeydown:[t.withKeys(t.withModifiers(u,["prevent"]),["enter"]),t.withKeys(t.withModifiers(u,["prevent"]),["space"])]},null,8,["tabindex","onKeydown"]))]),_:2},1032,["value","placeholder","disabled"])],10,O))}});exports._sfc_main=M;
1
+ "use strict";const t=require("vue"),o=require("@cldemo/ui-kit/common/base"),F=require("@cldemo/ui-kit/common/Element"),_=require("./Index.vue_vue_type_script_setup_true_lang-DXPZYc0c.js"),C=require("./Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),O=["id"],q=["aria-label","tabindex","onKeydown"],M=t.defineComponent({name:"ClInputSearch",components:{ClInput:_._sfc_main,ClIconFont:C._sfc_main},__name:"Index",props:{id:String,value:{type:String,default:""},className:{type:String,default:""},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""},textLabel:{type:String,default:""},changeDelayTime:{type:Number,default:200},theme:{type:String,default:"icon",validator:a=>["icon","text"].indexOf(a)!==-1},location:{type:String,default:"right",validator:a=>["left","right"].indexOf(a)!==-1}},emits:["update:value","update:modelValue","onChange","onSearch","onFocus","onBlur"],setup(a,{expose:S,emit:x}){const n=a,i=x,E=n.id,y=t.useTemplateRef("refElInput");let s=o.isNonEmptyString(n.value)?n.value:"";const l=t.ref(o.isNonEmptyString(n.value)?n.value:"");let d=null,f=null;const v=t.computed(()=>o.isFinite(n.changeDelayTime)&&n.changeDelayTime>=0?n.changeDelayTime:200),B=t.computed(()=>{let e="append";return o.isEmpty(n.location)||(e=n.location==="left"?"prepend":"append"),e}),w=t.computed(()=>{let e={"panel-input-search":!0,"input-search-disabled":n.disabled};const r=o.isEmpty(n.theme)?"icon":n.theme;return e[`input-search-${r}`]=!0,o.getJsonMerge(e,F.getClassNameJson(n.className))}),h=e=>{i("update:value",e),i("update:modelValue",e),i("onChange",e)},g=e=>{i("onSearch",e)},k=e=>{i("onFocus",e)},I=e=>{i("onBlur",e)},m=()=>{d&&(clearTimeout(d),d=null)},p=()=>{f&&(clearTimeout(f),f=null)},b=()=>{m(),p(),s!==l.value&&(s=l.value,h(l.value)),g(l.value)};t.onBeforeUnmount(()=>{m(),p()}),t.watch(()=>n.value,e=>{l.value=o.isNonEmptyString(e)?e:"",s=l.value});const T=e=>{n.disabled||(m(),d=setTimeout(()=>{!n.disabled&&l.value===e&&s!==e&&(s=e,h(e)),d=null},v.value))},K=()=>{n.disabled||(p(),f=setTimeout(()=>{n.disabled||b()},v.value))},N=e=>{n.disabled||k(e)},V=e=>{n.disabled||I(e)},u=()=>{n.disabled||b()},D=()=>{n.disabled||(m(),p(),s="",h(""),g(""))};return S({getValue:()=>l.value,setValue:(e,r)=>{const c=o.isNonEmptyString(e)?e:"";m(),p(),s=c,l.value=c,r&&(i("update:value",c),i("update:modelValue",c))},focus:()=>{y.value?.focus()}}),(e,r)=>(t.openBlock(),t.createElementBlock("div",{id:t.unref(E),class:t.normalizeClass(w.value)},[t.createVNode(_._sfc_main,{ref_key:"refElInput",ref:y,value:l.value,"onUpdate:value":r[0]||(r[0]=c=>l.value=c),theme:"icon",placeholder:a.placeholder,isClean:!0,disabled:a.disabled,onOnChange:T,onOnKeyupEnter:K,onOnFocus:N,onOnBlur:V,onOnClear:D},{[B.value]:t.withCtx(()=>[a.theme==="text"&&!t.unref(o).isEmpty(a.textLabel)?(t.openBlock(),t.createElementBlock("span",{key:0,role:"button","aria-label":a.textLabel,tabindex:a.disabled?-1:0,onClick:u,onKeydown:[t.withKeys(t.withModifiers(u,["prevent"]),["enter"]),t.withKeys(t.withModifiers(u,["prevent"]),["space"])]},t.toDisplayString(a.textLabel),41,q)):(t.openBlock(),t.createBlock(C._sfc_main,{key:1,name:"search",role:"button","aria-label":"搜索",tabindex:a.disabled?-1:0,onClick:u,onKeydown:[t.withKeys(t.withModifiers(u,["prevent"]),["enter"]),t.withKeys(t.withModifiers(u,["prevent"]),["space"])]},null,8,["tabindex","onKeydown"]))]),_:2},1032,["value","placeholder","disabled"])],10,O))}});exports._sfc_main=M;
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),y=require("@cldemo/ui-kit/common/base"),S=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),ee=require("../Shared/Popup.vue_vue_type_script_setup_true_lang-2PS2RvJ7.js"),M=require("@cldemo/ui-kit/common/Element/Event"),J=require("@cldemo/ui-kit/common/Element"),E=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js"),te=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Eczgr-_r.js"),le=require("../Shared/language-BJ4aVgHI.js");;/* empty css */const G=(a,t)=>Object.prototype.hasOwnProperty.call(a,t),ne=(a,t,n)=>{const o=(2-t)*n/2,p=o===0||o===1?0:t*n/(o<.5?o*2:2-o*2);return[a,p,o]},oe=a=>typeof a=="string"&&a.includes(".")&&Number.parseFloat(a)===1,ae=a=>typeof a=="string"&&a.includes("%"),T=(a,t)=>{oe(a)&&(a="100%");const n=ae(a);return a=Math.min(t,Math.max(0,Number.parseFloat(`${a}`))),n&&(a=Number.parseInt(`${a*t}`,10)/100),Math.abs(a-t)<1e-6?1:a%t/Number.parseFloat(t)},j={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},A=a=>{a=Math.min(Math.round(a),255);const t=Math.floor(a/16),n=a%16;return`${j[t]||t}${j[n]||n}`},Y=({r:a,g:t,b:n})=>Number.isNaN(+a)||Number.isNaN(+t)||Number.isNaN(+n)?"":`#${A(a)}${A(t)}${A(n)}`,H={A:10,B:11,C:12,D:13,E:14,F:15},x=a=>a.length===2?(H[a[0].toUpperCase()]||+a[0])*16+(H[a[1].toUpperCase()]||+a[1]):H[a[1].toUpperCase()]||+a[1],re=(a,t,n)=>{t=t/100,n=n/100;let o=t;const p=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,o*=p<=1?p:2-p;const r=(n+t)/2,d=n===0?2*o/(p+o):2*t/(n+t);return{h:a,s:d*100,v:r*100}},Q=(a,t,n)=>{a=T(a,255),t=T(t,255),n=T(n,255);const o=Math.max(a,t,n),p=Math.min(a,t,n);let r=0;const d=o,l=o-p,c=o===0?0:l/o;if(o===p)r=0;else{switch(o){case a:{r=(t-n)/l+(t<n?6:0);break}case t:{r=(n-a)/l+2;break}case n:{r=(a-t)/l+4;break}}r/=6}return{h:r*360,s:c*100,v:d*100}},D=(a,t,n)=>{a=T(a,360)*6,t=T(t,100),n=T(n,100);const o=Math.floor(a),p=a-o,r=n*(1-t),d=n*(1-p*t),l=n*(1-(1-p)*t),c=o%6,s=[n,d,r,r,l,n][c],h=[l,n,n,d,r,r][c],C=[r,r,l,n,n,d][c];return{r:Math.round(s*255),g:Math.round(h*255),b:Math.round(C*255)}};class se{_hue=0;_saturation=100;_value=100;_alpha=100;enableAlpha=!1;format="hex";value="";selected;constructor(t){t=t||{};for(const n in t)G(t,n)&&(this[n]=t[n]);t.value?this.fromString(t.value):this.doOnChange()}set(t,n){if(arguments.length===1&&typeof t=="object"){for(const o in t)G(t,o)&&this.set(o,t[o]);return}this[`_${t}`]=n,this.doOnChange()}get(t){return t==="alpha"?Math.floor(this[`_${t}`]):this[`_${t}`]}toRgb(){return D(this._hue,this._saturation,this._value)}fromString(t){if(!t)return;const n=this._convertValueInfo(t);n&&(this._hue=n.hue,this._saturation=n.saturation,this._value=n.value,this._alpha=n.alpha,this.doOnChange())}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:n,_value:o,_alpha:p,format:r}=this,d={hue:t,saturation:n,value:o,alpha:p};let l=this._convertFormat(r,d);l.length===0&&(l=this._getValueRGB(d)),this.value=l}checkValue(t){let n=!1,o="";if(/^rgb\(/.test(t)?o="^[rR][gG][Bb][\\(]([\\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\\s]*,){2}[\\s]*(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)[\\s]*[\\)]{1}$":/^rgba\(/.test(t)?o="^[rR][gG][Bb][Aa][\\(]([\\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\\s]*,){3}[\\s]*(1|1.0|0|0.[0-9])[\\s]*[\\)]{1}$":/^#/.test(t)?o="^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$":/^hsl\(/.test(t)?o="^[hH][Ss][Ll][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*)[\\)]$":/^hsla\(/.test(t)?o="^[hH][Ss][Ll][Aa][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,){2}([\\s]*(1|1.0|0|0.[0-9])[\\s]*)[\\)]$":/^hsv\(/.test(t)?o="^[hH][Ss][Vv][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*)[\\)]$":/^hsva\(/.test(t)&&(o="^[hH][Ss][Vv][Aa][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,){2}([\\s]*(1|1.0|0|0.[0-9])[\\s]*)[\\)]$"),o.length>0){const p=new RegExp(o);n=t.match(p)!==null}return n}getValueFormat(t,n){const o=this._convertValueInfo(t);return o?this._convertFormat(n,o):t}_convertValueInfo(t){let n=0,o=100,p=100,r=100;if(t){let d;if(t.includes("hsl")){const l=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(c=>c!=="").map((c,s)=>s>2?Number.parseFloat(c):Number.parseInt(c,10));l.length===4?(r=Number.parseFloat(l[3].toString()),r=r>1?1:r,r=r*100):l.length===3&&(r=100),l.length>=3&&(d=re(l[0],l[1],l[2]))}else if(t.includes("hsv")){const l=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(c=>c!=="").map((c,s)=>s>2?Number.parseFloat(c):Number.parseInt(c,10));l.length===4?(r=Number.parseFloat(l[3].toString()),r=r>1?1:r,r=r*100):l.length===3&&(r=100),l.length>=3&&(d={h:l[0],s:l[1],v:l[2]})}else if(t.includes("rgb")){const l=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(c=>c!=="").map((c,s)=>s>2?Number.parseFloat(c):Number.parseInt(c,10));l.length===4?(r=Number.parseFloat(l[3].toString()),r=r>1?1:r,r=r*100):l.length===3&&(r=100),l.length>=3&&(d=Q(l[0],l[1],l[2]))}else if(t.includes("#")){const l=t.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(l))return;let c=0,s=0,h=0;l.length===3?(c=x(l[0]+l[0]),s=x(l[1]+l[1]),h=x(l[2]+l[2])):(l.length===6||l.length===8)&&(c=x(l.slice(0,2)),s=x(l.slice(2,4)),h=x(l.slice(4,6))),l.length===8?(r=x(l.slice(6))/255,r=r>1?1:r,r=r*100):(l.length===3||l.length===6)&&(r=100),d=Q(c,s,h)}d&&(n=Math.max(0,Math.min(360,d.h)),o=Math.max(0,Math.min(100,d.s)),p=Math.max(0,Math.min(100,d.v)))}return{hue:n,saturation:o,value:p,alpha:r}}_convertFormat(t,n){let o="";switch(t){case"hsl":{o=this._getValueHSL(n);break}case"hsv":{o=this._getValueHSV(n);break}case"rgb":{o=this._getValueRGB(n);break}case"hex":o=this._getValueHEX(n)}return o}_isShowAlpha(t){return t!==100}_getValueHSL(t){const n=Math.floor(t.alpha),o=this._isShowAlpha(t.alpha),p=ne(t.hue,t.saturation/100,t.value/100),r=Math.round(t.hue),d=Math.round(p[1]*100),l=Math.round(p[2]*100);return o?`hsla(${r}, ${d}%, ${l}%, ${n/100})`:`hsl(${r}, ${d}%, ${l}%)`}_getValueHSV(t){const n=Math.floor(t.alpha),o=this._isShowAlpha(n),p=Math.round(t.hue),r=Math.round(t.saturation),d=Math.round(t.value);return o?`hsva(${p}, ${r}%, ${d}%, ${n/100})`:`hsv(${p}, ${r}%, ${d}%)`}_getValueHEX(t){const n=Math.floor(t.alpha);return this._isShowAlpha(n)?`${Y(D(t.hue,t.saturation,t.value))}${A(n*255/100)}`:Y(D(t.hue,t.saturation,t.value))}_getValueRGB(t){const n=Math.floor(t.alpha),o=this._isShowAlpha(n),{r:p,g:r,b:d}=D(t.hue,t.saturation,t.value);return o?`rgba(${p}, ${r}, ${d}, ${this.get("alpha")/100})`:`rgb(${p}, ${r}, ${d})`}}const ce=e.defineComponent({name:"ClColorPickerPalette",__name:"Palette",props:{color:{type:Object,required:!0}},setup(a){const t=a,n=e.useTemplateRef("refElTopParent"),o=e.reactive({background:"hsl(0, 100%, 50%)",btnLeft:0,btnTop:0}),p=e.computed(()=>{const c=t.color.get("hue"),s=t.color.get("value");return{hue:c,value:s}}),r=(c,s)=>{const C=n.value.getBoundingClientRect();let v=s.clientX-C.left,m=s.clientY-C.top;v=Math.max(0,v),v=Math.min(v,C.width),m=Math.max(0,m),m=Math.min(m,C.height),o.btnLeft=v,o.btnTop=m,t.color.set({saturation:v/C.width*100,value:100-m/C.height*100})},d=()=>{const c=n.value,s=t.color.get("saturation"),h=t.color.get("value"),{clientWidth:C,clientHeight:v}=c;o.btnLeft=s*C/100,o.btnTop=(100-h)*v/100,o.background=`hsl(${t.color.get("hue")}, 100%, 50%)`},l=()=>{const c={ing:(s,h)=>{r(s,h)},end:(s,h)=>{r(s,h)}};new M.Drag(n.value,c),d()};return e.onMounted(()=>{e.nextTick(()=>{l()})}),e.watch(()=>p.value,()=>{d()}),(c,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"refElTopParent",ref:n,class:"panel-colorpicker-palette",style:e.normalizeStyle({backgroundColor:o.background})},[s[1]||(s[1]=e.createElementVNode("div",{class:"panel-colorpicker-palette-white"},null,-1)),s[2]||(s[2]=e.createElementVNode("div",{class:"panel-colorpicker-palette-black"},null,-1)),e.createElementVNode("div",{class:"panel-colorpicker-palette-btn",style:e.normalizeStyle({top:o.btnTop+"px",left:o.btnLeft+"px"})},[...s[0]||(s[0]=[e.createElementVNode("div",null,null,-1)])],4)],4))}}),ie=e.defineComponent({name:"ClColorPickerHue",__name:"Hue",props:{color:{type:Object,required:!0}},setup(a){const t=a,n=e.useTemplateRef("refElTopParent"),o=e.useTemplateRef("refElContainer"),p=e.useTemplateRef("refElBtn"),r=e.reactive({btnTop:0}),d=e.computed(()=>t.color.get("hue")),l=(v,m)=>{const V=n.value.getBoundingClientRect();let b=m.clientY-V.top;b=Math.max(0,b),b=Math.min(b,V.height);const _=Math.round(b/V.height*360);t.color.set("hue",_)},c=()=>{const v=n.value,m=t.color.get("hue");return Math.round(m*v.offsetHeight/360)},s=()=>{r.btnTop=c()},h=()=>{const v={ing:(m,g)=>{l(m,g)},end:(m,g)=>{l(m,g)}};new M.Drag(o.value,v),new M.Drag(p.value,v),s()};e.onMounted(()=>{e.nextTick(()=>{h()})}),e.watch(()=>d.value,()=>{s()});const C=v=>{if(v.target!==p.value){const g=J.getClientXY(v);l(v,g)}};return(v,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"refElTopParent",ref:n,class:"panel-colorpicker-hue"},[e.createElementVNode("div",{ref_key:"refElContainer",ref:o,class:"panel-colorpicker-hue-container",onClick:C},null,512),e.createElementVNode("div",{ref_key:"refElBtn",ref:p,class:"panel-colorpicker-hue-btn",style:e.normalizeStyle({top:r.btnTop+"px"})},null,4)],512))}}),ue=e.defineComponent({name:"ClColorPickerAlpha",__name:"Alpha",props:{color:{type:Object,required:!0}},setup(a){const t=a,n=e.useTemplateRef("refElTopParent"),o=e.useTemplateRef("refElContainer"),p=e.useTemplateRef("refElBtn"),r=e.reactive({background:null,btnLeft:0}),d=e.computed(()=>t.color.get("alpha")),l=(m,g)=>{const b=n.value.getBoundingClientRect();let _=g.clientX-b.left;_=Math.max(0,_),_=Math.min(_,b.width);const N=Math.round(_/b.width*100);t.color.set("alpha",N)},c=()=>{const m=n.value,g=t.color.get("alpha");return Math.round(g*m.offsetWidth/100)},s=()=>{if(t.color&&t.color.value){const{r:m,g,b:V}=t.color.toRgb();return`linear-gradient(to right, rgba(${m}, ${g}, ${V}, 0) 0%, rgba(${m}, ${g}, ${V}, 1) 100%)`}return null},h=()=>{r.btnLeft=c(),r.background=s()},C=()=>{const m={ing:(g,V)=>{l(g,V)},end:(g,V)=>{l(g,V)}};new M.Drag(o.value,m),new M.Drag(p.value,m),h()};e.onMounted(()=>{e.nextTick(()=>{C()})}),e.watch(()=>d.value,()=>{h()}),e.watch(()=>t.color.value,()=>{h()});const v=m=>{if(m.target!==p.value){const V=J.getClientXY(m);l(m,V)}};return(m,g)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"refElTopParent",ref:n,class:"panel-colorpicker-alpha"},[e.createElementVNode("div",{ref_key:"refElContainer",ref:o,class:"panel-colorpicker-alpha-container",style:e.normalizeStyle({background:r.background}),onClick:v},null,4),e.createElementVNode("div",{ref_key:"refElBtn",ref:p,class:"panel-colorpicker-alpha-btn",style:e.normalizeStyle({left:r.btnLeft+"px"})},null,4)],512))}}),K=e.defineComponent({name:"ClColorPickerItemBlock",__name:"ItemBlock",props:{className:String,color:String},emits:{onClick:a=>!0},setup(a,{emit:t}){const n=a,o=t,p=e.computed(()=>{let d="panel-colorpicker-item-block ";const{className:l}=n;return l&&!y.isEmpty(l)&&(d+=l),d}),r=()=>{o("onClick",n.color||"")};return(d,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(p.value),onClick:r},[l[0]||(l[0]=e.createElementVNode("div",{class:"panel-colorpicker-bg-alpha"},null,-1)),e.createElementVNode("div",{style:e.normalizeStyle({background:a.color})},null,4)],2))}}),pe={class:"panel-colorpicker-preset"},de=e.defineComponent({name:"ClColorPickerPreset",__name:"Preset",emits:{onClick:a=>!0},setup(a,{emit:t}){const n=t,o=e.reactive({keyIndex:`ColorpickerPreset-${y.getRandom(8)}`}),p=e.ref([]),r=()=>{const l=["var(--cl-text-primary, #323233)","var(--cl-bg, #ffffff)","#f44336","#E91E63","#9c27b0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548","#9E9E9E","#607D8B","rgba(255, 69, 0, 0.68)","rgba(31, 147, 255, 0.73)","var(--cl-transparent, rgba(0, 0, 0, 0))"];p.value=l};e.onMounted(()=>{r()});const d=l=>{n("onClick",l)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(s,h)=>(e.openBlock(),e.createElementBlock("li",{key:`${o.keyIndex}-${h}`},[e.createVNode(K,{color:s,onOnClick:d},null,8,["color"])]))),128))])]))}}),he={class:"panel-colorpicker-value"},me={key:0,class:"panel-colorpicker-hex"},fe={key:1,class:"panel-colorpicker-rgb"},ve={key:2,class:"panel-colorpicker-hsl"},ge={key:3,class:"panel-colorpicker-hsv"},ke=e.defineComponent({name:"ClColorPickerValue",__name:"Value",props:{color:{type:Object,required:!0}},emits:{onChangeType:a=>!0},setup(a,{expose:t,emit:n}){const o=a,p=n,r=e.reactive({type:"hex",hex:"",rgb:"",hsl:"",hsv:""}),d=e.ref(""),l=e.reactive({r:"",g:"",b:"",a:""}),c=e.reactive({h:"",s:"",l:"",a:""}),s=e.reactive({h:"",s:"",v:"",a:""}),h={typeList:["hex","rgb","hsl","hsv"]},C=e.computed(()=>o.color.value),v=u=>{const f=u.substring(u.indexOf("(")+1,u.indexOf(")")).split(",").map($=>y.trim($));return f.length===3&&f.push("1"),f},m=(u,i)=>{const f=u||C.value,{color:$}=o,U=i==="hex"?f:$.getValueFormat(f,"hex"),q=$.getValueFormat(f,"rgb"),z=$.getValueFormat(f,"hsl"),X=$.getValueFormat(f,"hsv");r.hex=U,r.rgb=q,r.hsl=z,r.hsv=X,e.nextTick(()=>{d.value=U;const O=v(q);l.r=O[0],l.g=O[1],l.b=O[2],l.a=O[3];const R=v(z);c.h=R[0],c.s=R[1],c.l=R[2],c.a=R[3];const P=v(X);s.h=P[0],s.s=P[1],s.v=P[2],s.a=P[3]})},g=u=>{let i=h.typeList.indexOf(r.type);i+=u;const f=h.typeList.length;i<0?i=f-1:i>=f&&(i=0);const $=h.typeList[i];r.type=$,p("onChangeType",$)},V=u=>{let i="";switch(u){case"hex":{d.value.length>0&&(i=d.value);break}case"rgb":{l.r.length>0&&l.g.length>0&&l.b.length>0&&l.a.length>0&&(i=`rgba(${l.r}, ${l.g}, ${l.b},${l.a})`);break}case"hsl":{c.h.length>0&&c.s.length>0&&c.l.length>0&&c.a.length>0&&(i=`hsla(${c.h}, ${c.s}, ${c.l},${c.a})`);break}case"hsv":{s.h.length>0&&s.s.length>0&&s.v.length>0&&s.a.length>0&&(i=`hsva(${s.h}, ${s.s}, ${s.v},${s.a})`);break}}if(i.length>0&&o.color.checkValue(i)){const f=o.color.getValueFormat(i,u);i!==f&&(m(i,u),e.nextTick(()=>{o.color.fromString(i)}),p("onChangeType",u))}},b=()=>{m()};e.onMounted(()=>{e.nextTick(()=>{b()})}),e.watch(()=>C.value,u=>{const i=o.color.getValueFormat(u,"rgb");r.rgb!==i&&m()});const _=()=>{V("hex")},N=()=>{V("rgb")},w=()=>{V("hsl")},B=()=>{V("hsv")},F=()=>{g(-1)},I=()=>{g(1)};return t({setType:u=>{r.type=u},clearInputs:()=>{d.value="",l.r="",l.g="",l.b="",l.a="",c.h="",c.s="",c.l="",c.a="",s.h="",s.s="",s.v="",s.a=""}}),(u,i)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",null,[r.type==="hex"?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:d.value,"onUpdate:value":i[0]||(i[0]=f=>d.value=f),isClean:!1,onOnChange:_},null,8,["value"]),i[13]||(i[13]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"十六进制",-1))])])):r.type==="rgb"?(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.r,"onUpdate:value":i[1]||(i[1]=f=>l.r=f),isClean:!1,onOnChange:N},null,8,["value"]),i[14]||(i[14]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"R",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.g,"onUpdate:value":i[2]||(i[2]=f=>l.g=f),isClean:!1,onOnChange:N},null,8,["value"]),i[15]||(i[15]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"G",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.b,"onUpdate:value":i[3]||(i[3]=f=>l.b=f),isClean:!1,onOnChange:N},null,8,["value"]),i[16]||(i[16]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"B",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.a,"onUpdate:value":i[4]||(i[4]=f=>l.a=f),isClean:!1,onOnChange:N},null,8,["value"]),i[17]||(i[17]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"A",-1))])])):r.type==="hsl"?(e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.h,"onUpdate:value":i[5]||(i[5]=f=>c.h=f),isClean:!1,onOnChange:w},null,8,["value"]),i[18]||(i[18]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"H",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.s,"onUpdate:value":i[6]||(i[6]=f=>c.s=f),isClean:!1,onOnChange:w},null,8,["value"]),i[19]||(i[19]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"S",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.l,"onUpdate:value":i[7]||(i[7]=f=>c.l=f),isClean:!1,onOnChange:w},null,8,["value"]),i[20]||(i[20]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"L",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.a,"onUpdate:value":i[8]||(i[8]=f=>c.a=f),isClean:!1,onOnChange:w},null,8,["value"]),i[21]||(i[21]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"A",-1))])])):r.type==="hsv"?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.h,"onUpdate:value":i[9]||(i[9]=f=>s.h=f),isClean:!1,onOnChange:B},null,8,["value"]),i[22]||(i[22]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"H",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.s,"onUpdate:value":i[10]||(i[10]=f=>s.s=f),isClean:!1,onOnChange:B},null,8,["value"]),i[23]||(i[23]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"S",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.v,"onUpdate:value":i[11]||(i[11]=f=>s.v=f),isClean:!1,onOnChange:B},null,8,["value"]),i[24]||(i[24]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"V",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.a,"onUpdate:value":i[12]||(i[12]=f=>s.a=f),isClean:!1,onOnChange:B},null,8,["value"]),i[25]||(i[25]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"A",-1))])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[],64))]),e.createElementVNode("div",null,[e.createVNode(S._sfc_main,{name:"caret-up",onClick:F}),e.createVNode(S._sfc_main,{name:"caret-down",onClick:I})])]))}}),Ce={key:0,class:"panel-colorpicker-copy-icon"},W=e.defineComponent({name:"ClColorPickerCopy",__name:"Copy",props:{className:String,color:String,getTxtCallback:Function},setup(a){const t=a,n=e.useSlots(),o=e.reactive({isHover:!1}),p=e.computed(()=>!y.isUndefined(n.default)),r=e.computed(()=>{let s=!1;return p.value?s=o.isHover:s=!0,s}),d=e.computed(()=>{const s={"panel-colorpicker-copy":!0,"panel-colorpicker-copy-hover":o.isHover},{className:h}=t;return h&&!y.isEmpty(h)&&h.split(" ").forEach(C=>{y.isEmpty(C)||(s[C]=!0)}),s}),l=()=>{p.value&&(o.isHover=!0)},c=()=>{p.value&&(o.isHover=!1)};return(s,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.value),onMouseenter:l,onMouseleave:c},[e.renderSlot(s.$slots,"default"),r.value?(e.openBlock(),e.createElementBlock("div",Ce,[e.createVNode(te._sfc_main,{textLabel:a.getTxtCallback||a.color||""},null,8,["textLabel"])])):e.createCommentVNode("",!0)],34))}}),Ve={class:"panel-colorpicker-container"},be={key:0},_e={key:0,class:"panel-colorpicker-format"},Ee={class:"panel-colorpicker-format-show"},ye={key:1,class:"panel-colorpicker-operate"},Z=e.defineComponent({name:"ClColorPickerBase",__name:"Color",props:{value:String,disabled:{type:Boolean,default:!1},isAlpha:{type:Boolean,default:!0},isFormat:{type:Boolean,default:!0},isOperate:{type:Boolean,default:!0},isPreset:{type:Boolean,default:!0},isDropdown:{type:Boolean,default:!0}},emits:{onChange:a=>!0,onSubmit:()=>!0,onInit:()=>!0},setup(a,{expose:t,emit:n}){const o=a,p=n,{optPageLanguage:r,getPageLanguage:d}=le.useLanguage();d("common");const l=e.useTemplateRef("refElColorResult"),c=e.useTemplateRef("refElColorValue"),s=e.reactive({isShowColorResult:!1,colorResult:"",formatShow:"hex"}),h=e.reactive(new se({value:o.value,format:"",enableAlpha:!0})),C={isColorChangeResult:!0},v=()=>h.get("alpha").toString()==="100"?"hex":"rgb",m=(u,i=!0)=>{let f="";u&&!y.isEmpty(u)&&s.isShowColorResult&&(f=h.getValueFormat(u,s.formatShow)),s.colorResult=f,i&&p("onChange",f)},g=u=>{u&&!y.isEmpty(u)?(s.isShowColorResult=!0,h.fromString(u),m(h.value,!1)):(s.isShowColorResult=!1,C.isColorChangeResult=!1,m("",!1),h.fromString(""),e.nextTick(()=>{C.isColorChangeResult=!0}))},V=()=>{const{value:u}=o;g(u),p("onInit")};e.onMounted(()=>{e.nextTick(()=>{V()})}),e.watch(()=>o.value,u=>{g(u)}),e.watch(()=>h.value,u=>{y.isEmpty(o.value)&&(s.isShowColorResult=!0),C.isColorChangeResult&&m(u),C.isColorChangeResult=!0});const b=()=>h.getValueFormat(h.value,s.formatShow),_=u=>{h.fromString(u)},N=u=>{s.formatShow=u,m(h.value,!1)},w=()=>{const u=o.value||"";s.isShowColorResult=!y.isEmpty(u),y.isEmpty(u)?h.set({hue:0,saturation:0,value:100,alpha:100}):(C.isColorChangeResult=!1,m(u),h.fromString(u))},B=()=>{h.set({hue:0,saturation:0,value:100,alpha:100})},F=()=>{p("onSubmit")};return t({getValue:()=>{let u=s.colorResult;if(u.length>0){const i=v();u=h.getValueFormat(u,i)}return u},setValue:u=>{g(u)},initValueType:()=>{const u=v();s.formatShow=u,c.value&&c.value.setType(u)}}),(u,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["panel-colorpicker-wrapper",{"panel-colorpicker-wrapper-disabled":a.disabled}])},[e.createElementVNode("div",Ve,[e.createElementVNode("div",null,[e.createVNode(ce,{color:h},null,8,["color"]),e.createVNode(ie,{color:h},null,8,["color"])]),a.isAlpha?(e.openBlock(),e.createElementBlock("div",be,[e.createVNode(ue,{color:h},null,8,["color"]),i[0]||(i[0]=e.createElementVNode("div",null,null,-1))])):e.createCommentVNode("",!0)]),a.isFormat?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",Ee,[e.createVNode(W,{className:"panel-colorpicker-tip-current",getTxtCallback:b},{default:e.withCtx(()=>[e.createVNode(K,{color:h.value},null,8,["color"])]),_:1})]),e.createVNode(ke,{ref_key:"refElColorValue",ref:c,color:h,onOnChangeType:N},null,8,["color"])])):e.createCommentVNode("",!0),a.isOperate?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("div",{ref_key:"refElColorResult",ref:l},e.toDisplayString(s.colorResult),513),e.createElementVNode("div",null,[e.createElementVNode("div",{onClick:w},[e.createVNode(S._sfc_main,{name:"restore",title:e.unref(r).restore},null,8,["title"])]),e.createElementVNode("div",{onClick:B},[e.createVNode(S._sfc_main,{name:"clear",title:e.unref(r).clearEmpty},null,8,["title"])]),e.createVNode(W,{color:s.colorResult},null,8,["color"]),a.isDropdown?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:F},[e.createVNode(S._sfc_main,{name:"check",title:e.unref(r).submit},null,8,["title"])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),a.isPreset?(e.openBlock(),e.createBlock(de,{key:2,onOnClick:_})):e.createCommentVNode("",!0)],2))}}),Ne={class:"panel-colorpicker-dropdown-text"},we={key:0,class:"panel-colorpicker-dropdown-arrow"},Be=e.defineComponent({name:"ClColorPicker",__name:"Index",props:{id:String,value:String,className:String,disabled:{type:Boolean,default:!1},isDropdown:{type:Boolean,default:!0},isAlpha:{type:Boolean,default:!0},isFormat:{type:Boolean,default:!0},isOperate:{type:Boolean,default:!0},isPreset:{type:Boolean,default:!0},isPlaintext:{type:Boolean,default:!1}},emits:{"update:value":a=>!0,"update:modelValue":a=>!0,onChange:a=>!0,onInit:()=>!0},setup(a,{expose:t,emit:n}){const o=a,p=o.id,r=n,d=e.useTemplateRef("refElDropdownLayer"),l=e.useTemplateRef("refElColorpicker"),c=e.reactive({isInitShow:!o.isDropdown,dropdownTextValue:"",currentValue:""}),s={lastValue:""},h=e.computed(()=>{let k="panel-colorpicker ";const{className:u}=o;return u&&!y.isEmpty(u)&&(k+=u),o.isPlaintext&&(k+="cl-plaintext-static "),k}),C=()=>{const k=c.currentValue;let u=!1;o.isDropdown?u=k!==s.lastValue:u=!0,u&&(s.lastValue=k,r("update:value",k),r("update:modelValue",k),r("onChange",k))},v=k=>{let u="transparent";k&&!y.isEmpty(k)&&(u=k),c.dropdownTextValue=u},m=k=>{const u=k||"";s.lastValue=u,o.isDropdown||(c.currentValue=u),v(u)},g=()=>{const k=l.value.getValue();c.dropdownTextValue=k,c.currentValue=k,C()},V=()=>{m(o.value)};e.watch(()=>o.value,k=>{m(k)}),e.onMounted(()=>{e.nextTick(()=>{V()})});const b=()=>{r("onInit")},_=k=>{o.disabled||(k?l.value&&l.value.initValueType():o.isOperate?c.currentValue!==l.value.getValue()&&c.currentValue===s.lastValue&&l.value.setValue(s.lastValue):g())},N=()=>{c.isInitShow=!0,c.currentValue=s.lastValue},w=()=>{o.isDropdown||g()},B=()=>{g(),o.isDropdown&&d.value&&d.value.setOpen(!1)};return t({getValue:()=>c.currentValue,getValueData:()=>({value:c.currentValue}),setValue:k=>{m(k)}}),(k,u)=>a.isDropdown?(e.openBlock(),e.createBlock(ee._sfc_main,{key:0,ref_key:"refElDropdownLayer",ref:d,id:e.unref(p),classParent:h.value,classDropDown:"panel-colorpicker-dropdown",isUseDropdownArrow:!0,isDisabled:a.disabled,onOnChangeOpen:_,onOnOpenComplete:N},{label:e.withCtx(()=>[e.createElementVNode("div",Ne,[u[0]||(u[0]=e.createElementVNode("div",{class:"panel-colorpicker-bg-alpha"},null,-1)),e.createElementVNode("div",{style:e.normalizeStyle({"background-color":c.dropdownTextValue})},null,4),a.isPlaintext?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(S._sfc_main,{name:"angle-down"})]))])]),dropdown:e.withCtx(()=>[c.isInitShow?(e.openBlock(),e.createBlock(Z,{key:0,ref_key:"refElColorpicker",ref:l,value:c.currentValue,isAlpha:a.isAlpha,isFormat:a.isFormat,isOperate:a.isOperate,isPreset:a.isPreset,isDropdown:a.isDropdown,onOnChange:w,onOnSubmit:B,onOnInit:b},null,8,["value","isAlpha","isFormat","isOperate","isPreset","isDropdown"])):e.createCommentVNode("",!0)]),_:1},8,["id","classParent","isDisabled"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(h.value)},[c.isInitShow?(e.openBlock(),e.createBlock(Z,{key:0,ref_key:"refElColorpicker",ref:l,value:c.currentValue,disabled:a.disabled,isAlpha:a.isAlpha,isFormat:a.isFormat,isOperate:a.isOperate,isPreset:a.isPreset,isDropdown:a.isDropdown,onOnChange:w,onOnSubmit:B,onOnInit:b},null,8,["value","disabled","isAlpha","isFormat","isOperate","isPreset","isDropdown"])):e.createCommentVNode("",!0)],2))}});module.exports=Be;
1
+ "use strict";const e=require("vue"),y=require("@cldemo/ui-kit/common/base"),S=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js"),ee=require("../Shared/Popup.vue_vue_type_script_setup_true_lang-2PS2RvJ7.js"),M=require("@cldemo/ui-kit/common/Element/Event"),J=require("@cldemo/ui-kit/common/Element"),E=require("../Shared/Index.vue_vue_type_script_setup_true_lang-DXPZYc0c.js"),te=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Eczgr-_r.js"),le=require("../Shared/language-BJ4aVgHI.js");;/* empty css */const G=(a,t)=>Object.prototype.hasOwnProperty.call(a,t),ne=(a,t,n)=>{const o=(2-t)*n/2,p=o===0||o===1?0:t*n/(o<.5?o*2:2-o*2);return[a,p,o]},oe=a=>typeof a=="string"&&a.includes(".")&&Number.parseFloat(a)===1,ae=a=>typeof a=="string"&&a.includes("%"),T=(a,t)=>{oe(a)&&(a="100%");const n=ae(a);return a=Math.min(t,Math.max(0,Number.parseFloat(`${a}`))),n&&(a=Number.parseInt(`${a*t}`,10)/100),Math.abs(a-t)<1e-6?1:a%t/Number.parseFloat(t)},j={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},A=a=>{a=Math.min(Math.round(a),255);const t=Math.floor(a/16),n=a%16;return`${j[t]||t}${j[n]||n}`},Y=({r:a,g:t,b:n})=>Number.isNaN(+a)||Number.isNaN(+t)||Number.isNaN(+n)?"":`#${A(a)}${A(t)}${A(n)}`,H={A:10,B:11,C:12,D:13,E:14,F:15},x=a=>a.length===2?(H[a[0].toUpperCase()]||+a[0])*16+(H[a[1].toUpperCase()]||+a[1]):H[a[1].toUpperCase()]||+a[1],re=(a,t,n)=>{t=t/100,n=n/100;let o=t;const p=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,o*=p<=1?p:2-p;const r=(n+t)/2,d=n===0?2*o/(p+o):2*t/(n+t);return{h:a,s:d*100,v:r*100}},Q=(a,t,n)=>{a=T(a,255),t=T(t,255),n=T(n,255);const o=Math.max(a,t,n),p=Math.min(a,t,n);let r=0;const d=o,l=o-p,c=o===0?0:l/o;if(o===p)r=0;else{switch(o){case a:{r=(t-n)/l+(t<n?6:0);break}case t:{r=(n-a)/l+2;break}case n:{r=(a-t)/l+4;break}}r/=6}return{h:r*360,s:c*100,v:d*100}},D=(a,t,n)=>{a=T(a,360)*6,t=T(t,100),n=T(n,100);const o=Math.floor(a),p=a-o,r=n*(1-t),d=n*(1-p*t),l=n*(1-(1-p)*t),c=o%6,s=[n,d,r,r,l,n][c],h=[l,n,n,d,r,r][c],C=[r,r,l,n,n,d][c];return{r:Math.round(s*255),g:Math.round(h*255),b:Math.round(C*255)}};class se{_hue=0;_saturation=100;_value=100;_alpha=100;enableAlpha=!1;format="hex";value="";selected;constructor(t){t=t||{};for(const n in t)G(t,n)&&(this[n]=t[n]);t.value?this.fromString(t.value):this.doOnChange()}set(t,n){if(arguments.length===1&&typeof t=="object"){for(const o in t)G(t,o)&&this.set(o,t[o]);return}this[`_${t}`]=n,this.doOnChange()}get(t){return t==="alpha"?Math.floor(this[`_${t}`]):this[`_${t}`]}toRgb(){return D(this._hue,this._saturation,this._value)}fromString(t){if(!t)return;const n=this._convertValueInfo(t);n&&(this._hue=n.hue,this._saturation=n.saturation,this._value=n.value,this._alpha=n.alpha,this.doOnChange())}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:n,_value:o,_alpha:p,format:r}=this,d={hue:t,saturation:n,value:o,alpha:p};let l=this._convertFormat(r,d);l.length===0&&(l=this._getValueRGB(d)),this.value=l}checkValue(t){let n=!1,o="";if(/^rgb\(/.test(t)?o="^[rR][gG][Bb][\\(]([\\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\\s]*,){2}[\\s]*(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)[\\s]*[\\)]{1}$":/^rgba\(/.test(t)?o="^[rR][gG][Bb][Aa][\\(]([\\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\\s]*,){3}[\\s]*(1|1.0|0|0.[0-9])[\\s]*[\\)]{1}$":/^#/.test(t)?o="^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$":/^hsl\(/.test(t)?o="^[hH][Ss][Ll][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*)[\\)]$":/^hsla\(/.test(t)?o="^[hH][Ss][Ll][Aa][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,){2}([\\s]*(1|1.0|0|0.[0-9])[\\s]*)[\\)]$":/^hsv\(/.test(t)?o="^[hH][Ss][Vv][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*)[\\)]$":/^hsva\(/.test(t)&&(o="^[hH][Ss][Vv][Aa][\\(]([\\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\\s]*,)([\\s]*((100|[0-9][0-9]?)%|0)[\\s]*,){2}([\\s]*(1|1.0|0|0.[0-9])[\\s]*)[\\)]$"),o.length>0){const p=new RegExp(o);n=t.match(p)!==null}return n}getValueFormat(t,n){const o=this._convertValueInfo(t);return o?this._convertFormat(n,o):t}_convertValueInfo(t){let n=0,o=100,p=100,r=100;if(t){let d;if(t.includes("hsl")){const l=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(c=>c!=="").map((c,s)=>s>2?Number.parseFloat(c):Number.parseInt(c,10));l.length===4?(r=Number.parseFloat(l[3].toString()),r=r>1?1:r,r=r*100):l.length===3&&(r=100),l.length>=3&&(d=re(l[0],l[1],l[2]))}else if(t.includes("hsv")){const l=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(c=>c!=="").map((c,s)=>s>2?Number.parseFloat(c):Number.parseInt(c,10));l.length===4?(r=Number.parseFloat(l[3].toString()),r=r>1?1:r,r=r*100):l.length===3&&(r=100),l.length>=3&&(d={h:l[0],s:l[1],v:l[2]})}else if(t.includes("rgb")){const l=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(c=>c!=="").map((c,s)=>s>2?Number.parseFloat(c):Number.parseInt(c,10));l.length===4?(r=Number.parseFloat(l[3].toString()),r=r>1?1:r,r=r*100):l.length===3&&(r=100),l.length>=3&&(d=Q(l[0],l[1],l[2]))}else if(t.includes("#")){const l=t.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(l))return;let c=0,s=0,h=0;l.length===3?(c=x(l[0]+l[0]),s=x(l[1]+l[1]),h=x(l[2]+l[2])):(l.length===6||l.length===8)&&(c=x(l.slice(0,2)),s=x(l.slice(2,4)),h=x(l.slice(4,6))),l.length===8?(r=x(l.slice(6))/255,r=r>1?1:r,r=r*100):(l.length===3||l.length===6)&&(r=100),d=Q(c,s,h)}d&&(n=Math.max(0,Math.min(360,d.h)),o=Math.max(0,Math.min(100,d.s)),p=Math.max(0,Math.min(100,d.v)))}return{hue:n,saturation:o,value:p,alpha:r}}_convertFormat(t,n){let o="";switch(t){case"hsl":{o=this._getValueHSL(n);break}case"hsv":{o=this._getValueHSV(n);break}case"rgb":{o=this._getValueRGB(n);break}case"hex":o=this._getValueHEX(n)}return o}_isShowAlpha(t){return t!==100}_getValueHSL(t){const n=Math.floor(t.alpha),o=this._isShowAlpha(t.alpha),p=ne(t.hue,t.saturation/100,t.value/100),r=Math.round(t.hue),d=Math.round(p[1]*100),l=Math.round(p[2]*100);return o?`hsla(${r}, ${d}%, ${l}%, ${n/100})`:`hsl(${r}, ${d}%, ${l}%)`}_getValueHSV(t){const n=Math.floor(t.alpha),o=this._isShowAlpha(n),p=Math.round(t.hue),r=Math.round(t.saturation),d=Math.round(t.value);return o?`hsva(${p}, ${r}%, ${d}%, ${n/100})`:`hsv(${p}, ${r}%, ${d}%)`}_getValueHEX(t){const n=Math.floor(t.alpha);return this._isShowAlpha(n)?`${Y(D(t.hue,t.saturation,t.value))}${A(n*255/100)}`:Y(D(t.hue,t.saturation,t.value))}_getValueRGB(t){const n=Math.floor(t.alpha),o=this._isShowAlpha(n),{r:p,g:r,b:d}=D(t.hue,t.saturation,t.value);return o?`rgba(${p}, ${r}, ${d}, ${this.get("alpha")/100})`:`rgb(${p}, ${r}, ${d})`}}const ce=e.defineComponent({name:"ClColorPickerPalette",__name:"Palette",props:{color:{type:Object,required:!0}},setup(a){const t=a,n=e.useTemplateRef("refElTopParent"),o=e.reactive({background:"hsl(0, 100%, 50%)",btnLeft:0,btnTop:0}),p=e.computed(()=>{const c=t.color.get("hue"),s=t.color.get("value");return{hue:c,value:s}}),r=(c,s)=>{const C=n.value.getBoundingClientRect();let v=s.clientX-C.left,m=s.clientY-C.top;v=Math.max(0,v),v=Math.min(v,C.width),m=Math.max(0,m),m=Math.min(m,C.height),o.btnLeft=v,o.btnTop=m,t.color.set({saturation:v/C.width*100,value:100-m/C.height*100})},d=()=>{const c=n.value,s=t.color.get("saturation"),h=t.color.get("value"),{clientWidth:C,clientHeight:v}=c;o.btnLeft=s*C/100,o.btnTop=(100-h)*v/100,o.background=`hsl(${t.color.get("hue")}, 100%, 50%)`},l=()=>{const c={ing:(s,h)=>{r(s,h)},end:(s,h)=>{r(s,h)}};new M.Drag(n.value,c),d()};return e.onMounted(()=>{e.nextTick(()=>{l()})}),e.watch(()=>p.value,()=>{d()}),(c,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"refElTopParent",ref:n,class:"panel-colorpicker-palette",style:e.normalizeStyle({backgroundColor:o.background})},[s[1]||(s[1]=e.createElementVNode("div",{class:"panel-colorpicker-palette-white"},null,-1)),s[2]||(s[2]=e.createElementVNode("div",{class:"panel-colorpicker-palette-black"},null,-1)),e.createElementVNode("div",{class:"panel-colorpicker-palette-btn",style:e.normalizeStyle({top:o.btnTop+"px",left:o.btnLeft+"px"})},[...s[0]||(s[0]=[e.createElementVNode("div",null,null,-1)])],4)],4))}}),ie=e.defineComponent({name:"ClColorPickerHue",__name:"Hue",props:{color:{type:Object,required:!0}},setup(a){const t=a,n=e.useTemplateRef("refElTopParent"),o=e.useTemplateRef("refElContainer"),p=e.useTemplateRef("refElBtn"),r=e.reactive({btnTop:0}),d=e.computed(()=>t.color.get("hue")),l=(v,m)=>{const V=n.value.getBoundingClientRect();let b=m.clientY-V.top;b=Math.max(0,b),b=Math.min(b,V.height);const _=Math.round(b/V.height*360);t.color.set("hue",_)},c=()=>{const v=n.value,m=t.color.get("hue");return Math.round(m*v.offsetHeight/360)},s=()=>{r.btnTop=c()},h=()=>{const v={ing:(m,g)=>{l(m,g)},end:(m,g)=>{l(m,g)}};new M.Drag(o.value,v),new M.Drag(p.value,v),s()};e.onMounted(()=>{e.nextTick(()=>{h()})}),e.watch(()=>d.value,()=>{s()});const C=v=>{if(v.target!==p.value){const g=J.getClientXY(v);l(v,g)}};return(v,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"refElTopParent",ref:n,class:"panel-colorpicker-hue"},[e.createElementVNode("div",{ref_key:"refElContainer",ref:o,class:"panel-colorpicker-hue-container",onClick:C},null,512),e.createElementVNode("div",{ref_key:"refElBtn",ref:p,class:"panel-colorpicker-hue-btn",style:e.normalizeStyle({top:r.btnTop+"px"})},null,4)],512))}}),ue=e.defineComponent({name:"ClColorPickerAlpha",__name:"Alpha",props:{color:{type:Object,required:!0}},setup(a){const t=a,n=e.useTemplateRef("refElTopParent"),o=e.useTemplateRef("refElContainer"),p=e.useTemplateRef("refElBtn"),r=e.reactive({background:null,btnLeft:0}),d=e.computed(()=>t.color.get("alpha")),l=(m,g)=>{const b=n.value.getBoundingClientRect();let _=g.clientX-b.left;_=Math.max(0,_),_=Math.min(_,b.width);const N=Math.round(_/b.width*100);t.color.set("alpha",N)},c=()=>{const m=n.value,g=t.color.get("alpha");return Math.round(g*m.offsetWidth/100)},s=()=>{if(t.color&&t.color.value){const{r:m,g,b:V}=t.color.toRgb();return`linear-gradient(to right, rgba(${m}, ${g}, ${V}, 0) 0%, rgba(${m}, ${g}, ${V}, 1) 100%)`}return null},h=()=>{r.btnLeft=c(),r.background=s()},C=()=>{const m={ing:(g,V)=>{l(g,V)},end:(g,V)=>{l(g,V)}};new M.Drag(o.value,m),new M.Drag(p.value,m),h()};e.onMounted(()=>{e.nextTick(()=>{C()})}),e.watch(()=>d.value,()=>{h()}),e.watch(()=>t.color.value,()=>{h()});const v=m=>{if(m.target!==p.value){const V=J.getClientXY(m);l(m,V)}};return(m,g)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"refElTopParent",ref:n,class:"panel-colorpicker-alpha"},[e.createElementVNode("div",{ref_key:"refElContainer",ref:o,class:"panel-colorpicker-alpha-container",style:e.normalizeStyle({background:r.background}),onClick:v},null,4),e.createElementVNode("div",{ref_key:"refElBtn",ref:p,class:"panel-colorpicker-alpha-btn",style:e.normalizeStyle({left:r.btnLeft+"px"})},null,4)],512))}}),K=e.defineComponent({name:"ClColorPickerItemBlock",__name:"ItemBlock",props:{className:String,color:String},emits:{onClick:a=>!0},setup(a,{emit:t}){const n=a,o=t,p=e.computed(()=>{let d="panel-colorpicker-item-block ";const{className:l}=n;return l&&!y.isEmpty(l)&&(d+=l),d}),r=()=>{o("onClick",n.color||"")};return(d,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(p.value),onClick:r},[l[0]||(l[0]=e.createElementVNode("div",{class:"panel-colorpicker-bg-alpha"},null,-1)),e.createElementVNode("div",{style:e.normalizeStyle({background:a.color})},null,4)],2))}}),pe={class:"panel-colorpicker-preset"},de=e.defineComponent({name:"ClColorPickerPreset",__name:"Preset",emits:{onClick:a=>!0},setup(a,{emit:t}){const n=t,o=e.reactive({keyIndex:`ColorpickerPreset-${y.getRandom(8)}`}),p=e.ref([]),r=()=>{const l=["var(--cl-text-primary, #323233)","var(--cl-bg, #ffffff)","#f44336","#E91E63","#9c27b0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548","#9E9E9E","#607D8B","rgba(255, 69, 0, 0.68)","rgba(31, 147, 255, 0.73)","var(--cl-transparent, rgba(0, 0, 0, 0))"];p.value=l};e.onMounted(()=>{r()});const d=l=>{n("onClick",l)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(s,h)=>(e.openBlock(),e.createElementBlock("li",{key:`${o.keyIndex}-${h}`},[e.createVNode(K,{color:s,onOnClick:d},null,8,["color"])]))),128))])]))}}),he={class:"panel-colorpicker-value"},me={key:0,class:"panel-colorpicker-hex"},fe={key:1,class:"panel-colorpicker-rgb"},ve={key:2,class:"panel-colorpicker-hsl"},ge={key:3,class:"panel-colorpicker-hsv"},ke=e.defineComponent({name:"ClColorPickerValue",__name:"Value",props:{color:{type:Object,required:!0}},emits:{onChangeType:a=>!0},setup(a,{expose:t,emit:n}){const o=a,p=n,r=e.reactive({type:"hex",hex:"",rgb:"",hsl:"",hsv:""}),d=e.ref(""),l=e.reactive({r:"",g:"",b:"",a:""}),c=e.reactive({h:"",s:"",l:"",a:""}),s=e.reactive({h:"",s:"",v:"",a:""}),h={typeList:["hex","rgb","hsl","hsv"]},C=e.computed(()=>o.color.value),v=u=>{const f=u.substring(u.indexOf("(")+1,u.indexOf(")")).split(",").map($=>y.trim($));return f.length===3&&f.push("1"),f},m=(u,i)=>{const f=u||C.value,{color:$}=o,U=i==="hex"?f:$.getValueFormat(f,"hex"),q=$.getValueFormat(f,"rgb"),z=$.getValueFormat(f,"hsl"),X=$.getValueFormat(f,"hsv");r.hex=U,r.rgb=q,r.hsl=z,r.hsv=X,e.nextTick(()=>{d.value=U;const O=v(q);l.r=O[0],l.g=O[1],l.b=O[2],l.a=O[3];const R=v(z);c.h=R[0],c.s=R[1],c.l=R[2],c.a=R[3];const P=v(X);s.h=P[0],s.s=P[1],s.v=P[2],s.a=P[3]})},g=u=>{let i=h.typeList.indexOf(r.type);i+=u;const f=h.typeList.length;i<0?i=f-1:i>=f&&(i=0);const $=h.typeList[i];r.type=$,p("onChangeType",$)},V=u=>{let i="";switch(u){case"hex":{d.value.length>0&&(i=d.value);break}case"rgb":{l.r.length>0&&l.g.length>0&&l.b.length>0&&l.a.length>0&&(i=`rgba(${l.r}, ${l.g}, ${l.b},${l.a})`);break}case"hsl":{c.h.length>0&&c.s.length>0&&c.l.length>0&&c.a.length>0&&(i=`hsla(${c.h}, ${c.s}, ${c.l},${c.a})`);break}case"hsv":{s.h.length>0&&s.s.length>0&&s.v.length>0&&s.a.length>0&&(i=`hsva(${s.h}, ${s.s}, ${s.v},${s.a})`);break}}if(i.length>0&&o.color.checkValue(i)){const f=o.color.getValueFormat(i,u);i!==f&&(m(i,u),e.nextTick(()=>{o.color.fromString(i)}),p("onChangeType",u))}},b=()=>{m()};e.onMounted(()=>{e.nextTick(()=>{b()})}),e.watch(()=>C.value,u=>{const i=o.color.getValueFormat(u,"rgb");r.rgb!==i&&m()});const _=()=>{V("hex")},N=()=>{V("rgb")},w=()=>{V("hsl")},B=()=>{V("hsv")},F=()=>{g(-1)},I=()=>{g(1)};return t({setType:u=>{r.type=u},clearInputs:()=>{d.value="",l.r="",l.g="",l.b="",l.a="",c.h="",c.s="",c.l="",c.a="",s.h="",s.s="",s.v="",s.a=""}}),(u,i)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",null,[r.type==="hex"?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:d.value,"onUpdate:value":i[0]||(i[0]=f=>d.value=f),isClean:!1,onOnChange:_},null,8,["value"]),i[13]||(i[13]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"十六进制",-1))])])):r.type==="rgb"?(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.r,"onUpdate:value":i[1]||(i[1]=f=>l.r=f),isClean:!1,onOnChange:N},null,8,["value"]),i[14]||(i[14]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"R",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.g,"onUpdate:value":i[2]||(i[2]=f=>l.g=f),isClean:!1,onOnChange:N},null,8,["value"]),i[15]||(i[15]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"G",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.b,"onUpdate:value":i[3]||(i[3]=f=>l.b=f),isClean:!1,onOnChange:N},null,8,["value"]),i[16]||(i[16]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"B",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:l.a,"onUpdate:value":i[4]||(i[4]=f=>l.a=f),isClean:!1,onOnChange:N},null,8,["value"]),i[17]||(i[17]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"A",-1))])])):r.type==="hsl"?(e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.h,"onUpdate:value":i[5]||(i[5]=f=>c.h=f),isClean:!1,onOnChange:w},null,8,["value"]),i[18]||(i[18]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"H",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.s,"onUpdate:value":i[6]||(i[6]=f=>c.s=f),isClean:!1,onOnChange:w},null,8,["value"]),i[19]||(i[19]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"S",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.l,"onUpdate:value":i[7]||(i[7]=f=>c.l=f),isClean:!1,onOnChange:w},null,8,["value"]),i[20]||(i[20]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"L",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:c.a,"onUpdate:value":i[8]||(i[8]=f=>c.a=f),isClean:!1,onOnChange:w},null,8,["value"]),i[21]||(i[21]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"A",-1))])])):r.type==="hsv"?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.h,"onUpdate:value":i[9]||(i[9]=f=>s.h=f),isClean:!1,onOnChange:B},null,8,["value"]),i[22]||(i[22]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"H",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.s,"onUpdate:value":i[10]||(i[10]=f=>s.s=f),isClean:!1,onOnChange:B},null,8,["value"]),i[23]||(i[23]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"S",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.v,"onUpdate:value":i[11]||(i[11]=f=>s.v=f),isClean:!1,onOnChange:B},null,8,["value"]),i[24]||(i[24]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"V",-1))]),e.createElementVNode("div",null,[e.createVNode(E._sfc_main,{value:s.a,"onUpdate:value":i[12]||(i[12]=f=>s.a=f),isClean:!1,onOnChange:B},null,8,["value"]),i[25]||(i[25]=e.createElementVNode("div",{class:"panel-colorpicker-value-lable"},"A",-1))])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[],64))]),e.createElementVNode("div",null,[e.createVNode(S._sfc_main,{name:"caret-up",onClick:F}),e.createVNode(S._sfc_main,{name:"caret-down",onClick:I})])]))}}),Ce={key:0,class:"panel-colorpicker-copy-icon"},W=e.defineComponent({name:"ClColorPickerCopy",__name:"Copy",props:{className:String,color:String,getTxtCallback:Function},setup(a){const t=a,n=e.useSlots(),o=e.reactive({isHover:!1}),p=e.computed(()=>!y.isUndefined(n.default)),r=e.computed(()=>{let s=!1;return p.value?s=o.isHover:s=!0,s}),d=e.computed(()=>{const s={"panel-colorpicker-copy":!0,"panel-colorpicker-copy-hover":o.isHover},{className:h}=t;return h&&!y.isEmpty(h)&&h.split(" ").forEach(C=>{y.isEmpty(C)||(s[C]=!0)}),s}),l=()=>{p.value&&(o.isHover=!0)},c=()=>{p.value&&(o.isHover=!1)};return(s,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.value),onMouseenter:l,onMouseleave:c},[e.renderSlot(s.$slots,"default"),r.value?(e.openBlock(),e.createElementBlock("div",Ce,[e.createVNode(te._sfc_main,{textLabel:a.getTxtCallback||a.color||""},null,8,["textLabel"])])):e.createCommentVNode("",!0)],34))}}),Ve={class:"panel-colorpicker-container"},be={key:0},_e={key:0,class:"panel-colorpicker-format"},Ee={class:"panel-colorpicker-format-show"},ye={key:1,class:"panel-colorpicker-operate"},Z=e.defineComponent({name:"ClColorPickerBase",__name:"Color",props:{value:String,disabled:{type:Boolean,default:!1},isAlpha:{type:Boolean,default:!0},isFormat:{type:Boolean,default:!0},isOperate:{type:Boolean,default:!0},isPreset:{type:Boolean,default:!0},isDropdown:{type:Boolean,default:!0}},emits:{onChange:a=>!0,onSubmit:()=>!0,onInit:()=>!0},setup(a,{expose:t,emit:n}){const o=a,p=n,{optPageLanguage:r,getPageLanguage:d}=le.useLanguage();d("common");const l=e.useTemplateRef("refElColorResult"),c=e.useTemplateRef("refElColorValue"),s=e.reactive({isShowColorResult:!1,colorResult:"",formatShow:"hex"}),h=e.reactive(new se({value:o.value,format:"",enableAlpha:!0})),C={isColorChangeResult:!0},v=()=>h.get("alpha").toString()==="100"?"hex":"rgb",m=(u,i=!0)=>{let f="";u&&!y.isEmpty(u)&&s.isShowColorResult&&(f=h.getValueFormat(u,s.formatShow)),s.colorResult=f,i&&p("onChange",f)},g=u=>{u&&!y.isEmpty(u)?(s.isShowColorResult=!0,h.fromString(u),m(h.value,!1)):(s.isShowColorResult=!1,C.isColorChangeResult=!1,m("",!1),h.fromString(""),e.nextTick(()=>{C.isColorChangeResult=!0}))},V=()=>{const{value:u}=o;g(u),p("onInit")};e.onMounted(()=>{e.nextTick(()=>{V()})}),e.watch(()=>o.value,u=>{g(u)}),e.watch(()=>h.value,u=>{y.isEmpty(o.value)&&(s.isShowColorResult=!0),C.isColorChangeResult&&m(u),C.isColorChangeResult=!0});const b=()=>h.getValueFormat(h.value,s.formatShow),_=u=>{h.fromString(u)},N=u=>{s.formatShow=u,m(h.value,!1)},w=()=>{const u=o.value||"";s.isShowColorResult=!y.isEmpty(u),y.isEmpty(u)?h.set({hue:0,saturation:0,value:100,alpha:100}):(C.isColorChangeResult=!1,m(u),h.fromString(u))},B=()=>{h.set({hue:0,saturation:0,value:100,alpha:100})},F=()=>{p("onSubmit")};return t({getValue:()=>{let u=s.colorResult;if(u.length>0){const i=v();u=h.getValueFormat(u,i)}return u},setValue:u=>{g(u)},initValueType:()=>{const u=v();s.formatShow=u,c.value&&c.value.setType(u)}}),(u,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["panel-colorpicker-wrapper",{"panel-colorpicker-wrapper-disabled":a.disabled}])},[e.createElementVNode("div",Ve,[e.createElementVNode("div",null,[e.createVNode(ce,{color:h},null,8,["color"]),e.createVNode(ie,{color:h},null,8,["color"])]),a.isAlpha?(e.openBlock(),e.createElementBlock("div",be,[e.createVNode(ue,{color:h},null,8,["color"]),i[0]||(i[0]=e.createElementVNode("div",null,null,-1))])):e.createCommentVNode("",!0)]),a.isFormat?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",Ee,[e.createVNode(W,{className:"panel-colorpicker-tip-current",getTxtCallback:b},{default:e.withCtx(()=>[e.createVNode(K,{color:h.value},null,8,["color"])]),_:1})]),e.createVNode(ke,{ref_key:"refElColorValue",ref:c,color:h,onOnChangeType:N},null,8,["color"])])):e.createCommentVNode("",!0),a.isOperate?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("div",{ref_key:"refElColorResult",ref:l},e.toDisplayString(s.colorResult),513),e.createElementVNode("div",null,[e.createElementVNode("div",{onClick:w},[e.createVNode(S._sfc_main,{name:"restore",title:e.unref(r).restore},null,8,["title"])]),e.createElementVNode("div",{onClick:B},[e.createVNode(S._sfc_main,{name:"clear",title:e.unref(r).clearEmpty},null,8,["title"])]),e.createVNode(W,{color:s.colorResult},null,8,["color"]),a.isDropdown?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:F},[e.createVNode(S._sfc_main,{name:"check",title:e.unref(r).submit},null,8,["title"])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),a.isPreset?(e.openBlock(),e.createBlock(de,{key:2,onOnClick:_})):e.createCommentVNode("",!0)],2))}}),Ne={class:"panel-colorpicker-dropdown-text"},we={key:0,class:"panel-colorpicker-dropdown-arrow"},Be=e.defineComponent({name:"ClColorPicker",__name:"Index",props:{id:String,value:String,className:String,disabled:{type:Boolean,default:!1},isDropdown:{type:Boolean,default:!0},isAlpha:{type:Boolean,default:!0},isFormat:{type:Boolean,default:!0},isOperate:{type:Boolean,default:!0},isPreset:{type:Boolean,default:!0},isPlaintext:{type:Boolean,default:!1}},emits:{"update:value":a=>!0,"update:modelValue":a=>!0,onChange:a=>!0,onInit:()=>!0},setup(a,{expose:t,emit:n}){const o=a,p=o.id,r=n,d=e.useTemplateRef("refElDropdownLayer"),l=e.useTemplateRef("refElColorpicker"),c=e.reactive({isInitShow:!o.isDropdown,dropdownTextValue:"",currentValue:""}),s={lastValue:""},h=e.computed(()=>{let k="panel-colorpicker ";const{className:u}=o;return u&&!y.isEmpty(u)&&(k+=u),o.isPlaintext&&(k+="cl-plaintext-static "),k}),C=()=>{const k=c.currentValue;let u=!1;o.isDropdown?u=k!==s.lastValue:u=!0,u&&(s.lastValue=k,r("update:value",k),r("update:modelValue",k),r("onChange",k))},v=k=>{let u="transparent";k&&!y.isEmpty(k)&&(u=k),c.dropdownTextValue=u},m=k=>{const u=k||"";s.lastValue=u,o.isDropdown||(c.currentValue=u),v(u)},g=()=>{const k=l.value.getValue();c.dropdownTextValue=k,c.currentValue=k,C()},V=()=>{m(o.value)};e.watch(()=>o.value,k=>{m(k)}),e.onMounted(()=>{e.nextTick(()=>{V()})});const b=()=>{r("onInit")},_=k=>{o.disabled||(k?l.value&&l.value.initValueType():o.isOperate?c.currentValue!==l.value.getValue()&&c.currentValue===s.lastValue&&l.value.setValue(s.lastValue):g())},N=()=>{c.isInitShow=!0,c.currentValue=s.lastValue},w=()=>{o.isDropdown||g()},B=()=>{g(),o.isDropdown&&d.value&&d.value.setOpen(!1)};return t({getValue:()=>c.currentValue,getValueData:()=>({value:c.currentValue}),setValue:k=>{m(k)}}),(k,u)=>a.isDropdown?(e.openBlock(),e.createBlock(ee._sfc_main,{key:0,ref_key:"refElDropdownLayer",ref:d,id:e.unref(p),classParent:h.value,classDropDown:"panel-colorpicker-dropdown",isUseDropdownArrow:!0,isDisabled:a.disabled,onOnChangeOpen:_,onOnOpenComplete:N},{label:e.withCtx(()=>[e.createElementVNode("div",Ne,[u[0]||(u[0]=e.createElementVNode("div",{class:"panel-colorpicker-bg-alpha"},null,-1)),e.createElementVNode("div",{style:e.normalizeStyle({"background-color":c.dropdownTextValue})},null,4),a.isPlaintext?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(S._sfc_main,{name:"angle-down"})]))])]),dropdown:e.withCtx(()=>[c.isInitShow?(e.openBlock(),e.createBlock(Z,{key:0,ref_key:"refElColorpicker",ref:l,value:c.currentValue,isAlpha:a.isAlpha,isFormat:a.isFormat,isOperate:a.isOperate,isPreset:a.isPreset,isDropdown:a.isDropdown,onOnChange:w,onOnSubmit:B,onOnInit:b},null,8,["value","isAlpha","isFormat","isOperate","isPreset","isDropdown"])):e.createCommentVNode("",!0)]),_:1},8,["id","classParent","isDisabled"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(h.value)},[c.isInitShow?(e.openBlock(),e.createBlock(Z,{key:0,ref_key:"refElColorpicker",ref:l,value:c.currentValue,disabled:a.disabled,isAlpha:a.isAlpha,isFormat:a.isFormat,isOperate:a.isOperate,isPreset:a.isPreset,isDropdown:a.isDropdown,onOnChange:w,onOnSubmit:B,onOnInit:b},null,8,["value","disabled","isAlpha","isFormat","isOperate","isPreset","isDropdown"])):e.createCommentVNode("",!0)],2))}});module.exports=Be;
@@ -8,7 +8,7 @@ import { _ as U } from "../Shared/Index.vue_vue_type_script_setup_true_lang-C2LG
8
8
  import { _ as we } from "../Shared/Popup.vue_vue_type_script_setup_true_lang-DKmJL9a2.js";
9
9
  import { Drag as G } from "@cldemo/ui-kit/common/Element/Event";
10
10
  import ve from "@cldemo/ui-kit/common/Element";
11
- import { _ as S } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D_XMW7K4.js";
11
+ import { _ as S } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D4a5Iaue.js";
12
12
  import { _ as Ve } from "../Shared/Index.vue_vue_type_script_setup_true_lang-DWkYiuK9.js";
13
13
  import { a as _e } from "../Shared/language-CZZEj4e3.js";
14
14
  /* empty css */
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),m=require("@cldemo/ui-kit/common/log"),a=require("@cldemo/ui-kit/common/base"),S=require("@cldemo/ui-kit/common/Element"),x=require("../Shared/Index.vue_vue_type_script_setup_true_lang-C67qv3YC.js"),h=require("../Shared/Index.vue_vue_type_script_setup_true_lang-D_YbdXMB.js"),b=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BRvOcf4B.js"),F=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Dirpq4z0.js"),O=["id"],N={class:"cropperPreview-box-flex"},q=e.defineComponent({name:"ClCropperPreview",__name:"Index",props:{id:String,className:String,previewImageUrl:String,coverImageUrl:String,width:{type:Number,default:200},height:{type:Number,default:200},widthPreview:Number,heightPreview:Number,previewShape:{type:String,default:"square"},isCenterBox:{type:Boolean,default:!1},isShowUploadBtn:{type:Boolean,default:!0},getCropperImageUrl:Function,saveImageBase64:Function},emits:{onInitCoverImage:()=>!0,onError:l=>!0},setup(l,{expose:C,emit:w}){const n=l,p=w,d=n.id,s=e.useTemplateRef("refElCropper"),i=e.reactive({isEmptyPreviewUrl:!1,isEmptyCoverUrl:!1,isAgainCropper:!1,coverImageUrlOriginal:""});let g=!1;const y=e.computed(()=>{const{width:t,widthPreview:r}=n;return a.isFinite(r)?r:t}),U=e.computed(()=>{const{height:t,heightPreview:r}=n;return a.isFinite(r)?r:t}),_=e.computed(()=>({"panel-cropper-preview":!0,...S.getClassNameJson(n.className)})),u=()=>{const{previewImageUrl:t}=n,r=a.isEmpty(t);i.isEmptyPreviewUrl=r,i.isAgainCropper=r},v=()=>{const{coverImageUrl:t}=n,r=a.isEmpty(t);i.isEmptyCoverUrl=r,i.coverImageUrlOriginal=r?"":t},f=()=>{const{width:t,height:r}=n;(t<=0||r<=0)&&m.warn("ClCropperPreview","裁切区域宽高必须大于 0,当前值 width="+t+" height="+r)},I=()=>{u(),v(),f()};e.onMounted(()=>{e.nextTick(()=>{I()})}),e.watch(()=>n.previewImageUrl,()=>{u()}),e.watch(()=>n.coverImageUrl,()=>{v()});const B=t=>{t===!0&&p("onInitCoverImage")},k=(t,r)=>{if(!g){if(!(t instanceof File)){p("onError","文件读取失败,请重新选择图片");return}g=!0,s.value?.loadingStart(),a.getBase64ByFile([t]).then(o=>{const c=a.isNonEmptyString(o);i.isAgainCropper=!0,c?(i.coverImageUrlOriginal=o,i.isEmptyCoverUrl=!1):(i.isEmptyCoverUrl=a.isEmpty(i.coverImageUrlOriginal),p("onError","文件读取失败,请重新选择图片")),s.value?.loadingStop(),g=!1}).catch(o=>{s.value?.loadingStop(),g=!1,p("onError","文件读取失败,请重新选择图片")})}},E=()=>{i.isAgainCropper=!1},P=()=>{i.isAgainCropper=!0};return C({getValue:async()=>{let t="";try{t=s.value?String(await s.value.getImageBase64()||""):""}catch(r){m.error("ClCropperPreview","getValue 获取裁切图片失败:",r)}return t},getCropperUrl:async t=>{let r="";try{if(s.value&&a.isFunction(n.getCropperImageUrl))r=await n.getCropperImageUrl(s.value,t);else{const{previewImageUrl:o,coverImageUrl:c}=n;r=a.isNonEmptyString(o)?o:c||""}}catch(o){m.error("ClCropperPreview","getCropperUrl 调用失败:",o)}return r},getCoverUrlOriginal:async t=>{let r="";try{const{coverImageUrlOriginal:o}=i;if(o.startsWith("data:")&&a.isFunction(n.saveImageBase64)){const c=await n.saveImageBase64(o,t);r=c&&c.success?c.imageUrl:""}else/^(http|https):\/\/[^\s]+$/.test(o)&&(r=o)}catch(o){m.error("ClCropperPreview","getCoverUrlOriginal 调用失败:",o)}return r}}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(_.value),id:e.unref(d)},[e.createElementVNode("div",N,[i.isEmptyPreviewUrl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.isAgainCropper?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,iconName:"reply",label:"返回",color:"transparent",onOnClick:E})):(e.openBlock(),e.createBlock(h._sfc_main,{key:1,iconName:"cropper",label:"重新裁切",color:"transparent",onOnClick:P}))],64)),l.isShowUploadBtn&&(i.isAgainCropper||i.isEmptyCoverUrl&&i.isEmptyPreviewUrl)?(e.openBlock(),e.createBlock(b._sfc_main,{key:2,theme:"button",checkFormat:"jpg,png",buttonIcon:"upload-cloud",buttonColor:"white",buttonLabel:"选择图片",isShowUploadResult:!1,isShowUploadIng:!1,onOnChange:k})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64))]),!i.isEmptyPreviewUrl&&!i.isAgainCropper?(e.openBlock(),e.createBlock(F._sfc_main,{key:0,type:"image",list:[{value:l.previewImageUrl||"",imgUrl:"",label:""}],width:y.value,height:U.value},null,8,["list","width","height"])):i.isAgainCropper&&(!i.isEmptyPreviewUrl||!i.isEmptyCoverUrl)?(e.openBlock(),e.createBlock(x._sfc_main,{key:1,ref_key:"refElCropper",ref:s,previewShape:l.previewShape,isCenterBox:l.isCenterBox,src:i.coverImageUrlOriginal,width:l.width,height:l.height,isModal:!1,isShowUpload:!1,onOnImgLoad:B},null,8,["previewShape","isCenterBox","src","width","height"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64))],10,O))}});module.exports=q;
1
+ "use strict";const e=require("vue"),m=require("@cldemo/ui-kit/common/log"),a=require("@cldemo/ui-kit/common/base"),S=require("@cldemo/ui-kit/common/Element"),x=require("../Shared/Index.vue_vue_type_script_setup_true_lang-C67qv3YC.js"),h=require("../Shared/Index.vue_vue_type_script_setup_true_lang-D_YbdXMB.js"),b=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BIO6Me43.js"),F=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Dirpq4z0.js"),O=["id"],N={class:"cropperPreview-box-flex"},q=e.defineComponent({name:"ClCropperPreview",__name:"Index",props:{id:String,className:String,previewImageUrl:String,coverImageUrl:String,width:{type:Number,default:200},height:{type:Number,default:200},widthPreview:Number,heightPreview:Number,previewShape:{type:String,default:"square"},isCenterBox:{type:Boolean,default:!1},isShowUploadBtn:{type:Boolean,default:!0},getCropperImageUrl:Function,saveImageBase64:Function},emits:{onInitCoverImage:()=>!0,onError:l=>!0},setup(l,{expose:C,emit:w}){const n=l,p=w,d=n.id,s=e.useTemplateRef("refElCropper"),i=e.reactive({isEmptyPreviewUrl:!1,isEmptyCoverUrl:!1,isAgainCropper:!1,coverImageUrlOriginal:""});let g=!1;const y=e.computed(()=>{const{width:t,widthPreview:r}=n;return a.isFinite(r)?r:t}),U=e.computed(()=>{const{height:t,heightPreview:r}=n;return a.isFinite(r)?r:t}),_=e.computed(()=>({"panel-cropper-preview":!0,...S.getClassNameJson(n.className)})),u=()=>{const{previewImageUrl:t}=n,r=a.isEmpty(t);i.isEmptyPreviewUrl=r,i.isAgainCropper=r},v=()=>{const{coverImageUrl:t}=n,r=a.isEmpty(t);i.isEmptyCoverUrl=r,i.coverImageUrlOriginal=r?"":t},f=()=>{const{width:t,height:r}=n;(t<=0||r<=0)&&m.warn("ClCropperPreview","裁切区域宽高必须大于 0,当前值 width="+t+" height="+r)},I=()=>{u(),v(),f()};e.onMounted(()=>{e.nextTick(()=>{I()})}),e.watch(()=>n.previewImageUrl,()=>{u()}),e.watch(()=>n.coverImageUrl,()=>{v()});const B=t=>{t===!0&&p("onInitCoverImage")},k=(t,r)=>{if(!g){if(!(t instanceof File)){p("onError","文件读取失败,请重新选择图片");return}g=!0,s.value?.loadingStart(),a.getBase64ByFile([t]).then(o=>{const c=a.isNonEmptyString(o);i.isAgainCropper=!0,c?(i.coverImageUrlOriginal=o,i.isEmptyCoverUrl=!1):(i.isEmptyCoverUrl=a.isEmpty(i.coverImageUrlOriginal),p("onError","文件读取失败,请重新选择图片")),s.value?.loadingStop(),g=!1}).catch(o=>{s.value?.loadingStop(),g=!1,p("onError","文件读取失败,请重新选择图片")})}},E=()=>{i.isAgainCropper=!1},P=()=>{i.isAgainCropper=!0};return C({getValue:async()=>{let t="";try{t=s.value?String(await s.value.getImageBase64()||""):""}catch(r){m.error("ClCropperPreview","getValue 获取裁切图片失败:",r)}return t},getCropperUrl:async t=>{let r="";try{if(s.value&&a.isFunction(n.getCropperImageUrl))r=await n.getCropperImageUrl(s.value,t);else{const{previewImageUrl:o,coverImageUrl:c}=n;r=a.isNonEmptyString(o)?o:c||""}}catch(o){m.error("ClCropperPreview","getCropperUrl 调用失败:",o)}return r},getCoverUrlOriginal:async t=>{let r="";try{const{coverImageUrlOriginal:o}=i;if(o.startsWith("data:")&&a.isFunction(n.saveImageBase64)){const c=await n.saveImageBase64(o,t);r=c&&c.success?c.imageUrl:""}else/^(http|https):\/\/[^\s]+$/.test(o)&&(r=o)}catch(o){m.error("ClCropperPreview","getCoverUrlOriginal 调用失败:",o)}return r}}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(_.value),id:e.unref(d)},[e.createElementVNode("div",N,[i.isEmptyPreviewUrl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.isAgainCropper?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,iconName:"reply",label:"返回",color:"transparent",onOnClick:E})):(e.openBlock(),e.createBlock(h._sfc_main,{key:1,iconName:"cropper",label:"重新裁切",color:"transparent",onOnClick:P}))],64)),l.isShowUploadBtn&&(i.isAgainCropper||i.isEmptyCoverUrl&&i.isEmptyPreviewUrl)?(e.openBlock(),e.createBlock(b._sfc_main,{key:2,theme:"button",checkFormat:"jpg,png",buttonIcon:"upload-cloud",buttonColor:"white",buttonLabel:"选择图片",isShowUploadResult:!1,isShowUploadIng:!1,onOnChange:k})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64))]),!i.isEmptyPreviewUrl&&!i.isAgainCropper?(e.openBlock(),e.createBlock(F._sfc_main,{key:0,type:"image",list:[{value:l.previewImageUrl||"",imgUrl:"",label:""}],width:y.value,height:U.value},null,8,["list","width","height"])):i.isAgainCropper&&(!i.isEmptyPreviewUrl||!i.isEmptyCoverUrl)?(e.openBlock(),e.createBlock(x._sfc_main,{key:1,ref_key:"refElCropper",ref:s,previewShape:l.previewShape,isCenterBox:l.isCenterBox,src:i.coverImageUrlOriginal,width:l.width,height:l.height,isModal:!1,isShowUpload:!1,onOnImgLoad:B},null,8,["previewShape","isCenterBox","src","width","height"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64))],10,O))}});module.exports=q;
@@ -12,7 +12,7 @@ import n from "@cldemo/ui-kit/common/base";
12
12
  import W from "@cldemo/ui-kit/common/Element";
13
13
  import { _ as j } from "../Shared/Index.vue_vue_type_script_setup_true_lang-BWeBT0aj.js";
14
14
  import { _ as U } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D__hI9ud.js";
15
- import { _ as q } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D6cmq0Tf.js";
15
+ import { _ as q } from "../Shared/Index.vue_vue_type_script_setup_true_lang-DZCt32jb.js";
16
16
  import { _ as z } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D6kK-vM7.js";
17
17
  const H = ["id"], J = { class: "cropperPreview-box-flex" }, oe = /* @__PURE__ */ F({
18
18
  name: "ClCropperPreview",
@@ -1 +1 @@
1
- "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-FowII7_3.js");module.exports=e._sfc_main;
1
+ "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-DY4m6Xyj.js");module.exports=e._sfc_main;
@@ -6,7 +6,7 @@ import '../../styles/Common/Btn-base.css';
6
6
  import '../../styles/Common/Table-base.css';
7
7
  import '../../styles/Common/Overlay-base.css';
8
8
  import '../../styles/Web/ClDateTime.css';
9
- import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-CwjigRBx.js";
9
+ import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-DZF2gj7X.js";
10
10
  export {
11
11
  f as default
12
12
  };
@@ -1 +1 @@
1
- "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BRvOcf4B.js");module.exports=e._sfc_main;
1
+ "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BIO6Me43.js");module.exports=e._sfc_main;
@@ -5,7 +5,7 @@ import '../../styles/Common/Load-base.css';
5
5
  import '../../styles/Common/Btn-base.css';
6
6
  import '../../styles/Common/Overlay-base.css';
7
7
  import '../../styles/Web/ClFileUpload.css';
8
- import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D6cmq0Tf.js";
8
+ import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-DZCt32jb.js";
9
9
  export {
10
10
  f as default
11
11
  };
@@ -1 +1 @@
1
- "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CizRrQsH.js");module.exports=e._sfc_main;
1
+ "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-oovIcT38.js");module.exports=e._sfc_main;
@@ -4,7 +4,7 @@ import '../../styles/Common/Input-base.css';
4
4
  import '../../styles/Common/Load-base.css';
5
5
  import '../../styles/Common/Fade-base.css';
6
6
  import '../../styles/Web/ClInputTag.css';
7
- import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-DxYJbPyJ.js";
7
+ import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-C_exHzjc.js";
8
8
  export {
9
9
  f as default
10
10
  };
@@ -1 +1 @@
1
- "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Dzm58mMQ.js");module.exports=e._sfc_main;
1
+ "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-nAMiORzN.js");module.exports=e._sfc_main;
@@ -3,7 +3,7 @@ import '../../styles/Common/IconFont-base.css';
3
3
  import '../../styles/Common/Input-base.css';
4
4
  import '../../styles/Common/Fade-base.css';
5
5
  import '../../styles/Web/ClPaginate.css';
6
- import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-ChnRq_PS.js";
6
+ import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-B0MJO0JM.js";
7
7
  export {
8
8
  f as default
9
9
  };
@@ -1 +1 @@
1
- "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Dbf-3Nik.js");module.exports=e._sfc_main;
1
+ "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-DvN-fBNd.js");module.exports=e._sfc_main;
@@ -3,7 +3,7 @@ import '../../styles/Common/IconFont-base.css';
3
3
  import '../../styles/Common/Input-base.css';
4
4
  import '../../styles/Common/Fade-base.css';
5
5
  import '../../styles/Web/ClSelect.css';
6
- import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-BO4cal3i.js";
6
+ import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-2dwwjiTV.js";
7
7
  export {
8
8
  f as default
9
9
  };
@@ -1 +1 @@
1
- "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Ba8Z8fOP.js");module.exports=e._sfc_main;
1
+ "use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-DwBf338f.js");module.exports=e._sfc_main;
@@ -3,7 +3,7 @@ import '../../styles/Common/IconFont-base.css';
3
3
  import '../../styles/Common/Input-base.css';
4
4
  import '../../styles/Common/Fade-base.css';
5
5
  import '../../styles/Web/ClSelectCascade.css';
6
- import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-CQ3RGLek.js";
6
+ import { _ as f } from "../Shared/Index.vue_vue_type_script_setup_true_lang-HfnOtuMz.js";
7
7
  export {
8
8
  f as default
9
9
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),t=require("@cldemo/ui-kit/common/base"),oe=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BPTL5eCB.js"),ae=require("../Shared/List.vue_vue_type_script_setup_true_lang-CFCST05R.js"),Y=require("@cldemo/ui-kit/common/log"),ne=require("@cldemo/ui-kit/common/Element"),re=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BIFHYrzc.js"),Q=require("../Shared/One.vue_vue_type_script_setup_true_lang-D9zWNf0s.js"),se=require("../Shared/language-BJ4aVgHI.js"),le=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js");;/* empty css */const ce=["onClick"],ie=["innerHTML"],de=e.defineComponent({name:"ClSelectMoveSearchUl",__name:"SearchTree",props:{list:{type:Array,default:()=>[]}},emits:{onClick:h=>!0},setup(h,{emit:q}){const o=q,d=`selectmove-search-tree-${t.getRandom(5)}`,A=L=>{t.isUndefined(L)||o("onClick",L.toString())};return(L,N)=>{const p=e.resolveComponent("cl-select-move-search-ul");return e.openBlock(),e.createElementBlock("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.list,(s,B)=>(e.openBlock(),e.createElementBlock("li",{key:`${d}-${s.id}-${B}`},[e.createElementVNode("a",{href:"javascript:",tabindex:"-1",class:e.normalizeClass({"tree-hig":s.isHig,"tree-active":s.isSelected}),onClick:e.withModifiers(P=>A(s.id),["stop"])},[e.createVNode(Q._sfc_main,{value:s.isSelected,indeterminate:s.isIndeterminate},null,8,["value","indeterminate"]),e.createElementVNode("span",{class:"tree-text",innerHTML:s.showTextLabel},null,8,ie)],10,ce),s.list&&s.list.length>0?(e.openBlock(),e.createBlock(p,{key:0,list:s.list,onOnClick:A},null,8,["list"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))]))),128))])}}}),ue={class:"selectmove-search-list"},he={key:1},pe={class:"selectmove-search-empty"},me=1e3,fe=e.defineComponent({name:"ClSelectMoveSearch",__name:"Search",props:{disabled:Boolean,placeholder:String,width:Number,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},searchIsMultiple:{type:Boolean,default:!1},searchMultipleJoin:{type:String,default:","},searchTextFormat:[String,Array],selectId:{type:Array,default:()=>[]},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"}},emits:{onChange:h=>!0},setup(h,{emit:q}){const o=h,d=q,{optPageLanguage:A,getPageLanguage:L}=se.useLanguage();L("common");const N=e.inject("$SelectmoveTop"),p=e.inject("$SelectmoveBase");if(t.isUndefined(N)||t.isUndefined(p))throw new Error("SelectMove.Search 缺少容器依赖($SelectmoveTop/$SelectmoveBase),请确保在 ClSelectMove 内使用");const s=e.reactive({isOpen:!1,isInitSelect:!1}),B=e.ref([]),P=e.ref([]);let D="",F=[];const O={jsonSelectIds:{},jsonSelectHalfIds:{}},R=e.computed(()=>({"selectmove-search-input":!0,"selectmove-search-open":s.isOpen})),W=e.computed(()=>({"selectmove-search-dropdown":!0,"selectmove-search-open":s.isOpen})),r=e.computed(()=>{const a={};return o.width&&o.width>0&&(a.width=`${o.width}px`),a}),f=()=>{d("onChange",P.value.join(","))},g=()=>{s.isOpen=!1,B.value=[]},I=a=>{const x=p.convertSelectHalf(a);P.value=a,O.jsonSelectHalfIds=t.getArrConvertJson(x),O.jsonSelectIds=t.getArrConvertJson(a)},C=a=>{const x=a.toLowerCase().trim();if(x===D)return F;const w=[];if(t.isEmpty(o.searchKey))return Y.warn("ClSelectMoveSearch","SelectMove.Search searchKey 为空,搜索将无结果"),D=x,F=w,w;const k=t.isNonEmptyString(o.searchMultipleJoin)?o.searchMultipleJoin:",",M=o.searchIsMultiple?x.split(k).map(n=>n.trim()):[x],j=o.searchKey.length,G=o.searchKey,$=N.getDataList();return t.isArray($)?($.forEach(n=>{if(t.isUndefined(n)||t.isUndefined(n.id)||!t.isString(n.id)&&!t.isNumber(n.id))return;const l=n.id.toString(),v=[];let y=0;for(let _=0;_<j;_++){const K=n[G[_]];if(!t.isString(K)){y++;continue}const J=K.toLowerCase();let H=!1;for(let U=0;U<M.length;U++)if(M[U].length>0&&J.indexOf(M[U])>-1){H=!0;break}H&&v.push(!0)}if(v.length>0)switch(o.searchKeyType){case"||":w.push(l);break;case"&&":v.length===j-y&&w.push(l);break;default:Y.warn("ClSelectMoveSearch",`SelectMove.Search searchKeyType 未知值「${o.searchKeyType}」,按 || 兜底`),w.push(l);break}}),D=x,F=w,w):(D=x,F=w,w)},E=(a,x,w,k,M)=>{const j=[],G=M||[];return t.isExistJsonKey(x,a)&&x[a].forEach($=>{if(G.indexOf($)>-1)return;const n=G.concat([$]),l=t.getJsonClone(N.getDataInfo($));if(t.isEmpty(l))return;let v=t.isNonEmptyString(l.name)?t.encodeHTML(l.name):"";const y=o.searchTextFormat;if(y&&y.length>0){let J="";t.isArray(y)?y.length>w&&(J=y[w]):t.isString(y)&&(J=y),t.isEmpty(J)||(v=t.convertStringFormatEncodeHTML(J,l))}l.showTextLabel=v;let _=!1,K=t.isExistJsonKey(x,$);K?l.list=E($,x,w+1,k,n):(_=!0,l.list=[],N.getDataGroup($).length>0&&(K=!0,_=!1)),l.isIndeterminate=t.isExistJsonKey(O.jsonSelectHalfIds,$),l.isSelected=t.isExistJsonKey(O.jsonSelectIds,$),l.isChild=K,l.isLast=_,l.treeLevel=w,l.isHig=t.isExistJsonKey(k,$),j.push(l)}),j},T=a=>{if(a.length===0)return[];const{parentKey:x,topParentValue:w}=o,k={};let M=[];a.forEach($=>{k[$]=!0;const n=p.getParentIds($);M.push(...n),M.push($)}),M=t.getArrUnique(M);const j={};M.forEach($=>{const n=N.getDataInfo($);if(t.isUndefined(n))return;const l=n[x],v=t.isEmpty(l)?w:l.toString(),y=v===w?N.getTopParentValue():v;t.isExistJsonKey(j,y)||(j[y]=[]),j[y].push($)});const G=N.getTopParentValue();return t.isExistJsonKey(j,G)||Y.warn("ClSelectMoveSearch","SelectMove.Search 数据存在环或祖先链断裂,搜索结果可能为空"),E(G,j,0,k)},c=()=>{if(s.isInitSelect=!1,!t.isEqualArr(o.selectId,P.value)){const x=p.convertSelectedValue(o.selectId,!0,[]);I(x)}},m=a=>{if(t.isNonEmptyString(a)){s.isInitSelect&&c();const x=C(a),w=T(x);B.value=w,s.isOpen=!0}else g()},u=a=>{const x=[];return a.forEach(w=>{const k=t.getJsonClone(w);if(t.isUndefined(k)||t.isUndefined(k.id))return;const M=k.id.toString();k.isIndeterminate=t.isExistJsonKey(O.jsonSelectHalfIds,M),k.isSelected=t.isExistJsonKey(O.jsonSelectIds,M),k.list&&k.list.length>0&&(k.list=u(k.list)),x.push(k)}),x},i=a=>{if(s.isOpen){const x=ne.getParent(a.target,".selectmove-search");t.isUndefined(x)&&(s.isOpen=!1)}};e.onUnmounted(()=>{document.body.removeEventListener("click",i)}),e.watch(()=>s.isOpen,a=>{a?document.body.addEventListener("click",i):document.body.removeEventListener("click",i)}),e.watch(()=>o.selectId,()=>{s.isInitSelect=!0,s.isOpen&&(c(),B.value=u(B.value))},{immediate:!0}),e.watch(()=>[o.searchKey,o.searchKeyType,o.searchIsMultiple,o.searchMultipleJoin],()=>{D="",F=[]});const S=a=>{m(a)},b=a=>{s.isOpen||m(a)},V=a=>{const x=t.isExistJsonKey(O.jsonSelectIds,a),w=p.convertSelectedValue(a,!x,P.value);I(w),B.value=u(B.value),f()};return(a,x)=>(e.openBlock(),e.createElementBlock("div",{class:"selectmove-search",style:e.normalizeStyle(r.value)},[e.createElementVNode("div",{class:e.normalizeClass(R.value)},[e.createVNode(re._sfc_main,{placeholder:h.placeholder,disabled:h.disabled,changeDelayTime:me,onOnChange:S,onOnFocus:b},null,8,["placeholder","disabled"])],2),s.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(W.value)},[e.createElementVNode("div",ue,[B.value.length>0?(e.openBlock(),e.createBlock(de,{key:0,list:B.value,onOnClick:V},null,8,["list"])):(e.openBlock(),e.createElementBlock("ul",he,[e.createElementVNode("li",pe,e.toDisplayString(e.unref(A).noResultsText),1)]))])],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],4))}}),ge={class:"selectmove-tree"},Se={class:"selectmove-tree-head"},ye={class:"selectmove-tree-head-title"},Ie={class:"selectmove-tree-body"},ve=["onClick"],Ee=["innerHTML"],ee=10,xe=e.defineComponent({name:"ClSelectMoveTree",__name:"Tree",props:{disabled:Boolean,maxWidth:Number,width:Number,treeTitle:{type:Array,default:()=>[]},treeShowMinLevel:{type:Number,default:1},treeTextFormat:[String,Array],selectId:{type:Array,default:()=>[]},dataRefreshIndex:Number},emits:{onChange:h=>!0},setup(h,{emit:q}){const o=h,d=q,A=e.inject("$SelectmoveTop"),L=e.inject("$SelectmoveBase");if(t.isUndefined(A)||t.isUndefined(L))throw new Error("SelectMove.Tree 缺少容器依赖($SelectmoveTop/$SelectmoveBase),请确保在 ClSelectMove 内使用");const N=`selectmove-tree-${t.getRandom(5)}`,p=e.reactive({selectIds:[],HalfSelectIds:[],openActiveId:[]}),s=e.ref([]),B=()=>{d("onChange",p.selectIds.join(","))},P=c=>{let m=0;const u=A.getDataGroup(c);if(u.length>0){const i=[],S=[];u.forEach(b=>{const V=b.id.toString();t.isExistValue(p.selectIds,V)&&i.push(V),t.isExistValue(p.HalfSelectIds,V)&&S.push(V)}),(S.length>0||i.length>0)&&(m=2),i.length>0&&i.length===u.length&&(m=1)}return m},D=(c,m,u)=>{const i={idx:c,pId:m,title:!t.isEmpty(o.treeTitle)&&o.treeTitle.length>c?o.treeTitle[c]:u,list:[],checkAll:0,sty:{}};if(o.width&&o.maxWidth&&o.width>0&&o.maxWidth>0){let S=o.width-3;const b=o.maxWidth/o.width;c+1>=b&&(S+=3),i.sty.width=`${S}px`}if(!t.isEmpty(m)){const S=A.getDataGroup(m);S.length>0&&(i.list=S.map(b=>{const V=b.id.toString(),a=t.getJsonClone(b);a.selected=t.isExistValue(p.selectIds,V),a.indeterminate=t.isExistValue(p.HalfSelectIds,V),a.isActive=t.isExistValue(p.openActiveId,V);const x=A.getDataGroup(V);a.isSub=x.length>0;let w=t.isNonEmptyString(b.name)?t.encodeHTML(b.name):"";const k=o.treeTextFormat;if(k&&k.length>0){let M="";t.isArray(k)?k.length>c&&(M=k[c]):t.isString(k)&&(M=k),t.isEmpty(M)||(w=t.convertStringFormatEncodeHTML(M,a))}return a.showTextLabel=w,a})),i.checkAll=P(m)}return i},F=c=>{const m=L.convertSelectedValue(c,!0,[]),u=L.convertSelectHalf(m);p.selectIds=m,p.HalfSelectIds=u},O=(c,m)=>{const u=[];if(s.value.forEach((i,S)=>{S<=c&&u.push(D(i.idx,i.pId,i.title))}),A.getDataGroup(m).length>0){const i=A.getDataInfo(m),S=t.isNonEmptyString(i&&i.name)?i.name:"";u.push(D(c+1,m,S))}s.value=u},R=(c,m)=>{const u=c.id.toString(),i=t.getArrClone(p.openActiveId);i.splice(m),i.push(u),p.openActiveId=i,O(m,u)},W=(c,m)=>{const u=L.convertSelectedValue(c,m,p.selectIds),i=L.convertSelectHalf(u);p.selectIds=u,p.HalfSelectIds=i,s.value=s.value.map(S=>D(S.idx,S.pId,S.title)),B()},r=c=>{const m=s.value.length,u=c||[];if(m>0&&p.selectIds.length>0){let i,S=-1;for(let b=m-1;b>=0;b--)if(s.value[b].list.some(a=>{if(a.selected||a.indeterminate)return i=a,!0})){S=b;break}if(S>-1&&!t.isUndefined(i)&&i.isSub){const b=i.id.toString();if(u.indexOf(b)>-1)return;u.push(b),R(i,S),r(u)}}},f=()=>{const c=[];return c.push(D(0,A.getTopParentValue(),"")),c};let g=null;const I=()=>{p.openActiveId=[],t.isEmpty(o.selectId)?(p.selectIds=[],p.HalfSelectIds=[]):F(o.selectId),s.value=f(),r(),g=t.getArrClone(o.selectId),o.treeShowMinLevel>1&&p.selectIds.length===0&&e.nextTick(()=>{const c=s.value.length,m=t.isFinite(o.treeShowMinLevel)?Math.min(o.treeShowMinLevel,ee):ee;if(m>c){const u=[];for(let i=c;i<m;i++)u.push(D(i,"",""));s.value=s.value.concat(u)}})};e.onMounted(()=>{e.nextTick(()=>{I()})}),e.watch(()=>o.dataRefreshIndex,()=>{I()}),e.watch(()=>o.selectId,c=>{(t.isUndefined(g)?!1:t.isEqualArr(c,g))||(g=t.getArrClone(c),F(c),s.value=s.value.map(u=>D(u.idx,u.pId,u.title)),r())});const C=(c,m)=>{const u=A.getDataGroup(m.toString()).map(i=>i.id.toString());W(u,c.value)},E=(c,m)=>{W(m.toString(),c.value)},T=(c,m,u)=>{if(o.disabled)return;const i=m.id.toString();if(t.isEmpty(A.getDataGroup(i))){if(ne.getParent(c.target,".selectmove-option-checkbox",".selectmove-option"))return;W(i.toString(),!t.isExistValue(p.selectIds,i))}R(m,u)};return(c,m)=>(e.openBlock(),e.createElementBlock("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,i)=>(e.openBlock(),e.createElementBlock("div",{key:`${N}-tree-${i}`,class:"selectmove-tree-item",style:e.normalizeStyle(u.sty)},[e.createElementVNode("div",Se,[e.withDirectives(e.createVNode(Q._sfc_main,{disabled:h.disabled,value:u.checkAll===1,indeterminate:u.checkAll===2,onOnChange:S=>C(S,u.pId)},null,8,["disabled","value","indeterminate","onOnChange"]),[[e.vShow,u.list.length>0]]),e.createElementVNode("div",ye,e.toDisplayString(u.title),1)]),e.createElementVNode("div",Ie,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.list,(S,b)=>(e.openBlock(),e.createElementBlock("li",{key:`${N}-${S.id}-${b}`,class:e.normalizeClass({"selectmove-option":!0,active:S.isActive}),onClick:V=>T(V,S,i)},[e.createElementVNode("div",null,[e.createVNode(Q._sfc_main,{className:"selectmove-option-checkbox",disabled:h.disabled,value:S.selected,indeterminate:S.indeterminate,onOnChange:V=>E(V,S.id)},null,8,["disabled","value","indeterminate","onOnChange"]),e.createElementVNode("div",{class:"selectmove-option-text",innerHTML:S.showTextLabel},null,8,Ee),S.isSub?(e.openBlock(),e.createBlock(le._sfc_main,{key:0,name:"angle-right",className:"sub-icon"})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])],10,ve))),128))])])],4))),128)),e.renderSlot(c.$slots,"tail")]))}}),Ce={class:"selectmove-result"},_e={class:"selectmove-result-head"},ke=["innerHTML"],we={class:"selectmove-result-body"},Te=["innerHTML"],Be=e.defineComponent({name:"ClSelectMoveResult",__name:"Result",props:{disabled:Boolean,width:Number,resultCountFormat:String,resultTextFormat:String,resultMergeParent:Boolean,selectId:{type:Array,default:()=>[]},dataRefreshIndex:Number},emits:{onChange:h=>!0},setup(h,{emit:q}){const o=h,d=q,{optPageLanguage:A,getPageLanguage:L}=se.useLanguage();L("common");const N=e.inject("$SelectmoveTop"),p=e.inject("$SelectmoveBase");if(t.isUndefined(N)||t.isUndefined(p))throw new Error("SelectMove.Result 缺少容器依赖($SelectmoveTop/$SelectmoveBase),请确保在 ClSelectMove 内使用");const s=`selectmove-result-${t.getRandom(5)}`,B=e.ref([]),P=e.computed(()=>B.value.length),D=e.computed(()=>t.isNonEmptyString(o.resultCountFormat)?t.convertStringFormat(o.resultCountFormat,{_count:P.value}):`${A.value.selected} ${P.value} ${A.value.count}`),F=e.computed(()=>{const f={};return o.width&&o.width>0&&(f.width=`${o.width}px`),f}),O=f=>{d("onChange",f.join(","))},R=f=>{if(t.isEmpty(f))return[];const g=f.filter(E=>!t.isUndefined(E)&&!t.isEmpty(E)),I=o.resultMergeParent?p.getValueMergeParent(g):p.getValueSplitChild(g),C=[];return I.forEach(E=>{const T=N.getDataInfo(E);if(t.isUndefined(T))return;const c=t.getJsonClone(T);t.isNonEmptyString(o.resultTextFormat)?c.showTextLabel=t.convertStringFormatEncodeHTML(o.resultTextFormat,c):t.isNonEmptyString(c.name)?c.showTextLabel=t.encodeHTML(c.name):c.showTextLabel="",C.push(c)}),C};e.watch(()=>o.selectId,f=>{const I=(t.isEmpty(f)?[]:f).filter(T=>!t.isUndefined(T)&&!t.isEmpty(T)),C=B.value.map(T=>T.id.toString());t.isEqualArr(I,C)||(B.value=R(I))},{immediate:!0}),e.watch(()=>o.dataRefreshIndex,()=>{B.value=R(o.selectId)}),e.watch(()=>o.resultMergeParent,()=>{B.value=R(o.selectId)});const W=()=>{B.value=[],O([])},r=f=>{const g=[],I=[],C=f.id.toString();B.value.forEach(E=>{const T=E.id.toString();T!==C&&(I.push(E),g.push(T))}),B.value=I,O(g)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",{class:"selectmove-result-container",style:e.normalizeStyle(F.value)},[e.createElementVNode("div",_e,[e.createElementVNode("span",null,[h.disabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-cleanAll",type:"button",onClick:W},e.toDisplayString(e.unref(A).deleteAll),1))]),e.createElementVNode("span",{innerHTML:D.value},null,8,ke)]),e.createElementVNode("div",we,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(I,C)=>(e.openBlock(),e.createElementBlock("li",{key:`${s}-${I.id}-${C}`},[e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:I.showTextLabel},null,8,Te),h.disabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createBlock(le._sfc_main,{key:0,name:"close",className:"btn-clean",onClick:E=>r(I)},null,8,["onClick"]))])]))),128))])])],4)]))}}),be={class:"selectmove-body"},Me={key:0,class:"selectmove-result"},Le=100,Ve=175,te=e.defineComponent({name:"ClSelectMoveContainer",__name:"Container",props:{disabled:Boolean,width:Number,isSearch:{type:Boolean,default:!0},searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},searchIsMultiple:{type:Boolean,default:!1},searchMultipleJoin:{type:String,default:","},searchTextFormat:[String,Array],treeTitle:{type:Array,default:()=>[]},treeShowMinLevel:{type:Number,default:1},treeTextFormat:[String,Array],resultIsShowSlot:Boolean,resultIsShowSubUnit:Boolean,resultTextFormat:String,resultCountFormat:String,resultMergeParent:{type:Boolean,default:!0},dataRefreshIndex:{type:Number,default:0},selectId:{type:Array,default:()=>[]},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"}},emits:{onSelectValue:h=>!0,onInitComplete:()=>!0},setup(h,{emit:q}){const o=h,d=q;let A=!1;const L=e.inject("$SelectmoveTop");if(t.isUndefined(L))throw new Error("SelectMove.Container 缺少容器依赖($SelectmoveTop),请确保在 ClSelectMove 内使用");const N=e.reactive({searchWidth:0,treeWidth:0,resultWidth:0}),p={parentIdsJson:Object.create(null),childIdJson:Object.create(null),childIdsJson:Object.create(null)},s=r=>{d("onSelectValue",r)},B=()=>{e.nextTick(()=>{A||d("onInitComplete")})},P=r=>{let f=[];return t.isExistJsonKey(p.childIdJson,r)?f=p.childIdJson[r]:L.isCheckChildren(r)&&(L.getDataGroup(r).forEach(g=>{t.isUndefined(g)||t.isUndefined(g.id)||f.push(g.id.toString())}),p.childIdJson[r]=f),f},D=(r,f)=>{let g=[];const I=f||[];return I.indexOf(r)>-1||(I.push(r),t.isExistJsonKey(p.childIdsJson,r)?g=p.childIdsJson[r]:(L.isCheckChildren(r)&&L.getDataGroup(r).forEach(C=>{if(t.isUndefined(C)||t.isUndefined(C.id))return;const E=C.id.toString();g.push(E);const T=D(E,I);T.length>0&&(g=g.concat(T))}),p.childIdsJson[r]=g)),g},F=(r,f)=>{const{parentKey:g,topParentValue:I}=o;let C=[];const E=f||[];if(E.indexOf(r)>-1)return C;if(E.push(r),t.isExistJsonKey(p.parentIdsJson,r))C=p.parentIdsJson[r];else{const T=L.getDataInfo(r);if(!t.isUndefined(T)){const c=T[g],m=t.isEmpty(c)?I:c.toString();if(m!==I&&!t.isUndefined(L.getDataInfo(m))){C.push(m);const u=F(m,E);u.length>0&&(C=C.concat(u))}}p.parentIdsJson[r]=C}return C},O=(r,f,g)=>{const I=(t.isUndefined(g)?[]:g).filter(i=>!t.isUndefined(i));if(t.isUndefined(r))return t.getArrClone(I);const C=t.isObject(r)?r:[r];if(!t.isArray(C))return t.getArrClone(I);const E=t.getArrConvertJson(I),T={},c=[],m=[];C.forEach(i=>{if(t.isUndefined(i))return;const S=[],b=[],V=i.toString();if(f){if(!(t.isExistJsonKey(E,V)||t.isExistJsonKey(T,V))){S.push(V);const x=D(V);x&&x.length>0&&S.push(...x);const w=F(V);for(let k=0;k<w.length;k++){const M=w[k].toString();if(t.isExistJsonKey(E,M)||t.isExistJsonKey(T,M))break;const j=P(M),G=[];if(j.forEach($=>{const n=$.toString();(t.isExistJsonKey(E,n)||t.isExistJsonKey(T,n)||S.indexOf(n)>-1)&&G.push(n)}),j.length===G.length)S.push(M);else break}}}else{b.push(V);const a=D(V);a&&a.length>0&&b.push(...a);const x=F(V);b.push(...x)}S.length>0&&S.forEach(a=>{c.push(a),T[a]=!0}),b.length>0&&b.forEach(a=>{m.push(a)})});let u=t.getArrClone(I);return u.push(...c),u=t.getArrUnique(u),u=t.getArrRemoveById(u,m),u},R=r=>{if(t.isUndefined(r)||!t.isArray(r))return[];const f=[],g={};r.forEach(E=>{g[E]=!0;const T=F(E);f.push(...T)});const I=[],C={};return f.forEach(E=>{!t.isExistJsonKey(C,E)&&!t.isExistJsonKey(g,E)&&(C[E]=!0,I.push(E))}),I},W=()=>{const r=o.width;if(r!==void 0&&t.isFinite(r)&&r>=350){const f=Math.floor(r/Ve),g=Math.floor(r/f);N.searchWidth=r,N.treeWidth=g,N.resultWidth=g}};return e.onMounted(()=>{W(),B()}),e.onBeforeUnmount(()=>{A=!0}),e.watch(()=>o.dataRefreshIndex,()=>{p.parentIdsJson=Object.create(null),p.childIdJson=Object.create(null),p.childIdsJson=Object.create(null)}),e.watch(()=>o.width,()=>{W()}),e.provide("$SelectmoveBase",{convertSelectedValue:(r,f,g)=>{let I=!1;if(f&&t.isObject(r)&&r.length>Le&&(I=!0),I){const C=L.getValueMergeParent(r);return O(C,f,g)}else return O(r,f,g)},convertSelectHalf:R,getChildIds:D,getParentIds:F,getLastChildIds:(r,f)=>L.getLastChildIds(r,f),getValueMergeParent:r=>L.getValueMergeParent(r),getValueSplitChild:r=>L.getValueSplitChild(r)}),(r,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[h.isSearch?(e.openBlock(),e.createBlock(fe,{key:0,disabled:h.disabled,width:N.searchWidth,placeholder:h.searchPlaceholder,searchKey:h.searchKey,searchKeyType:h.searchKeyType,searchIsMultiple:h.searchIsMultiple,searchMultipleJoin:h.searchMultipleJoin,searchTextFormat:h.searchTextFormat,selectId:h.selectId,parentKey:h.parentKey,topParentValue:h.topParentValue,onOnChange:s},null,8,["disabled","width","placeholder","searchKey","searchKeyType","searchIsMultiple","searchMultipleJoin","searchTextFormat","selectId","parentKey","topParentValue"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),e.createElementVNode("div",be,[e.createVNode(xe,{disabled:h.disabled,maxWidth:N.searchWidth,width:N.treeWidth,treeTitle:h.treeTitle,treeShowMinLevel:h.treeShowMinLevel,treeTextFormat:h.treeTextFormat,selectId:h.selectId,dataRefreshIndex:h.dataRefreshIndex,onOnChange:s},{tail:e.withCtx(()=>[h.resultIsShowSlot?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(r.$slots,"resultSelect")])):h.resultIsShowSubUnit?(e.openBlock(),e.createBlock(Be,{key:1,disabled:h.disabled,width:N.resultWidth,resultTextFormat:h.resultTextFormat,resultCountFormat:h.resultCountFormat,resultMergeParent:h.resultMergeParent,selectId:h.selectId,dataRefreshIndex:h.dataRefreshIndex,onOnChange:s},null,8,["disabled","width","resultTextFormat","resultCountFormat","resultMergeParent","selectId","dataRefreshIndex"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64))]),_:3},8,["disabled","maxWidth","width","treeTitle","treeShowMinLevel","treeTextFormat","selectId","dataRefreshIndex"])])],64))}}),Ae=["id"],Ne={className:"selectmove-text-num"},Je={class:"selectmove-container"},Ke=["id"],Pe=e.defineComponent({name:"ClSelectMove",__name:"Index",props:{id:String,value:String,className:String,disabled:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},isDropdown:{type:Boolean,default:!1},placeholder:String,isClear:{type:Boolean,default:!1},containerWidth:{type:Number,default:350},isSearch:{type:Boolean,default:!0},searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},searchIsMultiple:{type:Boolean,default:!1},searchMultipleJoin:{type:String,default:","},searchTextFormat:[String,Array],treeTitle:{type:Array,default:()=>[]},treeShowMinLevel:{type:Number,default:1},treeTextFormat:[String,Array],resultIsShow:{type:Boolean,default:!0},resultTextFormat:String,resultCountFormat:String,resultMergeParent:{type:Boolean,default:!0},isOutMerge:{type:Boolean,default:!0},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"},isPlaintext:{type:Boolean,default:!1},plaintextSeparator:{type:String,default:","},plaintextLevelSeparator:{type:String,default:" > "},appendContainer:{type:String,default:""}},emits:{"update:value":h=>!0,"update:modelValue":h=>!0,onChange:(h,q)=>!0,onInit:()=>!0},setup(h,{expose:q,emit:o}){const d=h,A=o,L=e.useSlots(),N=d.id,p=e.useTemplateRef("refElDropdownLayer"),s=e.reactive({dataRefreshIndex:0,selectedIds:[],IsShowResultSlot:!t.isUndefined(L.resultSelect),isInitEmitDone:!1}),B=e.ref([]),P={dataJson:{},dataGroup:{},childLastIdsJson:{}},D=e.computed(()=>({disabled:d.disabled,width:d.containerWidth,isSearch:d.isSearch,searchPlaceholder:d.searchPlaceholder,searchKey:d.searchKey,searchKeyType:d.searchKeyType,searchIsMultiple:d.searchIsMultiple,searchMultipleJoin:d.searchMultipleJoin,searchTextFormat:d.searchTextFormat,treeTitle:d.treeTitle,treeShowMinLevel:d.treeShowMinLevel,treeTextFormat:d.treeTextFormat,resultIsShowSubUnit:d.resultIsShow,resultIsShowSlot:s.IsShowResultSlot,resultTextFormat:d.resultTextFormat,resultCountFormat:d.resultCountFormat,resultMergeParent:d.resultMergeParent,parentKey:d.parentKey,topParentValue:d.topParentValue})),F=e.computed(()=>{let n="panel-selectmove ";return t.isNonEmptyString(d.className)&&(n+=d.className),d.isDropdown||d.disabled&&(n+=" selectmove-disabled "),n}),O=n=>{A("update:value",n),A("update:modelValue",n)},R=(n,l)=>{O(n),A("onChange",n,l)},W=()=>{A("onInit")},r=()=>d.list,f=n=>t.isExistJsonKey(P.dataGroup,n.toString()),g=n=>{const l=n.toString();return f(l)?P.dataGroup[l]:[]},I=n=>{const l=n.toString();return t.isExistJsonKey(P.dataJson,l)?P.dataJson[l]:null},C=()=>`top_${d.topParentValue}`,E=n=>{const{parentKey:l,topParentValue:v}=d,y={},_={};!t.isEmpty(n)&&t.isArray(n)&&n.forEach(K=>{const J=t.getJsonClone(K);if(!t.isString(J.id)&&!t.isNumber(J.id))return;const H=J.id.toString(),U=t.isEmpty(J[l])?v:J[l].toString();y[H]=J;const z=U===v?C():U;t.isExistJsonKey(_,z)||(_[z]=[]),_[z].push(J)}),P.dataJson=y,P.dataGroup=_,P.childLastIdsJson={}};E(d.list);const T=(n,l)=>{let v=[];const y=l||[];return y.indexOf(n)>-1||(y.push(n),t.isExistJsonKey(P.childLastIdsJson,n)&&P.childLastIdsJson[n].length>0?v=P.childLastIdsJson[n]:(f(n)?g(n).forEach(_=>{const K=T(_.id.toString(),y);K.length>0&&(v=v.concat(K))}):v.push(n),P.childLastIdsJson[n]=v)),v},c=(n,l)=>{const{parentKey:v,topParentValue:y}=d,_=l||[],K={},J=[];let H=[];if(n.forEach(U=>{const z=I(U);if(!t.isUndefined(z)){const Z=z[v],X=t.isUndefined(Z)?y:Z.toString();X===y?H.push(U):(t.isExistJsonKey(K,X)||(K[X]=[]),K[X].push(U))}}),!t.isEmpty(K))for(const[U,z]of Object.entries(K))z.length===g(U).length&&_.indexOf(U)===-1?J.push(U):H=H.concat(z);if(J.length>0){H.push(...J);const U=t.getArrUnique(H);return c(U,_.concat(J))}else return H},m=n=>{const l=[],v=t.getArrConvertJson(n);return n.forEach(_=>{const K=g(_);if(t.isEmpty(K))l.push(_);else{const J=[];K.forEach(H=>{t.isExistJsonKey(v,H.id.toString())&&J.push(H.id)}),K.length!==J.length&&l.push(_)}}),c(l)},u=n=>{let l=[];return n.forEach(v=>{const y=T(v);l.push(...y)}),l=t.getArrUnique(l),l},i=(n,l)=>(t.isBoolean(l)?l:d.isOutMerge)?m(n):u(n),S=n=>{const l=[],v=[];return n.forEach(y=>{const _=I(y);t.isUndefined(_)||(l.push(_),v.push(t.isNonEmptyString(_.name)?t.encodeHTML(_.name):""))}),{list:l,label:v}},b=n=>{const l=[],v=new Set;let y=n;for(;t.isNonEmptyString(y)&&!v.has(y);){v.add(y);const _=I(y);if(!_)break;t.isNonEmptyString(_.name)&&l.unshift(_.name);const K=_[d.parentKey],J=K!=null?String(K):"";if(J===""||J===String(d.topParentValue))break;y=J}return l},V=e.computed(()=>{if(d.list,t.isEmpty(s.selectedIds))return"";const n=t.isString(d.plaintextLevelSeparator)?d.plaintextLevelSeparator:" > ",l=t.isString(d.plaintextSeparator)?d.plaintextSeparator:",";return i(s.selectedIds,d.resultMergeParent).map(y=>{const _=b(y);return t.removeHTMLTags(_.length>0?_.join(n):y)}).join(l)}),a=()=>{if(d.isDropdown)if(t.isEmpty(s.selectedIds))B.value=[];else{const n=i(s.selectedIds,d.resultMergeParent);B.value=S(n).label}};(()=>{t.isNonEmptyString(d.value)&&(s.selectedIds=t.split(d.value)),a()})(),e.watch(()=>d.value,(n,l)=>{if(n!==l){const v=t.isNonEmptyString(n)?t.split(n):[],y=i(s.selectedIds);t.isEqualArr(v,y)||(s.selectedIds=t.isEmpty(v)?[]:v,a())}}),e.watch(()=>d.list,n=>{t.isArray(n)&&(E(n),s.selectedIds=s.selectedIds.filter(l=>!t.isUndefined(I(l))),s.dataRefreshIndex++,a())}),e.watch(()=>d.resultMergeParent,()=>{a()});const w=()=>{d.disabled||(s.selectedIds=[],a(),R("",[]))},k=()=>{d.isDropdown&&(a(),p.value&&(p.value.checkIsShowOpen()||p.value.initCompleteOpen())),s.isInitEmitDone||(s.isInitEmitDone=!0,W())},M=n=>{const l=t.isEmpty(n)?[]:t.split(n);s.selectedIds=l;const v=i(l),y=S(v);a(),R(v.join(","),y.list)};return e.provide("$SelectmoveTop",{isCheckChildren:f,getDataGroup:g,getDataInfo:I,getDataList:r,getLastChildIds:T,getValueMergeParent:m,getValueSplitChild:u,getTopParentValue:C}),q({getValue:()=>i(s.selectedIds).join(","),getValueData:()=>{const n=i(s.selectedIds);return S(n).list},setValue:n=>{s.selectedIds=t.isString(n)&&!t.isEmpty(n)?t.split(n):[],a()}}),(n,l)=>h.isPlaintext?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(N),class:"cl-plaintext-value"},e.toDisplayString(V.value),9,Ae)):h.isDropdown?(e.openBlock(),e.createBlock(ae._sfc_main,{key:1,id:e.unref(N),ref_key:"refElDropdownLayer",ref:p,classParent:F.value,classText:"selectmove-text",classDropDown:"selectmove-dropdown",placeholder:h.placeholder,isDisabled:h.disabled,isClear:h.isClear,textLabel:B.value.join(","),textArrowDirection:"right",isUseDropdownArrow:!0,appendContainer:h.appendContainer,onOnClear:w},{textExtend:e.withCtx(()=>[e.createElementVNode("span",Ne,[B.value.length>1?(e.openBlock(),e.createBlock(oe._sfc_main,{key:0,num:B.value.length},null,8,["num"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])]),dropdown:e.withCtx(()=>[e.createElementVNode("div",Je,[e.createVNode(te,e.mergeProps(D.value,{dataRefreshIndex:s.dataRefreshIndex,selectId:s.selectedIds,onOnSelectValue:M,onOnInitComplete:k}),{resultSelect:e.withCtx(()=>[e.renderSlot(n.$slots,"resultSelect")]),_:3},16,["dataRefreshIndex","selectId"])])]),_:3},8,["id","classParent","placeholder","isDisabled","isClear","textLabel","appendContainer"])):(e.openBlock(),e.createElementBlock("div",{key:2,id:e.unref(N),class:e.normalizeClass(F.value)},[e.createVNode(te,e.mergeProps(D.value,{dataRefreshIndex:s.dataRefreshIndex,selectId:s.selectedIds,onOnSelectValue:M,onOnInitComplete:k}),{resultSelect:e.withCtx(()=>[e.renderSlot(n.$slots,"resultSelect")]),_:3},16,["dataRefreshIndex","selectId"])],10,Ke))}});module.exports=Pe;
1
+ "use strict";const e=require("vue"),t=require("@cldemo/ui-kit/common/base"),ae=require("@cldemo/ui-kit/common/globalConfig"),re=require("../Shared/Index.vue_vue_type_script_setup_true_lang-BPTL5eCB.js"),ce=require("../Shared/List.vue_vue_type_script_setup_true_lang-CFCST05R.js"),Q=require("@cldemo/ui-kit/common/log"),se=require("@cldemo/ui-kit/common/Element"),ie=require("../Shared/Index.vue_vue_type_script_setup_true_lang-qqnmaRnk.js"),Z=require("../Shared/One.vue_vue_type_script_setup_true_lang-D9zWNf0s.js"),le=require("../Shared/language-BJ4aVgHI.js"),oe=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFZ5jK-q.js");;/* empty css */const de=["onClick"],ue=["innerHTML"],he=e.defineComponent({name:"ClSelectMoveSearchUl",__name:"SearchTree",props:{list:{type:Array,default:()=>[]}},emits:{onClick:d=>!0},setup(d,{emit:q}){const l=q,a=`selectmove-search-tree-${t.getRandom(5)}`,A=L=>{t.isUndefined(L)||l("onClick",L.toString())};return(L,N)=>{const p=e.resolveComponent("cl-select-move-search-ul");return e.openBlock(),e.createElementBlock("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.list,(s,B)=>(e.openBlock(),e.createElementBlock("li",{key:`${a}-${s.id}-${B}`},[e.createElementVNode("a",{href:"javascript:",tabindex:"-1",class:e.normalizeClass({"tree-hig":s.isHig,"tree-active":s.isSelected}),onClick:e.withModifiers(K=>A(s.id),["stop"])},[e.createVNode(Z._sfc_main,{value:s.isSelected,indeterminate:s.isIndeterminate},null,8,["value","indeterminate"]),e.createElementVNode("span",{class:"tree-text",innerHTML:s.showTextLabel},null,8,ue)],10,de),s.list&&s.list.length>0?(e.openBlock(),e.createBlock(p,{key:0,list:s.list,onOnClick:A},null,8,["list"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))]))),128))])}}}),pe={class:"selectmove-search-list"},me={key:1},fe={class:"selectmove-search-empty"},ge=1e3,Se=e.defineComponent({name:"ClSelectMoveSearch",__name:"Search",props:{disabled:Boolean,placeholder:String,width:Number,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},searchIsMultiple:{type:Boolean,default:!1},searchMultipleJoin:{type:String,default:","},searchTextFormat:[String,Array],selectId:{type:Array,default:()=>[]},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"}},emits:{onChange:d=>!0},setup(d,{emit:q}){const l=d,a=q,{optPageLanguage:A,getPageLanguage:L}=le.useLanguage();L("common");const N=e.inject("$SelectmoveTop"),p=e.inject("$SelectmoveBase");if(t.isUndefined(N)||t.isUndefined(p))throw new Error("SelectMove.Search 缺少容器依赖($SelectmoveTop/$SelectmoveBase),请确保在 ClSelectMove 内使用");const s=e.reactive({isOpen:!1,isInitSelect:!1}),B=e.ref([]),K=e.ref([]);let P="",O=[];const U={jsonSelectIds:{},jsonSelectHalfIds:{}},R=e.computed(()=>({"selectmove-search-input":!0,"selectmove-search-open":s.isOpen})),W=e.computed(()=>({"selectmove-search-dropdown":!0,"selectmove-search-open":s.isOpen})),o=e.computed(()=>{const u={};return l.width&&l.width>0&&(u.width=`${l.width}px`),u}),f=()=>{a("onChange",K.value.join(","))},S=()=>{s.isOpen=!1,B.value=[]},I=u=>{const v=p.convertSelectHalf(u);K.value=u,U.jsonSelectHalfIds=t.getArrConvertJson(v),U.jsonSelectIds=t.getArrConvertJson(u)},x=u=>{const v=u.toLowerCase().trim();if(v===P)return O;const T=[];if(t.isEmpty(l.searchKey))return Q.warn("ClSelectMoveSearch","SelectMove.Search searchKey 为空,搜索将无结果"),P=v,O=T,T;const k=t.isNonEmptyString(l.searchMultipleJoin)?l.searchMultipleJoin:",",M=l.searchIsMultiple?v.split(k).map(F=>F.trim()):[v],j=l.searchKey.length,z=l.searchKey,D=N.getDataList();return t.isArray(D)?(D.forEach(F=>{if(t.isUndefined(F)||t.isUndefined(F.id)||!t.isString(F.id)&&!t.isNumber(F.id))return;const n=F.id.toString(),h=[];let g=0;for(let C=0;C<j;C++){const _=F[z[C]];if(!t.isString(_)){g++;continue}const J=_.toLowerCase();let $=!1;for(let H=0;H<M.length;H++)if(M[H].length>0&&J.indexOf(M[H])>-1){$=!0;break}$&&h.push(!0)}if(h.length>0)switch(l.searchKeyType){case"||":T.push(n);break;case"&&":h.length===j-g&&T.push(n);break;default:Q.warn("ClSelectMoveSearch",`SelectMove.Search searchKeyType 未知值「${l.searchKeyType}」,按 || 兜底`),T.push(n);break}}),P=v,O=T,T):(P=v,O=T,T)},E=(u,v,T,k,M)=>{const j=[],z=M||[];return t.isExistJsonKey(v,u)&&v[u].forEach(D=>{if(z.indexOf(D)>-1)return;const F=z.concat([D]),n=t.getJsonClone(N.getDataInfo(D));if(t.isEmpty(n))return;let h=t.isNonEmptyString(n.name)?t.encodeHTML(n.name):"";const g=l.searchTextFormat;if(g&&g.length>0){let J="";t.isArray(g)?g.length>T&&(J=g[T]):t.isString(g)&&(J=g),t.isEmpty(J)||(h=t.convertStringFormatEncodeHTML(J,n))}n.showTextLabel=h;let C=!1,_=t.isExistJsonKey(v,D);_?n.list=E(D,v,T+1,k,F):(C=!0,n.list=[],N.getDataGroup(D).length>0&&(_=!0,C=!1)),n.isIndeterminate=t.isExistJsonKey(U.jsonSelectHalfIds,D),n.isSelected=t.isExistJsonKey(U.jsonSelectIds,D),n.isChild=_,n.isLast=C,n.treeLevel=T,n.isHig=t.isExistJsonKey(k,D),j.push(n)}),j},w=u=>{if(u.length===0)return[];const{parentKey:v,topParentValue:T}=l,k={};let M=[];u.forEach(D=>{k[D]=!0;const F=p.getParentIds(D);M.push(...F),M.push(D)}),M=t.getArrUnique(M);const j={};M.forEach(D=>{const F=N.getDataInfo(D);if(t.isUndefined(F))return;const n=F[v],h=t.isEmpty(n)?T:n.toString(),g=h===T?N.getTopParentValue():h;t.isExistJsonKey(j,g)||(j[g]=[]),j[g].push(D)});const z=N.getTopParentValue();return t.isExistJsonKey(j,z)||Q.warn("ClSelectMoveSearch","SelectMove.Search 数据存在环或祖先链断裂,搜索结果可能为空"),E(z,j,0,k)},r=()=>{if(s.isInitSelect=!1,!t.isEqualArr(l.selectId,K.value)){const v=p.convertSelectedValue(l.selectId,!0,[]);I(v)}},m=u=>{if(t.isNonEmptyString(u)){s.isInitSelect&&r();const v=x(u),T=w(v);B.value=T,s.isOpen=!0}else S()},i=u=>{const v=[];return u.forEach(T=>{const k=t.getJsonClone(T);if(t.isUndefined(k)||t.isUndefined(k.id))return;const M=k.id.toString();k.isIndeterminate=t.isExistJsonKey(U.jsonSelectHalfIds,M),k.isSelected=t.isExistJsonKey(U.jsonSelectIds,M),k.list&&k.list.length>0&&(k.list=i(k.list)),v.push(k)}),v},c=u=>{if(s.isOpen){const v=se.getParent(u.target,".selectmove-search");t.isUndefined(v)&&(s.isOpen=!1)}};e.onUnmounted(()=>{document.body.removeEventListener("click",c)}),e.watch(()=>s.isOpen,u=>{u?document.body.addEventListener("click",c):document.body.removeEventListener("click",c)}),e.watch(()=>l.selectId,()=>{s.isInitSelect=!0,s.isOpen&&(r(),B.value=i(B.value))},{immediate:!0}),e.watch(()=>[l.searchKey,l.searchKeyType,l.searchIsMultiple,l.searchMultipleJoin],()=>{P="",O=[]});const y=u=>{m(u)},b=u=>{s.isOpen||m(u)},V=u=>{const v=t.isExistJsonKey(U.jsonSelectIds,u),T=p.convertSelectedValue(u,!v,K.value);I(T),B.value=i(B.value),f()};return(u,v)=>(e.openBlock(),e.createElementBlock("div",{class:"selectmove-search",style:e.normalizeStyle(o.value)},[e.createElementVNode("div",{class:e.normalizeClass(R.value)},[e.createVNode(ie._sfc_main,{placeholder:d.placeholder,disabled:d.disabled,changeDelayTime:ge,onOnChange:y,onOnFocus:b},null,8,["placeholder","disabled"])],2),s.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(W.value)},[e.createElementVNode("div",pe,[B.value.length>0?(e.openBlock(),e.createBlock(he,{key:0,list:B.value,onOnClick:V},null,8,["list"])):(e.openBlock(),e.createElementBlock("ul",me,[e.createElementVNode("li",fe,e.toDisplayString(e.unref(A).noResultsText),1)]))])],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],4))}}),ye={class:"selectmove-tree"},ve={class:"selectmove-tree-head"},Ie={class:"selectmove-tree-head-title"},Ee={class:"selectmove-tree-body"},xe=["onClick"],Ce=["innerHTML"],te=10,_e=e.defineComponent({name:"ClSelectMoveTree",__name:"Tree",props:{disabled:Boolean,maxWidth:Number,width:Number,treeTitle:{type:Array,default:()=>[]},treeShowMinLevel:{type:Number,default:1},treeTextFormat:[String,Array],selectId:{type:Array,default:()=>[]},dataRefreshIndex:Number},emits:{onChange:d=>!0},setup(d,{emit:q}){const l=d,a=q,A=e.inject("$SelectmoveTop"),L=e.inject("$SelectmoveBase");if(t.isUndefined(A)||t.isUndefined(L))throw new Error("SelectMove.Tree 缺少容器依赖($SelectmoveTop/$SelectmoveBase),请确保在 ClSelectMove 内使用");const N=`selectmove-tree-${t.getRandom(5)}`,p=e.reactive({selectIds:[],HalfSelectIds:[],openActiveId:[]}),s=e.ref([]),B=()=>{a("onChange",p.selectIds.join(","))},K=r=>{let m=0;const i=A.getDataGroup(r);if(i.length>0){const c=[],y=[];i.forEach(b=>{const V=b.id.toString();t.isExistValue(p.selectIds,V)&&c.push(V),t.isExistValue(p.HalfSelectIds,V)&&y.push(V)}),(y.length>0||c.length>0)&&(m=2),c.length>0&&c.length===i.length&&(m=1)}return m},P=(r,m,i)=>{const c={idx:r,pId:m,title:!t.isEmpty(l.treeTitle)&&l.treeTitle.length>r?l.treeTitle[r]:i,list:[],checkAll:0,sty:{}};if(l.width&&l.maxWidth&&l.width>0&&l.maxWidth>0){let y=l.width-3;const b=l.maxWidth/l.width;r+1>=b&&(y+=3),c.sty.width=`${y}px`}if(!t.isEmpty(m)){const y=A.getDataGroup(m);y.length>0&&(c.list=y.map(b=>{const V=b.id.toString(),u=t.getJsonClone(b);u.selected=t.isExistValue(p.selectIds,V),u.indeterminate=t.isExistValue(p.HalfSelectIds,V),u.isActive=t.isExistValue(p.openActiveId,V);const v=A.getDataGroup(V);u.isSub=v.length>0;let T=t.isNonEmptyString(b.name)?t.encodeHTML(b.name):"";const k=l.treeTextFormat;if(k&&k.length>0){let M="";t.isArray(k)?k.length>r&&(M=k[r]):t.isString(k)&&(M=k),t.isEmpty(M)||(T=t.convertStringFormatEncodeHTML(M,u))}return u.showTextLabel=T,u})),c.checkAll=K(m)}return c},O=r=>{const m=L.convertSelectedValue(r,!0,[]),i=L.convertSelectHalf(m);p.selectIds=m,p.HalfSelectIds=i},U=(r,m)=>{const i=[];if(s.value.forEach((c,y)=>{y<=r&&i.push(P(c.idx,c.pId,c.title))}),A.getDataGroup(m).length>0){const c=A.getDataInfo(m),y=t.isNonEmptyString(c&&c.name)?c.name:"";i.push(P(r+1,m,y))}s.value=i},R=(r,m)=>{const i=r.id.toString(),c=t.getArrClone(p.openActiveId);c.splice(m),c.push(i),p.openActiveId=c,U(m,i)},W=(r,m)=>{const i=L.convertSelectedValue(r,m,p.selectIds),c=L.convertSelectHalf(i);p.selectIds=i,p.HalfSelectIds=c,s.value=s.value.map(y=>P(y.idx,y.pId,y.title)),B()},o=r=>{const m=s.value.length,i=r||[];if(m>0&&p.selectIds.length>0){let c,y=-1;for(let b=m-1;b>=0;b--)if(s.value[b].list.some(u=>{if(u.selected||u.indeterminate)return c=u,!0})){y=b;break}if(y>-1&&!t.isUndefined(c)&&c.isSub){const b=c.id.toString();if(i.indexOf(b)>-1)return;i.push(b),R(c,y),o(i)}}},f=()=>{const r=[];return r.push(P(0,A.getTopParentValue(),"")),r};let S=null;const I=()=>{p.openActiveId=[],t.isEmpty(l.selectId)?(p.selectIds=[],p.HalfSelectIds=[]):O(l.selectId),s.value=f(),o(),S=t.getArrClone(l.selectId),l.treeShowMinLevel>1&&p.selectIds.length===0&&e.nextTick(()=>{const r=s.value.length,m=t.isFinite(l.treeShowMinLevel)?Math.min(l.treeShowMinLevel,te):te;if(m>r){const i=[];for(let c=r;c<m;c++)i.push(P(c,"",""));s.value=s.value.concat(i)}})};e.onMounted(()=>{e.nextTick(()=>{I()})}),e.watch(()=>l.dataRefreshIndex,()=>{I()}),e.watch(()=>l.selectId,r=>{(t.isUndefined(S)?!1:t.isEqualArr(r,S))||(S=t.getArrClone(r),O(r),s.value=s.value.map(i=>P(i.idx,i.pId,i.title)),o())});const x=(r,m)=>{const i=A.getDataGroup(m.toString()).map(c=>c.id.toString());W(i,r.value)},E=(r,m)=>{W(m.toString(),r.value)},w=(r,m,i)=>{if(l.disabled)return;const c=m.id.toString();if(t.isEmpty(A.getDataGroup(c))){if(se.getParent(r.target,".selectmove-option-checkbox",".selectmove-option"))return;W(c.toString(),!t.isExistValue(p.selectIds,c))}R(m,i)};return(r,m)=>(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(i,c)=>(e.openBlock(),e.createElementBlock("div",{key:`${N}-tree-${c}`,class:"selectmove-tree-item",style:e.normalizeStyle(i.sty)},[e.createElementVNode("div",ve,[e.withDirectives(e.createVNode(Z._sfc_main,{disabled:d.disabled,value:i.checkAll===1,indeterminate:i.checkAll===2,onOnChange:y=>x(y,i.pId)},null,8,["disabled","value","indeterminate","onOnChange"]),[[e.vShow,i.list.length>0]]),e.createElementVNode("div",Ie,e.toDisplayString(i.title),1)]),e.createElementVNode("div",Ee,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.list,(y,b)=>(e.openBlock(),e.createElementBlock("li",{key:`${N}-${y.id}-${b}`,class:e.normalizeClass({"selectmove-option":!0,active:y.isActive}),onClick:V=>w(V,y,c)},[e.createElementVNode("div",null,[e.createVNode(Z._sfc_main,{className:"selectmove-option-checkbox",disabled:d.disabled,value:y.selected,indeterminate:y.indeterminate,onOnChange:V=>E(V,y.id)},null,8,["disabled","value","indeterminate","onOnChange"]),e.createElementVNode("div",{class:"selectmove-option-text",innerHTML:y.showTextLabel},null,8,Ce),y.isSub?(e.openBlock(),e.createBlock(oe._sfc_main,{key:0,name:"angle-right",className:"sub-icon"})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])],10,xe))),128))])])],4))),128)),e.renderSlot(r.$slots,"tail")]))}}),ke={class:"selectmove-result"},we={class:"selectmove-result-head"},Te=["innerHTML"],Be={class:"selectmove-result-body"},be=["innerHTML"],Me=e.defineComponent({name:"ClSelectMoveResult",__name:"Result",props:{disabled:Boolean,width:Number,resultCountFormat:String,resultTextFormat:String,resultMergeParent:Boolean,selectId:{type:Array,default:()=>[]},dataRefreshIndex:Number},emits:{onChange:d=>!0},setup(d,{emit:q}){const l=d,a=q,{optPageLanguage:A,getPageLanguage:L}=le.useLanguage();L("common");const N=e.inject("$SelectmoveTop"),p=e.inject("$SelectmoveBase");if(t.isUndefined(N)||t.isUndefined(p))throw new Error("SelectMove.Result 缺少容器依赖($SelectmoveTop/$SelectmoveBase),请确保在 ClSelectMove 内使用");const s=`selectmove-result-${t.getRandom(5)}`,B=e.ref([]),K=e.computed(()=>B.value.length),P=e.computed(()=>t.isNonEmptyString(l.resultCountFormat)?t.convertStringFormat(l.resultCountFormat,{_count:K.value}):`${A.value.selected} ${K.value} ${A.value.count}`),O=e.computed(()=>{const f={};return l.width&&l.width>0&&(f.width=`${l.width}px`),f}),U=f=>{a("onChange",f.join(","))},R=f=>{if(t.isEmpty(f))return[];const S=f.filter(E=>!t.isUndefined(E)&&!t.isEmpty(E)),I=l.resultMergeParent?p.getValueMergeParent(S):p.getValueSplitChild(S),x=[];return I.forEach(E=>{const w=N.getDataInfo(E);if(t.isUndefined(w))return;const r=t.getJsonClone(w);t.isNonEmptyString(l.resultTextFormat)?r.showTextLabel=t.convertStringFormatEncodeHTML(l.resultTextFormat,r):t.isNonEmptyString(r.name)?r.showTextLabel=t.encodeHTML(r.name):r.showTextLabel="",x.push(r)}),x};e.watch(()=>l.selectId,f=>{const I=(t.isEmpty(f)?[]:f).filter(w=>!t.isUndefined(w)&&!t.isEmpty(w)),x=B.value.map(w=>w.id.toString());t.isEqualArr(I,x)||(B.value=R(I))},{immediate:!0}),e.watch(()=>l.dataRefreshIndex,()=>{B.value=R(l.selectId)}),e.watch(()=>l.resultMergeParent,()=>{B.value=R(l.selectId)});const W=()=>{B.value=[],U([])},o=f=>{const S=[],I=[],x=f.id.toString();B.value.forEach(E=>{const w=E.id.toString();w!==x&&(I.push(E),S.push(w))}),B.value=I,U(S)};return(f,S)=>(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",{class:"selectmove-result-container",style:e.normalizeStyle(O.value)},[e.createElementVNode("div",we,[e.createElementVNode("span",null,[d.disabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-cleanAll",type:"button",onClick:W},e.toDisplayString(e.unref(A).deleteAll),1))]),e.createElementVNode("span",{innerHTML:P.value},null,8,Te)]),e.createElementVNode("div",Be,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(I,x)=>(e.openBlock(),e.createElementBlock("li",{key:`${s}-${I.id}-${x}`},[e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:I.showTextLabel},null,8,be),d.disabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)):(e.openBlock(),e.createBlock(oe._sfc_main,{key:0,name:"close",className:"btn-clean",onClick:E=>o(I)},null,8,["onClick"]))])]))),128))])])],4)]))}}),Le={class:"selectmove-body"},Ve={key:0,class:"selectmove-result"},Ae=100,Ne=175,ne=e.defineComponent({name:"ClSelectMoveContainer",__name:"Container",props:{disabled:Boolean,width:Number,isSearch:{type:Boolean,default:!0},searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},searchIsMultiple:{type:Boolean,default:!1},searchMultipleJoin:{type:String,default:","},searchTextFormat:[String,Array],treeTitle:{type:Array,default:()=>[]},treeShowMinLevel:{type:Number,default:1},treeTextFormat:[String,Array],resultIsShowSlot:Boolean,resultIsShowSubUnit:Boolean,resultTextFormat:String,resultCountFormat:String,resultMergeParent:{type:Boolean,default:!0},dataRefreshIndex:{type:Number,default:0},selectId:{type:Array,default:()=>[]},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"}},emits:{onSelectValue:d=>!0,onInitComplete:()=>!0},setup(d,{emit:q}){const l=d,a=q;let A=!1;const L=e.inject("$SelectmoveTop");if(t.isUndefined(L))throw new Error("SelectMove.Container 缺少容器依赖($SelectmoveTop),请确保在 ClSelectMove 内使用");const N=e.reactive({searchWidth:0,treeWidth:0,resultWidth:0}),p={parentIdsJson:Object.create(null),childIdJson:Object.create(null),childIdsJson:Object.create(null)},s=o=>{a("onSelectValue",o)},B=()=>{e.nextTick(()=>{A||a("onInitComplete")})},K=o=>{let f=[];return t.isExistJsonKey(p.childIdJson,o)?f=p.childIdJson[o]:L.isCheckChildren(o)&&(L.getDataGroup(o).forEach(S=>{t.isUndefined(S)||t.isUndefined(S.id)||f.push(S.id.toString())}),p.childIdJson[o]=f),f},P=(o,f)=>{let S=[];const I=f||[];return I.indexOf(o)>-1||(I.push(o),t.isExistJsonKey(p.childIdsJson,o)?S=p.childIdsJson[o]:(L.isCheckChildren(o)&&L.getDataGroup(o).forEach(x=>{if(t.isUndefined(x)||t.isUndefined(x.id))return;const E=x.id.toString();S.push(E);const w=P(E,I);w.length>0&&(S=S.concat(w))}),p.childIdsJson[o]=S)),S},O=(o,f)=>{const{parentKey:S,topParentValue:I}=l;let x=[];const E=f||[];if(E.indexOf(o)>-1)return x;if(E.push(o),t.isExistJsonKey(p.parentIdsJson,o))x=p.parentIdsJson[o];else{const w=L.getDataInfo(o);if(!t.isUndefined(w)){const r=w[S],m=t.isEmpty(r)?I:r.toString();if(m!==I&&!t.isUndefined(L.getDataInfo(m))){x.push(m);const i=O(m,E);i.length>0&&(x=x.concat(i))}}p.parentIdsJson[o]=x}return x},U=(o,f,S)=>{const I=(t.isUndefined(S)?[]:S).filter(c=>!t.isUndefined(c));if(t.isUndefined(o))return t.getArrClone(I);const x=t.isObject(o)?o:[o];if(!t.isArray(x))return t.getArrClone(I);const E=t.getArrConvertJson(I),w={},r=[],m=[];x.forEach(c=>{if(t.isUndefined(c))return;const y=[],b=[],V=c.toString();if(f){if(!(t.isExistJsonKey(E,V)||t.isExistJsonKey(w,V))){y.push(V);const v=P(V);v&&v.length>0&&y.push(...v);const T=O(V);for(let k=0;k<T.length;k++){const M=T[k].toString();if(t.isExistJsonKey(E,M)||t.isExistJsonKey(w,M))break;const j=K(M),z=[];if(j.forEach(D=>{const F=D.toString();(t.isExistJsonKey(E,F)||t.isExistJsonKey(w,F)||y.indexOf(F)>-1)&&z.push(F)}),j.length===z.length)y.push(M);else break}}}else{b.push(V);const u=P(V);u&&u.length>0&&b.push(...u);const v=O(V);b.push(...v)}y.length>0&&y.forEach(u=>{r.push(u),w[u]=!0}),b.length>0&&b.forEach(u=>{m.push(u)})});let i=t.getArrClone(I);return i.push(...r),i=t.getArrUnique(i),i=t.getArrRemoveById(i,m),i},R=o=>{if(t.isUndefined(o)||!t.isArray(o))return[];const f=[],S={};o.forEach(E=>{S[E]=!0;const w=O(E);f.push(...w)});const I=[],x={};return f.forEach(E=>{!t.isExistJsonKey(x,E)&&!t.isExistJsonKey(S,E)&&(x[E]=!0,I.push(E))}),I},W=()=>{const o=l.width;if(o!==void 0&&t.isFinite(o)&&o>=350){const f=Math.floor(o/Ne),S=Math.floor(o/f);N.searchWidth=o,N.treeWidth=S,N.resultWidth=S}};return e.onMounted(()=>{W(),B()}),e.onBeforeUnmount(()=>{A=!0}),e.watch(()=>l.dataRefreshIndex,()=>{p.parentIdsJson=Object.create(null),p.childIdJson=Object.create(null),p.childIdsJson=Object.create(null)}),e.watch(()=>l.width,()=>{W()}),e.provide("$SelectmoveBase",{convertSelectedValue:(o,f,S)=>{let I=!1;if(f&&t.isObject(o)&&o.length>Ae&&(I=!0),I){const x=L.getValueMergeParent(o);return U(x,f,S)}else return U(o,f,S)},convertSelectHalf:R,getChildIds:P,getParentIds:O,getLastChildIds:(o,f)=>L.getLastChildIds(o,f),getValueMergeParent:o=>L.getValueMergeParent(o),getValueSplitChild:o=>L.getValueSplitChild(o)}),(o,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[d.isSearch?(e.openBlock(),e.createBlock(Se,{key:0,disabled:d.disabled,width:N.searchWidth,placeholder:d.searchPlaceholder,searchKey:d.searchKey,searchKeyType:d.searchKeyType,searchIsMultiple:d.searchIsMultiple,searchMultipleJoin:d.searchMultipleJoin,searchTextFormat:d.searchTextFormat,selectId:d.selectId,parentKey:d.parentKey,topParentValue:d.topParentValue,onOnChange:s},null,8,["disabled","width","placeholder","searchKey","searchKeyType","searchIsMultiple","searchMultipleJoin","searchTextFormat","selectId","parentKey","topParentValue"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),e.createElementVNode("div",Le,[e.createVNode(_e,{disabled:d.disabled,maxWidth:N.searchWidth,width:N.treeWidth,treeTitle:d.treeTitle,treeShowMinLevel:d.treeShowMinLevel,treeTextFormat:d.treeTextFormat,selectId:d.selectId,dataRefreshIndex:d.dataRefreshIndex,onOnChange:s},{tail:e.withCtx(()=>[d.resultIsShowSlot?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(o.$slots,"resultSelect")])):d.resultIsShowSubUnit?(e.openBlock(),e.createBlock(Me,{key:1,disabled:d.disabled,width:N.resultWidth,resultTextFormat:d.resultTextFormat,resultCountFormat:d.resultCountFormat,resultMergeParent:d.resultMergeParent,selectId:d.selectId,dataRefreshIndex:d.dataRefreshIndex,onOnChange:s},null,8,["disabled","width","resultTextFormat","resultCountFormat","resultMergeParent","selectId","dataRefreshIndex"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64))]),_:3},8,["disabled","maxWidth","width","treeTitle","treeShowMinLevel","treeTextFormat","selectId","dataRefreshIndex"])])],64))}}),Je=["id"],Ke={className:"selectmove-text-num"},Pe={class:"selectmove-container"},De=["id"],$e=e.defineComponent({name:"ClSelectMove",__name:"Index",props:{id:String,value:String,className:String,disabled:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},isDropdown:{type:Boolean,default:!1},placeholder:String,isClear:{type:Boolean,default:!1},containerWidth:{type:Number,default:350},isSearch:{type:Boolean,default:!0},searchPlaceholder:String,searchKey:{type:Array,default:()=>["name"]},searchKeyType:{type:String,default:"||"},searchIsMultiple:{type:Boolean,default:!1},searchMultipleJoin:{type:String,default:","},searchTextFormat:[String,Array],treeTitle:{type:Array,default:()=>[]},treeShowMinLevel:{type:Number,default:1},treeTextFormat:[String,Array],resultIsShow:{type:Boolean,default:!0},resultTextFormat:String,resultCountFormat:String,resultMergeParent:{type:Boolean,default:!0},isOutMerge:{type:Boolean,default:!0},parentKey:{type:String,default:"parentId"},topParentValue:{type:String,default:"0"},isPlaintext:{type:Boolean,default:!1},plaintextEmptyText:{type:String,default:void 0},plaintextSeparator:{type:String,default:","},plaintextLevelSeparator:{type:String,default:" > "},appendContainer:{type:String,default:""}},emits:{"update:value":d=>!0,"update:modelValue":d=>!0,onChange:(d,q)=>!0,onInit:()=>!0},setup(d,{expose:q,emit:l}){const a=d,A=l,L=e.useSlots(),N=a.id,p=e.useTemplateRef("refElDropdownLayer"),s=e.reactive({dataRefreshIndex:0,selectedIds:[],IsShowResultSlot:!t.isUndefined(L.resultSelect),isInitEmitDone:!1}),B=e.ref([]),K={dataJson:{},dataGroup:{},childLastIdsJson:{}},P=e.computed(()=>({disabled:a.disabled,width:a.containerWidth,isSearch:a.isSearch,searchPlaceholder:a.searchPlaceholder,searchKey:a.searchKey,searchKeyType:a.searchKeyType,searchIsMultiple:a.searchIsMultiple,searchMultipleJoin:a.searchMultipleJoin,searchTextFormat:a.searchTextFormat,treeTitle:a.treeTitle,treeShowMinLevel:a.treeShowMinLevel,treeTextFormat:a.treeTextFormat,resultIsShowSubUnit:a.resultIsShow,resultIsShowSlot:s.IsShowResultSlot,resultTextFormat:a.resultTextFormat,resultCountFormat:a.resultCountFormat,resultMergeParent:a.resultMergeParent,parentKey:a.parentKey,topParentValue:a.topParentValue})),O=e.computed(()=>{let n="panel-selectmove ";return t.isNonEmptyString(a.className)&&(n+=a.className),a.isDropdown||a.disabled&&(n+=" selectmove-disabled "),n}),U=n=>{A("update:value",n),A("update:modelValue",n)},R=(n,h)=>{U(n),A("onChange",n,h)},W=()=>{A("onInit")},o=()=>a.list,f=n=>t.isExistJsonKey(K.dataGroup,n.toString()),S=n=>{const h=n.toString();return f(h)?K.dataGroup[h]:[]},I=n=>{const h=n.toString();return t.isExistJsonKey(K.dataJson,h)?K.dataJson[h]:null},x=()=>`top_${a.topParentValue}`,E=n=>{const{parentKey:h,topParentValue:g}=a,C={},_={};!t.isEmpty(n)&&t.isArray(n)&&n.forEach(J=>{const $=t.getJsonClone(J);if(!t.isString($.id)&&!t.isNumber($.id))return;const H=$.id.toString(),G=t.isEmpty($[h])?g:$[h].toString();C[H]=$;const X=G===g?x():G;t.isExistJsonKey(_,X)||(_[X]=[]),_[X].push($)}),K.dataJson=C,K.dataGroup=_,K.childLastIdsJson={}};E(a.list);const w=(n,h)=>{let g=[];const C=h||[];return C.indexOf(n)>-1||(C.push(n),t.isExistJsonKey(K.childLastIdsJson,n)&&K.childLastIdsJson[n].length>0?g=K.childLastIdsJson[n]:(f(n)?S(n).forEach(_=>{const J=w(_.id.toString(),C);J.length>0&&(g=g.concat(J))}):g.push(n),K.childLastIdsJson[n]=g)),g},r=(n,h)=>{const{parentKey:g,topParentValue:C}=a,_=h||[],J={},$=[];let H=[];if(n.forEach(G=>{const X=I(G);if(!t.isUndefined(X)){const ee=X[g],Y=t.isUndefined(ee)?C:ee.toString();Y===C?H.push(G):(t.isExistJsonKey(J,Y)||(J[Y]=[]),J[Y].push(G))}}),!t.isEmpty(J))for(const[G,X]of Object.entries(J))X.length===S(G).length&&_.indexOf(G)===-1?$.push(G):H=H.concat(X);if($.length>0){H.push(...$);const G=t.getArrUnique(H);return r(G,_.concat($))}else return H},m=n=>{const h=[],g=t.getArrConvertJson(n);return n.forEach(_=>{const J=S(_);if(t.isEmpty(J))h.push(_);else{const $=[];J.forEach(H=>{t.isExistJsonKey(g,H.id.toString())&&$.push(H.id)}),J.length!==$.length&&h.push(_)}}),r(h)},i=n=>{let h=[];return n.forEach(g=>{const C=w(g);h.push(...C)}),h=t.getArrUnique(h),h},c=(n,h)=>(t.isBoolean(h)?h:a.isOutMerge)?m(n):i(n),y=n=>{const h=[],g=[];return n.forEach(C=>{const _=I(C);t.isUndefined(_)||(h.push(_),g.push(t.isNonEmptyString(_.name)?t.encodeHTML(_.name):""))}),{list:h,label:g}},b=n=>{const h=[],g=new Set;let C=n;for(;t.isNonEmptyString(C)&&!g.has(C);){g.add(C);const _=I(C);if(!_)break;t.isNonEmptyString(_.name)&&h.unshift(_.name);const J=_[a.parentKey],$=J!=null?String(J):"";if($===""||$===String(a.topParentValue))break;C=$}return h},V=e.computed(()=>{if(a.list,t.isEmpty(s.selectedIds))return"";const n=t.isString(a.plaintextLevelSeparator)?a.plaintextLevelSeparator:" > ",h=t.isString(a.plaintextSeparator)?a.plaintextSeparator:",";return c(s.selectedIds,a.resultMergeParent).map(C=>{const _=b(C);return t.removeHTMLTags(_.length>0?_.join(n):C)}).join(h)}),u=e.computed(()=>ae.getPlaintextOutText("selectMove",a.plaintextEmptyText,V.value,a.value)),v=()=>{if(a.isDropdown)if(t.isEmpty(s.selectedIds))B.value=[];else{const n=c(s.selectedIds,a.resultMergeParent);B.value=y(n).label}};(()=>{t.isNonEmptyString(a.value)&&(s.selectedIds=t.split(a.value)),v()})(),e.watch(()=>a.value,(n,h)=>{if(n!==h){const g=t.isNonEmptyString(n)?t.split(n):[],C=c(s.selectedIds);t.isEqualArr(g,C)||(s.selectedIds=t.isEmpty(g)?[]:g,v())}}),e.watch(()=>a.list,n=>{t.isArray(n)&&(E(n),s.selectedIds=s.selectedIds.filter(h=>!t.isUndefined(I(h))),s.dataRefreshIndex++,v())}),e.watch(()=>a.resultMergeParent,()=>{v()});const k=()=>{a.disabled||(s.selectedIds=[],v(),R("",[]))},M=()=>{a.isDropdown&&(v(),p.value&&(p.value.checkIsShowOpen()||p.value.initCompleteOpen())),s.isInitEmitDone||(s.isInitEmitDone=!0,W())},j=n=>{const h=t.isEmpty(n)?[]:t.split(n);s.selectedIds=h;const g=c(h),C=y(g);v(),R(g.join(","),C.list)};return e.provide("$SelectmoveTop",{isCheckChildren:f,getDataGroup:S,getDataInfo:I,getDataList:o,getLastChildIds:w,getValueMergeParent:m,getValueSplitChild:i,getTopParentValue:x}),q({getValue:()=>c(s.selectedIds).join(","),getValueData:()=>{const n=c(s.selectedIds);return y(n).list},setValue:n=>{s.selectedIds=t.isString(n)&&!t.isEmpty(n)?t.split(n):[],v()}}),(n,h)=>d.isPlaintext?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(N),class:"cl-plaintext-value"},e.toDisplayString(u.value),9,Je)):d.isDropdown?(e.openBlock(),e.createBlock(ce._sfc_main,{key:1,id:e.unref(N),ref_key:"refElDropdownLayer",ref:p,classParent:O.value,classText:"selectmove-text",classDropDown:"selectmove-dropdown",placeholder:d.placeholder,isDisabled:d.disabled,isClear:d.isClear,textLabel:B.value.join(","),textArrowDirection:"right",isUseDropdownArrow:!0,appendContainer:d.appendContainer,onOnClear:k},{textExtend:e.withCtx(()=>[e.createElementVNode("span",Ke,[B.value.length>1?(e.openBlock(),e.createBlock(re._sfc_main,{key:0,num:B.value.length},null,8,["num"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])]),dropdown:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createVNode(ne,e.mergeProps(P.value,{dataRefreshIndex:s.dataRefreshIndex,selectId:s.selectedIds,onOnSelectValue:j,onOnInitComplete:M}),{resultSelect:e.withCtx(()=>[e.renderSlot(n.$slots,"resultSelect")]),_:3},16,["dataRefreshIndex","selectId"])])]),_:3},8,["id","classParent","placeholder","isDisabled","isClear","textLabel","appendContainer"])):(e.openBlock(),e.createElementBlock("div",{key:2,id:e.unref(N),class:e.normalizeClass(O.value)},[e.createVNode(ne,e.mergeProps(P.value,{dataRefreshIndex:s.dataRefreshIndex,selectId:s.selectedIds,onOnSelectValue:j,onOnInitComplete:M}),{resultSelect:e.withCtx(()=>[e.renderSlot(n.$slots,"resultSelect")]),_:3},16,["dataRefreshIndex","selectId"])],10,De))}});module.exports=$e;