cnhis-design-vue 3.1.55-release.2 → 3.1.56-beta.11

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 (122) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/index.d.ts +18 -0
  3. package/es/components/annotation-edit/src/AnnotationEdit.d.ts +18 -0
  4. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  5. package/es/components/annotation-edit/src/type.d.ts +4 -0
  6. package/es/components/audio-sdk/src/audioSDK.d.ts +20 -6
  7. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  8. package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +14 -0
  9. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  10. package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +5 -2
  11. package/es/components/audio-sdk/src/utils/recordingDialog.js +1 -1
  12. package/es/components/audio-sdk/style/index.css +1 -1
  13. package/es/components/base-search/index.d.ts +14 -0
  14. package/es/components/base-search/src/index.vue.d.ts +14 -0
  15. package/es/components/base-search/src/index.vue2.js +1 -1
  16. package/es/components/base-search/style/index.css +1 -1
  17. package/es/components/button-print/src/utils/print.d.ts +3 -0
  18. package/es/components/button-print/src/utils/print.js +1 -1
  19. package/es/components/callback/src/components/render/popupMaps.d.ts +26 -4
  20. package/es/components/classification/index.d.ts +39 -23
  21. package/es/components/classification/src/components/search-filter/index.vue.d.ts +14 -0
  22. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  23. package/es/components/classification/src/components/set-classification/index.vue.d.ts +20 -22
  24. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  25. package/es/components/classification/src/components/table-modal/index.vue.d.ts +9 -20
  26. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  27. package/es/components/classification/src/index.vue.d.ts +65 -45
  28. package/es/components/classification/src/index.vue2.js +1 -1
  29. package/es/components/classification/style/index.css +1 -1
  30. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  31. package/es/components/fabric-chart/index.d.ts +4 -2
  32. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
  33. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  41. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  45. package/es/components/form-config/index.d.ts +84 -14
  46. package/es/components/form-config/src/FormConfig.vue.d.ts +84 -14
  47. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -4
  48. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +41 -7
  49. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1 -0
  50. package/es/components/form-render/index.d.ts +26 -4
  51. package/es/components/form-render/src/FormRender.vue.d.ts +27 -4
  52. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  53. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -4
  54. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  55. package/es/components/form-render/src/constants/index.d.ts +1 -0
  56. package/es/components/form-render/src/constants/index.js +1 -1
  57. package/es/components/form-render/src/hooks/useComplexOptions.d.ts +1 -1
  58. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  59. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
  60. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  61. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  62. package/es/components/form-render/src/types/index.d.ts +3 -1
  63. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
  64. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  65. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +48 -10
  66. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  67. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/radioRendererPlugin.js +1 -1
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  70. package/es/components/index.css +1 -1
  71. package/es/components/info-header/index.d.ts +77 -13
  72. package/es/components/info-header/src/InfoHeader.vue.d.ts +77 -13
  73. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +5 -1
  74. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +5 -1
  75. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -5
  76. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -4
  77. package/es/components/recommend-search/index.d.ts +8 -8
  78. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  79. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  80. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  81. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  82. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  83. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  84. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  85. package/es/components/shortcut-setter/index.d.ts +26 -4
  86. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +26 -4
  87. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  88. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +14 -0
  89. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +14 -0
  90. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +14 -0
  91. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +14 -0
  92. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +15 -0
  93. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  94. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +14 -0
  95. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  96. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +15 -0
  97. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +15 -0
  98. package/es/components/table-filter/src/types/index.d.ts +3 -1
  99. package/es/env.d.ts +25 -25
  100. package/es/shared/assets/img/failure.png.js +1 -1
  101. package/es/shared/assets/img/no-permission.png.js +1 -1
  102. package/es/shared/assets/img/nodata.png.js +1 -1
  103. package/es/shared/assets/img/notfound.png.js +1 -1
  104. package/es/shared/assets/img/qr.png.js +1 -1
  105. package/es/shared/assets/img/success.png.js +1 -1
  106. package/es/shared/assets/img/video.png.js +1 -1
  107. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  108. package/es/shared/assets/img/xb_big.png.js +1 -1
  109. package/es/shared/assets/img/xb_small.png.js +1 -1
  110. package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +1 -1
  111. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
  112. package/es/shared/package.json.js +1 -1
  113. package/es/shared/types/business.d.ts +1 -0
  114. package/es/shared/utils/business.js +1 -1
  115. package/package.json +2 -2
  116. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  117. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  118. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  119. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  120. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  121. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  122. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -19,7 +19,7 @@ export declare function useComplexOptions(props: {
19
19
  childWidthMode?: "inner" | "outer" | undefined;
20
20
  renderLabel?: boolean | undefined;
21
21
  attrs?: AnyObject | undefined;
22
- }) => any[];
22
+ }) => (JSX.Element | null)[];
23
23
  valueRef: Ref<any>;
