cnhis-design-vue 3.1.23-beta.1 → 3.1.23-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 (131) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/index.d.ts +0 -3
  3. package/es/components/big-table/src/BigTable.vue.d.ts +0 -3
  4. package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -20
  5. package/es/components/big-table/src/components/edit-form/useCommon.d.ts +4 -0
  6. package/es/components/big-table/src/utils.d.ts +1 -1
  7. package/es/components/big-table/src/utils2.js +11 -37
  8. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  9. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  10. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  11. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  12. package/es/components/fabric-chart/src/components/PopupMenu.js +7 -2
  13. package/es/components/fabric-chart/src/hooks/useCenter2.js +9 -5
  14. package/es/components/fabric-chart/src/hooks/useEvent2.js +40 -8
  15. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  16. package/es/components/field-set/index.d.ts +1 -0
  17. package/es/components/field-set/src/FieldSet.js +16 -10
  18. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
  19. package/es/components/form-config/index.d.ts +7 -0
  20. package/es/components/form-config/src/FormConfig.vue.d.ts +7 -0
  21. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +7 -0
  22. package/es/components/form-render/index2.js +2 -1
  23. package/es/components/form-render/src/components/renderer/index.d.ts +2 -1
  24. package/es/components/form-render/src/components/renderer/index.js +2 -1
  25. package/es/components/form-render/src/components/renderer/index2.js +2 -1
  26. package/es/components/form-render/src/components/renderer/levelSearchCascade.d.ts +88 -0
  27. package/es/components/form-render/src/components/renderer/levelSearchCascade.js +237 -0
  28. package/es/components/form-render/src/components/renderer/search.d.ts +15 -1
  29. package/es/components/form-render/src/components/renderer/search.js +3 -1
  30. package/es/components/form-render/src/components/renderer/{cascader.d.ts → searchCascade.d.ts} +0 -0
  31. package/es/components/form-render/src/components/renderer/{cascader.js → searchCascade.js} +2 -0
  32. package/es/components/form-render/src/components/renderer/select.js +3 -1
  33. package/es/components/form-render/src/hooks/useAsyncQueue2.js +4 -4
  34. package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +11 -4
  35. package/es/components/form-render/src/hooks/useFormRequest.d.ts +2 -0
  36. package/es/components/form-render/src/hooks/useFormRequest2.js +1 -1
  37. package/es/components/form-render/src/types/fieldItem.d.ts +7 -0
  38. package/es/components/form-render/src/utils/schema2.js +1 -4
  39. package/es/components/iho-table/index.d.ts +100 -271
  40. package/es/components/iho-table/src/IhoTable.vue.d.ts +100 -271
  41. package/es/components/iho-table/src/components/IhoTableColumn.js +1 -1
  42. package/es/components/iho-table/src/constants/index.d.ts +5 -3
  43. package/es/components/iho-table/src/constants/index.js +1 -1
  44. package/es/components/iho-table/src/constants/index2.js +9 -7
  45. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
  46. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +1 -1
  47. package/es/components/iho-table/src/plugins/index.d.ts +1 -0
  48. package/es/components/iho-table/src/plugins/index.js +5 -1
  49. package/es/components/iho-table/src/plugins/index2.js +5 -1
  50. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +11 -8
  51. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.d.ts +31 -0
  52. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.js +205 -0
  53. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.d.ts +1 -0
  54. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +39 -0
  55. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.d.ts +4 -0
  56. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.js +1 -0
  57. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon2.js +17 -0
  58. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +4 -1
  59. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +4 -1
  60. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.d.ts +1 -0
  61. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{inputRendererPlugins.js → inputRendererPlugin.js} +4 -4
  62. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +31 -0
  63. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +60 -0
  64. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.d.ts +1 -0
  65. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +40 -0
  66. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -0
  67. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -0
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils2.js +20 -0
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.js → editSeparate.js} +20 -22
  70. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.vue.d.ts → editSeparate.vue.d.ts} +1 -17
  71. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +13 -9
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.d.ts → separateUtils.d.ts} +0 -0
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.js → separateUtils.js} +1 -1
  74. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils2.js → separateUtils2.js} +4 -4
  75. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.d.ts +31 -0
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.js +60 -0
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.d.ts +1 -0
  78. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +39 -0
  79. package/es/components/iho-table/src/plugins/rendererPlugins/index.js +4 -1
  80. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +2 -0
  81. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +2 -0
  82. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +3 -1
  83. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +16 -26
  84. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +1 -46
  85. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.d.ts +11 -0
  86. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -0
  87. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils2.js +50 -0
  88. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.d.ts +1 -0
  89. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -0
  90. package/es/components/iho-table/src/plugins/virtualTreePlugin/index2.js +84 -0
  91. package/es/components/iho-table/src/types/index.d.ts +1 -3
  92. package/es/components/index.css +1 -1
  93. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -0
  94. package/es/components/search-cascader/index.d.ts +196 -0
  95. package/es/components/search-cascader/index.js +1 -0
  96. package/es/components/search-cascader/index2.js +10 -0
  97. package/es/components/search-cascader/src/SearchCascader.js +168 -0
  98. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +198 -0
  99. package/es/components/search-cascader/src/components/SearchMenu.d.ts +45 -0
  100. package/es/components/search-cascader/src/components/SearchMenu.js +134 -0
  101. package/es/components/search-cascader/src/components/index.d.ts +1 -0
  102. package/es/components/search-cascader/src/components/index.js +1 -0
  103. package/es/components/search-cascader/src/constants/index.d.ts +3 -0
  104. package/es/components/search-cascader/src/constants/index.js +1 -0
  105. package/es/components/search-cascader/src/constants/index2.js +3 -0
  106. package/es/components/search-cascader/src/hooks/index.d.ts +1 -0
  107. package/es/components/search-cascader/src/hooks/index.js +1 -0
  108. package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +3 -0
  109. package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -0
  110. package/es/components/search-cascader/src/hooks/useCssVariable2.js +7 -0
  111. package/es/components/search-cascader/src/utils/index.d.ts +2 -0
  112. package/es/components/search-cascader/src/utils/index.js +1 -0
  113. package/es/components/search-cascader/src/utils/index2.js +11 -0
  114. package/es/components/search-cascader/style/index.css +1 -0
  115. package/es/components/select-label/index.d.ts +1 -0
  116. package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -0
  117. package/es/components/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.js +16 -4
  118. package/es/components/shortcut-provider/src/ShortcutProvider.js +2 -1
  119. package/es/components/shortcut-setter/index.d.ts +7 -0
  120. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +7 -0
  121. package/es/shared/components/no-data/NoData.js +74 -0
  122. package/es/shared/components/no-data/NoData.vue.d.ts +51 -0
  123. package/es/shared/components/no-data/index.d.ts +2 -0
  124. package/es/shared/components/no-data/index.js +1 -0
  125. package/es/shared/components/no-data/index2.js +2 -0
  126. package/es/shared/utils/index.d.ts +2 -1
  127. package/es/shared/utils/index.js +1 -1
  128. package/es/shared/utils/index2.js +17 -7
  129. package/es/shared/utils/tapable/index.d.ts +139 -0
  130. package/package.json +2 -2
  131. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugins.d.ts +0 -1
