cnhis-design-vue 3.1.30-beta.5 → 3.1.30-beta.6

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.
@@ -101,7 +101,6 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
101
101
  }>>;
102
102
  emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
103
103
  uuid: string;
104
- uuidRef: import("vue").Ref<string>;
105
104
  $table: import("vue").Ref<import("vxe-table").VxeTableInstance | undefined>;
106
105
  hooks: Readonly<{
107
106
  configHooks: import("../../../es/components/iho-table/src/types").AbstractConfigHooks;
@@ -2130,6 +2129,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2130
2129
  anchorList?: string[] | undefined;
2131
2130
  }>;
2132
2131
  updateConfigRef: () => void;
2132
+ _updateConfigRef: () => void;
2133
2133
  fieldListRef: import("vue").Ref<{
2134
2134
  [x: string]: unknown;
2135
2135
  property?: string | undefined;
@@ -2431,9 +2431,11 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
2431
2431
  annotation?: boolean | undefined;
2432
2432
  }[]>;
2433
2433
  updateFieldListRef: () => void;
2434
+ _updateFieldListRef: () => void;
2434
2435
  dataTransfer: (data: import("../../../es/shared/types").AnyObject[]) => Promise<import("../../../es/shared/types").AnyObject[]>;
2435
2436
  tableDataRef: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
2436
2437
  updateTableDataRef: () => Promise<void>;
2438
+ _updateTableDataRef: () => Promise<void>;
2437
2439
  tableHandler: import("../../../es/components/iho-table/src/types").IhoTableHandler;
2438
2440
  eventListener: import("./src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
2439
2441
  eventHookHandler: Record<keyof import("vxe-table").VxeTableEventProps, any>;
@@ -1,4 +1,4 @@
1
- import { defineComponent, provide, ref, computed, watch, resolveComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, createVNode, mergeProps, withCtx, Fragment, renderList } from 'vue';
1
+ import { defineComponent, provide, ref, computed, watch, resolveComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, createVNode, mergeProps, createSlots, withCtx, Fragment, renderList, renderSlot } from 'vue';
2
2
  import { uuidGenerator } from '../../../shared/utils/index.js';
3
3
  import { useDebounceFn } from '@vueuse/core';
4
4
  import { VxeEventListenerNameList, InjectionIhoTableEmits, InjectionIhoTableUUID, InjectionIhoTableInstance, InjectionIhoTableConfig, InjectionIhoTableFieldList, InjectionIhoTableHandler } from './constants/index.js';
@@ -24,36 +24,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  ...VxeEventListenerNameList.map(getEventName)
25
25
  ],
26
26
  setup(__props, { expose, emit: emits }) {
27
- var _a, _b, _c;
27
+ var _a, _b;
28
28
  const props = __props;
29
29
  provide(InjectionIhoTableEmits, emits);
30
30
  const uuid = uuidGenerator();
31
- const uuidRef = ref(uuid);
32
- provide(InjectionIhoTableUUID, uuidRef);
31
+ provide(InjectionIhoTableUUID, uuid);
33
32
  const $table = ref();
34
33
  provide(InjectionIhoTableInstance, $table);
35
34
  const hooks = createTableHooks();
36
- const configRef = ref({
37
- uuid: (_b = (_a = props.tableConfig) == null ? void 0 : _a.uuid) != null ? _b : uuid,
38
- menuConfig: (_c = props.tableConfig) == null ? void 0 : _c.menuConfig
39
- });
35
+ const configRef = ref({ uuid: (_b = (_a = props.tableConfig) == null ? void 0 : _a.uuid) != null ? _b : uuid });
40
36
  provide(InjectionIhoTableConfig, configRef);
41
- const updateConfigRef = useDebounceFn(() => {
37
+ const updateConfigRef = useDebounceFn(_updateConfigRef, 10);
38
+ function _updateConfigRef() {
42
39
  configRef.value = applyTableConfigHooks(hooks, props.tableConfig);
43
- configRef.value.uuid = uuidRef.value;
44
- }, 10);
40
+ configRef.value.uuid = uuid;
41
+ }
45
42
  const fieldListRef = ref([]);
46
43
  provide(InjectionIhoTableFieldList, fieldListRef);
47
- const updateFieldListRef = useDebounceFn(() => {
44
+ const updateFieldListRef = useDebounceFn(_updateFieldListRef, 10);
45
+ function _updateFieldListRef() {
48
46
  fieldListRef.value = applyTableFieldHooks(hooks, props.fieldList, configRef.value);
49
- }, 10);
47
+ }
50
48
  const dataTransfer = createDataTransfer(hooks, configRef, $table);
51
49
  const tableDataRef = ref([]);
52
- const updateTableDataRef = useDebounceFn(async () => {
50
+ const updateTableDataRef = useDebounceFn(_updateTableDataRef, 10);
51
+ async function _updateTableDataRef() {
53
52
  var _a2;
54
53
  tableDataRef.value = await dataTransfer(props.tableData);
55
54
  (_a2 = $table.value) == null ? void 0 : _a2.recalculate(true);
56
- }, 10);
55
+ }
57
56
  const tableHandler = { updateTableDataRef, updateConfigRef, updateFieldListRef };
58
57
  provide(InjectionIhoTableHandler, tableHandler);
59
58
  const eventListener = provideIhoTableEventListener();
@@ -73,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
72
  updateFieldListRef();
74
73
  updateTableDataRef();
75
74
  },
