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

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 (47) hide show
  1. package/README.md +87 -87
  2. package/es/components/classification/index.d.ts +20 -2
  3. package/es/components/classification/src/components/search-filter/index.vue.d.ts +20 -2
  4. package/es/components/classification/src/components/set-classification/index.vue.d.ts +20 -2
  5. package/es/components/classification/src/index.vue.d.ts +20 -2
  6. package/es/components/date-picker/index.d.ts +10 -1
  7. package/es/components/date-picker/src/DatePicker.vue.d.ts +10 -1
  8. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  9. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  10. package/es/components/form-render/src/components/renderer/date.js +1 -1
  11. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +10 -1
  12. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +10 -1
  13. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  14. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  15. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  16. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  17. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +20 -2
  18. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +10 -1
  19. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +10 -1
  20. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +20 -2
  21. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +20 -2
  22. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +10 -1
  23. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +10 -1
  24. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +10 -1
  25. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +10 -1
  26. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +40 -4
  27. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +40 -4
  28. package/es/env.d.ts +25 -25
  29. package/es/shared/assets/img/failure.png.js +1 -1
  30. package/es/shared/assets/img/no-permission.png.js +1 -1
  31. package/es/shared/assets/img/nodata.png.js +1 -1
  32. package/es/shared/assets/img/notfound.png.js +1 -1
  33. package/es/shared/assets/img/qr.png.js +1 -1
  34. package/es/shared/assets/img/success.png.js +1 -1
  35. package/es/shared/assets/img/video.png.js +1 -1
  36. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  37. package/es/shared/assets/img/xb_big.png.js +1 -1
  38. package/es/shared/assets/img/xb_small.png.js +1 -1
  39. package/es/shared/package.json.js +1 -1
  40. package/package.json +2 -2
  41. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  42. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  43. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  44. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  45. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  46. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  47. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -806,6 +806,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
806
806
  formattedValue: {
807
807
  type: StringConstructor;
808
808
  };
