cnhis-design-vue 3.2.7-release.0 → 3.2.7-release.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  2. package/es/components/classification/index.d.ts +60 -5
  3. package/es/components/classification/src/components/search-filter/index.vue.d.ts +60 -5
  4. package/es/components/classification/src/components/set-classification/index.vue.d.ts +60 -5
  5. package/es/components/classification/src/index.vue.d.ts +60 -5
  6. package/es/components/date-picker/index.d.ts +13 -0
  7. package/es/components/date-picker/src/DatePicker.vue.d.ts +13 -0
  8. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  9. package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
  10. package/es/components/fabric-chart/src/constants/index.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
  13. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
  15. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
  18. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
  20. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.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.d.ts +8 -3
  24. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
  26. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  27. package/es/components/fabric-chart/src/interface.d.ts +11 -1
  28. package/es/components/field-set/src/FieldColor.vue.d.ts +26 -0
  29. package/es/components/field-set/src/components/condition.vue.d.ts +13 -0
  30. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +26 -0
  31. package/es/components/field-set/src/components/edit-filter.vue.d.ts +13 -0
  32. package/es/components/form-config/index.d.ts +3 -3
  33. package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
  34. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
  35. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  36. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  37. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  38. package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
  39. package/es/components/form-render/src/types/index.d.ts +1 -1
  40. package/es/components/form-render/src/utils/business.js +1 -1
  41. package/es/components/form-render/src/utils/schema.d.ts +1 -1
  42. package/es/components/form-render/src/utils/schema.js +1 -1
  43. package/es/components/iho-chat/index.d.ts +204 -69
  44. package/es/components/iho-chat/src/Index.vue.d.ts +204 -69
  45. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  46. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +34 -13
  47. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  48. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +38 -13
  49. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  50. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +48 -14
  51. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  52. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +20 -3
  53. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  54. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +13 -0
  55. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  56. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +3 -10
  57. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  58. package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
  59. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  60. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +47 -22
  61. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  62. package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
  63. package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
  64. package/es/components/iho-chat/src/hooks/useSearchUserList.d.ts +11 -0
  65. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -0
  66. package/es/components/iho-chat/src/types/index.d.ts +0 -1
  67. package/es/components/iho-chat/style/index.css +1 -1
  68. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +13 -0
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +13 -0
  70. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +20 -2
  71. package/es/components/index.css +1 -1
  72. package/es/components/shortcut-setter/index.d.ts +1 -1
  73. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
  74. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +13 -0
  75. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +13 -0
  76. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +13 -0
  77. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +13 -0
  78. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +47 -5
  79. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +13 -0
  80. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +13 -0
  81. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +37 -19
  82. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -1
  83. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +47 -5
  84. package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
  85. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +47 -5
  86. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +13 -0
  87. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +13 -0
  88. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +13 -0
  89. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +13 -0
  90. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +33 -18
  91. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  92. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +13 -0
  93. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  94. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +69 -4
  95. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +69 -4
  96. package/es/components/table-filter/src/tool/transformData.js +1 -1
  97. package/es/components/table-filter/src/types/index.d.ts +1 -0
  98. package/es/components/time-picker/index.d.ts +20 -2
  99. package/es/components/time-picker/src/TimePicker.vue.d.ts +21 -2
  100. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  101. package/es/shared/package.json.js +1 -1
  102. package/es/shared/utils/business.js +1 -1
  103. package/package.json +2 -2
