cnhis-design-vue 3.1.52-beta.0 → 3.1.52-beta.10

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 (76) hide show
  1. package/es/components/body-select/index.d.ts +47 -0
  2. package/es/components/body-select/index.js +1 -0
  3. package/es/components/body-select/src/config/index.d.ts +101 -0
  4. package/es/components/body-select/src/config/index.js +1 -0
  5. package/es/components/body-select/src/hooks/renderCanvas.d.ts +6 -0
  6. package/es/components/body-select/src/hooks/renderCanvas.js +1 -0
  7. package/es/components/body-select/src/index.vue.d.ts +48 -0
  8. package/es/components/body-select/src/index.vue.js +1 -0
  9. package/es/components/body-select/src/index.vue2.js +1 -0
  10. package/es/components/body-select/style/index.css +1 -0
  11. package/es/components/callback/src/components/render/popupMaps.d.ts +1 -1
  12. package/es/components/classification/index.d.ts +40 -6
  13. package/es/components/classification/src/components/search-filter/index.vue.d.ts +40 -6
  14. package/es/components/classification/src/components/set-classification/index.vue.d.ts +40 -6
  15. package/es/components/classification/src/index.vue.d.ts +40 -6
  16. package/es/components/date-picker/index.d.ts +20 -3
  17. package/es/components/date-picker/src/DatePicker.vue.d.ts +20 -3
  18. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  19. package/es/components/form-config/index.d.ts +9 -2
  20. package/es/components/form-config/src/FormConfig.vue.d.ts +9 -2
  21. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
  22. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -1
  23. package/es/components/form-render/index.d.ts +1 -1
  24. package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
  25. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
  26. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  27. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +18 -0
  28. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  29. package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -1
  30. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  31. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  32. package/es/components/form-render/src/hooks/useFormEvent.d.ts +2 -2
  33. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  34. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  35. package/es/components/form-render/src/types/index.d.ts +2 -2
  36. package/es/components/form-render/style/index.css +1 -1
  37. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
  38. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +20 -3
  39. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +20 -3
  40. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  41. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  42. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  43. package/es/components/index.css +1 -1
  44. package/es/components/index.d.ts +2 -1
  45. package/es/components/index.js +1 -1
  46. package/es/components/info-header/index.d.ts +2 -2
  47. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -2
  48. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -1
  49. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -1
  50. package/es/components/recommend-search/index.d.ts +1 -1
  51. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +1 -1
  52. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  53. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  54. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  55. package/es/components/scale-view/style/index.css +1 -1
  56. package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -1
  57. package/es/components/shortcut-setter/index.d.ts +2 -1
  58. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -1
  59. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +40 -6
  60. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +20 -3
  61. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +20 -3
  62. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +40 -6
  63. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +40 -6
  64. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +20 -3
  65. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +20 -3
  66. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +20 -3
  67. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +20 -3
  68. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +80 -12
  69. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +80 -12
  70. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  71. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +9 -0
  72. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  73. package/es/shared/hooks/useDateTime.d.ts +7 -2
  74. package/es/shared/hooks/useDateTime.js +1 -1
  75. package/es/shared/package.json.js +1 -1
  76. package/package.json +2 -2
