cnhis-design-vue 3.1.52-release.1 → 3.1.52-release.2

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 (63) 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 +76 -6
  13. package/es/components/classification/src/components/search-filter/index.vue.d.ts +76 -6
  14. package/es/components/classification/src/components/set-classification/index.vue.d.ts +76 -6
  15. package/es/components/classification/src/index.vue.d.ts +76 -6
  16. package/es/components/date-picker/index.d.ts +38 -3
  17. package/es/components/date-picker/src/DatePicker.vue.d.ts +38 -3
  18. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  19. package/es/components/form-config/index.d.ts +2 -2
  20. package/es/components/form-config/src/FormConfig.vue.d.ts +2 -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 +1 -1
  23. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  24. package/es/components/form-render/index.d.ts +1 -1
  25. package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
  26. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
  27. package/es/components/form-render/src/components/renderer/date.d.ts +9 -0
  28. package/es/components/form-render/src/components/renderer/date.js +1 -1
  29. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  30. package/es/components/form-render/src/hooks/useFormEvent.d.ts +2 -2
  31. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  32. package/es/components/form-render/src/types/index.d.ts +2 -2
  33. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +38 -3
  34. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +38 -3
  35. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  36. package/es/components/index.css +1 -1
  37. package/es/components/index.d.ts +2 -1
  38. package/es/components/index.js +1 -1
  39. package/es/components/info-header/index.d.ts +2 -2
  40. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -2
  41. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -1
  42. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -1
  43. package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -1
  44. package/es/components/shortcut-setter/index.d.ts +1 -1
  45. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
  46. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +76 -6
  47. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +38 -3
  48. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +38 -3
  49. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +76 -6
  50. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +76 -6
  51. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +38 -3
  52. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +38 -3
  53. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +38 -3
  54. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +38 -3
  55. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +152 -12
  56. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +152 -12
  57. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  58. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +9 -0
  59. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  60. package/es/shared/hooks/useDateTime.d.ts +8 -2
  61. package/es/shared/hooks/useDateTime.js +1 -1
  62. package/es/shared/package.json.js +1 -1
  63. package/package.json +2 -2
