cnhis-design-vue 3.1.56-release.0 → 3.1.56

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 (111) hide show
  1. package/es/components/annotation-edit/index.d.ts +18 -0
  2. package/es/components/annotation-edit/src/AnnotationEdit.d.ts +18 -0
  3. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  4. package/es/components/annotation-edit/src/type.d.ts +4 -0
  5. package/es/components/audio-sdk/src/audioSDK.d.ts +20 -6
  6. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  7. package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +14 -0
  8. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  9. package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +5 -2
  10. package/es/components/audio-sdk/src/utils/recordingDialog.js +1 -1
  11. package/es/components/audio-sdk/style/index.css +1 -1
  12. package/es/components/base-search/index.d.ts +14 -0
  13. package/es/components/base-search/src/index.vue.d.ts +14 -0
  14. package/es/components/base-search/src/index.vue2.js +1 -1
  15. package/es/components/base-search/style/index.css +1 -1
  16. package/es/components/big-table/index.js +1 -1
  17. package/es/components/callback/src/components/render/popupMaps.d.ts +26 -4
  18. package/es/components/classification/index.d.ts +20 -7
  19. package/es/components/classification/src/components/search-filter/index.vue.d.ts +14 -0
  20. package/es/components/classification/src/components/set-classification/index.vue.d.ts +20 -7
  21. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  22. package/es/components/classification/src/components/table-modal/index.vue.d.ts +6 -5
  23. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  24. package/es/components/classification/src/index.vue.d.ts +20 -7
  25. package/es/components/classification/src/index.vue2.js +1 -1
  26. package/es/components/fabric-chart/index.d.ts +4 -2
  27. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
  28. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  37. package/es/components/form-config/index.d.ts +82 -14
  38. package/es/components/form-config/src/FormConfig.vue.d.ts +82 -14
  39. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -4
  40. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  41. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +41 -7
  42. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  43. package/es/components/form-render/index.d.ts +26 -4
  44. package/es/components/form-render/src/FormRender.vue.d.ts +27 -4
  45. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  46. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -4
  47. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  48. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  49. package/es/components/form-render/src/components/renderer/select.js +1 -1
  50. package/es/components/form-render/src/constants/index.d.ts +1 -0
  51. package/es/components/form-render/src/constants/index.js +1 -1
  52. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
  53. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  54. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  55. package/es/components/form-render/src/types/index.d.ts +3 -1
  56. package/es/components/iho-table/index.js +1 -1
  57. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.js +1 -1
  58. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  59. package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.js +1 -1
  60. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
  61. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.js +1 -1
  62. package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.js +1 -1
  63. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
  64. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
  65. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  66. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  67. package/es/components/iho-table/src/utils/index.js +1 -1
  68. package/es/components/index.css +1 -1
  69. package/es/components/index.js +1 -1
  70. package/es/components/info-header/index.d.ts +77 -13
  71. package/es/components/info-header/src/InfoHeader.vue.d.ts +77 -13
  72. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +5 -1
  73. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +5 -1
  74. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -5
  75. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -4
  76. package/es/components/recommend-search/index.d.ts +8 -8
  77. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  78. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  79. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  80. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  81. package/es/components/shortcut-setter/index.d.ts +26 -4
  82. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +26 -4
  83. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +14 -0
  84. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +14 -0
  85. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +14 -0
  86. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +14 -0
  87. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +15 -0
  88. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  89. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +14 -0
  90. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  91. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +15 -0
  92. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +15 -0
  93. package/es/components/vod-chunk-upload/src/vod-chunk-upload/index.js +1 -1
  94. package/es/shared/components/CancelRadio/index.js +1 -1
  95. package/es/shared/components/InputNumberSlash/index.js +1 -1
  96. package/es/shared/components/SelectPage/index.js +1 -1
  97. package/es/shared/components/SlotRender/index.js +1 -1
  98. package/es/shared/components/SvgIcon/index.js +1 -1
  99. package/es/shared/components/TextOverTooltip/index.js +1 -1
  100. package/es/shared/components/VueDraggable/index.js +1 -1
  101. package/es/shared/components/no-data/index.js +1 -1
  102. package/es/shared/package.json.js +1 -1
  103. package/es/shared/utils/business.js +1 -1
  104. package/es/shared/utils/tapable/AsyncParallelBailHook.js +1 -0
  105. package/es/shared/utils/tapable/AsyncSeriesBailHook.js +1 -0
  106. package/es/shared/utils/tapable/AsyncSeriesLoopHook.js +1 -0
  107. package/es/shared/utils/tapable/AsyncSeriesWaterfallHook.js +1 -0
  108. package/es/shared/utils/tapable/SyncBailHook.js +1 -0
  109. package/es/shared/utils/tapable/SyncLoopHook.js +1 -0
  110. package/es/shared/utils/vexutils.js +1 -1
  111. package/package.json +2 -2