76
- { immediate: true, deep: true }
75
+ { deep: true }
77
76
  );
78
77
  watch(
79
78
  () => props.fieldList,
@@ -81,9 +80,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
80
  updateFieldListRef();
82
81
  updateTableDataRef();
83
82
  },
84
- { immediate: true, deep: true }
83
+ { deep: true }
85
84
  );
86
- watch(() => props.tableData, updateTableDataRef, { immediate: true });
85
+ watch(() => props.tableData, updateTableDataRef);
86
+ _updateConfigRef();
87
+ _updateFieldListRef();
88
+ _updateTableDataRef();
87
89
  const { header, footer } = createDomInsertComponent(hooks);
88
90
  expose({ $table });
89
91
  hooks.setupHooks.setup.call(configRef, fieldListRef);
@@ -94,7 +96,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
96
  createVNode(_component_vxe_table, mergeProps({
95
97
  ref_key: "$table",
96
98
  ref: $table
97
- }, unref(bindProperties), { data: tableDataRef.value }), {
99
+ }, unref(bindProperties), { data: tableDataRef.value }), createSlots({
98
100
  default: withCtx(() => [
99
101
  (openBlock(true), createElementBlock(Fragment, null, renderList(fieldListRef.value, (field) => {
100
102
  return openBlock(), createBlock(unref(ColumnComponent), {
@@ -104,8 +106,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
104
106
  }, null, 8, ["field", "annotation"]);
105
107
  }), 128))
106
108
  ]),
107
- _: 1
108
- }, 16, ["data"]),
109
+ _: 2
110
+ }, [
111
+ renderList(_ctx.$slots, (k, v) => {
112
+ return {
113
+ name: v,
114
+ fn: withCtx(() => [
115
+ renderSlot(_ctx.$slots, v)
116
+ ])
117
+ };
118
+ })
119
+ ]), 1040, ["data"]),
109
120
  (openBlock(), createBlock(resolveDynamicComponent(unref(footer))))
110
121
  ]);
111
122
  };
@@ -100,7 +100,6 @@ declare const _default: import("vue").DefineComponent<{
100
100
  }>>;
101
101
  emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
102
102
  uuid: string;
103
- uuidRef: import("vue").Ref<string>;
104
103
  $table: import("vue").Ref<VxeTableInstance | undefined>;