@@ -1,12 +1,11 @@
1
- import { defineComponent, inject, ref, watch, computed, onMounted, onDeactivated, openBlock, createBlock, unref, withCtx, createElementVNode, withModifiers, normalizeStyle, toDisplayString } from 'vue';
2
- import script from '../../../../../../../shared/components/SlotRender/SlotRender.js';
1
+ import { defineComponent, inject, ref, watch, computed, onMounted, onDeactivated, openBlock, createBlock, unref, withCtx, createElementVNode, withModifiers, normalizeStyle, toDisplayString, renderSlot, createVNode } from 'vue';
3
2
  import { cloneDeep, isObject, isArray } from 'lodash-es';
4
3
  import { NPopover, NInput } from 'naive-ui';
5
4
  import { InjectionIhoTableEmits, InjectionIhoTableHandler } from '../../../../constants/index2.js';
6
5
  import _export_sfc from '../../../../../../../_virtual/plugin-vue_export-helper.js';
7
6
 
8
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
- __name: "edit-separate",
8
+ __name: "editSeparate",
10
9
  props: {
11
10
  value: {},
12
11
  height: { type: Number },
@@ -22,6 +21,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
21
  const tableHandler = inject(InjectionIhoTableHandler);
23
22
  const popoverRef = ref();
24
23
  const editContent = ref();
24
+ function setEditContent(value) {
25
+ editContent.value = value;
26
+ }
25
27
  const show = ref(false);
26
28
  function setShow(v) {
27
29
  show.value = v;
@@ -70,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
70
72
  ref: popoverRef,
71
73
  trigger: "manual",
72
74
  show: show.value,
73
- "onUpdate:show": _cache[3] || (_cache[3] = ($event) => show.value = $event),
75
+ "onUpdate:show": _cache[2] || (_cache[2] = ($event) => show.value = $event),
74
76
  "show-arrow": false
75
77
  }, {
76
78
  trigger: withCtx(() => [
@@ -81,30 +83,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
83
  style: normalizeStyle(unref(style))
82
84
  }, toDisplayString(__props.displayContent || " "), 5)
83
85
  ]),