@@ -1 +1 @@
1
- import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i}from"vue";import{arrayed as a,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as u,autorun as d}from"@formily/reactive";import{connect as f,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isString as c,isArray as b,isFunction as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import x from"../tooltipMessage.vue.js";import{InjectionFormUUID as I,InjectionFormGraph as j,InjectionAnnotation as h,InjectionFormGlobalProps as k}from"../../constants/index.js";import{useComplexOptionsSpan as F}from"../../hooks/useComplexOptions.js";import{validateMessageParser as R}from"../../utils/index.js";import{dotEscape as L}from"../../utils/schema.js";import{useFormField as q}from"../../hooks/useFormField.js";const K=f(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:a}){const{field:f,fieldKey:p,fieldAddress:c}=q(),R=r(I),K=l((()=>L(`${R}-${c.value}`))),S=o(!1);if(m(f.value)&&b(e.suffixFields)){const l=r(j);t(u(l,v((()=>{m(f.value)&&b(e.suffixFields)&&(S.value=e.suffixFields.some((e=>{const r=f.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(d((()=>{S.value=Reflect.get(f.value,"required")})));const A=r(h),E=l({get(){var r,l;return null!=(l=null==(r=A.value)?void 0:r[e.propertyKey])?l:""},set(r){A.value={property:e.propertyKey,value:r}}});const M=l((()=>A.value&&!1!==e.annotation)),O=l((()=>e.label&&" "!==e.label)),V=l((()=>{let r=0;return M.value&&(r+=18),e.remark&&(r+=18),r})),$=r(k,{}),w=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?$.bordered:l}));function C(){return O.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(V.value)}},[y(e.labelRender)?e.labelRender(e.label):e.label]),V.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(x,{message:e.remark},null)]):null,M.value?n(g,{class:"form-render__formItemLabel--annotation",modelValue:E.value,"onUpdate:modelValue":e=>E.value=e},null):null]):null]):null}const{getSpan:N}=F();return()=>{return n(_,i({class:["form-render__formItem",{"form-render--no-border":!w.value,"form-render--underline":"underline"===w.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:N(R,f.value.address,!1)+e.span}},{id:K.value,uuid:R,"widget-type":f.value.componentType,"field-key":L(p.value),"field-address":L(c.value),required:S.value}),{...a,label:C});var r}}}),p({title:"label"},((e,r)=>{const l=m(r)?void 0:a(r.selfErrors).length?function(e,r){if(!c(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>R(e,r))).join(",");return R(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{K as FORM_ITEM};
1
+ import{defineComponent as e,inject as r,computed as l,ref as o,onUnmounted as t,createVNode as n,mergeProps as i,unref as a}from"vue";import{arrayed as s,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as u}from"@formily/core";import{observe as d,autorun as f}from"@formily/reactive";import{connect as p,mapProps as v}from"@formily/vue";import{useDebounceFn as c}from"@vueuse/core";import{isString as b,isArray as y,isFunction as _}from"lodash-es";import{NFormItem as g}from"naive-ui";import x from"../../../../annotation-edit/index.js";import"../../../index.js";import I from"../tooltipMessage.vue.js";import{InjectionFormUUID as j,InjectionFormGraph as h,InjectionAnnotation as k,InjectionAnnotationShortcuts as F,InjectionFormGlobalProps as R}from"../../constants/index.js";import{useComplexOptionsSpan as L}from"../../hooks/useComplexOptions.js";import{validateMessageParser as q}from"../../utils/index.js";import{dotEscape as K}from"../../utils/schema.js";import{useFormField as S}from"../../hooks/useFormField.js";const A=p(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:s}){const{field:p,fieldKey:v,fieldAddress:b}=S(),q=r(j),A=l((()=>K(`${q}-${b.value}`))),E=o(!1);if(u(p.value)&&y(e.suffixFields)){const l=r(h);t(d(l,c((()=>{u(p.value)&&y(e.suffixFields)&&(E.value=e.suffixFields.some((e=>{const r=p.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else t(f((()=>{E.value=Reflect.get(p.value,"required")})));const M=r(k),O=l({get(){var r,l;return null!=(l=null==(r=M.value)?void 0:r[e.propertyKey])?l:""},set(r){M.value={property:e.propertyKey,value:r}}}),V=r(F);const $=l((()=>M.value&&!1!==e.annotation)),w=l((()=>e.label&&" "!==e.label)),C=l((()=>{let r=0;return $.value&&(r+=18),e.remark&&(r+=18),r})),N=r(R,{}),T=l((()=>{var r;const l=null==(r=e.fieldItem)?void 0:r.bordered;return null==l?N.bordered:l}));function U(){return w.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:m(C.value)}},[_(e.labelRender)?e.labelRender(e.label):e.label]),C.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(I,{message:e.remark},null)]):null,$.value?n(x,{class:"form-render__formItemLabel--annotation",modelValue:O.value,"onUpdate:modelValue":e=>O.value=e,shortcuts:a(V)},null):null]):null]):null}const{getSpan:W}=L();return()=>{return n(g,i({class:["form-render__formItem",{"form-render--no-border":!T.value,"form-render--underline":"underline"===T.value}],style:{"--form-item-column":"inner"===(null==(r=e.fieldItem)?void 0:r.childWidthMode)?e.span:W(q,p.value.address,!1)+e.span}},{id:A.value,uuid:q,"widget-type":p.value.componentType,"field-key":K(v.value),"field-address":K(b.value),required:E.value}),{...s,label:U});var r}}}),v({title:"label"},((e,r)=>{const l=u(r)?void 0:s(r.selfErrors).length?function(e,r){if(!b(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>q(e,r))).join(",");return q(r.defined_error_msg,r)}(s(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:l,"validation-status":l?"error":void 0}})));export{A as FORM_ITEM};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as n,nextTick as o}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as m,InjectionFormUUID as f}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as h,createVisitedSetter as y,traverseDependKey as g}from"../../utils/schema.js";import"@formily/reactive";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";import{useFormField as k}from"../../hooks/useFormField.js";import"../../hooks/useFormValidator.js";const j=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const h=t(),{field:j,title:C}=k(),b=t(1),w=t(!0);const F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),S=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),x=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[S.value])).slice(-1).join(""),l=t.map((e=>e[F.value])).join(" / ");return a||l}catch(e){return null}}));function A(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[F.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const q=l(m);async function V(t){e.filterable?await async function(){if(!e.urlConfig||h.value&&e.requestCache)return;const t=await q.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:C.value,cache:e.requestCache,payload:{field:j.value,labelKey:F.value,valueKey:S.value}});function a(e,t,r){const n=[...r,...l(e)],o={[F.value]:e[F.value],[S.value]:e[S.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:n};return c(e.children)&&(o.children=e.children.map((e=>a(e,t+1,n))),o.isLeaf=!e.children.length),b.value=Math.max(b.value,t+1),o}function l(e){let t=[];if(p(e[F.value])&&(t=[...t,e[F.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}h.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await q.addAsync(n(s(t),i(e),C.value,t));if(!a.length&&t)return t.isLeaf=!0,A(0,0,o(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&h.value&&e.requestCache||s(t)>=s(e)-1}function n(t,a,l,r){const n={lvlnr:t+1+""};return r&&a.dependKey&&g(a.dependKey,((e,t)=>{n[t]=r[e]})),{params:n,...a,key:l,cache:e.requestCache}}function o(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[F.value]:a[F.value],[S.value]:a[S.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:h.value=l}(t),await H()}const K=`form-render__cascade--menu-${l(f)}`;async function H(){await o();const e=document.querySelector(`.${K} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<b.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:B,injectValueWatchFromEmpty:I,injectValueBindKey:E}=v();I((()=>e.value),V),B((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(h.value=null,w.value?e.lazyRequest||(V(),w.value=!w.value):await V())}),{immediate:!0});const O=t(!1);function z(e){O.value=!!e,e&&V()}const N=a((()=>h.value||e.options||[])),R=a((()=>!e.filterable)),U=E(x);return()=>n(d,{key:U.value,remote:R.value,filterable:e.filterable,"menu-props":{class:K,onClick:H},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":z,value:x.value,filter:L,"onUpdate:value":A,labelField:F.value,valueField:S.value,options:N.value,onLoad:V,onFocus:y(j)},u)}}),i({dataSource:"options"},h));export{j as SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{isEqual as s,isArray as c,isString as p}from"lodash-es";import{NCascader as d}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as v,InjectionFormUUID as f}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"date-fns";import{assignUpdateValue as y,createVisitedSetter as h,traverseDependKey as k}from"../../utils/schema.js";import"@formily/reactive";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"./index.js";import{useFormField as j}from"../../hooks/useFormField.js";import"../../hooks/useFormValidator.js";const g=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const y=t(),{field:g,title:b}=j(),C=t(1),S=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){i("update:value",c(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const x=l(v);async function q(t){e.filterable?await async function(){if(!e.urlConfig||y.value&&e.requestCache)return;const t=await x.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache,payload:{field:g.value,labelKey:w.value,valueKey:F.value}});function a(e,t,o){const r=[...o,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return c(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),C.value=Math.max(C.value,t+1),n}function l(e){let t=[];if(p(e[w.value])&&(t=[...t,e[w.value]]),p(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}y.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await x.addAsync(r(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&y.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&k(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:y.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(f)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function K(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<C.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:L,injectValueWatchFromEmpty:I,injectValueBindKey:E}=m();I((()=>e.value),q),L((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{s(t,a)||(y.value=null,S.value?e.lazyRequest||(q(),S.value=!S.value):await q())}),{immediate:!0});const O=t(!1);function W(e){O.value=!!e,e&&q()}const z=a((()=>y.value||e.options||[])),N=a((()=>!e.filterable)),P=E(A);return()=>r(d,{key:P.value,remote:N.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":W,value:A.value,filter:K,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:z.value,onLoad:q,onFocus:h(g)},u)}}),i({dataSource:"options"},y));export{g as SEARCH_CASCADER};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as n,toRaw as s}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as m,isObject as p,omit as d,xor as c}from"lodash-es";import{NSelect as f}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as v}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as y}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as C,useComplexOptionsSpan as S}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as k,InjectionFormUUID as F}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as B,assignClearBindVisited as w,createVisitedSetter as O}from"../../utils/schema.js";import"@formily/reactive";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as K}from"../../hooks/useFormField.js";import{useUrlConfigOptions as R,useAutographOptions as A,useRecommendOptions as x}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const V=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const B=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:w,valueKey:V,showKey:H,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:q}=e.urlConfig?R(e,B):A(e,B),{modifyEvent:E,modifyAbleRef:W,getOptionsWithCreated:z}=v(e,{searchContent:P,labelKey:w,valueKey:V,valueRef:B,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=C(e,B),{getRecommend:U,postRecommend:D,sortedOptions:G}=x(e,N,b,w,V),{field:J,fieldKey:Q}=K();t(k).setContext(Q.value,(e=>({currentOption:i(function(e){const o=z(_.value);return m(e)?function(e){const t=o.reduce(((e,o)=>(e[o[V.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[V.value]===t)));var t}(e))})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(B,(()=>e.lazyRequest&&X())),Y(B);const ee=$(B),{menuProps:oe,nodeProps:te}=g(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:ne}=y(e,{labelKey:w,valueKey:V,valueRef:B,showKey:H,searchContent:P}),se=o((()=>z(W.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return B.value;const o=e.multiple&&m(B.value);return _.value.find((e=>o?B.value.includes(e[V.value]):e[V.value]===B.value))?B.value:null})),me=a(!1);async function pe(e){e&&await X(),me.value=e}async function de(e,o){await E.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!p(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(d(s(o),["created","shouldSave"]))}))}const ce=t(F),{getSpan:fe}=S(),ve=O(J,E.focus);function ye(o){if(!e.multiple)return;const t=o?se.value.map((e=>e[V.value])):[];c(t,e.value).length&&(B.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(ye),...h}),r(f,n({title:ne.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:q.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:w.value,valueField:V.value,options:se.value,onSearch:X,show:me.value,"onUpdate:show":pe,onFocus:ve,onBlur:E.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=fe(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>M({option:e,value:B.value,valueKey:V.value,labelKey:w.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},B,w));export{V as SELECT};
1
+ import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as s,toRaw as n}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as p,isObject as m,omit as d,xor as c}from"lodash-es";import{NSelect as y}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as f}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as v}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{connect as h,mapProps as b}from"@formily/vue";import{useCommonInjection as j,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as g}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as C,InjectionFormUUID as B}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import{assignUpdateValue as F,assignClearBindVisited as A,createVisitedSetter as w}from"../../utils/schema.js";import"@formily/reactive";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as H}from"../../hooks/useFormField.js";import{useUrlConfigOptions as O,useAutographOptions as K,useRecommendOptions as R}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const x=h(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean}},emits:["update:value","postRecommend"],setup(e,{slots:h,emit:b}){const F=o({get:()=>e.value,async set(e){b("update:value",e),D(e)}}),{labelKey:A,valueKey:x,showKey:V,fetchData:L,searchContent:P,fullOptions:_,filterOptions:N,remoteOptions:I,loading:W}=e.urlConfig?O(e,F):K(e,F),{modifyEvent:q,modifyAbleRef:E,getOptionsWithCreated:z}=f(e,{searchContent:P,labelKey:A,valueKey:x,valueRef:F,fullOptions:_}),{renderComplexOption:M,hasComplexOption:T}=k(e,F),{getRecommend:U,postRecommend:D,sortedOptions:G}=R(e,N,b,A,x),{field:J,fieldKey:Q}=H();t(C).setContext(Q.value,(e=>({currentOption:i(function(e){const o=z(_.value);return p(e)?function(e){const t=o.reduce(((e,o)=>(e[o[x.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[x.value]===t)));var t}(e))})));const X=async e=>(P.value=e,Promise.allSettled([L(e),U(e)])),{injectValueValidate:Y,injectValueWatchFromEmpty:Z,injectValueBindKey:$}=j();Z(F,(()=>e.lazyRequest&&X())),Y(F);const ee=$(F),{menuProps:oe,nodeProps:te}=S(),{renderTag:le,renderLabel:ae,renderSelectAll:re,titleRef:se}=v(e,{labelKey:A,valueKey:x,valueRef:F,showKey:V,searchContent:P}),ne=o((()=>z(E.value?_.value:G.value))),ue=l(),ie=o((()=>{if(e.allowCreate||e.showCustomValue)return F.value;const o=e.multiple&&p(F.value);return _.value.find((e=>o?F.value.includes(e[x.value]):e[x.value]===F.value))?F.value:null})),pe=a(!1);async function me(e){e&&await X(),pe.value=e}async function de(e,o){await q.updateValue(e,o),I.value&&o&&u(o).forEach((e=>{if(!m(e))return;const o=e;o.created&&o.shouldSave&&I.value.push(d(n(o),["created","shouldSave"]))}))}const ce=t(B),{getSpan:ye}=g(),fe=w(J,q.focus);function ve(o){if(!e.multiple)return;const t=o?ne.value.map((e=>e[x.value])):[];c(t,e.value).length&&(F.value=t)}function he(o){let t=h;return e.multiple&&e.selectAll&&(t={action:()=>re(ve),...h}),r(y,s({title:se.value,key:ee.value,multiple:e.multiple,remote:!0,filterable:!0,loading:W.value,value:ie.value,onUpdateValue:de,"menu-props":oe,"node-props":te,labelField:A.value,valueField:x.value,options:ne.value,onSearch:X,show:pe.value,"onUpdate:show":me,onFocus:fe,onBlur:q.blur,renderLabel:ae,renderTag:le},o,ue),t)}return()=>{var e,o;if(!T.value)return he();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=ye(ce,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[he({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),_.value.map((e=>M({option:e,value:F.value,valueKey:x.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},F,A));export{x as SELECT};
@@ -16,6 +16,7 @@ export declare const InjectionFormLifeCycleCaller: InjectionKey<ReturnType<typeo
16
16
  export declare const InjectionFormUUID: InjectionKey<string>;
17
17
  export declare const InjectionFormGraph: InjectionKey<Record<string, GeneralField>>;
18
18
  export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Nullable<Record<string, AnnotationItem>>>>;
19
+ export declare const InjectionAnnotationShortcuts: InjectionKey<WritableComputedRef<Exclude<NonNullable<AnnotationItem>, string>['shortcuts']>>;
19
20
  export declare const InjectionFormGlobalProps: InjectionKey<Readonly<FormRenderProps>>;
20
21
  export declare enum FIELD_BUSINESS_TYPE {
21
22
  PASSWORD = "password",
@@ -1 +1 @@
1
- const o=Symbol("InjectionAsyncQueue"),e=Symbol("InjectionSchemaField"),n=Symbol("InjectionBusinessCollector"),t=Symbol("InjectionChangeContextCollector"),l=Symbol("InjectionFormItemDepsCollector"),E=Symbol("InjectionFormLifeCycleCaller"),I=Symbol("InjectionFormUUID"),i=Symbol("InjectionFormGraph"),a=Symbol("InjectionAnnotation"),c=Symbol("InjectionFormGlobalProps");var m=(o=>(o.PASSWORD="password",o.ID_CARD="id_card",o.AGE="age",o.AGE_UNIT="age_unit",o.MOBILE="mobile",o.TELEPHONE="telephone",o.EMAIL="email",o.SEX="sex",o.BIRTHDAY="birthday",o.BANK_CARD="bank_card",o.WEBSITE="website",o.GESTATIONAL_WEEKS="gestational_weeks",o.GESTATIONAL_STAGE="gestational_stage",o.CUSTOMER_NAME="customer_name",o))(m||{}),A=(o=>(o.MALE="1",o.FEMALE="2",o))(A||{}),S=(o=>(o.DAY="D",o.MONTH="M",o.YEAR="Y",o.HOUR="H",o.WEEK="W",o.MINUTE="N",o))(S||{});const r=["COMPLEX","COMBINATION"];export{S as FIELD_AGE_UNIT,m as FIELD_BUSINESS_TYPE,A as FIELD_SEX_VALUE,a as InjectionAnnotation,o as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,c as InjectionFormGlobalProps,i as InjectionFormGraph,l as InjectionFormItemDepsCollector,E as InjectionFormLifeCycleCaller,I as InjectionFormUUID,e as InjectionSchemaField,r as NESTED_FORM_ITEM_TYPE};
1
+ const o=Symbol("InjectionAsyncQueue"),e=Symbol("InjectionSchemaField"),n=Symbol("InjectionBusinessCollector"),t=Symbol("InjectionChangeContextCollector"),l=Symbol("InjectionFormItemDepsCollector"),E=Symbol("InjectionFormLifeCycleCaller"),i=Symbol("InjectionFormUUID"),I=Symbol("InjectionFormGraph"),c=Symbol("InjectionAnnotation"),a=Symbol("InjectionAnnotationShortcuts"),m=Symbol("InjectionFormGlobalProps");var A=(o=>(o.PASSWORD="password",o.ID_CARD="id_card",o.AGE="age",o.AGE_UNIT="age_unit",o.MOBILE="mobile",o.TELEPHONE="telephone",o.EMAIL="email",o.SEX="sex",o.BIRTHDAY="birthday",o.BANK_CARD="bank_card",o.WEBSITE="website",o.GESTATIONAL_WEEKS="gestational_weeks",o.GESTATIONAL_STAGE="gestational_stage",o.CUSTOMER_NAME="customer_name",o))(A||{}),S=(o=>(o.MALE="1",o.FEMALE="2",o))(S||{}),r=(o=>(o.DAY="D",o.MONTH="M",o.YEAR="Y",o.HOUR="H",o.WEEK="W",o.MINUTE="N",o))(r||{});const s=["COMPLEX","COMBINATION"];export{r as FIELD_AGE_UNIT,A as FIELD_BUSINESS_TYPE,S as FIELD_SEX_VALUE,c as InjectionAnnotation,a as InjectionAnnotationShortcuts,o as InjectionAsyncQueue,n as InjectionBusinessCollector,t as InjectionChangeContextCollector,m as InjectionFormGlobalProps,I as InjectionFormGraph,l as InjectionFormItemDepsCollector,E as InjectionFormLifeCycleCaller,i as InjectionFormUUID,e as InjectionSchemaField,s as NESTED_FORM_ITEM_TYPE};
@@ -68,7 +68,11 @@ export declare function useFieldNormalize(): {
68
68
  }>;
69
69
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
70
70
  scope: import("../../../../shared/types").AnyObject;
71
- annotation: import("../../../../shared/types").AnyObject;
71
+ annotation: Record<string, import("../../../annotation-edit/src/type").AnnotationItem>;
72
+ annotationShortcuts: (string | {
73
+ label: string;
74
+ value: string;
75
+ })[] | undefined;
72
76
  consumer: boolean;
73
77
  uuid: string;
74
78
  lifeCycle: Partial<{
@@ -159,7 +163,11 @@ export declare function useFieldNormalize(): {
159
163
  }>;
160
164
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
161
165
  scope: import("../../../../shared/types").AnyObject;
162
- annotation: import("../../../../shared/types").AnyObject;
166
+ annotation: Record<string, import("../../../annotation-edit/src/type").AnnotationItem>;
167
+ annotationShortcuts: (string | {
168
+ label: string;
169
+ value: string;
170
+ })[] | undefined;
163
171
  consumer: boolean;
164
172
  uuid: string;
165
173
  lifeCycle: Partial<{
@@ -1 +1 @@
1
- import{arrayed as e,uuidGenerator as t,traverse as r}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/Hook.js";import l from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import{last as o,isString as i}from"lodash-es";import{FIELD_BUSINESS_TYPE as _}from"../constants/index.js";function s(){const s=new l(["fieldList","props"]),p=new l(["fieldItem","props"]);p.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),p.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),p.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:_.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),p.tap("__multiple_select",(e=>{const{html_type:t,multi_select:r,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===r:l)),e}));const n=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];p.tap("__normalize",(e=>(n.some((([t,r])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=r))),e)));const a=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return p.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...a].some((([r,l])=>{if(!e(r).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),s.tap("__out_bordered",((e,{column:r,outBordered:l})=>{if(!l)return e;let i=0;return e.reduce(((l,_,s)=>{const p=2*(_.elem_width||3);return i+=p,i===r&&s<e.length-1?(i=0,l.push(_),l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0})):i>r?(i=p,l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0}),l.push(_)):(o(l)&&(o(l).fieldItemBorder=!0),l.push(_)),l}),[])})),s.tap("__prefix/suffix",(e=>{const t=[];return r(e,(l=>{["prefix","suffix"].forEach((o=>{const _=l[o];if(!i(_))return;const s=_.match("#{(.+)}");if(!s)return;const p=i(s[1])&&function(t){let l=null;return r(e,((e,r)=>{e.val_key===t&&(l=e,r())}),["children","properties"]),l}(s[1].trim());p&&(Reflect.deleteProperty(l,o),l[`${o}Config`]=l[`${o}Config`]||[],l[`${o}Config`].push(p),t.push(p))}))}),["children","properties"]),t.length?function e(r){return r.reduce(((r,l)=>(t.includes(l)||(r.push(l),l.properties&&(l.properties=e(l.properties)),l.children&&(l.children=e(l.children))),r)),[])}(e):e})),{FieldNormalizeWaterfallHook:p,FieldListNormalizeWaterfallHook:s}}export{s as useFieldNormalize};
1
+ import{arrayed as e,uuidGenerator as t,traverse as r}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{last as o,isString as s}from"lodash-es";import{FIELD_BUSINESS_TYPE as i}from"../constants/index.js";function a(){const a=new l(["fieldList","props"]),p=new l(["fieldItem","props"]);p.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),p.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),p.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:i.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),p.tap("__multiple_select",(e=>{const{html_type:t,multi_select:r,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===r:l)),e}));const _=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];p.tap("__normalize",(e=>(_.some((([t,r])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=r))),e)));const n=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return p.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...n].some((([r,l])=>{if(!e(r).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),a.tap("__out_bordered",((e,{column:r,outBordered:l})=>{if(!l)return e;let s=0;return e.reduce(((l,i,a)=>{const p=2*(i.elem_width||3);return s+=p,s===r&&a<e.length-1?(s=0,l.push(i),l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0})):s>r?(s=p,l.push({val_key:`${t()}`,html_type:"LINE_BREAKS",lineBreaksBorder:!0}),l.push(i)):(o(l)&&(o(l).fieldItemBorder=!0),l.push(i)),l}),[])})),a.tap("__prefix/suffix",(e=>{const t=[];return r(e,(l=>{["prefix","suffix"].forEach((o=>{const i=l[o];if(!s(i))return;const a=i.match("#{(.+)}");if(!a)return;const p=s(a[1])&&function(t){let l=null;return r(e,((e,r)=>{e.val_key===t&&(l=e,r())}),["children","properties"]),l}(a[1].trim());p&&(Reflect.deleteProperty(l,o),l[`${o}Config`]=l[`${o}Config`]||[],l[`${o}Config`].push(p),t.push(p))}))}),["children","properties"]),t.length?function e(r){return r.reduce(((r,l)=>(t.includes(l)||(r.push(l),l.properties&&(l.properties=e(l.properties)),l.children&&(l.children=e(l.children))),r)),[])}(e):e})),{FieldNormalizeWaterfallHook:p,FieldListNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
@@ -1 +1 @@
1
- import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionFormGlobalProps as j}from"../constants/index.js";import{useFormRenderLifeCycle as C}from"./useFormRenderLifeCycle.js";import{usePresetScope as v}from"./usePresetScope.js";import{useBusinessBinding as x}from"./useBusinessBinding.js";import{useChangeContext as y}from"./useChangeContext.js";import{useFormItemDeps as q}from"./useFormItemDeps.js";function g(g,F){const{callLifeCycle:R}=C(g),b=s(o((()=>g.requestInstance)),o((()=>!!g.uniqueCacheData))).create(g.parallelism,{beforeRequest:(...e)=>R("beforeRequest",e)||e[1],afterRequest:(...e)=>R("afterRequest",e)||n(e[1])});t(u,b);const D=i({components:{...m,...g.components},scope:Object.assign({},v(),g.scope)}).SchemaField;t(c,D);const I=x().create(g.businessFormatter);t(p,I);const S=y().create();t(l,S);const k=q().create();t(f,k);const B=g.uuid||e();return t(d,B),t(h,o({get:()=>g.annotation?r(g.annotation):null,set(e){if(!a(g.annotation)||!a(e))return;const o=g.annotation[e.property];g.annotation[e.property]=e.value,F("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,g),{asyncQueue:b,SchemaField:D,businessCollector:I,changeContextCollector:S,formItemDepsCollector:k,formUUID:B}}export{g as useFormContext};
1
+ import{uuidGenerator as e}from"../../../../shared/utils/index.js";import"lodash-es";import"naive-ui";import{computed as o,provide as t,readonly as r}from"vue";import"@vueuse/core";import"date-fns";import{useFormAsyncQueue as s,presetRequestHandler as n}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{createSchemaField as i}from"@formily/vue";import{isObject as a}from"@vue/shared";import"../../index.js";import m from"../components/renderer/index.js";import{InjectionAsyncQueue as u,InjectionSchemaField as c,InjectionBusinessCollector as p,InjectionChangeContextCollector as l,InjectionFormItemDepsCollector as f,InjectionFormUUID as d,InjectionAnnotation as h,InjectionAnnotationShortcuts as j,InjectionFormGlobalProps as C}from"../constants/index.js";import{useFormRenderLifeCycle as v}from"./useFormRenderLifeCycle.js";import{usePresetScope as x}from"./usePresetScope.js";import{useBusinessBinding as y}from"./useBusinessBinding.js";import{useChangeContext as q}from"./useChangeContext.js";import{useFormItemDeps as g}from"./useFormItemDeps.js";function F(F,R){const{callLifeCycle:b}=v(F),S=s(o((()=>F.requestInstance)),o((()=>!!F.uniqueCacheData))).create(F.parallelism,{beforeRequest:(...e)=>b("beforeRequest",e)||e[1],afterRequest:(...e)=>b("afterRequest",e)||n(e[1])});t(u,S);const D=i({components:{...m,...F.components},scope:Object.assign({},x(),F.scope)}).SchemaField;t(c,D);const I=y().create(F.businessFormatter);t(p,I);const k=q().create();t(l,k);const B=g().create();t(f,B);const L=F.uuid||e();return t(d,L),t(h,o({get:()=>F.annotation?r(F.annotation):null,set(e){if(!a(F.annotation)||!a(e))return;const o=F.annotation[e.property];F.annotation[e.property]=e.value,R("annotationChange",{fieldKey:e.property,value:e.value,oldValue:o})}})),t(j,o((()=>F.annotationShortcuts))),t(C,F),{asyncQueue:S,SchemaField:D,businessCollector:I,changeContextCollector:k,formItemDepsCollector:B,formUUID:L}}export{F as useFormContext};
@@ -3,6 +3,7 @@ import { AnyObject, LowCodeTypes, UndefinedAble } from '../../../../shared/types
3
3
  import { DataField, Field, Form, GeneralField } from '@formily/core';
4
4
  import { ISchema } from '@formily/json-schema/esm/types';
5
5
  import { Component, FunctionalComponent } from 'vue';
6
+ import { AnnotationItem } from '../../../../components/annotation-edit/src/type';
6
7
  import { FIELD_BUSINESS_TYPE } from '../../../../components/form-render/src/constants';
7
8
  import { FieldItem } from '../types';
8
9
  export * from './fieldItem';
@@ -134,7 +135,8 @@ export declare type FormRenderProps = Partial<{
134
135
  schema: ISchema;
135
136
  components: Record<string, Component | FunctionalComponent>;
136
137
  scope: AnyObject;
137
- annotation: AnyObject;
138
+ annotation: Record<string, AnnotationItem>;
139
+ annotationShortcuts: Exclude<NonNullable<AnnotationItem>, string>['shortcuts'];
138
140
  consumer: boolean;
139
141
  uuid: string;
140
142
  lifeCycle: FormRenderLifeCycle;
@@ -1 +1 @@
1
- import{COMPONENT_NAMESPACE as s}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import{once as t}from"lodash-es";import r from"./src/IhoTable.vue.js";import e from"./src/plugins/index.js";import"vue";import"./src/constants/index.js";import"@vueuse/shared";import"date-fns";import"./src/utils/separateMap.js";import"../../shared/utils/tapable/SyncHook.js";import"../../shared/utils/tapable/Hook.js";import"../../shared/utils/tapable/SyncWaterfallHook.js";import"../../shared/utils/tapable/AsyncParallelHook.js";import"../../shared/utils/tapable/AsyncSeriesHook.js";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./src/types/pluginType.js";import{useTablePlugin as a}from"./src/hooks/useTablePlugin.js";export{defineTablePlugin}from"./src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./src/hooks/useColumnConfigAdaptor.js";const{use:i}=a(),l=t((s=>{i(Object.values(e).map((s=>s())),s)})),p=r;p.install=function(t){o(t,p,s+"IhoTable")};export{p as default,l as useIhoTablePresetPlugins,a as useTablePlugin};
1
+ import{COMPONENT_NAMESPACE as s}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import{once as t}from"lodash-es";import a from"./src/IhoTable.vue.js";import e from"./src/plugins/index.js";import"vue";import"./src/constants/index.js";import"@vueuse/shared";import"date-fns";import"./src/utils/separateMap.js";import"../../shared/utils/tapable/SyncHook.js";import"../../shared/utils/tapable/SyncBailHook.js";import"../../shared/utils/tapable/SyncWaterfallHook.js";import"../../shared/utils/tapable/SyncLoopHook.js";import"../../shared/utils/tapable/AsyncParallelHook.js";import"../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../shared/utils/tapable/AsyncSeriesHook.js";import"../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./src/types/pluginType.js";import{useTablePlugin as r}from"./src/hooks/useTablePlugin.js";export{defineTablePlugin,useTablePlugin}from"./src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./src/hooks/useColumnConfigAdaptor.js";const{use:l}=r(),i=t((s=>{l(Object.values(e).map((s=>s())),s)})),p=a;p.install=function(t){o(t,p,s+"IhoTable")};export{p as default,i as useIhoTablePresetPlugins};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import o from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractConfigHooks as n}from"../../types/pluginType.js";class t extends n{constructor(){super(...arguments),this.config=new o(["config","context"]),this.rowConfig=new o(["rowConfig","config","context"]),this.editConfig=new o(["editConfig","config","context"]),this.columnConfig=new o(["columnConfig","config","context"]),this.resizableConfig=new o(["resizableConfig","config","context"]),this.seqConfig=new o(["seqConfig","config","context"]),this.sortConfig=new o(["sortConfig","config","context"]),this.filterConfig=new o(["filterConfig","config","context"]),this.radioConfig=new o(["radioConfig","config","context"]),this.checkboxConfig=new o(["checkboxConfig","config","context"]),this.expandConfig=new o(["expandConfig","config","context"]),this.treeConfig=new o(["treeConfig","config","context"]),this.mouseConfig=new o(["mouseConfig","config","context"]),this.menuConfig=new o(["menuConfig","config","context"]),this.keyboardConfig=new o(["keyboardConfig","config","context"]),this.scrollY=new o(["scrollY","config","context"]),this.scrollX=new o(["scrollX","config","context"]),this.editRules=new o(["editRules","config","context"])}}function i(){return{create:function(){return new t}}}export{i as useConfigHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import o from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractConfigHooks as n}from"../../types/pluginType.js";class e extends n{constructor(){super(...arguments),this.config=new o(["config","context"]),this.rowConfig=new o(["rowConfig","config","context"]),this.editConfig=new o(["editConfig","config","context"]),this.columnConfig=new o(["columnConfig","config","context"]),this.resizableConfig=new o(["resizableConfig","config","context"]),this.seqConfig=new o(["seqConfig","config","context"]),this.sortConfig=new o(["sortConfig","config","context"]),this.filterConfig=new o(["filterConfig","config","context"]),this.radioConfig=new o(["radioConfig","config","context"]),this.checkboxConfig=new o(["checkboxConfig","config","context"]),this.expandConfig=new o(["expandConfig","config","context"]),this.treeConfig=new o(["treeConfig","config","context"]),this.mouseConfig=new o(["mouseConfig","config","context"]),this.menuConfig=new o(["menuConfig","config","context"]),this.keyboardConfig=new o(["keyboardConfig","config","context"]),this.scrollY=new o(["scrollY","config","context"]),this.scrollX=new o(["scrollX","config","context"]),this.editRules=new o(["editRules","config","context"])}}function t(){return{create:function(){return new e}}}export{t as useConfigHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import t from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import a from"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractDataHooks as e}from"../../types/pluginType.js";class o extends e{constructor(){super(...arguments),this.dataStart=new t(["config"]),this.data=new a(["rowData","context","config"]),this.dataEnd=new t(["config"])}}function r(){return{create:function(){return new o}}}export{r as useDataHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import t from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import a from"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractDataHooks as s}from"../../types/pluginType.js";class o extends s{constructor(){super(...arguments),this.dataStart=new t(["config"]),this.data=new a(["rowData","context","config"]),this.dataEnd=new t(["config"])}}function e(){return{create:function(){return new o}}}export{e as useDataHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import e from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractDomInsertHooks as t}from"../../types/pluginType.js";class s extends t{constructor(){super(...arguments),this.header=new e(["nodes"]),this.footer=new e(["nodes"])}}function o(){return{create:function(){return new s}}}export{o as useDomInsertHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import s from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractDomInsertHooks as e}from"../../types/pluginType.js";class o extends e{constructor(){super(...arguments),this.header=new s(["nodes"]),this.footer=new s(["nodes"])}}function t(){return{create:function(){return new o}}}export{t as useDomInsertHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import e from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{getCurrentInstance as n,onMounted as t,onBeforeUnmount as o,provide as i}from"vue";import{InjectionIhoTableEventListener as c}from"../../constants/index.js";import{AbstractEventHooks as l}from"../../types/pluginType.js";class s extends l{constructor(){super(...arguments),this.onKeydownStart=new e(["event","context","config"]),this.onKeydown=new e(["event","context","config"]),this.onKeydownEnd=new e(["event","context","config"]),this.onPaste=new e(["event","context","config"]),this.onCopy=new e(["event","context","config"]),this.onCut=new e(["event","context","config"]),this.onCurrentChange=new e(["event","context","config"]),this.onRadioChange=new e(["event","context","config"]),this.onCheckboxChange=new e(["event","context","config"]),this.onCheckboxAll=new e(["event","context","config"]),this.onCheckboxRangeStart=new e(["event","context","config"]),this.onCheckboxRangeChange=new e(["event","context","config"]),this.onCheckboxRangeEnd=new e(["event","context","config"]),this.onCellClick=new e(["event","context","config"]),this.onCellDblclick=new e(["event","context","config"]),this.onCellMenu=new e(["event","context","config"]),this.onCellMouseenter=new e(["event","context","config"]),this.onCellMouseleave=new e(["event","context","config"]),this.onHeaderCellClick=new e(["event","context","config"]),this.onHeaderCellDblclick=new e(["event","context","config"]),this.onHeaderCellMenu=new e(["event","context","config"]),this.onFooterCellClick=new e(["event","context","config"]),this.onFooterCellDblclick=new e(["event","context","config"]),this.onFooterCellMenu=new e(["event","context","config"]),this.onSortChange=new e(["event","context","config"]),this.onFilterChange=new e(["event","context","config"]),this.onFilterVisible=new e(["event","context","config"]),this.onResizableChange=new e(["event","context","config"]),this.onToggleRowExpand=new e(["event","context","config"]),this.onToggleTreeExpand=new e(["event","context","config"]),this.onMenuClick=new e(["event","context","config"]),this.onEditClosed=new e(["event","context","config"]),this.onEditActived=new e(["event","context","config"]),this.onEditDisabled=new e(["event","context","config"]),this.onValidError=new e(["event","context","config"]),this.onScroll=new e(["event","context","config"]),this.onCustom=new e(["event","context","config"]),this.onOpenFnr=new e(["event","context","config"]),this.onFnrChange=new e(["event","context","config"]),this.onFnrFind=new e(["event","context","config"]),this.onFnrFindAll=new e(["event","context","config"]),this.onFnrReplace=new e(["event","context","config"]),this.onFnrReplaceAll=new e(["event","context","config"]),this.onCellAreaCopy=new e(["event","context","config"]),this.onCellAreaCut=new e(["event","context","config"]),this.onCellAreaPaste=new e(["event","context","config"]),this.onCellAreaMerge=new e(["event","context","config"]),this.onClearCellAreaMerge=new e(["event","context","config"]),this.onHeaderCellAreaSelection=new e(["event","context","config"]),this.onCellAreaSelectionStart=new e(["event","context","config"]),this.onCellAreaSelectionDrag=new e(["event","context","config"]),this.onCellAreaSelectionEnd=new e(["event","context","config"]),this.onCellAreaExtensionStart=new e(["event","context","config"]),this.onCellAreaExtensionDrag=new e(["event","context","config"]),this.onCellAreaExtensionEnd=new e(["event","context","config"]),this.onCellAreaArrowsStart=new e(["event","context","config"]),this.onCellAreaArrowsEnd=new e(["event","context","config"]),this.onActiveCellChangeStart=new e(["event","context","config"]),this.onActiveCellChangeEnd=new e(["event","context","config"]),this.onCellAreaSelectionAllStart=new e(["event","context","config"]),this.onCellAreaSelectionAllEnd=new e(["event","context","config"]),this.onPageChange=new e(["event","context","config"])}}function r(){return{create:function(){return new s}}}class a{constructor(){this.eventMap=new Map}addEventListener(e,i){if(!n())throw new Error("addEventListener can only used in setup environment!");const c=this.eventMap.get(e)||new Set;this.eventMap.set(e,c),t((()=>c.add(i))),o((()=>c.delete(i)))}trigger(e,...n){var t;null==(t=this.eventMap.get(e))||t.forEach((e=>{e(...n)}))}}function h(){if(!n())throw new Error("provideIhoTableEventListener can only used in setup environment!");const e=new a;return i(c,e),e}export{a as IhoTableEventListener,h as provideIhoTableEventListener,r as useEventHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import e from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{getCurrentInstance as n,onMounted as t,onBeforeUnmount as o,provide as i}from"vue";import{InjectionIhoTableEventListener as c}from"../../constants/index.js";import{AbstractEventHooks as s}from"../../types/pluginType.js";class l extends s{constructor(){super(...arguments),this.onKeydownStart=new e(["event","context","config"]),this.onKeydown=new e(["event","context","config"]),this.onKeydownEnd=new e(["event","context","config"]),this.onPaste=new e(["event","context","config"]),this.onCopy=new e(["event","context","config"]),this.onCut=new e(["event","context","config"]),this.onCurrentChange=new e(["event","context","config"]),this.onRadioChange=new e(["event","context","config"]),this.onCheckboxChange=new e(["event","context","config"]),this.onCheckboxAll=new e(["event","context","config"]),this.onCheckboxRangeStart=new e(["event","context","config"]),this.onCheckboxRangeChange=new e(["event","context","config"]),this.onCheckboxRangeEnd=new e(["event","context","config"]),this.onCellClick=new e(["event","context","config"]),this.onCellDblclick=new e(["event","context","config"]),this.onCellMenu=new e(["event","context","config"]),this.onCellMouseenter=new e(["event","context","config"]),this.onCellMouseleave=new e(["event","context","config"]),this.onHeaderCellClick=new e(["event","context","config"]),this.onHeaderCellDblclick=new e(["event","context","config"]),this.onHeaderCellMenu=new e(["event","context","config"]),this.onFooterCellClick=new e(["event","context","config"]),this.onFooterCellDblclick=new e(["event","context","config"]),this.onFooterCellMenu=new e(["event","context","config"]),this.onSortChange=new e(["event","context","config"]),this.onFilterChange=new e(["event","context","config"]),this.onFilterVisible=new e(["event","context","config"]),this.onResizableChange=new e(["event","context","config"]),this.onToggleRowExpand=new e(["event","context","config"]),this.onToggleTreeExpand=new e(["event","context","config"]),this.onMenuClick=new e(["event","context","config"]),this.onEditClosed=new e(["event","context","config"]),this.onEditActived=new e(["event","context","config"]),this.onEditDisabled=new e(["event","context","config"]),this.onValidError=new e(["event","context","config"]),this.onScroll=new e(["event","context","config"]),this.onCustom=new e(["event","context","config"]),this.onOpenFnr=new e(["event","context","config"]),this.onFnrChange=new e(["event","context","config"]),this.onFnrFind=new e(["event","context","config"]),this.onFnrFindAll=new e(["event","context","config"]),this.onFnrReplace=new e(["event","context","config"]),this.onFnrReplaceAll=new e(["event","context","config"]),this.onCellAreaCopy=new e(["event","context","config"]),this.onCellAreaCut=new e(["event","context","config"]),this.onCellAreaPaste=new e(["event","context","config"]),this.onCellAreaMerge=new e(["event","context","config"]),this.onClearCellAreaMerge=new e(["event","context","config"]),this.onHeaderCellAreaSelection=new e(["event","context","config"]),this.onCellAreaSelectionStart=new e(["event","context","config"]),this.onCellAreaSelectionDrag=new e(["event","context","config"]),this.onCellAreaSelectionEnd=new e(["event","context","config"]),this.onCellAreaExtensionStart=new e(["event","context","config"]),this.onCellAreaExtensionDrag=new e(["event","context","config"]),this.onCellAreaExtensionEnd=new e(["event","context","config"]),this.onCellAreaArrowsStart=new e(["event","context","config"]),this.onCellAreaArrowsEnd=new e(["event","context","config"]),this.onActiveCellChangeStart=new e(["event","context","config"]),this.onActiveCellChangeEnd=new e(["event","context","config"]),this.onCellAreaSelectionAllStart=new e(["event","context","config"]),this.onCellAreaSelectionAllEnd=new e(["event","context","config"]),this.onPageChange=new e(["event","context","config"])}}function r(){return{create:function(){return new l}}}class a{constructor(){this.eventMap=new Map}addEventListener(e,i){if(!n())throw new Error("addEventListener can only used in setup environment!");const c=this.eventMap.get(e)||new Set;this.eventMap.set(e,c),t((()=>c.add(i))),o((()=>c.delete(i)))}trigger(e,...n){var t;null==(t=this.eventMap.get(e))||t.forEach((e=>{e(...n)}))}}function h(){if(!n())throw new Error("provideIhoTableEventListener can only used in setup environment!");const e=new a;return i(c,e),e}export{a as IhoTableEventListener,h as provideIhoTableEventListener,r as useEventHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import e from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractExposeHooks as t}from"../../types/pluginType.js";class s extends t{constructor(){super(...arguments),this.expose=new e(["expose","config","context"])}}function o(){return{create:function(){return new s}}}export{o as useExposeHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import s from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractExposeHooks as e}from"../../types/pluginType.js";class o extends e{constructor(){super(...arguments),this.expose=new s(["expose","config","context"])}}function t(){return{create:function(){return new o}}}export{t as useExposeHooks};
@@ -1 +1 @@
1
- import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import t from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import e from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractFieldHooks as o}from"../../types/pluginType.js";class i extends o{constructor(){super(...arguments),this.fieldStart=new e(["config","context"]),this.field=new t(["fieldItem","context","config","tableContext"]),this.fieldList=new t(["fieldList","config","context"]),this.fieldEnd=new e(["config","context"])}}function s(){return{create:function(){return new i}}}export{s as useFieldHooks};
1
+ import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import t from"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import e from"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractFieldHooks as s}from"../../types/pluginType.js";class o extends s{constructor(){super(...arguments),this.fieldStart=new e(["config","context"]),this.field=new t(["fieldItem","context","config","tableContext"]),this.fieldList=new t(["fieldList","config","context"]),this.fieldEnd=new e(["config","context"])}}function i(){return{create:function(){return new o}}}export{i as useFieldHooks};
@@ -1 +1 @@
1
- import t from"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/Hook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import{AbstractSetupHooks as e}from"../../types/pluginType.js";class s extends e{constructor(){super(...arguments),this.setup=new t(["config","fieldList","context"])}}function o(){return{create:function(){return new s}}}export{o as useSetupHooks};
1
+ import s from"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractSetupHooks as t}from"../../types/pluginType.js";class e extends t{constructor(){super(...arguments),this.setup=new s(["config","fieldList","context"])}}function o(){return{create:function(){return new e}}}export{o as useSetupHooks};
@@ -1 +1 @@
1
- import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as a}from"../utils/index.js";import{defineTablePlugin as n}from"../hooks/useTablePlugin.js";function l(){const l="defaultValuePlugin",o=new Map([[t.TIME,({defaultValue:t,valueFormat:a="HH:mm"})=>"current"===t?e(Date.now(),a):t],[t.DATE,({defaultValue:t,valueFormat:a="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),a):t]]);function u(e){var t;const n=a(e);if(!n||null==n.defaultValue)return null;const l=null==(t=e.editRender)?void 0:t.name,u=l&&o.get(l);return u?u(n):n.defaultValue}return n({name:l,apply(e){const t=Object.freeze([]);let a=t;e.fieldHooks.field.tap(l,(e=>(e.editRender={defaultValue:({column:e})=>u(e),...e.editRender},e))),e.fieldHooks.fieldList.tap(l,(e=>a=e)),e.dataHooks.data.tap(l,(e=>{a.length&&a.forEach((t=>{if(null!=e[t.field])return;const a=u(t);null!=a&&(e[t.field]=a)}))})),e.dataHooks.dataEnd.tap(l,(()=>a=t))}})}export{l as defaultValuePlugin};
1
+ import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as n}from"../utils/index.js";import{defineTablePlugin as u}from"../hooks/useTablePlugin.js";function l(){const l="defaultValuePlugin",a=new Map([[t.TIME,({defaultValue:t,valueFormat:n="HH:mm"})=>"current"===t?e(Date.now(),n):t],[t.DATE,({defaultValue:t,valueFormat:n="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),n):t]]);return u({name:l,apply(e){e.fieldHooks.field.tap(l,(e=>(e.editRender={defaultValue:({column:e})=>function(e){var t;const u=n(e);if(!u||null==u.defaultValue)return null;const l=null==(t=e.editRender)?void 0:t.name,o=l&&a.get(l);return o?o(u):u.defaultValue}(e),...e.editRender},e)))}})}export{l as defaultValuePlugin};
@@ -1 +1 @@
1
- import{inject as e,createVNode as t}from"vue";import{arrayed as l,widthAppend as n}from"../../../../shared/utils/index.js";import{isObject as o,isString as a,isFunction as i}from"lodash-es";import r from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as s,InjectionIhoTableConfig as u}from"../constants/index.js";import{getLowCodeFieldFromField as d,IhoTableRenderHelper as m}from"../utils/index.js";import{defineTablePlugin as c}from"../hooks/useTablePlugin.js";function p(){const p="headerPlugin";return c({name:p,apply(c){c.fieldHooks.field.tap(p,(c=>{var p;const f=null==(p=c.slots)?void 0:p.header;return c.slots={...c.slots,header:p=>function(d,c,p){var f;const h=e(s),v=e(u),x=e("$xetable"),b=d.column||{},j=o(null==h?void 0:h.value)&&!1!==c.annotation,g=m.isEditableColumn(v.value,b),w=m.hasFilter(c)||m.hasDateFiler(c),W=null==(f=c.titlePrefix)?void 0:f.content,y=a(p)?p:i(p)?p(d):null;let D=!1;if(v.value){const e=v.value.editRules&&v.value.editRules[b.field];e&&(D=l(e).some((e=>e.required)))}const M=v.value.border?Math.max(2,Math.ceil(x.reactData.scrollbarWidth/x.reactData.tableColumn.length)):1,P=n(Math.max(0,b.renderWidth-20-M-(D?14:0)-(j?18:0)-(w?23:0)-(g?22:0)-(W?20:0)-(b.sortable?23:0)));return t("section",{class:"iho-table__headerWrapper"},[t("section",{style:{width:P}},[null!=y?y:t("div",{style:{maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const e=b.title,l=/\\n|\n|\r/g;if(!l.test(e))return e;const n=e.replace(l,"<br>").split("<br>");return n.map(((e,l)=>[e,l===n.length-1?null:t("br",null,null)]))}()])]),j?t(r,{modelValue:h.value[b.field],"onUpdate:modelValue":e=>h.value[b.field]=e},null):null])}(p,d(c),f)},c}))}})}export{p as default};
1
+ import{useAttrs as t,onBeforeUnmount as e,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as c,IhoTableRenderHelper as p}from"../utils/index.js";import{defineTablePlugin as h}from"../hooks/useTablePlugin.js";function f(){const f="headerPlugin";return h({name:f,apply(h){let v=null;h.setupHooks.setup.tap(f,(()=>{v=t(),e((()=>{v=null}))})),h.fieldHooks.field.tap(f,(t=>{var e;const h=null==(e=t.slots)?void 0:e.header;return t.slots={...t.slots,header:e=>function(t,e,c){var h;const f=l(d),x=l(m),b=l("$xetable"),j=t.column||{},g=r(null==f?void 0:f.value)&&!1!==e.annotation,w=p.isEditableColumn(x.value,j),W=p.hasFilter(e)||p.hasDateFiler(e),k=null==(h=e.titlePrefix)?void 0:h.content,y=i(c)?c:s(c)?c(t):null;let D=!1;if(x.value){const t=x.value.editRules&&x.value.editRules[j.field];t&&(D=n(t).some((t=>t.required)))}const M=x.value.border?Math.max(2,Math.ceil(b.reactData.scrollbarWidth/b.reactData.tableColumn.length)):1,P=a(Math.max(0,j.renderWidth-20-M-(D?14:0)-(g?18:0)-(W?23:0)-(w?22:0)-(k?20:0)-(j.sortable?23:0)));return o("section",{class:"iho-table__headerWrapper"},[o("section",{style:{width:P}},[null!=y?y:o("div",{style:{maxWidth:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const t=j.title,e=/\\n|\n|\r/g;if(!e.test(t))return t;const l=t.replace(e,"<br>").split("<br>");return l.map(((t,e)=>[t,e===l.length-1?null:o("br",null,null)]))}()])]),g?o(u,{modelValue:f.value[j.field],"onUpdate:modelValue":t=>f.value[j.field]=t,shortcuts:v&&(v["annotation-shortcuts"]||v.annotationShortcuts)||[]},null):null])}(e,c(t),h)},t}))}})}export{f as default};
@@ -1 +1 @@
1
- import{reactive as e,inject as o,createVNode as t,mergeProps as l,onBeforeUnmount as n}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as C,selectOptionsMap as E}from"../hooks/useSelectOption.js";import{cloneDeep as g,isEqual as h}from"lodash-es";import{defineTablePlugin as y}from"../../../../hooks/useTablePlugin.js";function b(){const b="selectRendererPlugin",x=e(new Map);function k(e){return!0===e||"1"===e}return y({name:b,vxe(e){e.interceptor.add("event.clearActived",u(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:l,column:n,$table:r}){var d;const u=o(s),c=C(u,n.field,l,r),p=m(l,e,c),f=i(p).join(","),v=e&&(k(e.variableHeight)||(null==(d=e.componentProps)?void 0:d.indexedText));return[t("span",{title:a(n,f),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",t("br",null,null)]),e)),[]):f])]},renderEdit:c.createRenderEdit((({fieldItem:e,emitFormClick:n,row:i,column:r,$rowIndex:d,$table:u})=>{var a,c,p,m;const v=o(s),w=C(v,r.field,i,u),E=k(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),g=k(null!=(m=null==(p=e.componentProps)?void 0:p.allowCreate)?m:e.allowCreate)||E;return[t(f,l({queryOptions:e.queryOptions},e.componentProps,{options:w,column:r,row:i,"row-index":d,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:E,allowCreate:g,onClick:n}),null)]}))})},apply(e){async function o(e,o={}){var t,l,n;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=w(i.options)||w(null==(l=i.componentProps)?void 0:l.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(n=i.queryOptions)?void 0:n.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}d(e).bindAutoFocusConfig(b,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(b,((e,{uuid:t})=>{if(t){E.get(t)||E.set(t,{}),x.set(t,g(e));const l=E.get(t);e.forEach((async t=>{var n;const i=null==(n=t.editRender)?void 0:n.props;t.field&&i&&"SELECT"===p.getCellType(i)&&(l[t.field]||v(e,t.field)||(l[t.field]=[],l[t.field]=await o(t)))}))}return e})),e.dataHooks.data.tap(b,((e,{uuid:t},l)=>{if(!t)return;const n=x.get(t);if(!n||!n.length)return;const i=E.get(t);n.forEach((async t=>{var l;const r=null==(l=t.editRender)?void 0:l.props;if(t.field&&r&&"SELECT"===p.getCellType(r)&&(null==r?void 0:r.connectField)){const l=r.connectField.split(","),s=e[r.columnName];l.forEach((async l=>{const d=null==n?void 0:n.find((e=>e.field===l));if(!d)return;const u=s?`${l}__${r.columnName}-${s}`:l;i[u]||(i[u]=[],i[u]=await o(d,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(b,(e=>{n((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(E.delete(t),x.delete(t))}))})),e.eventHooks.onCellDblclick.tap(b,(({$table:e},o,{emits:t})=>{var l;const{column:n,row:i}=e.reactData.editStore.actived;if(!n||!i)return;const s=null==(l=n.editRender)?void 0:l.props,{cellDblclickSelectable:d=!1,multiple:u=!1,valueField:a="value"}=s.componentProps||{};if(!d||!function(e){return e&&p.getCellType(e)===r.SELECT}(s))return;const c=o.uuid&&C(o.uuid,n.field,i,e);if(1!==(null==c?void 0:c.length))return;const f=u?[c[0][a]]:c[0][a],m=i[n.field];e.clearEdit(),h(f,m)||(i[n.field]=f,t("formChange",{column:n,row:i,oldValue:m,value:f,index:e.getRowIndex(i),$table:e,option:c[0]}))}))}})}export{b as selectRendererPlugin};
1
+ import{reactive as e,inject as o,createVNode as t,mergeProps as n,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as u}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as d,getTitle as a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as h,selectOptionsMap as b}from"../hooks/useSelectOption.js";import{cloneDeep as g,isFunction as y,isEqual as C}from"lodash-es";import{defineTablePlugin as E}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",k=e(new Map);function j(e){return!0===e||"1"===e}return E({name:x,vxe(e){e.interceptor.add("event.clearActived",d(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:n,column:l,$table:r}){var u;const d=o(s),c=h(d,l.field,n,r),p=m(n,e,c),f=i(p).join(","),v=e&&(j(e.variableHeight)||(null==(u=e.componentProps)?void 0:u.indexedText));return[t("span",{title:a(l,f),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",t("br",null,null)]),e)),[]):f])]},renderEdit:c.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:u,$table:d})=>{var a,c,p,m;const v=o(s),w=h(v,r.field,i,d),b=j(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),g=j(null!=(m=null==(p=e.componentProps)?void 0:p.allowCreate)?m:e.allowCreate)||b;return[t(f,n({queryOptions:e.queryOptions},e.componentProps,{options:w,column:r,row:i,"row-index":u,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:b,allowCreate:g,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var t,n,l;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=w(i.options)||w(null==(n=i.componentProps)?void 0:n.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}function t(e){return e&&p.getCellType(e)===r.SELECT}u(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(x,((e,{uuid:n})=>{if(n){b.get(n)||b.set(n,{}),k.set(n,g(e));const l=b.get(n);e.forEach((async n=>{var i;const r=null==(i=n.editRender)?void 0:i.props;if(n.field&&r&&t(r)&&!v(e,n.field)){if(y(r.queryOptions)&&l[n.field])return;l[n.field]=[],l[n.field]=await o(n)}}))}return e})),e.dataHooks.data.tap(x,((e,{uuid:n},l)=>{if(!n)return;const i=k.get(n);if(!i||!i.length)return;const r=b.get(n);i.forEach((async n=>{var l;const s=null==(l=n.editRender)?void 0:l.props;if(n.field&&s&&t(s)&&(null==s?void 0:s.connectField)){const t=s.connectField.split(","),l=e[s.columnName];t.forEach((async t=>{const u=null==i?void 0:i.find((e=>e.field===t));if(!u)return;const d=l?`${t}__${s.columnName}-${l}`:t;r[d]||(r[d]=[],r[d]=await o(u,{row:e,connectColumn:n}))}))}}))})),e.setupHooks.setup.tap(x,(e=>{l((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(b.delete(t),k.delete(t))}))})),e.eventHooks.onCellDblclick.tap(x,(({$table:e},o,{emits:n})=>{var l;const{column:i,row:r}=e.reactData.editStore.actived;if(!i||!r)return;const s=null==(l=i.editRender)?void 0:l.props,{cellDblclickSelectable:u=!1,multiple:d=!1,valueField:a="value"}=s.componentProps||{};if(!u||!t(s))return;const c=o.uuid&&h(o.uuid,i.field,r,e);if(1!==(null==c?void 0:c.length))return;const p=d?[c[0][a]]:c[0][a],f=r[i.field];e.clearEdit(),C(p,f)||(r[i.field]=p,n("formChange",{column:i,row:r,oldValue:f,value:p,index:e.getRowIndex(r),$table:e,option:c[0]}))}))}})}export{x as selectRendererPlugin};
@@ -1 +1 @@
1
- import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as l,findAncestor as u}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{parse as c,isValid as d,compareDesc as s}from"date-fns";import{isNumber as f,isFunction as p,isString as m,isObject as v,isArray as I}from"lodash-es";import{InjectionIhoTableConfig as h,InjectionIhoTableEmits as g,IHO_TABLE_STRING_STATUS as E,IHO_TABLE_NUMBER_STATUS as w,IHO_TABLE_TREE_TYPE as T,InjectionIhoTableUUID as R}from"../constants/index.js";import{getSeparateInfo as C}from"./separateMap.js";export{deleteSeparateInfo,setSeparateInfo}from"./separateMap.js";function S(e){return console.warn(`[IhoTable]: ${e}`)}const F=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function D(){var e,t,r;const o=n(h);return o||S("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function O(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function P(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function A(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function b(e,n,r,o,i=2){const l=function(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?p(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):f(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return f(l)&&l>0?l:i<=0?function(){const n=+e.colWidth;return f(n)?n:64}():(await a(0),b(e,n,r,o,i-1))}function $(e){const o=n(g);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const N=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(R),l=C(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:G(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...$(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(M(e))return!0;let n=e.fieldSetting;return m(n)&&(n=i(n||"")),v(n)&&((t=n).notParticipatingSearch!==E.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),V=Object.freeze({isPositive:e=>e===w.POSITIVE||e===E.POSITIVE,isNegative:e=>e===w.NEGATIVE||e===E.NEGATIVE,notPositive:e=>e!==w.POSITIVE&&e!==E.POSITIVE,notNegative:e=>e!==w.NEGATIVE&&e!==E.NEGATIVE}),W=(e,n)=>({$event:t,column:r})=>{var o;if(!l(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==t?void 0:t.target;return!v(i)||!u(i,n)};function _(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function U(e){return m(e)&&!!e.match(/^###\{[^{}]+}$/)}function j(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function y(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!m(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&m(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;U(r)&&(r=j(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const H=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===w.NEGATIVE&&H.includes(F.getCellType(e))&&I(e.options)&&e.options.length}function G(e,n=""){return"tooltip"!==e.showOverflow&&m(n)?n:""}function L(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},u=c(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!d(u)}function k(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!d(new Date(r))||m(l.connectField)&&n[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(n[l.connectField]))>0)}export{N as IhoTableRenderHelper,V as IhoTableStatusHelper,F as IhoTableUtils,S as IhoTableWarn,W as createIhoTableClearActivedInterceptor,O as eventListener2EventName,P as eventName2EventListener,b as getColumnRenderWidth,x as getLowCodeFieldFromField,D as getRowHeight,C as getSeparateInfo,G as getTitle,M as isCompatibleColumn,k as isInvalidDate,L as isInvalidTime,U as isRichContent,_ as isTransformTreeType,y as parseMergeField,j as parseRichContent,$ as useIhoTableFormEvent,A as useUUIDMap};
1
+ import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as l,findAncestor as u}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{parse as c,isValid as d,compareDesc as s}from"date-fns";import{isNumber as f,isFunction as p,isString as m,isObject as v,isArray as I}from"lodash-es";import{InjectionIhoTableConfig as g,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as E,IHO_TABLE_NUMBER_STATUS as w,IHO_TABLE_TREE_TYPE as T,InjectionIhoTableUUID as R}from"../constants/index.js";import{getSeparateInfo as S}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const F=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function D(){var e,t,r;const o=n(g);return o||C("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function O(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function P(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function A(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function b(e,n,r,o,i=2){const l=function(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?p(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):f(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return f(l)&&l>0?l:i<=0?function(){const n=+e.colWidth;return f(n)?n:64}():(await a(0),b(e,n,r,o,i-1))}function $(e){const o=n(h);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const N=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(R),l=S(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:G(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...$(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(M(e))return!0;let n=e.fieldSetting;return m(n)&&(n=i(n||"")),v(n)&&((t=n).notParticipatingSearch!==E.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),V=Object.freeze({isPositive:e=>e===w.POSITIVE||e===E.POSITIVE,isNegative:e=>e===w.NEGATIVE||e===E.NEGATIVE,notPositive:e=>e!==w.POSITIVE&&e!==E.POSITIVE,notNegative:e=>e!==w.NEGATIVE&&e!==E.NEGATIVE}),W=(e,n)=>({$event:t,column:r})=>{var o;if(!l(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==t?void 0:t.target;return!v(i)||!u(i,n)};function _(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function U(e){return m(e)&&!!e.match(/^###\{[^{}]+}$/)}function j(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function y(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!m(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&m(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;U(r)&&(r=j(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const H=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===w.NEGATIVE&&H.includes(F.getCellType(e))&&I(e.options)&&e.options.length}function G(e,n=""){return"tooltip"!==e.showOverflow&&m(n)?n:""}function L(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},u=c(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!d(u)}function k(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!d(new Date(r))||m(l.connectField)&&n[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(n[l.connectField]))>0)}export{N as IhoTableRenderHelper,V as IhoTableStatusHelper,F as IhoTableUtils,C as IhoTableWarn,W as createIhoTableClearActivedInterceptor,O as eventListener2EventName,P as eventName2EventListener,b as getColumnRenderWidth,x as getLowCodeFieldFromField,D as getRowHeight,G as getTitle,M as isCompatibleColumn,k as isInvalidDate,L as isInvalidTime,U as isRichContent,_ as isTransformTreeType,y as parseMergeField,j as parseRichContent,$ as useIhoTableFormEvent,A as useUUIDMap};