cnhis-design-vue 3.1.52-beta.2 → 3.1.52-beta.20

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 (118) hide show
  1. package/README.md +87 -87
  2. package/es/components/body-select/index.d.ts +47 -0
  3. package/es/components/body-select/index.js +1 -0
  4. package/es/components/body-select/src/config/index.d.ts +101 -0
  5. package/es/components/body-select/src/config/index.js +1 -0
  6. package/es/components/body-select/src/hooks/renderCanvas.d.ts +6 -0
  7. package/es/components/body-select/src/hooks/renderCanvas.js +1 -0
  8. package/es/components/body-select/src/index.vue.d.ts +48 -0
  9. package/es/components/body-select/src/index.vue.js +1 -0
  10. package/es/components/body-select/src/index.vue2.js +1 -0
  11. package/es/components/body-select/style/index.css +1 -0
  12. package/es/components/callback/src/components/render/popupMaps.d.ts +37 -37
  13. package/es/components/classification/index.d.ts +76 -6
  14. package/es/components/classification/src/components/search-filter/index.vue.d.ts +76 -6
  15. package/es/components/classification/src/components/set-classification/index.vue.d.ts +76 -6
  16. package/es/components/classification/src/index.vue.d.ts +76 -6
  17. package/es/components/date-picker/index.d.ts +38 -3
  18. package/es/components/date-picker/src/DatePicker.vue.d.ts +38 -3
  19. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  20. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  26. package/es/components/fabric-chart/src/interface.d.ts +2 -2
  27. package/es/components/form-config/index.d.ts +9 -2
  28. package/es/components/form-config/src/FormConfig.vue.d.ts +81 -74
  29. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +37 -37
  30. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +40 -37
  31. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  32. package/es/components/form-render/index.d.ts +37 -37
  33. package/es/components/form-render/index.js +1 -1
  34. package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
  35. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +37 -37
  36. package/es/components/form-render/src/components/renderer/date.d.ts +25 -0
  37. package/es/components/form-render/src/components/renderer/date.js +1 -1
  38. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  39. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  40. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +18 -0
  41. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  42. package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -1
  43. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  44. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  45. package/es/components/form-render/src/hooks/useFormEvent.d.ts +2 -2
  46. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  47. package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
  48. package/es/components/form-render/src/types/fieldItem.js +1 -1
  49. package/es/components/form-render/src/types/index.d.ts +2 -2
  50. package/es/components/form-render/src/types/index.js +1 -1
  51. package/es/components/form-render/style/index.css +1 -1
  52. package/es/components/iho-table/index.js +1 -1
  53. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
  54. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +38 -3
  55. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
  56. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +38 -3
  57. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  58. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  59. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +2 -7
  60. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  61. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
  62. package/es/components/iho-table/src/types/index.d.ts +1 -1
  63. package/es/components/iho-table/src/utils/index.d.ts +2 -0
  64. package/es/components/iho-table/src/utils/index.js +1 -1
  65. package/es/components/index.css +1 -1
  66. package/es/components/index.d.ts +2 -1
  67. package/es/components/index.js +1 -1
  68. package/es/components/info-header/index.d.ts +2 -2
  69. package/es/components/info-header/src/InfoHeader.vue.d.ts +75 -75
  70. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +38 -38
  71. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +37 -37
  72. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  73. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  74. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  75. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  76. package/es/components/scale-view/style/index.css +1 -1
  77. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  78. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  79. package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -1
  80. package/es/components/shortcut-setter/index.d.ts +2 -1
  81. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +38 -37
  82. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  83. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +76 -6
  84. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +38 -3
  85. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +38 -3
  86. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +76 -6
  87. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +76 -6
  88. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +38 -3
  89. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +38 -3
  90. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +38 -3
  91. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +38 -3
  92. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +152 -12
  93. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +152 -12
  94. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  95. package/es/env.d.ts +25 -25
  96. package/es/shared/assets/img/failure.png.js +1 -1
  97. package/es/shared/assets/img/no-permission.png.js +1 -1
  98. package/es/shared/assets/img/nodata.png.js +1 -1
  99. package/es/shared/assets/img/notfound.png.js +1 -1
  100. package/es/shared/assets/img/qr.png.js +1 -1
  101. package/es/shared/assets/img/success.png.js +1 -1
  102. package/es/shared/assets/img/video.png.js +1 -1
  103. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  104. package/es/shared/assets/img/xb_big.png.js +1 -1
  105. package/es/shared/assets/img/xb_small.png.js +1 -1
  106. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +9 -0
  107. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  108. package/es/shared/hooks/useDateTime.d.ts +8 -2
  109. package/es/shared/hooks/useDateTime.js +1 -1
  110. package/es/shared/package.json.js +1 -1
  111. package/package.json +2 -2
  112. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  113. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  114. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  115. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  116. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  117. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  118. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -4,7 +4,6 @@ import { AnyObject } from '../../../../../../../../es/shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  formattedValue: {