84
- default: withCtx(() => {
85
- var _a, _b;
86
- return [
87
- ((_a = __props.column.context) == null ? void 0 : _a.separateSlot) ? (openBlock(), createBlock(unref(script), {
88
- key: 0,
89
- renderer: (_b = __props.column.context) == null ? void 0 : _b.separateSlot,
86
+ default: withCtx(() => [
87
+ renderSlot(_ctx.$slots, "menu", {
88
+ value: editContent.value,
89
+ "onUpdate:value": setEditContent,
90
+ "onUpdate:show": setShow,
91
+ col: __props.column,
92
+ row: __props.row
93
+ }, () => [
94
+ createVNode(unref(NInput), {
90
95
  value: editContent.value,
91
96
  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => editContent.value = $event),
92
- "onUpdate:show": setShow,
93
- col: __props.column,
94
- row: __props.row
95
- }, null, 8, ["renderer", "value", "col", "row"])) : (openBlock(), createBlock(unref(NInput), {
96
- key: 1,
97
- value: editContent.value,
98
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => editContent.value = $event),
99
97
  type: "textarea"
100
- }, null, 8, ["value"]))
101
- ];
102
- }),
103
- _: 1
98
+ }, null, 8, ["value"])
99
+ ])
100
+ ]),
101
+ _: 3
104
102
  }, 8, ["show"]);
105
103
  };
106
104
  }
107
105
  });
108
- var EditSeparate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "edit-separate.vue"]]);
106
+ var EditSeparate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "editSeparate.vue"]]);
109
107
 
110
108
  export { EditSeparate as default };
@@ -51,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
51
51
  tableHandler: import("../../../../../../../../es/components/iho-table").IhoTableHandler;
52
52
  popoverRef: import("vue").Ref<any>;
53
53
  editContent: import("vue").Ref<any>;
54
+ setEditContent: (value: any) => void;
54
55
  show: import("vue").Ref<boolean>;
55
56
  setShow: (v: boolean) => void;
56
57
  emit: (event: "update:value", ...args: any[]) => void;
@@ -59,23 +60,6 @@ declare const _default: import("vue").DefineComponent<{
59
60
  updateShow: (show: boolean) => void;
60
61
  style: import("vue").ComputedRef<CSSProperties>;
61
62
  elementRef: import("vue").Ref<any>;
62
- SlotRender: import("vue").DefineComponent<{
63
- renderer: {
64
- type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../../../es/shared/types").Func<any[], any>>;
65
- required: true;
66
- };
67
- rootSlots: {
68
- type: PropType<Record<string, import("../../../../../../../../es/shared/types").Func<any[], any>>>;
69
- };
70
- }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
71
- renderer: {
72
- type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../../../es/shared/types").Func<any[], any>>;
73
- required: true;
74
- };
75
- rootSlots: {
76
- type: PropType<Record<string, import("../../../../../../../../es/shared/types").Func<any[], any>>>;
77
- };
78
- }>>, {}>;
79
63
  NPopover: any;
