cnhis-design-vue 3.1.30 → 3.1.31-beta.0

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 (23) hide show
  1. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
  2. package/es/components/form-render/src/hooks/useBusinessBinding.js +16 -9
  3. package/es/components/form-render/src/utils/business.js +1 -1
  4. package/es/components/iho-table/index.d.ts +41 -39
  5. package/es/components/iho-table/src/IhoTable.js +1 -0
  6. package/es/components/iho-table/src/IhoTable.vue.d.ts +41 -39
  7. package/es/components/iho-table/src/components/IhoTableColumn.js +6 -3
  8. package/es/components/iho-table/src/constants/index.d.ts +1 -1
  9. package/es/components/iho-table/src/constants/index.js +1 -0
  10. package/es/components/iho-table/src/plugins/filterPlugin/filter.js +163 -73
  11. package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.d.ts +126 -0
  12. package/es/components/iho-table/src/plugins/filterPlugin/index.js +6 -12
  13. package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +0 -3
  14. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +2 -2
  15. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.d.ts +2 -4
  16. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +2 -17
  17. package/es/components/iho-table/src/types/index.d.ts +10 -2
  18. package/es/components/iho-table/src/utils/index.d.ts +8 -0
  19. package/es/components/iho-table/src/utils/index.js +30 -2
  20. package/es/components/iho-table/style/index.css +1 -1
  21. package/es/components/index.css +1 -1
  22. package/package.json +2 -2
  23. package/es/components/iho-table/src/plugins/filterPlugin/filter.d.ts +0 -23
@@ -56,7 +56,7 @@ export declare enum IHO_TABLE_STRING_STATUS {
56
56
  NEGATIVE = "0",
57
57
  POSITIVE = "1"
58
58
  }
59
- export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", ...("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "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")[]];
59
+ export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", "sortChange", ...("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "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")[]];
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)>;
@@ -131,6 +131,7 @@ const IhoTableEventNameTuple = [
131
131
  "formChange",
132
132
  "settingClick",
133
133
  "formClick",
134
+ "sortChange",
134
135
  ...VxeEventListenerNameList.map(getEventName)
135
136
  ];
136
137
  const InjectionIhoTableConfig = Symbol("injectionIhoTableConfig");
@@ -1,12 +1,17 @@
1
- import { defineComponent, inject, computed, ref, toRefs, createVNode, unref } from 'vue';
1
+ import { defineComponent, inject, toRefs, ref, onDeactivated, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, normalizeClass, isRef, normalizeStyle } from 'vue';
2
+ import { widthAppend } from '../../../../../shared/utils/index.js';
2
3
  import { FilterOutline } from '@vicons/ionicons5';
3
4
  import { useVirtualList } from '@vueuse/core';
4
- import { NPopover, NIcon, NCheckboxGroup, NCheckbox, NInput } from 'naive-ui';
5
- import { InjectionIhoTableUUID } from '../../constants/index.js';
5
+ import { InjectionIhoTableUUID, InjectionIhoTableEmits } from '../../constants/index.js';
6
6
  import { IHO_TABLE_FILTER_STATUS } from './types.js';
7
+ import { NEllipsis, NPopover, NIcon, NInput, NCheckboxGroup, NCheckbox, NButtonGroup, NButton } from 'naive-ui';
8
+ import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
7
9
 
