@jetlinks-web/components 2.6.9 → 2.6.11
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/es/EditTable/Body.js +34 -7
- package/es/EditTable/CellRender.js +12 -0
- package/es/EditTable/EditTable.js +70 -15
- package/es/EditTable/Header.js +22 -7
- package/es/EditTable/HeaderRender.js +12 -0
- package/es/EditTable/components/Search/sort.js +1 -1
- package/es/EditTable/consts.js +2 -1
- package/es/EditTable/hooks/index.js +4 -1
- package/es/EditTable/props.js +1 -1
- package/es/EditTable/style/body.less +0 -1
- package/es/EditTable/style/header.less +5 -0
- package/es/EditTable/style/index.css +16 -1
- package/es/EditTable/style/table.less +14 -0
- package/es/EditTable/utils.js +3 -3
- package/es/FullPage/FullPage.js +1 -1
- package/es/PermissionButton/index.js +1 -2
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/style/index.css +16 -1
- package/lib/EditTable/Body.js +34 -7
- package/lib/EditTable/CellRender.js +12 -0
- package/lib/EditTable/EditTable.js +70 -15
- package/lib/EditTable/Header.js +22 -7
- package/lib/EditTable/HeaderRender.js +12 -0
- package/lib/EditTable/components/Search/sort.js +1 -1
- package/lib/EditTable/consts.js +3 -2
- package/lib/EditTable/hooks/index.js +6 -2
- package/lib/EditTable/props.js +1 -1
- package/lib/EditTable/style/body.less +0 -1
- package/lib/EditTable/style/header.less +5 -0
- package/lib/EditTable/style/index.css +16 -1
- package/lib/EditTable/style/table.less +14 -0
- package/lib/EditTable/utils.js +2 -3
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/PermissionButton/index.js +1 -2
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/style/index.css +16 -1
- package/package.json +3 -3
package/es/style/index.css
CHANGED
|
@@ -4841,6 +4841,7 @@ span.ant-radio + * {
|
|
|
4841
4841
|
flex-shrink: 0;
|
|
4842
4842
|
background: #fafafa;
|
|
4843
4843
|
transition: background-color 0.3s ease;
|
|
4844
|
+
overflow: auto hidden;
|
|
4844
4845
|
}
|
|
4845
4846
|
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-edit-table-header {
|
|
4846
4847
|
overflow: hidden;
|
|
@@ -4855,6 +4856,17 @@ span.ant-radio + * {
|
|
|
4855
4856
|
flex: 1 1 auto;
|
|
4856
4857
|
flex-direction: row;
|
|
4857
4858
|
}
|
|
4859
|
+
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-table-horizontal-scroll {
|
|
4860
|
+
width: 100%;
|
|
4861
|
+
height: 10px;
|
|
4862
|
+
min-height: 10px;
|
|
4863
|
+
max-height: 10px;
|
|
4864
|
+
display: flex;
|
|
4865
|
+
}
|
|
4866
|
+
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-table-horizontal-scroll .jetlinks-table-horizontal-scroll-bar {
|
|
4867
|
+
height: 100%;
|
|
4868
|
+
overflow-x: scroll;
|
|
4869
|
+
}
|
|
4858
4870
|
.jetlinks-edit-table-body-viewport {
|
|
4859
4871
|
max-height: 100%;
|
|
4860
4872
|
width: 100%;
|
|
@@ -4880,7 +4892,6 @@ span.ant-radio + * {
|
|
|
4880
4892
|
}
|
|
4881
4893
|
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row {
|
|
4882
4894
|
width: 100%;
|
|
4883
|
-
display: flex;
|
|
4884
4895
|
align-items: center;
|
|
4885
4896
|
transition: top 0.2s, height 0.2s, background-color 0.1s;
|
|
4886
4897
|
border-bottom: 1px solid #ebebeb;
|
|
@@ -4940,6 +4951,10 @@ span.ant-radio + * {
|
|
|
4940
4951
|
display: flex;
|
|
4941
4952
|
align-items: center;
|
|
4942
4953
|
font-weight: 600;
|
|
4954
|
+
gap: 4px;
|
|
4955
|
+
}
|
|
4956
|
+
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .table-header-cell-title .cell-title-box {
|
|
4957
|
+
flex: 1 1 auto;
|
|
4943
4958
|
}
|
|
4944
4959
|
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .header-cell-required {
|
|
4945
4960
|
color: #ff4d4f;
|
package/lib/EditTable/Body.js
CHANGED
|
@@ -16,8 +16,10 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
16
16
|
} return value; }
|
|
17
17
|
/* Analyzed bindings: {
|
|
18
18
|
"groupKey": "props",
|
|
19
|
+
"width": "props",
|
|
19
20
|
"readonly": "props",
|
|
20
21
|
"ContextMenu": "setup-maybe-ref",
|
|
22
|
+
"useHScroll": "setup-maybe-ref",
|
|
21
23
|
"useRightMenuContext": "setup-maybe-ref",
|
|
22
24
|
"randomString": "setup-maybe-ref",
|
|
23
25
|
"bodyProps": "setup-maybe-ref",
|
|
@@ -29,6 +31,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
29
31
|
"onBeforeUnmount": "setup-const",
|
|
30
32
|
"nextTick": "setup-const",
|
|
31
33
|
"Empty": "setup-const",
|
|
34
|
+
"CellRender": "setup-const",
|
|
32
35
|
"props": "setup-reactive-const",
|
|
33
36
|
"emit": "setup-const",
|
|
34
37
|
"viewScrollRef": "setup-ref",
|
|
@@ -36,6 +39,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
36
39
|
"virtualRang": "setup-reactive-const",
|
|
37
40
|
"containerStyle": "setup-ref",
|
|
38
41
|
"context": "setup-maybe-ref",
|
|
42
|
+
"hScroll": "setup-maybe-ref",
|
|
39
43
|
"scrollLock": "setup-let",
|
|
40
44
|
"menuInstance": "setup-let",
|
|
41
45
|
"maxLen": "setup-ref",
|
|
@@ -47,7 +51,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
47
51
|
"rowClick": "setup-const",
|
|
48
52
|
"updateSelectedKeys": "setup-const"
|
|
49
53
|
} */
|
|
50
|
-
import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
|
|
54
|
+
import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, createBlock as _createBlock, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
|
|
51
55
|
const _hoisted_1 = { style: { position: 'relative' } };
|
|
52
56
|
const _hoisted_2 = ["data-row-key", "onContextmenu", "onClick"];
|
|
53
57
|
const _hoisted_3 = {
|
|
@@ -64,11 +68,12 @@ const _hoisted_5 = {
|
|
|
64
68
|
};
|
|
65
69
|
const _hoisted_6 = { class: "jetlinks-edit-table-body-empty" };
|
|
66
70
|
import ContextMenu from './components/ContextMenu';
|
|
67
|
-
import { useRightMenuContext } from "./hooks";
|
|
71
|
+
import { useHScroll, useRightMenuContext } from "./hooks";
|
|
68
72
|
import { randomString } from "@jetlinks-web/utils";
|
|
69
73
|
import { bodyProps } from "./props";
|
|
70
74
|
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
|
71
75
|
import Empty from '../Empty/Empty.js';
|
|
76
|
+
import CellRender from './CellRender.js';
|
|
72
77
|
const __sfc_main__ = Object.assign({
|
|
73
78
|
name: 'JEditTableBody'
|
|
74
79
|
}, {
|
|
@@ -78,6 +83,9 @@ const __sfc_main__ = Object.assign({
|
|
|
78
83
|
type: [String, Number],
|
|
79
84
|
default: undefined
|
|
80
85
|
},
|
|
86
|
+
width: {
|
|
87
|
+
type: Number
|
|
88
|
+
},
|
|
81
89
|
readonly: {
|
|
82
90
|
type: Boolean,
|
|
83
91
|
default: false
|
|
@@ -95,6 +103,7 @@ const __sfc_main__ = Object.assign({
|
|
|
95
103
|
});
|
|
96
104
|
const containerStyle = ref(0);
|
|
97
105
|
const context = useRightMenuContext();
|
|
106
|
+
const hScroll = useHScroll();
|
|
98
107
|
let scrollLock = ref(false);
|
|
99
108
|
let menuInstance;
|
|
100
109
|
const maxLen = computed(() => {
|
|
@@ -104,7 +113,7 @@ const __sfc_main__ = Object.assign({
|
|
|
104
113
|
const virtualData = computed(() => {
|
|
105
114
|
const array = props.dataSource.slice(virtualRang.start, virtualRang.end);
|
|
106
115
|
if (tableCenterRef.value) {
|
|
107
|
-
tableCenterRef.value.style.webkitTransform
|
|
116
|
+
// tableCenterRef.value.style.webkitTransform = `translateY(${virtualRang.start * props.cellHeight}px)`
|
|
108
117
|
}
|
|
109
118
|
return array;
|
|
110
119
|
});
|
|
@@ -215,7 +224,11 @@ const __sfc_main__ = Object.assign({
|
|
|
215
224
|
_createElementVNode("div", {
|
|
216
225
|
class: "jetlinks-edit-table-center",
|
|
217
226
|
ref_key: "tableCenterRef",
|
|
218
|
-
ref: tableCenterRef
|
|
227
|
+
ref: tableCenterRef,
|
|
228
|
+
style: _normalizeStyle({
|
|
229
|
+
transform: `translate3d(-${_unref(hScroll) || 0}px, ${virtualRang.start * _ctx.cellHeight}px, 0)`,
|
|
230
|
+
width: __props.width + 'px'
|
|
231
|
+
})
|
|
219
232
|
}, [
|
|
220
233
|
(virtualData.value.length)
|
|
221
234
|
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(virtualData.value, (item, index) => {
|
|
@@ -225,7 +238,11 @@ const __sfc_main__ = Object.assign({
|
|
|
225
238
|
'jetlinks-edit-table-row-selected': _optionalChain([selectedRowKeys, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.includes, 'call', _14 => _14(item[_ctx.rowKey] || virtualRang.start + index + 1)])
|
|
226
239
|
}),
|
|
227
240
|
key: `record_${item.__key}`,
|
|
228
|
-
style: _normalizeStyle({
|
|
241
|
+
style: _normalizeStyle({
|
|
242
|
+
height: `${_ctx.cellHeight}px`,
|
|
243
|
+
lineHeight: `${_ctx.cellHeight}px`,
|
|
244
|
+
transform: `-${_unref(hScroll) || 0}px`
|
|
245
|
+
}),
|
|
229
246
|
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
230
247
|
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
231
248
|
onClick: _withModifiers(() => rowClick(item), ["stop"])
|
|
@@ -254,7 +271,17 @@ const __sfc_main__ = Object.assign({
|
|
|
254
271
|
index: item.__dataIndex,
|
|
255
272
|
column: column
|
|
256
273
|
}, () => [
|
|
257
|
-
|
|
274
|
+
(column.customRender)
|
|
275
|
+
? (_openBlock(), _createBlock(CellRender, {
|
|
276
|
+
key: 0,
|
|
277
|
+
record: item,
|
|
278
|
+
value: item[column.dataIndex],
|
|
279
|
+
index: item.__dataIndex,
|
|
280
|
+
"render-fn": column.customRender
|
|
281
|
+
}, null, 8 /* PROPS */, ["record", "value", "index", "render-fn"]))
|
|
282
|
+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
|
|
283
|
+
_createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)
|
|
284
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
258
285
|
])
|
|
259
286
|
]))
|
|
260
287
|
], 4 /* STYLE */));
|
|
@@ -265,7 +292,7 @@ const __sfc_main__ = Object.assign({
|
|
|
265
292
|
(__props.readonly)
|
|
266
293
|
? (_openBlock(), _createElementBlock("div", _hoisted_5))
|
|
267
294
|
: _createCommentVNode("v-if", true)
|
|
268
|
-
],
|
|
295
|
+
], 4 /* STYLE */)
|
|
269
296
|
])
|
|
270
297
|
], 36 /* STYLE, NEED_HYDRATION */))
|
|
271
298
|
: _renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Analyzed bindings: {} */
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
const __sfc_main__ = defineComponent({
|
|
4
|
+
name: "CellRender",
|
|
5
|
+
props: ['renderFn', 'value', 'record', 'index'],
|
|
6
|
+
setup(props) {
|
|
7
|
+
return () => {
|
|
8
|
+
return props.renderFn(props.value, props.record, props.index);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export default __sfc_main__;
|
|
@@ -26,6 +26,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
26
26
|
"TABLE_GROUP_ACTIVE": "setup-maybe-ref",
|
|
27
27
|
"TABLE_GROUP_ERROR": "setup-maybe-ref",
|
|
28
28
|
"TABLE_GROUP_OPTIONS": "setup-maybe-ref",
|
|
29
|
+
"TABLE_H_SCROLL": "setup-maybe-ref",
|
|
29
30
|
"TABLE_OPEN_GROUP": "setup-maybe-ref",
|
|
30
31
|
"TABLE_TOOL": "setup-maybe-ref",
|
|
31
32
|
"TABLE_WRAPPER": "setup-maybe-ref",
|
|
@@ -58,7 +59,11 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
58
59
|
"myColumns": "setup-ref",
|
|
59
60
|
"tableWrapper": "setup-ref",
|
|
60
61
|
"tableBody": "setup-ref",
|
|
62
|
+
"scrollBarRef": "setup-ref",
|
|
61
63
|
"tableStyle": "setup-reactive-const",
|
|
64
|
+
"showScroll": "setup-ref",
|
|
65
|
+
"horizontalScrollWidth": "setup-ref",
|
|
66
|
+
"horizontalScrollLeft": "setup-ref",
|
|
62
67
|
"fields": "setup-const",
|
|
63
68
|
"defaultGroupId": "literal-const",
|
|
64
69
|
"fieldsErrMap": "setup-ref",
|
|
@@ -85,6 +90,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
85
90
|
"removeFieldError": "setup-const",
|
|
86
91
|
"addFieldError": "setup-const",
|
|
87
92
|
"scrollWidth": "setup-ref",
|
|
93
|
+
"handleColumns": "setup-const",
|
|
88
94
|
"onResize": "setup-const",
|
|
89
95
|
"onScrollDown": "setup-const",
|
|
90
96
|
"rightMenu": "setup-const",
|
|
@@ -93,12 +99,18 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
93
99
|
"getTableWrapperRef": "setup-const",
|
|
94
100
|
"groupDelete": "setup-const",
|
|
95
101
|
"groupEdit": "setup-const",
|
|
96
|
-
"getGroupActive": "setup-const"
|
|
102
|
+
"getGroupActive": "setup-const",
|
|
103
|
+
"onHorizontalScroll": "setup-const"
|
|
97
104
|
} */
|
|
98
|
-
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, createVNode as _createVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock,
|
|
105
|
+
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, createVNode as _createVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, normalizeClass as _normalizeClass } from "vue";
|
|
99
106
|
const _hoisted_1 = { class: "jetlinks-edit-table-extra" };
|
|
100
107
|
const _hoisted_2 = { class: "jetlinks-edit-table" };
|
|
101
|
-
|
|
108
|
+
const _hoisted_3 = {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: "jetlinks-table-horizontal-scroll"
|
|
111
|
+
};
|
|
112
|
+
const _hoisted_4 = /*#__PURE__*/ _createElementVNode("div", { style: { "width": "15px", "height": "100%", "overflow-x": "hidden" } }, null, -1 /* HOISTED */);
|
|
113
|
+
import { FULL_SCREEN, RIGHT_MENU, TABLE_DATA_SOURCE, TABLE_ERROR, TABLE_GROUP_ACTIVE, TABLE_GROUP_ERROR, TABLE_GROUP_OPTIONS, TABLE_H_SCROLL, TABLE_OPEN_GROUP, TABLE_TOOL, TABLE_WRAPPER } from './consts';
|
|
102
114
|
import { handleColumnsWidth } from './utils';
|
|
103
115
|
import { useGroup, useResizeObserver, useValidate } from './hooks';
|
|
104
116
|
import { tableProps } from 'ant-design-vue/lib/table';
|
|
@@ -147,10 +159,14 @@ const __sfc_main__ = Object.assign({
|
|
|
147
159
|
const myColumns = ref([]);
|
|
148
160
|
const tableWrapper = ref();
|
|
149
161
|
const tableBody = ref();
|
|
162
|
+
const scrollBarRef = ref();
|
|
150
163
|
const tableStyle = reactive({
|
|
151
164
|
width: '100%',
|
|
152
165
|
height: props.height
|
|
153
166
|
});
|
|
167
|
+
const showScroll = ref(false);
|
|
168
|
+
const horizontalScrollWidth = ref(0);
|
|
169
|
+
const horizontalScrollLeft = ref(0);
|
|
154
170
|
const fields = {};
|
|
155
171
|
const fieldsErrMap = ref({});
|
|
156
172
|
const fieldsGroupError = ref({});
|
|
@@ -287,6 +303,7 @@ const __sfc_main__ = Object.assign({
|
|
|
287
303
|
});
|
|
288
304
|
provide(TABLE_GROUP_OPTIONS, groupOptions);
|
|
289
305
|
provide(TABLE_GROUP_ACTIVE, groupActive);
|
|
306
|
+
provide(TABLE_H_SCROLL, horizontalScrollLeft);
|
|
290
307
|
const addField = (key, field) => {
|
|
291
308
|
fields[key] = field;
|
|
292
309
|
};
|
|
@@ -309,13 +326,7 @@ const __sfc_main__ = Object.assign({
|
|
|
309
326
|
const scrollWidth = computed(() => {
|
|
310
327
|
return (props.dataSource.length * props.cellHeight) > props.height ? scrollDefaultWidth.value : 0;
|
|
311
328
|
});
|
|
312
|
-
|
|
313
|
-
const _width = width - scrollWidth.value;
|
|
314
|
-
tableStyle.width = width || '100%';
|
|
315
|
-
// const viewportDom = document.querySelector('.jetlinks-edit-table-body-viewport')
|
|
316
|
-
// const viewportDivDom = viewportDom.querySelector('div')
|
|
317
|
-
//
|
|
318
|
-
// scrollDefaultWidth.value = viewportDom.offsetWidth - viewportDivDom.offsetWidth
|
|
329
|
+
const handleColumns = () => {
|
|
319
330
|
let newColumns = [...props.columns];
|
|
320
331
|
if (props.serial) {
|
|
321
332
|
const serial = {
|
|
@@ -327,11 +338,28 @@ const __sfc_main__ = Object.assign({
|
|
|
327
338
|
}
|
|
328
339
|
return customData.index + 1;
|
|
329
340
|
},
|
|
330
|
-
width: _optionalChain([props, 'access', _14 => _14.serial, 'optionalAccess', _15 => _15.width])
|
|
341
|
+
width: _optionalChain([props, 'access', _14 => _14.serial, 'optionalAccess', _15 => _15.width]),
|
|
342
|
+
fixed: 'left'
|
|
331
343
|
};
|
|
332
344
|
newColumns = [serial, ...props.columns];
|
|
333
345
|
}
|
|
334
|
-
myColumns.value = handleColumnsWidth(newColumns,
|
|
346
|
+
myColumns.value = handleColumnsWidth(newColumns, tableStyle.width - scrollWidth.value);
|
|
347
|
+
horizontalScrollWidth.value = myColumns.value.reduce((prev, next) => {
|
|
348
|
+
prev += next.width;
|
|
349
|
+
return prev;
|
|
350
|
+
}, 0);
|
|
351
|
+
if (horizontalScrollWidth.value > tableStyle.width) {
|
|
352
|
+
showScroll.value = true;
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
function onResize({ width = 0 }) {
|
|
356
|
+
const _width = width - scrollWidth.value;
|
|
357
|
+
tableStyle.width = width || '100%';
|
|
358
|
+
// const viewportDom = document.querySelector('.jetlinks-edit-table-body-viewport')
|
|
359
|
+
// const viewportDivDom = viewportDom.querySelector('div')
|
|
360
|
+
//
|
|
361
|
+
// scrollDefaultWidth.value = viewportDom.offsetWidth - viewportDivDom.offsetWidth
|
|
362
|
+
handleColumns();
|
|
335
363
|
}
|
|
336
364
|
const onScrollDown = (len) => {
|
|
337
365
|
emit('scrollDown', len);
|
|
@@ -368,6 +396,9 @@ const __sfc_main__ = Object.assign({
|
|
|
368
396
|
const getGroupActive = () => {
|
|
369
397
|
return groupActive.value;
|
|
370
398
|
};
|
|
399
|
+
const onHorizontalScroll = (e) => {
|
|
400
|
+
horizontalScrollLeft.value = scrollBarRef.value.scrollLeft;
|
|
401
|
+
};
|
|
371
402
|
watch(() => fieldsErrMap.value, (errorMap) => {
|
|
372
403
|
fieldsGroupError.value = {};
|
|
373
404
|
if (props.openGroup) {
|
|
@@ -398,6 +429,9 @@ const __sfc_main__ = Object.assign({
|
|
|
398
429
|
watch(() => scrollWidth.value, () => {
|
|
399
430
|
onResize({ width: tableStyle.width });
|
|
400
431
|
});
|
|
432
|
+
watch(() => [JSON.stringify(props.columns), tableStyle.width], () => {
|
|
433
|
+
handleColumns();
|
|
434
|
+
});
|
|
401
435
|
useFormContext({
|
|
402
436
|
dataSource: computed(() => {
|
|
403
437
|
return props.dataSource;
|
|
@@ -441,7 +475,7 @@ const __sfc_main__ = Object.assign({
|
|
|
441
475
|
_createVNode(Header, {
|
|
442
476
|
columns: myColumns.value,
|
|
443
477
|
searchColumns: __props.searchColumns,
|
|
444
|
-
style: _normalizeStyle({ width: tableStyle.width })
|
|
478
|
+
style: _normalizeStyle({ width: tableStyle.width, transform: `translateX(-${horizontalScrollLeft.value}px)` })
|
|
445
479
|
}, null, 8 /* PROPS */, ["columns", "searchColumns", "style"])
|
|
446
480
|
], 4 /* STYLE */),
|
|
447
481
|
_createElementVNode("div", {
|
|
@@ -461,6 +495,7 @@ const __sfc_main__ = Object.assign({
|
|
|
461
495
|
openGroup: _ctx.openGroup,
|
|
462
496
|
rowSelection: _ctx.rowSelection,
|
|
463
497
|
readonly: __props.readonly,
|
|
498
|
+
width: horizontalScrollWidth.value,
|
|
464
499
|
onScrollDown: onScrollDown
|
|
465
500
|
}, _createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
466
501
|
_renderList(_unref(slots), (_, name) => {
|
|
@@ -471,12 +506,32 @@ const __sfc_main__ = Object.assign({
|
|
|
471
506
|
])
|
|
472
507
|
};
|
|
473
508
|
})
|
|
474
|
-
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["dataSource", "columns", "cellHeight", "height", "disableMenu", "rowKey", "groupKey", "openGroup", "rowSelection", "readonly"]),
|
|
509
|
+
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["dataSource", "columns", "cellHeight", "height", "disableMenu", "rowKey", "groupKey", "openGroup", "rowSelection", "readonly", "width"]),
|
|
475
510
|
_renderSlot(_ctx.$slots, "bodyExtra")
|
|
476
511
|
], 4 /* STYLE */),
|
|
512
|
+
(showScroll.value)
|
|
513
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_3, [
|
|
514
|
+
_createElementVNode("div", {
|
|
515
|
+
class: "jetlinks-table-horizontal-scroll-bar",
|
|
516
|
+
ref_key: "scrollBarRef",
|
|
517
|
+
ref: scrollBarRef,
|
|
518
|
+
style: _normalizeStyle({
|
|
519
|
+
width: 'calc(100% - 15px)',
|
|
520
|
+
height: '100%',
|
|
521
|
+
overflowX: 'scroll'
|
|
522
|
+
}),
|
|
523
|
+
onScroll: onHorizontalScroll
|
|
524
|
+
}, [
|
|
525
|
+
_createElementVNode("div", {
|
|
526
|
+
style: _normalizeStyle({ minWidth: horizontalScrollWidth.value + 'px', maxWidth: horizontalScrollWidth.value + 'px', height: '100%' })
|
|
527
|
+
}, null, 4 /* STYLE */)
|
|
528
|
+
], 36 /* STYLE, NEED_HYDRATION */),
|
|
529
|
+
_hoisted_4
|
|
530
|
+
]))
|
|
531
|
+
: _createCommentVNode("v-if", true),
|
|
477
532
|
(_ctx.dataSource.length && _ctx.openGroup)
|
|
478
533
|
? (_openBlock(), _createBlock(Group, {
|
|
479
|
-
key:
|
|
534
|
+
key: 1,
|
|
480
535
|
activeKey: _unref(groupActive).value,
|
|
481
536
|
"onUpdate:activeKey": _cache[0] || (_cache[0] = $event => ((_unref(groupActive).value) = $event)),
|
|
482
537
|
options: _unref(groupOptions),
|
package/lib/EditTable/Header.js
CHANGED
|
@@ -23,27 +23,33 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
23
23
|
"Sort": "setup-maybe-ref",
|
|
24
24
|
"reactive": "setup-const",
|
|
25
25
|
"defineOptions": "setup-const",
|
|
26
|
+
"useHScroll": "setup-maybe-ref",
|
|
26
27
|
"useTableTool": "setup-maybe-ref",
|
|
28
|
+
"HeaderItemRender": "setup-const",
|
|
27
29
|
"props": "setup-reactive-const",
|
|
28
30
|
"tableTool": "setup-maybe-ref",
|
|
31
|
+
"hScroll": "setup-maybe-ref",
|
|
29
32
|
"searchData": "setup-reactive-const",
|
|
30
33
|
"showFilter": "setup-const",
|
|
31
34
|
"sortClick": "setup-const"
|
|
32
35
|
} */
|
|
33
|
-
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock,
|
|
36
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, unref as _unref, mergeProps as _mergeProps, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
|
|
34
37
|
const _hoisted_1 = ["id"];
|
|
35
38
|
const _hoisted_2 = { class: "table-header-cell-title" };
|
|
36
|
-
const _hoisted_3 = {
|
|
39
|
+
const _hoisted_3 = { class: "cell-title-box" };
|
|
40
|
+
const _hoisted_4 = { key: 1 };
|
|
41
|
+
const _hoisted_5 = {
|
|
37
42
|
key: 0,
|
|
38
43
|
class: "header-cell-required"
|
|
39
44
|
};
|
|
40
|
-
const
|
|
45
|
+
const _hoisted_6 = {
|
|
41
46
|
key: 0,
|
|
42
47
|
class: "table-header-cell-trigger"
|
|
43
48
|
};
|
|
44
49
|
import { SearchModal, Sort } from './components/Search';
|
|
45
50
|
import { reactive, } from 'vue';
|
|
46
|
-
import { useTableTool } from "./hooks";
|
|
51
|
+
import { useHScroll, useTableTool } from "./hooks";
|
|
52
|
+
import HeaderItemRender from './HeaderRender.js';
|
|
47
53
|
const __sfc_main__ = Object.assign({
|
|
48
54
|
name: 'JEditTableHeader'
|
|
49
55
|
}, {
|
|
@@ -68,6 +74,7 @@ const __sfc_main__ = Object.assign({
|
|
|
68
74
|
setup(__props) {
|
|
69
75
|
const props = __props;
|
|
70
76
|
const tableTool = useTableTool();
|
|
77
|
+
const hScroll = useHScroll();
|
|
71
78
|
const searchData = reactive({
|
|
72
79
|
visible: false,
|
|
73
80
|
key: undefined
|
|
@@ -95,13 +102,21 @@ const __sfc_main__ = Object.assign({
|
|
|
95
102
|
class: _normalizeClass({ 'jetlinks-edit-table-header-cell-box': true, 'header-cell-box-tool': !!(item.sort || item.filter) })
|
|
96
103
|
}, [
|
|
97
104
|
_createElementVNode("div", _hoisted_2, [
|
|
98
|
-
_createElementVNode("
|
|
105
|
+
_createElementVNode("div", _hoisted_3, [
|
|
106
|
+
(item.render)
|
|
107
|
+
? (_openBlock(), _createBlock(HeaderItemRender, {
|
|
108
|
+
key: 0,
|
|
109
|
+
"render-fn": item.render,
|
|
110
|
+
value: item.title
|
|
111
|
+
}, null, 8 /* PROPS */, ["render-fn", "value"]))
|
|
112
|
+
: (_openBlock(), _createElementBlock("span", _hoisted_4, _toDisplayString(item.title), 1 /* TEXT */))
|
|
113
|
+
]),
|
|
99
114
|
(_optionalChain([item, 'access', _ => _.form, 'optionalAccess', _2 => _2.required]))
|
|
100
|
-
? (_openBlock(), _createElementBlock("span",
|
|
115
|
+
? (_openBlock(), _createElementBlock("span", _hoisted_5, "*"))
|
|
101
116
|
: _createCommentVNode("v-if", true)
|
|
102
117
|
]),
|
|
103
118
|
(!!(item.sort || item.filter))
|
|
104
|
-
? (_openBlock(), _createElementBlock("div",
|
|
119
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_6, [
|
|
105
120
|
(item.filter)
|
|
106
121
|
? (_openBlock(), _createBlock(_component_AIcon, {
|
|
107
122
|
key: 0,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Analyzed bindings: {} */
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
const __sfc_main__ = defineComponent({
|
|
4
|
+
name: "HeaderItemRender",
|
|
5
|
+
props: ['renderFn', 'value'],
|
|
6
|
+
setup(props) {
|
|
7
|
+
return () => {
|
|
8
|
+
return props.renderFn(props.value);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export default __sfc_main__;
|
|
@@ -42,7 +42,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
42
42
|
"onDesc": "setup-const"
|
|
43
43
|
} */
|
|
44
44
|
import { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
45
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
45
|
+
const _withScopeId = n => (_pushScopeId("data-v-1744796323717"), n = n(), _popScopeId(), n);
|
|
46
46
|
const _hoisted_1 = { class: "jetlinks-table-sort-content" };
|
|
47
47
|
const _hoisted_2 = { class: "jetlinks-table-sort-title" };
|
|
48
48
|
const _hoisted_3 = { class: "table-sort-body" };
|
package/lib/EditTable/consts.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TABLE_WRAPPER = exports.TABLE_TOOL = exports.TABLE_OPEN_GROUP = exports.TABLE_GROUP_OPTIONS = exports.TABLE_GROUP_ERROR = exports.TABLE_GROUP_ACTIVE = exports.TABLE_FORM_ITEM_ERROR = exports.TABLE_ERROR = exports.TABLE_DATA_SOURCE = exports.RIGHT_MENU = exports.METADATA_GROUP_OPTIONS = exports.FULL_SCREEN = void 0;
|
|
6
|
+
exports.TABLE_WRAPPER = exports.TABLE_TOOL = exports.TABLE_OPEN_GROUP = exports.TABLE_H_SCROLL = exports.TABLE_GROUP_OPTIONS = exports.TABLE_GROUP_ERROR = exports.TABLE_GROUP_ACTIVE = exports.TABLE_FORM_ITEM_ERROR = exports.TABLE_ERROR = exports.TABLE_DATA_SOURCE = exports.RIGHT_MENU = exports.METADATA_GROUP_OPTIONS = exports.FULL_SCREEN = void 0;
|
|
7
7
|
var METADATA_GROUP_OPTIONS = exports.METADATA_GROUP_OPTIONS = Symbol('metadata-group-options');
|
|
8
8
|
var TABLE_WRAPPER = exports.TABLE_WRAPPER = Symbol('table-wrapper');
|
|
9
9
|
var FULL_SCREEN = exports.FULL_SCREEN = Symbol('full');
|
|
@@ -15,4 +15,5 @@ var TABLE_DATA_SOURCE = exports.TABLE_DATA_SOURCE = Symbol('table-data-source');
|
|
|
15
15
|
var TABLE_OPEN_GROUP = exports.TABLE_OPEN_GROUP = Symbol('table-open-group');
|
|
16
16
|
var TABLE_TOOL = exports.TABLE_TOOL = Symbol('table-tool');
|
|
17
17
|
var TABLE_FORM_ITEM_ERROR = exports.TABLE_FORM_ITEM_ERROR = Symbol('table-form-item-error');
|
|
18
|
-
var TABLE_GROUP_ACTIVE = exports.TABLE_GROUP_ACTIVE = Symbol('table-group-active');
|
|
18
|
+
var TABLE_GROUP_ACTIVE = exports.TABLE_GROUP_ACTIVE = Symbol('table-group-active');
|
|
19
|
+
var TABLE_H_SCROLL = exports.TABLE_H_SCROLL = Symbol('table-h-scroll');
|
|
@@ -12,9 +12,10 @@ var _exportNames = {
|
|
|
12
12
|
useTableDataSource: true,
|
|
13
13
|
useTableTool: true,
|
|
14
14
|
useFormItemError: true,
|
|
15
|
-
useTableFullScreen: true
|
|
15
|
+
useTableFullScreen: true,
|
|
16
|
+
useHScroll: true
|
|
16
17
|
};
|
|
17
|
-
exports.useTableWrapper = exports.useTableTool = exports.useTableFullScreen = exports.useTableDataSource = exports.useRightMenuContext = exports.useInjectForm = exports.useInjectError = exports.useFormItemError = exports.useFormContext = void 0;
|
|
18
|
+
exports.useTableWrapper = exports.useTableTool = exports.useTableFullScreen = exports.useTableDataSource = exports.useRightMenuContext = exports.useInjectForm = exports.useInjectError = exports.useHScroll = exports.useFormItemError = exports.useFormContext = void 0;
|
|
18
19
|
var _vue = require("vue");
|
|
19
20
|
var _consts = require("../consts");
|
|
20
21
|
var _useResizeObserver = require("./useResizeObserver");
|
|
@@ -88,4 +89,7 @@ var useFormItemError = exports.useFormItemError = function useFormItemError() {
|
|
|
88
89
|
};
|
|
89
90
|
var useTableFullScreen = exports.useTableFullScreen = function useTableFullScreen() {
|
|
90
91
|
return (0, _vue.inject)(_consts.FULL_SCREEN);
|
|
92
|
+
};
|
|
93
|
+
var useHScroll = exports.useHScroll = function useHScroll() {
|
|
94
|
+
return (0, _vue.inject)(_consts.TABLE_H_SCROLL);
|
|
91
95
|
};
|
package/lib/EditTable/props.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
flex-shrink: 0;
|
|
18
18
|
background: #fafafa;
|
|
19
19
|
transition: background-color 0.3s ease;
|
|
20
|
+
overflow: auto hidden;
|
|
20
21
|
}
|
|
21
22
|
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-edit-table-header {
|
|
22
23
|
overflow: hidden;
|
|
@@ -31,6 +32,17 @@
|
|
|
31
32
|
flex: 1 1 auto;
|
|
32
33
|
flex-direction: row;
|
|
33
34
|
}
|
|
35
|
+
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-table-horizontal-scroll {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 10px;
|
|
38
|
+
min-height: 10px;
|
|
39
|
+
max-height: 10px;
|
|
40
|
+
display: flex;
|
|
41
|
+
}
|
|
42
|
+
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-table-horizontal-scroll .jetlinks-table-horizontal-scroll-bar {
|
|
43
|
+
height: 100%;
|
|
44
|
+
overflow-x: scroll;
|
|
45
|
+
}
|
|
34
46
|
.jetlinks-edit-table-body-viewport {
|
|
35
47
|
max-height: 100%;
|
|
36
48
|
width: 100%;
|
|
@@ -56,7 +68,6 @@
|
|
|
56
68
|
}
|
|
57
69
|
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row {
|
|
58
70
|
width: 100%;
|
|
59
|
-
display: flex;
|
|
60
71
|
align-items: center;
|
|
61
72
|
transition: top 0.2s, height 0.2s, background-color 0.1s;
|
|
62
73
|
border-bottom: 1px solid #ebebeb;
|
|
@@ -116,6 +127,10 @@
|
|
|
116
127
|
display: flex;
|
|
117
128
|
align-items: center;
|
|
118
129
|
font-weight: 600;
|
|
130
|
+
gap: 4px;
|
|
131
|
+
}
|
|
132
|
+
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .table-header-cell-title .cell-title-box {
|
|
133
|
+
flex: 1 1 auto;
|
|
119
134
|
}
|
|
120
135
|
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box .header-cell-required {
|
|
121
136
|
color: #ff4d4f;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
flex-shrink: 0;
|
|
15
15
|
background: #fafafa;
|
|
16
16
|
transition: background-color .3s ease;
|
|
17
|
+
overflow: auto hidden;
|
|
17
18
|
|
|
18
19
|
.jetlinks-edit-table-header {
|
|
19
20
|
overflow: hidden;
|
|
@@ -29,5 +30,18 @@
|
|
|
29
30
|
flex: 1 1 auto;
|
|
30
31
|
flex-direction: row;
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
.jetlinks-table-horizontal-scroll {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 10px;
|
|
37
|
+
min-height: 10px;
|
|
38
|
+
max-height: 10px;
|
|
39
|
+
display: flex;
|
|
40
|
+
|
|
41
|
+
.jetlinks-table-horizontal-scroll-bar {
|
|
42
|
+
height: 100%;
|
|
43
|
+
overflow-x: scroll;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
32
46
|
}
|
|
33
47
|
}
|
package/lib/EditTable/utils.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.isFullScreen = exports.handlePureRecord = exports.handleColumnsWidth = exports.collectValidateRules = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
7
|
var _lodashEs = require("lodash");
|
|
10
8
|
/**
|
|
11
9
|
* 规则收集器,收集columns中的rules和watch
|
|
@@ -30,7 +28,8 @@ var handlePureRecord = exports.handlePureRecord = function handlePureRecord(reco
|
|
|
30
28
|
return (0, _lodashEs.omit)(record, ['__serial', '__index', '__top', '__selected', '__key', '__dataIndex']);
|
|
31
29
|
};
|
|
32
30
|
var handleColumnsWidth = exports.handleColumnsWidth = function handleColumnsWidth(columns, warpWidth) {
|
|
33
|
-
|
|
31
|
+
// let newColumns = [...columns]
|
|
32
|
+
var newColumns = (0, _lodashEs.cloneDeep)(columns);
|
|
34
33
|
var noWidthLen = 0; // 没有width属性的长度
|
|
35
34
|
var hasWidthCount = 0; // 有width属性的合计
|
|
36
35
|
var average = 0; // 每个column宽度
|
package/lib/FullPage/FullPage.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
} */
|
|
10
10
|
import { defineComponent as _defineComponent } from 'vue';
|
|
11
11
|
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
12
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
12
|
+
const _withScopeId = n => (_pushScopeId("data-v-1744796320097"), n = n(), _popScopeId(), n);
|
|
13
13
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
14
14
|
import { ref, inject } from 'vue';
|
|
15
15
|
import { useElementBounding } from '@vueuse/core';
|