cnhis-design-vue 3.1.52-beta.12 → 3.1.52-beta.14

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 (32) hide show
  1. package/es/components/classification/index.d.ts +22 -4
  2. package/es/components/classification/src/components/search-filter/index.vue.d.ts +22 -4
  3. package/es/components/classification/src/components/set-classification/index.vue.d.ts +22 -4
  4. package/es/components/classification/src/index.vue.d.ts +22 -4
  5. package/es/components/date-picker/index.d.ts +11 -2
  6. package/es/components/date-picker/src/DatePicker.vue.d.ts +11 -2
  7. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  8. package/es/components/form-render/src/components/renderer/date.d.ts +9 -0
  9. package/es/components/form-render/src/components/renderer/date.js +1 -1
  10. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  11. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +11 -2
  12. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +11 -2
  13. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  14. package/es/components/recommend-search/index.d.ts +1 -1
  15. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +1 -1
  16. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  17. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +22 -4
  18. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +11 -2
  19. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +11 -2
  20. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +22 -4
  21. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +22 -4
  22. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +11 -2
  23. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +11 -2
  24. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +11 -2
  25. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +11 -2
  26. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +44 -8
  27. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +44 -8
  28. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  29. package/es/shared/hooks/useDateTime.d.ts +2 -1
  30. package/es/shared/hooks/useDateTime.js +1 -1
  31. package/es/shared/package.json.js +1 -1
  32. package/package.json +2 -2
@@ -809,6 +809,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
809
809
  placeholder: {
810
810
  type: StringConstructor;
811
811
  };