8
- var FilterComponent = defineComponent({
9
- name: "IhoTableFilter",
10
+ const _hoisted_1 = { class: "iho-table__filterWrapper" };
11
+ const _hoisted_2 = ["onClick"];
12
+ const _hoisted_3 = { class: "iho-table__filterFooter" };
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ __name: "filter",
10
15
  props: {
11
16
  payload: {
12
17
  type: Object,
@@ -17,83 +22,168 @@ var FilterComponent = defineComponent({
17
22
  required: true
18
23
  }
19
24
  },
20
- setup(props, {
21
- slots
22
- }) {
25
+ setup(__props) {
26
+ const props = __props;
23
27
  const uuid = inject(InjectionIhoTableUUID);
24
- const columnRef = computed(() => props.payload.column);
28
+ const globEmit = inject(InjectionIhoTableEmits);
29
+ const { options, checked, sortStatus } = toRefs(props.filterState);
25
30
  const filterVisible = ref(false);
26
- const {
27
- options,
28
- checked,
29
- checkAll,
30
- searchFilterText,
31
- sortStatus
32
- } = toRefs(props.filterState);
33
- const {
34
- list,
35
- containerProps,
36
- wrapperProps
37
- } = useVirtualList(options, {
38
- itemHeight: 32,
39
- overscan: 5
40
- });
41
- function renderTrigger() {
42
- return createVNode(NIcon, {
43
- "component": FilterOutline,
44
- "onClick": toggleFilter
45
- }, null);
46
- function toggleFilter() {
47
- filterVisible.value = !filterVisible.value;
48
- }
31
+ const searchFilterText = ref("");
32
+ function close() {
33
+ filterVisible.value = false;
34
+ searchFilterText.value = "";
49
35
  }
50
- function renderFilter() {
51
- return createVNode("section", {
52
- "class": "iho-table__filterWrapper"
53
- }, [renderFilterButton(sortStatus, IHO_TABLE_FILTER_STATUS.ASCENDING, "\u5347\u5E8F A to Z"), renderFilterButton(sortStatus, IHO_TABLE_FILTER_STATUS.DESCENDING, "\u964D\u5E8F Z to A"), renderSearcher(searchFilterText), renderOptions()]);
54
- function renderOptions() {
55
- return createVNode(NCheckboxGroup, null, {
56
- default() {
57
- return createVNode("section", {
58
- "ref": containerProps.ref,
59
- "style": containerProps.style,
60
- "onScroll": containerProps.onScroll
61
- }, [createVNode("section", {
62
- "style": wrapperProps.value.style
63
- }, [list.value.map((option) => {
64
- return createVNode("div", null, [createVNode(NCheckbox, {
65
- "value": option.data.value,
66
- "label": option.data.key
67
- }, null)]);
68
- })])]);
69
- }
70
- });
36
+ onDeactivated(close);
37
+ const OPTION_ITEM_HEIGHT = 32;
38
+ const VIEW_CAPACITY = 10;
39
+ let checkedCache = [];
40
+ const { list, containerProps, wrapperProps } = useVirtualList(
41
+ computed(() => {
42
+ return searchFilterText.value ? options.value.filter((option) => option.key.includes(searchFilterText.value)) : options.value;
43
+ }),
44
+ {
45
+ itemHeight: OPTION_ITEM_HEIGHT,
46
+ overscan: 3
71
47
  }
72
- function renderSearcher(searchFilterText2) {
73
- return createVNode(NInput, {
74
- "value": searchFilterText2.value,
75
- "onUpdate:value": ($event) => searchFilterText2.value = $event
76
- }, null);
48
+ );
49
+ const containerStyleWithHeight = computed(() => {
50
+ return {
51
+ ...containerProps.style,
52
+ height: widthAppend(OPTION_ITEM_HEIGHT * VIEW_CAPACITY)
53
+ };
54
+ });
55
+ function confirmSort() {
56
+ sortStatus.value = IHO_TABLE_FILTER_STATUS.DEFAULT;
57
+ close();
58
+ globEmit("sortChange", { type: "filter", value: [...checked.value] });
59
+ }
60
+ function cancelSort() {
61
+ checked.value = checkedCache;
62
+ close();
63
+ }
64
+ const sortStatusList = [
65
+ { status: IHO_TABLE_FILTER_STATUS.ASCENDING, text: "\u5347\u5E8F A to Z" },
66
+ { status: IHO_TABLE_FILTER_STATUS.DESCENDING, text: "\u964D\u5E8F Z to A" }
67
+ ];
68
+ function setSortStatus(value) {
69
+ if (value === sortStatus.value) {
70
+ sortStatus.value = IHO_TABLE_FILTER_STATUS.DEFAULT;
71
+ } else {
72
+ sortStatus.value = value;
77
73
  }
78
- function renderFilterButton(sortStatus2, status, text) {
79
- return createVNode("div", {
80
- "class": ["iho-table__filterButton", {
81
- "iho-table__filterButton--active": unref(sortStatus2) === status
82
- }],
83
- "onClick": () => sortStatus2.value = status
84
- }, [text]);
74
+ close();
75
+ globEmit("sortChange", { type: "sort", value: sortStatus.value });
76
+ }
77
+ function toggleFilter() {
78
+ filterVisible.value = !filterVisible.value;
79
+ if (filterVisible.value) {
80
+ checkedCache = [...checked.value];
81
+ } else {
82
+ searchFilterText.value = "";
83
+ checkedCache = [];
85
84
  }
86
85
  }
87
- return () => {
88
- return createVNode("section", null, [unref(columnRef).title, createVNode(NPopover, {
89
- "to": `#${uuid}`,
90
- "show": filterVisible.value
91
- }, {
92
- trigger: renderTrigger,
93
- default: renderFilter
94
- })]);
86
+ return (_ctx, _cache) => {
87
+ return openBlock(), createElementBlock("section", null, [
88
+ createVNode(unref(NEllipsis), { style: { "max-width": "calc(100% - 22px)" } }, {
89
+ default: withCtx(() => [
90
+ createTextVNode(toDisplayString(__props.payload.column.title), 1)
91
+ ]),
92
+ _: 1
93
+ }),
94
+ createVNode(unref(NPopover), {
95
+ to: `#${unref(uuid)}`,
96
+ show: filterVisible.value
97
+ }, {
98
+ trigger: withCtx(() => [
99
+ createVNode(unref(NIcon), {
100
+ class: "iho-table__filterIcon",
101
+ component: unref(FilterOutline),
102
+ onClick: toggleFilter
103
+ }, null, 8, ["component"])
104
+ ]),
105
+ default: withCtx(() => [
106
+ createElementVNode("section", _hoisted_1, [
107
+ (openBlock(), createElementBlock(Fragment, null, renderList(sortStatusList, (item) => {
108
+ return createElementVNode("div", {
109
+ key: item.status,
110
+ class: normalizeClass(["iho-table__filterButton", { "iho-table__filterButton--active": unref(sortStatus) === item.status }]),
111
+ onClick: ($event) => setSortStatus(item.status)
112
+ }, toDisplayString(item.text), 11, _hoisted_2);
113
+ }), 64)),
114
+ createVNode(unref(NInput), {
115
+ value: searchFilterText.value,
116
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => searchFilterText.value = $event)
117
+ }, null, 8, ["value"]),
118
+ createVNode(unref(NCheckboxGroup), {
119
+ value: unref(checked),
120
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => isRef(checked) ? checked.value = $event : null)
121
+ }, {
122
+ default: withCtx(() => [
123
+ createElementVNode("section", {
124
+ ref: unref(containerProps).ref,
125
+ style: normalizeStyle(unref(containerStyleWithHeight)),
126
+ onScroll: _cache[1] || (_cache[1] = (...args) => unref(containerProps).onScroll && unref(containerProps).onScroll(...args)),
127
+ class: "iho-table__filterListWrapper"
128
+ }, [
129
+ createElementVNode("section", {
130
+ style: normalizeStyle(unref(wrapperProps).style)
131
+ }, [
132
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (option) => {
133
+ return openBlock(), createElementBlock("div", {
134
+ class: "iho-table__filterListItem",
135
+ key: option.data.value
136
+ }, [
137
+ createVNode(unref(NCheckbox), {
138
+ value: option.data.value,
139
+ label: option.data.key
140
+ }, null, 8, ["value", "label"])
141
+ ]);
142
+ }), 128))
143
+ ], 4)
144
+ ], 36)
145
+ ]),
146
+ _: 1
147
+ }, 8, ["value"]),
148
+ createElementVNode("footer", _hoisted_3, [
149
+ createElementVNode("section", null, toDisplayString(`\u5DF2\u9009\u62E9${unref(checked).length}\u9879`), 1),
150
+ createVNode(unref(NButtonGroup), { size: "tiny" }, {
151
+ default: withCtx(() => [
152
+ createVNode(unref(NButton), {
153
+ onClick: _cache[3] || (_cache[3] = ($event) => checked.value = [])
154
+ }, {
155
+ default: withCtx(() => [
156
+ createTextVNode("\u6E05\u7A7A")
157
+ ]),
158
+ _: 1
159
+ }),
160
+ createVNode(unref(NButton), { onClick: cancelSort }, {
161
+ default: withCtx(() => [
162
+ createTextVNode("\u53D6\u6D88")
163
+ ]),
164
+ _: 1
165
+ }),
166
+ createVNode(unref(NButton), {
167
+ type: "primary",
168
+ onClick: confirmSort
169
+ }, {
170
+ default: withCtx(() => [
171
+ createTextVNode("\u786E\u5B9A")
172
+ ]),
173
+ _: 1
174
+ })
175
+ ]),
176
+ _: 1
177
+ })
178
+ ])
179
+ ])
180
+ ]),
181
+ _: 1
182
+ }, 8, ["to", "show"])
183
+ ]);
95
184
  };
96
185
  }
97
186
  });
187
+ var FilterComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "filter.vue"]]);
98
188
 
99
189
  export { FilterComponent as default };
@@ -0,0 +1,126 @@
1
+ import { CSSProperties, PropType, ref } from 'vue';
2
+ import { VxeColumnPropTypes } from 'vxe-table';
3
+ import { FilterState, IHO_TABLE_FILTER_STATUS } from '../../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
4
+ declare const _default: import("vue").DefineComponent<{
5
+ payload: {
6
+ type: PropType<VxeColumnPropTypes.HeaderSlotParams>;
7
+ required: true;
8
+ };
9
+ filterState: {
10
+ type: PropType<FilterState>;
11
+ required: true;
12
+ };
13
+ }, {
14
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
15
+ payload: {
16
+ type: PropType<VxeColumnPropTypes.HeaderSlotParams>;
17
+ required: true;
18
+ };
19
+ filterState: {
20
+ type: PropType<FilterState>;
21
+ required: true;
22
+ };
23
+ }>> & {}>>;
24
+ uuid: string;
25
+ globEmit: <T extends "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "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;
26
+ options: import("vue").Ref<import("../../../../../shared/types").AnyObject[]>;
27
+ checked: import("vue").Ref<string[]>;
28
+ sortStatus: import("vue").Ref<IHO_TABLE_FILTER_STATUS>;
29
+ filterVisible: import("vue").Ref<boolean>;
30
+ searchFilterText: import("vue").Ref<string>;
31
+ close: () => void;
32
+ OPTION_ITEM_HEIGHT: number;
33
+ VIEW_CAPACITY: number;
34
+ checkedCache: string[];
35
+ list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<import("../../../../../shared/types").AnyObject>[]>;
36
+ containerProps: {
37
+ ref: import("vue").Ref<any>;
38
+ onScroll: () => void;
39
+ style: Partial<CSSStyleDeclaration>;
40
+ };
41
+ wrapperProps: import("vue").ComputedRef<{
42
+ style: {
43
+ width: string;
44
+ height: string;
45
+ marginTop: string;
46
+ };
47
+ }>;
48
+ containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
49
+ confirmSort: () => void;
50
+ cancelSort: () => void;
51
+ sortStatusList: {
52
+ status: IHO_TABLE_FILTER_STATUS;
53
+ text: string;
54
+ }[];
55
+ setSortStatus: (value: IHO_TABLE_FILTER_STATUS) => void;
56
+ toggleFilter: () => void;
57
+ FilterOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
58
+ ref: typeof ref;
59
+ NButton: any;
60
+ NButtonGroup: any;
61
+ NCheckbox: any;
62
+ NCheckboxGroup: import("vue").DefineComponent<{
63
+ readonly min: NumberConstructor;
64
+ readonly max: NumberConstructor;
65
+ readonly size: PropType<"small" | "medium" | "large">;
66
+ readonly value: PropType<(string | number)[] | null>;
67
+ readonly defaultValue: {
68
+ readonly type: PropType<(string | number)[] | null>;
69
+ readonly default: null;
70
+ };
71
+ readonly disabled: {
72
+ readonly type: PropType<boolean | undefined>;
73
+ readonly default: undefined;
74
+ };
75
+ readonly 'onUpdate:value': PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
76
+ actionType: "check" | "uncheck";
77
+ value: string | number;
78
+ }) => void>>;
79
+ readonly onUpdateValue: PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
80
+ actionType: "check" | "uncheck";
81
+ value: string | number;
82
+ }) => void>>;
83
+ readonly onChange: PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[]) => void> | undefined>;
84
+ }, {
85
+ mergedClsPrefix: import("vue").ComputedRef<string>;
86
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
87
+ readonly min: NumberConstructor;
88
+ readonly max: NumberConstructor;
89
+ readonly size: PropType<"small" | "medium" | "large">;
90
+ readonly value: PropType<(string | number)[] | null>;
91
+ readonly defaultValue: {
92
+ readonly type: PropType<(string | number)[] | null>;
93
+ readonly default: null;
94
+ };
95
+ readonly disabled: {
96
+ readonly type: PropType<boolean | undefined>;
97
+ readonly default: undefined;
98
+ };
99
+ readonly 'onUpdate:value': PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
100
+ actionType: "check" | "uncheck";
101
+ value: string | number;
102
+ }) => void>>;
103
+ readonly onUpdateValue: PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
104
+ actionType: "check" | "uncheck";
105
+ value: string | number;
106
+ }) => void>>;
107
+ readonly onChange: PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[]) => void> | undefined>;
108
+ }>>, {
109
+ readonly disabled: boolean | undefined;
110
+ readonly defaultValue: (string | number)[] | null;
111
+ }>;
112
+ NEllipsis: any;
113
+ NIcon: any;
114
+ NInput: any;
115
+ NPopover: any;
116
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
117
+ payload: {
118
+ type: PropType<VxeColumnPropTypes.HeaderSlotParams>;
119
+ required: true;
120
+ };
121
+ filterState: {
122
+ type: PropType<FilterState>;
123
+ required: true;
124
+ };
125
+ }>>, {}>;
126
+ export default _default;
@@ -1,32 +1,26 @@
1
1
  import { isObject, isArray } from 'lodash-es';
