cnhis-design-vue 3.2.4-release.3 → 3.2.4-release.5

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 (59) hide show
  1. package/es/components/biunique-chat/index.d.ts +37 -9
  2. package/es/components/biunique-chat/src/Index.vue.d.ts +37 -9
  3. package/es/components/biunique-chat/src/api/index.d.ts +1 -0
  4. package/es/components/biunique-chat/src/api/index.js +1 -1
  5. package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +36 -8
  6. package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
  7. package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +2 -1
  8. package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
  9. package/es/components/biunique-chat/src/components/ChatRecord.vue.d.ts +38 -8
  10. package/es/components/biunique-chat/src/components/ChatRecord.vue2.js +1 -1
  11. package/es/components/biunique-chat/src/utils/index.d.ts +1 -0
  12. package/es/components/biunique-chat/src/utils/index.js +1 -1
  13. package/es/components/biunique-chat/style/index.css +1 -1
  14. package/es/components/callback/src/components/render/popupMaps.d.ts +15 -0
  15. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  16. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  17. package/es/components/form-config/index.d.ts +36 -0
  18. package/es/components/form-config/src/FormConfig.vue.d.ts +36 -0
  19. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +15 -0
  20. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +18 -0
  21. package/es/components/form-render/index.d.ts +15 -0
  22. package/es/components/form-render/src/FormRender.vue.d.ts +15 -0
  23. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  24. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +15 -0
  25. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  26. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
  27. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
  28. package/es/components/form-render/src/constants/index.d.ts +2 -1
  29. package/es/components/form-render/src/constants/index.js +1 -1
  30. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  31. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  32. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
  33. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  34. package/es/components/form-render/src/types/index.d.ts +1 -0
  35. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  36. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  37. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +1 -1
  38. package/es/components/iho-table/src/types/index.d.ts +1 -0
  39. package/es/components/index.css +1 -1
  40. package/es/components/info-header/index.d.ts +35 -0
  41. package/es/components/info-header/src/InfoHeader.vue.d.ts +35 -0
  42. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
  43. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
  44. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +16 -0
  45. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +15 -0
  46. package/es/components/shortcut-setter/index.d.ts +15 -0
  47. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -0
  48. package/es/components/tooth-bitmap/index.d.ts +4 -7
  49. package/es/components/tooth-bitmap/src/ToothBitmap.vue.d.ts +4 -7
  50. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  51. package/es/shared/hooks/useAsyncQueue/index.d.ts +1 -1
  52. package/es/shared/hooks/useFormRequest/index.d.ts +1 -0
  53. package/es/shared/hooks/useFormRequest/index.js +1 -1
  54. package/es/shared/hooks/useFormRequest/types.d.ts +2 -0
  55. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  56. package/es/shared/package.json.js +1 -1
  57. package/es/shared/utils/index.d.ts +1 -0
  58. package/es/shared/utils/index.js +1 -1
  59. package/package.json +2 -2
