@jetlinks-web/components 2.4.25 → 2.5.1
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 +91 -181
- package/es/EditTable/EditTable.js +179 -105
- package/es/EditTable/FormItem.js +3 -4
- package/es/EditTable/Header.js +56 -164
- package/es/EditTable/components/ContextMenu/Menu.js +11 -7
- package/es/EditTable/components/Search/index.js +2 -1
- package/es/EditTable/components/Search/{Search.js → search.js} +94 -66
- package/es/EditTable/components/Search/sort.js +214 -0
- package/es/EditTable/consts.js +6 -1
- package/es/EditTable/context.js +50 -0
- package/es/EditTable/group.js +355 -0
- package/es/EditTable/hooks/index.js +1 -0
- package/es/EditTable/hooks/useGroup.js +44 -0
- package/es/EditTable/props.js +14 -4
- package/es/EditTable/style/body.less +17 -27
- package/es/EditTable/style/form.less +33 -0
- package/es/EditTable/style/group.less +32 -0
- package/es/EditTable/style/header.less +16 -21
- package/es/EditTable/style/index.css +103 -66
- package/es/EditTable/style/index.less +3 -0
- package/es/EditTable/style/menu.less +25 -0
- package/es/EditTable/style/table.less +2 -11
- package/es/EditTable/utils.js +22 -50
- package/es/FullPage/FullPage.js +1 -1
- package/es/PermissionButton/index.js +40 -20
- package/es/RadioButton/RadioButton.js +1 -1
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/Search/Search.js +1 -1
- package/es/locale/en-US.js +39 -3
- package/es/locale/zh-CN.js +36 -0
- package/es/style/index.css +103 -66
- package/lib/EditTable/Body.js +91 -181
- package/lib/EditTable/EditTable.js +179 -105
- package/lib/EditTable/FormItem.js +3 -4
- package/lib/EditTable/Header.js +56 -164
- package/lib/EditTable/components/ContextMenu/Menu.js +11 -7
- package/lib/EditTable/components/Search/index.js +10 -3
- package/lib/EditTable/components/Search/{Search.js → search.js} +94 -66
- package/lib/EditTable/components/Search/sort.js +214 -0
- package/lib/EditTable/consts.js +7 -2
- package/lib/EditTable/context.js +56 -0
- package/lib/EditTable/group.js +355 -0
- package/lib/EditTable/hooks/index.js +12 -0
- package/lib/EditTable/hooks/useGroup.js +50 -0
- package/lib/EditTable/props.js +14 -4
- package/lib/EditTable/style/body.less +17 -27
- package/lib/EditTable/style/form.less +33 -0
- package/lib/EditTable/style/group.less +32 -0
- package/lib/EditTable/style/header.less +16 -21
- package/lib/EditTable/style/index.css +103 -66
- package/lib/EditTable/style/index.less +3 -0
- package/lib/EditTable/style/menu.less +25 -0
- package/lib/EditTable/style/table.less +2 -11
- package/lib/EditTable/utils.js +23 -51
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/PermissionButton/index.js +40 -20
- package/lib/RadioButton/RadioButton.js +1 -1
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/Search/Search.js +1 -1
- package/lib/locale/en-US.js +39 -3
- package/lib/locale/zh-CN.js +36 -0
- package/lib/style/index.css +103 -66
- package/package.json +2 -2
package/es/style/index.css
CHANGED
|
@@ -4838,19 +4838,12 @@ span.ant-radio + * {
|
|
|
4838
4838
|
flex-direction: column;
|
|
4839
4839
|
flex-grow: 0;
|
|
4840
4840
|
flex-shrink: 0;
|
|
4841
|
+
background: #fafafa;
|
|
4842
|
+
transition: background-color 0.3s ease;
|
|
4841
4843
|
}
|
|
4842
4844
|
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-edit-table-header {
|
|
4843
4845
|
overflow: hidden;
|
|
4844
4846
|
width: 100%;
|
|
4845
|
-
position: relative;
|
|
4846
|
-
}
|
|
4847
|
-
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-edit-table-header .jetlinks-edit-table-header-scroll-hidden {
|
|
4848
|
-
position: absolute;
|
|
4849
|
-
top: 0;
|
|
4850
|
-
right: 0;
|
|
4851
|
-
bottom: 0;
|
|
4852
|
-
z-index: 5;
|
|
4853
|
-
background: #fafafa;
|
|
4854
4847
|
}
|
|
4855
4848
|
.jetlinks-edit-table-wrapper .jetlinks-edit-table .jetlinks-edit-table-body {
|
|
4856
4849
|
background-color: #fff;
|
|
@@ -4875,62 +4868,43 @@ span.ant-radio + * {
|
|
|
4875
4868
|
z-index: -1;
|
|
4876
4869
|
}
|
|
4877
4870
|
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-body-container {
|
|
4878
|
-
|
|
4871
|
+
overflow: hidden;
|
|
4872
|
+
height: 100%;
|
|
4879
4873
|
}
|
|
4880
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center
|
|
4881
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-left,
|
|
4882
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-right {
|
|
4874
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center {
|
|
4883
4875
|
position: relative;
|
|
4876
|
+
flex: 1 1 auto;
|
|
4884
4877
|
min-width: 0;
|
|
4885
4878
|
height: 100%;
|
|
4886
|
-
z-index: 5;
|
|
4887
|
-
flex-shrink: 0;
|
|
4888
|
-
flex-grow: 0;
|
|
4889
4879
|
}
|
|
4890
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row
|
|
4891
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-left .jetlinks-edit-table-row,
|
|
4892
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-right .jetlinks-edit-table-row {
|
|
4880
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row {
|
|
4893
4881
|
width: 100%;
|
|
4894
4882
|
display: flex;
|
|
4895
4883
|
align-items: center;
|
|
4896
4884
|
transition: top 0.2s, height 0.2s, background-color 0.1s;
|
|
4897
4885
|
border-bottom: 1px solid #ebebeb;
|
|
4898
|
-
background-color: #fff;
|
|
4899
4886
|
}
|
|
4900
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row.jetlinks-edit-table-
|
|
4901
|
-
|
|
4902
|
-
|
|
4887
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row .jetlinks-edit-table-cell {
|
|
4888
|
+
position: absolute;
|
|
4889
|
+
min-width: 0;
|
|
4890
|
+
}
|
|
4891
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row:hover {
|
|
4903
4892
|
background-color: #f8f8f8;
|
|
4904
4893
|
}
|
|
4905
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row.jetlinks-edit-table-row-selected
|
|
4906
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-left .jetlinks-edit-table-row.jetlinks-edit-table-row-selected,
|
|
4907
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-right .jetlinks-edit-table-row.jetlinks-edit-table-row-selected {
|
|
4894
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row.jetlinks-edit-table-row-selected {
|
|
4908
4895
|
background-color: var(--ant-primary-1);
|
|
4909
4896
|
}
|
|
4910
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row .
|
|
4911
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-left .jetlinks-edit-table-row .jetlinks-edit-table-cell,
|
|
4912
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-right .jetlinks-edit-table-row .jetlinks-edit-table-cell {
|
|
4913
|
-
min-width: 0;
|
|
4914
|
-
}
|
|
4915
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row .body-cell-box,
|
|
4916
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-left .jetlinks-edit-table-row .body-cell-box,
|
|
4917
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-right .jetlinks-edit-table-row .body-cell-box {
|
|
4897
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row .body-cell-box {
|
|
4918
4898
|
padding: 0 12px;
|
|
4919
4899
|
position: relative;
|
|
4920
4900
|
}
|
|
4921
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-
|
|
4922
|
-
position:
|
|
4901
|
+
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center .jetlinks-edit-table-row .readonly-mask {
|
|
4902
|
+
position: absolute;
|
|
4903
|
+
top: 0;
|
|
4923
4904
|
left: 0;
|
|
4924
|
-
}
|
|
4925
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-right {
|
|
4926
|
-
position: sticky;
|
|
4927
4905
|
right: 0;
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
z-index: 1;
|
|
4931
|
-
}
|
|
4932
|
-
.jetlinks-edit-table-body-viewport .jetlinks-edit-table-center > div {
|
|
4933
|
-
position: relative;
|
|
4906
|
+
bottom: 0;
|
|
4907
|
+
z-index: 4;
|
|
4934
4908
|
}
|
|
4935
4909
|
.jetlinks-edit-table-body-empty {
|
|
4936
4910
|
display: flex;
|
|
@@ -4941,25 +4915,6 @@ span.ant-radio + * {
|
|
|
4941
4915
|
.jetlinks-edit-table-header-container {
|
|
4942
4916
|
height: 100%;
|
|
4943
4917
|
position: relative;
|
|
4944
|
-
display: flex;
|
|
4945
|
-
width: 100%;
|
|
4946
|
-
}
|
|
4947
|
-
.jetlinks-edit-table-header-container .jetlinks-header-left,
|
|
4948
|
-
.jetlinks-edit-table-header-container .jetlinks-header-center,
|
|
4949
|
-
.jetlinks-edit-table-header-container .jetlinks-header-right {
|
|
4950
|
-
position: relative;
|
|
4951
|
-
z-index: 5;
|
|
4952
|
-
min-width: 0;
|
|
4953
|
-
height: 100%;
|
|
4954
|
-
width: 100%;
|
|
4955
|
-
background: #fafafa;
|
|
4956
|
-
}
|
|
4957
|
-
.jetlinks-edit-table-header-container .jetlinks-header-center {
|
|
4958
|
-
z-index: 2;
|
|
4959
|
-
}
|
|
4960
|
-
.jetlinks-edit-table-header-container .jetlinks-header-center > div {
|
|
4961
|
-
position: relative;
|
|
4962
|
-
height: 100%;
|
|
4963
4918
|
}
|
|
4964
4919
|
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell {
|
|
4965
4920
|
height: 100%;
|
|
@@ -4967,12 +4922,12 @@ span.ant-radio + * {
|
|
|
4967
4922
|
align-items: center;
|
|
4968
4923
|
float: left;
|
|
4969
4924
|
overflow: visible;
|
|
4970
|
-
|
|
4925
|
+
position: absolute;
|
|
4926
|
+
top: 0;
|
|
4971
4927
|
}
|
|
4972
4928
|
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box {
|
|
4973
4929
|
padding: 0 12px;
|
|
4974
4930
|
width: 100%;
|
|
4975
|
-
position: relative;
|
|
4976
4931
|
}
|
|
4977
4932
|
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box.header-cell-box-tool {
|
|
4978
4933
|
display: flex;
|
|
@@ -5006,6 +4961,88 @@ span.ant-radio + * {
|
|
|
5006
4961
|
.jetlinks-edit-table-header-container .jetlinks-edit-table-header-cell .jetlinks-edit-table-header-cell-box:not(:last-child)::before {
|
|
5007
4962
|
background-color: transparent;
|
|
5008
4963
|
}
|
|
4964
|
+
.jetlinks-table-search .jetlinks-table-search-header {
|
|
4965
|
+
display: flex;
|
|
4966
|
+
justify-content: space-between;
|
|
4967
|
+
}
|
|
4968
|
+
.jetlinks-table-search .jetlinks-table-search-header .jetlinks-drag-modal-footer {
|
|
4969
|
+
display: none;
|
|
4970
|
+
}
|
|
4971
|
+
.jetlinks-table-search .jetlinks-table-search-header .jetlinks-table-search-result-total {
|
|
4972
|
+
color: #1890ff;
|
|
4973
|
+
}
|
|
4974
|
+
.jetlinks-table-group-warp .ant-tabs-nav {
|
|
4975
|
+
margin-bottom: 0;
|
|
4976
|
+
}
|
|
4977
|
+
.jetlinks-table-group-warp .ant-tabs-nav .ant-tabs-tab {
|
|
4978
|
+
overflow: hidden;
|
|
4979
|
+
position: relative;
|
|
4980
|
+
}
|
|
4981
|
+
.jetlinks-table-group-warp .ant-tabs-nav .ant-tabs-tab-active {
|
|
4982
|
+
background-color: #BAE0FF !important;
|
|
4983
|
+
border-color: #91CAFF !important;
|
|
4984
|
+
}
|
|
4985
|
+
.jetlinks-table-group-warp .ant-tabs-nav .ant-tabs-nav-add {
|
|
4986
|
+
border: none;
|
|
4987
|
+
}
|
|
4988
|
+
.jetlinks-table-group-error-warp {
|
|
4989
|
+
color: #1a1a1a !important;
|
|
4990
|
+
}
|
|
4991
|
+
.jetlinks-table-group-error-warp .table-group-error-target {
|
|
4992
|
+
position: absolute;
|
|
4993
|
+
right: 0;
|
|
4994
|
+
top: 0;
|
|
4995
|
+
border: 16px solid transparent;
|
|
4996
|
+
border-top-color: #ff4d4f;
|
|
4997
|
+
border-right-width: 0;
|
|
4998
|
+
border-bottom-width: 0;
|
|
4999
|
+
}
|
|
5000
|
+
.jetlinks-table-form-error-target {
|
|
5001
|
+
position: absolute;
|
|
5002
|
+
right: 2px;
|
|
5003
|
+
top: -9px;
|
|
5004
|
+
border: 16px solid transparent;
|
|
5005
|
+
border-top-color: #ff4d4f;
|
|
5006
|
+
border-right-width: 0;
|
|
5007
|
+
border-bottom-width: 0;
|
|
5008
|
+
}
|
|
5009
|
+
.jetlinks-edit-table-form-has-error .select-no-value .ant-select-selector {
|
|
5010
|
+
border-color: #ff4d4f !important;
|
|
5011
|
+
}
|
|
5012
|
+
.jetlinks-edit-table-form-has-error .select-no-value .ant-select-selector:focus {
|
|
5013
|
+
box-shadow: 0 0 0 2px var(--ant-error-color-outline) !important;
|
|
5014
|
+
}
|
|
5015
|
+
.jetlinks-edit-table-form-has-error > input {
|
|
5016
|
+
border-color: #ff4d4f !important;
|
|
5017
|
+
}
|
|
5018
|
+
.jetlinks-edit-table-form-has-error > input:focus {
|
|
5019
|
+
box-shadow: 0 0 0 2px var(--ant-error-color-outline) !important;
|
|
5020
|
+
}
|
|
5021
|
+
.jetlinks-edit-table-form-has-error .jetlinks-table-form-required-aicon {
|
|
5022
|
+
color: #ff4d4f;
|
|
5023
|
+
}
|
|
5024
|
+
.jetlinks-edit-table-context-menu {
|
|
5025
|
+
position: fixed;
|
|
5026
|
+
box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
|
|
5027
|
+
border-radius: 4px;
|
|
5028
|
+
overflow: hidden;
|
|
5029
|
+
width: 192px;
|
|
5030
|
+
padding: 4px;
|
|
5031
|
+
background-color: #fff;
|
|
5032
|
+
}
|
|
5033
|
+
.jetlinks-edit-table-context-menu .ant-menu {
|
|
5034
|
+
border-right: none;
|
|
5035
|
+
}
|
|
5036
|
+
.jetlinks-edit-table-context-menu .ant-menu .ant-menu-item {
|
|
5037
|
+
margin: 0;
|
|
5038
|
+
height: 32px;
|
|
5039
|
+
}
|
|
5040
|
+
.jetlinks-edit-table-context-menu .ant-menu .ant-menu-item.danger {
|
|
5041
|
+
color: #ff4d4f;
|
|
5042
|
+
}
|
|
5043
|
+
.jetlinks-edit-table-context-menu .ant-menu-item-active {
|
|
5044
|
+
background-color: var(--ant-primary-1);
|
|
5045
|
+
}
|
|
5009
5046
|
.edit-table-search-header {
|
|
5010
5047
|
display: flex;
|
|
5011
5048
|
justify-content: space-between;
|
package/lib/EditTable/Body.js
CHANGED
|
@@ -16,12 +16,11 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
16
16
|
} return value; }
|
|
17
17
|
/* Analyzed bindings: {
|
|
18
18
|
"groupKey": "props",
|
|
19
|
+
"readonly": "props",
|
|
19
20
|
"ContextMenu": "setup-maybe-ref",
|
|
20
21
|
"useRightMenuContext": "setup-maybe-ref",
|
|
21
|
-
"useTableTool": "setup-maybe-ref",
|
|
22
22
|
"randomString": "setup-maybe-ref",
|
|
23
23
|
"bodyProps": "setup-maybe-ref",
|
|
24
|
-
"defaultProps": "setup-maybe-ref",
|
|
25
24
|
"ref": "setup-const",
|
|
26
25
|
"reactive": "setup-const",
|
|
27
26
|
"computed": "setup-const",
|
|
@@ -29,55 +28,59 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
29
28
|
"onMounted": "setup-const",
|
|
30
29
|
"onBeforeUnmount": "setup-const",
|
|
31
30
|
"nextTick": "setup-const",
|
|
32
|
-
"
|
|
31
|
+
"Empty": "setup-const",
|
|
33
32
|
"props": "setup-reactive-const",
|
|
34
33
|
"emit": "setup-const",
|
|
35
34
|
"viewScrollRef": "setup-ref",
|
|
35
|
+
"tableCenterRef": "setup-ref",
|
|
36
36
|
"virtualRang": "setup-reactive-const",
|
|
37
37
|
"containerStyle": "setup-ref",
|
|
38
38
|
"context": "setup-maybe-ref",
|
|
39
|
-
"
|
|
40
|
-
"selectedRowKeys": "setup-ref",
|
|
41
|
-
"hoverKeys": "setup-ref",
|
|
42
|
-
"scrollLock": "setup-ref",
|
|
39
|
+
"scrollLock": "setup-let",
|
|
43
40
|
"menuInstance": "setup-let",
|
|
44
41
|
"maxLen": "setup-ref",
|
|
42
|
+
"selectedRowKeys": "setup-ref",
|
|
45
43
|
"virtualData": "setup-ref",
|
|
46
|
-
"columnFixedMap": "setup-ref",
|
|
47
44
|
"onScroll": "setup-const",
|
|
48
45
|
"scrollTo": "setup-const",
|
|
49
46
|
"showContextMenu": "setup-const",
|
|
50
47
|
"rowClick": "setup-const",
|
|
51
|
-
"updateSelectedKeys": "setup-const"
|
|
52
|
-
"getViewScrollRef": "setup-const"
|
|
48
|
+
"updateSelectedKeys": "setup-const"
|
|
53
49
|
} */
|
|
54
|
-
import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode,
|
|
55
|
-
const _hoisted_1 = {
|
|
56
|
-
|
|
57
|
-
|
|
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";
|
|
51
|
+
const _hoisted_1 = { style: { position: 'relative' } };
|
|
52
|
+
const _hoisted_2 = ["data-row-key", "onContextmenu", "onClick"];
|
|
53
|
+
const _hoisted_3 = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "body-cell-box"
|
|
56
|
+
};
|
|
57
|
+
const _hoisted_4 = {
|
|
58
|
+
key: 1,
|
|
59
|
+
class: "body-cell-box"
|
|
60
|
+
};
|
|
61
|
+
const _hoisted_5 = {
|
|
62
|
+
key: 1,
|
|
63
|
+
class: "readonly-mask"
|
|
58
64
|
};
|
|
59
|
-
const
|
|
60
|
-
const _hoisted_3 = { class: "body-cell-box" };
|
|
61
|
-
const _hoisted_4 = ["data-row-key", "onContextmenu", "onClick", "onMouseover"];
|
|
62
|
-
const _hoisted_5 = { class: "body-cell-box" };
|
|
63
|
-
const _hoisted_6 = ["data-row-key", "onContextmenu", "onClick", "onMouseover"];
|
|
64
|
-
const _hoisted_7 = { class: "body-cell-box" };
|
|
65
|
-
const _hoisted_8 = { class: "jetlinks-edit-table-body-empty" };
|
|
65
|
+
const _hoisted_6 = { class: "jetlinks-edit-table-body-empty" };
|
|
66
66
|
import ContextMenu from './components/ContextMenu';
|
|
67
|
-
import { useRightMenuContext
|
|
67
|
+
import { useRightMenuContext } from "./hooks";
|
|
68
68
|
import { randomString } from "@jetlinks-web/utils";
|
|
69
|
-
import { bodyProps
|
|
69
|
+
import { bodyProps } from "./props";
|
|
70
70
|
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
|
71
|
-
import
|
|
71
|
+
import Empty from '../Empty/Empty.js';
|
|
72
72
|
const __sfc_main__ = Object.assign({
|
|
73
73
|
name: 'JEditTableBody'
|
|
74
74
|
}, {
|
|
75
75
|
props: {
|
|
76
|
-
...defaultProps(),
|
|
77
76
|
...bodyProps(),
|
|
78
77
|
groupKey: {
|
|
79
78
|
type: [String, Number],
|
|
80
79
|
default: undefined
|
|
80
|
+
},
|
|
81
|
+
readonly: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
81
84
|
}
|
|
82
85
|
},
|
|
83
86
|
emits: ['update:dataSource', 'scrollDown'],
|
|
@@ -85,23 +88,25 @@ const __sfc_main__ = Object.assign({
|
|
|
85
88
|
const props = __props;
|
|
86
89
|
const emit = __emit;
|
|
87
90
|
const viewScrollRef = ref();
|
|
91
|
+
const tableCenterRef = ref();
|
|
88
92
|
const virtualRang = reactive({
|
|
89
93
|
start: 0,
|
|
90
94
|
end: 15
|
|
91
95
|
});
|
|
92
96
|
const containerStyle = ref(0);
|
|
93
97
|
const context = useRightMenuContext();
|
|
94
|
-
|
|
95
|
-
const selectedRowKeys = ref([]);
|
|
96
|
-
const hoverKeys = ref();
|
|
97
|
-
const scrollLock = ref(false);
|
|
98
|
+
let scrollLock = ref(false);
|
|
98
99
|
let menuInstance;
|
|
99
100
|
const maxLen = computed(() => {
|
|
100
101
|
return Math.trunc(props.height / props.cellHeight);
|
|
101
102
|
});
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
103
|
+
const selectedRowKeys = ref([]);
|
|
104
|
+
const virtualData = computed(() => {
|
|
105
|
+
const array = props.dataSource.slice(virtualRang.start, virtualRang.end);
|
|
106
|
+
if (tableCenterRef.value) {
|
|
107
|
+
tableCenterRef.value.style.webkitTransform = `translate3d(0, ${virtualRang.start * props.cellHeight}px, 0)`;
|
|
108
|
+
}
|
|
109
|
+
return array;
|
|
105
110
|
});
|
|
106
111
|
const onScroll = () => {
|
|
107
112
|
if (!viewScrollRef.value)
|
|
@@ -118,17 +123,15 @@ const __sfc_main__ = Object.assign({
|
|
|
118
123
|
}
|
|
119
124
|
virtualRang.start = start;
|
|
120
125
|
virtualRang.end = end;
|
|
121
|
-
// updateVirtualData(start, end)
|
|
122
126
|
};
|
|
123
127
|
const scrollTo = (index) => {
|
|
124
128
|
if (viewScrollRef.value) {
|
|
125
|
-
|
|
126
|
-
viewScrollRef.value.scrollTop = top;
|
|
129
|
+
viewScrollRef.value.scrollTop = index * props.cellHeight;
|
|
127
130
|
}
|
|
128
131
|
};
|
|
129
132
|
const showContextMenu = (e, record, _index) => {
|
|
130
133
|
e.preventDefault();
|
|
131
|
-
if (
|
|
134
|
+
if (props.disableMenu) {
|
|
132
135
|
record = {
|
|
133
136
|
...record,
|
|
134
137
|
__index: _index
|
|
@@ -154,8 +157,16 @@ const __sfc_main__ = Object.assign({
|
|
|
154
157
|
const updateSelectedKeys = (keys) => {
|
|
155
158
|
selectedRowKeys.value = keys;
|
|
156
159
|
};
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
onMounted(() => {
|
|
161
|
+
nextTick(() => {
|
|
162
|
+
onScroll();
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
onBeforeUnmount(() => {
|
|
166
|
+
_optionalChain([menuInstance, 'optionalAccess', _6 => _6.destroy, 'call', _7 => _7()]);
|
|
167
|
+
_optionalChain([menuInstance, 'optionalAccess', _8 => _8.cleanCopy, 'call', _9 => _9()]);
|
|
168
|
+
});
|
|
169
|
+
watch(() => JSON.stringify(_optionalChain([props, 'access', _10 => _10.rowSelection, 'optionalAccess', _11 => _11.selectedRowKeys])), (val) => {
|
|
159
170
|
selectedRowKeys.value = JSON.parse(val || '[]');
|
|
160
171
|
}, { immediate: true });
|
|
161
172
|
watch(() => props.dataSource, (val, oldVal) => {
|
|
@@ -177,32 +188,23 @@ const __sfc_main__ = Object.assign({
|
|
|
177
188
|
emit('scrollDown', maxLen.value - props.dataSource.length + 3);
|
|
178
189
|
}
|
|
179
190
|
}, { immediate: true });
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
nextTick(() => {
|
|
185
|
-
onScroll();
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
onBeforeUnmount(() => {
|
|
189
|
-
_optionalChain([menuInstance, 'optionalAccess', _8 => _8.destroy, 'call', _9 => _9()]);
|
|
190
|
-
_optionalChain([menuInstance, 'optionalAccess', _10 => _10.cleanCopy, 'call', _11 => _11()]);
|
|
191
|
+
watch(() => props.groupKey, () => {
|
|
192
|
+
if (props.openGroup) {
|
|
193
|
+
scrollTo(0);
|
|
194
|
+
}
|
|
191
195
|
});
|
|
192
196
|
__expose({
|
|
193
197
|
scrollTo,
|
|
194
|
-
updateSelectedKeys
|
|
195
|
-
getViewScrollRef
|
|
198
|
+
updateSelectedKeys
|
|
196
199
|
});
|
|
197
200
|
return (_ctx, _cache) => {
|
|
198
|
-
const _component_j_empty = _resolveComponent("j-empty");
|
|
199
201
|
return (_ctx.dataSource.length)
|
|
200
202
|
? (_openBlock(), _createElementBlock("div", {
|
|
201
203
|
key: 0,
|
|
202
|
-
class: "jetlinks-edit-table-body-viewport",
|
|
203
|
-
style: _normalizeStyle({ ..._ctx.style, height: _ctx.height + 'px' }),
|
|
204
204
|
ref_key: "viewScrollRef",
|
|
205
205
|
ref: viewScrollRef,
|
|
206
|
+
class: "jetlinks-edit-table-body-viewport",
|
|
207
|
+
style: _normalizeStyle({ ..._ctx.style, height: _ctx.height + 'px' }),
|
|
206
208
|
onScroll: onScroll
|
|
207
209
|
}, [
|
|
208
210
|
_createElementVNode("div", _hoisted_1, [
|
|
@@ -210,157 +212,65 @@ const __sfc_main__ = Object.assign({
|
|
|
210
212
|
class: "jetlinks-edit-scrollbar",
|
|
211
213
|
style: _normalizeStyle(containerStyle.value)
|
|
212
214
|
}, null, 4 /* STYLE */),
|
|
213
|
-
(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
minWidth: columnFixedMap.value.left.width + 'px',
|
|
221
|
-
width: columnFixedMap.value.left.width + 'px',
|
|
222
|
-
boxShadow: _unref(tableTool).scrollMap.x ? '0 0 12px 0 rgba(0 ,0, 0, .2)' : ''
|
|
223
|
-
})
|
|
224
|
-
}, [
|
|
225
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(virtualData.value, (item, index) => {
|
|
215
|
+
_createElementVNode("div", {
|
|
216
|
+
class: "jetlinks-edit-table-center",
|
|
217
|
+
ref_key: "tableCenterRef",
|
|
218
|
+
ref: tableCenterRef
|
|
219
|
+
}, [
|
|
220
|
+
(virtualData.value.length)
|
|
221
|
+
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(virtualData.value, (item, index) => {
|
|
226
222
|
return (_openBlock(), _createElementBlock("div", {
|
|
227
223
|
class: _normalizeClass({
|
|
228
224
|
'jetlinks-edit-table-row': true,
|
|
229
|
-
'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)])
|
|
230
|
-
'jetlinks-edit-table-row-hover': hoverKeys.value === (item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
225
|
+
'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)])
|
|
231
226
|
}),
|
|
232
|
-
key:
|
|
233
|
-
style: _normalizeStyle({ height: `${_ctx.cellHeight}px
|
|
227
|
+
key: `record_${item.__key}`,
|
|
228
|
+
style: _normalizeStyle({ height: `${_ctx.cellHeight}px`, }),
|
|
234
229
|
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
235
230
|
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
236
|
-
onClick: _withModifiers(() => rowClick(item), ["stop"])
|
|
237
|
-
onMouseover: $event => (hoverKeys.value = (item[_ctx.rowKey] || virtualRang.start + index + 1)),
|
|
238
|
-
onMouseleave: _cache[0] || (_cache[0] = $event => (hoverKeys.value = undefined))
|
|
231
|
+
onClick: _withModifiers(() => rowClick(item), ["stop"])
|
|
239
232
|
}, [
|
|
240
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(
|
|
233
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.columns, (column, __index) => {
|
|
241
234
|
return (_openBlock(), _createElementBlock("div", {
|
|
242
235
|
class: "jetlinks-edit-table-cell",
|
|
243
236
|
style: _normalizeStyle({
|
|
244
|
-
width: `${column.
|
|
237
|
+
width: `${column.width}px`,
|
|
238
|
+
left: `${column.left || 200 * __index}px`,
|
|
245
239
|
})
|
|
246
240
|
}, [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2));
|
|
259
|
-
}), 128 /* KEYED_FRAGMENT */))
|
|
260
|
-
], 4 /* STYLE */))
|
|
261
|
-
: _createCommentVNode("v-if", true),
|
|
262
|
-
_createElementVNode("div", {
|
|
263
|
-
class: "jetlinks-edit-table-center",
|
|
264
|
-
style: _normalizeStyle({
|
|
265
|
-
webkitTransform: `translate3d(-${_unref(tableTool).scrollMap.x}px, ${virtualRang.start * props.cellHeight}px, 0)`
|
|
266
|
-
})
|
|
267
|
-
}, [
|
|
268
|
-
_createElementVNode("div", {
|
|
269
|
-
style: _normalizeStyle({ width: columnFixedMap.value.center.width + 'px' })
|
|
270
|
-
}, [
|
|
271
|
-
(virtualData.value.length)
|
|
272
|
-
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(virtualData.value, (item, index) => {
|
|
273
|
-
return (_openBlock(), _createElementBlock("div", {
|
|
274
|
-
class: _normalizeClass({
|
|
275
|
-
'jetlinks-edit-table-row': true,
|
|
276
|
-
'jetlinks-edit-table-row-selected': _optionalChain([selectedRowKeys, 'access', _15 => _15.value, 'optionalAccess', _16 => _16.includes, 'call', _17 => _17(item[_ctx.rowKey] || virtualRang.start + index + 1)]),
|
|
277
|
-
'jetlinks-edit-table-row-hover': hoverKeys.value === (item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
278
|
-
}),
|
|
279
|
-
key: 'center' + index,
|
|
280
|
-
style: _normalizeStyle({ height: `${_ctx.cellHeight}px`, }),
|
|
281
|
-
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
282
|
-
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
283
|
-
onClick: _withModifiers(() => rowClick(item), ["stop"]),
|
|
284
|
-
onMouseover: $event => (hoverKeys.value = (item[_ctx.rowKey] || virtualRang.start + index + 1)),
|
|
285
|
-
onMouseleave: _cache[1] || (_cache[1] = $event => (hoverKeys.value = undefined))
|
|
286
|
-
}, [
|
|
287
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(columnFixedMap.value.center.keys, (column) => {
|
|
288
|
-
return (_openBlock(), _createElementBlock("div", {
|
|
289
|
-
class: "jetlinks-edit-table-cell",
|
|
290
|
-
style: _normalizeStyle({
|
|
291
|
-
width: `${column._width}px`,
|
|
292
|
-
})
|
|
293
|
-
}, [
|
|
294
|
-
_createElementVNode("div", _hoisted_5, [
|
|
241
|
+
(column.dataIndex === '__serial')
|
|
242
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_3, [
|
|
243
|
+
_renderSlot(_ctx.$slots, "serial", {
|
|
244
|
+
record: item,
|
|
245
|
+
index: item.__dataIndex,
|
|
246
|
+
column: column
|
|
247
|
+
}, () => [
|
|
248
|
+
_createTextVNode(_toDisplayString(virtualRang.start + index + 1), 1 /* TEXT */)
|
|
249
|
+
])
|
|
250
|
+
]))
|
|
251
|
+
: (_openBlock(), _createElementBlock("div", _hoisted_4, [
|
|
295
252
|
_renderSlot(_ctx.$slots, column.dataIndex, {
|
|
296
253
|
record: item,
|
|
297
254
|
index: item.__dataIndex,
|
|
298
255
|
column: column
|
|
299
256
|
}, () => [
|
|
300
|
-
_createTextVNode(_toDisplayString(
|
|
257
|
+
_createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)
|
|
301
258
|
])
|
|
302
|
-
])
|
|
303
|
-
], 4 /* STYLE */));
|
|
304
|
-
}), 256 /* UNKEYED_FRAGMENT */))
|
|
305
|
-
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_4));
|
|
306
|
-
}), 128 /* KEYED_FRAGMENT */))
|
|
307
|
-
: _createCommentVNode("v-if", true)
|
|
308
|
-
], 4 /* STYLE */)
|
|
309
|
-
], 4 /* STYLE */),
|
|
310
|
-
(columnFixedMap.value.right.keys.length)
|
|
311
|
-
? (_openBlock(), _createElementBlock("div", {
|
|
312
|
-
key: 1,
|
|
313
|
-
class: "jetlinks-edit-table-right",
|
|
314
|
-
style: _normalizeStyle({
|
|
315
|
-
webkitTransform: `translate3d(0, ${virtualRang.start * props.cellHeight}px, 0)`,
|
|
316
|
-
maxWidth: columnFixedMap.value.right.width + 'px',
|
|
317
|
-
minWidth: columnFixedMap.value.right.width + 'px',
|
|
318
|
-
width: columnFixedMap.value.right.width + 'px',
|
|
319
|
-
boxShadow: _unref(tableTool).scrollMap.down !== 'right' ? '0 0 12px 0 rgba(0 ,0, 0, .2)' : ''
|
|
320
|
-
})
|
|
321
|
-
}, [
|
|
322
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(virtualData.value, (item, index) => {
|
|
323
|
-
return (_openBlock(), _createElementBlock("div", {
|
|
324
|
-
class: _normalizeClass({
|
|
325
|
-
'jetlinks-edit-table-row': true,
|
|
326
|
-
'jetlinks-edit-table-row-selected': _optionalChain([selectedRowKeys, 'access', _18 => _18.value, 'optionalAccess', _19 => _19.includes, 'call', _20 => _20(item[_ctx.rowKey] || virtualRang.start + index + 1)]),
|
|
327
|
-
'jetlinks-edit-table-row-hover': hoverKeys.value === (item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
328
|
-
}),
|
|
329
|
-
key: 'right' + index,
|
|
330
|
-
style: _normalizeStyle({ height: `${_ctx.cellHeight}px` }),
|
|
331
|
-
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
332
|
-
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
333
|
-
onClick: _withModifiers(() => rowClick(item), ["stop"]),
|
|
334
|
-
onMouseover: $event => (hoverKeys.value = (item[_ctx.rowKey] || virtualRang.start + index + 1)),
|
|
335
|
-
onMouseleave: _cache[2] || (_cache[2] = $event => (hoverKeys.value = undefined))
|
|
336
|
-
}, [
|
|
337
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(columnFixedMap.value.right.keys, (column) => {
|
|
338
|
-
return (_openBlock(), _createElementBlock("div", {
|
|
339
|
-
class: "jetlinks-edit-table-cell",
|
|
340
|
-
style: _normalizeStyle({
|
|
341
|
-
width: `${column._width}px`,
|
|
342
|
-
})
|
|
343
|
-
}, [
|
|
344
|
-
_createElementVNode("div", _hoisted_7, [
|
|
345
|
-
_renderSlot(_ctx.$slots, column.dataIndex, {
|
|
346
|
-
record: item,
|
|
347
|
-
index: item.__dataIndex,
|
|
348
|
-
column: column
|
|
349
|
-
}, () => [
|
|
350
|
-
_createTextVNode(_toDisplayString(column.dataIndex === '__serial' ? virtualRang.start + index + 1 : item[column.dataIndex]), 1 /* TEXT */)
|
|
351
|
-
])
|
|
352
|
-
])
|
|
259
|
+
]))
|
|
353
260
|
], 4 /* STYLE */));
|
|
354
261
|
}), 256 /* UNKEYED_FRAGMENT */))
|
|
355
|
-
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */,
|
|
262
|
+
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2));
|
|
356
263
|
}), 128 /* KEYED_FRAGMENT */))
|
|
357
|
-
|
|
358
|
-
|
|
264
|
+
: _createCommentVNode("v-if", true),
|
|
265
|
+
(__props.readonly)
|
|
266
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_5))
|
|
267
|
+
: _createCommentVNode("v-if", true)
|
|
268
|
+
], 512 /* NEED_PATCH */)
|
|
359
269
|
])
|
|
360
270
|
], 36 /* STYLE, NEED_HYDRATION */))
|
|
361
271
|
: _renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
362
|
-
_createElementVNode("div",
|
|
363
|
-
_createVNode(
|
|
272
|
+
_createElementVNode("div", _hoisted_6, [
|
|
273
|
+
_createVNode(Empty)
|
|
364
274
|
])
|
|
365
275
|
]);
|
|
366
276
|
};
|