24
24
  hasComplexOption: import("vue").ComputedRef<boolean>;
25
25
  };
@@ -1 +1 @@
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 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 h}from"@formily/vue";import{isArray as f,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{renderDescOption as b}from"../utils/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as S}from"../utils/schema.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 k=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),f=p(),y=o(n+"_virtualParent",""),b=`${y?y+".":""}${f.value.address}`;function j(e){return`${b}.${e}`}i(n+"_virtualParent",b);const{schemaAdaptor:$}=F(u);function k(t){var r,l,n,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!=(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 E=t((()=>{const t=$(e.fieldItems);return Object.values(t).forEach(k),S(t)}));a(E,(()=>{return e=E.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 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(n,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",l({class:"form-render__labelField",style:{"--column":(e=E.value,Object.values(e.properties||{}).reduce(((e,t)=>e+M(n,j(t.name))),0)),flex:"1"}},I),[r(h,{basePath:".",schema:E.value},null)]);var e}}});function E(e,n){u();const o=t((()=>e.options.some((e=>f(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(f(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:n="value",labelKey:a="label",childFieldStrategy:s,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[c?t.desc?b(t[a],t):t[a]:null,o.value&&("all"===s||i(e,t,n))?r(k,l({fieldItems:t.childrenFields,name:t[n],childFieldStrategy:s,childWidthMode:d},u),null):null]},valueRef:n,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 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};
@@ -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{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};
@@ -1 +1 @@
1
- import"../../../../shared/utils/index.js";import{isField as e}from"@formily/core";import{isArray as o}from"lodash-es";import{computed as r,unref as i}from"vue";import{isMatchLowCodeConditionsWithSqlExpression as t}from"../../../../shared/utils/business.js";function n(n,s){const l={hideField:c((e=>e.setDisplay("none"))),showField:c((e=>e.setDisplay("visible"))),requiredField:c((e=>e.required=!0)),notRequiredField:c((e=>{e.required=!1,e.validate()})),enabledField:c((e=>e.editable=!0)),disabledField:c((e=>e.editable=!1))};function c(o){return r=>{r.forEach((r=>{const i=s.query(r).take();i&&e(i)&&o(i)}))}}const d=r((()=>i(n)?i(n).reduce(((e,r)=>(o(r.conObj)&&r.conObj.forEach((o=>e.push(o.field_key))),e)),[]):[]));function a(e){Object.entries(e).forEach((([e,o])=>l[e]&&l[e](o)))}return{lowCodeReactionsHandler:function(e){const o=i(n);if(!o||!d.value.includes(e))return;const r=s.getFormState().values;o.forEach((o=>{(function(e,o){return!!o.conObj&&o.conObj.some((o=>o.field_key===e))})(e,o)&&t(r,o)&&a(o)}))},triggerAllReactionsHandler:function(){const e=i(n);if(!e)return;const o=s.getFormState().values;e.forEach((e=>{t(o,e)&&a(e)}))}}}export{n as useLowCodeReactions};
1
+ import"../../../../shared/utils/index.js";import{isField as e}from"@formily/core";import{isArray as i}from"lodash-es";import{computed as t,unref as r}from"vue";import{isMatchLowCodeConditionsWithSqlExpression as o}from"../../../../shared/utils/business.js";function n(n,l){const s={hideField:a(((e,i)=>{var t;i.isRestoreDefault?(e.value=null!=(t=e.initialValue)?t:null,e.setDisplay("hidden")):e.setDisplay("none")})),showField:a((e=>e.setDisplay("visible"))),requiredField:a((e=>e.required=!0)),notRequiredField:a((e=>{e.required=!1,e.validate()})),enabledField:a((e=>e.editable=!0)),disabledField:a((e=>e.editable=!1))};function a(i){return(t,r)=>{t.forEach((t=>{const o=l.query(t).take();o&&e(o)&&i(o,r)}))}}const u=t((()=>r(n)?r(n).reduce(((e,t)=>(i(t.conObj)&&t.conObj.forEach((i=>e.push(i.field_key))),e)),[]):[]));function d(e){Object.entries(e).forEach((([i,t])=>s[i]&&s[i](t,e)))}return{lowCodeReactionsHandler:function(e){const i=r(n);if(!i||!u.value.includes(e))return;const t=l.getFormState().values;i.forEach((i=>{(function(e,i){return!!i.conObj&&i.conObj.some((i=>i.field_key===e))})(e,i)&&o(t,i)&&d(i)}))},triggerAllReactionsHandler:function(){const e=r(n);if(!e)return;const i=l.getFormState().values;e.forEach((e=>{o(i,e)&&d(e)}))}}}export{n as useLowCodeReactions};
@@ -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{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};
@@ -4,7 +4,7 @@ import { VxeTableConstructor, VxeTableDefines, VxeTableMethods, VxeTablePrivateM
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  value: {
6
6
  type: StringConstructor;
7
- default: undefined;
7
+ default: null;
8
8
  };
9
9
  column: {
10
10
  type: PropType<VxeTableDefines.ColumnInfo>;
@@ -18,12 +18,24 @@ declare const _default: import("vue").DefineComponent<{
18
18
  type: NumberConstructor;
19
19
  required: true;
20
20
  };
21
+ isStartDate: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ isEndDate: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ connectField: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
21
33
  }, {
22
34
  attr: AnyObject;
23
35
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
24
36
  value: {
25
37
  type: StringConstructor;
26
- default: undefined;
38
+ default: null;
27
39
  };
28
40
  column: {
29
41
  type: PropType<VxeTableDefines.ColumnInfo>;
@@ -37,6 +49,18 @@ declare const _default: import("vue").DefineComponent<{
37
49
  type: NumberConstructor;
38
50
  required: true;
39
51
  };
52
+ isStartDate: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ isEndDate: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
60
+ connectField: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
40
64
  }>> & {
41
65
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
42
66
  }>>;
@@ -45,16 +69,16 @@ declare const _default: import("vue").DefineComponent<{
45
69
  emit: (event: "update:value", ...args: any[]) => void;
46
70
  formRef: import("vue").Ref<any>;
47
71
  formattedValue: import("vue").WritableComputedRef<string | null | undefined>;
48
- formatConfig: import("vue").ComputedRef<{
49
- valueFormat: string;
50
- format: string;
72
+ dateConfig: import("vue").ComputedRef<{
51
73
  timePickerProps: {
52
74
  format: string | undefined;
53
75
  };
76
+ isDateDisabled: (ts: number) => any;
77
+ isTimeDisabled: ((ts: number) => any) | undefined;
78
+ type: any;
79
+ clearable: boolean;
80
+ allowedInvalidValue: string;
54
81
  }>;
55
- isStartDate: any;
56
- isEndDate: any;
57
- connectField: string;
58
82
  setDateDisabled: (cur: number, date: number) => boolean;
59
83
  isDateDisabled: (ts: number) => boolean;
60
84
  isTimeDisabled: (ts: number) => {
@@ -62,7 +86,6 @@ declare const _default: import("vue").DefineComponent<{
62
86
  isMinuteDisabled: (minute: number) => boolean;
63
87
  isSecondDisabled: (second: number) => boolean;
64
88
  };
65
- dateConfig: AnyObject;
66
89
  customDateDisabledDecorator: (customDateDisabled?: AnyFn) => ((ts: number) => any) | null;
67
90
  getDetailTime: (date: Date) => {
68
91
  h: number;
@@ -147,7 +170,7 @@ declare const _default: import("vue").DefineComponent<{
147
170
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
148
171
  value: {
149
172
  type: StringConstructor;
150
- default: undefined;
173
+ default: null;
151
174
  };
152
175
  column: {
153
176
  type: PropType<VxeTableDefines.ColumnInfo>;
@@ -161,9 +184,24 @@ declare const _default: import("vue").DefineComponent<{
161
184
  type: NumberConstructor;
162
185
  required: true;
163
186
  };
187
+ isStartDate: {
188
+ type: BooleanConstructor;
189
+ default: boolean;
190
+ };
191
+ isEndDate: {
192
+ type: BooleanConstructor;
193
+ default: boolean;
194
+ };
195
+ connectField: {
196
+ type: StringConstructor;
197
+ default: string;
198
+ };
164
199
  }>> & {
165
200
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
166
201
  }, {
167
202
  value: string;
203
+ connectField: string;
204
+ isStartDate: boolean;
205
+ isEndDate: boolean;
168
206
  }>;
169
207
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,inject as r,ref as a,computed as i,openBlock as o,createBlock as s,unref as n,mergeProps as l,isRef as u}from"vue";import{generateTimeFormat as m}from"../../../../../../../shared/utils/index.js";import{isFunction as d}from"lodash-es";import{useIhoTableFormEvent as p}from"../../../../utils/index.js";import f from"../../../../../../date-picker/index.js";var w=e({__name:"editDate",props:{value:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{emit:w}){const c=e,D=t(),v=r("$xetable"),{emitFormChangeWithParams:b}=p({...c,$table:v}),y=a(),g=i({get:()=>c.value?c.value:null,set(e){const t=c.value;t!==e&&(w("update:value",e),b({oldValue:t}))}}),$=i((()=>{const e=D.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:m(e)}}})),{isStartDate:T=!1,isEndDate:h=!1}=D,x=D.connectField||"",j=(e,t)=>T&&x?e>t:!(!h||!x)&&e<t,F=e=>{const t=new Date(c.row[x]),r=new Date(e),{h:a,m:i,s:o}=S(t),s=(e,t,r,a)=>!(h&&r>a)&&(!(T&&r<a)&&j(e,t));return{isHourDisabled:t=>{if(!c.row[x])return!1;const i=new Date(`${c.row[x].split(" ")[0]} 00:00:00`).getTime(),{m:o,s:n}=S(r);return s(t,a,e-60*t*60*1e3-60*o*1e3-1e3*n,i)},isMinuteDisabled:t=>{if(!c.row[x])return!1;const o=new Date(`${c.row[x].split(" ")[0]} ${a}:00:00`).getTime(),{s:n}=S(r);return s(t,i,e-60*t*1e3-1e3*n,o)},isSecondDisabled:t=>{if(!c.row[x])return!1;const r=new Date(`${c.row[x].split(" ")[0]} ${a}:${i}:00`).getTime();return s(t,o,e-1e3*t,r)}}},H={type:D.type||"datetime",clearable:!0,allowedInvalidValue:"-",...D,...$.value,isDateDisabled:M(D.isDateDisabled)||(e=>!!c.row[x]&&j(e,h?new Date(`${c.row[x].split(" ")[0]} 00:00:00`).getTime():new Date(c.row[x]).getTime()))};function M(e){return d(e)?t=>e(t,c.row):null}function S(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return H.type.includes("time")&&(H.isTimeDisabled=M(D.isTimeDisabled)||F),(e,t)=>(o(),s(n(f),l({ref_key:"formRef",ref:y},n(H),{"formatted-value":n(g),"onUpdate:formatted-value":t[0]||(t[0]=e=>u(g)?g.value=e:null)}),null,16,["formatted-value"]))}});export{w as default};
1
+ import{defineComponent as e,useAttrs as t,inject as i,ref as n,computed as r,openBlock as l,createBlock as o,unref as a,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:"-_-"}},emits:["update:value"],setup(e,{emit:f}){const p=e,w=t(),v=i("$xetable"),{emitFormChangeWithParams:b}=m({...p,$table:v}),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:o}=(null==n?void 0:n(t))||{},{h:a,m:s,s:u}=x(new Date(e)),d=null==r?void 0:r(a),c=null==l?void 0:l(s,a),m=null==o?void 0:o(u,s,a);if(d||c||m)return}f("update:value",e),b({oldValue:t})}}),y=r((()=>{const{valueFormat:e,format:t,type:i="datetime"}=w;return{type:i,clearable:!0,allowedInvalidValue:"-",...w,timePickerProps:{format:d(e||t)},isDateDisabled:h(w.isDateDisabled)||S,isTimeDisabled:(null==i?void 0:i.includes("time"))?h(w.isTimeDisabled)||T:void 0}}));function $(e,t){return p.isStartDate&&p.connectField?e>t:!(!p.isEndDate||!p.connectField)&&e<t}function S(e){return!!p.row[p.connectField]&&$(e,p.isEndDate?new Date(`${p.row[p.connectField].split(" ")[0]} 00:00:00`).getTime():new Date(p.row[p.connectField]).getTime())}function T(e){const t=new Date(p.row[p.connectField]),i=new Date(e),{h:n,m:r,s:l}=x(t),o=(e,t,i,n)=>!(p.isEndDate&&i>n)&&(!(p.isStartDate&&i<n)&&$(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:a}=x(i);return o(t,n,e-60*t*60*1e3-60*l*1e3-1e3*a,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:a}=x(i);return o(t,r,e-60*t*1e3-1e3*a,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 o(t,l,e-1e3*t,i)}}}function h(e){return c(e)?t=>e(t,p.row):null}function x(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return(e,t)=>(l(),o(a(D),s({ref_key:"formRef",ref:F},a(y),{"formatted-value":a(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{computed as e,createVNode as t,mergeProps as o}from"vue";import{NRadio as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../constants/index.js";import{IhoTableRenderHelper as i,getLowCodeFieldFromField as l,IhoTableUtils as d}from"../../../utils/index.js";import{defineTablePlugin as a}from"../../../hooks/useTablePlugin.js";function u(){const u="radioRendererPlugin";return a({name:u,vxe(l){l.renderer.add(r.RADIO,{renderCell:i.createRenderEdit((({fieldItem:r,emitFormChangeWithParams:i,row:l,column:d,$table:a})=>{const u=e({get:()=>l[d.field],set(){const{fullData:e}=a.getTableData();null==e||e.forEach((e=>e[d.field]=!1)),l[d.field]=!0,i({oldValue:!1})}}),f=(null==r?void 0:r.componentProps)||{};return[l.$__SEPARATE?"":t(n,o({checked:u.value,"onUpdate:checked":e=>u.value=e},f),null)]}))})},apply(e){function t(e){return d.getCellType(e)===r.RADIO}e.fieldHooks.field.tap(u,((e,o,n)=>{var r;const i=l(e);if(!i)return e;if(t(i)){const e=null==(r=n.editConfig)?void 0:r.beforeEditMethod;n.editConfig={...n.editConfig,beforeEditMethod:o=>{const{column:n}=o;return!t(l(n))&&(!e||e(o))}}}return e}))}})}export{u as radioRendererPlugin};
1
+ import{computed as e,createVNode as o,mergeProps as r}from"vue";import{NRadio as t}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../constants/index.js";import{IhoTableRenderHelper as i,IhoTableUtils as l}from"../../../utils/index.js";import{isFunction as d}from"lodash-es";import{defineTablePlugin as a}from"../../../hooks/useTablePlugin.js";function u(){const u="radioRendererPlugin";return a({name:u,vxe(l){l.renderer.add(n.RADIO,{renderCell:i.createRenderEdit((({fieldItem:n,emitFormChangeWithParams:i,row:l,column:d,$table:a})=>{const u=e({get:()=>l[d.field],set(){const{fullData:e}=a.getTableData();null==e||e.forEach((e=>e[d.field]=!1)),l[d.field]=!0,i({oldValue:!1})}}),m=(null==n?void 0:n.componentProps)||{};return[l.$__SEPARATE?"":o(t,r({checked:u.value,"onUpdate:checked":e=>u.value=e},m),null)]}))})},apply(e){e.configHooks.editConfig.tap(u,((e={},o)=>{const r=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;const{row:t,column:i}=e[0];return!function(e){return!!e&&l.getCellType(e)===n.RADIO}(null==(o=i.editRender)?void 0:o.props)&&(!d(r)||r(...e))},e}))}})}export{u as radioRendererPlugin};
@@ -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{defineComponent as e,useAttrs as l,inject as t,ref as a,computed as r,reactive as u,watch as o,nextTick as i,openBlock as n,createBlock as d,unref as c,withCtx as v,createVNode as m,mergeProps as s,isRef as f,createElementBlock as p,Fragment as h,renderList as y,createTextVNode as k,toDisplayString as b,createCommentVNode as w}from"vue";import{NPopover as _,NInput as g,NSpace as V,NScrollbar as C,NButton as F}from"naive-ui";import{useIhoTableFormEvent as x}from"../../../../utils/index.js";import D from"../../../../../../time-picker/index.js";import{parse as q,isValid as O,getHours as j,getMinutes as S,getSeconds as $,format as A}from"date-fns";var H=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},shortcutOptions:{type:Array,default:()=>[]}},emits:["update:formattedValue","click"],setup(e,{emit:H}){const I=e,P=l(),R=t("$xetable"),{emitFormChangeWithParams:E}=x({...I,$table:R}),M=a(null),U=a(!1),z=a(),K=a(),N=r((()=>K.value&&L(K.value)?{style:"text-decoration: line-through"}:{})),T=r({get(){if(!K.value)return null;const e=q(K.value,G.valueFormat,new Date);return O(e)?K.value:I.formattedValue?I.formattedValue:null},set(e){J(e)}}),{placeholder:W="请选择",valueFormat:B="HH:mm"}=P,G=u({...P,placeholder:W,valueFormat:B,format:B});function J(e){if(K.value=e||"",e&&L(e))return;const l=I.formattedValue;l!==e&&(H("update:formattedValue",e),E({oldValue:l}))}function L(e){var l,t,a;const r=q(e,G.format,new Date),u=j(r),o=S(r),i=$(r),n=null==(l=G.isHourDisabled)?void 0:l.call(G,u),d=null==(t=G.isMinuteDisabled)?void 0:t.call(G,o,u),c=null==(a=G.isSecondDisabled)?void 0:a.call(G,i,o,u);return!!n||(!!d||!!c)}function Q(){[G.valueFormat.replace(/[^\w]/g,""),G.valueFormat].some((e=>{const l=q(K.value,e,new Date);if(!K.value||O(l)){return J(K.value?A(l,G.valueFormat):null),!0}return!1}))}function X(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=M.value)||l.blur(),U.value=!1)}return o((()=>I.formattedValue),(e=>{if(!e)return"";K.value=e}),{immediate:!0}),o((()=>U.value),(async e=>{var l,t,a,r,u;e&&(await i(),null==(u=null==(r=null==(a=null==(t=null==(l=z.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(l,t)=>(n(),d(c(_),{show:U.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:t[4]||(t[4]=()=>U.value=!1)},{trigger:v((()=>[m(c(g),{ref_key:"formRef",ref:M,clearable:"",placeholder:c(W),value:K.value,"onUpdate:value":t[0]||(t[0]=e=>K.value=e),valueModifiers:{trim:!0},"input-props":c(N),onClick:t[1]||(t[1]=()=>U.value=!0),onChange:Q,onKeydown:X},null,8,["placeholder","value","input-props"])])),default:v((()=>[m(c(V),null,{default:v((()=>[m(c(D),s({ref_key:"timePickerRef",ref:z,show:""},c(G),{class:"iho-table__time-picker",to:!1,"formatted-value":c(T),"onUpdate:formatted-value":t[2]||(t[2]=e=>f(T)?T.value=e:null),onConfirm:t[3]||(t[3]=()=>U.value=!1)}),null,16,["formatted-value"]),m(c(C),{class:"iho-table__scrollbar"},{default:v((()=>[e.shortcutOptions.length?(n(),d(c(V),{key:0,vertical:"",wrap:!1},{default:v((()=>[(n(!0),p(h,null,y(e.shortcutOptions,(e=>(n(),d(c(F),{size:"tiny",key:e,disabled:L(e),onClick:l=>function(e){J(e),U.value=!1}(e)},{default:v((()=>[k(b(e),1)])),_:2},1032,["disabled","onClick"])))),128))])),_:1})):w("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{H as default};
1
+ import{defineComponent as e,useAttrs as l,inject as t,ref as a,computed as r,reactive as u,watch as o,nextTick as i,openBlock as n,createBlock as d,unref as c,withCtx as v,createVNode as m,mergeProps as s,isRef as f,createElementBlock as p,Fragment as h,renderList as y,createTextVNode as k,toDisplayString as b,createCommentVNode as w}from"vue";import{NPopover as _,NInput as g,NSpace as V,NScrollbar as C,NButton as F}from"naive-ui";import{useIhoTableFormEvent as x}from"../../../../utils/index.js";import D from"../../../../../../time-picker/index.js";import{parse as q,isValid as O,getHours as j,getMinutes as S,getSeconds as $,format as A}from"date-fns";var H=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},shortcutOptions:{type:Array,default:()=>[]}},emits:["update:formattedValue","click"],setup(e,{emit:H}){const I=e,P=l(),R=t("$xetable"),{emitFormChangeWithParams:E}=x({...I,$table:R}),M=a(null),U=a(!1),z=a(),K=a(),N=r((()=>K.value&&L(K.value)?{style:"text-decoration: line-through"}:{})),T=r({get(){if(!K.value)return null;const e=q(K.value,G.valueFormat,new Date);return O(e)?K.value:I.formattedValue?I.formattedValue:null},set(e){J(e)}}),{placeholder:W="请选择",valueFormat:B="HH:mm"}=P,G=u({...P,placeholder:W,valueFormat:B,format:B});function J(e){if(K.value=e||"",e&&L(e))return;const l=I.formattedValue;l!==e&&(H("update:formattedValue",e),E({oldValue:l}))}function L(e){var l,t,a;const r=q(e,G.format,new Date),u=j(r),o=S(r),i=$(r),n=null==(l=G.isHourDisabled)?void 0:l.call(G,u),d=null==(t=G.isMinuteDisabled)?void 0:t.call(G,o,u),c=null==(a=G.isSecondDisabled)?void 0:a.call(G,i,o,u);return!!(n||d||c)}function Q(){[G.valueFormat.replace(/[^\w]/g,""),G.valueFormat].some((e=>{const l=q(K.value,e,new Date);if(!K.value||O(l)){return J(K.value?A(l,G.valueFormat):null),!0}return!1}))}function X(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=M.value)||l.blur(),U.value=!1)}return o((()=>I.formattedValue),(e=>{if(!e)return"";K.value=e}),{immediate:!0}),o((()=>U.value),(async e=>{var l,t,a,r,u;e&&(await i(),null==(u=null==(r=null==(a=null==(t=null==(l=z.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(l,t)=>(n(),d(c(_),{show:U.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:t[4]||(t[4]=()=>U.value=!1)},{trigger:v((()=>[m(c(g),{ref_key:"formRef",ref:M,clearable:"",placeholder:c(W),value:K.value,"onUpdate:value":t[0]||(t[0]=e=>K.value=e),valueModifiers:{trim:!0},"input-props":c(N),onClick:t[1]||(t[1]=()=>U.value=!0),onChange:Q,onKeydown:X},null,8,["placeholder","value","input-props"])])),default:v((()=>[m(c(V),null,{default:v((()=>[m(c(D),s({ref_key:"timePickerRef",ref:z,show:""},c(G),{class:"iho-table__time-picker",to:!1,"formatted-value":c(T),"onUpdate:formatted-value":t[2]||(t[2]=e=>f(T)?T.value=e:null),onConfirm:t[3]||(t[3]=()=>U.value=!1)}),null,16,["formatted-value"]),m(c(C),{class:"iho-table__scrollbar"},{default:v((()=>[e.shortcutOptions.length?(n(),d(c(V),{key:0,vertical:"",wrap:!1},{default:v((()=>[(n(!0),p(h,null,y(e.shortcutOptions,(e=>(n(),d(c(F),{size:"tiny",key:e,disabled:L(e),onClick:l=>function(e){J(e),U.value=!1}(e)},{default:v((()=>[k(b(e),1)])),_:2},1032,["disabled","onClick"])))),128))])),_:1})):w("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{H as default};