105
104
  hooks: Readonly<{
106
105
  configHooks: import("../../../../es/components/iho-table/src/types").AbstractConfigHooks;
@@ -2129,6 +2128,7 @@ declare const _default: import("vue").DefineComponent<{
2129
2128
  anchorList?: string[] | undefined;
2130
2129
  }>;
2131
2130
  updateConfigRef: () => void;
2131
+ _updateConfigRef: () => void;
2132
2132
  fieldListRef: import("vue").Ref<{
2133
2133
  [x: string]: unknown;
2134
2134
  property?: string | undefined;
@@ -2430,9 +2430,11 @@ declare const _default: import("vue").DefineComponent<{
2430
2430
  annotation?: boolean | undefined;
2431
2431
  }[]>;
2432
2432
  updateFieldListRef: () => void;
2433
+ _updateFieldListRef: () => void;
2433
2434
  dataTransfer: (data: AnyObject[]) => Promise<AnyObject[]>;
2434
2435
  tableDataRef: import("vue").Ref<AnyObject[]>;
2435
2436
  updateTableDataRef: () => Promise<void>;
2437
+ _updateTableDataRef: () => Promise<void>;
2436
2438
  tableHandler: IhoTableHandler;
2437
2439
  eventListener: import("../../../../es/components/iho-table/src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
2438
2440
  eventHookHandler: Record<keyof import("vxe-table").VxeTableEventProps, any>;
@@ -60,7 +60,7 @@ export declare const IhoTableEventNameTuple: readonly ["formChange", "settingCli
60
60
  export declare const InjectionIhoTableConfig: InjectionKey<Ref<IhoTableConfig>>;
61
61
  export declare const InjectionIhoTableFieldList: InjectionKey<Ref<IhoTableFieldItem[]>>;
62
62
  export declare const InjectionIhoTableEmits: InjectionKey<(<T extends typeof IhoTableEventNameTuple[number]>(event: T, ...args: IhoTableEmitPayload<T>) => void)>;
63
- export declare const InjectionIhoTableUUID: InjectionKey<Ref<string>>;
63
+ export declare const InjectionIhoTableUUID: InjectionKey<string>;
64
64
  export declare const InjectionIhoTableInstance: InjectionKey<Ref<UndefinedAble<VxeTableInstance>>>;
65
65
  export declare const InjectionIhoTableHandler: InjectionKey<IhoTableHandler>;
66
66
  export declare const InjectionIhoTableEventListener: InjectionKey<IhoTableEventListener>;
@@ -5,5 +5,5 @@ export declare function useTableContext(): {
5
5
  tableEmit: <T extends "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd">(event: T, ...args: import("../types").IhoTableEmitPayload<T>) => void;
6
6
  eventListener: import("./tapHooks/useEventHooks").IhoTableEventListener;
7
7
  $table: import("vue").Ref<import("../../../../shared/types").UndefinedAble<import("vxe-table").VxeTableInstance>>;
8
- uuid: import("vue").Ref<string>;
8
+ uuid: string;
9
9
  };
@@ -11,12 +11,12 @@ function lowCodeFieldAdaptorPlugin() {
11
11
  hooks.fieldHooks.field.tap({ name: pluginName, stage: HIGHEST_PRIORITY }, (field) => {
12
12
  const _field = field;
13
13
  const result = {
14
+ className: _field.bold ? "iho-table__boldCell" : "",
14
15
  field: _field.columnName,
15
- width: _field.colWidth,
16
- showOverflow: "tooltip",
16
+ showOverflow: Reflect.has(_field, "showOverflow") ? _field.showOverflow : "tooltip",
17
17
  visible: _field.isShow !== IHO_TABLE_NUMBER_STATUS.NEGATIVE,
18
- className: _field.bold ? "iho-table__boldCell" : "",
19
- ...pick(_field, ["title", "treeNode", "bold"])
18
+ width: _field.colWidth,
19
+ ...pick(_field, ["title", "treeNode", "resizable"])
20
20
  };
21
21
  settingObjAdaptor(result, _field);
22
22
  return result;
@@ -1,4 +1,4 @@
1
- import { createVNode, inject } from 'vue';
1
+ import { createVNode, inject, mergeProps } from 'vue';
2
2
  import { NInput } from 'naive-ui';
3
3
  import '../../../../index.js';
4
4
  import { EDITABLE_WIDGET_TYPE, InjectionIhoTableEmits } from '../../../constants/index.js';
@@ -16,7 +16,9 @@ function inputRendererPlugin() {
16
16
  }) {
17
17
  return [createVNode("span", null, [row[column.field]])];
18
18
  },
19
- renderEdit(renderOpts, {
19
+ renderEdit({
20
+ props
21
+ }, {
20
22
  row,
21
23
  column,
22
24
  $rowIndex
@@ -30,11 +32,11 @@ function inputRendererPlugin() {
30
32
  index: $rowIndex
31
33
  });
32
34
  }
33
- return [createVNode(NInput, {
35
+ return [createVNode(NInput, mergeProps({
34
36
  "value": row[column.field],
35
37
  "onUpdate:value": ($event) => row[column.field] = $event,
36
38
  "onBlur": onBlur
37
- }, null)];
39
+ }, props == null ? void 0 : props.componentProps), null)];
38
40
  }
39
41
  });
40
42
  }
@@ -1,4 +1,4 @@
1
- import { reactive, inject, unref, createVNode, onBeforeUnmount } from 'vue';
1
+ import { reactive, inject, createVNode, toRaw, onBeforeUnmount } from 'vue';
2
2
  import { traverse } from '../../../../../../../shared/utils/index.js';
3
3
  import { isFunction } from 'lodash-es';
4
4
  import '../../../../../index.js';
@@ -31,7 +31,7 @@ function separateRendererPlugins() {
31
31
  }) {
32
32
  var _a;
33
33
  const uuid = inject(InjectionIhoTableUUID);
34
- const separateRow = getSeparateRowData(unref(uuid), row);
34
+ const separateRow = getSeparateRowData(uuid, row);
35
35
  return createVNode("section", null, [(_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field]]);
36
36
  },
37
37
  renderEdit(renderOpts, {
@@ -40,7 +40,7 @@ function separateRendererPlugins() {
40
40
  }) {
41
41
  var _a, _b;
42
42
  const uuid = inject(InjectionIhoTableUUID);
43
- const separateRow = getSeparateRowData(unref(uuid), row);
43
+ const separateRow = getSeparateRowData(uuid, row);
44
44
  const height = getRowHeight();
45
45
  const slots = {};
46
46
  if (isFunction((_a = renderOpts.props) == null ? void 0 : _a.separateSlot)) {
@@ -67,7 +67,7 @@ function separateRendererPlugins() {
67
67
  function getSeparateColumn(fieldList2) {
68
68
  return fieldList2.reduce((res, field) => {
69
69
  traverse(field, (item) => {
70
- isSeparateColumn(item) && res.push(item);
70
+ isSeparateColumn(item) && res.push(toRaw(item));
71
71
  });
72
72
  return res;
73
73
  }, []);
@@ -144,10 +144,6 @@ function separateRendererPlugins() {
144
144
  };
145
145
  }
146
146
  hooks.setupHooks.setup.tap(pluginName, (config) => {
147
- if (config.value.uuid) {
148
- separateRowMap.set(config.value.uuid, /* @__PURE__ */ new WeakMap());
149
- separateColumnMap.set(config.value.uuid, []);
150
- }
151
147
  onBeforeUnmount(() => {
152
148
  if (config.value.uuid) {
153
149
  separateRowMap.delete(config.value.uuid);
@@ -36,11 +36,13 @@ export declare type LowCodeTableFieldItem = {
36
36
  } & Partial<{
37
37
  id: number | string;
38
38
  title: string;
39
- colWidth: string | number;
39
+ colWidth: VxeTableDefines.ColumnInfo['width'];
40
40
  settingObj: LowCodeTableSettingObj;
41
41
  treeNode: boolean;
42
42
  isShow: 0 | 1;
43
- }>;
43
+ componentProps: AnyObject;
44
+ showOverflow: VxeTableDefines.ColumnInfo['showOverflow'];
45
+ }> & Partial<Pick<VxeTableDefines.ColumnInfo, 'resizable'>>;
44
46
  export declare type IhoFormChangePayload = {
45
47
  column: IhoTableFieldItem;
46
48
  row: AnyObject;