809
+ placeholder: {
810
+ type: StringConstructor;
811
+ };
809
812
  }, {
810
813
  attrs: {
811
814
  [x: string]: unknown;
@@ -820,13 +823,16 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
820
823
  formattedValue: {
821
824
  type: StringConstructor;
822
825
  };
826
+ placeholder: {
827
+ type: StringConstructor;
828
+ };
823
829
  }>> & {
824
830
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
825
831
  }>>;
826
832
  emit: (event: "update:formatted-value", ...args: any[]) => void;
827
833
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
828
834
  panelInstRef: import("vue").Ref<null>;
829
- placeholder: import("vue").Ref<any>;
835
+ placeholderRef: import("vue").Ref<any>;
830
836
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
831
837
  isDateTime: import("vue").ComputedRef<boolean>;
832
838
  formatRef: import("vue").ComputedRef<string>;
@@ -848,6 +854,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
848
854
  formattedValue: {
849
855
  type: StringConstructor;
850
856
  };
857
+ placeholder: {
858
+ type: StringConstructor;
859
+ };
851
860
  }>> & {
852
861
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
853
862
  }, {
@@ -1416,6 +1425,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1416
1425
  formattedValue: {
1417
1426
  type: StringConstructor;
1418
1427
  };
1428
+ placeholder: {
1429
+ type: StringConstructor;
1430
+ };
1419
1431
  }, {
1420
1432
  attrs: {
1421
1433
  [x: string]: unknown;
@@ -1430,13 +1442,16 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1430
1442
  formattedValue: {
1431
1443
  type: StringConstructor;
1432
1444
  };
1445
+ placeholder: {
1446
+ type: StringConstructor;
1447
+ };
1433
1448
  }>> & {
1434
1449
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1435
1450
  }>>;
1436
1451
  emit: (event: "update:formatted-value", ...args: any[]) => void;
1437
1452
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
1438
1453
  panelInstRef: import("vue").Ref<null>;
1439
- placeholder: import("vue").Ref<any>;
1454
+ placeholderRef: import("vue").Ref<any>;
1440
1455
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1441
1456
  isDateTime: import("vue").ComputedRef<boolean>;
1442
1457
  formatRef: import("vue").ComputedRef<string>;
@@ -1458,6 +1473,9 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
1458
1473
  formattedValue: {
1459
1474
  type: StringConstructor;
1460
1475
  };
1476
+ placeholder: {
1477
+ type: StringConstructor;
1478
+ };
1461
1479
  }>> & {
1462
1480
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1463
1481
  }, {
@@ -283,6 +283,9 @@ declare const _default: import("vue").DefineComponent<{
283
283
  formattedValue: {
284
284
  type: StringConstructor;
285
285
  };
286
+ placeholder: {
287
+ type: StringConstructor;
288
+ };
286
289
  }, {
287
290
  attrs: {
288
291
  [x: string]: unknown;
@@ -297,13 +300,16 @@ declare const _default: import("vue").DefineComponent<{
297
300
  formattedValue: {
298
301
  type: StringConstructor;
299
302
  };
303
+ placeholder: {
304
+ type: StringConstructor;
305
+ };
300
306
  }>> & {
301
307
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
302
308
  }>>;
303
309
  emit: (event: "update:formatted-value", ...args: any[]) => void;
304
310
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
305
311
  panelInstRef: import("vue").Ref<null>;
306
- placeholder: import("vue").Ref<any>;
312
+ placeholderRef: import("vue").Ref<any>;
307
313
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
308
314
  isDateTime: import("vue").ComputedRef<boolean>;
309
315
  formatRef: import("vue").ComputedRef<string>;
@@ -325,6 +331,9 @@ declare const _default: import("vue").DefineComponent<{
325
331
  formattedValue: {
326
332
  type: StringConstructor;
327
333
  };
334
+ placeholder: {
335
+ type: StringConstructor;
336
+ };
328
337
  }>> & {
329
338
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
330
339
  }, {
@@ -893,6 +902,9 @@ declare const _default: import("vue").DefineComponent<{
893
902
  formattedValue: {
894
903
  type: StringConstructor;
895
904
  };
905
+ placeholder: {
906
+ type: StringConstructor;
907
+ };
896
908
  }, {
897
909
  attrs: {
898
910
  [x: string]: unknown;
@@ -907,13 +919,16 @@ declare const _default: import("vue").DefineComponent<{
907
919
  formattedValue: {
908
920
  type: StringConstructor;
909
921
  };
922
+ placeholder: {
923
+ type: StringConstructor;
924
+ };
910
925
  }>> & {
911
926
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
912
927
  }>>;
913
928
  emit: (event: "update:formatted-value", ...args: any[]) => void;
914
929
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
915
930
  panelInstRef: import("vue").Ref<null>;
916
- placeholder: import("vue").Ref<any>;
931
+ placeholderRef: import("vue").Ref<any>;
917
932
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
918
933
  isDateTime: import("vue").ComputedRef<boolean>;
919
934
  formatRef: import("vue").ComputedRef<string>;
@@ -935,6 +950,9 @@ declare const _default: import("vue").DefineComponent<{
935
950
  formattedValue: {
936
951
  type: StringConstructor;
937
952
  };
953
+ placeholder: {
954
+ type: StringConstructor;
955
+ };
938
956
  }>> & {
939
957
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
940
958
  }, {
@@ -593,6 +593,9 @@ declare const _default: import("vue").DefineComponent<{
593
593
  formattedValue: {
594
594
  type: StringConstructor;
595
595
  };
596
+ placeholder: {
597
+ type: StringConstructor;
598
+ };
596
599
  }, {
597
600
  attrs: {
598
601
  [x: string]: unknown;
@@ -607,13 +610,16 @@ declare const _default: import("vue").DefineComponent<{
607
610
  formattedValue: {
608
611
  type: StringConstructor;
609
612
  };
613
+ placeholder: {
614
+ type: StringConstructor;
615
+ };
610
616
  }>> & {
611
617
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
612
618
  }>>;
613
619
  emit: (event: "update:formatted-value", ...args: any[]) => void;
614
620
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
615
621
  panelInstRef: import("vue").Ref<null>;
616
- placeholder: import("vue").Ref<any>;
622
+ placeholderRef: import("vue").Ref<any>;
617
623
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
618
624
  isDateTime: import("vue").ComputedRef<boolean>;
619
625
  formatRef: import("vue").ComputedRef<string>;
@@ -635,6 +641,9 @@ declare const _default: import("vue").DefineComponent<{
635
641
  formattedValue: {
636
642
  type: StringConstructor;
637
643
  };
644
+ placeholder: {
645
+ type: StringConstructor;
646
+ };
638
647
  }>> & {
639
648
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
640
649
  }, {
@@ -1203,6 +1212,9 @@ declare const _default: import("vue").DefineComponent<{
1203
1212
  formattedValue: {
1204
1213
  type: StringConstructor;
1205
1214
  };
1215
+ placeholder: {
1216
+ type: StringConstructor;
1217
+ };
1206
1218
  }, {
1207
1219
  attrs: {
1208
1220
  [x: string]: unknown;
@@ -1217,13 +1229,16 @@ declare const _default: import("vue").DefineComponent<{
1217
1229
  formattedValue: {
1218
1230
  type: StringConstructor;
1219
1231
  };
1232
+ placeholder: {
1233
+ type: StringConstructor;
1234
+ };
1220
1235
  }>> & {
1221
1236
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1222
1237
  }>>;
1223
1238
  emit: (event: "update:formatted-value", ...args: any[]) => void;
1224
1239
  datePickerRef: import("vue").Ref<import("../../../..").AnyObject | null>;
1225
1240
  panelInstRef: import("vue").Ref<null>;
1226
- placeholder: import("vue").Ref<any>;
1241
+ placeholderRef: import("vue").Ref<any>;
1227
1242
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1228
1243
  isDateTime: import("vue").ComputedRef<boolean>;
1229
1244
  formatRef: import("vue").ComputedRef<string>;
@@ -1245,6 +1260,9 @@ declare const _default: import("vue").DefineComponent<{
1245
1260
  formattedValue: {
1246
1261
  type: StringConstructor;
1247
1262
  };
1263
+ placeholder: {
1264
+ type: StringConstructor;
1265
+ };
1248
1266
  }>> & {
1249
1267
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1250
1268
  }, {
@@ -807,6 +807,9 @@ declare const _default: import("vue").DefineComponent<{
807
807
  formattedValue: {
808
808
  type: StringConstructor;
809
809
  };
810
+ placeholder: {
811
+ type: StringConstructor;
812
+ };
810
813
  }, {
811
814
  attrs: {
812
815
  [x: string]: unknown;
@@ -821,13 +824,16 @@ declare const _default: import("vue").DefineComponent<{
821
824
  formattedValue: {
822
825
  type: StringConstructor;
823
826
  };
827
+ placeholder: {
828
+ type: StringConstructor;
829
+ };
824
830
  }>> & {
825
831
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
826
832
  }>>;
827
833
  emit: (event: "update:formatted-value", ...args: any[]) => void;
828
834
  datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
829
835
  panelInstRef: import("vue").Ref<null>;
830
- placeholder: import("vue").Ref<any>;
836
+ placeholderRef: import("vue").Ref<any>;
831
837
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
832
838
  isDateTime: import("vue").ComputedRef<boolean>;
833
839
  formatRef: import("vue").ComputedRef<string>;
@@ -849,6 +855,9 @@ declare const _default: import("vue").DefineComponent<{
849
855
  formattedValue: {
850
856
  type: StringConstructor;
851
857
  };
858
+ placeholder: {
859
+ type: StringConstructor;
860
+ };
852
861
  }>> & {
853
862
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
854
863
  }, {
@@ -1417,6 +1426,9 @@ declare const _default: import("vue").DefineComponent<{
1417
1426
  formattedValue: {
1418
1427
  type: StringConstructor;
1419
1428
  };
1429
+ placeholder: {
1430
+ type: StringConstructor;
1431
+ };
1420
1432
  }, {
1421
1433
  attrs: {
1422
1434
  [x: string]: unknown;
@@ -1431,13 +1443,16 @@ declare const _default: import("vue").DefineComponent<{
1431
1443
  formattedValue: {
1432
1444
  type: StringConstructor;
1433
1445
  };
1446
+ placeholder: {
1447
+ type: StringConstructor;
1448
+ };
1434
1449
  }>> & {
1435
1450
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1436
1451
  }>>;
1437
1452
  emit: (event: "update:formatted-value", ...args: any[]) => void;
1438
1453
  datePickerRef: import("vue").Ref<import("../..").AnyObject | null>;
1439
1454
  panelInstRef: import("vue").Ref<null>;
1440
- placeholder: import("vue").Ref<any>;
1455
+ placeholderRef: import("vue").Ref<any>;
1441
1456
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
1442
1457
  isDateTime: import("vue").ComputedRef<boolean>;
1443
1458
  formatRef: import("vue").ComputedRef<string>;
@@ -1459,6 +1474,9 @@ declare const _default: import("vue").DefineComponent<{
1459
1474
  formattedValue: {
1460
1475
  type: StringConstructor;
1461
1476
  };
1477
+ placeholder: {
1478
+ type: StringConstructor;
1479
+ };
1462
1480
  }>> & {
1463
1481
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1464
1482
  }, {
@@ -9,6 +9,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
9
9
  formattedValue: {
10
10
  type: StringConstructor;
11
11
  };
12
+ placeholder: {
13
+ type: StringConstructor;
14
+ };
12
15
  }, {
13
16
  attrs: {
14
17
  [x: string]: unknown;
@@ -23,13 +26,16 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
23
26
  formattedValue: {
24
27
  type: StringConstructor;
25
28
  };
29
+ placeholder: {
30
+ type: StringConstructor;
31
+ };
26
32
  }>> & {
27
33
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
28
34
  }>>;
29
35
  emit: (event: "update:formatted-value", ...args: any[]) => void;
30
36
  datePickerRef: import("vue").Ref<import("../../../es/shared/types").AnyObject | null>;
31
37
  panelInstRef: import("vue").Ref<null>;
32
- placeholder: import("vue").Ref<any>;
38
+ placeholderRef: import("vue").Ref<any>;
33
39
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
34
40
  isDateTime: import("vue").ComputedRef<boolean>;
35
41
  formatRef: import("vue").ComputedRef<string>;
@@ -51,6 +57,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
51
57
  formattedValue: {
52
58
  type: StringConstructor;
53
59
  };
60
+ placeholder: {
61
+ type: StringConstructor;
62
+ };
54
63
  }>> & {
55
64
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
56
65
  }, {
@@ -9,6 +9,9 @@ declare const _default: import("vue").DefineComponent<{
9
9
  formattedValue: {
10
10
  type: StringConstructor;
11
11
  };
12
+ placeholder: {
13
+ type: StringConstructor;
14
+ };
12
15
  }, {
13
16
  attrs: {
14
17
  [x: string]: unknown;
@@ -23,13 +26,16 @@ declare const _default: import("vue").DefineComponent<{
23
26
  formattedValue: {
24
27
  type: StringConstructor;
25
28
  };
29
+ placeholder: {
30
+ type: StringConstructor;
31
+ };
26
32
  }>> & {
27
33
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
28
34
  }>>;
29
35
  emit: (event: "update:formatted-value", ...args: any[]) => void;
30
36
  datePickerRef: import("vue").Ref<AnyObject | null>;
31
37
  panelInstRef: import("vue").Ref<null>;
32
- placeholder: import("vue").Ref<any>;
38
+ placeholderRef: import("vue").Ref<any>;
33
39
  currentFormattedValue: import("vue").WritableComputedRef<string | undefined>;
34
40
  isDateTime: import("vue").ComputedRef<boolean>;
35
41
  formatRef: import("vue").ComputedRef<string>;
@@ -51,6 +57,9 @@ declare const _default: import("vue").DefineComponent<{
51
57
  formattedValue: {
52
58
  type: StringConstructor;
53
59
  };
60
+ placeholder: {
61
+ type: StringConstructor;
62
+ };
54
63
  }>> & {
55
64
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
56
65
  }, {
@@ -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,mergeProps as i,isRef as d,createSlots as s,renderList as f,withCtx as m,renderSlot as p,nextTick as v}from"vue";import{NDatePicker as c}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as y}from"../../../shared/hooks/useDateTime.js";import{format as h}from"date-fns";var g=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:String}},emits:["update:formatted-value"],setup(e,{expose:g,emit:R}){const M=e,V=t(),k=a(null),w=a(null),C=a(),D=l({get:()=>j(M.formattedValue)?void 0:M.formattedValue,set(e){R("update:formatted-value",e,e?Date.parse(e):null)}}),$=l((()=>{const e=Reflect.get(V,"type")||"";return["datetime","datetimerange"].includes(e)})),E=l((()=>{if(Reflect.get(V,"format"))return V.format;const e=V.type||"";return $.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),I=l((()=>$.value?E.value.split(" "):"")),{focus:P,blur:U,handleConfirm:_}=y(k,{formatRef:E,attrs:V,emit:R});function b(e){e&&$.value&&v((()=>{var e;w.value=null==(e=k.value)?void 0:e.panelInstRef,y(w,{formatRef:I,attrs:V,isPanel:!0})}))}async function x(...e){var t,a,l,n,u,r;const o=Reflect.get(V,"type")||"",i=null==(n=null==(l=null==(a=null==(t=k.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=M.onConfirm)||u.call(M,...e):(await v(),i.focus(),_(i),i.blur(),null==(r=M.onConfirm)||r.call(M,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!M.updateUnchangedValue||o.includes("range"))return;const d=i.value;i.value=h(new Date,E.value),i.dispatchEvent(new InputEvent("input")),i.value=d,i.dispatchEvent(new InputEvent("input"))}function j(e=""){return["-"].includes(e)}return n((()=>M.formattedValue),(e=>{C.value=j(e)?e:V.placeholder?V.placeholder:"选择日期时间"}),{immediate:!0}),g({$datePicker:k,focus:P,blur:U}),(e,t)=>(u(),r(o(c),i({ref_key:"datePickerRef",ref:k},e.$attrs,{"onUpdate:show":b,onConfirm:x,placeholder:C.value,"formatted-value":o(D),"onUpdate:formatted-value":t[0]||(t[0]=e=>d(D)?D.value=e:null)}),s({_:2},[f(e.$slots,((t,a)=>({name:a,fn:m((()=>[p(e.$slots,a)]))})))]),1040,["placeholder","formatted-value"]))}});export{g as default};
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};