80
64
  NInput: any;
81
65
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -2,10 +2,10 @@ import { reactive, inject, unref, createVNode, onBeforeUnmount } from 'vue';
2
2
  import { traverse } from '../../../../../../../shared/utils/index2.js';
3
3
  import { isFunction } from 'lodash-es';
4
4
  import '../../../../../index2.js';
5
- import { INPUT_TYPE, InjectionIhoTableUUID } from '../../../../constants/index2.js';
5
+ import { EDITABLE_WIDGET_TYPE, InjectionIhoTableUUID } from '../../../../constants/index2.js';
6
6
  import { getRowHeight } from '../../../../utils/index2.js';
7
- import { isSeparateColumn, getColumnRenderWidth, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './separate-utils2.js';
8
- import EditSeparate from './edit-separate.js';
7
+ import { isSeparateColumn, getColumnRenderWidth, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './separateUtils2.js';
8
+ import EditSeparate from './editSeparate.js';
9
9
  import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
10
10
 
11
11
  function separateRendererPlugins() {
@@ -24,8 +24,8 @@ function separateRendererPlugins() {
24
24
  return defineTablePlugin({
25
25
  name: pluginName,
26
26
  vxe(instance) {
27
- instance.renderer.add(INPUT_TYPE.SEPARATE, {
28
- renderCell(renderOpt, {
27
+ instance.renderer.add(EDITABLE_WIDGET_TYPE.SEPARATE, {
28
+ renderCell(renderOpts, {
29
29
  column,
30
30
  row
31
31
  }) {
@@ -34,14 +34,18 @@ function separateRendererPlugins() {
34
34
  const separateRow = getSeparateRowData(unref(uuid), row);
35
35
  return createVNode("section", null, [(_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field]]);
36
36
  },
37
- renderEdit(renderOpt, {
37
+ renderEdit(renderOpts, {
38
38
  column,
39
39
  row
40
40
  }) {
41
- var _a;
41
+ var _a, _b;
42
42
  const uuid = inject(InjectionIhoTableUUID);
43
43
  const separateRow = getSeparateRowData(unref(uuid), row);
44
44
  const height = getRowHeight();
45
+ const slots = {};
46
+ if (isFunction((_a = renderOpts.props) == null ? void 0 : _a.separateSlot)) {
47
+ slots.menu = renderOpts.props.separateSlot;
48
+ }
45
49
  return [createVNode(EditSeparate, {
46
50
  "value": row[column.field],
47
51
  "onUpdate:value": ($event) => row[column.field] = $event,
@@ -49,8 +53,8 @@ function separateRendererPlugins() {
49
53
  "height": height,
50
54
  "column": column,
51
55
  "row": row,
52
- "displayContent": (_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field]
53
- }, null)];
56
+ "displayContent": (_b = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _b[column.field]
57
+ }, slots)];
54
58
  }
55
59
  });
56
60
  },
@@ -1 +1 @@
1
- export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn } from './separate-utils2.js';
1
+ export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn } from './separateUtils2.js';
@@ -1,7 +1,7 @@
1
1
  import { getStringWidth } from '../../../../../../../shared/utils/index2.js';
2
2
  import { isNumber, isArray, cloneDeep, isString } from 'lodash-es';
3
3
  import { nextTick, unref } from 'vue';
4
- import { INPUT_TYPE } from '../../../../constants/index2.js';
4
+ import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index2.js';
5
5
 
6
6
  function getColumnInfoMaxLength(parsedRowDataInfo) {
7
7
  return Math.max(...parsedRowDataInfo.map((r) => r.data.length), 1);
@@ -29,8 +29,8 @@ function generateSeparateRowData(parsedRowDataInfo, index) {
29
29
  function contentSeparate(value, field, width) {
30
30
  if (isArray(value)) {
31
31
  return value.map((row) => {
32
- var _a, _b, _c;
33
- return (_c = (_b = (_a = field.context) == null ? void 0 : _a.separateFormatter) == null ? void 0 : _b.call(_a, cloneDeep(row))) != null ? _c : row;
32
+ var _a, _b, _c, _d;
33
+ return (_d = (_c = (_b = (_a = field.editRender) == null ? void 0 : _a.props) == null ? void 0 : _b.separateFormatter) == null ? void 0 : _c.call(_b, cloneDeep(row))) != null ? _d : row;
34
34
  });
35
35
  }
36
36
  if (!isString(value) || !isNumber(width))
@@ -48,7 +48,7 @@ function contentSeparate(value, field, width) {
48
48
  }
49
49
  function isSeparateColumn(field) {
50
50
  var _a;
51
- return field.field && ((_a = field.editRender) == null ? void 0 : _a.name) === INPUT_TYPE.SEPARATE;
51
+ return field.field && ((_a = field.editRender) == null ? void 0 : _a.name) === EDITABLE_WIDGET_TYPE.SEPARATE;
52
52
  }
53
53
 
54
54
  export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn };
@@ -0,0 +1,31 @@
1
+ import { PropType } from 'vue';
2
+ import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
3
+ import { AnyObject } from '../../../../../../../../es/shared/types';
4
+ declare const _default: import("vue").DefineComponent<{
5
+ column: {
6
+ type: PropType<IhoTableFieldItem>;
7
+ required: true;
8
+ };
9
+ row: {
10
+ type: PropType<AnyObject>;
11
+ required: true;
12
+ };
13
+ index: {
14
+ type: NumberConstructor;
15
+ required: true;
16
+ };
17
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
+ column: {
19
+ type: PropType<IhoTableFieldItem>;
20
+ required: true;
21
+ };
22
+ row: {
23
+ type: PropType<AnyObject>;
24
+ required: true;
25
+ };
26
+ index: {
27
+ type: NumberConstructor;
28
+ required: true;
29
+ };
30
+ }>>, {}>;
31
+ export default _default;
@@ -0,0 +1,60 @@
1
+ import { defineComponent, inject, createVNode, mergeProps } from 'vue';
2
+ import { NTimePicker } from 'naive-ui';
3
+ import { InjectionIhoTableEmits } from '../../../../constants/index2.js';
4
+ import { useCommon } from '../hooks/useCommon2.js';
5
+
6
+ var EditTime = defineComponent({
7
+ name: "EditTime",
8
+ inheritAttrs: false,
9
+ components: {
10
+ NTimePicker
11
+ },
12
+ props: {
13
+ column: {
14
+ type: Object,
15
+ required: true
16
+ },
17
+ row: {
18
+ type: Object,
19
+ required: true
20
+ },
21
+ index: {
22
+ type: Number,
23
+ required: true
24
+ }
25
+ },
26
+ setup(props, {
27
+ attrs,
28
+ emit
29
+ }) {
30
+ const globEmit = inject(InjectionIhoTableEmits);
31
+ const {
32
+ formRef,
33
+ isShow
34
+ } = useCommon();
35
+ const onUpdateValue = (value) => {
36
+ globEmit("formChange", {
37
+ value,
38
+ row: props.row,
39
+ column: props.column,
40
+ index: props.index
41
+ });
42
+ };
43
+ const timeConfig = {
44
+ placeholder: attrs.placeholder || "\u8BF7\u9009\u62E9",
45
+ valueFormat: attrs.valueFormat || "HH:mm",
46
+ format: attrs.valueFormat || "yyyy-MM-dd HH:mm:ss",
47
+ ...attrs,
48
+ onUpdateFormattedValue: onUpdateValue
49
+ };
50
+ return () => createVNode(NTimePicker, mergeProps({
51
+ "ref": formRef,
52
+ "show": isShow.value,
53
+ "onUpdate:show": ($event) => isShow.value = $event,
54
+ "formattedValue": props.row[props.column.field],
55
+ "onUpdate:formattedValue": ($event) => props.row[props.column.field] = $event
56
+ }, timeConfig), null);
57
+ }
58
+ });
59
+
60
+ export { EditTime as default };
@@ -0,0 +1 @@
1
+ export declare function timeRendererPlugin(): import("../../../../../../../../es/components/iho-table").TablePlugin;
@@ -0,0 +1,39 @@
1
+ import { createVNode, mergeProps } from 'vue';
2
+ import '../../../../../index2.js';
3
+ import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index2.js';
4
+ import EditTime from './editTime.js';
5
+ import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
6
+
7
+ function timeRendererPlugin() {
8
+ const pluginName = "timeRendererPlugin";
9
+ return defineTablePlugin({
10
+ name: pluginName,
11
+ vxe(instance) {
12
+ instance.renderer.add(EDITABLE_WIDGET_TYPE.TIME, {
13
+ renderCell({
14
+ props
15
+ }, {
16
+ row,
17
+ column
18
+ }) {
19
+ return [createVNode("span", null, [row[column.field]])];
20
+ },
21
+ renderEdit({
22
+ props
23
+ }, {
24
+ row,
25
+ column,
26
+ $rowIndex
27
+ }) {
28
+ return [createVNode(EditTime, mergeProps((props == null ? void 0 : props.componentProps) || {}, {
29
+ "column": column,
30
+ "row": row,
31
+ "index": $rowIndex
32
+ }), null)];
33
+ }
34
+ });
35
+ }
36
+ });
37
+ }
38
+
39
+ export { timeRendererPlugin };
@@ -4,5 +4,8 @@ export { colorRendererPlugin } from './widgets/colorRendererPlugin.js';
4
4
  export { seqRendererPlugin } from './widgets/seqRendererPlugin.js';
5
5
  export { checkRendererPlugin } from './widgets/checkRendererPlugin.js';
6
6
  export { pictureRendererPlugin } from './widgets/pictureRendererPlugin.js';
7
- export { inputRendererPlugins } from './editableWidgets/inputRendererPlugins.js';
7
+ export { inputRendererPlugin } from './editableWidgets/inputRendererPlugin.js';
8
8
  export { separateRendererPlugins } from './editableWidgets/separateRendererPlugin/index.js';
9
+ export { selectRendererPlugin } from './editableWidgets/selectRendererPlugin/index.js';
10
+ export { dateRendererPlugin } from './editableWidgets/dateRendererPlugin/index.js';
11
+ export { timeRendererPlugin } from './editableWidgets/timeRendererPlugin/index.js';
@@ -16,6 +16,8 @@ function checkRendererPlugin() {
16
16
  if (index === 0 && config.selectType) {
17
17
  insertBefore({
18
18
  field: pluginName,
19
+ width: 50,
20
+ align: "center",
19
21
  type: config.selectType
20
22
  });
21
23
  }
@@ -15,6 +15,8 @@ function labelRendererPlugin() {
15
15
  column
16
16
  }) {
17
17
  try {
18
+ if (!row[column.field])
19
+ return [];
18
20
  const value = JSON.parse(row[column.field]);
19
21
  const labels = isArray(value.labels) ? value.labels : parseLabelString(value.labelStr);
20
22
  return labels.map(renderLabelItem);
@@ -19,8 +19,10 @@ function pictureRendererPlugin() {
19
19
  column
20
20
  }) {
21
21
  try {
22
+ if (!row[column.field])
23
+ return [];
22
24
  const value = JSON.parse(row[column.field]);
23
- const height = getRowHeight();
25
+ const height = getRowHeight() - 16;
24
26
  return [createVNode("section", {
25
27
  "style": "display:flex;justify-content:center"
26
28
  }, [createVNode(ViewerImage, {
@@ -2,34 +2,13 @@ import { inject, createVNode } from 'vue';
2
2
  import { SettingsSharp } from '@vicons/ionicons5';
3
3
  import { NIcon } from 'naive-ui';
4
4
  import '../../../../index2.js';
5
- import { WIDGET_TYPE, InjectionIhoTableEmits } from '../../../constants/index2.js';
5
+ import { InjectionIhoTableEmits } from '../../../constants/index2.js';
6
6
  import { defineTablePlugin } from '../../../hooks/useTablePlugin2.js';
7
7
 
8
8
  function seqRendererPlugin() {
9
9
  const pluginName = "seqRendererPlugin";
10
10
  return defineTablePlugin({
11
11
  name: pluginName,
12
- vxe(instance) {
13
- instance.renderer.add(WIDGET_TYPE.SEQUENCE, {
14
- renderCell(renderOpts, {
15
- $rowIndex
16
- }) {
17
- return [`${$rowIndex}`];
18
- },
19
- renderHeader() {
20
- const emits = inject(InjectionIhoTableEmits);
21
- function onClick() {
22
- emits && emits("settingClick");
23
- }
24
- return [createVNode(NIcon, {
25
- "size": "14",
26
- "color": "#777",
27
- "component": SettingsSharp,
28
- "onClick": onClick
29
- }, null)];
30
- }
31
- });
32
- },
33
12
  apply(hooks) {
34
13
  hooks.fieldHooks.field.tap(pluginName, (field, {
35
14
  index,
@@ -39,10 +18,21 @@ function seqRendererPlugin() {
39
18
  insertBefore({
40
19
  align: "center",
41
20
  fixed: "left",
42
- width: 34,
43
- field: pluginName,
44
- editRender: {
45
- name: WIDGET_TYPE.SEQUENCE
21
+ width: 50,
22
+ type: "seq",
23
+ slots: {
24
+ header() {
25
+ const emits = inject(InjectionIhoTableEmits);
26
+ function onClick() {
27
+ emits && emits("settingClick");
28
+ }
29
+ return [createVNode(NIcon, {
30
+ "size": "14",
31
+ "color": "#777",
32
+ "component": SettingsSharp,
33
+ "onClick": onClick
34
+ }, null)];
35
+ }
46
36
  }
47
37
  });
48
38
  }
@@ -1,7 +1,6 @@
1
1
  import { isObject } from '@vue/shared';
2
- import { isArray, isString } from 'lodash-es';
3
2
  import '../../../index2.js';
4
- import { IhoTableRowGroupSequence } from '../../constants/index2.js';
3
+ import { groupTraverser, createRowGroupList } from './rowGroupUtils2.js';
5
4
  import { defineTablePlugin } from '../../hooks/useTablePlugin2.js';
6
5
 
7
6
  function rowGroupSettingPlugin() {
@@ -24,49 +23,5 @@ function rowGroupSettingPlugin() {
24
23
  function fieldSearcher(fieldName, fieldList) {
25
24
  return fieldList.find((field) => field.field === fieldName);
26
25
  }
27
- function createRowGroupList(rowGroupSetting, fieldList) {
28
- const result = fieldList.map((field) => field.field);
29
- IhoTableRowGroupSequence.some((sequence) => {
30
- const currentLevelGroup = rowGroupSetting[sequence];
31
- if (!isArray(currentLevelGroup))
32
- return true;
33
- currentLevelGroup.forEach((groupSetting) => {
34
- if (!isArray(groupSetting.list) || !groupSetting.list.length)
35
- return;
36
- const children = [];
37
- groupSetting.list.forEach((fieldName, idx) => {
38
- const groupIdx = groupIndexSearcher(fieldName, result);
39
- if (!~groupIdx)
40
- return;
41
- children.push(result[groupIdx]);
42
- if (idx === 0) {
43
- result.splice(groupIdx, 1, { fieldName: groupSetting.title, children });
44
- } else {
45
- result.splice(groupIdx, 1);
46
- }
47
- });
48
- });
49
- });
50
- return result;
51
- function groupIndexSearcher(fieldName, groupList) {
52
- return groupList.findIndex((group) => (isObject(group) ? group.fieldName : group) === fieldName);
53
- }
54
- }
55
- function groupTraverser(groupList, replacer) {
56
- return groupList.reduce((result, group) => {
57
- if (isString(group)) {
58
- const item = replacer(group);
59
- item && result.push(item);
60
- }
61
- if (isObject(group) && group.children) {
62
- const item = replacer(group.fieldName, true);
63
- if (item) {
64
- item.children = groupTraverser(group.children, replacer);
65
- result.push(item);
66
- }
67
- }
68
- return result;
69
- }, []);
70
- }
71
26
 
72
27
  export { rowGroupSettingPlugin };
@@ -0,0 +1,11 @@
1
+ import { NotNull, Nullable } from '../../../../../../es/shared/types';
2
+ import { IhoTableConfig, IhoTableFieldItem } from '../../../../../../es/components/iho-table';
3
+ declare type GroupItem = string | {
4
+ fieldName: string;
5
+ children?: GroupItem[];
6
+ };
7
+ export declare function createRowGroupList(rowGroupSetting: NotNull<IhoTableConfig['rowGroupSetting']>, fieldList: IhoTableFieldItem[], getKey?: (field: IhoTableFieldItem) => string): GroupItem[];
8
+ export declare function groupTraverser<T extends Nullable<{
9
+ children?: T[];
10
+ }>>(groupList: GroupItem[], replacer: (fieldName: string, isBlock?: boolean) => T): NotNull<T>[];
11
+ export {};
@@ -0,0 +1 @@
1
+ export { createRowGroupList, groupTraverser } from './rowGroupUtils2.js';
@@ -0,0 +1,50 @@
1
+ import { isObject } from '@vue/shared';
2
+ import { isArray, isString } from 'lodash-es';
3
+ import { IhoTableRowGroupSequence } from '../../constants/index2.js';
4
+
5
+ function createRowGroupList(rowGroupSetting, fieldList, getKey = (field) => field.field) {
6
+ const result = fieldList.map((field) => getKey(field));
7
+ IhoTableRowGroupSequence.some((sequence) => {
8
+ const currentLevelGroup = rowGroupSetting[sequence];
9
+ if (!isArray(currentLevelGroup))
10
+ return true;
11
+ currentLevelGroup.forEach((groupSetting) => {
12
+ if (!isArray(groupSetting.list) || !groupSetting.list.length)
13
+ return;
14
+ const children = [];
15
+ groupSetting.list.forEach((fieldName, idx) => {
16
+ const groupIdx = groupIndexSearcher(fieldName, result);
17
+ if (!~groupIdx)
18
+ return;
19
+ children.push(result[groupIdx]);
20
+ if (idx === 0) {
21
+ result.splice(groupIdx, 1, { fieldName: groupSetting.title, children });
22
+ } else {
23
+ result.splice(groupIdx, 1);
24
+ }
25
+ });
26
+ });
27
+ });
28
+ return result;
29
+ function groupIndexSearcher(fieldName, groupList) {
30
+ return groupList.findIndex((group) => (isObject(group) ? group.fieldName : group) === fieldName);
31
+ }
32
+ }
33
+ function groupTraverser(groupList, replacer) {
34
+ return groupList.reduce((result, group) => {
35
+ if (isString(group)) {
36
+ const item = replacer(group);
37
+ item && result.push(item);
38
+ }
39
+ if (isObject(group) && group.children) {
40
+ const item = replacer(group.fieldName, true);
41
+ if (item) {
42
+ item.children = groupTraverser(group.children, replacer);
43
+ result.push(item);
44
+ }
45
+ }
46
+ return result;
47
+ }, []);
48
+ }
49
+
50
+ export { createRowGroupList, groupTraverser };
@@ -0,0 +1 @@
1
+ export declare function virtualTreePlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
@@ -0,0 +1 @@
1
+ export { virtualTreePlugin } from './index2.js';