@@ -200,6 +200,10 @@ declare const _default: import("vue").DefineComponent<{
200
200
  allowedInvalidValue: {
201
201
  type: StringConstructor;
202
202
  };
203
+ to: {
204
+ type: PropType<string | false | HTMLElement>;
205
+ default: string;
206
+ };
203
207
  }, {
204
208
  attrs: {
205
209
  [x: string]: unknown;
@@ -220,6 +224,10 @@ declare const _default: import("vue").DefineComponent<{
220
224
  allowedInvalidValue: {
221
225
  type: StringConstructor;
222
226
  };
227
+ to: {
228
+ type: PropType<string | false | HTMLElement>;
229
+ default: string;
230
+ };
223
231
  }>> & {
224
232
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
225
233
  }>>;
@@ -256,10 +264,15 @@ declare const _default: import("vue").DefineComponent<{
256
264
  allowedInvalidValue: {
257
265
  type: StringConstructor;
258
266
  };
267
+ to: {
268
+ type: PropType<string | false | HTMLElement>;
269
+ default: string;
270
+ };
259
271
  }>> & {
260
272
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
261
273
  }, {
262
274
  updateUnchangedValue: boolean;
275
+ to: string | false | HTMLElement;
263
276
  }>>;
264
277
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
265
278
  data: {
@@ -1911,7 +1911,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1911
1911
  wrapperStyle?: Record<string, string> | undefined;
1912
1912
  childFieldStrategy?: "checked" | "all" | undefined;
1913
1913
  childWidthMode?: "inner" | "outer" | undefined;
1914
- validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
1914
+ validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
1915
1915
  reactions?: {
1916
1916
  [x: string]: any;
1917
1917
  dependencies?: string[] | undefined;
@@ -2158,7 +2158,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2158
2158
  wrapperStyle?: Record<string, string> | undefined;
2159
2159
  childFieldStrategy?: "checked" | "all" | undefined;
2160
2160
  childWidthMode?: "inner" | "outer" | undefined;
2161
- validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
2161
+ validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2162
2162
  reactions?: {
2163
2163
  [x: string]: any;
2164
2164
  dependencies?: string[] | undefined;
@@ -2376,7 +2376,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2376
2376
  wrapperStyle?: Record<string, string> | undefined;
2377
2377
  childFieldStrategy?: "checked" | "all" | undefined;
2378
2378
  childWidthMode?: "inner" | "outer" | undefined;
2379
- validator?: ((value: unknown, fieldItem: import("..").FieldItem) => string | void) | undefined;
2379
+ validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2380
2380
  reactions?: {
2381
2381
  [x: string]: any;
2382
2382
  dependencies?: string[] | undefined;
@@ -1914,7 +1914,7 @@ declare const _default: import("vue").DefineComponent<{
1914
1914
  wrapperStyle?: Record<string, string> | undefined;
1915
1915
  childFieldStrategy?: "checked" | "all" | undefined;
1916
1916
  childWidthMode?: "inner" | "outer" | undefined;
1917
- validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
1917
+ validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
1918
1918
  reactions?: {
1919
1919
  [x: string]: any;
1920
1920
  dependencies?: string[] | undefined;
@@ -2161,7 +2161,7 @@ declare const _default: import("vue").DefineComponent<{
2161
2161
  wrapperStyle?: Record<string, string> | undefined;
2162
2162
  childFieldStrategy?: "checked" | "all" | undefined;
2163
2163
  childWidthMode?: "inner" | "outer" | undefined;
2164
- validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
2164
+ validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2165
2165
  reactions?: {
2166
2166
  [x: string]: any;
2167
2167
  dependencies?: string[] | undefined;
@@ -2379,7 +2379,7 @@ declare const _default: import("vue").DefineComponent<{
2379
2379
  wrapperStyle?: Record<string, string> | undefined;
2380
2380
  childFieldStrategy?: "checked" | "all" | undefined;
2381
2381
  childWidthMode?: "inner" | "outer" | undefined;
2382
- validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem) => string | void) | undefined;
2382
+ validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
2383
2383
  reactions?: {
2384
2384
  [x: string]: any;
2385
2385
  dependencies?: string[] | undefined;
@@ -417,7 +417,7 @@ declare const _default: import("vue").DefineComponent<{
417
417
  wrapperStyle?: Record<string, string> | undefined;
418
418
  childFieldStrategy?: "checked" | "all" | undefined;
419
419
  childWidthMode?: "inner" | "outer" | undefined;
420
- validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
420
+ validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
421
421
  reactions?: {
422
422
  [x: string]: any;
423
423
  dependencies?: string[] | undefined;
@@ -664,7 +664,7 @@ declare const _default: import("vue").DefineComponent<{
664
664
  wrapperStyle?: Record<string, string> | undefined;
665
665
  childFieldStrategy?: "checked" | "all" | undefined;
666
666
  childWidthMode?: "inner" | "outer" | undefined;
667
- validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
667
+ validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
668
668
  reactions?: {
669
669
  [x: string]: any;
670
670
  dependencies?: string[] | undefined;
@@ -882,7 +882,7 @@ declare const _default: import("vue").DefineComponent<{
882
882
  wrapperStyle?: Record<string, string> | undefined;
883
883
  childFieldStrategy?: "checked" | "all" | undefined;
884
884
  childWidthMode?: "inner" | "outer" | undefined;
885
- validator?: ((value: unknown, fieldItem: FieldItem) => string | void) | undefined;
885
+ validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
886
886
  reactions?: {
887
887
  [x: string]: any;
888
888
  dependencies?: string[] | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,ref as i,inject as t,watch as l,toRaw as a,openBlock as r,createElementBlock as n,Fragment as s,createVNode as u,unref as d,mergeProps as m,nextTick as v}from"vue";import{cloneDeep as f}from"lodash-es";import{InjectionActiveFieldItem as p}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as c}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as g}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as h}from"../hooks/useConfigurationField.js";import"../../../index.js";import y from"../../../form-render/index.js";var b=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:b}){const j=e,x=o((()=>`#${j.uuid} .form-config__config`)),F=i(),w=t(p),R=i([]),k=i({}),{generateFieldListByFormConfigItem:C}=h(),P=i(!1);async function _(){var e;w.value=L,await v(),null==(e=F.value)||e.validate()}let L=null;function O({fieldKey:e,value:o}){w.value&&(w.value[e]=o)}return l(w,(async(e,o)=>{var i,t,l;if(!e)return R.value=[];if(o&&e!==L)try{await(null==(i=F.value)?void 0:i.validate())}catch(e){return P.value=!0}L=e,k.value={editable:!0,show:!0,...f(a(e))};const r=null==(t=j.bindFormRenderRef)?void 0:t.getFieldList();R.value=C(e,c(r,e.key)).map((e=>({...e,componentProps:{...e.componentProps,to:x.value}}))),null==(l=F.value)||l.reload()}),{immediate:!0}),b({validate(){var e;return null==(e=F.value)?void 0:e.validate()}}),(o,i)=>(r(),n(s,null,[u(d(y),m({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:F,onFormChange:O,"field-list":R.value,"initial-data":k.value}),null,16,["field-list","initial-data"]),u(d(g),{show:P.value,"onUpdate:show":i[0]||(i[0]=e=>P.value=e),preset:"dialog",to:d(x),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:_},null,8,["show","to"])],64))}});export{b as default};
1
+ import{defineComponent as e,computed as i,ref as o,inject as l,watch as t,toRaw as a,openBlock as r,createElementBlock as n,Fragment as s,createVNode as u,unref as d,mergeProps as m,nextTick as v}from"vue";import{cloneDeep as f}from"lodash-es";import{InjectionActiveFieldItem as p}from"../constants/index.js";import"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{findFieldItemByKey as c}from"../utils/index.js";import"@vicons/ionicons5";import{NModal as g}from"naive-ui";import"../../../../shared/utils/index.js";import{useConfigurationField as h}from"../hooks/useConfigurationField.js";import"../../../index.js";import y from"../../../form-render/index.js";var b=e({__name:"FormConfigEdit",props:{uuid:{type:String,required:!0},bindFormRenderRef:{type:Object},formProps:{type:Object}},setup(e,{expose:b}){const j=e,x=i((()=>`#${j.uuid} .form-config__config`)),F=o(),w=l(p),R=o([]),k=o({}),{generateFieldListByFormConfigItem:C}=h(),_=o(!1);async function P(){var e;w.value=L,await v(),null==(e=F.value)||e.validate()}let L=null;function O({fieldKey:e,value:i}){w.value&&(w.value[e]=i)}return t(w,(async(e,i)=>{var o,l,t;if(!e)return R.value=[];if(i&&e!==L)try{await(null==(o=F.value)?void 0:o.validate())}catch(e){return _.value=!0}L=e,k.value={editable:!0,show:!0,...f(a(e))};const r=null==(l=j.bindFormRenderRef)?void 0:l.getFieldList();R.value=C(e,c(r,e.key)),null==(t=F.value)||t.reload()}),{immediate:!0}),b({validate(){var e;return null==(e=F.value)?void 0:e.validate()}}),(i,o)=>(r(),n(s,null,[u(d(y),m({size:"small"},e.formProps,{column:12,ref_key:"formRenderRef",ref:F,onFormChange:O,"field-list":R.value,"initial-data":k.value}),null,16,["field-list","initial-data"]),u(d(g),{show:_.value,"onUpdate:show":o[0]||(o[0]=e=>_.value=e),preset:"dialog",to:d(x),"close-on-esc":!1,"mask-closable":!1,closable:!1,title:"存在填写错误的字段","positive-text":"继续编辑",onPositiveClick:P},null,8,["show","to"])],64))}});export{b as default};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";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"],{...i(o,["wordbook","autograph"])})}function u(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function f(e){return"1"===e||!0===e}function x(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==_?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=h(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},v=e=>{var o,t,n,l,s,a,p,c,d,x,_,h,v,g;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==(n=e.componentProps)?void 0:n.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!=(x=null==(d=e.componentProps)?void 0:d.showField)?x:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(v=e.componentProps)?void 0:v.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,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},g=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"],{...i(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:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",v],["REMOTE_SEARCH",v],["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}),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}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=b(e);return Object.assign(o["x-component-props"],{...i(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",g],["CHECKBOX",g],["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:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=b(e);Array.isArray(e.properties)&&l("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"],i(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,i={column:9999}){let r=null;const l=j.call(t(o),i).reduce(((e,o,n)=>{var l;const a=null==(l=(o=E.call(o,i)).validate)?void 0:l.obj_type;return a&&x&&x.collect(a,t(o)),"LINEBAR"===o.html_type?(e[p(o)]=s(w(o),n),r=e[p(o)].properties={}):r?r[p(o)]=s(O(o),n):(r=null,e[p(o)]=s(O(o),n)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{if("LINEBAR"!==e["x-component"])return;e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const o=Object.keys(e.properties||{}).map((o=>`${e.name}.${o}#selfDisplay`));e["x-reactions"].push({dependencies:o,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function p(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:k}}export{x as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as l}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{traverseSchema as a,fieldKeyEscape as p,createLinebarId as c}from"../utils/schema.js";import{useFormValidator as d}from"./useFormValidator.js";import{transformDateFormat as m}from"../utils/business.js";function u(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function f(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function x(e){return"1"===e||!0===e}function _(n,_){const{createValidatorSchema:b}=d(),v=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=b(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},g=e=>{var o,t,n,l,s,a,p,c,d,m,_,h,b,g;const y=v(e);e.urlConfig?f(y,e):e.autograph&&u(y,e);const w=!!e.__multiple,C=x(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=x(null!=(l=null==(n=e.componentProps)?void 0:n.selectAll)?l:e.selectAll),A=x(null!=(a=null==(s=e.componentProps)?void 0:s.shouldSave)?a:e.save_free_entry),E=x(null!=(c=null==(p=e.componentProps)?void 0:p.allowCreate)?c:e.free_entry),j=null!=(m=null==(d=e.componentProps)?void 0:d.showField)?m:e.show_key,k=null!=(h=null==(_=e.componentProps)?void 0:_.options)?h:e.option,N=null!=(g=r(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.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,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},y=e=>{var o,t;const n=v(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?f(n,e):e.autograph&&u(n,e),n},w=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},C=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:c(e.val_key),show:"0"!==e.is_show,remark:e.remark},"x-content":e.slots}),O=new Map([["LINEBAR",C],["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=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return!0!==i&&"1"!==i||(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:r(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=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:m(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(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=v(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=v(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",y],["CHECKBOX",y],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&l("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?N(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"],i(e,["wrapperStyle","display"])),o}]]),A=e=>{if(e.suffixConfig)return E(e);return(O.get(e.html_type)||w)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return A(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=v(o),r=n.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(i,{type:"void",name:p(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:N(n)}),i},{FieldNormalizeWaterfallHook:j,FieldListNormalizeWaterfallHook:k}=s();function N(o,i={column:9999}){let r=null;const l=k.call(t(o),i).reduce(((e,o,l)=>{var a;const p=null==(a=(o=j.call(o,i)).validate)?void 0:a.obj_type;return p&&n&&n.collect(p,t(o)),"LINEBAR"===o.html_type?(e[c(o)]=s(C(o),l),r=e[c(o)].properties={}):r?r[c(o)]=s(A(o),l):(r=null,e[c(o)]=s(A(o),l)),e}),{});return i.linebarAutoHidden&&Object.values(l).forEach((e=>{"LINEBAR"===e["x-component"]&&h(e)})),a({properties:l,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&h(e,!!o&&!o["x-root"])})),l;function s(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function c(o){return o.suffixConfig?p([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:N}}function h(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":""}${e.name}.${t}#selfDisplay`));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:'{{hasVisible($deps) && $self.selfDisplay==="visible"}}'}}})}export{_ as useFieldListAdaptor};
@@ -1 +1 @@
1
- import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:a=>e(a,m)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
1
+ import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import{isIdCard as u}from"../utils/business.js";function n(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&u(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:u,min_length:n,message:o,max_value:t,min_value:g,decimal_length:v}={},validator:d}=m;if(d&&e(d).forEach((e=>{l(e)&&r.push({validator:(a,i,r)=>e(a,m,r)})})),u&&r.push({max:u,message:o}),n&&r.push({min:n,message:o}),t&&r.push({maximum:t,message:o}),g&&r.push({minimum:g,message:o}),null!=v&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+v,o)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const o=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?"":e<Number(a.minimum)&&a.message||""):""})}));export{n as useFormValidator,o as validateMessageLocale};
@@ -1,5 +1,6 @@
1
1
  import { FormRequestDefine } from '../../../../shared/hooks';
2
2
  import { AnyObject, ArrayAble, LowCodeTypes } from '../../../../shared/types';
3
+ import { Field } from '@formily/core';
3
4
  import { SchemaEffectTypes, SchemaTypes } from '@formily/vue';
4
5
  import { VNode } from 'vue';
5
6
  import { DependKeyType, FormCommonState } from '../../../../components/form-render';
@@ -158,7 +159,7 @@ export type FieldItem = {
158
159
  * @param fieldItem 配置参数
159
160
  * @return {void|string} 返回校验信息
160
161
  */
161
- validator: (value: unknown, fieldItem: FieldItem) => void | string;
162
+ validator: (value: unknown, fieldItem: FieldItem, field: Field) => void | string;
162
163
  reactions: ArrayAble<ReactionType>;
163
164
  [key: string]: any;
164
165
  }>;
@@ -15,7 +15,7 @@ export interface FieldVisitorContext {
15
15
  insertAfter(f: FieldItem | FieldItem[]): void;
16
16
  }
17
17
  export type FieldVisitor = Record<string, (context: FieldVisitorContext) => void>;
18
- export type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours', number>;
18
+ export type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours' | 'minutes', number>;
19
19
  export type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeContext;
20
20
  export type FormRenderExpose = {
21
21
  formModel: Form;
@@ -1 +1 @@
1
- import{differenceInDays as t,differenceInMonths as e,differenceInYears as n,differenceInHours as a,format as r}from"date-fns";import{isString as s}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as u}from"../constants/index.js";function d(t){return((t,e,n)=>{const a={},r=1-t.substr(e,1)%2;a.sex=1===r?u.FEMALE:u.MALE;const s=(2==n?"19":"")+t.substr(6,n),o=t.substr(6+n,2),d=t.substr(8+n,2);a.birthday=s+"-"+o+"-"+d+" 00:00";const c=new Date,i=c.getMonth()+1<parseInt(o,10)||c.getMonth()+1==parseInt(o,10)&&c.getDate()<parseInt(d,10)?1:0;return Object.assign(a,g(a.birthday)),a.age=a.year=c.getFullYear()-parseInt(s,10)-i,a})(t,15==t.length?14:16,15==t.length?2:4)}function c(t=""){if(!s(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),a=t.includes("d"),r=t.includes("H"),o=t.includes("m"),u=t.includes("s");return e||n||a||!(r||o||u)?r||o||u?"datetime":!e||n||a?!e&&n&&a?"month":"date":"year":"time"}const i=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,h=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/;function f(t){return i.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let a=0;a<17;a++)n+=+t[a]*e[a];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||h.test(t)}function l(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function g(r){const s={},o=new Date,u=new Date(r);return s.day=t(o,u),s.month=e(o,u),s.age=s.year=n(o,u),s.hours=a(o,u),s}function m(t,e,n="yyyy-MM-dd HH:mm"){var a;const s=new Date,u={[o.MINUTE]:()=>d(s,"Minutes",t),[o.HOUR]:()=>d(s,"Hours",t),[o.DAY]:()=>d(s,"Date",t),[o.WEEK]:()=>d(s,"Date",7*t),[o.MONTH]:()=>d(s,"Month",t),[o.YEAR]:()=>d(s,"FullYear",t)};return null==(a=u[e])||a.call(u),r(function(t,e){const n=[{[o.DAY]:"Date",[o.WEEK]:"Date",[o.MONTH]:"Date",[o.YEAR]:"Date"},{[o.HOUR]:"Hours"},{[o.MINUTE]:"Minutes"}],a=n.findIndex((t=>Reflect.has(t,e)));~a&&n.slice(a+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(s,e),n);function d(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function M(t){const e=t.hours<24?{ageUnit:o.HOUR,age:Math.max(t.hours,1)}:t.day<30?{ageUnit:o.DAY,age:Math.max(t.day,1)}:t.day<365?{ageUnit:o.MONTH,age:Math.max(t.month,1)}:{ageUnit:o.YEAR,age:Math.max(t.year,1)};return e.age=Math.max(e.age,1),e}const D=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function y(t){if(!s(t))return;const e=t.match(D);if(!e)return;const[,n,a,r,o,u,d]=e;return new Date(`${n}-${a}-${r||"01"} ${o||"00"}:${u||"00"}:${d||"00"}`)}export{y as businessDateParser,f as isIdCard,l as isMobile,m as parseAge2Birthday,M as parseAgeFromContext,g as parseBirthday,d as parseIdCard,c as transformDateFormat};
1
+ import{format as t,differenceInDays as e,differenceInMonths as n,differenceInYears as r,differenceInHours as s,differenceInMinutes as a}from"date-fns";import{isString as u}from"lodash-es";import{FIELD_AGE_UNIT as o,FIELD_SEX_VALUE as d}from"../constants/index.js";function i(t){return((t,e,n)=>{const r={},s=1-t.substr(e,1)%2;r.sex=1===s?d.FEMALE:d.MALE;const a=(2==n?"19":"")+t.substr(6,n),u=t.substr(6+n,2),o=t.substr(8+n,2);r.birthday=a+"-"+u+"-"+o+" 00:00";const i=new Date,c=i.getMonth()+1<parseInt(u,10)||i.getMonth()+1==parseInt(u,10)&&i.getDate()<parseInt(o,10)?1:0;return Object.assign(r,m(r.birthday)),r.age=r.year=i.getFullYear()-parseInt(a,10)-c,r})(t,15==t.length?14:16,15==t.length?2:4)}function c(t=""){if(!u(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),r=t.includes("d"),s=t.includes("H"),a=t.includes("m"),o=t.includes("s");return e||n||r||!(s||a||o)?s||a||o?"datetime":!e||n||r?!e&&n&&r?"month":"date":"year":"time"}const l=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,f=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/;function g(t){return l.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let r=0;r<17;r++)n+=+t[r]*e[r];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||f.test(t)}function h(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function m(t){const u={},o=new Date,d=new Date(t),i=[["day",e],["month",n],["year",r],["hours",s],["minutes",a]];return Object.defineProperties(u,i.reduce(((t,[e,n])=>(t[e]={get:(()=>{let t=null;return()=>(null===t&&(t=n(o,d)),t)})()},t)),{})),u}function M(e,n,r="yyyy-MM-dd HH:mm"){var s;const a=new Date,u={[o.MINUTE]:()=>d(a,"Minutes",e),[o.HOUR]:()=>d(a,"Hours",e),[o.DAY]:()=>d(a,"Date",e),[o.WEEK]:()=>d(a,"Date",7*e),[o.MONTH]:()=>d(a,"Month",e),[o.YEAR]:()=>d(a,"FullYear",e)};return null==(s=u[n])||s.call(u),t(function(t,e){const n=[{[o.DAY]:"Date",[o.WEEK]:"Date",[o.MONTH]:"Date",[o.YEAR]:"Date"},{[o.HOUR]:"Hours"},{[o.MINUTE]:"Minutes"}],r=n.findIndex((t=>Reflect.has(t,e)));~r&&n.slice(r+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(a,n),r);function d(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function D(t){const e=t.minutes<60?{ageUnit:o.MINUTE,age:t.minutes}:t.hours<24?{ageUnit:o.HOUR,age:t.hours}:t.day<30?{ageUnit:o.DAY,age:t.day}:t.day<365?{ageUnit:o.MONTH,age:t.month}:{ageUnit:o.YEAR,age:t.year};return e.age=Math.max(e.age,1),e}const y=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function E(t){if(!u(t))return;const e=t.match(y);if(!e)return;const[,n,r,s,a,o,d]=e;return new Date(`${n}-${r}-${s||"01"} ${a||"00"}:${o||"00"}:${d||"00"}`)}export{E as businessDateParser,g as isIdCard,h as isMobile,M as parseAge2Birthday,D as parseAgeFromContext,m as parseBirthday,i as parseIdCard,c as transformDateFormat};
@@ -3,7 +3,7 @@ import { GeneralField } from '@formily/core';
3
3
  import { ISchema } from '@formily/json-schema/esm/types';
4
4
  import { Ref } from 'vue';
5
5
  import { DependKeyType, FieldItem, ObjectDependKey } from '../../../../components/form-render';
6
- export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema) => void): void;
6
+ export declare function traverseSchema(schema: ISchema, handler: (_s: ISchema, parent?: ISchema) => void, parent?: ISchema): void;
7
7
  export declare function fieldKeyEscape(fieldList: FieldItem[]): string;
8
8
  export declare function dotEscape(id: string): string;
9
9
  export declare function createFieldAddressId(id: string): string;
@@ -1 +1 @@
1
- import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r){r(e),t(e.properties)&&Object.values(e.properties).forEach((e=>{i(e,r)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`address-${e}`)}function s(e){return l(`id-${e}`)}function p(e,r){e&&function(){const r=new Map;o(e)?e.forEach((e=>{var n;t(e)?r.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,dependKey:e}):r.set(e,e)})):t(e)?Object.entries(e).forEach((([e,t])=>{r.set(e,t)})):n(e)&&r.set(e,e);return r}().forEach(((e,t)=>{if(n(e))return r(t,e);r(t,e.key,e.dependKey)}))}function d(e,t){let r=null;for(const o of t){if(o.val_key===e){n(o)&&(r=null);break}n(o)&&(r=o.val_key)}return r;function n(e){return"LINEBAR"===e.html_type}}function v(t,n){const o={...t};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var t;const o=null==(t=n.decoratorProps)?void 0:t.beforeSetValue;if(u(o)){const t=o(n.path.toString(),e,{field:n,oldValue:n.value});return r(t)?t.then((e=>n.setValue(e)),a):n.setValue(t)}n.setValue(e)}}),o}function m(t,r){const n={...t};return e(r)&&(n.key=void 0===n.value?0:1),n}function y(t,r){const n={...t};return e(r)&&(n.onClear=()=>r.visited=!0),n}function h(e){return{type:"object",properties:e}}function k(t,r){return(...n)=>(e(t.value)&&(t.value.visited=!0),u(r)?r(...n):void 0)}export{y as assignClearBindVisited,v as assignUpdateValue,m as assignValueBindKey,f as createFieldAddressId,s as createLinebarId,h as createObjSchema,k as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,d as getParentLinebar,p as traverseDependKey,i as traverseSchema};
1
+ import{isField as e}from"@formily/core";import{isObject as t,isPromise as r}from"@vue/shared";import{isString as n,isArray as o,isFunction as u,noop as a}from"lodash-es";function i(e,r,n){r(e,n),t(e.properties)&&Object.values(e.properties).forEach((t=>{i(t,r,e)}))}function c(e){return l(e.map((e=>e.val_key)).join("-"))}function l(e){return e.replace(/[.]/g,"-")}function f(e){return l(`address-${e}`)}function s(e){return l(`id-${e}`)}function p(e,r){e&&function(){const r=new Map;o(e)?e.forEach((e=>{var n;t(e)?r.set(e.paramName,{key:null!=(n=e.paramValue)?n:e.paramName,dependKey:e}):r.set(e,e)})):t(e)?Object.entries(e).forEach((([e,t])=>{r.set(e,t)})):n(e)&&r.set(e,e);return r}().forEach(((e,t)=>{if(n(e))return r(t,e);r(t,e.key,e.dependKey)}))}function d(e,t){let r=null;for(const o of t){if(o.val_key===e){n(o)&&(r=null);break}n(o)&&(r=o.val_key)}return r;function n(e){return"LINEBAR"===e.html_type}}function v(t,n){const o={...t};return e(n)&&Object.assign(o,{"onUpdate:value"(e){var t;const o=null==(t=n.decoratorProps)?void 0:t.beforeSetValue;if(u(o)){const t=o(n.path.toString(),e,{field:n,oldValue:n.value});return r(t)?t.then((e=>n.setValue(e)),a):n.setValue(t)}n.setValue(e)}}),o}function m(t,r){const n={...t};return e(r)&&(n.key=void 0===n.value?0:1),n}function y(t,r){const n={...t};return e(r)&&(n.onClear=()=>r.visited=!0),n}function h(e){return{type:"object",properties:e}}function k(t,r){return(...n)=>(e(t.value)&&(t.value.visited=!0),u(r)?r(...n):void 0)}export{y as assignClearBindVisited,v as assignUpdateValue,m as assignValueBindKey,f as createFieldAddressId,s as createLinebarId,h as createObjSchema,k as createVisitedSetter,l as dotEscape,c as fieldKeyEscape,d as getParentLinebar,p as traverseDependKey,i as traverseSchema};