@@ -590,6 +590,15 @@ declare const _default: import("vue").DefineComponent<{
590
590
  onConfirm: {
591
591
  type: FunctionConstructor;
592
592
  };
593
+ formattedValue: {
594
+ type: StringConstructor;
595
+ };
596
+ placeholder: {
597
+ type: StringConstructor;
598
+ };
599
+ allowedInvalidValue: {
600
+ type: StringConstructor;
601
+ };
593
602
  }, {
594
603
  attrs: {
595
604
  [x: string]: unknown;
@@ -601,9 +610,23 @@ declare const _default: import("vue").DefineComponent<{
601
610
  onConfirm: {
602
611
  type: FunctionConstructor;
603
612
  };
604
- }>> & {}>>;
613
+ formattedValue: {
614
+ type: StringConstructor;
615
+ };
616
+ placeholder: {
617
+ type: StringConstructor;
618
+ };
619
+ allowedInvalidValue: {
620
+ type: StringConstructor;
621
+ };
622
+ }>> & {
623
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
624
+ }>>;
625
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
605
626
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
606
627
  panelInstRef: import("vue").Ref<null>;
628
+ placeholderRef: import("vue").Ref<any>;
629
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
607
630
  isDateTime: import("vue").ComputedRef<boolean>;
608
631
  formatRef: import("vue").ComputedRef<string>;
609
632
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -612,15 +635,27 @@ declare const _default: import("vue").DefineComponent<{
612
635
  handleConfirm: (target: HTMLInputElement) => void;
613
636
  onUpdateShow: (show: boolean) => void;
614
637
  onConfirm: (...args: any[]) => Promise<void>;
638
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
615
639
  NDatePicker: any;
616
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
640
+ }, 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<{
617
641
  updateUnchangedValue: {
618
642
  type: BooleanConstructor;
619
643
  };
620
644
  onConfirm: {
621
645
  type: FunctionConstructor;
622
646
  };
623
- }>>, {
647
+ formattedValue: {
648
+ type: StringConstructor;
649
+ };
650
+ placeholder: {
651
+ type: StringConstructor;
652
+ };
653
+ allowedInvalidValue: {
654
+ type: StringConstructor;
655
+ };
656
+ }>> & {
657
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
658
+ }, {
624
659
  updateUnchangedValue: boolean;
625
660
  }>>;
626
661
  NSelect: any;
@@ -1183,6 +1218,15 @@ declare const _default: import("vue").DefineComponent<{
1183
1218
  onConfirm: {
1184
1219
  type: FunctionConstructor;
1185
1220
  };
1221
+ formattedValue: {
1222
+ type: StringConstructor;
1223
+ };
1224
+ placeholder: {
1225
+ type: StringConstructor;
1226
+ };
1227
+ allowedInvalidValue: {
1228
+ type: StringConstructor;
1229
+ };
1186
1230
  }, {
1187
1231
  attrs: {
1188
1232
  [x: string]: unknown;
@@ -1194,9 +1238,23 @@ declare const _default: import("vue").DefineComponent<{
1194
1238
  onConfirm: {
1195
1239
  type: FunctionConstructor;
1196
1240
  };
1197
- }>> & {}>>;
1241
+ formattedValue: {
1242
+ type: StringConstructor;
1243
+ };
1244
+ placeholder: {
1245
+ type: StringConstructor;
1246
+ };
1247
+ allowedInvalidValue: {
1248
+ type: StringConstructor;
1249
+ };
1250
+ }>> & {
1251
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1252
+ }>>;
1253
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
1198
1254
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
1199
1255
  panelInstRef: import("vue").Ref<null>;
1256
+ placeholderRef: import("vue").Ref<any>;
1257
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
1200
1258
  isDateTime: import("vue").ComputedRef<boolean>;
1201
1259
  formatRef: import("vue").ComputedRef<string>;
1202
1260
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -1205,15 +1263,27 @@ declare const _default: import("vue").DefineComponent<{
1205
1263
  handleConfirm: (target: HTMLInputElement) => void;
1206
1264
  onUpdateShow: (show: boolean) => void;
1207
1265
  onConfirm: (...args: any[]) => Promise<void>;
1266
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
1208
1267
  NDatePicker: any;
1209
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1268
+ }, 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<{
1210
1269
  updateUnchangedValue: {
1211
1270
  type: BooleanConstructor;
1212
1271
  };
1213
1272
  onConfirm: {
1214
1273
  type: FunctionConstructor;
1215
1274
  };
1216
- }>>, {
1275
+ formattedValue: {
1276
+ type: StringConstructor;
1277
+ };
1278
+ placeholder: {
1279
+ type: StringConstructor;
1280
+ };
1281
+ allowedInvalidValue: {
1282
+ type: StringConstructor;
1283
+ };
1284
+ }>> & {
1285
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1286
+ }, {
1217
1287
  updateUnchangedValue: boolean;
1218
1288
  }>>;
1219
1289
  WidgetValEnums: {
@@ -804,6 +804,15 @@ declare const _default: import("vue").DefineComponent<{
804
804
  onConfirm: {
805
805
  type: FunctionConstructor;
806
806
  };
807
+ formattedValue: {
808
+ type: StringConstructor;
809
+ };
810
+ placeholder: {
811
+ type: StringConstructor;
812
+ };
813
+ allowedInvalidValue: {
814
+ type: StringConstructor;
815
+ };
807
816
  }, {
808
817
  attrs: {
809
818
  [x: string]: unknown;
@@ -815,9 +824,23 @@ declare const _default: import("vue").DefineComponent<{
815
824
  onConfirm: {
816
825
  type: FunctionConstructor;
817
826
  };
818
- }>> & {}>>;
827
+ formattedValue: {
828
+ type: StringConstructor;
829
+ };
830
+ placeholder: {
831
+ type: StringConstructor;
832
+ };
833
+ allowedInvalidValue: {
834
+ type: StringConstructor;
835
+ };
836
+ }>> & {
837
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
838
+ }>>;
839
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
819
840
  datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
820
841
  panelInstRef: import("vue").Ref<null>;
842
+ placeholderRef: import("vue").Ref<any>;
843
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
821
844
  isDateTime: import("vue").ComputedRef<boolean>;
822
845
  formatRef: import("vue").ComputedRef<string>;
823
846
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -826,15 +849,27 @@ declare const _default: import("vue").DefineComponent<{
826
849
  handleConfirm: (target: HTMLInputElement) => void;
827
850
  onUpdateShow: (show: boolean) => void;
828
851
  onConfirm: (...args: any[]) => Promise<void>;
852
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
829
853
  NDatePicker: any;
830
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
854
+ }, 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<{
831
855
  updateUnchangedValue: {
832
856
  type: BooleanConstructor;
833
857
  };
834
858
  onConfirm: {
835
859
  type: FunctionConstructor;
836
860
  };
837
- }>>, {
861
+ formattedValue: {
862
+ type: StringConstructor;
863
+ };
864
+ placeholder: {
865
+ type: StringConstructor;
866
+ };
867
+ allowedInvalidValue: {
868
+ type: StringConstructor;
869
+ };
870
+ }>> & {
871
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
872
+ }, {
838
873
  updateUnchangedValue: boolean;
839
874
  }>>;
840
875
  NSelect: any;
@@ -1397,6 +1432,15 @@ declare const _default: import("vue").DefineComponent<{
1397
1432
  onConfirm: {
1398
1433
  type: FunctionConstructor;
1399
1434
  };
1435
+ formattedValue: {
1436
+ type: StringConstructor;
1437
+ };
1438
+ placeholder: {
1439
+ type: StringConstructor;
1440
+ };
1441
+ allowedInvalidValue: {
1442
+ type: StringConstructor;
1443
+ };
1400
1444
  }, {
1401
1445
  attrs: {
1402
1446
  [x: string]: unknown;
@@ -1408,9 +1452,23 @@ declare const _default: import("vue").DefineComponent<{
1408
1452
  onConfirm: {
1409
1453
  type: FunctionConstructor;
1410
1454
  };
1411
- }>> & {}>>;
1455
+ formattedValue: {
1456
+ type: StringConstructor;
1457
+ };
1458
+ placeholder: {
1459
+ type: StringConstructor;
1460
+ };
1461
+ allowedInvalidValue: {
1462
+ type: StringConstructor;
1463
+ };
1464
+ }>> & {
1465
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1466
+ }>>;
1467
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
1412
1468
  datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
1413
1469
  panelInstRef: import("vue").Ref<null>;
1470
+ placeholderRef: import("vue").Ref<any>;
1471
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
1414
1472
  isDateTime: import("vue").ComputedRef<boolean>;
1415
1473
  formatRef: import("vue").ComputedRef<string>;
1416
1474
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -1419,15 +1477,27 @@ declare const _default: import("vue").DefineComponent<{
1419
1477
  handleConfirm: (target: HTMLInputElement) => void;
1420
1478
  onUpdateShow: (show: boolean) => void;
1421
1479
  onConfirm: (...args: any[]) => Promise<void>;
1480
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
1422
1481
  NDatePicker: any;
1423
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1482
+ }, 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<{
1424
1483
  updateUnchangedValue: {
1425
1484
  type: BooleanConstructor;
1426
1485
  };
1427
1486
  onConfirm: {
1428
1487
  type: FunctionConstructor;
1429
1488
  };
1430
- }>>, {
1489
+ formattedValue: {
1490
+ type: StringConstructor;
1491
+ };
1492
+ placeholder: {
1493
+ type: StringConstructor;
1494
+ };
1495
+ allowedInvalidValue: {
1496
+ type: StringConstructor;
1497
+ };
1498
+ }>> & {
1499
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1500
+ }, {
1431
1501
  updateUnchangedValue: boolean;
1432
1502
  }>>;
1433
1503
  WidgetValEnums: {
@@ -6,6 +6,15 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
6
6
  onConfirm: {
7
7
  type: FunctionConstructor;
8
8
  };
9
+ formattedValue: {
10
+ type: StringConstructor;
11
+ };
12
+ placeholder: {
13
+ type: StringConstructor;
14
+ };
15
+ allowedInvalidValue: {
16
+ type: StringConstructor;
17
+ };
9
18
  }, {
10
19
  attrs: {
11
20
  [x: string]: unknown;
@@ -17,9 +26,23 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
17
26
  onConfirm: {
18
27
  type: FunctionConstructor;
19
28
  };
20
- }>> & {}>>;
29
+ formattedValue: {
30
+ type: StringConstructor;
31
+ };
32
+ placeholder: {
33
+ type: StringConstructor;
34
+ };
35
+ allowedInvalidValue: {
36
+ type: StringConstructor;
37
+ };
38
+ }>> & {
39
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
40
+ }>>;
41
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
21
42
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
22
43
  panelInstRef: import("vue").Ref<null>;
44
+ placeholderRef: import("vue").Ref<any>;
45
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
23
46
  isDateTime: import("vue").ComputedRef<boolean>;
24
47
  formatRef: import("vue").ComputedRef<string>;
25
48
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -28,15 +51,27 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
28
51
  handleConfirm: (target: HTMLInputElement) => void;
29
52
  onUpdateShow: (show: boolean) => void;
30
53
  onConfirm: (...args: any[]) => Promise<void>;
54
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
31
55
  NDatePicker: any;
32
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
56
+ }, 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<{
33
57
  updateUnchangedValue: {
34
58
  type: BooleanConstructor;
35
59
  };
36
60
  onConfirm: {
37
61
  type: FunctionConstructor;
38
62
  };
39
- }>>, {
63
+ formattedValue: {
64
+ type: StringConstructor;
65
+ };
66
+ placeholder: {
67
+ type: StringConstructor;
68
+ };
69
+ allowedInvalidValue: {
70
+ type: StringConstructor;
71
+ };
72
+ }>> & {
73
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
74
+ }, {
40
75
  updateUnchangedValue: boolean;
41
76
  }>>;
42
77
  export default DatePicker;
@@ -6,6 +6,15 @@ declare const _default: import("vue").DefineComponent<{
6
6
  onConfirm: {
7
7
  type: FunctionConstructor;
8
8
  };
9
+ formattedValue: {
10
+ type: StringConstructor;
11
+ };
12
+ placeholder: {
13
+ type: StringConstructor;
14
+ };
15
+ allowedInvalidValue: {
16
+ type: StringConstructor;
17
+ };
9
18
  }, {
10
19
  attrs: {
11
20
  [x: string]: unknown;
@@ -17,9 +26,23 @@ declare const _default: import("vue").DefineComponent<{
17
26
  onConfirm: {
18
27
  type: FunctionConstructor;
19
28
  };
20
- }>> & {}>>;
29
+ formattedValue: {
30
+ type: StringConstructor;
31
+ };
32
+ placeholder: {
33
+ type: StringConstructor;
34
+ };
35
+ allowedInvalidValue: {
36
+ type: StringConstructor;
37
+ };
38
+ }>> & {
39
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
40
+ }>>;
41
+ emit: (event: "update:formatted-value", ...args: any[]) => void;
21
42
  datePickerRef: import("vue").Ref<AnyObject | null>;
22
43
  panelInstRef: import("vue").Ref<null>;
44
+ placeholderRef: import("vue").Ref<any>;
45
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
23
46
  isDateTime: import("vue").ComputedRef<boolean>;
24
47
  formatRef: import("vue").ComputedRef<string>;
25
48
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -28,15 +51,27 @@ declare const _default: import("vue").DefineComponent<{
28
51
  handleConfirm: (target: HTMLInputElement) => void;
29
52
  onUpdateShow: (show: boolean) => void;
30
53
  onConfirm: (...args: any[]) => Promise<void>;
54
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
31
55
  NDatePicker: any;
32
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
56
+ }, 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<{
33
57
  updateUnchangedValue: {
34
58
  type: BooleanConstructor;
35
59
  };
36
60
  onConfirm: {
37
61
  type: FunctionConstructor;
38
62
  };
39
- }>>, {
63
+ formattedValue: {
64
+ type: StringConstructor;
65
+ };
66
+ placeholder: {
67
+ type: StringConstructor;
68
+ };
69
+ allowedInvalidValue: {
70
+ type: StringConstructor;
71
+ };
72
+ }>> & {
73
+ "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
74
+ }, {
40
75
  updateUnchangedValue: boolean;
41
76
  }>;
42
77
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as n,ref as t,computed as l,openBlock as a,createBlock as u,unref as o,mergeProps as r,createSlots as i,renderList as s,withCtx as d,renderSlot as p,nextTick as c}from"vue";import{NDatePicker as f}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as v}from"../../../shared/hooks/useDateTime.js";import{format as m}from"date-fns";var y=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function}},setup(e,{expose:y}){const h=e,g=n(),M=t(null),R=t(null),k=l((()=>{const e=Reflect.get(g,"type")||"";return["datetime","datetimerange"].includes(e)})),w=l((()=>{if(Reflect.get(g,"format"))return g.format;const e=g.type||"";return k.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),C=l((()=>k.value?w.value.split(" "):"")),{focus:$,blur:D,handleConfirm:E}=v(M,w,g);function I(e){e&&k.value&&c((()=>{var e;R.value=null==(e=M.value)?void 0:e.panelInstRef,v(R,C,g,!0)}))}async function _(...e){var n,t,l,a,u,o;const r=Reflect.get(g,"type")||"",i=null==(a=null==(l=null==(t=null==(n=M.value)?void 0:n.inputInstRef)?void 0:t.$el)?void 0:l.querySelector)?void 0:a.call(l,"input");if(r.includes("range")?null==(u=h.onConfirm)||u.call(h,...e):(await c(),i.focus(),E(i),i.blur(),null==(o=h.onConfirm)||o.call(h,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!h.updateUnchangedValue||r.includes("range"))return;const s=i.value;i.value=m(new Date,w.value),i.dispatchEvent(new InputEvent("input")),i.value=s,i.dispatchEvent(new InputEvent("input"))}return y({$datePicker:M,focus:$,blur:D}),(e,n)=>(a(),u(o(f),r({ref_key:"datePickerRef",ref:M},e.$attrs,{"onUpdate:show":I,onConfirm:_}),i({_:2},[s(e.$slots,((n,t)=>({name:t,fn:d((()=>[p(e.$slots,t)]))})))]),1040))}});export{y as default};
1
+ import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as n,openBlock as u,createBlock as o,unref as r,isRef as d,createSlots as i,renderList as s,withCtx as f,renderSlot as p,nextTick as v}from"vue";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as c}from"../../../shared/hooks/useDateTime.js";import{format as y}from"date-fns";var h=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:String},placeholder:{type:String},allowedInvalidValue:{type:String}},emits:["update:formatted-value"],setup(e,{expose:h,emit:g}){const V=e,w=t(),I=a(null),R=a(null),M=a(),k=l({get:()=>b(V.formattedValue)?null:V.formattedValue,set(e){g("update:formatted-value",e,e?Date.parse(e):null)}}),C=l((()=>{const e=Reflect.get(w,"type")||"";return["datetime","datetimerange"].includes(e)})),D=l((()=>{if(Reflect.get(w,"format"))return w.format;const e=w.type||"";return C.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),E=l((()=>C.value?D.value.split(" "):"")),{focus:P,blur:S,handleConfirm:U}=c(I,{formatRef:D,attrs:w,emit:g,allowedInvalidValue:V.allowedInvalidValue});function $(e){e&&C.value&&v((()=>{var e;R.value=null==(e=I.value)?void 0:e.panelInstRef,c(R,{formatRef:E,attrs:w,isPanel:!0})}))}async function _(...e){var t,a,l,n,u,o;const r=Reflect.get(w,"type")||"",d=null==(n=null==(l=null==(a=null==(t=I.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(r.includes("range")?null==(u=V.onConfirm)||u.call(V,...e):(await v(),d.focus(),U(d),d.blur(),null==(o=V.onConfirm)||o.call(V,Date.parse(d.value),d.value)),!(null==d?void 0:d.value)||!V.updateUnchangedValue||r.includes("range"))return;const i=d.value;d.value=y(new Date,D.value),d.dispatchEvent(new InputEvent("input")),d.value=i,d.dispatchEvent(new InputEvent("input"))}function b(e=""){return V.allowedInvalidValue&&V.allowedInvalidValue===e}return n((()=>V.formattedValue),(e=>{M.value=b(e)?e:V.placeholder?V.placeholder:"选择日期时间"}),{immediate:!0}),h({$datePicker:I,focus:P,blur:S}),(e,t)=>(u(),o(r(m),{ref_key:"datePickerRef",ref:I,"onUpdate:show":$,onConfirm:_,placeholder:M.value,"formatted-value":r(k),"onUpdate:formatted-value":t[0]||(t[0]=e=>d(k)?k.value=e:null)},i({_:2},[s(e.$slots,((t,a)=>({name:a,fn:f((()=>[p(e.$slots,a)]))})))]),1032,["placeholder","formatted-value"]))}});export{h as default};
@@ -7846,7 +7846,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7846
7846
  onKeydown: (event: KeyboardEvent) => Promise<void>;
7847
7847
  clearSpan: (uuid: string) => void;
7848
7848
  exposeEvent: {
7849
- validate(path?: string, { force }?: {
7849
+ validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
7850
7850
  force?: boolean | undefined;
7851
7851
  }): Promise<void>;
7852
7852
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -14236,7 +14236,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
14236
14236
  onKeydown: (event: KeyboardEvent) => Promise<void>;
14237
14237
  clearSpan: (uuid: string) => void;
14238
14238
  exposeEvent: {
14239
- validate(path?: string, { force }?: {
14239
+ validate(path?: string | ((field: import("@formily/core").Field<any, any, any, any>) => boolean), { force }?: {
14240
14240
  force?: boolean | undefined;
14241
14241
  }): Promise<void>;
14242
14242
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -7848,7 +7848,7 @@ declare const _default: import("vue").DefineComponent<{
7848
7848
  onKeydown: (event: KeyboardEvent) => Promise<void>;
7849
7849
  clearSpan: (uuid: string) => void;
7850
7850
  exposeEvent: {
7851
- validate(path?: string, { force }?: {
7851
+ validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
7852
7852
  force?: boolean | undefined;
7853
7853
  }): Promise<void>;
7854
7854
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -14238,7 +14238,7 @@ declare const _default: import("vue").DefineComponent<{
14238
14238
  onKeydown: (event: KeyboardEvent) => Promise<void>;
14239
14239
  clearSpan: (uuid: string) => void;
14240
14240
  exposeEvent: {
14241
- validate(path?: string, { force }?: {
14241
+ validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
14242
14242
  force?: boolean | undefined;
14243
14243
  }): Promise<void>;
14244
14244
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -576,7 +576,7 @@ declare const _default: import("vue").DefineComponent<{}, {
576
576
  onKeydown: (event: KeyboardEvent) => Promise<void>;
577
577
  clearSpan: (uuid: string) => void;
578
578
  exposeEvent: {
579
- validate(path?: string, { force }?: {
579
+ validate(path?: string | ((field: import("../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
580
580
  force?: boolean | undefined;
581
581
  }): Promise<void>;
582
582
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -5951,7 +5951,7 @@ declare const _default: import("vue").DefineComponent<{
5951
5951
  onKeydown: (event: KeyboardEvent) => Promise<void>;
5952
5952
  clearSpan: (uuid: string) => void;
5953
5953
  exposeEvent: {
5954
- validate(path?: string, { force }?: {
5954
+ validate(path?: string | ((field: import("../../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
5955
5955
  force?: boolean | undefined;
5956
5956
  }): Promise<void>;
5957
5957
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -1 +1 @@
1
- import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as _,isNotFoldOptionConfig as a,isEditOptionConfig as o,isNullOptionConfig as m,isVisibleOptionConfig as s,rowsOptionConfig as n}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as r}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=r();function E(){const r=new Map([[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const _=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(_.componentProps,["class","style","disabled"]),...t(_,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,..._()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...a()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...o()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...m()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...s()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...n()})]]);function E(e,t,l){return e.map((e=>{var i,_;return{...null!=(_=null==(i=r.get(e))?void 0:i(t,l))?_:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const _=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&_.splice(3,0,l.ROWS),E(_,e,t)}}}export{E as useConfigurationField};
1
+ import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as _,isEditOptionConfig as o,isNullOptionConfig as s,isVisibleOptionConfig as m,rowsOptionConfig as n}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as r}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=r();function E(){const r=new Map([[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,..._()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...o()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...s()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...m()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...n()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=r.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
@@ -563,7 +563,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
563
563
  onKeydown: (event: KeyboardEvent) => Promise<void>;
564
564
  clearSpan: (uuid: string) => void;
565
565
  exposeEvent: {
566
- validate(path?: string, { force }?: {
566
+ validate(path?: string | ((field: import("@formily/core/esm/models/Field").Field<any, any, any, any>) => boolean), { force }?: {
567
567
  force?: boolean | undefined;
568
568
  }): Promise<void>;
569
569
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -558,7 +558,7 @@ declare const _default: import("vue").DefineComponent<{
558
558
  onKeydown: (event: KeyboardEvent) => Promise<void>;
559
559
  clearSpan: (uuid: string) => void;
560
560
  exposeEvent: {
561
- validate(path?: string, { force }?: {
561
+ validate(path?: string | ((field: Field<any, any, any, any>) => boolean), { force }?: {
562
562
  force?: boolean | undefined;
563
563
  }): Promise<void>;
564
564
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -561,7 +561,7 @@ declare const _default: import("vue").DefineComponent<{}, {
561
561
  onKeydown: (event: KeyboardEvent) => Promise<void>;
562
562
  clearSpan: (uuid: string) => void;
563
563
  exposeEvent: {
564
- validate(path?: string, { force }?: {
564
+ validate(path?: string | ((field: import("../../../../es/components/form-render").Field<any, any, any, any>) => boolean), { force }?: {
565
565
  force?: boolean | undefined;
566
566
  }): Promise<void>;
567
567
  getFormValues(needCombineExtendKey?: boolean): any;
@@ -25,6 +25,10 @@ export declare const DATE: import("vue").DefineComponent<{
25
25
  type: StringConstructor;
26
26
  default: string;
27
27
  };
28
+ allowedInvalidValue: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
28
32
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
29
33
  onChange: {};
30
34
  value: {
@@ -51,8 +55,13 @@ export declare const DATE: import("vue").DefineComponent<{
51
55
  type: StringConstructor;
52
56
  default: string;
53
57
  };
58
+ allowedInvalidValue: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
54
62
  }>> & {
55
63
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
56
64
  }, {
65
+ allowedInvalidValue: string;
57
66
  valueFormat: string;
58
67
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,watch as o,createVNode as a,mergeProps as r}from"vue";import{generateTimeFormat as i}from"../../../../../shared/utils/index.js";import{connect as n,mapProps as u}from"@formily/vue";import{isObject as s}from"@vueuse/core";import{format as m}from"date-fns";import l from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../../index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const p=n(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:n}){const{injectValueValidate:u,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function p(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function f(e){return c()&&e<Date.now()-864e5||p()&&e>Date.now()}function y(e){const t=new Date(e),o=new Date,a=new Date(t);a.setHours(0),a.setMinutes(0),a.setSeconds(0);const r=new Date(t);r.setHours(23),r.setMinutes(59),r.setSeconds(59);const i=a>o,n=r<o,u=t.getHours(),s=o.getHours(),m=o.getMinutes();return{isHourDisabled:function(e){return c()&&!i&&e<s||p()&&!n&&e>s},isMinuteDisabled:function(e){if(u===s)return c()&&!i&&e<m||p()&&!n&&e>m;return c()&&!i&&u<s||p()&&!n&&u>s}}}u((()=>e.value));const D=t((()=>{const t={};if(s(e.validate)){const{min_date:o,max_date:a}=e.validate;(o||a)&&(t.isDateDisabled=f,t.isTimeDisabled=y)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:i(e.valueFormat)}})));function g(t){return t?m(new Date(t),e.valueFormat):t}o((()=>e.value),(e=>{e&&g(e)!==e&&n("update:value",g(e))}));const h=t({get:()=>g(e.value),set:e=>{n("update:value",e)}}),w=v(h);return()=>a(l,r({key:w.value},D.value,j.value,{"formatted-value":h.value,"onUpdate:formatted-value":e=>h.value=e}),null)}}),u(v,c));export{p as DATE};
1
+ import{defineComponent as e,computed as t,watch as a,createVNode as o,mergeProps as r}from"vue";import{generateTimeFormat as i}from"../../../../../shared/utils/index.js";import{connect as n,mapProps as u}from"@formily/vue";import{isObject as l}from"@vueuse/core";import{format as s}from"date-fns";import m from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../../index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const p=n(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"}},emits:["update:value"],setup(e,{emit:n}){const{injectValueValidate:u,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function p(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function f(e){return c()&&e<Date.now()-864e5||p()&&e>Date.now()}function y(e){const t=new Date(e),a=new Date,o=new Date(t);o.setHours(0),o.setMinutes(0),o.setSeconds(0);const r=new Date(t);r.setHours(23),r.setMinutes(59),r.setSeconds(59);const i=o>a,n=r<a,u=t.getHours(),l=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return c()&&!i&&e<l||p()&&!n&&e>l},isMinuteDisabled:function(e){if(u===l)return c()&&!i&&e<s||p()&&!n&&e>s;return c()&&!i&&u<l||p()&&!n&&u>l}}}u((()=>e.value));const D=t((()=>{const t={};if(l(e.validate)){const{min_date:a,max_date:o}=e.validate;(a||o)&&(t.isDateDisabled=f,t.isTimeDisabled=y)}return t})),w=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:i(e.valueFormat)}})));function j(t){return t!==e.allowedInvalidValue&&t?s(new Date(t),e.valueFormat):t}a((()=>e.value),(e=>{e&&j(e)!==e&&n("update:value",j(e))}));const g=t({get:()=>j(e.value),set:e=>{n("update:value",e)}}),h=v(g);return()=>o(m,r({key:h.value,allowedInvalidValue:e.allowedInvalidValue},D.value,w.value,{"formatted-value":g.value,"onUpdate:formatted-value":e=>g.value=e}),null)}}),u(v,c));export{p as DATE};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as r,ref as t,inject as a,watch as l,createVNode as o}from"vue";import{isEqual as n,isArray as u,isEmpty as i,isString as s,isNumber as v,isFunction as d,omit as c,cloneDeep as p}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as f}from"../../constants/index.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as h,mapProps as k}from"@formily/vue";import g from"../../../../search-cascader/index.js";import j from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as w}from"../../utils/schema.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const K=h(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:h}){const k=r({get:()=>e.value,set(r){n(r,e.value)||h("update:value",r)}}),w=t(!1),K=t([]),{field:F,fieldKey:O}=_(),q=r((()=>{var r,t,a;return null!=(a=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?a:e.labelField})),S=r((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=r((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),C=r((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),L=a(f),{getSearchRequestInfo:P}=b(),A=t(150),I=t();async function R(r,t,a=!0){var l,o,n,f;if(A.value=t&&(null==(l=I.value)?void 0:l.getWidth())||150,u(e.value)&&!i(e.value)&&e.value.every((e=>e[S.value]))&&!r&&!t){const r=1===e.value.length,t=null==(o=K.value)?void 0:o.length,[a,l]=function(e){if(!e.length)return[];const r=[(e=p(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const a=e[r];a&&(t.children=[a],a.parent=t,t=a)}return[e,r]}(e.value),n=a[Math.max(0,a.length-2)];if(!r){K.value=l;const e=a[Math.max(0,a.length-2)];return await R(e,void 0),e}if(t)return n}try{if(r&&!r.__keyword&&r.isLeaf)return y(r);if(!(null==r?void 0:r.__keyword)){const l=await L.addAsync(function(r,a,l,o,n){const u={autograph:()=>a,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[S.value]}]:e.conObjFirstLevel||[]}(r,t,o)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},i=Object.entries(u).reduce(((e,[t,a])=>(e[t]=s(a)?r[a]:d(a)?a():void 0,e)),{});return{...P(),params:i,key:n,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,O.value));if(r){if(!l.length)return a?y(r):Promise.reject();r.children=l.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:h(r)+1>=t}}(e,r,C.value)))}else K.value=l.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[q.value]=e[x.value||q.value]||e[q.value]);return e}(e,t))),t&&(null==(n=I.value)||n.setCursor(K.value[0]));return}if(!s(r.id_link))return Promise.reject();const l=r.id_link.split("_").filter((e=>e));v(C.value)&&C.value!==1/0&&l.splice(C.value);const o=await async function(r){if(!P().primaryKeyUrl)return[];try{return await L.addAsync(t(e.wordbook,e.autograph,r,O.value))}catch(e){s(e)&&m(e)}function t(r,t,a,l){const o=P();return{key:l,params:{autograph:t,tableId:r.id,primaryKeyValue:a.join(","),page:1},...o,url:o.primaryKeyUrl,cache:e.requestCache,payload:{field:F.value,labelKey:q.value,valueKey:S.value}}}}(l);if(!o)return Promise.reject();const{lastOption:u,options:c}=function(e,r){let t=e[0];return{options:r.reduce(((r,l,o)=>{const n=a(e,l);return 0===o?(t=n,[n]):(Object.assign(n,{parent:t,isLeaf:o+1>=C.value}),t.children=[n],t=n,r)}),[]),lastOption:t};function a(e,r){return e.find((e=>e[S.value]===r))}}(o,l);return c.length<C.value&&(await R(u),i(u.children))?(k.value=function(e,r){return r.map((r=>e.find((e=>e[S.value]===r))))}(o,l),w.value=!1,Promise.reject()):(K.value=c,null==(f=I.value)||f.setCursor(u),u)}catch(e){s(e)&&m(e)}function y(e){return k.value=function(e){const r=[];let t=e;for(;t;)r.unshift(c(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),w.value=!1,Promise.reject()}function h(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}function U(){A.value=150}l((()=>e.wordbook),((r,t)=>{n(r,t)||(K.value=[],r&&(k.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:V,injectValueBindKey:B}=y();V(k);const N=B(k);return()=>o(g,{ref:I,value:k.value,"onUpdate:value":e=>k.value=e,show:w.value,"onUpdate:show":e=>w.value=e,options:K.value,key:N.value,labelKey:q.value,valueKey:S.value,search:R,onFocus:U,menuWidth:A.value},{empty:()=>o(j,null,null)})}}),k({dataSource:"options"},w));export{K as LEVEL_SEARCH_CASCADER};
1
+ import{defineComponent as e,computed as r,ref as a,inject as t,watch as l,createVNode as o}from"vue";import{isEqual as u,isArray as n,isEmpty as i,isString as s,isNumber as v,isFunction as d,omit as c,cloneDeep as p}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as f}from"../../constants/index.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as h,mapProps as k}from"@formily/vue";import g from"../../../../search-cascader/index.js";import j from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as w}from"../../utils/schema.js";import{useFormField as _}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const K=h(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:h}){const k=r({get:()=>e.value,set(r){u(r,e.value)||h("update:value",r)}}),w=a(!1),K=a([]),{field:F,fieldKey:O}=_(),q=r((()=>{var r,a,t;return null!=(t=null==(a=null==(r=e.wordbook)?void 0:r.show_key)?void 0:a[0])?t:e.labelField})),S=r((()=>{var r,a;return null!=(a=null==(r=e.wordbook)?void 0:r.value_key)?a:e.valueField})),x=r((()=>{var r,a;return null==(a=null==(r=e.wordbook)?void 0:r.render_key)?void 0:a[0]})),C=r((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),L=t(f),{getSearchRequestInfo:P}=b(),A=a(150),I=a();async function R(r,a,t=!0){var l,o,u,f;if(A.value=a&&(null==(l=I.value)?void 0:l.getWidth())||150,n(e.value)&&!i(e.value)&&e.value.every((e=>e[S.value]))&&!r&&!a){const r=1===e.value.length,a=null==(o=K.value)?void 0:o.length,[t,l]=function(e){if(!e.length)return[];const r=[(e=p(e))[0]];let a=e[0];for(let r=1;r<e.length;r++){const t=e[r];t&&(a.children=[t],t.parent=a,a=t)}return[e,r]}(e.value),u=t[Math.max(0,t.length-2)];if(!r){K.value=l;const e=t[Math.max(0,t.length-2)];return await R(e,void 0),e}if(a)return u}try{if(r&&!r.__keyword&&r.isLeaf)return y(r);if(!(null==r?void 0:r.__keyword)){const l=await L.addAsync(function(r,t,l,o,u){const n={autograph:()=>t,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,a){return r?e.conObj||[]:a?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:a[S.value]}]:e.conObjFirstLevel||[]}(r,a,o)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>a,page:()=>1},i=Object.entries(n).reduce(((e,[a,t])=>(e[a]=s(t)?r[t]:d(t)?t():void 0,e)),{});return{...P(),params:i,key:u,cache:e.requestCache,payload:{field:l,labelKey:q.value,valueKey:S.value}}}(e.wordbook,e.autograph,F.value,r,O.value));if(r){if(!l.length)return t?y(r):Promise.reject();r.children=l.map((e=>function(e,r,a){return{...e,parent:r,isLeaf:h(r)+1>=a}}(e,r,C.value)))}else K.value=l.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[q.value]=e[x.value||q.value]||e[q.value]);return e}(e,a))),a&&(null==(u=I.value)||u.setCursor(K.value[0]));return}if(!s(r.id_link))return Promise.reject();const l=r.id_link.split("_").filter((e=>e));v(C.value)&&C.value!==1/0&&l.splice(C.value);const o=await async function(r){if(!P().primaryKeyUrl)return[];try{return await L.addAsync(a(e.wordbook,e.autograph,r,O.value))}catch(e){s(e)&&m(e)}function a(r,a,t,l){const o=P();return{key:l,params:{autograph:a,tableId:r.id,primaryKeyValue:t.join(","),page:1},...o,url:o.primaryKeyUrl,cache:e.requestCache,payload:{field:F.value,labelKey:q.value,valueKey:S.value}}}}(l);if(!o)return Promise.reject();const{lastOption:n,options:c}=function(e,r){let a=e[0];return{options:r.reduce(((r,l,o)=>{const u=t(e,l);return 0===o?(a=u,[u]):(Object.assign(u,{parent:a,isLeaf:o+1>=C.value}),a.children=[u],a=u,r)}),[]),lastOption:a};function t(e,r){return e.find((e=>e[S.value]===r))}}(o,l);return c.length<C.value&&(await R(n),i(n.children))?(k.value=function(e,r){return r.map((r=>e.find((e=>e[S.value]===r))))}(o,l),w.value=!1,Promise.reject()):(K.value=c,null==(f=I.value)||f.setCursor(n),n)}catch(e){s(e)&&m(e)}function y(e){return k.value=function(e){const r=[];let a=e;for(;a;)r.unshift(c(a,["parent","isLeaf","__keyword","children"])),a=a.parent;return r}(e),w.value=!1,Promise.reject()}function h(e){let r=1,a=e.parent;for(;a;)r++,a=a.parent;return r}}function U(){A.value=150}l((()=>e.wordbook),((r,a)=>{u(r,a)||(K.value=[],r&&(k.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:V,injectValueBindKey:B}=y();V(k);const N=B(k);return()=>o(g,{ref:I,value:k.value,"onUpdate:value":e=>k.value=e,show:w.value,"onUpdate:show":e=>w.value=e,options:K.value,key:N.value,labelKey:q.value,valueKey:S.value,search:R,onFocus:U,menuWidth:A.value},{empty:()=>o(j,null,null)})}}),k({dataSource:"options"},w));export{K as LEVEL_SEARCH_CASCADER};