@jetlinks-web/components 2.0.37 → 2.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/es/CardSelect/style/index.js +1 -0
  2. package/es/CheckButton/style/index.js +1 -0
  3. package/es/DragModal/DragModal.js +307 -0
  4. package/es/DragModal/index.js +5 -0
  5. package/es/DragModal/style/index.css +81 -0
  6. package/es/DragModal/style/index.js +1 -0
  7. package/es/DragModal/style/index.less +96 -0
  8. package/es/EditTable/Body.js +365 -0
  9. package/es/EditTable/EditTable.js +401 -0
  10. package/es/EditTable/Header.js +242 -0
  11. package/es/EditTable/components/ContextMenu/Menu.js +154 -0
  12. package/es/EditTable/components/ContextMenu/index.js +81 -0
  13. package/es/EditTable/components/Search/Search.js +290 -0
  14. package/es/EditTable/components/Search/index.js +1 -0
  15. package/es/EditTable/consts.js +7 -0
  16. package/es/EditTable/hooks/index.js +40 -0
  17. package/es/EditTable/hooks/useResizeObserver.js +31 -0
  18. package/es/EditTable/hooks/useValidate.js +87 -0
  19. package/es/EditTable/index.js +9 -0
  20. package/es/EditTable/props.js +50 -0
  21. package/es/EditTable/style/body.less +76 -0
  22. package/es/EditTable/style/header.less +77 -0
  23. package/es/EditTable/style/index.css +219 -0
  24. package/es/EditTable/style/index.js +1 -0
  25. package/es/EditTable/style/index.less +42 -0
  26. package/es/EditTable/style/table.less +42 -0
  27. package/es/EditTable/utils.js +98 -0
  28. package/es/Ellipsis/style/index.js +1 -0
  29. package/es/FullPage/FullPage.js +1 -1
  30. package/es/Search/Advanced/SaveHistory.js +1 -1
  31. package/es/Search/Item.js +1 -1
  32. package/es/Search/Search.js +1 -1
  33. package/es/components.js +3 -1
  34. package/es/style/index.css +292 -0
  35. package/es/style/index.less +9 -7
  36. package/es/style.js +3 -1
  37. package/lib/CardSelect/style/index.js +3 -0
  38. package/lib/CheckButton/style/index.js +3 -0
  39. package/lib/DragModal/DragModal.js +307 -0
  40. package/lib/DragModal/index.js +12 -0
  41. package/lib/DragModal/style/index.css +81 -0
  42. package/lib/DragModal/style/index.js +3 -0
  43. package/lib/DragModal/style/index.less +96 -0
  44. package/lib/EditTable/Body.js +365 -0
  45. package/lib/EditTable/EditTable.js +401 -0
  46. package/lib/EditTable/Header.js +242 -0
  47. package/lib/EditTable/components/ContextMenu/Menu.js +154 -0
  48. package/lib/EditTable/components/ContextMenu/index.js +88 -0
  49. package/lib/EditTable/components/Search/Search.js +290 -0
  50. package/lib/EditTable/components/Search/index.js +13 -0
  51. package/lib/EditTable/consts.js +13 -0
  52. package/lib/EditTable/hooks/index.js +79 -0
  53. package/lib/EditTable/hooks/useResizeObserver.js +38 -0
  54. package/lib/EditTable/hooks/useValidate.js +94 -0
  55. package/lib/EditTable/index.js +16 -0
  56. package/lib/EditTable/props.js +56 -0
  57. package/lib/EditTable/style/body.less +76 -0
  58. package/lib/EditTable/style/header.less +77 -0
  59. package/lib/EditTable/style/index.css +219 -0
  60. package/lib/EditTable/style/index.js +3 -0
  61. package/lib/EditTable/style/index.less +42 -0
  62. package/lib/EditTable/style/table.less +42 -0
  63. package/lib/EditTable/utils.js +105 -0
  64. package/lib/Ellipsis/style/index.js +3 -0
  65. package/lib/FullPage/FullPage.js +1 -1
  66. package/lib/Search/Advanced/SaveHistory.js +1 -1
  67. package/lib/Search/Item.js +1 -1
  68. package/lib/Search/Search.js +1 -1
  69. package/lib/components.js +14 -0
  70. package/lib/style/components.less +2 -0
  71. package/lib/style/index.css +292 -0
  72. package/lib/style/index.less +9 -7
  73. package/lib/style.js +3 -1
  74. package/package.json +3 -1