812
+ allowedInvalidValue: {
813
+ type: StringConstructor;
814
+ };
812
815
  }, {
813
816
  attrs: {
814
817
  [x: string]: unknown;
@@ -826,6 +829,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
826
829
  placeholder: {
827
830
  type: StringConstructor;
828
831
  };
832
+ allowedInvalidValue: {
833
+ type: StringConstructor;
834
+ };
829
835
  }>> & {
830
836
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
831
837
  }>>;
@@ -833,7 +839,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
833
839
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
834
840
  panelInstRef: import("vue").Ref<null>;
835
841
  placeholderRef: import("vue").Ref<any>;
836
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
842
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
837
843
  isDateTime: import("vue").ComputedRef<boolean>;
838
844
  formatRef: import("vue").ComputedRef<string>;
839
845
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -842,7 +848,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
842
848
  handleConfirm: (target: HTMLInputElement) => void;
843
849
  onUpdateShow: (show: boolean) => void;
844
850
  onConfirm: (...args: any[]) => Promise<void>;
845
- isOtherValue: (value?: string) => boolean;
851
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
846
852
  NDatePicker: any;
847
853
  }, 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<{
848
854
  updateUnchangedValue: {
@@ -857,6 +863,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
857
863
  placeholder: {
858
864
  type: StringConstructor;
859
865
  };
866
+ allowedInvalidValue: {
867
+ type: StringConstructor;
868
+ };
860
869
  }>> & {
861
870
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
862
871
  }, {
@@ -1428,6 +1437,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1428
1437
  placeholder: {
1429
1438
  type: StringConstructor;
1430
1439
  };
1440
+ allowedInvalidValue: {
1441
+ type: StringConstructor;
1442
+ };
1431
1443
  }, {
1432
1444
  attrs: {
1433
1445
  [x: string]: unknown;
@@ -1445,6 +1457,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1445
1457
  placeholder: {
1446
1458
  type: StringConstructor;
1447
1459
  };
1460
+ allowedInvalidValue: {
1461
+ type: StringConstructor;
1462
+ };
1448
1463
  }>> & {
1449
1464
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1450
1465
  }>>;
@@ -1452,7 +1467,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1452
1467
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
1453
1468
  panelInstRef: import("vue").Ref<null>;
1454
1469
  placeholderRef: import("vue").Ref<any>;
1455
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1470
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
1456
1471
  isDateTime: import("vue").ComputedRef<boolean>;
1457
1472
  formatRef: import("vue").ComputedRef<string>;
1458
1473
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -1461,7 +1476,7 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1461
1476
  handleConfirm: (target: HTMLInputElement) => void;
1462
1477
  onUpdateShow: (show: boolean) => void;
1463
1478
  onConfirm: (...args: any[]) => Promise<void>;
1464
- isOtherValue: (value?: string) => boolean;
1479
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
1465
1480
  NDatePicker: any;
1466
1481
  }, 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<{
1467
1482
  updateUnchangedValue: {
@@ -1476,6 +1491,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1476
1491
  placeholder: {
1477
1492
  type: StringConstructor;
1478
1493
  };
1494
+ allowedInvalidValue: {
1495
+ type: StringConstructor;
1496
+ };
1479
1497
  }>> & {
1480
1498
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1481
1499
  }, {
@@ -286,6 +286,9 @@ declare const _default: import("vue").DefineComponent<{
286
286
  placeholder: {
287
287
  type: StringConstructor;
288
288
  };
289
+ allowedInvalidValue: {
290
+ type: StringConstructor;
291
+ };
289
292
  }, {
290
293
  attrs: {
291
294
  [x: string]: unknown;
@@ -303,6 +306,9 @@ declare const _default: import("vue").DefineComponent<{
303
306
  placeholder: {
304
307
  type: StringConstructor;
305
308
  };
309
+ allowedInvalidValue: {
310
+ type: StringConstructor;
311
+ };
306
312
  }>> & {
307
313
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
308
314
  }>>;
@@ -310,7 +316,7 @@ declare const _default: import("vue").DefineComponent<{
310
316
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
311
317
  panelInstRef: import("vue").Ref<null>;
312
318
  placeholderRef: import("vue").Ref<any>;
313
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
319
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
314
320
  isDateTime: import("vue").ComputedRef<boolean>;
315
321
  formatRef: import("vue").ComputedRef<string>;
316
322
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -319,7 +325,7 @@ declare const _default: import("vue").DefineComponent<{
319
325
  handleConfirm: (target: HTMLInputElement) => void;
320
326
  onUpdateShow: (show: boolean) => void;
321
327
  onConfirm: (...args: any[]) => Promise<void>;
322
- isOtherValue: (value?: string) => boolean;
328
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
323
329
  NDatePicker: any;
324
330
  }, 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<{
325
331
  updateUnchangedValue: {
@@ -334,6 +340,9 @@ declare const _default: import("vue").DefineComponent<{
334
340
  placeholder: {
335
341
  type: StringConstructor;
336
342
  };
343
+ allowedInvalidValue: {
344
+ type: StringConstructor;
345
+ };
337
346
  }>> & {
338
347
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
339
348
  }, {
@@ -905,6 +914,9 @@ declare const _default: import("vue").DefineComponent<{
905
914
  placeholder: {
906
915
  type: StringConstructor;
907
916
  };
917
+ allowedInvalidValue: {
918
+ type: StringConstructor;
919
+ };
908
920
  }, {
909
921
  attrs: {
910
922
  [x: string]: unknown;
@@ -922,6 +934,9 @@ declare const _default: import("vue").DefineComponent<{
922
934
  placeholder: {
923
935
  type: StringConstructor;
924
936
  };
937
+ allowedInvalidValue: {
938
+ type: StringConstructor;
939
+ };
925
940
  }>> & {
926
941
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
927
942
  }>>;
@@ -929,7 +944,7 @@ declare const _default: import("vue").DefineComponent<{
929
944
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
930
945
  panelInstRef: import("vue").Ref<null>;
931
946
  placeholderRef: import("vue").Ref<any>;
932
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
947
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
933
948
  isDateTime: import("vue").ComputedRef<boolean>;
934
949
  formatRef: import("vue").ComputedRef<string>;
935
950
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -938,7 +953,7 @@ declare const _default: import("vue").DefineComponent<{
938
953
  handleConfirm: (target: HTMLInputElement) => void;
939
954
  onUpdateShow: (show: boolean) => void;
940
955
  onConfirm: (...args: any[]) => Promise<void>;
941
- isOtherValue: (value?: string) => boolean;
956
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
942
957
  NDatePicker: any;
943
958
  }, 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<{
944
959
  updateUnchangedValue: {
@@ -953,6 +968,9 @@ declare const _default: import("vue").DefineComponent<{
953
968
  placeholder: {
954
969
  type: StringConstructor;
955
970
  };
971
+ allowedInvalidValue: {
972
+ type: StringConstructor;
973
+ };
956
974
  }>> & {
957
975
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
958
976
  }, {
@@ -596,6 +596,9 @@ declare const _default: import("vue").DefineComponent<{
596
596
  placeholder: {
597
597
  type: StringConstructor;
598
598
  };
599
+ allowedInvalidValue: {
600
+ type: StringConstructor;
601
+ };
599
602
  }, {
600
603
  attrs: {
601
604
  [x: string]: unknown;
@@ -613,6 +616,9 @@ declare const _default: import("vue").DefineComponent<{
613
616
  placeholder: {
614
617
  type: StringConstructor;
615
618
  };
619
+ allowedInvalidValue: {
620
+ type: StringConstructor;
621
+ };
616
622
  }>> & {
617
623
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
618
624
  }>>;
@@ -620,7 +626,7 @@ declare const _default: import("vue").DefineComponent<{
620
626
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
621
627
  panelInstRef: import("vue").Ref<null>;
622
628
  placeholderRef: import("vue").Ref<any>;
623
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
629
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
624
630
  isDateTime: import("vue").ComputedRef<boolean>;
625
631
  formatRef: import("vue").ComputedRef<string>;
626
632
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -629,7 +635,7 @@ declare const _default: import("vue").DefineComponent<{
629
635
  handleConfirm: (target: HTMLInputElement) => void;
630
636
  onUpdateShow: (show: boolean) => void;
631
637
  onConfirm: (...args: any[]) => Promise<void>;
632
- isOtherValue: (value?: string) => boolean;
638
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
633
639
  NDatePicker: any;
634
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<{
635
641
  updateUnchangedValue: {
@@ -644,6 +650,9 @@ declare const _default: import("vue").DefineComponent<{
644
650
  placeholder: {
645
651
  type: StringConstructor;
646
652
  };
653
+ allowedInvalidValue: {
654
+ type: StringConstructor;
655
+ };
647
656
  }>> & {
648
657
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
649
658
  }, {
@@ -1215,6 +1224,9 @@ declare const _default: import("vue").DefineComponent<{
1215
1224
  placeholder: {
1216
1225
  type: StringConstructor;
1217
1226
  };
1227
+ allowedInvalidValue: {
1228
+ type: StringConstructor;
1229
+ };
1218
1230
  }, {
1219
1231
  attrs: {
1220
1232
  [x: string]: unknown;
@@ -1232,6 +1244,9 @@ declare const _default: import("vue").DefineComponent<{
1232
1244
  placeholder: {
1233
1245
  type: StringConstructor;
1234
1246
  };
1247
+ allowedInvalidValue: {
1248
+ type: StringConstructor;
1249
+ };
1235
1250
  }>> & {
1236
1251
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1237
1252
  }>>;
@@ -1239,7 +1254,7 @@ declare const _default: import("vue").DefineComponent<{
1239
1254
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
1240
1255
  panelInstRef: import("vue").Ref<null>;
1241
1256
  placeholderRef: import("vue").Ref<any>;
1242
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1257
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
1243
1258
  isDateTime: import("vue").ComputedRef<boolean>;
1244
1259
  formatRef: import("vue").ComputedRef<string>;
1245
1260
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -1248,7 +1263,7 @@ declare const _default: import("vue").DefineComponent<{
1248
1263
  handleConfirm: (target: HTMLInputElement) => void;
1249
1264
  onUpdateShow: (show: boolean) => void;
1250
1265
  onConfirm: (...args: any[]) => Promise<void>;
1251
- isOtherValue: (value?: string) => boolean;
1266
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
1252
1267
  NDatePicker: any;
1253
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<{
1254
1269
  updateUnchangedValue: {
@@ -1263,6 +1278,9 @@ declare const _default: import("vue").DefineComponent<{
1263
1278
  placeholder: {
1264
1279
  type: StringConstructor;
1265
1280
  };
1281
+ allowedInvalidValue: {
1282
+ type: StringConstructor;
1283
+ };
1266
1284
  }>> & {
1267
1285
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1268
1286
  }, {
@@ -810,6 +810,9 @@ declare const _default: import("vue").DefineComponent<{
810
810
  placeholder: {
811
811
  type: StringConstructor;
812
812
  };
813
+ allowedInvalidValue: {
814
+ type: StringConstructor;
815
+ };
813
816
  }, {
814
817
  attrs: {
815
818
  [x: string]: unknown;
@@ -827,6 +830,9 @@ declare const _default: import("vue").DefineComponent<{
827
830
  placeholder: {
828
831
  type: StringConstructor;
829
832
  };
833
+ allowedInvalidValue: {
834
+ type: StringConstructor;
835
+ };
830
836
  }>> & {
831
837
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
832
838
  }>>;
@@ -834,7 +840,7 @@ declare const _default: import("vue").DefineComponent<{
834
840
  datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
835
841
  panelInstRef: import("vue").Ref<null>;
836
842
  placeholderRef: import("vue").Ref<any>;
837
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
843
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
838
844
  isDateTime: import("vue").ComputedRef<boolean>;
839
845
  formatRef: import("vue").ComputedRef<string>;
840
846
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -843,7 +849,7 @@ declare const _default: import("vue").DefineComponent<{
843
849
  handleConfirm: (target: HTMLInputElement) => void;
844
850
  onUpdateShow: (show: boolean) => void;
845
851
  onConfirm: (...args: any[]) => Promise<void>;
846
- isOtherValue: (value?: string) => boolean;
852
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
847
853
  NDatePicker: any;
848
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<{
849
855
  updateUnchangedValue: {
@@ -858,6 +864,9 @@ declare const _default: import("vue").DefineComponent<{
858
864
  placeholder: {
859
865
  type: StringConstructor;
860
866
  };
867
+ allowedInvalidValue: {
868
+ type: StringConstructor;
869
+ };
861
870
  }>> & {
862
871
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
863
872
  }, {
@@ -1429,6 +1438,9 @@ declare const _default: import("vue").DefineComponent<{
1429
1438
  placeholder: {
1430
1439
  type: StringConstructor;
1431
1440
  };
1441
+ allowedInvalidValue: {
1442
+ type: StringConstructor;
1443
+ };
1432
1444
  }, {
1433
1445
  attrs: {
1434
1446
  [x: string]: unknown;
@@ -1446,6 +1458,9 @@ declare const _default: import("vue").DefineComponent<{
1446
1458
  placeholder: {
1447
1459
  type: StringConstructor;
1448
1460
  };
1461
+ allowedInvalidValue: {
1462
+ type: StringConstructor;
1463
+ };
1449
1464
  }>> & {
1450
1465
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1451
1466
  }>>;
@@ -1453,7 +1468,7 @@ declare const _default: import("vue").DefineComponent<{
1453
1468
  datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
1454
1469
  panelInstRef: import("vue").Ref<null>;
1455
1470
  placeholderRef: import("vue").Ref<any>;
1456
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1471
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
1457
1472
  isDateTime: import("vue").ComputedRef<boolean>;
1458
1473
  formatRef: import("vue").ComputedRef<string>;
1459
1474
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -1462,7 +1477,7 @@ declare const _default: import("vue").DefineComponent<{
1462
1477
  handleConfirm: (target: HTMLInputElement) => void;
1463
1478
  onUpdateShow: (show: boolean) => void;
1464
1479
  onConfirm: (...args: any[]) => Promise<void>;
1465
- isOtherValue: (value?: string) => boolean;
1480
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
1466
1481
  NDatePicker: any;
1467
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<{
1468
1483
  updateUnchangedValue: {
@@ -1477,6 +1492,9 @@ declare const _default: import("vue").DefineComponent<{
1477
1492
  placeholder: {
1478
1493
  type: StringConstructor;
1479
1494
  };
1495
+ allowedInvalidValue: {
1496
+ type: StringConstructor;
1497
+ };
1480
1498
  }>> & {
1481
1499
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1482
1500
  }, {
@@ -12,6 +12,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
12
12
  placeholder: {
13
13
  type: StringConstructor;
14
14
  };
15
+ allowedInvalidValue: {
16
+ type: StringConstructor;
17
+ };
15
18
  }, {
16
19
  attrs: {
17
20
  [x: string]: unknown;
@@ -29,6 +32,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
29
32
  placeholder: {
30
33
  type: StringConstructor;
31
34
  };
35
+ allowedInvalidValue: {
36
+ type: StringConstructor;
37
+ };
32
38
  }>> & {
33
39
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
34
40
  }>>;
@@ -36,7 +42,7 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
36
42
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
37
43
  panelInstRef: import("vue").Ref<null>;
38
44
  placeholderRef: import("vue").Ref<any>;
39
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
45
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
40
46
  isDateTime: import("vue").ComputedRef<boolean>;
41
47
  formatRef: import("vue").ComputedRef<string>;
42
48
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -45,7 +51,7 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
45
51
  handleConfirm: (target: HTMLInputElement) => void;
46
52
  onUpdateShow: (show: boolean) => void;
47
53
  onConfirm: (...args: any[]) => Promise<void>;
48
- isOtherValue: (value?: string) => boolean;
54
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
49
55
  NDatePicker: any;
50
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<{
51
57
  updateUnchangedValue: {
@@ -60,6 +66,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
60
66
  placeholder: {
61
67
  type: StringConstructor;
62
68
  };
69
+ allowedInvalidValue: {
70
+ type: StringConstructor;
71
+ };
63
72
  }>> & {
64
73
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
65
74
  }, {
@@ -12,6 +12,9 @@ declare const _default: import("vue").DefineComponent<{
12
12
  placeholder: {
13
13
  type: StringConstructor;
14
14
  };
15
+ allowedInvalidValue: {
16
+ type: StringConstructor;
17
+ };
15
18
  }, {
16
19
  attrs: {
17
20
  [x: string]: unknown;
@@ -29,6 +32,9 @@ declare const _default: import("vue").DefineComponent<{
29
32
  placeholder: {
30
33
  type: StringConstructor;
31
34
  };
35
+ allowedInvalidValue: {
36
+ type: StringConstructor;
37
+ };
32
38
  }>> & {
33
39
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
34
40
  }>>;
@@ -36,7 +42,7 @@ declare const _default: import("vue").DefineComponent<{
36
42
  datePickerRef: import("vue").Ref<AnyObject | null>;
37
43
  panelInstRef: import("vue").Ref<null>;
38
44
  placeholderRef: import("vue").Ref<any>;
39
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
45
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
40
46
  isDateTime: import("vue").ComputedRef<boolean>;
41
47
  formatRef: import("vue").ComputedRef<string>;
42
48
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -45,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
45
51
  handleConfirm: (target: HTMLInputElement) => void;
46
52
  onUpdateShow: (show: boolean) => void;
47
53
  onConfirm: (...args: any[]) => Promise<void>;
48
- isOtherValue: (value?: string) => boolean;
54
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
49
55
  NDatePicker: any;
50
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<{
51
57
  updateUnchangedValue: {
@@ -60,6 +66,9 @@ declare const _default: import("vue").DefineComponent<{
60
66
  placeholder: {
61
67
  type: StringConstructor;
62
68
  };
69
+ allowedInvalidValue: {
70
+ type: StringConstructor;
71
+ };
63
72
  }>> & {
64
73
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
65
74
  }, {
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as n,openBlock as u,createBlock as r,unref as o,isRef as i,createSlots as d,renderList as s,withCtx as f,renderSlot as m,nextTick as p}from"vue";import{NDatePicker as v}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}},emits:["update:formatted-value"],setup(e,{expose:h,emit:g}){const R=e,M=t(),V=a(null),k=a(null),w=a(),C=l({get:()=>x(R.formattedValue)?void 0:R.formattedValue,set(e){g("update:formatted-value",e,e?Date.parse(e):null)}}),D=l((()=>{const e=Reflect.get(M,"type")||"";return["datetime","datetimerange"].includes(e)})),E=l((()=>{if(Reflect.get(M,"format"))return M.format;const e=M.type||"";return D.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),I=l((()=>D.value?E.value.split(" "):"")),{focus:P,blur:U,handleConfirm:$}=c(V,{formatRef:E,attrs:M,emit:g});function _(e){e&&D.value&&p((()=>{var e;k.value=null==(e=V.value)?void 0:e.panelInstRef,c(k,{formatRef:I,attrs:M,isPanel:!0})}))}async function b(...e){var t,a,l,n,u,r;const o=Reflect.get(M,"type")||"",i=null==(n=null==(l=null==(a=null==(t=V.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(o.includes("range")?null==(u=R.onConfirm)||u.call(R,...e):(await p(),i.focus(),$(i),i.blur(),null==(r=R.onConfirm)||r.call(R,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!R.updateUnchangedValue||o.includes("range"))return;const d=i.value;i.value=y(new Date,E.value),i.dispatchEvent(new InputEvent("input")),i.value=d,i.dispatchEvent(new InputEvent("input"))}function x(e=""){return["-"].includes(e)}return n((()=>R.formattedValue),(e=>{w.value=x(e)?e:R.placeholder?R.placeholder:"选择日期时间"}),{immediate:!0}),h({$datePicker:V,focus:P,blur:U}),(e,t)=>(u(),r(o(v),{ref_key:"datePickerRef",ref:V,"onUpdate:show":_,onConfirm:b,placeholder:w.value,"formatted-value":o(C),"onUpdate:formatted-value":t[0]||(t[0]=e=>i(C)?C.value=e:null)},d({_:2},[s(e.$slots,((t,a)=>({name:a,fn:f((()=>[m(e.$slots,a)]))})))]),1032,["placeholder","formatted-value"]))}});export{h 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};
@@ -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&&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&&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};
@@ -38,6 +38,9 @@ declare const _default: import("vue").DefineComponent<{
38
38
  placeholder: {
39
39
  type: StringConstructor;
40
40
  };
41
+ allowedInvalidValue: {
42
+ type: StringConstructor;
43
+ };
41
44
  }, {
42
45
  attrs: {
43
46
  [x: string]: unknown;
@@ -55,6 +58,9 @@ declare const _default: import("vue").DefineComponent<{
55
58
  placeholder: {
56
59
  type: StringConstructor;
57
60
  };
61
+ allowedInvalidValue: {
62
+ type: StringConstructor;
63
+ };
58
64
  }>> & {
59
65
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
60
66
  }>>;
@@ -62,7 +68,7 @@ declare const _default: import("vue").DefineComponent<{
62
68
  datePickerRef: import("vue").Ref<import("../../../../../../es/shared/types").AnyObject | null>;
63
69
  panelInstRef: import("vue").Ref<null>;
64
70
  placeholderRef: import("vue").Ref<any>;
65
- currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
71
+ currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
66
72
  isDateTime: import("vue").ComputedRef<boolean>;
67
73
  formatRef: import("vue").ComputedRef<string>;
68
74
  panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
@@ -71,7 +77,7 @@ declare const _default: import("vue").DefineComponent<{
71
77
  handleConfirm: (target: HTMLInputElement) => void;
72
78
  onUpdateShow: (show: boolean) => void;
73
79
  onConfirm: (...args: any[]) => Promise<void>;
74
- isOtherValue: (value?: string) => boolean;
80
+ isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
75
81
  NDatePicker: any;
76
82
  }, 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<{
77
83
  updateUnchangedValue: {
@@ -86,6 +92,9 @@ declare const _default: import("vue").DefineComponent<{
86
92
  placeholder: {
87
93
  type: StringConstructor;
88
94
  };
95
+ allowedInvalidValue: {
96
+ type: StringConstructor;
97
+ };
89
98
  }>> & {
90
99
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
91
100
  }, {