@@ -1 +1 @@
1
- import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as a,onUnmounted as s,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";import{renderDescOption as S}from"../utils/index.js";const j=e(new Map);function O(e,t,r=0){j.set(e,j.get(e)||{});j.get(e)[t+""]=r}function M(e,t,r=!0){const n=j.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function W(e,t){const r=j.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){j.delete(e)}const k=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const l=o(g),u=o(x),h=p(),y=o(l+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function j(e){return`${S}.${e}`}i(l+"_virtualParent",S);const{schemaAdaptor:$}=b(u);function k(t){var r,n,l,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,childWidthMode:null!=(o=null==(l=t["x-component-props"])?void 0:l.childWidthMode)?o:e.childWidthMode,size:"small"}})}const E=t((()=>{const t=$(e.fieldItems);return Object.values(t).forEach(k),F(t)}));a(E,(()=>{return e=E.value,void Object.values(e.properties||{}).forEach((e=>{var t;O(l,j(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const K=m();function P(){return e.fieldItems.map((e=>K.value.query(e.val_key).take()))}s((()=>{var e;P().forEach((e=>{e&&e.setDisplay("none")})),e=E.value,Object.values(e.properties||{}).forEach((e=>{W(l,j(e.name))}))})),d((()=>{P().forEach((e=>{e&&e.setDisplay("visible")}))}));const _=c(v,["stop"]),I=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=_,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=E.value,Object.values(e.properties||{}).reduce(((e,t)=>e+M(l,j(t.name))),0)),flex:"1"}},I),[r(f,{basePath:".",schema:E.value},null)]);var e}}});function E(e,l){u();const o=t((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(h(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:a="label",childFieldStrategy:s,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[function(){var e;const n=null!=(e=t.title)?e:t[a],l=r("span",{title:n},[t[a]]);return c?t.desc?S(l,t):l:null}(),o.value&&("all"===s||i(e,t,l))?r(k,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:s,childWidthMode:d},u),null):null]},valueRef:l,hasComplexOption:o}}function K(){return{getSpan:M,setSpan:O,deleteSpan:W,clearSpan:$}}export{E as useComplexOptions,K as useComplexOptionsSpan};
1
+ import{reactive as e,computed as t,createVNode as r,mergeProps as l,defineComponent as n,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";import{renderDescOption as S}from"../utils/index.js";const j=e(new Map);function O(e,t,r=0){j.set(e,j.get(e)||{});j.get(e)[t+""]=r}function M(e,t,r=!0){const l=j.get(e);return l?Object.entries(l).reduce(((e,[l,n])=>r&&l===`${t}`||l.startsWith(`${t}.`)?e+n:e),0):0}function W(e,t){const r=j.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){j.delete(e)}const E=n({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const n=o(g),u=o(x),h=p(),y=o(n+"_virtualParent",""),S=`${y?y+".":""}${h.value.address}`;function j(e){return`${S}.${e}`}i(n+"_virtualParent",S);const{schemaAdaptor:$}=b(u);function E(t){var r,l,n,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",isOptionChildField:!0},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(l=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?l:e.childFieldStrategy,childWidthMode:null!=(o=null==(n=t["x-component-props"])?void 0:n.childWidthMode)?o:e.childWidthMode,size:"small"}})}const K=t((()=>{const t=$(e.fieldItems);return Object.values(t).forEach(E),F(t)}));s(K,(()=>{return e=K.value,void Object.values(e.properties||{}).forEach((e=>{var t;O(n,j(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const P=m();function _(){return e.fieldItems.map((e=>P.value.query(e.val_key).take()))}a((()=>{var e;_().forEach((e=>{e&&e.setDisplay("none")})),e=K.value,Object.values(e.properties||{}).forEach((e=>{W(n,j(e.name))}))})),d((()=>{_().forEach((e=>{e&&e.setDisplay("visible")}))}));const k=c(v,["stop"]),C=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=k,e)),{});return()=>{return r("section",l({class:"form-render__labelField",style:{"--column":(e=K.value,Object.values(e.properties||{}).reduce(((e,t)=>e+M(n,j(t.name))),0)),flex:"1"}},C),[r(f,{basePath:".",schema:K.value},null)]);var e}}});function K(e,n){u();const o=t((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(h(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:n="value",labelKey:s="label",childFieldStrategy:a,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[function(){var e;const l=null!=(e=t.title)?e:t[s],n=r("span",{title:l},[t[s]]);return c?t.desc?S(n,t):n:null}(),o.value&&("all"===a||i(e,t,n))?r(E,l({fieldItems:t.childrenFields,name:t[n],childFieldStrategy:a,childWidthMode:d},u),null):null]},valueRef:n,hasComplexOption:o}}function P(){return{getSpan:M,setSpan:O,deleteSpan:W,clearSpan:$}}export{K as useComplexOptions,P as useComplexOptionsSpan};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{format as l}from"date-fns";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as c}from"./useFormValidator.js";import{transformDateFormat as d}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function u(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function f(e){return"1"===e||!0===e}function _(_,x){const{createValidatorSchema:h}=c(),b=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==x?void 0:x.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=h(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,r,l,s,a,p,c,d,_,x,h,g,v;const y=b(e);e.urlConfig?u(y,e):e.autograph&&m(y,e);const w=!!e.__multiple,C=f(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=f(null!=(l=null==(r=e.componentProps)?void 0:r.selectAll)?l:e.selectAll),A=f(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=f(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(_=null==(d=e.componentProps)?void 0:d.showField)?_:e.show_key,k=null!=(h=null==(x=e.componentProps)?void 0:x.options)?h:e.option,N=null!=(v=i(e.multi_select_value))?v:null==(g=e.componentProps)?void 0:g.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...n(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},v=e=>{var o,t;const n=b(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?u(n,e):e.autograph&&m(n,e),n},y=e=>{const t=b(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},w=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),C=new Map([["LINEBAR",w],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=b(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=b(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=b(e),{decimal_length:t,validate:n,allowSlash:r}=e;return!0!==r&&"1"!==r||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:i(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",g],["REMOTE_SEARCH",g],["DATE",e=>{const o=b(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:d(e.date_format),validate:e.validate}),"current"===o.default&&(o.default=l(new Date,e.date_format||"yyyy-MM-dd")),o}],["TIME",e=>{const o=b(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:d(e.date_format),validate:e.validate}),"current"===o.default&&(o.default=l(new Date,e.date_format||"HH:mm:ss")),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=b(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=b(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=b(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",v],["CHECKBOX",v],["SWITCH",e=>{const o=b(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=b(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=b(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?k(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),O=e=>{if(e.suffixConfig)return A(e);return(C.get(e.html_type)||y)(e)},A=o=>{if(!o.suffixConfig&&!o.prefixConfig)return O(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=b(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:k(n)}),i},{FieldNormalizeWaterfallHook:E,FieldListNormalizeWaterfallHook:j}=s();function k(o,n={column:9999}){let i=null;return j.call(t(o),n).reduce(((e,o,s)=>{var a;const p=null==(a=(o=E.call(o,n)).validate)?void 0:a.obj_type;return p&&_&&_.collect(p,t(o)),"LINEBAR"===o.html_type?(e[l(o)]=r(w(o),s),i=e[l(o)].properties={}):i?i[l(o)]=r(O(o),s):(i=null,e[l(o)]=r(O(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function l(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:k}}export{_ as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as i,formRenderLog as r}from"../utils/index.js";import{useFieldNormalize as l}from"./useFieldNormalize.js";import{fieldKeyEscape as s,createLinebarId as a}from"../utils/schema.js";import{useFormValidator as p}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function d(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function m(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(e){return"1"===e||!0===e}function f(f,_){const{createValidatorSchema:x}=p(),h=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==_?void 0:_.beforeSetValue,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=x(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},b=e=>{var o,t,r,l,s,a,p,c,f,_,x,b,g,v;const y=h(e);e.urlConfig?m(y,e):e.autograph&&d(y,e);const w=!!e.__multiple,C=u(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=u(null!=(l=null==(r=e.componentProps)?void 0:r.selectAll)?l:e.selectAll),A=u(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=u(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(_=null==(f=e.componentProps)?void 0:f.showField)?_:e.show_key,k=null!=(b=null==(x=e.componentProps)?void 0:x.options)?b:e.option,N=null!=(v=i(e.multi_select_value))?v:null==(g=e.componentProps)?void 0:g.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:E||C,shouldSave:A,showField:j,maxTagCount:N,selectAll:O,...n(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},g=e=>{var o,t;const n=h(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:"1"===i||!0===i}),e.urlConfig?m(n,e):e.autograph&&d(n,e),n},v=e=>{const t=h(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},y=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:"1"===e.is_not_fold,id:a(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),w=new Map([["LINEBAR",y],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=h(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=h(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=h(e),{decimal_length:t,validate:n,allowSlash:r}=e;return!0!==r&&"1"!==r||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:i(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",b],["REMOTE_SEARCH",b],["DATE",e=>{const o=h(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=h(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=h(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=h(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=h(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:"1"!==e.hide_title,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",g],["CHECKBOX",g],["SWITCH",e=>{const o=h(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=h(e);return Object.assign(o["x-component-props"],{step:i(e.step_length),max:i(e.max_length),min:i(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=h(e);Array.isArray(e.properties)&&r("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),C=e=>{if(e.suffixConfig)return O(e);return(w.get(e.html_type)||v)(e)},O=o=>{if(!o.suffixConfig&&!o.prefixConfig)return C(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:"1"})))],i=h(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:s(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...i["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),i},{FieldNormalizeWaterfallHook:A,FieldListNormalizeWaterfallHook:E}=l();function j(o,n={column:9999}){let i=null;return E.call(t(o),n).reduce(((e,o,s)=>{var a;const p=null==(a=(o=A.call(o,n)).validate)?void 0:a.obj_type;return p&&f&&f.collect(p,t(o)),"LINEBAR"===o.html_type?(e[l(o)]=r(y(o),s),i=e[l(o)].properties={}):i?i[l(o)]=r(C(o),s):(i=null,e[l(o)]=r(C(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function l(o){return o.suffixConfig?s([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{f as useFieldListAdaptor};
@@ -103,6 +103,7 @@ export declare function useFieldNormalize(): {
103
103
  linebarWidth: string | number;
104
104
  linebarDirection: "horizontal" | "vertical";
105
105
  linebarTextDirection: "horizontal" | "vertical";
106
+ autoWidth: number | boolean;
106
107
  }>], import("../../../../shared/utils/tapable").UnsetAdditionalOptions>;
107
108
  FieldListNormalizeWaterfallHook: SyncWaterfallHook<[FieldItem[], Partial<{
108
109
  fieldList: FieldItem[];
@@ -206,5 +207,6 @@ export declare function useFieldNormalize(): {
206
207
  linebarWidth: string | number;
207
208
  linebarDirection: "horizontal" | "vertical";
208
209
  linebarTextDirection: "horizontal" | "vertical";
210
+ autoWidth: number | boolean;
209
211
  }>], import("../../../../shared/utils/tapable").UnsetAdditionalOptions>;
210
212
  };
@@ -1 +1 @@
1
- import{arrayed as e,traverse as t}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{isString as o}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as r}from"../constants/index.js";import{FieldListFilter as a,findItemByValCondition as i,parseEnhanceText as s}from"../utils/index.js";import{transformDateFormat as _}from"../utils/business.js";function n(){const n=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({name:"__fieldAlias",before:"__labelPlacementOverwrite"},(e=>("BOTTOM"===e.inputBorder&&(e.bordered="underline"),e.title_h_layout&&(e.decoratorProps={...e.decoratorProps},"0"===e.title_h_layout?e.decoratorProps.labelPlacement="top":"1"===e.title_h_layout&&(e.decoratorProps.labelPlacement="left")),o(e.lineBarLayoutDirection)&&(e.linebarDirection=e.lineBarLayoutDirection.toLowerCase()),e))),p.tap("__labelPlacementOverwrite",((e,t)=>(t.labelPlacementOverwrite&&(e.decoratorProps={...e.decoratorProps,labelPlacement:void 0}),e))),p.tap("__time",(e=>("DATE"===e.html_type&&"time"===_(e.date_format)&&(e.html_type="TIME"),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:r.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:l,__multiple:o}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===l:o)),e}));const c=[[["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=>(c.some((([t,l])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=l))),e)));const m=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?([...m].some((([l,o])=>{if(!e(l).includes(t.html_type))return;const r=o.get(t.show_mode);return r&&r(t),!0})),t):t)),n.tap("__out_bordered",((e,{column:t,outBordered:l})=>e)),n.tap("__prefix/suffix",(e=>{const l=[];return t(e,(t=>{["prefix","suffix"].forEach((r=>{const a=t[r];if(!o(a))return;const s=a.match("#{(.+)}");if(!s)return;const _=o(s[1])&&i(e,(e=>e.val_key===s[1].trim()));_&&(Reflect.deleteProperty(t,r),t[`${r}Config`]=t[`${r}Config`]||[],t[`${r}Config`].push(_),l.push(_))}))}),["children","properties"]),l.length?a(e,(e=>l.includes(e))):e})),n.tap("__textEnhance",(e=>{const l=[];return t(e,(t=>{if("TEXT"!==t.html_type||!o(t.default_val))return;const r=s(t.default_val);t.__textEnhance=r,r.forEach((o=>{if("text"===o.type)return;const r=i(e,(e=>[e.name,e.val_key].includes(o.content)));r&&(Reflect.deleteProperty(t,"default_val"),l.push(r),o.content=r)}))}),["children","properties"]),a(e,(e=>l.includes(e)))})),{FieldNormalizeWaterfallHook:p,FieldListNormalizeWaterfallHook:n}}export{n as useFieldNormalize};
1
+ import{arrayed as e,traverse as t}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{format as a}from"date-fns";import{isString as r}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as o}from"../constants/index.js";import{FieldListFilter as _,findItemByValCondition as i,parseEnhanceText as s}from"../utils/index.js";import{transformDateFormat as n}from"../utils/business.js";function p(){const p=new l(["fieldList","props"]),u=new l(["fieldItem","props"]);u.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),u.tap({name:"__fieldAlias",before:"__labelPlacementOverwrite"},(e=>("BOTTOM"===e.inputBorder&&(e.bordered="underline"),e.title_h_layout&&(e.decoratorProps={...e.decoratorProps},"0"===e.title_h_layout?e.decoratorProps.labelPlacement="top":"1"===e.title_h_layout&&(e.decoratorProps.labelPlacement="left")),r(e.lineBarLayoutDirection)&&(e.linebarDirection=e.lineBarLayoutDirection.toLowerCase()),e))),u.tap("__labelPlacementOverwrite",((e,t)=>(t.labelPlacementOverwrite&&(e.decoratorProps={...e.decoratorProps,labelPlacement:void 0}),e))),u.tap("__time",(e=>("DATE"===e.html_type&&"time"===n(e.date_format)&&(e.html_type="TIME"),e))),u.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),u.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:o.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),u.tap({name:"__multiple_select",before:"__defaultValue"},(e=>{const{html_type:t,multi_select:l,__multiple:a}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===l:a)),e})),u.tap("__defaultValue",(e=>{switch(e.html_type){case"TIME":"current"===e.default_val&&(e.default_val=a(new Date,e.date_format||"HH:mm:ss"));break;case"DATE":"current"===e.default_val&&(e.default_val=a(new Date,e.date_format||"yyyy-MM-dd"));break;case"CHECKBOX":case"CHECKBOX_BLOCK":r(e.default_val)&&e.default_val&&(e.default_val=e.default_val.split(","));break;case"SELECT":case"SEARCH":case"SEARCH_MORE":r(e.default_val)&&e.default_val&&(e.default_val=e.__multiple?e.default_val.split(","):e.default_val)}return e}));const c=[[["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"]];u.tap("__normalize",(e=>(c.some((([t,l])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=l))),e)));const m=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 u.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...m].some((([l,a])=>{if(!e(l).includes(t.html_type))return;const r=a.get(t.show_mode);return r&&r(t),!0})),t):t)),p.tap("__out_bordered",((e,{column:t,outBordered:l})=>e)),p.tap("__prefix/suffix",(e=>{const l=[];return t(e,(t=>{["prefix","suffix"].forEach((a=>{const o=t[a];if(!r(o))return;const _=o.match("#{(.+)}");if(!_)return;const s=r(_[1])&&i(e,(e=>e.val_key===_[1].trim()));s&&(Reflect.deleteProperty(t,a),t[`${a}Config`]=t[`${a}Config`]||[],t[`${a}Config`].push(s),l.push(s))}))}),["children","properties"]),l.length?_(e,(e=>l.includes(e))):e})),p.tap("__textEnhance",(e=>{const l=[];return t(e,(t=>{if("TEXT"!==t.html_type||!r(t.default_val))return;const a=s(t.default_val);t.__textEnhance=a,a.forEach((a=>{if("text"===a.type)return;const r=i(e,(e=>[e.name,e.val_key].includes(a.content)));r&&(Reflect.deleteProperty(t,"default_val"),l.push(r),a.content=r)}))}),["children","properties"]),_(e,(e=>l.includes(e)))})),{FieldNormalizeWaterfallHook:u,FieldListNormalizeWaterfallHook:p}}export{p as useFieldNormalize};
@@ -159,6 +159,7 @@ export declare type FormRenderProps = Partial<{
159
159
  linebarWidth: number | string;
160
160
  linebarDirection: 'vertical' | 'horizontal';
161
161
  linebarTextDirection: 'vertical' | 'horizontal';
162
+ autoWidth: boolean | number;
162
163
  }>;
163
164
  export declare type FormBusinessFormatter = (payload: {
164
165
  fieldKey: string;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,inject as i,ref as n,computed as r,openBlock as l,createBlock as a,unref as o,mergeProps as s,isRef as u}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as c}from"lodash-es";import{useIhoTableFormEvent as m}from"../../../../utils/index.js";import D from"../../../../../../date-picker/index.js";var f=e({__name:"editDate",props:{value:{type:String,default:null},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},isStartDate:{type:Boolean,default:!1},isEndDate:{type:Boolean,default:!1},connectField:{type:String,default:"-_-"},isDateDisabled:{type:Function},isTimeDisabled:{type:Function}},emits:["update:value"],setup(e,{emit:f}){const p=e,v=t(),w=i("$xetable"),{emitFormChangeWithParams:b}=m({...p,$table:w}),F=n(),g=r({get:()=>p.value?p.value:null,set(e){const t=p.value;if(t===e)return;const{isDateDisabled:i,isTimeDisabled:n}=y.value;if(e){const t=Date.parse(e);if(i(t))return;const{isHourDisabled:r,isMinuteDisabled:l,isSecondDisabled:a}=(null==n?void 0:n(t))||{},{h:o,m:s,s:u}=h(new Date(e)),d=null==r?void 0:r(o),c=null==l?void 0:l(s,o),m=null==a?void 0:a(u,s,o);if(d||c||m)return}f("update:value",e),b({oldValue:t})}}),y=r((()=>{const{valueFormat:e,format:t,type:i="datetime"}=v;return{type:i,clearable:!0,allowedInvalidValue:"-",...v,timePickerProps:{format:d(e||t)},isDateDisabled:e=>{var t;return(null==(t=p.isDateDisabled)?void 0:t.call(p,e,p.row))||function(e){return!!p.row[p.connectField]&&T(e,p.isEndDate?new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime():new Date(p.row[p.connectField]).getTime())}(e)},isTimeDisabled:(null==i?void 0:i.includes("time"))?S(p.isTimeDisabled)||$:void 0}}));function T(e,t){return p.isStartDate&&p.connectField?e>t:!(!p.isEndDate||!p.connectField)&&e<t}function $(e){const t=new Date(p.row[p.connectField]),i=new Date(e),{h:n,m:r,s:l}=h(t),a=(e,t,i,n)=>!(p.isEndDate&&i>n)&&(!(p.isStartDate&&i<n)&&T(e,t));return{isHourDisabled:t=>{if(!p.row[p.connectField])return!1;const r=new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime(),{m:l,s:o}=h(i);return a(t,n,e-60*t*60*1e3-60*l*1e3-1e3*o,r)},isMinuteDisabled:t=>{if(!p.row[p.connectField])return!1;const l=new Date(`${p.row[p.connectField].split(" ")[0]} ${n}:00:00`).getTime(),{s:o}=h(i);return a(t,r,e-60*t*1e3-1e3*o,l)},isSecondDisabled:t=>{if(!p.row[p.connectField])return!1;const i=new Date(`${p.row[p.connectField].split(" ")[0]} ${n}:${r}:00`).getTime();return a(t,l,e-1e3*t,i)}}}function S(e){return c(e)?t=>e(t,p.row):null}function h(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return(e,t)=>(l(),a(o(D),s({ref_key:"formRef",ref:F},o(y),{"formatted-value":o(g),"onUpdate:formatted-value":t[0]||(t[0]=e=>u(g)?g.value=e:null)}),null,16,["formatted-value"]))}});export{f as default};
1
+ import{defineComponent as e,useAttrs as t,inject as i,ref as n,computed as r,openBlock as l,createBlock as a,unref as o,mergeProps as s,isRef as u}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as c}from"lodash-es";import{useIhoTableFormEvent as m}from"../../../../utils/index.js";import D from"../../../../../../date-picker/index.js";var f=e({__name:"editDate",props:{value:{type:String,default:null},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},isStartDate:{type:Boolean,default:!1},isEndDate:{type:Boolean,default:!1},connectField:{type:String,default:"-_-"},isDateDisabled:{type:Function},isTimeDisabled:{type:Function}},emits:["update:value"],setup(e,{emit:f}){const p=e,v=t(),w=i("$xetable"),{emitFormChangeWithParams:b}=m({...p,$table:w}),F=n(),g=r({get:()=>p.value?p.value:null,set(e){const t=p.value;if(t===e)return;const{isDateDisabled:i,isTimeDisabled:n}=y.value;if(e){const[t,r]=e.split(" "),l=Date.parse(r?e:t+" 00:00:00");if(i(l))return;const{isHourDisabled:a,isMinuteDisabled:o,isSecondDisabled:s}=(null==n?void 0:n(l))||{},{h:u,m:d,s:c}=h(new Date(e)),m=null==a?void 0:a(u),D=null==o?void 0:o(d,u),f=null==s?void 0:s(c,d,u);if(m||D||f)return}f("update:value",e),b({oldValue:t})}}),y=r((()=>{const{valueFormat:e,format:t,type:i="datetime"}=v;return{type:i,clearable:!0,allowedInvalidValue:"-",...v,timePickerProps:{format:d(e||t)},isDateDisabled:e=>{var t;return(null==(t=p.isDateDisabled)?void 0:t.call(p,e,p.row))||function(e){return!!p.row[p.connectField]&&T(e,p.isEndDate?new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime():new Date(p.row[p.connectField]).getTime())}(e)},isTimeDisabled:(null==i?void 0:i.includes("time"))?S(p.isTimeDisabled)||$:void 0}}));function T(e,t){return p.isStartDate&&p.connectField?e>t:!(!p.isEndDate||!p.connectField)&&e<t}function $(e){const t=new Date(p.row[p.connectField]),i=new Date(e),{h:n,m:r,s:l}=h(t),a=(e,t,i,n)=>!(p.isEndDate&&i>n)&&(!(p.isStartDate&&i<n)&&T(e,t));return{isHourDisabled:t=>{if(!p.row[p.connectField])return!1;const r=new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime(),{m:l,s:o}=h(i);return a(t,n,e-60*t*60*1e3-60*l*1e3-1e3*o,r)},isMinuteDisabled:t=>{if(!p.row[p.connectField])return!1;const l=new Date(`${p.row[p.connectField].split(" ")[0]} ${n}:00:00`).getTime(),{s:o}=h(i);return a(t,r,e-60*t*1e3-1e3*o,l)},isSecondDisabled:t=>{if(!p.row[p.connectField])return!1;const i=new Date(`${p.row[p.connectField].split(" ")[0]} ${n}:${r}:00`).getTime();return a(t,l,e-1e3*t,i)}}}function S(e){return c(e)?t=>e(t,p.row):null}function h(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return(e,t)=>(l(),a(o(D),s({ref_key:"formRef",ref:F},o(y),{"formatted-value":o(g),"onUpdate:formatted-value":t[0]||(t[0]=e=>u(g)?g.value=e:null)}),null,16,["formatted-value"]))}});export{f as default};
@@ -1 +1 @@
1
- import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as f,uniq as c,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as h,InjectionIhoTableHandler as A}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as R,IhoTableRenderHelper as g,getRowHeight as D,getColumnRenderWidth as T,parseMergeField as w}from"../../../../utils/index.js";import b from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as P,getColumnInfoMaxLength as x,generateSeparateRowData as C,isSeparateColumn as S}from"./separateUtils.js";import{getSeparateInfo as k,setSeparateInfo as H,deleteSeparateInfo as j}from"../../../../utils/separateMap.js";import{defineTablePlugin as M}from"../../../../hooks/useTablePlugin.js";function O(){const O="separateRendererPlugins",F=e(new Map);return M({name:O,vxe(e){e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(h),l=null!=(i=null==(n=k(u,r))?void 0:n.separateData)?i:{},s=R(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis iho-table__colorAndIcon",title:d},[d])},renderEdit:g.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const f=t(h),c=k(f,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){var e;if(!c)return[];if(c.ihoTableHandler=t(A),c.separateData["__"+n.field]=null!=(e=c.separateData["__"+n.field])?e:c.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}return a(m,{value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}():function(){var t;const o=null==(t=null==c?void 0:c.separateData)?void 0:t[n.field],r=l(e.separateFormatter)?e.separateFormatter(o):o;return[a(b,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==c?void 0:c.index,height:_,column:n,row:i,"display-content":r,onClick:u},E)]}()}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!l(e)||e(...t))}}v(e).bindAutoFocusConfig(O,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(O,(({row:e,column:t,$table:a},o,{emits:r})=>{if(!e.$__uuid)return;const n=R(t);if(!n||!n.separateRowEdit)return;const i=k(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:f}=t;if(null!==u["__"+f]&&u["__"+f]!==u[f]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+f])?t:e[f]})),o=l[f];l[f]=d(l[f])?e:e.join(""),r("formChange",{value:l[f],oldValue:o,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(O,((e,{uuid:t})=>(t&&F.set(t,e.reduce(((e,t)=>(i(t,(t=>{S(t)&&(e.push(o(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(O,(async(e,t,{insertAfter:a,index:o,$table:r})=>{var n;if(!t.uuid)return;const i=F.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await T(t,e,o,r),i={field:t.field,column:t,data:$(w(e,t),t,a,null==(n=R(t))?void 0:n.separateDeep)};l.push(i)}function s(e){return l.find((t=>t.field===e))}l.forEach((e=>{const{column:t}=e,a=R(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const o=p(u(a.separateBinder).map(s));if(!o.length)return;const r=o.concat(e),n=Math.max(...r.map((e=>e.data.length)));f(n).forEach((e=>{const t=r.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===c(a).length)return;const o=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const r=n(t);r!==o&&(d(t)?t.push(...P(o,r)):a[e]=f(o).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),f(x(l)).forEach(((r,n,i)=>{var u;const s=C(l,n),d={index:o,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void H(t.uuid,e,d);const p=null!=(u=e.$__SEPARATE_ROW_CACHE[n-1])?u:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=o,H(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(O,(async(e,t,a)=>{a.updateTableDataRef()})),e.configHooks.editConfig.tap(O,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;if(!t.uuid)return f();const r=F.get(t.uuid);if(!r||!r.length)return f();const{row:n,column:i}=e[0],u=k(t.uuid,n);if(!u)return f();const s=null==(o=i.editRender)?void 0:o.props;if(!s||s.separateRowEdit)return f();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&f();function f(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(O,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(O,(e=>{n((()=>{e.value.uuid&&(F.delete(e.value.uuid),j(e.value.uuid))}))}))}})}export{O as separateRendererPlugins};
1
+ import{reactive as e,inject as t,createVNode as a,toRaw as r,h as o,onBeforeUnmount as n}from"vue";import{widthAppend as i,getCharWidth as u,traverse as l,arrayed as s}from"../../../../../../../shared/utils/index.js";import{isFunction as d,isObject as p,isArray as f,compact as c,range as _,uniq as m,flatten as E}from"lodash-es";import{NInput as h}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as A,InjectionIhoTableUUID as v,InjectionIhoTableHandler as R}from"../../../../constants/index.js";import{useAutoFocus as g}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as D,IhoTableRenderHelper as T,getRowHeight as w,getColumnRenderWidth as b,parseMergeField as $}from"../../../../utils/index.js";import x from"./editSeparate.vue.js";import{contentSeparate as C,getLengthDiffArray as P,getColumnInfoMaxLength as S,generateSeparateRowData as k,isSeparateColumn as H}from"./separateUtils.js";import{getSeparateInfo as I,setSeparateInfo as j,deleteSeparateInfo as M}from"../../../../utils/separateMap.js";import{defineTablePlugin as O}from"../../../../hooks/useTablePlugin.js";function F(){const F="separateRendererPlugins",y=e(new Map);return O({name:F,vxe(e){e.renderer.add(A.SEPARATE,{renderCell(e,{column:r,row:o}){const n=t(v),{separateData:l={},isOriginRow:s}=I(n,o)||{},d=D(r),p=(null==d?void 0:d.separateFormatter)?d.separateFormatter(l[r.field]):l[r.field];return a("section",{class:"iho-table__ellipsis iho-table__colorAndIcon",title:p,style:{textIndent:s&&(null==d?void 0:d.separateIndent)?i(u("一")*d.separateIndent):0}},[p])},renderEdit:T.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var l,s;const f=t(v),c=I(f,i),_=w(),m={};let E=null!=(s=null==(l=e.componentProps)?void 0:l.separateSlot)?s:e.separateSlot;return E&&(E=r(E),m.menu=d(E)?E:p(E)?e=>o(E,e):void 0),e.separateRowEdit?function(){var e;if(!c)return[];if(c.ihoTableHandler=t(R),c.separateData["__"+n.field]=null!=(e=c.separateData["__"+n.field])?e:c.separateData[n.field],m.menu){const e=m.menu;return a(e,{column:n,col:n,row:i,value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}return a(h,{value:c.separateData["__"+n.field],"onUpdate:value":e=>c.separateData["__"+n.field]=e},null)}():function(){var t;const r=null==(t=null==c?void 0:c.separateData)?void 0:t[n.field],o=d(e.separateFormatter)?e.separateFormatter(r):r;return[a(x,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,rowIndex:c.index,height:_,column:n,row:i,displayContent:o,onClick:u},m)]}()}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!d(e)||e(...t))}}g(e).bindAutoFocusConfig(F,A.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(F,(({row:e,column:t,$table:a},r,{emits:o})=>{if(!e.$__uuid)return;const n=D(t);if(!n||!n.separateRowEdit)return;const i=I(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:d}=i,{field:p}=t;if(null!==u["__"+p]&&u["__"+p]!==u[p]&&f(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+p])?t:e[p]})),r=l[p];l[p]=f(l[p])?e:e.join(""),o("formChange",{value:l[p],oldValue:r,row:l,column:t,index:d,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(F,((e,{uuid:t})=>(t&&y.set(t,e.reduce(((e,t)=>(l(t,(t=>{H(t)&&(e.push(r(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(F,(async(e,t,{insertAfter:a,index:r,$table:o})=>{var n;if(!t.uuid)return;const i=y.get(t.uuid);if(!i||!i.length)return;const u=[];for(const t of i){if(!t.field)continue;const a=await b(t,e,r,o),i={field:t.field,column:t,data:C($(e,t),t,a,null==(n=D(t))?void 0:n.separateDeep)};u.push(i)}function l(e){return u.find((t=>t.field===e))}u.forEach((e=>{const{column:t}=e,a=D(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const r=c(s(a.separateBinder).map(l));if(!r.length)return;const o=r.concat(e),n=Math.max(...o.map((e=>e.data.length)));_(n).forEach((e=>{const t=o.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===m(a).length)return;const r=Math.max(...a);function n(e){return f(e)?e.length:1}t.forEach((({item:t,data:a})=>{const o=n(t);o!==r&&(f(t)?t.push(...P(r,o)):a[e]=_(r).map(((e,a)=>0===a?t:"")))}))}))})),u.forEach((e=>{e.data=E(e.data)})),_(S(u)).forEach(((o,n,i)=>{var l;const s=k(u,n),d={index:r,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void j(t.uuid,e,d);const p=null!=(l=e.$__SEPARATE_ROW_CACHE[n-1])?l:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=r,j(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(F,(async(e,t,a)=>{a.updateTableDataRef()})),e.configHooks.editConfig.tap(F,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var r;if(!t.uuid)return f();const o=y.get(t.uuid);if(!o||!o.length)return f();const{row:n,column:i}=e[0],u=I(t.uuid,n);if(!u)return f();const l=null==(r=i.editRender)?void 0:r.props;if(!l||l.separateRowEdit)return f();const{isOriginRow:s,isLastRow:p}=u;return("bottom"===l.separatePlacement?p:s)&&f();function f(){return!d(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(F,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(F,(e=>{n((()=>{e.value.uuid&&(y.delete(e.value.uuid),M(e.value.uuid))}))}))}})}export{F as separateRendererPlugins};
@@ -1 +1 @@
1
- import{getStringWidth as r}from"../../../../../../../shared/utils/index.js";import{isArray as t,isString as n,isNumber as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as o}from"../../../../constants/index.js";import{getLowCodeFieldFromField as i}from"../../../../utils/index.js";function a(r){return Math.max(...r.map((r=>r.data.length)),1)}function u(r,t){return r.reduce(((r,n)=>(r[n.field]=n.data[t],r)),{})}function s(o,a,u,d=!1){var f;if(t(o)){if(d){const r=null==(f=i(a))?void 0:f.separateFormatter;return o.map((t=>s(r?r(t):t,a,u)))}return o}if(!n(o)||!e(u))return[o];u-=24;const m=[...o].reduce(((t,n)=>{const e=t[t.length-1];return r(e+n)>u?t.push(n):t[t.length-1]=e+n,t}),[""]);return d?[m]:m}function d(r){var t;return r.field&&(null==(t=r.editRender)?void 0:t.name)===o.SEPARATE}function f(r,t,n=""){const e=Math.abs(r-t);return Array.from({length:e}).map((()=>n))}export{s as contentSeparate,u as generateSeparateRowData,a as getColumnInfoMaxLength,f as getLengthDiffArray,d as isSeparateColumn};
1
+ import{getCharWidth as t,getStringWidth as n}from"../../../../../../../shared/utils/index.js";import{isArray as r,isString as e,isNumber as o}from"lodash-es";import{EDITABLE_WIDGET_TYPE as a}from"../../../../constants/index.js";import{getLowCodeFieldFromField as i}from"../../../../utils/index.js";function u(t){return Math.max(...t.map((t=>t.data.length)),1)}function s(t,n){return t.reduce(((t,r)=>(t[r.field]=r.data[n],t)),{})}function d(a,u,s,l=!1){var f,m;const c=(null==(f=i(u))?void 0:f.separateIndent)||0;if(r(a)){if(l){const t=null==(m=i(u))?void 0:m.separateFormatter;return a.map((n=>d(t?t(n):n,u,s)))}return a}if(!e(a)||!o(s))return[a];s-=24;const p=[...a].reduce(((r,e)=>{const o=r[r.length-1],a=1===r.length?s-c*t("一"):s;return n(o+e)>a?r.push(e):r[r.length-1]=o+e,r}),[""]);return l?[p]:p}function l(t){var n;return t.field&&(null==(n=t.editRender)?void 0:n.name)===a.SEPARATE}function f(t,n,r=""){const e=Math.abs(t-n);return Array.from({length:e}).map((()=>r))}export{d as contentSeparate,s as generateSeparateRowData,u as getColumnInfoMaxLength,f as getLengthDiffArray,l as isSeparateColumn};
@@ -185,6 +185,7 @@ export declare type LowCodeTableFieldItem = {
185
185
  separateBinder: ArrayAble<string>;
186
186
  separateRowEdit: boolean;
187
187
  separatePlacement: 'bottom';
188
+ separateIndent: number;
188
189
  separateWidth: ((payload: {
189
190
  column: VxeTableDefines.ColumnInfo;
190
191
  row: AnyObject;