@uzum-tech/ui 2.0.0-beta.3 → 2.0.0-beta.5
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.
- package/dist/index.js +2467 -1507
- package/dist/index.mjs +2461 -1506
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/_internal/component-renderer/index.d.ts +2 -0
- package/es/_internal/component-renderer/index.mjs +1 -0
- package/es/_internal/component-renderer/src/interface.d.ts +29 -0
- package/es/_internal/component-renderer/src/interface.mjs +1 -0
- package/es/_internal/component-renderer/src/renderer.d.ts +3 -0
- package/es/_internal/component-renderer/src/renderer.mjs +20 -0
- package/es/_internal/select-menu/src/SelectOption.mjs +9 -5
- package/es/_internal/select-menu/src/styles/index.cssr.mjs +4 -3
- package/es/_internal/selection/src/styles/index.cssr.mjs +3 -0
- package/es/card-list/src/CardList.d.ts +1 -1
- package/es/checkbox/src/Checkbox.d.ts +2 -2
- package/es/components.d.ts +1 -0
- package/es/components.mjs +1 -0
- package/es/config-provider/src/internal-interface.d.ts +3 -1
- package/es/data-table/src/DataTable.d.ts +25 -5
- package/es/data-table/src/DataTable.mjs +125 -4
- package/es/data-table/src/HeaderButton/FilterMenu.mjs +1 -1
- package/es/data-table/src/TableParts/Body.d.ts +9 -6
- package/es/data-table/src/TableParts/Body.mjs +30 -6
- package/es/data-table/src/TableParts/Cell.mjs +17 -17
- package/es/data-table/src/TableParts/Header.d.ts +4 -2
- package/es/data-table/src/TableParts/Header.mjs +65 -22
- package/es/data-table/src/interface.d.ts +16 -0
- package/es/data-table/src/interface.mjs +9 -0
- package/es/data-table/src/use-group-header.mjs +2 -2
- package/es/data-table/src/use-mask.mjs +1 -1
- package/es/data-table/src/use-resizable.d.ts +1 -0
- package/es/data-table/src/use-resizable.mjs +5 -2
- package/es/data-table/src/use-scroll.d.ts +5 -4
- package/es/data-table/src/use-scroll.mjs +29 -25
- package/es/data-table/src/use-sorter.mjs +1 -1
- package/es/data-table/src/use-table-data.mjs +1 -1
- package/es/data-table/src/utils/column-utils.d.ts +13 -0
- package/es/data-table/src/utils/column-utils.mjs +84 -0
- package/es/data-table/src/utils/csv-utils.d.ts +3 -0
- package/es/data-table/src/utils/csv-utils.mjs +21 -0
- package/es/data-table/src/utils/index.d.ts +7 -0
- package/es/data-table/src/utils/index.mjs +7 -0
- package/es/data-table/src/utils/mask-defaults.d.ts +6 -0
- package/es/data-table/src/utils/mask-defaults.mjs +16 -0
- package/es/data-table/src/utils/resize-orchestrator-utils.d.ts +6 -0
- package/es/data-table/src/utils/resize-orchestrator-utils.mjs +21 -0
- package/es/data-table/src/utils/sort-filter-utils.d.ts +6 -0
- package/es/data-table/src/utils/sort-filter-utils.mjs +38 -0
- package/es/data-table/src/utils/width-utils.d.ts +20 -0
- package/es/data-table/src/utils/width-utils.mjs +174 -0
- package/es/data-table/src/utils.d.ts +1 -25
- package/es/data-table/src/utils.mjs +1 -165
- package/es/grid/src/Grid.d.ts +1 -1
- package/es/header/src/HeaderSearchResults.d.ts +1 -1
- package/es/icon-bar/src/IconBar.d.ts +1 -1
- package/es/input/src/Input.d.ts +1 -1
- package/es/list/src/ListItem.d.ts +2 -2
- package/es/list/src/ListItem.mjs +19 -12
- package/es/list/src/props.d.ts +3 -1
- package/es/list/src/styles/index.cssr.mjs +4 -2
- package/es/locales/common/enUS.d.ts +6 -0
- package/es/locales/common/enUS.mjs +6 -0
- package/es/locales/common/ruRU.mjs +6 -0
- package/es/mapping-card/index.d.ts +7 -0
- package/es/mapping-card/index.mjs +4 -0
- package/es/mapping-card/src/MappingCard.d.ts +2091 -0
- package/es/mapping-card/src/MappingCard.mjs +77 -0
- package/es/mapping-card/src/MappingCardList.d.ts +36 -0
- package/es/mapping-card/src/MappingCardList.mjs +50 -0
- package/es/mapping-card/src/MappingCardParts/Body.d.ts +4 -0
- package/es/mapping-card/src/MappingCardParts/Body.mjs +66 -0
- package/es/mapping-card/src/MappingCardParts/Header.d.ts +7 -0
- package/es/mapping-card/src/MappingCardParts/Header.mjs +147 -0
- package/es/mapping-card/src/injection.d.ts +17 -0
- package/es/mapping-card/src/injection.mjs +2 -0
- package/es/mapping-card/src/interface.d.ts +105 -0
- package/es/mapping-card/src/interface.mjs +45 -0
- package/es/mapping-card/src/styles/index.cssr.d.ts +2 -0
- package/es/mapping-card/src/styles/index.cssr.mjs +92 -0
- package/es/mapping-card/styles/dark.d.ts +337 -0
- package/es/mapping-card/styles/dark.mjs +22 -0
- package/es/mapping-card/styles/index.d.ts +3 -0
- package/es/mapping-card/styles/index.mjs +2 -0
- package/es/mapping-card/styles/light.d.ts +352 -0
- package/es/mapping-card/styles/light.mjs +45 -0
- package/es/progress/src/MultipleCircle.d.ts +1 -1
- package/es/radio/src/Radio.d.ts +1 -1
- package/es/radio/src/RadioButton.d.ts +3 -3
- package/es/tabs/src/Tabs.d.ts +2 -6
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/toggle-button/src/ToggleButton.d.ts +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/component-renderer/index.d.ts +2 -0
- package/lib/_internal/component-renderer/index.js +5 -0
- package/lib/_internal/component-renderer/src/interface.d.ts +29 -0
- package/lib/_internal/component-renderer/src/interface.js +2 -0
- package/lib/_internal/component-renderer/src/renderer.d.ts +3 -0
- package/lib/_internal/component-renderer/src/renderer.js +28 -0
- package/lib/_internal/select-menu/src/SelectOption.js +11 -12
- package/lib/_internal/select-menu/src/styles/index.cssr.js +4 -3
- package/lib/_internal/selection/src/styles/index.cssr.js +3 -0
- package/lib/card-list/src/CardList.d.ts +1 -1
- package/lib/checkbox/src/Checkbox.d.ts +2 -2
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/internal-interface.d.ts +3 -1
- package/lib/data-table/src/DataTable.d.ts +25 -5
- package/lib/data-table/src/DataTable.js +131 -4
- package/lib/data-table/src/TableParts/Body.d.ts +9 -6
- package/lib/data-table/src/TableParts/Body.js +30 -8
- package/lib/data-table/src/TableParts/Cell.js +16 -16
- package/lib/data-table/src/TableParts/Header.d.ts +4 -2
- package/lib/data-table/src/TableParts/Header.js +55 -23
- package/lib/data-table/src/interface.d.ts +16 -0
- package/lib/data-table/src/interface.js +6 -0
- package/lib/data-table/src/use-group-header.js +1 -1
- package/lib/data-table/src/use-resizable.d.ts +1 -0
- package/lib/data-table/src/use-resizable.js +5 -2
- package/lib/data-table/src/use-scroll.d.ts +5 -4
- package/lib/data-table/src/use-scroll.js +31 -28
- package/lib/data-table/src/utils/column-utils.d.ts +13 -0
- package/lib/data-table/src/utils/column-utils.js +116 -0
- package/lib/data-table/src/utils/csv-utils.d.ts +3 -0
- package/lib/data-table/src/utils/csv-utils.js +34 -0
- package/lib/data-table/src/utils/index.d.ts +7 -0
- package/lib/data-table/src/utils/index.js +26 -0
- package/lib/data-table/src/utils/mask-defaults.d.ts +6 -0
- package/lib/data-table/src/utils/mask-defaults.js +22 -0
- package/lib/data-table/src/utils/resize-orchestrator-utils.d.ts +6 -0
- package/lib/data-table/src/utils/resize-orchestrator-utils.js +35 -0
- package/lib/data-table/src/utils/sort-filter-utils.d.ts +6 -0
- package/lib/data-table/src/utils/sort-filter-utils.js +54 -0
- package/lib/data-table/src/utils/width-utils.d.ts +20 -0
- package/lib/data-table/src/utils/width-utils.js +182 -0
- package/lib/data-table/src/utils.d.ts +1 -25
- package/lib/data-table/src/utils.js +15 -229
- package/lib/grid/src/Grid.d.ts +1 -1
- package/lib/header/src/HeaderSearchResults.d.ts +1 -1
- package/lib/icon-bar/src/IconBar.d.ts +1 -1
- package/lib/input/src/Input.d.ts +1 -1
- package/lib/list/src/ListItem.d.ts +2 -2
- package/lib/list/src/ListItem.js +31 -10
- package/lib/list/src/props.d.ts +3 -1
- package/lib/list/src/styles/index.cssr.js +4 -2
- package/lib/locales/common/enUS.d.ts +6 -0
- package/lib/locales/common/enUS.js +6 -0
- package/lib/locales/common/ruRU.js +6 -0
- package/lib/mapping-card/index.d.ts +7 -0
- package/lib/mapping-card/index.js +15 -0
- package/lib/mapping-card/src/MappingCard.d.ts +2091 -0
- package/lib/mapping-card/src/MappingCard.js +58 -0
- package/lib/mapping-card/src/MappingCardList.d.ts +36 -0
- package/lib/mapping-card/src/MappingCardList.js +38 -0
- package/lib/mapping-card/src/MappingCardParts/Body.d.ts +4 -0
- package/lib/mapping-card/src/MappingCardParts/Body.js +48 -0
- package/lib/mapping-card/src/MappingCardParts/Header.d.ts +7 -0
- package/lib/mapping-card/src/MappingCardParts/Header.js +77 -0
- package/lib/mapping-card/src/injection.d.ts +17 -0
- package/lib/mapping-card/src/injection.js +5 -0
- package/lib/mapping-card/src/interface.d.ts +105 -0
- package/lib/mapping-card/src/interface.js +48 -0
- package/lib/mapping-card/src/styles/index.cssr.d.ts +2 -0
- package/lib/mapping-card/src/styles/index.cssr.js +97 -0
- package/lib/mapping-card/styles/dark.d.ts +337 -0
- package/lib/mapping-card/styles/dark.js +24 -0
- package/lib/mapping-card/styles/index.d.ts +3 -0
- package/lib/mapping-card/styles/index.js +10 -0
- package/lib/mapping-card/styles/light.d.ts +352 -0
- package/lib/mapping-card/styles/light.js +40 -0
- package/lib/progress/src/MultipleCircle.d.ts +1 -1
- package/lib/radio/src/Radio.d.ts +1 -1
- package/lib/radio/src/RadioButton.d.ts +3 -3
- package/lib/tabs/src/Tabs.d.ts +2 -6
- package/lib/themes/dark.js +84 -82
- package/lib/themes/light.js +82 -80
- package/lib/toggle-button/src/ToggleButton.d.ts +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +2 -0
- package/web-types.json +207 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { renderConfig } from "./src/renderer.mjs";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { BadgeProps } from '../../../badge';
|
|
3
|
+
import type { ListItemProps } from '../../../list/src/props';
|
|
4
|
+
import type { StatusProps } from '../../../status';
|
|
5
|
+
import type { TagProps } from '../../../tag';
|
|
6
|
+
import type { TextProps } from '../../../typography';
|
|
7
|
+
export interface BuiltinTypeMap {
|
|
8
|
+
text: TextProps;
|
|
9
|
+
status: StatusProps;
|
|
10
|
+
badge: BadgeProps;
|
|
11
|
+
tag: TagProps;
|
|
12
|
+
list_item: ListItemProps;
|
|
13
|
+
}
|
|
14
|
+
export type BuiltinType = keyof BuiltinTypeMap;
|
|
15
|
+
export type BuiltinConfig = {
|
|
16
|
+
[K in BuiltinType]: {
|
|
17
|
+
type: K;
|
|
18
|
+
params?: BuiltinTypeMap[K];
|
|
19
|
+
slots?: Record<string, ComponentConfig>;
|
|
20
|
+
render?: never;
|
|
21
|
+
};
|
|
22
|
+
}[BuiltinType];
|
|
23
|
+
export interface RenderConfig {
|
|
24
|
+
render: () => VNode;
|
|
25
|
+
type?: never;
|
|
26
|
+
params?: never;
|
|
27
|
+
slots?: never;
|
|
28
|
+
}
|
|
29
|
+
export type ComponentConfig = BuiltinConfig | RenderConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { h } from 'vue';
|
|
2
|
+
import { UBadge } from "../../../badge/index.mjs";
|
|
3
|
+
import { UListItem } from "../../../list/index.mjs";
|
|
4
|
+
import { UStatus } from "../../../status/index.mjs";
|
|
5
|
+
import { UTag } from "../../../tag/index.mjs";
|
|
6
|
+
import { UText } from "../../../typography/index.mjs";
|
|
7
|
+
const registry = {
|
|
8
|
+
text: UText,
|
|
9
|
+
status: UStatus,
|
|
10
|
+
badge: UBadge,
|
|
11
|
+
tag: UTag,
|
|
12
|
+
list_item: UListItem
|
|
13
|
+
};
|
|
14
|
+
export function renderConfig(config) {
|
|
15
|
+
if (config.render) {
|
|
16
|
+
return config.render();
|
|
17
|
+
}
|
|
18
|
+
const slots = config.slots ? Object.fromEntries(Object.entries(config.slots).map(([name, slotConfig]) => [name, () => renderConfig(slotConfig)])) : undefined;
|
|
19
|
+
return h(registry[config.type], config.params, slots);
|
|
20
|
+
}
|
|
@@ -6,7 +6,9 @@ import { UBaseIcon } from "../../icon/index.mjs";
|
|
|
6
6
|
import { CheckmarkIcon } from "../../icons/index.mjs";
|
|
7
7
|
import { internalSelectionMenuInjectionKey } from "./interface.mjs";
|
|
8
8
|
function renderCheckMark(show, clsPrefix) {
|
|
9
|
-
return h(
|
|
9
|
+
return h("div", {
|
|
10
|
+
class: `${clsPrefix}-base-select-option__check-wrapper`
|
|
11
|
+
}, h(Transition, {
|
|
10
12
|
name: "fade-in-scale-up-transition"
|
|
11
13
|
}, {
|
|
12
14
|
default: () => show ? h(UBaseIcon, {
|
|
@@ -15,7 +17,7 @@ function renderCheckMark(show, clsPrefix) {
|
|
|
15
17
|
}, {
|
|
16
18
|
default: () => h(CheckmarkIcon)
|
|
17
19
|
}) : null
|
|
18
|
-
});
|
|
20
|
+
}));
|
|
19
21
|
}
|
|
20
22
|
export default defineComponent({
|
|
21
23
|
name: 'UBaseSelectOption',
|
|
@@ -98,7 +100,9 @@ export default defineComponent({
|
|
|
98
100
|
const {
|
|
99
101
|
value: multiple
|
|
100
102
|
} = multipleRef;
|
|
101
|
-
if (value === null)
|
|
103
|
+
if (value === null) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
102
106
|
const optionValue = props.tmNode.rawNode[valueFieldRef.value];
|
|
103
107
|
if (multiple) {
|
|
104
108
|
const {
|
|
@@ -135,11 +139,11 @@ export default defineComponent({
|
|
|
135
139
|
handleMouseMove,
|
|
136
140
|
account
|
|
137
141
|
} = this;
|
|
138
|
-
const checkmark = renderCheckMark(isSelected, clsPrefix);
|
|
142
|
+
const checkmark = renderCheckMark(showCheckmark && isSelected, clsPrefix);
|
|
139
143
|
const label = renderLabel ? renderLabel(rawNode, isSelected) : render(rawNode[this.labelField], rawNode, isSelected);
|
|
140
144
|
const children = account ? [h(UBaseAccountOption, Object.assign({}, rawNode, {
|
|
141
145
|
label: label
|
|
142
|
-
})),
|
|
146
|
+
})), checkmark] : [label, checkmark];
|
|
143
147
|
const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(rawNode);
|
|
144
148
|
const node = h("div", Object.assign({}, attrs, {
|
|
145
149
|
class: [`${clsPrefix}-base-select-option`, rawNode.class, attrs === null || attrs === void 0 ? void 0 : attrs.class, {
|
|
@@ -104,14 +104,15 @@ export default cB('base-select-menu', `
|
|
|
104
104
|
color: var(--u-option-text-color-disabled);
|
|
105
105
|
`), cM('selected', `
|
|
106
106
|
opacity: var(--u-option-opacity-disabled);
|
|
107
|
-
`)]), cE('check', `
|
|
108
|
-
font-size: 24px;
|
|
107
|
+
`)]), cE('check-wrapper', `
|
|
109
108
|
position: absolute;
|
|
110
109
|
right: calc(var(--u-option-padding-right) - 4px);
|
|
111
110
|
top: 50%;
|
|
112
111
|
transform: translateY(-50%);
|
|
112
|
+
`, [cE('check', `
|
|
113
|
+
font-size: 24px;
|
|
113
114
|
color: var(--u-option-check-color);
|
|
114
115
|
transition: color .3s var(--u-bezier);
|
|
115
116
|
`, [fadeInScaleUpTransition({
|
|
116
117
|
enterScale: '0.5'
|
|
117
|
-
})])])]);
|
|
118
|
+
})])])])]);
|
|
@@ -272,6 +272,9 @@ export default c([cB('base-selection', `
|
|
|
272
272
|
color: var(--u-text-color-disabled);
|
|
273
273
|
`), cE('render-label', `
|
|
274
274
|
color: var(--u-text-color-disabled);
|
|
275
|
+
`), cB('base-selection-overlay', `
|
|
276
|
+
pointer-events: auto;
|
|
277
|
+
user-select: text;
|
|
275
278
|
`)]), cB('base-selection-tag-wrapper', `
|
|
276
279
|
max-width: 100%;
|
|
277
280
|
display: inline-flex;
|
|
@@ -251,9 +251,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
251
251
|
dropDownBgColor: string;
|
|
252
252
|
}, any>>>;
|
|
253
253
|
}>> & Readonly<{}>, {
|
|
254
|
+
readonly cols: string | number;
|
|
254
255
|
readonly showDivider: boolean;
|
|
255
256
|
readonly xGap: string | number;
|
|
256
257
|
readonly yGap: string | number;
|
|
257
|
-
readonly cols: string | number;
|
|
258
258
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
259
259
|
export default _default;
|
|
@@ -713,12 +713,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
713
713
|
disabled: boolean | undefined;
|
|
714
714
|
position: "left" | "right";
|
|
715
715
|
focusable: boolean;
|
|
716
|
+
checkedValue: string | number | boolean;
|
|
717
|
+
uncheckedValue: string | number | boolean;
|
|
716
718
|
indeterminate: boolean;
|
|
717
719
|
ripple: boolean;
|
|
718
720
|
privateInsideTable: boolean;
|
|
719
721
|
checked: string | number | boolean | undefined;
|
|
720
722
|
defaultChecked: string | number | boolean;
|
|
721
|
-
checkedValue: string | number | boolean;
|
|
722
|
-
uncheckedValue: string | number | boolean;
|
|
723
723
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
724
724
|
export default _default;
|
package/es/components.d.ts
CHANGED
package/es/components.mjs
CHANGED
|
@@ -63,6 +63,7 @@ export * from "./legacy-transfer/index.mjs";
|
|
|
63
63
|
export * from "./list/index.mjs";
|
|
64
64
|
export * from "./loading-bar/index.mjs";
|
|
65
65
|
export * from "./log/index.mjs";
|
|
66
|
+
export * from "./mapping-card/index.mjs";
|
|
66
67
|
export * from "./marquee/index.mjs";
|
|
67
68
|
export * from "./mention/index.mjs";
|
|
68
69
|
export * from "./menu/index.mjs";
|
|
@@ -52,7 +52,7 @@ import type { CollapseTransitionTheme } from '../../collapse-transition/styles';
|
|
|
52
52
|
import type { CollapseTheme } from '../../collapse/styles';
|
|
53
53
|
import type { ColorPickerProps } from '../../color-picker';
|
|
54
54
|
import type { ColorPickerTheme } from '../../color-picker/styles';
|
|
55
|
-
import type { DatePickerV2Props, DatePickerV2Theme } from '../../components';
|
|
55
|
+
import type { DatePickerV2Props, DatePickerV2Theme, MappingCardProps, MappingCardTheme } from '../../components';
|
|
56
56
|
import type { CropTheme } from '../../crop/styles';
|
|
57
57
|
import type { DataTableProps, DataTableRenderFilter, DataTableRenderSorter } from '../../data-table';
|
|
58
58
|
import type { DataTableTheme } from '../../data-table/styles';
|
|
@@ -209,6 +209,7 @@ export interface GlobalThemeWithoutCommon {
|
|
|
209
209
|
ButtonGroup?: ButtonGroupTheme;
|
|
210
210
|
Calendar?: CalendarTheme;
|
|
211
211
|
ActionCard?: ActionCardTheme;
|
|
212
|
+
MappingCard?: MappingCardTheme;
|
|
212
213
|
Card?: CardTheme;
|
|
213
214
|
Carousel?: CarouselTheme;
|
|
214
215
|
Cascader?: CascaderTheme;
|
|
@@ -315,6 +316,7 @@ export interface GlobalComponentConfig {
|
|
|
315
316
|
ButtonGroup?: ButtonGroupProps;
|
|
316
317
|
Calendar?: CalendarProps;
|
|
317
318
|
ActionCard?: ActionCardProps;
|
|
319
|
+
MappingCard?: MappingCardProps;
|
|
318
320
|
Card?: CardProps;
|
|
319
321
|
Carousel?: CarouselProps;
|
|
320
322
|
Cascader?: CascaderProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CsvOptionsType, MainTableRef, RowKey, TableBaseColumn } from './interface';
|
|
1
|
+
import type { ColumnKey, CsvOptionsType, MainTableRef, RowKey, TableBaseColumn } from './interface';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
-
readonly onUnstableColumnResize: import("vue").PropType<(resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key:
|
|
3
|
+
readonly onUnstableColumnResize: import("vue").PropType<(resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key: ColumnKey) => number | undefined) => void>;
|
|
4
4
|
readonly pagination: {
|
|
5
5
|
readonly type: import("vue").PropType<false | import("../..").PaginationProps>;
|
|
6
6
|
readonly default: false;
|
|
@@ -62,6 +62,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
62
62
|
readonly type: import("vue").PropType<"auto" | "fixed">;
|
|
63
63
|
readonly default: "auto";
|
|
64
64
|
};
|
|
65
|
+
readonly resizableMinWidth: {
|
|
66
|
+
readonly type: import("vue").PropType<number | string>;
|
|
67
|
+
readonly default: 50;
|
|
68
|
+
};
|
|
69
|
+
readonly resizableMaxWidth: import("vue").PropType<number | string>;
|
|
70
|
+
readonly resizableStorage: {
|
|
71
|
+
readonly type: BooleanConstructor;
|
|
72
|
+
readonly default: true;
|
|
73
|
+
};
|
|
65
74
|
readonly allowCheckingNotLoaded: BooleanConstructor;
|
|
66
75
|
readonly cascade: {
|
|
67
76
|
readonly type: BooleanConstructor;
|
|
@@ -2965,7 +2974,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2965
2974
|
clearFilters: () => void;
|
|
2966
2975
|
clearSorter: () => void;
|
|
2967
2976
|
page: (page: number) => void;
|
|
2968
|
-
sort: (columnKey:
|
|
2977
|
+
sort: (columnKey: ColumnKey, order: import("./interface").SortOrder) => void;
|
|
2969
2978
|
scrollTo: import("../../scrollbar/src/Scrollbar").ScrollTo;
|
|
2970
2979
|
downloadCsv: (options?: CsvOptionsType) => void;
|
|
2971
2980
|
getData: () => {
|
|
@@ -4421,7 +4430,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4421
4430
|
themeClass: import("vue").Ref<string, string> | undefined;
|
|
4422
4431
|
onRender: (() => void) | undefined;
|
|
4423
4432
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "edit"[], "edit", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
4424
|
-
readonly onUnstableColumnResize: import("vue").PropType<(resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key:
|
|
4433
|
+
readonly onUnstableColumnResize: import("vue").PropType<(resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key: ColumnKey) => number | undefined) => void>;
|
|
4425
4434
|
readonly pagination: {
|
|
4426
4435
|
readonly type: import("vue").PropType<false | import("../..").PaginationProps>;
|
|
4427
4436
|
readonly default: false;
|
|
@@ -4483,6 +4492,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4483
4492
|
readonly type: import("vue").PropType<"auto" | "fixed">;
|
|
4484
4493
|
readonly default: "auto";
|
|
4485
4494
|
};
|
|
4495
|
+
readonly resizableMinWidth: {
|
|
4496
|
+
readonly type: import("vue").PropType<number | string>;
|
|
4497
|
+
readonly default: 50;
|
|
4498
|
+
};
|
|
4499
|
+
readonly resizableMaxWidth: import("vue").PropType<number | string>;
|
|
4500
|
+
readonly resizableStorage: {
|
|
4501
|
+
readonly type: BooleanConstructor;
|
|
4502
|
+
readonly default: true;
|
|
4503
|
+
};
|
|
4486
4504
|
readonly allowCheckingNotLoaded: BooleanConstructor;
|
|
4487
4505
|
readonly cascade: {
|
|
4488
4506
|
readonly type: BooleanConstructor;
|
|
@@ -7388,6 +7406,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7388
7406
|
readonly bordered: boolean | undefined;
|
|
7389
7407
|
readonly loading: boolean;
|
|
7390
7408
|
readonly loadingSkeleton: boolean;
|
|
7409
|
+
readonly spinProps: import("../../_internal").BaseLoadingExposedProps;
|
|
7391
7410
|
readonly allowCheckingNotLoaded: boolean;
|
|
7392
7411
|
readonly remote: boolean;
|
|
7393
7412
|
readonly cascade: boolean;
|
|
@@ -7404,11 +7423,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7404
7423
|
readonly defaultExpandAll: boolean;
|
|
7405
7424
|
readonly stickyExpandedRows: boolean;
|
|
7406
7425
|
readonly tableLayout: "auto" | "fixed";
|
|
7426
|
+
readonly resizableMinWidth: string | number;
|
|
7427
|
+
readonly resizableStorage: boolean;
|
|
7407
7428
|
readonly childrenKey: string;
|
|
7408
7429
|
readonly indent: number;
|
|
7409
7430
|
readonly flexHeight: boolean;
|
|
7410
7431
|
readonly summaryPlacement: "top" | "bottom";
|
|
7411
7432
|
readonly paginationBehaviorOnFilter: "first" | "current";
|
|
7412
|
-
readonly spinProps: import("../../_internal").BaseLoadingExposedProps;
|
|
7413
7433
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7414
7434
|
export default _default;
|
|
@@ -14,7 +14,7 @@ import { useResizable } from "./use-resizable.mjs";
|
|
|
14
14
|
import { useScroll } from "./use-scroll.mjs";
|
|
15
15
|
import { useTableData } from "./use-table-data.mjs";
|
|
16
16
|
import { loadTableState, restoreSortStateFromStored, saveTableState } from "./use-table-storage.mjs";
|
|
17
|
-
import { generateCsv } from "./utils.mjs";
|
|
17
|
+
import { areColumnWidthMapsEqual, computeFixedTableColumnWidths, deriveColumnWidthSignature, deriveResizableColumnWidthItems, deriveVisibleLeafColumnWidthItems, generateCsv, isColumnResizable, parseLengthToNumber, sanitizeColumnWidthMap } from "./utils/index.mjs";
|
|
18
18
|
export default defineComponent({
|
|
19
19
|
name: 'DataTable',
|
|
20
20
|
alias: ['AdvancedTable'],
|
|
@@ -66,6 +66,7 @@ export default defineComponent({
|
|
|
66
66
|
getResizableWidth,
|
|
67
67
|
clearResizableWidth,
|
|
68
68
|
doUpdateResizableWidth,
|
|
69
|
+
setResizableWidths,
|
|
69
70
|
resizableWidthsRef
|
|
70
71
|
} = useResizable();
|
|
71
72
|
const {
|
|
@@ -155,7 +156,8 @@ export default defineComponent({
|
|
|
155
156
|
} = useScroll(props, {
|
|
156
157
|
bodyWidthRef,
|
|
157
158
|
mainTableInstRef,
|
|
158
|
-
mergedCurrentPageRef
|
|
159
|
+
mergedCurrentPageRef,
|
|
160
|
+
getResizableWidth
|
|
159
161
|
});
|
|
160
162
|
onMounted(() => {
|
|
161
163
|
var _a, _b;
|
|
@@ -163,7 +165,7 @@ export default defineComponent({
|
|
|
163
165
|
if (!key) return;
|
|
164
166
|
const stored = loadTableState(key);
|
|
165
167
|
if (!stored) return;
|
|
166
|
-
if (stored.columnWidths && Object.keys(stored.columnWidths).length > 0) {
|
|
168
|
+
if (props.resizableStorage && stored.columnWidths && Object.keys(stored.columnWidths).length > 0) {
|
|
167
169
|
resizableWidthsRef.value = Object.assign(Object.assign({}, resizableWidthsRef.value), stored.columnWidths);
|
|
168
170
|
}
|
|
169
171
|
if (props.pagination && stored.page != null) {
|
|
@@ -205,7 +207,7 @@ export default defineComponent({
|
|
|
205
207
|
var _a, _b;
|
|
206
208
|
if (!(state === null || state === void 0 ? void 0 : state.key)) return;
|
|
207
209
|
saveTableState(state.key, {
|
|
208
|
-
columnWidths: state.columnWidths,
|
|
210
|
+
columnWidths: state.columnWidths && Object.keys(state.columnWidths).length ? state.columnWidths : undefined,
|
|
209
211
|
page: state.page,
|
|
210
212
|
pageSize: state.pageSize,
|
|
211
213
|
filters: state.filters,
|
|
@@ -228,6 +230,124 @@ export default defineComponent({
|
|
|
228
230
|
}
|
|
229
231
|
return props.tableLayout;
|
|
230
232
|
});
|
|
233
|
+
const resizableColumnPresentRef = computed(() => {
|
|
234
|
+
return dataRelatedColsRef.value.some(column => isColumnResizable(column));
|
|
235
|
+
});
|
|
236
|
+
const resizableEnabledRef = computed(() => {
|
|
237
|
+
return resizableColumnPresentRef.value;
|
|
238
|
+
});
|
|
239
|
+
const fixedResizableModeRef = computed(() => {
|
|
240
|
+
return mergedTableLayoutRef.value === 'fixed' && resizableEnabledRef.value;
|
|
241
|
+
});
|
|
242
|
+
const visibleLeafColumnsSignalRef = computed(() => deriveVisibleLeafColumnWidthItems(dataRelatedColsRef.value));
|
|
243
|
+
const visibleLeafKeySignatureRef = computed(() => {
|
|
244
|
+
return visibleLeafColumnsSignalRef.value.map(column => String(column.key)).join('|');
|
|
245
|
+
});
|
|
246
|
+
const visibleLeafDescriptorSignatureRef = computed(() => {
|
|
247
|
+
return deriveColumnWidthSignature(visibleLeafColumnsSignalRef.value);
|
|
248
|
+
});
|
|
249
|
+
const resizableColumnsSignalRef = computed(() => deriveResizableColumnWidthItems(dataRelatedColsRef.value));
|
|
250
|
+
const resizableColumnsSignatureRef = computed(() => {
|
|
251
|
+
return deriveColumnWidthSignature(resizableColumnsSignalRef.value);
|
|
252
|
+
});
|
|
253
|
+
const modeSignalRef = computed(() => {
|
|
254
|
+
return fixedResizableModeRef.value ? 'fixed' : 'non-fixed';
|
|
255
|
+
});
|
|
256
|
+
const containerWidthSignalRef = computed(() => {
|
|
257
|
+
const bodyWidth = bodyWidthRef.value;
|
|
258
|
+
const scrollXWidth = parseLengthToNumber(props.scrollX);
|
|
259
|
+
return bodyWidth !== null && bodyWidth > 0 ? bodyWidth : scrollXWidth !== undefined && scrollXWidth > 0 ? scrollXWidth : undefined;
|
|
260
|
+
});
|
|
261
|
+
const widthConstraintSignalRef = computed(() => {
|
|
262
|
+
return {
|
|
263
|
+
systemMinWidth: props.resizableMinWidth,
|
|
264
|
+
systemMaxWidth: props.resizableMaxWidth
|
|
265
|
+
};
|
|
266
|
+
});
|
|
267
|
+
function buildNonFixedModeWidthMap(currentWidths, resizableColumns) {
|
|
268
|
+
const {
|
|
269
|
+
systemMinWidth,
|
|
270
|
+
systemMaxWidth
|
|
271
|
+
} = widthConstraintSignalRef.value;
|
|
272
|
+
return {
|
|
273
|
+
keys: resizableColumns.map(column => column.key),
|
|
274
|
+
widthMap: sanitizeColumnWidthMap(resizableColumns, {
|
|
275
|
+
systemMinWidth,
|
|
276
|
+
systemMaxWidth,
|
|
277
|
+
source: currentWidths
|
|
278
|
+
})
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function buildFixedModeWidthMap(visibleLeafColumns, currentWidths) {
|
|
282
|
+
const {
|
|
283
|
+
systemMinWidth,
|
|
284
|
+
systemMaxWidth
|
|
285
|
+
} = widthConstraintSignalRef.value;
|
|
286
|
+
const preferredWidths = sanitizeColumnWidthMap(visibleLeafColumns, {
|
|
287
|
+
systemMinWidth,
|
|
288
|
+
systemMaxWidth,
|
|
289
|
+
source: currentWidths
|
|
290
|
+
});
|
|
291
|
+
const containerWidth = containerWidthSignalRef.value;
|
|
292
|
+
if (containerWidth === undefined) {
|
|
293
|
+
return preferredWidths;
|
|
294
|
+
}
|
|
295
|
+
return computeFixedTableColumnWidths(visibleLeafColumns, {
|
|
296
|
+
containerWidth,
|
|
297
|
+
systemMinWidth,
|
|
298
|
+
systemMaxWidth,
|
|
299
|
+
preferredWidths
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function syncResizableWidths(nextWidths, keys) {
|
|
303
|
+
const prevWidths = resizableWidthsRef.value;
|
|
304
|
+
const keySet = new Set(keys.map(String));
|
|
305
|
+
const staleKeysPresent = Object.keys(prevWidths).some(key => !keySet.has(key));
|
|
306
|
+
if (!staleKeysPresent && areColumnWidthMapsEqual(prevWidths, nextWidths, keys)) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
setResizableWidths(nextWidths);
|
|
310
|
+
}
|
|
311
|
+
function reconcileResizableWidths(_reason) {
|
|
312
|
+
const visibleLeafColumns = visibleLeafColumnsSignalRef.value;
|
|
313
|
+
const currentWidths = resizableWidthsRef.value;
|
|
314
|
+
if (!visibleLeafColumns.length || !resizableColumnPresentRef.value) {
|
|
315
|
+
if (Object.keys(currentWidths).length) {
|
|
316
|
+
clearResizableWidth();
|
|
317
|
+
}
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
if (modeSignalRef.value !== 'fixed') {
|
|
321
|
+
const {
|
|
322
|
+
widthMap,
|
|
323
|
+
keys
|
|
324
|
+
} = buildNonFixedModeWidthMap(currentWidths, resizableColumnsSignalRef.value);
|
|
325
|
+
syncResizableWidths(widthMap, keys);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const visibleLeafKeys = visibleLeafColumns.map(column => column.key);
|
|
329
|
+
const nextWidths = buildFixedModeWidthMap(visibleLeafColumns, currentWidths);
|
|
330
|
+
syncResizableWidths(nextWidths, visibleLeafKeys);
|
|
331
|
+
}
|
|
332
|
+
function registerResizableWidthReconcileWatches() {
|
|
333
|
+
watch(() => [visibleLeafDescriptorSignatureRef.value, visibleLeafKeySignatureRef.value, resizableColumnsSignatureRef.value, resizableColumnPresentRef.value], () => {
|
|
334
|
+
reconcileResizableWidths('topology/capability');
|
|
335
|
+
}, {
|
|
336
|
+
immediate: true
|
|
337
|
+
});
|
|
338
|
+
watch(modeSignalRef, () => {
|
|
339
|
+
reconcileResizableWidths('mode');
|
|
340
|
+
});
|
|
341
|
+
watch(() => [containerWidthSignalRef.value, widthConstraintSignalRef.value.systemMinWidth, widthConstraintSignalRef.value.systemMaxWidth], () => {
|
|
342
|
+
reconcileResizableWidths('environment');
|
|
343
|
+
});
|
|
344
|
+
watch(() => resizableWidthsRef.value, () => {
|
|
345
|
+
reconcileResizableWidths('width-state');
|
|
346
|
+
}, {
|
|
347
|
+
deep: true
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
registerResizableWidthReconcileWatches();
|
|
231
351
|
const calculateTotalRowValue = (pageData, config) => {
|
|
232
352
|
const {
|
|
233
353
|
type,
|
|
@@ -438,6 +558,7 @@ export default defineComponent({
|
|
|
438
558
|
}),
|
|
439
559
|
onLoadRef: toRef(props, 'onLoad'),
|
|
440
560
|
mergedTableLayoutRef,
|
|
561
|
+
resizableEnabledRef,
|
|
441
562
|
maxHeightRef: toRef(props, 'maxHeight'),
|
|
442
563
|
minHeightRef: toRef(props, 'minHeight'),
|
|
443
564
|
flexHeightRef: toRef(props, 'flexHeight'),
|
|
@@ -4,7 +4,7 @@ import { UButton } from "../../../button/index.mjs";
|
|
|
4
4
|
import { UCheckbox, UCheckboxGroup } from "../../../checkbox/index.mjs";
|
|
5
5
|
import { URadio, URadioGroup } from "../../../radio/index.mjs";
|
|
6
6
|
import { dataTableInjectionKey } from "../interface.mjs";
|
|
7
|
-
import { shouldUseArrayInSingleMode } from "../utils.mjs";
|
|
7
|
+
import { shouldUseArrayInSingleMode } from "../utils/index.mjs";
|
|
8
8
|
export default defineComponent({
|
|
9
9
|
name: 'DataTableFilterMenu',
|
|
10
10
|
props: {
|
|
@@ -3,6 +3,12 @@ import type { VirtualListInst } from 'vueuc';
|
|
|
3
3
|
import type { ScrollbarInst } from '../../../_internal';
|
|
4
4
|
import type { ColumnKey, RowKey, TmNode } from '../interface';
|
|
5
5
|
import type { ColItem } from '../use-group-header';
|
|
6
|
+
interface NormalRowRenderInfo {
|
|
7
|
+
striped: boolean;
|
|
8
|
+
tmNode: TmNode;
|
|
9
|
+
key: RowKey;
|
|
10
|
+
index: number;
|
|
11
|
+
}
|
|
6
12
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
13
|
onEdit: PropType<(value: string, row: string, key: string) => void>;
|
|
8
14
|
onResize: PropType<(e: ResizeObserverEntry) => void>;
|
|
@@ -2822,12 +2828,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2822
2828
|
shouldDisplaySomeTablePart: import("vue").ComputedRef<boolean>;
|
|
2823
2829
|
empty: import("vue").ComputedRef<boolean>;
|
|
2824
2830
|
paginatedDataAndInfo: import("vue").ComputedRef<{
|
|
2825
|
-
data:
|
|
2826
|
-
tmNode: TmNode;
|
|
2827
|
-
key: import("treemate").Key;
|
|
2828
|
-
striped: boolean;
|
|
2829
|
-
index: number;
|
|
2830
|
-
}[];
|
|
2831
|
+
data: NormalRowRenderInfo[];
|
|
2831
2832
|
hasChildren: boolean;
|
|
2832
2833
|
}>;
|
|
2833
2834
|
rawPaginatedData: import("vue").Ref<import("../interface").InternalRowData[], import("../interface").InternalRowData[]>;
|
|
@@ -2853,6 +2854,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2853
2854
|
mergedSortState: import("vue").Ref<import("../interface").SortState[], import("../interface").SortState[]>;
|
|
2854
2855
|
virtualScroll: import("vue").Ref<boolean, boolean>;
|
|
2855
2856
|
mergedTableLayout: import("vue").Ref<"auto" | "fixed", "auto" | "fixed">;
|
|
2857
|
+
fixedResizableMode: import("vue").ComputedRef<boolean>;
|
|
2858
|
+
fixedResizableTableWidth: import("vue").ComputedRef<string | undefined>;
|
|
2856
2859
|
childTriggerColIndex: import("vue").Ref<number, number>;
|
|
2857
2860
|
indent: import("vue").Ref<number, number>;
|
|
2858
2861
|
rowProps: import("vue").Ref<import("../interface").CreateRowProps<import("../interface").InternalRowData> | undefined, import("../interface").CreateRowProps<import("../interface").InternalRowData> | undefined>;
|
|
@@ -6,7 +6,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
6
6
|
}
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
|
-
import { pxfy, repeat } from 'seemly';
|
|
9
|
+
import { depx, pxfy, repeat } from 'seemly';
|
|
10
10
|
import { useMemo } from 'vooks';
|
|
11
11
|
import { computed, defineComponent, Fragment, h, inject, onUnmounted, ref, watchEffect } from 'vue';
|
|
12
12
|
import { VirtualList, VResizeObserver } from 'vueuc';
|
|
@@ -17,7 +17,7 @@ import { c } from "../../../_utils/cssr/index.mjs";
|
|
|
17
17
|
import { configProviderInjectionKey } from "../../../config-provider/src/context.mjs";
|
|
18
18
|
import { UEmpty } from "../../../empty/index.mjs";
|
|
19
19
|
import { dataTableInjectionKey } from "../interface.mjs";
|
|
20
|
-
import { createRowClassName, getColKey, isColumnSorting } from "../utils.mjs";
|
|
20
|
+
import { createRowClassName, getColKey, isColumnSorting } from "../utils/index.mjs";
|
|
21
21
|
import RenderSafeCheckbox from "./BodyCheckbox.mjs";
|
|
22
22
|
import RenderSafeRadio from "./BodyRadio.mjs";
|
|
23
23
|
import BodySkeleton from "./BodySkeleton.mjs";
|
|
@@ -71,6 +71,7 @@ const VirtualListItemWrapper = defineComponent({
|
|
|
71
71
|
type: Array,
|
|
72
72
|
required: true
|
|
73
73
|
},
|
|
74
|
+
tableWidth: String,
|
|
74
75
|
onMouseenter: Function,
|
|
75
76
|
onMouseleave: Function
|
|
76
77
|
},
|
|
@@ -79,12 +80,14 @@ const VirtualListItemWrapper = defineComponent({
|
|
|
79
80
|
clsPrefix,
|
|
80
81
|
id,
|
|
81
82
|
cols,
|
|
83
|
+
tableWidth,
|
|
82
84
|
onMouseenter,
|
|
83
85
|
onMouseleave
|
|
84
86
|
} = this;
|
|
85
87
|
return h("table", {
|
|
86
88
|
style: {
|
|
87
|
-
tableLayout: 'fixed'
|
|
89
|
+
tableLayout: 'fixed',
|
|
90
|
+
width: tableWidth
|
|
88
91
|
},
|
|
89
92
|
class: `${clsPrefix}-data-table-table`,
|
|
90
93
|
onMouseenter: onMouseenter,
|
|
@@ -134,6 +137,7 @@ export default defineComponent({
|
|
|
134
137
|
virtualScrollRef,
|
|
135
138
|
componentId,
|
|
136
139
|
mergedTableLayoutRef,
|
|
140
|
+
resizableEnabledRef,
|
|
137
141
|
childTriggerColIndexRef,
|
|
138
142
|
indentRef,
|
|
139
143
|
rowPropsRef,
|
|
@@ -174,6 +178,19 @@ export default defineComponent({
|
|
|
174
178
|
const mergedExpandedRowKeySetRef = computed(() => {
|
|
175
179
|
return new Set(mergedExpandedRowKeysRef.value);
|
|
176
180
|
});
|
|
181
|
+
const fixedResizableModeRef = computed(() => {
|
|
182
|
+
return mergedTableLayoutRef.value === 'fixed' && resizableEnabledRef.value;
|
|
183
|
+
});
|
|
184
|
+
const fixedResizableTableWidthRef = computed(() => {
|
|
185
|
+
if (!fixedResizableModeRef.value) return;
|
|
186
|
+
let total = 0;
|
|
187
|
+
for (const column of colsRef.value) {
|
|
188
|
+
const width = depx(column.style.width);
|
|
189
|
+
if (!Number.isFinite(width) || width <= 0) return;
|
|
190
|
+
total += width;
|
|
191
|
+
}
|
|
192
|
+
return `${total}px`;
|
|
193
|
+
});
|
|
177
194
|
function getRowInfo(key) {
|
|
178
195
|
var _a;
|
|
179
196
|
return (_a = treeMateRef.value.getNode(key)) === null || _a === void 0 ? void 0 : _a.rawNode;
|
|
@@ -427,6 +444,8 @@ export default defineComponent({
|
|
|
427
444
|
mergedSortState: mergedSortStateRef,
|
|
428
445
|
virtualScroll: virtualScrollRef,
|
|
429
446
|
mergedTableLayout: mergedTableLayoutRef,
|
|
447
|
+
fixedResizableMode: fixedResizableModeRef,
|
|
448
|
+
fixedResizableTableWidth: fixedResizableTableWidthRef,
|
|
430
449
|
childTriggerColIndex: childTriggerColIndexRef,
|
|
431
450
|
indent: indentRef,
|
|
432
451
|
rowProps: rowPropsRef,
|
|
@@ -459,21 +478,23 @@ export default defineComponent({
|
|
|
459
478
|
virtualScroll,
|
|
460
479
|
maxHeight,
|
|
461
480
|
mergedTableLayout,
|
|
481
|
+
fixedResizableMode,
|
|
482
|
+
fixedResizableTableWidth,
|
|
462
483
|
flexHeight,
|
|
463
484
|
loadingKeySet,
|
|
464
485
|
onResize,
|
|
465
486
|
setHeaderScrollLeft,
|
|
466
487
|
emptyPropsRef
|
|
467
488
|
} = this;
|
|
468
|
-
const scrollable = scrollX !== undefined || maxHeight !== undefined || flexHeight;
|
|
489
|
+
const scrollable = scrollX !== undefined || maxHeight !== undefined || flexHeight || fixedResizableMode;
|
|
469
490
|
// For a basic table with auto layout whose content may overflow we will
|
|
470
491
|
// make it scrollable, which differs from browser's native behavior.
|
|
471
492
|
// For native behavior, see
|
|
472
493
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout
|
|
473
494
|
const isBasicAutoLayout = !scrollable && mergedTableLayout === 'auto';
|
|
474
|
-
const xScrollable = scrollX !== undefined || isBasicAutoLayout;
|
|
495
|
+
const xScrollable = scrollX !== undefined || isBasicAutoLayout || fixedResizableMode;
|
|
475
496
|
const contentStyle = {
|
|
476
|
-
minWidth: formatLength(scrollX) || '100%'
|
|
497
|
+
minWidth: fixedResizableTableWidth || formatLength(scrollX) || '100%'
|
|
477
498
|
};
|
|
478
499
|
if (scrollX) contentStyle.width = '100%';
|
|
479
500
|
const tableNode = h(UScrollbar, Object.assign({}, this.scrollbarProps, {
|
|
@@ -767,6 +788,7 @@ export default defineComponent({
|
|
|
767
788
|
class: `${mergedClsPrefix}-data-table-table`,
|
|
768
789
|
onMouseleave: handleMouseleaveTable,
|
|
769
790
|
style: {
|
|
791
|
+
width: fixedResizableTableWidth,
|
|
770
792
|
tableLayout: this.mergedTableLayout
|
|
771
793
|
}
|
|
772
794
|
}, h("colgroup", null, cols.map(col => h("col", {
|
|
@@ -786,6 +808,7 @@ export default defineComponent({
|
|
|
786
808
|
class: `${mergedClsPrefix}-data-table-table`,
|
|
787
809
|
onMouseleave: handleMouseleaveTable,
|
|
788
810
|
style: {
|
|
811
|
+
width: fixedResizableTableWidth,
|
|
789
812
|
tableLayout: this.mergedTableLayout
|
|
790
813
|
}
|
|
791
814
|
}, h("colgroup", null, cols.map(col => h("col", {
|
|
@@ -804,6 +827,7 @@ export default defineComponent({
|
|
|
804
827
|
clsPrefix: mergedClsPrefix,
|
|
805
828
|
id: componentId,
|
|
806
829
|
cols,
|
|
830
|
+
tableWidth: fixedResizableTableWidth,
|
|
807
831
|
onMouseleave: handleMouseleaveTable
|
|
808
832
|
},
|
|
809
833
|
showScrollbar: false,
|