@@ -0,0 +1,154 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
+ const op = ops[i];
3
+ const fn = ops[i + 1];
4
+ i += 2;
5
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
6
+ return undefined;
7
+ }
8
+ if (op === 'access' || op === 'optionalAccess') {
9
+ lastAccessLHS = value;
10
+ value = fn(value);
11
+ }
12
+ else if (op === 'call' || op === 'optionalCall') {
13
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
14
+ lastAccessLHS = undefined;
15
+ }
16
+ } return value; }
17
+ /* Analyzed bindings: {
18
+ "data": "props",
19
+ "onClose": "props",
20
+ "onClick": "props",
21
+ "onCopy": "props",
22
+ "paste": "props",
23
+ "onMounted": "setup-const",
24
+ "ref": "setup-const",
25
+ "nextTick": "setup-const",
26
+ "defineOptions": "setup-const",
27
+ "AIcon": "setup-maybe-ref",
28
+ "Menu": "setup-maybe-ref",
29
+ "MenuItem": "setup-maybe-ref",
30
+ "props": "setup-reactive-const",
31
+ "contextMenu": "setup-ref",
32
+ "showDetail": "setup-maybe-ref",
33
+ "showPaste": "setup-maybe-ref",
34
+ "showDelete": "setup-maybe-ref",
35
+ "clickFunc": "setup-const",
36
+ "close": "setup-const"
37
+ } */
38
+ import { unref as _unref, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
39
+ import { onMounted, ref, nextTick, } from "vue";
40
+ import { AIcon } from '../../../components';
41
+ import { Menu } from 'ant-design-vue';
42
+ const __sfc_main__ = Object.assign({
43
+ name: 'JEditTableContextMenu'
44
+ }, {
45
+ props: {
46
+ data: { type: Object, default: () => ({}) },
47
+ onClose: { type: Function, default: () => { } },
48
+ onClick: { type: Function, default: () => { } },
49
+ onCopy: { type: Function, default: () => { } },
50
+ paste: { type: Object, default: () => ({}) }
51
+ },
52
+ setup(__props) {
53
+ const MenuItem = Menu.Item;
54
+ const props = __props;
55
+ const contextMenu = ref(null);
56
+ const showDetail = computed(() => {
57
+ return !props.data.id;
58
+ });
59
+ const showPaste = computed(() => {
60
+ return !props.paste;
61
+ });
62
+ const showDelete = computed(() => {
63
+ return _optionalChain([props, 'access', _2 => _2.data, 'access', _3 => _3.expands, 'optionalAccess', _4 => _4.isProduct]);
64
+ });
65
+ const clickFunc = ({ key }) => {
66
+ if (key === 'copy') {
67
+ props.onCopy(props.data);
68
+ }
69
+ props.onClick(key);
70
+ };
71
+ const close = (e) => {
72
+ setTimeout(() => {
73
+ props.onClose();
74
+ }, 300);
75
+ };
76
+ onMounted(async () => {
77
+ // 确保组件已经渲染
78
+ await nextTick();
79
+ // 触发组件focus
80
+ contextMenu.value.focus();
81
+ });
82
+ return (_ctx, _cache) => {
83
+ return (_openBlock(), _createElementBlock("div", {
84
+ class: "metadata-context-menu",
85
+ ref_key: "contextMenu",
86
+ ref: contextMenu,
87
+ tabindex: "-1",
88
+ onBlur: close
89
+ }, [
90
+ _createVNode(_unref(Menu), { onClick: clickFunc }, {
91
+ default: _withCtx(() => [
92
+ _createVNode(_unref(MenuItem), { key: "add" }, {
93
+ icon: _withCtx(() => [
94
+ _createVNode(_unref(AIcon), { type: "PlusSquareOutlined" })
95
+ ]),
96
+ default: _withCtx(() => [
97
+ _createTextVNode(" 新增行 ")
98
+ ]),
99
+ _: 1 /* STABLE */
100
+ }),
101
+ _createVNode(_unref(MenuItem), { key: "copy" }, {
102
+ icon: _withCtx(() => [
103
+ _createVNode(_unref(AIcon), { type: "icon-copy" })
104
+ ]),
105
+ default: _withCtx(() => [
106
+ _createTextVNode(" 复制行 ")
107
+ ]),
108
+ _: 1 /* STABLE */
109
+ }),
110
+ _createVNode(_unref(MenuItem), {
111
+ key: "paste",
112
+ disabled: _unref(showPaste)
113
+ }, {
114
+ icon: _withCtx(() => [
115
+ _createVNode(_unref(AIcon), { type: "icon-paste" })
116
+ ]),
117
+ default: _withCtx(() => [
118
+ _createTextVNode(" 粘贴行 ")
119
+ ]),
120
+ _: 1 /* STABLE */
121
+ }, 8 /* PROPS */, ["disabled"]),
122
+ _createVNode(_unref(MenuItem), {
123
+ key: "detail",
124
+ disabled: _unref(showDetail)
125
+ }, {
126
+ icon: _withCtx(() => [
127
+ _createVNode(_unref(AIcon), { type: "icon-chakan" })
128
+ ]),
129
+ default: _withCtx(() => [
130
+ _createTextVNode(" 查看详情 ")
131
+ ]),
132
+ _: 1 /* STABLE */
133
+ }, 8 /* PROPS */, ["disabled"]),
134
+ _createVNode(_unref(MenuItem), {
135
+ key: "delete",
136
+ class: "danger",
137
+ disabled: _unref(showDelete)
138
+ }, {
139
+ icon: _withCtx(() => [
140
+ _createVNode(_unref(AIcon), { type: "DeleteOutlined" })
141
+ ]),
142
+ default: _withCtx(() => [
143
+ _createTextVNode(" 删除 ")
144
+ ]),
145
+ _: 1 /* STABLE */
146
+ }, 8 /* PROPS */, ["disabled"])
147
+ ]),
148
+ _: 1 /* STABLE */
149
+ })
150
+ ], 544 /* NEED_HYDRATION, NEED_PATCH */));
151
+ };
152
+ }
153
+ });
154
+ export default __sfc_main__;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _Menu = _interopRequireDefault(require("./Menu.js"));
9
+ var _vue = require("vue");
10
+ var _utils = require("../../utils");
11
+ var _lodashEs = require("lodash");
12
+ var curInstance = null;
13
+ var seed = 1;
14
+ var copyValue;
15
+ var contextMenu = function contextMenu(e, data, context) {
16
+ if (curInstance) {
17
+ curInstance.destroy();
18
+ }
19
+ curInstance = null;
20
+ var id = seed++;
21
+ // 创建一个临时的div,用于挂载我们的菜单
22
+ var container = document.createElement('div');
23
+ // 获取body标签,用于挂载整个菜单
24
+ var appendTo = context.getPopupContainer() || document.body;
25
+ // 传给menu组件的props
26
+ var props = {
27
+ data: data,
28
+ onClose: function onClose() {
29
+ if (curInstance) {
30
+ curInstance.destroy();
31
+ }
32
+ },
33
+ onClick: function onClick(type) {
34
+ var copyRecord = (0, _utils.handlePureRecord)(copyValue);
35
+ if (copyRecord.expands) {
36
+ copyRecord.expands = (0, _lodashEs.omit)(copyRecord.expands, ['isProduct']);
37
+ }
38
+ context.click(type, data, (0, _utils.handlePureRecord)(copyRecord));
39
+ },
40
+ onCopy: function onCopy(data) {
41
+ copyValue = data;
42
+ context.click('copy', data);
43
+ },
44
+ paste: !!copyValue
45
+ };
46
+ // 渲染虚拟节点
47
+ var vnode = (0, _vue.h)(_Menu.default, props);
48
+ // vnode为需要渲染的虚拟节点,container为渲染的容器
49
+ (0, _vue.render)(vnode, container);
50
+ // 首先需要先把菜单真正渲染到页面,才能拿到它的宽度和高度
51
+ appendTo.appendChild(container.firstElementChild);
52
+ // 当前真正的菜单节点,上面输出的vnode中可以看到,el就是我们的菜单节点
53
+ var curMenu = vnode.el;
54
+ // 获取curMenu的高度和宽度,用于临界的计算
55
+ var offsetWidth = curMenu.offsetWidth,
56
+ offsetHeight = curMenu.offsetHeight;
57
+ // 获取body的可视区域的宽度
58
+ var clientWidth = appendTo.clientWidth;
59
+ // 取出右键点击时的坐标,clientX是距离左侧的位置,clientY是距离顶部的位置
60
+ var clientX = e.clientX,
61
+ clientY = e.clientY;
62
+ // 当前可视区域的宽度 - 当前鼠标距离浏览器左边的距离
63
+ // 如果 大于菜单的宽度,说明正常设置菜单距离左边界的距离,即设置style.left
64
+ // 否则菜单需要在鼠标左侧展示,即需要设置style.right组件距离可视区域右侧的距离
65
+ var leftOrRight = clientWidth - clientX > offsetWidth ? "left" : "right";
66
+ // 当前浏览器的高度(不包含滚动条) - 当前鼠标距离浏览器上边的距离
67
+ // 如果 大于菜单的高度,说明可以正常设置菜单距离上边界的距离,即设置style.top
68
+ // 否则需要设置菜单距离底部边界的位置,即style.bottom
69
+ var topOrBottom = window.innerHeight - clientY > offsetHeight ? "top" : "bottom";
70
+ var offsetLeft = Math.abs(clientWidth - clientX);
71
+ // 设置left或者right的style
72
+ curMenu.style[leftOrRight] = leftOrRight === "left" ? "".concat(clientX + 20, "px") : "".concat(offsetLeft, "px");
73
+ // 设置top或者bottom的style
74
+ curMenu.style[topOrBottom] = topOrBottom === 'bottom' ? '2px' : "".concat(clientY, "px");
75
+ var instance = {
76
+ id: id,
77
+ destroy: function destroy() {
78
+ curInstance = null;
79
+ (0, _vue.render)(null, container);
80
+ },
81
+ cleanCopy: function cleanCopy() {
82
+ copyValue = null;
83
+ }
84
+ };
85
+ curInstance = instance;
86
+ return instance;
87
+ };
88
+ var _default = exports.default = contextMenu;
@@ -0,0 +1,290 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
+ const op = ops[i];
3
+ const fn = ops[i + 1];
4
+ i += 2;
5
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
6
+ return undefined;
7
+ }
8
+ if (op === 'access' || op === 'optionalAccess') {
9
+ lastAccessLHS = value;
10
+ value = fn(value);
11
+ }
12
+ else if (op === 'call' || op === 'optionalCall') {
13
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
14
+ lastAccessLHS = undefined;
15
+ }
16
+ } return value; }
17
+ /* Analyzed bindings: {
18
+ "searchKey": "props",
19
+ "rowKey": "props",
20
+ "Table": "setup-const",
21
+ "useTableDataSource": "setup-maybe-ref",
22
+ "useTableTool": "setup-maybe-ref",
23
+ "Ellipsis": "setup-maybe-ref",
24
+ "DragModal": "setup-maybe-ref",
25
+ "Button": "setup-maybe-ref",
26
+ "Input": "setup-maybe-ref",
27
+ "Space": "setup-maybe-ref",
28
+ "ref": "setup-const",
29
+ "defineOptions": "setup-const",
30
+ "props": "setup-reactive-const",
31
+ "emit": "setup-const",
32
+ "dataSource": "setup-maybe-ref",
33
+ "tableTool": "setup-maybe-ref",
34
+ "searchValue": "setup-ref",
35
+ "filterArray": "setup-ref",
36
+ "visible": "setup-ref",
37
+ "searchIndex": "setup-ref",
38
+ "modalHeight": "setup-ref",
39
+ "tableHeight": "setup-ref",
40
+ "selectedRowKeys": "setup-ref",
41
+ "tableRef": "setup-ref",
42
+ "columns": "setup-const",
43
+ "selectedTableRow": "setup-const",
44
+ "handleFilterArray": "setup-const",
45
+ "search": "setup-const",
46
+ "heightChange": "setup-const",
47
+ "onClose": "setup-const",
48
+ "onSelect": "setup-const"
49
+ } */
50
+ import { createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, withModifiers as _withModifiers, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock } from "vue";
51
+ const _hoisted_1 = { class: "edit-table-search" };
52
+ const _hoisted_2 = { class: "edit-table-search-header" };
53
+ const _hoisted_3 = /*#__PURE__*/ _createElementVNode("span", null, "查找", -1 /* HOISTED */);
54
+ const _hoisted_4 = {
55
+ key: 0,
56
+ style: { "margin": "12px 0" }
57
+ };
58
+ const _hoisted_5 = { key: 1 };
59
+ const _hoisted_6 = { class: "edit-table-search-result-total" };
60
+ import Table from '../../EditTable.js';
61
+ import { useTableDataSource, useTableTool } from "../../hooks";
62
+ import { Ellipsis, DragModal } from '../../../components';
63
+ import { Button, Input, Space } from 'ant-design-vue';
64
+ import { ref, } from 'vue';
65
+ const __sfc_main__ = Object.assign({
66
+ name: 'JEditTableSearch'
67
+ }, {
68
+ props: {
69
+ searchKey: {
70
+ type: String,
71
+ default: 'id'
72
+ },
73
+ rowKey: {
74
+ type: String,
75
+ default: 'id'
76
+ }
77
+ },
78
+ emits: ['close'],
79
+ setup(__props, { emit: __emit }) {
80
+ const props = __props;
81
+ const emit = __emit;
82
+ const dataSource = useTableDataSource();
83
+ const tableTool = useTableTool();
84
+ const searchValue = ref();
85
+ const filterArray = ref([]);
86
+ const visible = ref(false);
87
+ const searchIndex = ref(-1);
88
+ const modalHeight = ref(100);
89
+ const tableHeight = ref(230);
90
+ const selectedRowKeys = ref([]);
91
+ const tableRef = ref();
92
+ const columns = [
93
+ {
94
+ title: '标识',
95
+ dataIndex: 'id',
96
+ },
97
+ {
98
+ title: '名称',
99
+ dataIndex: 'name',
100
+ }
101
+ ];
102
+ const selectedTableRow = (record) => {
103
+ tableTool.scrollTo({
104
+ ...record,
105
+ __serial: record.__oldSerial - 1
106
+ });
107
+ tableTool.selected([record[props.rowKey]]);
108
+ };
109
+ const handleFilterArray = () => {
110
+ const cloneDataSource = JSON.parse(JSON.stringify(dataSource.value || '[]')).map(item => Object.assign(item, { __oldSerial: item.__serial }));
111
+ return cloneDataSource.filter(item => {
112
+ if (item[props.searchKey]) {
113
+ return item[props.searchKey].includes(searchValue.value);
114
+ }
115
+ return false;
116
+ });
117
+ };
118
+ const search = (key) => {
119
+ filterArray.value = handleFilterArray();
120
+ if (key === 'all') { // 查找全部
121
+ visible.value = true;
122
+ modalHeight.value = 400;
123
+ searchIndex.value = 0;
124
+ }
125
+ else if (key === 'next') { // 下一个
126
+ searchIndex.value += 1;
127
+ }
128
+ else { // 上一个
129
+ searchIndex.value -= 1;
130
+ }
131
+ if (searchIndex.value < 0) { // 小于0时,跳转到最后一个
132
+ searchIndex.value = filterArray.value.length - 1;
133
+ }
134
+ else if (searchIndex.value > filterArray.value.length - 1) { // 大于整体搜索结果时,跳转到第一个
135
+ searchIndex.value = 0;
136
+ }
137
+ const searchItem = filterArray.value[searchIndex.value];
138
+ if (key !== 'all' && visible.value) {
139
+ _optionalChain([tableRef, 'access', _2 => _2.value, 'optionalAccess', _3 => _3.scrollToByIndex, 'call', _4 => _4(searchIndex.value - 1)]); // 控制EditTable滚动到指定为止
140
+ }
141
+ if (filterArray.value.length > 1) {
142
+ selectedRowKeys.value = [searchItem[props.rowKey]];
143
+ selectedTableRow(searchItem);
144
+ }
145
+ else {
146
+ selectedRowKeys.value = [];
147
+ tableTool.selected([]);
148
+ }
149
+ };
150
+ const heightChange = (h) => {
151
+ if (h > 340) {
152
+ tableHeight.value = h - 160;
153
+ }
154
+ };
155
+ const onClose = () => {
156
+ emit('close');
157
+ tableTool.searchVisible(false);
158
+ };
159
+ const onSelect = (record) => {
160
+ searchIndex.value = filterArray.value.findIndex(item => item[props.rowKey] === record[props.rowKey]);
161
+ selectedRowKeys.value = [record[props.rowKey]];
162
+ selectedTableRow(record);
163
+ };
164
+ return (_ctx, _cache) => {
165
+ return (_openBlock(), _createBlock(_unref(DragModal), {
166
+ width: 800,
167
+ height: modalHeight.value,
168
+ title: false,
169
+ dragRang: [600, 200],
170
+ bodyStyle: {
171
+ overflow: 'hidden',
172
+ },
173
+ footer: false,
174
+ onHeightChange: heightChange
175
+ }, {
176
+ default: _withCtx(() => [
177
+ _createElementVNode("div", _hoisted_1, [
178
+ _createElementVNode("div", _hoisted_2, [
179
+ _createElementVNode("div", null, [
180
+ _createVNode(_unref(Space), null, {
181
+ default: _withCtx(() => [
182
+ _hoisted_3,
183
+ _createVNode(_unref(Input), {
184
+ value: searchValue.value,
185
+ "onUpdate:value": _cache[0] || (_cache[0] = $event => ((searchValue).value = $event)),
186
+ maxlength: 64,
187
+ placeholder: "请输入查找内容"
188
+ }, null, 8 /* PROPS */, ["value"]),
189
+ _createVNode(_unref(Button), {
190
+ type: "primary",
191
+ ghost: "",
192
+ onClick: _cache[1] || (_cache[1] = () => search('all'))
193
+ }, {
194
+ default: _withCtx(() => [
195
+ _createTextVNode("查找全部")
196
+ ]),
197
+ _: 1 /* STABLE */
198
+ }),
199
+ _createVNode(_unref(Button), {
200
+ type: "primary",
201
+ ghost: "",
202
+ onClick: _cache[2] || (_cache[2] = () => search('prev'))
203
+ }, {
204
+ default: _withCtx(() => [
205
+ _createTextVNode("上一个")
206
+ ]),
207
+ _: 1 /* STABLE */
208
+ }),
209
+ _createVNode(_unref(Button), {
210
+ type: "primary",
211
+ ghost: "",
212
+ onClick: _cache[3] || (_cache[3] = () => search('next'))
213
+ }, {
214
+ default: _withCtx(() => [
215
+ _createTextVNode("下一个")
216
+ ]),
217
+ _: 1 /* STABLE */
218
+ })
219
+ ]),
220
+ _: 1 /* STABLE */
221
+ })
222
+ ]),
223
+ _createElementVNode("div", null, [
224
+ _createVNode(_unref(Button), {
225
+ type: "primary",
226
+ onClick: _withModifiers(onClose, ["stop"])
227
+ }, {
228
+ default: _withCtx(() => [
229
+ _createTextVNode("关闭")
230
+ ]),
231
+ _: 1 /* STABLE */
232
+ })
233
+ ])
234
+ ]),
235
+ (visible.value)
236
+ ? (_openBlock(), _createElementBlock("div", _hoisted_4, [
237
+ _createVNode(Table, {
238
+ ref_key: "tableRef",
239
+ ref: tableRef,
240
+ "data-source": filterArray.value,
241
+ columns: columns,
242
+ height: tableHeight.value,
243
+ disableMenu: false,
244
+ cellHeight: 36,
245
+ rowSelection: {
246
+ onSelect: onSelect,
247
+ selectedRowKeys: selectedRowKeys.value
248
+ },
249
+ serial: {
250
+ title: '行数'
251
+ }
252
+ }, {
253
+ serial: _withCtx(({ record }) => [
254
+ _createElementVNode("span", null, _toDisplayString(record.__oldSerial), 1 /* TEXT */)
255
+ ]),
256
+ id: _withCtx(({ record }) => [
257
+ _createVNode(_unref(Ellipsis), null, {
258
+ default: _withCtx(() => [
259
+ _createTextVNode(_toDisplayString(record.id), 1 /* TEXT */)
260
+ ]),
261
+ _: 2 /* DYNAMIC */
262
+ }, 1024 /* DYNAMIC_SLOTS */)
263
+ ]),
264
+ name: _withCtx(({ record }) => [
265
+ _createVNode(_unref(Ellipsis), null, {
266
+ default: _withCtx(() => [
267
+ _createTextVNode(_toDisplayString(record.name), 1 /* TEXT */)
268
+ ]),
269
+ _: 2 /* DYNAMIC */
270
+ }, 1024 /* DYNAMIC_SLOTS */)
271
+ ]),
272
+ _: 1 /* STABLE */
273
+ }, 8 /* PROPS */, ["data-source", "height", "rowSelection"])
274
+ ]))
275
+ : _createCommentVNode("v-if", true),
276
+ (visible.value)
277
+ ? (_openBlock(), _createElementBlock("div", _hoisted_5, [
278
+ _createTextVNode(" 查找到 "),
279
+ _createElementVNode("span", _hoisted_6, _toDisplayString(filterArray.value.length), 1 /* TEXT */),
280
+ _createTextVNode(" 条相关属性 ")
281
+ ]))
282
+ : _createCommentVNode("v-if", true)
283
+ ])
284
+ ]),
285
+ _: 1 /* STABLE */
286
+ }, 8 /* PROPS */, ["height"]));
287
+ };
288
+ }
289
+ });
290
+ export default __sfc_main__;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "Search", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _Search.default;
11
+ }
12
+ });
13
+ var _Search = _interopRequireDefault(require("./Search.js"));
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TABLE_WRAPPER = exports.TABLE_TOOL = exports.TABLE_FORM_ITEM_ERROR = exports.TABLE_ERROR = exports.TABLE_DATA_SOURCE = exports.RIGHT_MENU = exports.FULL_SCREEN = void 0;
7
+ var TABLE_WRAPPER = exports.TABLE_WRAPPER = Symbol('table-wrapper');
8
+ var FULL_SCREEN = exports.FULL_SCREEN = Symbol('full');
9
+ var RIGHT_MENU = exports.RIGHT_MENU = Symbol('right-menu');
10
+ var TABLE_ERROR = exports.TABLE_ERROR = Symbol('table-error');
11
+ var TABLE_DATA_SOURCE = exports.TABLE_DATA_SOURCE = Symbol('table-data-source');
12
+ var TABLE_TOOL = exports.TABLE_TOOL = Symbol('table-tool');
13
+ var TABLE_FORM_ITEM_ERROR = exports.TABLE_FORM_ITEM_ERROR = Symbol('table-form-item-error');
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ useFormContext: true,
8
+ useInjectForm: true,
9
+ useInjectError: true,
10
+ useTableWrapper: true,
11
+ useRightMenuContext: true,
12
+ useTableDataSource: true,
13
+ useTableTool: true,
14
+ useFormItemError: true,
15
+ useTableFullScreen: true
16
+ };
17
+ exports.useTableWrapper = exports.useTableTool = exports.useTableFullScreen = exports.useTableDataSource = exports.useRightMenuContext = exports.useInjectForm = exports.useInjectError = exports.useFormItemError = exports.useFormContext = void 0;
18
+ var _vue = require("vue");
19
+ var _consts = require("../consts");
20
+ var _useResizeObserver = require("./useResizeObserver");
21
+ Object.keys(_useResizeObserver).forEach(function (key) {
22
+ if (key === "default" || key === "__esModule") return;
23
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
24
+ if (key in exports && exports[key] === _useResizeObserver[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _useResizeObserver[key];
29
+ }
30
+ });
31
+ });
32
+ var _useValidate = require("./useValidate");
33
+ Object.keys(_useValidate).forEach(function (key) {
34
+ if (key === "default" || key === "__esModule") return;
35
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
36
+ if (key in exports && exports[key] === _useValidate[key]) return;
37
+ Object.defineProperty(exports, key, {
38
+ enumerable: true,
39
+ get: function get() {
40
+ return _useValidate[key];
41
+ }
42
+ });
43
+ });
44
+ var FormContextKey = 'form-context';
45
+ var useFormContext = exports.useFormContext = function useFormContext(options) {
46
+ (0, _vue.provide)(FormContextKey, options);
47
+ };
48
+ var useInjectForm = exports.useInjectForm = function useInjectForm() {
49
+ return (0, _vue.inject)(FormContextKey, {
50
+ addField: function addField(key, field) {},
51
+ dataSource: (0, _vue.computed)(function () {
52
+ return [];
53
+ }),
54
+ rules: (0, _vue.computed)(function () {
55
+ return undefined;
56
+ })
57
+ });
58
+ };
59
+ var useInjectError = exports.useInjectError = function useInjectError() {
60
+ return (0, _vue.inject)(_consts.TABLE_ERROR);
61
+ };
62
+ var useTableWrapper = exports.useTableWrapper = function useTableWrapper() {
63
+ return (0, _vue.inject)(_consts.TABLE_WRAPPER);
64
+ };
65
+ var useRightMenuContext = exports.useRightMenuContext = function useRightMenuContext() {
66
+ return (0, _vue.inject)(_consts.RIGHT_MENU);
67
+ };
68
+ var useTableDataSource = exports.useTableDataSource = function useTableDataSource() {
69
+ return (0, _vue.inject)(_consts.TABLE_DATA_SOURCE, []);
70
+ };
71
+ var useTableTool = exports.useTableTool = function useTableTool() {
72
+ return (0, _vue.inject)(_consts.TABLE_TOOL, false);
73
+ };
74
+ var useFormItemError = exports.useFormItemError = function useFormItemError() {
75
+ return (0, _vue.inject)(_consts.TABLE_FORM_ITEM_ERROR);
76
+ };
77
+ var useTableFullScreen = exports.useTableFullScreen = function useTableFullScreen() {
78
+ return (0, _vue.inject)(_consts.FULL_SCREEN);
79
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useResizeObserver = void 0;
8
+ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
9
+ var _vue = require("vue");
10
+ var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
11
+ var _lodashEs = require("lodash");
12
+ var useResizeObserver = exports.useResizeObserver = function useResizeObserver(tableWrapper, cb) {
13
+ var observer;
14
+ var onResize = function onResize(e) {
15
+ var rect = {};
16
+ var _iterator = (0, _createForOfIteratorHelper2.default)(e),
17
+ _step;
18
+ try {
19
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
20
+ var entry = _step.value;
21
+ rect = entry.contentRect;
22
+ }
23
+ } catch (err) {
24
+ _iterator.e(err);
25
+ } finally {
26
+ _iterator.f();
27
+ }
28
+ cb(rect, e);
29
+ };
30
+ (0, _vue.onMounted)(function () {
31
+ observer = new _resizeObserverPolyfill.default((0, _lodashEs.debounce)(onResize, 100));
32
+ observer.observe(tableWrapper.value);
33
+ });
34
+ (0, _vue.onBeforeUnmount)(function () {
35
+ var _observer;
36
+ (_observer = observer) === null || _observer === void 0 ? void 0 : _observer.unobserve(tableWrapper.value);
37
+ });
38
+ };