6
6
  type: StringConstructor;
7
- default: undefined;
8
7
  };
9
8
  column: {
10
9
  type: PropType<VxeTableDefines.ColumnInfo>;
@@ -23,7 +22,6 @@ declare const _default: import("vue").DefineComponent<{
23
22
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
24
23
  formattedValue: {
25
24
  type: StringConstructor;
26
- default: undefined;
27
25
  };
28
26
  column: {
29
27
  type: PropType<VxeTableDefines.ColumnInfo>;
@@ -49,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
49
47
  timePickerRef: import("vue").Ref<any>;
50
48
  inputValue: import("vue").Ref<any>;
51
49
  __formattedValue: import("vue").Ref<any>;
52
- oldValue: string | undefined;
50
+ oldValue: any;
53
51
  placeholder: any;
54
52
  valueFormat: any;
55
53
  shortcutOptions: any;
@@ -76,7 +74,6 @@ declare const _default: import("vue").DefineComponent<{
76
74
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:formattedValue")[], "click" | "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
77
75
  formattedValue: {
78
76
  type: StringConstructor;
79
- default: undefined;
80
77
  };
81
78
  column: {
82
79
  type: PropType<VxeTableDefines.ColumnInfo>;
@@ -93,7 +90,5 @@ declare const _default: import("vue").DefineComponent<{
93
90
  }>> & {
94
91
  onClick?: ((...args: any[]) => any) | undefined;
95
92
  "onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
96
- }, {
97
- formattedValue: string;
98
- }>;
93
+ }, {}>;
99
94
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as l,inject as t,ref as a,watch as r,nextTick as o,openBlock as u,createBlock as i,unref as n,mergeProps as m,withCtx as c,createVNode as d,createElementBlock as v,Fragment as f,renderList as s,createTextVNode as p,toDisplayString as k,createCommentVNode as y}from"vue";import{NPopover as _,NInput as h,NSpace as w,NScrollbar as b,NButton as g}from"naive-ui";import{useIhoTableFormEvent as V}from"../../../../utils/index.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";var $=e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:$}){const j=e,I=l(),O=t("$xetable"),{emitFormChangeWithParams:P}=V({...j,$table:O}),R=a(null),S=a(!1),A=a(),E=a(),H=a();let U=j.formattedValue;const{placeholder:z="请选择",valueFormat:D="HH:mm",shortcutOptions:K=[]}=I,N={placeholder:z,valueFormat:D,format:D};function T(e){H.value=e,U!==e&&($("update:formattedValue",e),P({oldValue:U}),U=e)}function W(){[N.valueFormat.replace(/:/,""),N.valueFormat].some((e=>{const l=F((E.value||"").trim(),e,new Date);if(q(l)){return T(x(l,N.valueFormat)),!0}}))}function B(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=R.value)||l.blur(),S.value=!1)}return r((()=>j.formattedValue),(e=>{E.value=e,H.value=e}),{immediate:!0}),r((()=>S.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=A.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()})))})),(e,l)=>(u(),i(n(_),m({show:S.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>S.value=!1)}),{trigger:c((()=>[d(n(h),{ref_key:"formRef",ref:R,clearable:"",value:E.value,"onUpdate:value":l[0]||(l[0]=e=>E.value=e),onClick:l[1]||(l[1]=()=>S.value=!0),onChange:W,onKeydown:B},null,8,["value"])])),default:c((()=>[d(n(w),null,{default:c((()=>[d(n(C),m({ref_key:"timePickerRef",ref:A,show:"","formatted-value":H.value},n(N),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":T,onConfirm:l[2]||(l[2]=()=>S.value=!1)}),null,16,["formatted-value"]),d(n(b),{class:"iho-table__scrollbar"},{default:c((()=>[n(K).length?(u(),i(n(w),{key:0,vertical:"",wrap:!1},{default:c((()=>[(u(!0),v(f,null,s(n(K),(e=>(u(),i(n(g),{size:"tiny",key:e,onClick:l=>function(e){T(e),S.value=!1}(e)},{default:c((()=>[p(k(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):y("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}});export{$ as default};
1
+ import{defineComponent as e,useAttrs as l,inject as t,ref as a,watch as r,nextTick as o,openBlock as u,createBlock as i,unref as n,withCtx as m,createVNode as c,mergeProps as v,createElementBlock as d,Fragment as f,renderList as s,createTextVNode as p,toDisplayString as k,createCommentVNode as y}from"vue";import{NPopover as _,NInput as h,NSpace as w,NScrollbar as b,NButton as g}from"naive-ui";import{useIhoTableFormEvent as V}from"../../../../utils/index.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";var j=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:j}){const $=e,I=l(),O=t("$xetable"),{emitFormChangeWithParams:P}=V({...$,$table:O}),R=a(null),S=a(!1),A=a(),E=a(),H=a();let U=$.formattedValue;const{placeholder:z="请选择",valueFormat:D="HH:mm",shortcutOptions:K=[]}=I,M={placeholder:z,valueFormat:D,format:D};function N(e){if(H.value=e,U===e)return;const l=e||null;j("update:formattedValue",l),P({oldValue:U}),U=l}function T(){[M.valueFormat.replace(/:/,""),M.valueFormat].some((e=>{const l=F(E.value,e,new Date);if(!E.value||q(l)){return N(E.value?x(l,M.valueFormat):""),!0}return!1}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=R.value)||l.blur(),S.value=!1)}return r((()=>$.formattedValue),(e=>{E.value=e,H.value=e}),{immediate:!0}),r((()=>S.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=A.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()})))})),(e,l)=>(u(),i(n(_),{show:S.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:l[3]||(l[3]=()=>S.value=!1)},{trigger:m((()=>[c(n(h),{ref_key:"formRef",ref:R,clearable:"",value:E.value,"onUpdate:value":l[0]||(l[0]=e=>E.value=e),valueModifiers:{trim:!0},onClick:l[1]||(l[1]=()=>S.value=!0),onChange:T,onKeydown:W},null,8,["value"])])),default:m((()=>[c(n(w),null,{default:m((()=>[c(n(C),v({ref_key:"timePickerRef",ref:A,show:"","formatted-value":H.value},n(M),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":N,onConfirm:l[2]||(l[2]=()=>S.value=!1)}),null,16,["formatted-value"]),c(n(b),{class:"iho-table__scrollbar"},{default:m((()=>[n(K).length?(u(),i(n(w),{key:0,vertical:"",wrap:!1},{default:m((()=>[(u(!0),d(f,null,s(n(K),(e=>(u(),i(n(g),{size:"tiny",key:e,onClick:l=>function(e){N(e),S.value=!1}(e)},{default:m((()=>[p(k(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):y("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{j as default};
@@ -1 +1 @@
1
- import{createVNode as e,mergeProps as o}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../../../../constants/index.js";import{useAutoFocus as r}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as i}from"../../../../utils/index.js";import d from"./editTime.vue.js";import{defineTablePlugin as l}from"../../../../hooks/useTablePlugin.js";function m(){const m="timeRendererPlugin";return l({name:m,vxe(r){r.interceptor.add("event.clearActived",n(t.TIME,(e=>e.classList.contains("n-popover")))),r.renderer.add(t.TIME,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(d,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l,valueFormat:t.valueFormat},t.componentProps,{onClick:r}),null)]))})},apply(e){r(e).bindAutoFocusConfig(m,t.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)})}})}export{m as timeRendererPlugin};
1
+ import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as r}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as l,IhoTableRenderHelper as d,getLowCodeFieldFromField as m,isInvalidTime as u}from"../../../../utils/index.js";import a from"./editTime.vue.js";import{defineTablePlugin as f}from"../../../../hooks/useTablePlugin.js";function s(){const s="timeRendererPlugin";return f({name:s,vxe(t){t.interceptor.add("event.clearActived",l(n.TIME,(e=>e.classList.contains("n-popover")))),t.renderer.add(n.TIME,{renderCell:d.createDefaultRenderCell(),renderEdit:d.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(a,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l,valueFormat:t.valueFormat},t.componentProps,{onClick:r}),null)]))})},apply(e){i(e).bindAutoFocusConfig(s,n.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)}),e.eventHooks.onCellDblclick.tap(s,(({row:e,column:o,columnIndex:i,rowIndex:l},d,{$table:a})=>{var f,s,c,p;if((null==(f=o.editRender)?void 0:f.name)!==n.TIME||e[o.field])return;if(r(null==(s=d.editConfig)?void 0:s.beforeEditMethod)){if(!(null==(c=d.editConfig)?void 0:c.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:l,$table:a,$grid:a})))return}const v=t(new Date,(null==(p=m(o))?void 0:p.valueFormat)||"HH:mm");u(o,v)||(e[o.field]=v)}))}})}export{s as timeRendererPlugin};
@@ -95,7 +95,7 @@ export declare namespace IhoTableLowCodeField {
95
95
  }
96
96
  export declare type LowCodeTableFieldItem = {
97
97
  columnName: string;
98
- [K: string]: unknown;
98
+ [K: string]: any;
99
99
  } & Partial<{
100
100
  id: number | string;
101
101
  alias: string;
@@ -55,3 +55,5 @@ export declare function parseRichContent(richContent: string): any;
55
55
  export declare function parseMergeField(row: AnyObject, column: VxeTableDefines.ColumnInfo): any;
56
56
  export declare function isCompatibleColumn(field: LowCodeTableFieldItem): number | false;
57
57
  export declare function getTitle(column: VxeTableDefines.ColumnInfo, value?: string): string;
58
+ export declare function isInvalidTime(column: VxeTableDefines.ColumnInfo, newValue: MaybeRef<any>): boolean;
59
+ export declare function isInvalidDate(column: VxeTableDefines.ColumnInfo, row: AnyObject, newValue: MaybeRef<any>): any;
@@ -1 +1 @@
1
- import{reactive as e,inject as t,unref as n,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{isNumber as c,isFunction as s,isString as d,isObject as f,isArray as p}from"lodash-es";import{InjectionIhoTableConfig as m,InjectionIhoTableEmits as v,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as h,InjectionIhoTableUUID as E}from"../constants/index.js";import{getSeparateInfo as T}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function w(e){return console.warn(`[IhoTable]: ${e}`)}const C=Object.freeze({getCellType(e){var t;return((null==(t=e.settingObj)?void 0:t.attr)||e.formType||"DEFAULT").toUpperCase()}});function R(){var e,n,r;const o=t(m);return o||w("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(n=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:n.height)?r:32}function S(e){const t=e.slice(2);return`${t[0].toLowerCase()}${t.slice(1)}`}function O(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function P(t,n=!0){const r=n?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||t()).get(e)},setItemFromUUID:function(e,t){r.set(e,t)},removeItemFromUUID:function(e){r.delete(e)}}}async function F(e,t,r,o){const i=u();return c(i)||await a(0),u()||function(){const t=+e.colWidth;return c(t)?t:64}();function u(){var i;const u=null==(i=n(o))?void 0:i.getColumnByField(e.field);if(!u)return;const l=$(u);return l?s(l.separateWidth)?l.separateWidth({column:u,row:t,rowIndex:r,$table:n(o)}):c(l.separateWidth)?l.separateWidth:u.renderWidth:u.renderWidth}}function A(e){const o=t(v);function i(){var t;const r=n(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(t=r.column.editRender)?void 0:t.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function u(e={}){o("formChange",{...i(),...r(e)})}function l(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){u()},emitFormClick:function(){l()},emitFormChangeWithParams:u,emitFormClickWithParams:l}}function $(e){var t;return null==(t=e.editRender)?void 0:t.props}const b=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:n,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(n[r.field]);const i=t(E),u=T(i,n);if(!u)return c(n[r.field]);const{originalData:l=n,isLastRow:a}=u;return c(a?l[r.field]:null);function c(e){return[o("span",{title:_(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:t},n){return e({...n,fieldItem:t||{},...A(n)})}},isEditableColumn(e,t){var n;return!1!==(null==(n=e.editConfig)?void 0:n.showIcon)&&t.editRender&&!1!==t.editRender.enabled},hasFilter(e){if(y(e))return!0;let t=e.fieldSetting;return d(t)&&(t=i(t||"")),f(t)&&((n=t).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=n.mapping)?void 0:r.type));var n,r},hasDateFiler(e){var t;return null==(t=null==e?void 0:e.filterSetting)?void 0:t.daterange}}),x=Object.freeze({isPositive:e=>e===g.POSITIVE||e===I.POSITIVE,isNegative:e=>e===g.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==g.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==g.NEGATIVE&&e!==I.NEGATIVE}),N=(e,t)=>({$event:n,column:r})=>{var o;if(!u(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==n?void 0:n.target;return!f(i)||!l(i,t)};function V(e){return[h.TRANSFORM_WITH_SPAN_METHOD,h.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function W(e){return d(e)&&!!e.match(/^###\{[^{}]+}$/)}function D(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,t){if(e.$__SEPARATE||!t.editRender||!t.editRender.props)return e[t.field];const{fieldSetting:n}=t.editRender.props;if(!d(n))return e[t.field];const{mergedFeildExpression:r}=i(n);return r&&d(r)?r.replace(/#{(.+?)}/g,(function(t,n){let r=n?e[n.trim()]:null;W(r)&&(r=D(r).change_text);return r||(null==r?"--":r)})):e[t.field]}const j=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===g.NEGATIVE&&j.includes(C.getCellType(e))&&p(e.options)&&e.options.length}function _(e,t=""){return"tooltip"===e.showOverflow?"":t}export{b as IhoTableRenderHelper,x as IhoTableStatusHelper,C as IhoTableUtils,w as IhoTableWarn,N as createIhoTableClearActivedInterceptor,S as eventListener2EventName,O as eventName2EventListener,F as getColumnRenderWidth,$ as getLowCodeFieldFromField,R as getRowHeight,_ as getTitle,y as isCompatibleColumn,W as isRichContent,V as isTransformTreeType,U as parseMergeField,D as parseRichContent,A as useIhoTableFormEvent,P as useUUIDMap};
1
+ import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as l,findAncestor as u}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{parse as c,isValid as d,compareDesc as s}from"date-fns";import{isNumber as f,isFunction as p,isString as m,isObject as v,isArray as I}from"lodash-es";import{InjectionIhoTableConfig as g,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as E,IHO_TABLE_NUMBER_STATUS as w,IHO_TABLE_TREE_TYPE as T,InjectionIhoTableUUID as R}from"../constants/index.js";import{getSeparateInfo as S}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const F=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function D(){var e,t,r;const o=n(g);return o||C("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function O(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function P(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function A(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function $(e,n,r,o){const i=l();return f(i)||await a(0),l()||function(){const n=+e.colWidth;return f(n)?n:64}();function l(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?p(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):f(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}}function b(e){const o=n(h);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const N=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(R),l=S(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:G(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...b(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(M(e))return!0;let n=e.fieldSetting;return m(n)&&(n=i(n||"")),v(n)&&((t=n).notParticipatingSearch!==E.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),V=Object.freeze({isPositive:e=>e===w.POSITIVE||e===E.POSITIVE,isNegative:e=>e===w.NEGATIVE||e===E.NEGATIVE,notPositive:e=>e!==w.POSITIVE&&e!==E.POSITIVE,notNegative:e=>e!==w.NEGATIVE&&e!==E.NEGATIVE}),W=(e,n)=>({$event:t,column:r})=>{var o;if(!l(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==t?void 0:t.target;return!v(i)||!u(i,n)};function U(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function j(e){return m(e)&&!!e.match(/^###\{[^{}]+}$/)}function y(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function _(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!m(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&m(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;j(r)&&(r=y(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const H=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===w.NEGATIVE&&H.includes(F.getCellType(e))&&I(e.options)&&e.options.length}function G(e,n=""){return"tooltip"===e.showOverflow?"":n}function L(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},u=c(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!d(u)}function k(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!d(new Date(r))||m(l.connectField)&&n[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(n[l.connectField]))>0)}export{N as IhoTableRenderHelper,V as IhoTableStatusHelper,F as IhoTableUtils,C as IhoTableWarn,W as createIhoTableClearActivedInterceptor,O as eventListener2EventName,P as eventName2EventListener,$ as getColumnRenderWidth,x as getLowCodeFieldFromField,D as getRowHeight,G as getTitle,M as isCompatibleColumn,k as isInvalidDate,L as isInvalidTime,j as isRichContent,U as isTransformTreeType,_ as parseMergeField,y as parseRichContent,b as useIhoTableFormEvent,A as useUUIDMap};