Commit cb1759b257b00485b40e87c6314bcbf276e5050d

Authored by vben
1 parent 81560fd3

perf(table): remove ExpandIcon

build/vite/optimizer.ts deleted 100644 โ†’ 0
1   -// TODO
2   -import type { GetManualChunk } from 'rollup';
3   -
4   -//
5   -const vendorLibs: { match: string[]; output: string }[] = [
6   - // {
7   - // match: ['xlsx'],
8   - // output: 'xlsx',
9   - // },
10   -];
11   -
12   -// @ts-ignore
13   -export const configManualChunk: GetManualChunk = (id: string) => {
14   - if (/[\\/]node_modules[\\/]/.test(id)) {
15   - const matchItem = vendorLibs.find((item) => {
16   - const reg = new RegExp(`[\\/]node_modules[\\/]_?(${item.match.join('|')})(.*)`, 'ig');
17   - return reg.test(id);
18   - });
19   - return matchItem ? matchItem.output : null;
20   - }
21   -};
build/vite/plugin/hmr.ts deleted 100644 โ†’ 0
1   -import type { Plugin } from 'vite';
2   -
3   -/**
4   - * TODO
5   - * Temporarily solve the Vite circular dependency problem, and wait for a better solution to fix it later. I don't know what problems this writing will bring.
6   - * @returns
7   - */
8   -
9   -export function configHmrPlugin(): Plugin {
10   - return {
11   - name: 'singleHMR',
12   - // handleHotUpdate({ modules, file }) {
13   - // if (file.match(/xml$/)) return [];
14   -
15   - // modules.forEach((m) => {
16   - // if (!m.url.match(/\.(css|less)/)) {
17   - // m.importedModules = new Set();
18   - // m.importers = new Set();
19   - // }
20   - // });
21   -
22   - // return modules;
23   - // },
24   - };
25   -}
src/components/Table/src/BasicTable.vue
... ... @@ -43,7 +43,6 @@
43 43 import { Table } from 'ant-design-vue';
44 44 import { BasicForm, useForm } from '/@/components/Form/index';
45 45 import { PageWrapperFixedHeightKey } from '/@/components/Page';
46   - import expandIcon from './components/ExpandIcon';
47 46 import HeaderCell from './components/HeaderCell.vue';
48 47 import { InnerHandlers } from './types/table';
49 48  
... ... @@ -222,10 +221,8 @@
222 221 const getBindValues = computed(() => {
223 222 const dataSource = unref(getDataSourceRef);
224 223 let propsData: Recordable = {
225   - // ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
226 224 ...attrs,
227 225 customRow,
228   - expandIcon: slots.expandIcon ? null : expandIcon(),
229 226 ...unref(getProps),
230 227 ...unref(getHeaderProps),
231 228 scroll: unref(getScrollRef),
... ...
src/components/Table/src/components/ExpandIcon.tsx deleted 100644 โ†’ 0
1   -import { BasicArrow } from '/@/components/Basic';
2   -
3   -export default () => {
4   - return (props: Recordable) => {
5   - if (!props.expandable) {
6   - if (props.needIndentSpaced) {
7   - return <span class="ant-table-row-expand-icon ant-table-row-spaced" />;
8   - } else {
9   - return <span />;
10   - }
11   - }
12   - return (
13   - <BasicArrow
14   - style="margin-right: 8px"
15   - iconStyle="margin-top: -2px;"
16   - onClick={(e: Event) => {
17   - props.onExpand(props.record, e);
18   - }}
19   - expand={props.expanded}
20   - />
21   - );
22   - };
23   -};
src/components/Table/src/hooks/useRowSelection.ts
... ... @@ -21,11 +21,8 @@ export function useRowSelection(
21 21  
22 22 return {
23 23 selectedRowKeys: unref(selectedRowKeysRef),
24   - hideDefaultSelections: false,
25 24 onChange: (selectedRowKeys: string[]) => {
26 25 setSelectedRowKeys(selectedRowKeys);
27   - // selectedRowKeysRef.value = selectedRowKeys;
28   - // selectedRowRef.value = selectedRows;
29 26 },
30 27 ...omit(rowSelection, ['onChange']),
31 28 };
... ...
src/components/Table/src/props.ts
... ... @@ -10,6 +10,7 @@ import type {
10 10 SizeType,
11 11 } from './types/table';
12 12 import type { FormProps } from '/@/components/Form';
  13 +
13 14 import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from './const';
14 15 import { propTypes } from '/@/utils/propTypes';
15 16  
... ...
src/components/Tree/src/Tree.vue
... ... @@ -13,6 +13,7 @@
13 13 watch,
14 14 onMounted,
15 15 } from 'vue';
  16 + import TreeHeader from './TreeHeader.vue';
16 17 import { Tree, Empty } from 'ant-design-vue';
17 18 import { TreeIcon } from './TreeIcon';
18 19 import { ScrollContainer } from '/@/components/Container';
... ... @@ -23,7 +24,6 @@
23 24 import { useTree } from './useTree';
24 25 import { useContextMenu } from '/@/hooks/web/useContextMenu';
25 26 import { CreateContextOptions } from '/@/components/ContextMenu';
26   - import TreeHeader from './TreeHeader.vue';
27 27 import { treeEmits, treeProps } from './tree';
28 28 import { createBEM } from '/@/utils/bem';
29 29  
... ...
src/components/Tree/src/TreeHeader.vue
... ... @@ -5,7 +5,7 @@
5 5 {{ title }}
6 6 </BasicTitle>
7 7 <div
8   - class="flex flex-1 justify-self-stretch items-center cursor-pointer"
  8 + class="flex items-center flex-1 cursor-pointer justify-self-stretch"
9 9 v-if="search || toolbar"
10 10 >
11 11 <div :class="getInputSearchCls" v-if="search">
... ... @@ -46,7 +46,6 @@
46 46  
47 47 const [bem] = createBEM('tree-header');
48 48  
49   - // eslint-disable vue/valid-define-emits
50 49 const props = defineProps({
51 50 helpMessage: {
52 51 type: [String, Array] as PropType<string | string[]>,
... ...