2
- import { reactive, h, onBeforeUnmount } from 'vue';
2
+ import { h, onBeforeUnmount } from 'vue';
3
3
  import '../../../index.js';
4
4
  import { IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS } from '../../constants/index.js';
5
5
  import { IHO_TABLE_FILTER_STATUS } from './types.js';
6
- import { IhoTableUtils } from '../../utils/index.js';
6
+ import { useUUIDMap, IhoTableUtils } from '../../utils/index.js';
7
7
  import FilterComponent from './filter.js';
8
8
  import { defineTablePlugin } from '../../hooks/useTablePlugin.js';
9
9
 
10
10
  function filterPlugin() {
11
11
  const pluginName = "filterPlugin";
12
- const uuidTargetMap = reactive(/* @__PURE__ */ new Map());
12
+ const { getItemFromUUID, removeItemFromUUID } = useUUIDMap(() => /* @__PURE__ */ new Map());
13
13
  function initFilterState(uuid, fieldName) {
14
- const stateMap = uuidTargetMap.set(uuid, uuidTargetMap.get(uuid) || /* @__PURE__ */ new Map()).get(uuid);
14
+ const stateMap = getItemFromUUID(uuid);
15
15
  return stateMap.set(
16
16
  fieldName,
17
17
  stateMap.get(fieldName) || {
18
18
  options: [],
19
19
  checked: [],
20
- indeterminate: false,
21
- checkAll: false,
22
- searchFilterText: "",
23
20
  sortStatus: IHO_TABLE_FILTER_STATUS.DEFAULT
24
21
  }
25
22
  ).get(fieldName);
26
23
  }
27
- function clearFilterState(uuid) {
28
- uuidTargetMap.delete(uuid);
29
- }
30
24
  return defineTablePlugin({
31
25
  name: pluginName,
32
26
  apply(hooks) {
@@ -40,7 +34,7 @@ function filterPlugin() {
40
34
  const fieldSetting = JSON.parse(lowCodeField.fieldSetting || "");
41
35
  if (!isFieldSetting(fieldSetting) || !showFilter(fieldSetting))
42
36
  return;
43
- let options = (_d = (_c = (_b = fieldSetting.mapping) == null ? void 0 : _b.mappingField) == null ? void 0 : _c.map((item) => item.value[0])) != null ? _d : [];
37
+ let options = (_d = (_c = (_b = fieldSetting.mapping) == null ? void 0 : _b.mappingFiled) == null ? void 0 : _c.map((item) => item.value[0])) != null ? _d : [];
44
38
  if (isCompatibleColumn(lowCodeField)) {
45
39
  options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({ ...option, key: option.label }))) != null ? _f : [];
46
40
  }
@@ -59,7 +53,7 @@ function filterPlugin() {
59
53
  return fieldList;
60
54
  });
61
55
  hooks.setupHooks.setup.tap(pluginName, (config) => {
62
- onBeforeUnmount(() => config.value.uuid && clearFilterState(config.value.uuid));
56
+ onBeforeUnmount(() => config.value.uuid && removeItemFromUUID(config.value.uuid));
63
57
  });
64
58
  function isCompatibleColumn(field) {
65
59
  const filterTypes = ["SEARCH", "SELECT", "RADIO", "CHECKBOX"];
@@ -7,8 +7,5 @@ export declare enum IHO_TABLE_FILTER_STATUS {
7
7
  export declare type FilterState = {
8
8
  options: AnyObject[];
9
9
  checked: string[];
10
- indeterminate: boolean;
11
- checkAll: boolean;
12
- searchFilterText: string;
13
10
  sortStatus: IHO_TABLE_FILTER_STATUS;
14
11
  };
@@ -3,8 +3,8 @@ import { traverse } from '../../../../../../../shared/utils/index.js';
3
3
  import { isFunction, isObject } from 'lodash-es';
4
4
  import '../../../../../index.js';
5
5
  import { EDITABLE_WIDGET_TYPE, InjectionIhoTableUUID, InjectionIhoTableEmits } from '../../../../constants/index.js';
6
- import { getRowHeight } from '../../../../utils/index.js';
7
- import { isSeparateColumn, getColumnRenderWidth, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './separateUtils.js';
6
+ import { getRowHeight, getColumnRenderWidth } from '../../../../utils/index.js';
7
+ import { isSeparateColumn, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './separateUtils.js';
8
8
  import EditSeparate from './editSeparate.js';
9
9
  import { defineTablePlugin } from '../../../../hooks/useTablePlugin.js';
10
10
 
@@ -1,13 +1,11 @@
1
- import { AnyObject, Nullable } from '../../../../../../../../es/shared/types';
2
- import { MaybeRef } from '@vueuse/core';
3
- import { VxeTableDefines, VxeTableInstance } from 'vxe-table';
1
+ import { AnyObject } from '../../../../../../../../es/shared/types';
2
+ import { VxeTableDefines } from 'vxe-table';
4
3
  import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
5
4
  declare type ParsedRowDataInfo = {
6
5
  field: string;
7
6
  data: string[];
8
7
  };
9
8
  export declare function getColumnInfoMaxLength(parsedRowDataInfo: ParsedRowDataInfo[]): number;
10
- export declare function getColumnRenderWidth(column: AnyObject, $table: MaybeRef<Nullable<VxeTableInstance>>): Promise<number>;
11
9
  export declare function generateSeparateRowData(parsedRowDataInfo: ParsedRowDataInfo[], index: number): AnyObject;
12
10
  export declare function contentSeparate(value: unknown, field: IhoTableFieldItem, width: number): any[];
13
11
  export declare function isSeparateColumn(field: IhoTableFieldItem | VxeTableDefines.ColumnInfo): boolean | "" | undefined;
@@ -1,25 +1,10 @@
1
1
  import { getStringWidth } from '../../../../../../../shared/utils/index.js';
2
- import { isNumber, isArray, cloneDeep, isString } from 'lodash-es';
3
- import { nextTick, unref } from 'vue';
2
+ import { isArray, cloneDeep, isString, isNumber } from 'lodash-es';
4
3
  import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index.js';
5
4
 
6
5
  function getColumnInfoMaxLength(parsedRowDataInfo) {
7
6
  return Math.max(...parsedRowDataInfo.map((r) => r.data.length), 1);
8
7
  }
9
- async function getColumnRenderWidth(column, $table) {
10
- const prev = getRenderWidth();
11
- if (!prev) {
12
- await nextTick();
13
- }
14
- return getRenderWidth() || getColumnWidth();
15
- function getRenderWidth() {
16
- var _a, _b;
17
- return (_b = (_a = unref($table)) == null ? void 0 : _a.getColumnByField(column.field)) == null ? void 0 : _b.renderWidth;
18
- }
19
- function getColumnWidth() {
20
- return isNumber(column.width) ? column.width : 64;
21
- }
22
- }
23
8
  function generateSeparateRowData(parsedRowDataInfo, index) {
24
9
  return parsedRowDataInfo.reduce((res, info) => {
25
10
  res[info.field] = info.data[index];
@@ -54,4 +39,4 @@ function isSeparateColumn(field) {
54
39
  return field.field && ((_a = field.editRender) == null ? void 0 : _a.name) === EDITABLE_WIDGET_TYPE.SEPARATE;
55
40
  }
56
41
 
57
- export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn };
42
+ export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, isSeparateColumn };
@@ -2,6 +2,7 @@ import { AnyObject, TupleToUnion } from '../../../../../es/shared/types';
2
2
  import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes } from 'vxe-table';
3
3
  import { VxeTableEventProps } from 'vxe-table/types/table';
4
4
  import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence, VxeEventListenerNameList } from '../../../../../es/components/iho-table/src/constants';
5
+ import { IHO_TABLE_FILTER_STATUS } from '../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
5
6
  export * from './pluginType';
6
7
  export interface IhoTableRowGroupItem {
7
8
  groupName: string;
@@ -33,7 +34,7 @@ export declare namespace IhoTableLowCodeField {
33
34
  notParticipatingSearch: IHO_TABLE_STRING_STATUS;
34
35
  mapping?: {
35
36
  type: string;
36
- mappingField: Array<{
37
+ mappingFiled: Array<{
37
38
  value: Array<{
38
39
  options: AnyObject[];
39
40
  }>;
@@ -73,7 +74,14 @@ export declare type EventListenerToEventName<T extends string> = T extends `on${
73
74
  export declare type EventNameToEventListener<T extends string> = T extends `${infer L}${infer R}` ? `on${Uppercase<L>}${R}` : never;
74
75
  export declare type IhoTableHandler = Record<'updateConfigRef' | 'updateFieldListRef' | 'updateTableDataRef', () => void>;
75
76
  export declare type IhoTableEventNameUnion = TupleToUnion<typeof IhoTableEventNameTuple>;
76
- export declare type IhoTableEmitPayload<T extends typeof IhoTableEventNameTuple[number]> = T extends 'formChange' | 'formClick' ? [IhoTableFormChangePayload] : T extends 'settingClick' ? [] : Parameters<NonNullable<VxeTableEventProps[EventNameToEventListener<Exclude<T, 'formChange' | 'settingClick' | 'formClick'>>]>>;
77
+ export declare type IhoTableFilterPayload = {
78
+ type: 'sort';
79
+ value: IHO_TABLE_FILTER_STATUS;
80
+ } | {
81
+ type: 'filter';
82
+ value: string[];
83
+ };
84
+ export declare type IhoTableEmitPayload<T extends typeof IhoTableEventNameTuple[number]> = T extends 'formChange' | 'formClick' ? [IhoTableFormChangePayload] : T extends 'settingClick' ? [] : T extends 'sortChange' ? [IhoTableFilterPayload] : Parameters<NonNullable<VxeTableEventProps[EventNameToEventListener<Exclude<T, 'formChange' | 'settingClick' | 'formClick' | 'sortChange'>>]>>;
77
85
  export declare type IhoTableAnchorItem = {
78
86
  field: string;
79
87
  title: string;
@@ -1,3 +1,6 @@
1
+ import { AnyObject, Nullable } from '../../../../../es/shared/types';
2
+ import { MaybeRef } from '@vueuse/core';
3
+ import { VxeTableInstance } from 'vxe-table';
1
4
  import { EventListenerToEventName, LowCodeTableFieldItem } from '../../../../../es/components/iho-table';
2
5
  export declare function IhoTableLog(message: string): void;
3
6
  export declare function IhoTableWarn(message: string): void;
@@ -6,3 +9,8 @@ export declare const IhoTableUtils: Readonly<{
6
9
  }>;
7
10
  export declare function getRowHeight(): number;
8
11
  export declare function getEventName<T extends string>(eventListenerName: T): EventListenerToEventName<T>;
12
+ export declare function useUUIDMap<T>(creator: () => T, isReactive?: boolean): {
13
+ getItemFromUUID: (uuid: string) => T;
14
+ removeItemFromUUID: (uuid: string) => void;
15
+ };
16
+ export declare function getColumnRenderWidth(column: AnyObject, $table: MaybeRef<Nullable<VxeTableInstance>>): Promise<number>;
@@ -1,4 +1,5 @@
1
- import { inject } from 'vue';
1
+ import { isNumber } from 'lodash-es';
2
+ import { inject, reactive, nextTick, unref } from 'vue';
2
3
  import { InjectionIhoTableConfig } from '../constants/index.js';
3
4
 
4
5
  function IhoTableLog(message) {
@@ -25,5 +26,32 @@ function getEventName(eventListenerName) {
25
26
  const eventName = eventListenerName.slice(2);
26
27
  return `${eventName[0].toLowerCase()}${eventName.slice(1)}`;
27
28
  }
29
+ function useUUIDMap(creator, isReactive = true) {
30
+ const uuidMap = isReactive ? reactive(/* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
31
+ function getItemFromUUID(uuid) {
32
+ return uuidMap.set(uuid, uuidMap.get(uuid) || creator()).get(uuid);
33
+ }
34
+ function removeItemFromUUID(uuid) {
35
+ uuidMap.delete(uuid);
36
+ }
37
+ return {
38
+ getItemFromUUID,
39
+ removeItemFromUUID
40
+ };
41
+ }
42
+ async function getColumnRenderWidth(column, $table) {
43
+ const prev = getRenderWidth();
44
+ if (!prev) {
45
+ await nextTick();
46
+ }
47
+ return getRenderWidth() || getColumnWidth();
48
+ function getRenderWidth() {
49
+ var _a, _b;
50
+ return (_b = (_a = unref($table)) == null ? void 0 : _a.getColumnByField(column.field)) == null ? void 0 : _b.renderWidth;
51
+ }
52
+ function getColumnWidth() {
53
+ return isNumber(column.width) ? column.width : 64;
54
+ }
55
+ }
28
56
 
29
- export { IhoTableLog, IhoTableUtils, IhoTableWarn, getEventName, getRowHeight };
57
+ export { IhoTableLog, IhoTableUtils, IhoTableWarn, getColumnRenderWidth, getEventName, getRowHeight, useUUIDMap };
@@ -1 +1 @@
1
- .iho-table .vxe-table--render-default .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)}.iho-table .vxe-table--render-default .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)}.iho-table__boldCell{font-weight:700}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;width:200px}.iho-table__filterButton{align-items:center;display:flex;height:30px}.iho-table__filterButton--active{color:blue}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}.iho-table__headerWrapper{display:inline-flex}
1
+ .iho-table .vxe-table--render-default .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)}.iho-table .vxe-table--render-default .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)}.iho-table__boldCell{font-weight:700}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;width:200px}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:#5585f5}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05)}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;height:32px;padding:0 8px}.iho-table__filterListItem:hover{background:rgba(0,0,0,.05)}.iho-table__filterFooter{display:flex;justify-content:space-between}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}.iho-table__headerWrapper{display:inline-flex}