@@ -476,6 +476,9 @@ export declare const WidgetCfgMaps: Map<string, {
476
476
  onConfirm: {
477
477
  type: FunctionConstructor;
478
478
  };
479
+ formattedValue: {
480
+ type: StringConstructor;
481
+ };
479
482
  }, {
480
483
  attrs: {
481
484
  [x: string]: unknown;
@@ -487,9 +490,17 @@ export declare const WidgetCfgMaps: Map<string, {
487
490
  onConfirm: {
488
491
  type: FunctionConstructor;
489
492
  };
490
- }>> & {}>>;
493
+ formattedValue: {
494
+ type: StringConstructor;
495
+ };
496
+ }>> & {
497
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
498
+ }>>;
499
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
491
500
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
492
501
  panelInstRef: import("vue").Ref<null>;
502
+ placeholder: import("vue").Ref<any>;
503
+ currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
493
504
  isDateTime: import("vue").ComputedRef<boolean>;
494
505
  formatRef: import("vue").ComputedRef<string>;
495
506
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -498,15 +509,21 @@ export declare const WidgetCfgMaps: Map<string, {
498
509
  handleConfirm: (target: HTMLInputElement) => void;
499
510
  onUpdateShow: (show: boolean) => void;
500
511
  onConfirm: (...args: any[]) => Promise<void>;
512
+ isOtherValue: (value?: string) => boolean;
501
513
  NDatePicker: any;
502
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
514
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
503
515
  updateUnchangedValue: {
504
516
  type: BooleanConstructor;
505
517
  };
506
518
  onConfirm: {
507
519
  type: FunctionConstructor;
508
520
  };
509
- }>>, {
521
+ formattedValue: {
522
+ type: StringConstructor;
523
+ };
524
+ }>> & {
525
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
526
+ }, {
510
527
  updateUnchangedValue: boolean;
511
528
  }>>;
512
529
  DateQuickBtn: import("vue").DefineComponent<{
@@ -701,6 +718,9 @@ export declare const WidgetCfgMaps: Map<string, {
701
718
  onConfirm: {
702
719
  type: FunctionConstructor;
703
720
  };
721
+ formattedValue: {
722
+ type: StringConstructor;
723
+ };
704
724
  }, {
705
725
  attrs: {
706
726
  [x: string]: unknown;
@@ -712,9 +732,17 @@ export declare const WidgetCfgMaps: Map<string, {
712
732
  onConfirm: {
713
733
  type: FunctionConstructor;
714
734
  };
715
- }>> & {}>>;
735
+ formattedValue: {
736
+ type: StringConstructor;
737
+ };
738
+ }>> & {
739
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
740
+ }>>;
741
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
716
742
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
717
743
  panelInstRef: import("vue").Ref<null>;
744
+ placeholder: import("vue").Ref<any>;
745
+ currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
718
746
  isDateTime: import("vue").ComputedRef<boolean>;
719
747
  formatRef: import("vue").ComputedRef<string>;
720
748
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -723,15 +751,21 @@ export declare const WidgetCfgMaps: Map<string, {
723
751
  handleConfirm: (target: HTMLInputElement) => void;
724
752
  onUpdateShow: (show: boolean) => void;
725
753
  onConfirm: (...args: any[]) => Promise<void>;
754
+ isOtherValue: (value?: string) => boolean;
726
755
  NDatePicker: any;
727
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
756
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
728
757
  updateUnchangedValue: {
729
758
  type: BooleanConstructor;
730
759
  };
731
760
  onConfirm: {
732
761
  type: FunctionConstructor;
733
762
  };
734
- }>>, {
763
+ formattedValue: {
764
+ type: StringConstructor;
765
+ };
766
+ }>> & {
767
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
768
+ }, {
735
769
  updateUnchangedValue: boolean;
736
770
  }>>;
737
771
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -888,6 +922,9 @@ export declare const WidgetCfgMaps: Map<string, {
888
922
  onConfirm: {
889
923
  type: FunctionConstructor;
890
924
  };
925
+ formattedValue: {
926
+ type: StringConstructor;
927
+ };
891
928
  }, {
892
929
  attrs: {
893
930
  [x: string]: unknown;
@@ -899,9 +936,17 @@ export declare const WidgetCfgMaps: Map<string, {
899
936
  onConfirm: {
900
937
  type: FunctionConstructor;
901
938
  };
902
- }>> & {}>>;
939
+ formattedValue: {
940
+ type: StringConstructor;
941
+ };
942
+ }>> & {
943
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
944
+ }>>;
945
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
903
946
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
904
947
  panelInstRef: import("vue").Ref<null>;
948
+ placeholder: import("vue").Ref<any>;
949
+ currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
905
950
  isDateTime: import("vue").ComputedRef<boolean>;
906
951
  formatRef: import("vue").ComputedRef<string>;
907
952
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -910,15 +955,21 @@ export declare const WidgetCfgMaps: Map<string, {
910
955
  handleConfirm: (target: HTMLInputElement) => void;
911
956
  onUpdateShow: (show: boolean) => void;
912
957
  onConfirm: (...args: any[]) => Promise<void>;
958
+ isOtherValue: (value?: string) => boolean;
913
959
  NDatePicker: any;
914
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
960
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
915
961
  updateUnchangedValue: {
916
962
  type: BooleanConstructor;
917
963
  };
918
964
  onConfirm: {
919
965
  type: FunctionConstructor;
920
966
  };
921
- }>>, {
967
+ formattedValue: {
968
+ type: StringConstructor;
969
+ };
970
+ }>> & {
971
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
972
+ }, {
922
973
  updateUnchangedValue: boolean;
923
974
  }>>;
924
975
  DateQuickBtn: import("vue").DefineComponent<{
@@ -1120,6 +1171,9 @@ export declare const WidgetCfgMaps: Map<string, {
1120
1171
  onConfirm: {
1121
1172
  type: FunctionConstructor;
1122
1173
  };
1174
+ formattedValue: {
1175
+ type: StringConstructor;
1176
+ };
1123
1177
  }, {
1124
1178
  attrs: {
1125
1179
  [x: string]: unknown;
@@ -1131,9 +1185,17 @@ export declare const WidgetCfgMaps: Map<string, {
1131
1185
  onConfirm: {
1132
1186
  type: FunctionConstructor;
1133
1187
  };
1134
- }>> & {}>>;
1188
+ formattedValue: {
1189
+ type: StringConstructor;
1190
+ };
1191
+ }>> & {
1192
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1193
+ }>>;
1194
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
1135
1195
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
1136
1196
  panelInstRef: import("vue").Ref<null>;
1197
+ placeholder: import("vue").Ref<any>;
1198
+ currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1137
1199
  isDateTime: import("vue").ComputedRef<boolean>;
1138
1200
  formatRef: import("vue").ComputedRef<string>;
1139
1201
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -1142,15 +1204,21 @@ export declare const WidgetCfgMaps: Map<string, {
1142
1204
  handleConfirm: (target: HTMLInputElement) => void;
1143
1205
  onUpdateShow: (show: boolean) => void;
1144
1206
  onConfirm: (...args: any[]) => Promise<void>;
1207
+ isOtherValue: (value?: string) => boolean;
1145
1208
  NDatePicker: any;
1146
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1209
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1147
1210
  updateUnchangedValue: {
1148
1211
  type: BooleanConstructor;
1149
1212
  };
1150
1213
  onConfirm: {
1151
1214
  type: FunctionConstructor;
1152
1215
  };
1153
- }>>, {
1216
+ formattedValue: {
1217
+ type: StringConstructor;
1218
+ };
1219
+ }>> & {
1220
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1221
+ }, {
1154
1222
  updateUnchangedValue: boolean;
1155
1223
  }>>;
1156
1224
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as r,ref as s,computed as t,openBlock as o,createBlock as m,unref as i,mergeProps as a,createSlots as f,renderList as u,withCtx as l,renderSlot as n}from"vue";import{NTimePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as c}from"../../../shared/hooks/useDateTime.js";var d=e({__name:"TimePicker",setup(e,{expose:d}){const k=r(),h=s(null),$=t((()=>Reflect.get(k,"format")?k.format:"HH:mm:ss")),{focus:_,blur:v}=c(h,$,k);return d({$timePicker:h,focus:_,blur:v}),(e,r)=>(o(),m(i(p),a({ref_key:"timePickerRef",ref:h},e.$attrs),f({_:2},[u(e.$slots,((r,s)=>({name:s,fn:l((()=>[n(e.$slots,s)]))})))]),1040))}});export{d as default};
1
+ import{defineComponent as e,useAttrs as r,ref as t,computed as s,openBlock as o,createBlock as m,unref as i,mergeProps as a,createSlots as f,renderList as u,withCtx as l,renderSlot as n}from"vue";import{NTimePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as c}from"../../../shared/hooks/useDateTime.js";var d=e({__name:"TimePicker",setup(e,{expose:d}){const k=r(),h=t(null),$=s((()=>Reflect.get(k,"format")?k.format:"HH:mm:ss")),{focus:_,blur:v}=c(h,{formatRef:$,attrs:k});return d({$timePicker:h,focus:_,blur:v}),(e,r)=>(o(),m(i(p),a({ref_key:"timePickerRef",ref:h},e.$attrs),f({_:2},[u(e.$slots,((r,t)=>({name:t,fn:l((()=>[n(e.$slots,t)]))})))]),1040))}});export{d as default};
@@ -26,6 +26,10 @@ declare const _default: import("vue").DefineComponent<{
26
26
  popperProps: {
27
27
  type: PropType<AnyObject>;
28
28
  };
29
+ slashSymbol: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
29
33
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
30
34
  value: {
31
35
  type: (NumberConstructor | StringConstructor)[];
@@ -52,7 +56,12 @@ declare const _default: import("vue").DefineComponent<{
52
56
  popperProps: {
53
57
  type: PropType<AnyObject>;
54
58
  };
59
+ slashSymbol: {
60
+ type: StringConstructor;
61
+ default: string;
62
+ };
55
63
  }>>, {
56
64
  onChange: Func<any[], any>;
65
+ slashSymbol: string;
57
66
  }>;
58
67
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,ref as l,watch as u,createVNode as n,mergeProps as o}from"vue";import{findAncestor as a}from"../../utils/index.js";import{isArray as i,isString as r,isNumber as s,isObject as v}from"lodash-es";import{NInput as p,NDropdown as c}from"naive-ui";import"../../../components/form-render/index.js";import{createInputSlot as f}from"../../../components/form-render/src/utils/index.js";var d=e({props:{value:{type:[Number,String]},onChange:{type:Function,default:()=>({})},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]},precision:{type:Number},whiteList:{type:Array},inputProps:{type:Object},popperProps:{type:Object}},setup(e){const d=f(e),m=t((()=>i(e.whiteList)?e.whiteList.reduce(((e,t)=>(r(t)&&e.push({label:t,value:t}),e)),[]):[]));const h=l(),g=t({get:()=>h.value,set:e=>s(e)?h.value=e+"":r(e)?e.endsWith("/")?h.value="/":void(h.value=m.value.some((t=>t.label!==e&&t.label.includes(e)))?"":e):void 0});function b(e=-1){const t=s(+e)&&e>=0?+e:null;return new RegExp(`^-?(0|[1-9][0-9]*)?${0===t?"":`(\\.[0-9]${s(t)?`{0,${t}}`:"*"})?`}$`)}u((()=>e.value),(e=>g.value=e),{immediate:!0});const y=b();function j(){if(r(g.value)&&"-"!==g.value)if("/"===g.value||function(e,t=!1){return m.value.length&&m.value.some((({value:l})=>t?l.includes(e):l===e))}(g.value))e.onChange(g.value);else if(y.test(g.value)){const t=g.value.endsWith(".")?g.value.slice(0,-1):g.value;e.onChange(g.value=t)}else g.value=e.value;else g.value=e.value}const w=l(!1),x=l();function $(){w.value=!0}function C(e){var t;if(!e.target)return;const l=e.target;(null==(t=x.value)?void 0:t.$el)&&a(l,(e=>e===x.value.$el))||(w.value=!1)}function F(e,t){var l,u;v(t)&&(g.value=t.value,null==(u=null==(l=x.value)?void 0:l.focus)||u.call(l))}const O=t((()=>b(e.precision)));function P(e){return!(null!=e&&""!==e&&"/"!==e&&r(e)&&!e.endsWith("/"))||(!(!m.value.length||!m.value.some((t=>t.label.includes(e))))||O.value.test(e)&&"-."!==e&&!e.startsWith("."))}return()=>{const t=n(p,o({ref:x,value:g.value,"onUpdate:value":e=>g.value=e,"allow-input":P,onBlur:j,onClick:$,onFocus:$},e.inputProps),d.value);return m.value.length?n(c,o({onSelect:F,options:m.value,show:w.value,width:"trigger",onClickoutside:C},e.popperProps),{default:()=>t}):t}}});export{d as default};
1
+ import{defineComponent as e,computed as l,ref as t,watch as u,createVNode as n,mergeProps as o}from"vue";import{findAncestor as a}from"../../utils/index.js";import{isArray as s,isString as i,isNumber as r,isObject as v}from"lodash-es";import{NInput as p,NDropdown as c}from"naive-ui";import"../../../components/form-render/index.js";import{createInputSlot as m}from"../../../components/form-render/src/utils/index.js";var f=e({props:{value:{type:[Number,String]},onChange:{type:Function,default:()=>({})},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]},precision:{type:Number},whiteList:{type:Array},inputProps:{type:Object},popperProps:{type:Object},slashSymbol:{type:String,default:"/"}},setup(e){const f=m(e),d=l((()=>s(e.whiteList)?e.whiteList.reduce(((e,l)=>(i(l)&&e.push({label:l,value:l}),e)),[]):[]));const h=t(),b=l({get:()=>h.value,set:l=>r(l)?h.value=l+"":i(l)?l.endsWith(e.slashSymbol)?h.value=e.slashSymbol:void(h.value=d.value.some((e=>e.label!==l&&e.label.includes(l)))?"":l):void 0});function g(e=-1){const l=r(+e)&&e>=0?+e:null;return new RegExp(`^-?(0|[1-9][0-9]*)?${0===l?"":`(\\.[0-9]${r(l)?`{0,${l}}`:"*"})?`}$`)}u((()=>e.value),(e=>b.value=e),{immediate:!0});const y=g();function S(){if(b.value===e.slashSymbol||function(e,l=!1){return d.value.length&&d.value.some((({value:t})=>l?t.includes(e):t===e))}(b.value))e.onChange(b.value);else if(i(b.value)&&"-"!==b.value)if(y.test(b.value)){const l=b.value.endsWith(".")?b.value.slice(0,-1):b.value;e.onChange(b.value=l)}else b.value=e.value;else b.value=e.value}const j=t(!1),w=t();function x(){j.value=!0}function $(e){var l;if(!e.target)return;const t=e.target;(null==(l=w.value)?void 0:l.$el)&&a(t,(e=>e===w.value.$el))||(j.value=!1)}function C(e,l){var t,u;v(l)&&(b.value=l.value,null==(u=null==(t=w.value)?void 0:t.focus)||u.call(t))}const F=l((()=>g(e.precision)));function O(l){return!(null!=l&&""!==l&&l!==e.slashSymbol&&i(l)&&!l.endsWith(e.slashSymbol))||(!(!d.value.length||!d.value.some((e=>e.label.includes(l))))||F.value.test(l)&&"-."!==l&&!l.startsWith("."))}return()=>{const l=n(p,o({ref:w,value:b.value,"onUpdate:value":e=>b.value=e,"allow-input":O,onBlur:S,onClick:x,onFocus:x},e.inputProps),f.value);return d.value.length?n(c,o({onSelect:C,options:d.value,show:j.value,width:"trigger",onClickoutside:$},e.popperProps),{default:()=>l}):l}}});export{f as default};
@@ -1,6 +1,11 @@
1
1
  import { Ref, ComputedRef } from 'vue';
2
- import { AnyObject } from '../../../es/shared/types';
3
- export declare function useDateTime(datePickerRef: Ref<AnyObject | null>, formatRef: ComputedRef<string | [string, string]>, attrs: AnyObject, isPanel?: boolean): {
2
+ import { AnyObject, Func } from '../../../es/shared/types';
3
+ export declare function useDateTime(datePickerRef: Ref<AnyObject | null>, { formatRef, attrs, emit, isPanel }: {
4
+ formatRef: ComputedRef<string | [string, string]>;
5
+ attrs: AnyObject;
6
+ emit?: Func;
7
+ isPanel?: boolean;
8
+ }): {
4
9
  handleConfirm: (target: HTMLInputElement) => void;
5
10
  focus: () => any;
6
11
  blur: () => any;
@@ -1 +1 @@
1
- import{computed as e,unref as t}from"vue";import{useEventListener as n}from"@vueuse/core";import{isValid as l}from"date-fns";function i(e,t=""){e.value=t,e.dispatchEvent(new InputEvent("input"))}function o(e,t,n,l){const o=e.value;if(!o)return;const u=e.selectionEnd||0,s=o.length;let r=0,a=0,c=0,d="",f=0;for(;r<s;){const e=o[r++];if(/\d/.test(e)&&(d+=e),r===u){c=d.length;const e=o.slice(r).match(/^\d+/);f=e?e[0].length:0}}const v=Array.isArray(t)?function(e){var t,n;let l=!1,i=e.parentNode||null;for(;i;){if(null==(n=null==(t=i.classList)?void 0:t.contains)?void 0:n.call(t,"n-time-picker")){l=!0;break}i=i.parentNode||null}return l}(e)?t[1]:t[0]:t;let g="",m=0,p=0;for(r=0;r<v.length&&(l||!(a>=d.length));){const e=v[r++];if(/[yMdHms]/.test(e)?g+=d[a++]||"0":g+=e,n&&a===c){c=-1,m=g.length,p=m;let e=v.slice(r).match(/^[yMdHms]+/);e?(f=Math.min(f,e[0].length),f&&(g+=d.slice(a,a+f),a+=f),r+=e[0].length):(e=v.slice(r).match(/^([^yMdHms]+)([yMdHms]*)/),e&&(m+=e[1].length,p=m+e[2].length))}}const h=g!==o;return h&&i(e,g),n&&(m=m||g.length+1,p=p||g.length+1,e.setSelectionRange(m,p)),h}function u(u,s,r,a){const c=e((()=>{var e;return null==(e=u.value)?void 0:e.$el})),d=e((()=>{const e={};return["date","time","hour","minute","second"].forEach((t=>function(e,t){const n=`is-${t}-disabled`;r[n]&&(e[n.replace(/-(\w)/g,((e,t)=>t.toUpperCase()))]=r[n])}(e,t))),e}));function f(e){o(e,t(s),!1,!0);const n=null==e?void 0:e.value,u=Reflect.get(r,"type")||"";n&&!u.includes("range")&&l(new Date(n))&&!function(e){const{isTimeDisabled:t,isDateDisabled:n,isHourDisabled:l,isMinuteDisabled:i,isSecondDisabled:o}=d.value;if(null==n?void 0:n(e.getTime()))return;const u=(null==t?void 0:t(e.getTime()).isHourDisabled)||l,s=(null==t?void 0:t(e.getTime()).isMinuteDisabled)||i,r=(null==t?void 0:t(e.getTime()).isSecondDisabled)||o;if(null==u?void 0:u(e.getHours()))return;if(null==s?void 0:s(e.getMinutes()))return;if(null==r?void 0:r(e.getSeconds()))return;return!0}(new Date(n))&&i(e)}return n(c,"input",(function(e){const n=e.target;if(!n.value||!Reflect.get(n,"_f_"))return;Reflect.set(n,"_f_",0),o(n,t(s),!0)&&(e.preventDefault(),e.stopPropagation())}),!0),n(c,"keydown",(function(e){const{key:t}=e,n=e.target;if(/\d/.test(t)&&n)Reflect.set(n,"_f_",1);else if("Enter"===t)f(n);else if("Backspace"===t&&!a){const e=null==n?void 0:n.value;1===(null==e?void 0:e.length)&&(i(n),n.blur(),n.focus())}}),!0),n(c,"mouseup",(function(e){const t=e.target;["INPUT"].includes(t.tagName)&&0===e.button&&function(e){const{selectionStart:t=0,selectionEnd:n=0,value:l}=e;if(t!==n)return;const i=/(\d+)/g;let o,u,s;for(;null!==(o=i.exec(l));)if(t&&o.index<=t&&t<=i.lastIndex){u=o.index,s=i.lastIndex;break}void 0!==u&&void 0!==s&&e.setSelectionRange(u,s)}(t)}),!0),n(c,"paste",(function(e){var t,n;const l=(null==(t=e.clipboardData)?void 0:t.getData("text"))||"",o=null==(n=l.match(/\d+/g))?void 0:n.join(",");if(!o)return;e.preventDefault(),e.stopPropagation();const u=e.target;i(u,o),f(u)}),!0),{handleConfirm:f,focus:()=>{var e,t;return null==(t=null==(e=u.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=u.value)?void 0:e.blur)?void 0:t.call(e)}}}export{u as useDateTime};
1
+ import{computed as e,unref as t}from"vue";import{useEventListener as n}from"@vueuse/core";import{isValid as l}from"date-fns";function i(e,t=""){e.value=t,e.dispatchEvent(new InputEvent("input"))}function o(e,t,n,l){const o=e.value;if(!o)return;const u=e.selectionEnd||0,r=o.length;let s=0,a=0,c=0,d="",f=0;for(;s<r;){const e=o[s++];if(/\d/.test(e)&&(d+=e),s===u){c=d.length;const e=o.slice(s).match(/^\d+/);f=e?e[0].length:0}}const v=Array.isArray(t)?function(e){var t,n;let l=!1,i=e.parentNode||null;for(;i;){if(null==(n=null==(t=i.classList)?void 0:t.contains)?void 0:n.call(t,"n-time-picker")){l=!0;break}i=i.parentNode||null}return l}(e)?t[1]:t[0]:t;let g="",m=0,p=0;for(s=0;s<v.length&&(l||!(a>=d.length));){const e=v[s++];if(/[yMdHms]/.test(e)?g+=d[a++]||"0":g+=e,n&&a===c){c=-1,m=g.length,p=m;let e=v.slice(s).match(/^[yMdHms]+/);e?(f=Math.min(f,e[0].length),f&&(g+=d.slice(a,a+f),a+=f),s+=e[0].length):(e=v.slice(s).match(/^([^yMdHms]+)([yMdHms]*)/),e&&(m+=e[1].length,p=m+e[2].length))}}const h=g!==o;return h&&i(e,g),n&&(m=m||g.length+1,p=p||g.length+1,e.setSelectionRange(m,p)),h}function u(u,{formatRef:r,attrs:s,emit:a,isPanel:c}){const d=e((()=>{var e;return null==(e=u.value)?void 0:e.$el})),f=e((()=>{const e={};return["date","time","hour","minute","second"].forEach((t=>function(e,t){const n=`is-${t}-disabled`;s[n]&&(e[n.replace(/-(\w)/g,((e,t)=>t.toUpperCase()))]=s[n])}(e,t))),e}));function v(e){if(g(e.value))return;o(e,t(r),!1,!0);const n=null==e?void 0:e.value,u=Reflect.get(s,"type")||"";n&&!u.includes("range")&&l(new Date(n))&&!function(e){const{isTimeDisabled:t,isDateDisabled:n,isHourDisabled:l,isMinuteDisabled:i,isSecondDisabled:o}=f.value;if(null==n?void 0:n(e.getTime()))return;const u=(null==t?void 0:t(e.getTime()).isHourDisabled)||l,r=(null==t?void 0:t(e.getTime()).isMinuteDisabled)||i,s=(null==t?void 0:t(e.getTime()).isSecondDisabled)||o;if(null==u?void 0:u(e.getHours()))return;if(null==r?void 0:r(e.getMinutes()))return;if(null==s?void 0:s(e.getSeconds()))return;return!0}(new Date(n))&&i(e)}function g(e=""){return["-"].includes(e)&&!c}return n(d,"input",(function(e){const n=e.target;if(!n.value||!Reflect.get(n,"_f_"))return;Reflect.set(n,"_f_",0),o(n,t(r),!0)&&(e.preventDefault(),e.stopPropagation())}),!0),n(d,"keydown",(function(e){const{key:t}=e,n=e.target;if(/\d/.test(t)&&n)Reflect.set(n,"_f_",1);else if("Enter"===t)v(n);else if("Backspace"===t&&!c){const e=null==n?void 0:n.value;1===(null==e?void 0:e.length)&&(i(n),n.blur(),n.focus())}}),!0),n(d,"mouseup",(function(e){const t=e.target;["INPUT"].includes(t.tagName)&&0===e.button&&function(e){const{selectionStart:t=0,selectionEnd:n=0,value:l}=e;if(t!==n)return;const i=/(\d+)/g;let o,u,r;for(;null!==(o=i.exec(l));)if(t&&o.index<=t&&t<=i.lastIndex){u=o.index,r=i.lastIndex;break}void 0!==u&&void 0!==r&&e.setSelectionRange(u,r)}(t)}),!0),n(d,"paste",(function(e){var t,n;const l=(null==(t=e.clipboardData)?void 0:t.getData("text"))||"",o=null==(n=l.match(/\d+/g))?void 0:n.join(",");if(!o)return;e.preventDefault(),e.stopPropagation();const u=e.target;i(u,o),v(u)}),!0),n(d,"blur",(function(e){const t=e.target;g(t.value)&&function(e){i(e),null==a||a("update:formatted-value","-",null)}(t)}),!0),{handleConfirm:v,focus:()=>{var e,t;return null==(t=null==(e=u.value)?void 0:e.focus)?void 0:t.call(e)},blur:()=>{var e,t;return null==(t=null==(e=u.value)?void 0:e.blur)?void 0:t.call(e)}}}export{u as useDateTime};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.52-beta.0",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.52-beta.0",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.52-beta.10",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.52-beta.10",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.52-beta.0",
3
+ "version": "3.1.52-beta.10",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -63,5 +63,5 @@
63
63
  "iOS 7",
64
64
  "last 3 iOS versions"
65
65
  ],
66
- "gitHead": "19af4906517c50027c3771bff2a4d5f2f50675c1"
66
+ "gitHead": "cff2d753b8c213fdea5897657f70d52bdbed5fd4"
67
67
  }