@meethive/components 0.0.14 → 0.0.15
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 +108 -24
- package/es/EditTable/EditTable.js +111 -35
- package/es/EditTable/FormItem.js +46 -18
- package/es/EditTable/Group.js +167 -53
- package/es/EditTable/Header.js +79 -21
- package/es/EditTable/components/ContextMenu/Menu.js +79 -29
- package/es/EditTable/components/Search/Search.js +132 -33
- package/es/EditTable/components/Search/Sort.js +91 -32
- package/es/FullPage/FullPage.js +23 -9
- package/es/Icon/Icon.js +43 -23
- package/es/Markdown/Markdown.js +9 -4
- package/es/RadioButton/RadioButton.js +31 -12
- package/es/Skeleton/Skeleton.js +33 -9
- package/es/Skeleton/components/DashBoardCard.js +40 -9
- package/es/Skeleton/components/DashBoardChart.js +67 -9
- package/es/Skeleton/components/Detail.js +75 -9
- package/es/Skeleton/components/Drawer.js +59 -9
- package/es/Skeleton/components/Item.js +17 -7
- package/es/Skeleton/components/List.js +27 -11
- package/es/Skeleton/components/ListCard.js +36 -10
- package/es/Skeleton/components/ListCardItem.js +71 -8
- package/es/Skeleton/components/ListTable.js +53 -9
- package/es/Skeleton/components/Page.js +40 -10
- package/es/Skeleton/components/Search.js +39 -8
- package/es/Skeleton/components/Tree.js +46 -9
- package/es/TimeFormat/TimeFormat.js +18 -9
- package/es/Title/Title.js +22 -10
- package/es/ValueItem/ValueItem.js +171 -43
- package/lib/EditTable/Body.js +108 -24
- package/lib/EditTable/EditTable.js +111 -35
- package/lib/EditTable/FormItem.js +46 -18
- package/lib/EditTable/Group.js +167 -53
- package/lib/EditTable/Header.js +79 -21
- package/lib/EditTable/components/ContextMenu/Menu.js +79 -29
- package/lib/EditTable/components/Search/Search.js +132 -33
- package/lib/EditTable/components/Search/Sort.js +91 -32
- package/lib/FullPage/FullPage.js +23 -9
- package/lib/Icon/Icon.js +43 -23
- package/lib/Markdown/Markdown.js +9 -4
- package/lib/RadioButton/RadioButton.js +31 -12
- package/lib/Skeleton/Skeleton.js +33 -9
- package/lib/Skeleton/components/DashBoardCard.js +40 -9
- package/lib/Skeleton/components/DashBoardChart.js +67 -9
- package/lib/Skeleton/components/Detail.js +75 -9
- package/lib/Skeleton/components/Drawer.js +59 -9
- package/lib/Skeleton/components/Item.js +17 -7
- package/lib/Skeleton/components/List.js +27 -11
- package/lib/Skeleton/components/ListCard.js +36 -10
- package/lib/Skeleton/components/ListCardItem.js +71 -8
- package/lib/Skeleton/components/ListTable.js +53 -9
- package/lib/Skeleton/components/Page.js +40 -10
- package/lib/Skeleton/components/Search.js +39 -8
- package/lib/Skeleton/components/Tree.js +46 -9
- package/lib/TimeFormat/TimeFormat.js +18 -9
- package/lib/Title/Title.js +22 -10
- package/lib/ValueItem/ValueItem.js +171 -43
- package/package.json +1 -1
package/es/EditTable/Body.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, 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, createBlock as _createBlock, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createVNode as _createVNode } from "vue";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
style: {
|
|
5
|
+
"position": "relative"
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_2 = ["data-row-key", "onContextmenu", "onClick"];
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "body-cell-box"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_4 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "body-cell-box"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_5 = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "readonly-mask"
|
|
20
|
+
};
|
|
21
|
+
const _hoisted_6 = {
|
|
22
|
+
class: "jetlinks-edit-table-body-empty"
|
|
23
|
+
};
|
|
24
|
+
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
|
2
25
|
import ContextMenu from './components/ContextMenu';
|
|
3
26
|
import { useHScroll, useRightMenuContext } from './hooks';
|
|
4
27
|
import { randomString } from '@meethive/utils';
|
|
@@ -6,12 +29,11 @@ import { bodyProps } from './props';
|
|
|
6
29
|
import Empty from '../Empty/Empty.js';
|
|
7
30
|
import CellRender from './CellRender.js';
|
|
8
31
|
import genEditTableStyle from './style';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Empty,
|
|
13
|
-
CellRender
|
|
32
|
+
const __sfc_main__ = _defineComponent({
|
|
33
|
+
...{
|
|
34
|
+
name: 'JEditTableBody'
|
|
14
35
|
},
|
|
36
|
+
__name: 'Body',
|
|
15
37
|
props: {
|
|
16
38
|
...bodyProps(),
|
|
17
39
|
groupKey: {
|
|
@@ -27,10 +49,12 @@ export default defineComponent({
|
|
|
27
49
|
}
|
|
28
50
|
},
|
|
29
51
|
emits: ['update:dataSource', 'scrollDown'],
|
|
30
|
-
setup(
|
|
31
|
-
|
|
32
|
-
|
|
52
|
+
setup(__props, {
|
|
53
|
+
expose: __expose,
|
|
54
|
+
emit: __emit
|
|
33
55
|
}) {
|
|
56
|
+
const props = __props;
|
|
57
|
+
const emit = __emit;
|
|
34
58
|
const prefixCls = computed(() => 'jetlinks-edit-table');
|
|
35
59
|
const [wrapSSR, hashId] = genEditTableStyle(prefixCls);
|
|
36
60
|
const viewScrollRef = ref();
|
|
@@ -49,7 +73,11 @@ export default defineComponent({
|
|
|
49
73
|
});
|
|
50
74
|
const selectedRowKeys = ref([]);
|
|
51
75
|
const virtualData = computed(() => {
|
|
52
|
-
|
|
76
|
+
const array = props.dataSource.slice(virtualRang.start, virtualRang.end);
|
|
77
|
+
if (tableCenterRef.value) {
|
|
78
|
+
// tableCenterRef.value.style.webkitTransform = `translateY(${virtualRang.start * props.cellHeight}px)`
|
|
79
|
+
}
|
|
80
|
+
return array;
|
|
53
81
|
});
|
|
54
82
|
const onScroll = () => {
|
|
55
83
|
if (!viewScrollRef.value) return;
|
|
@@ -137,22 +165,78 @@ export default defineComponent({
|
|
|
137
165
|
scrollTo(0);
|
|
138
166
|
}
|
|
139
167
|
});
|
|
140
|
-
|
|
168
|
+
__expose({
|
|
141
169
|
scrollTo,
|
|
142
170
|
updateSelectedKeys
|
|
143
171
|
});
|
|
144
|
-
return {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
172
|
+
return (_ctx, _cache) => {
|
|
173
|
+
return _ctx.dataSource.length ? (_openBlock(), _createElementBlock("div", {
|
|
174
|
+
key: 0,
|
|
175
|
+
ref_key: "viewScrollRef",
|
|
176
|
+
ref: viewScrollRef,
|
|
177
|
+
class: _normalizeClass(['jetlinks-edit-table-body-viewport', _unref(hashId)]),
|
|
178
|
+
style: _normalizeStyle({
|
|
179
|
+
..._ctx.style,
|
|
180
|
+
height: _ctx.height + 'px'
|
|
181
|
+
}),
|
|
182
|
+
onScroll: onScroll
|
|
183
|
+
}, [_createElementVNode("div", _hoisted_1, [_createElementVNode("div", {
|
|
184
|
+
class: "jetlinks-edit-scrollbar",
|
|
185
|
+
style: _normalizeStyle(containerStyle.value)
|
|
186
|
+
}, null, 4 /* STYLE */), _createElementVNode("div", {
|
|
187
|
+
ref_key: "tableCenterRef",
|
|
188
|
+
ref: tableCenterRef,
|
|
189
|
+
class: "jetlinks-edit-table-center",
|
|
190
|
+
style: _normalizeStyle({
|
|
191
|
+
transform: `translate3d(-${_unref(hScroll) || 0}px, ${virtualRang.start * _ctx.cellHeight}px, 0)`,
|
|
192
|
+
width: __props.width + 'px'
|
|
193
|
+
})
|
|
194
|
+
}, [virtualData.value.length ? (_openBlock(true), _createElementBlock(_Fragment, {
|
|
195
|
+
key: 0
|
|
196
|
+
}, _renderList(virtualData.value, (item, index) => {
|
|
197
|
+
return _openBlock(), _createElementBlock("div", {
|
|
198
|
+
key: `record_${item.__key}`,
|
|
199
|
+
class: _normalizeClass({
|
|
200
|
+
'jetlinks-edit-table-row': true,
|
|
201
|
+
'jetlinks-edit-table-row-selected': selectedRowKeys.value.value?.includes(item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
202
|
+
}),
|
|
203
|
+
style: _normalizeStyle({
|
|
204
|
+
height: `${_ctx.cellHeight}px`,
|
|
205
|
+
transform: `-${_unref(hScroll) || 0}px`
|
|
206
|
+
}),
|
|
207
|
+
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
208
|
+
onContextmenu: _withModifiers(e => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
209
|
+
onClick: _withModifiers(() => rowClick(item), ["stop"])
|
|
210
|
+
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.columns, (column, __index) => {
|
|
211
|
+
return _openBlock(), _createElementBlock("div", {
|
|
212
|
+
key: column.dataIndex,
|
|
213
|
+
class: "jetlinks-edit-table-cell",
|
|
214
|
+
style: _normalizeStyle({
|
|
215
|
+
width: `${column.width}px`,
|
|
216
|
+
left: `${column.left || 200 * __index}px`
|
|
217
|
+
})
|
|
218
|
+
}, [column.dataIndex === '__serial' ? (_openBlock(), _createElementBlock("div", _hoisted_3, [_renderSlot(_ctx.$slots, "serial", {
|
|
219
|
+
record: item,
|
|
220
|
+
index: item.__dataIndex,
|
|
221
|
+
column: column
|
|
222
|
+
}, () => [_createTextVNode(_toDisplayString(virtualRang.start + index + 1), 1 /* TEXT */)])])) : (_openBlock(), _createElementBlock("div", _hoisted_4, [_renderSlot(_ctx.$slots, column.dataIndex, {
|
|
223
|
+
record: item,
|
|
224
|
+
index: item.__dataIndex,
|
|
225
|
+
column: column
|
|
226
|
+
}, () => [column.customRender ? (_openBlock(), _createBlock(CellRender, {
|
|
227
|
+
key: 0,
|
|
228
|
+
record: item,
|
|
229
|
+
value: item[column.dataIndex],
|
|
230
|
+
index: item.__dataIndex,
|
|
231
|
+
"render-fn": column.customRender
|
|
232
|
+
}, null, 8 /* PROPS */, ["record", "value", "index", "render-fn"])) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
233
|
+
key: 1
|
|
234
|
+
}, [_createTextVNode(_toDisplayString(item[column.dataIndex]), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))])]))], 4 /* STYLE */);
|
|
235
|
+
}), 128 /* KEYED_FRAGMENT */))], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2);
|
|
236
|
+
}), 128 /* KEYED_FRAGMENT */)) : _createCommentVNode("v-if", true), __props.readonly ? (_openBlock(), _createElementBlock("div", _hoisted_5)) : _createCommentVNode("v-if", true)], 4 /* STYLE */)])], 38 /* CLASS, STYLE, NEED_HYDRATION */)) : _renderSlot(_ctx.$slots, "empty", {
|
|
237
|
+
key: 1
|
|
238
|
+
}, () => [_createElementVNode("div", _hoisted_6, [_createVNode(Empty)])]);
|
|
156
239
|
};
|
|
157
240
|
}
|
|
158
|
-
});
|
|
241
|
+
});
|
|
242
|
+
export default __sfc_main__;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
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";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
class: "jetlinks-edit-table-extra"
|
|
5
|
+
};
|
|
6
|
+
const _hoisted_2 = {
|
|
7
|
+
class: "jetlinks-edit-table"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "jetlinks-table-horizontal-scroll"
|
|
12
|
+
};
|
|
13
|
+
import { ref, reactive, computed, watch, provide, useSlots } from 'vue';
|
|
2
14
|
import { tableProps } from 'ant-design-vue/lib/table';
|
|
3
15
|
import { useFullscreen } from '@vueuse/core';
|
|
4
16
|
import { findIndex, get, sortBy } from 'lodash-es';
|
|
@@ -13,13 +25,11 @@ import Group from './Group.js';
|
|
|
13
25
|
import { useLocaleReceiver } from '../LocaleReciver';
|
|
14
26
|
import useEditTableStyle from './style';
|
|
15
27
|
const defaultGroupId = 'group_1';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Header,
|
|
20
|
-
Body,
|
|
21
|
-
Group
|
|
28
|
+
const __sfc_main__ = _defineComponent({
|
|
29
|
+
...{
|
|
30
|
+
name: 'JEditTable'
|
|
22
31
|
},
|
|
32
|
+
__name: 'EditTable',
|
|
23
33
|
props: {
|
|
24
34
|
...tableProps(),
|
|
25
35
|
...bodyProps(),
|
|
@@ -44,10 +54,12 @@ export default defineComponent({
|
|
|
44
54
|
}
|
|
45
55
|
},
|
|
46
56
|
emits: ['scrollDown', 'rightMenuClick', 'editChange', 'searchVisibleChange'],
|
|
47
|
-
setup(
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
setup(__props, {
|
|
58
|
+
expose: __expose,
|
|
59
|
+
emit: __emit
|
|
50
60
|
}) {
|
|
61
|
+
const props = __props;
|
|
62
|
+
const emit = __emit;
|
|
51
63
|
const [contextLocale] = useLocaleReceiver('EditTable');
|
|
52
64
|
const prefixCls = computed(() => 'jetlinks-edit-table');
|
|
53
65
|
const [wrapSSR, hashId] = useEditTableStyle(prefixCls);
|
|
@@ -349,7 +361,7 @@ export default defineComponent({
|
|
|
349
361
|
addFieldError,
|
|
350
362
|
validateItem
|
|
351
363
|
});
|
|
352
|
-
|
|
364
|
+
__expose({
|
|
353
365
|
validate,
|
|
354
366
|
tableWrapper,
|
|
355
367
|
scrollToById,
|
|
@@ -357,29 +369,93 @@ export default defineComponent({
|
|
|
357
369
|
getTableWrapperRef,
|
|
358
370
|
getGroupActive
|
|
359
371
|
});
|
|
360
|
-
return {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
372
|
+
return (_ctx, _cache) => {
|
|
373
|
+
return _openBlock(), _createElementBlock("div", {
|
|
374
|
+
ref_key: "tableWrapper",
|
|
375
|
+
ref: tableWrapper,
|
|
376
|
+
class: _normalizeClass({
|
|
377
|
+
'jetlinks-edit-table-wrapper': true,
|
|
378
|
+
'table-full-screen': _unref(isFullscreen),
|
|
379
|
+
[_unref(hashId)]: true
|
|
380
|
+
})
|
|
381
|
+
}, [_createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "extra", {
|
|
382
|
+
isFullscreen: _unref(isFullscreen),
|
|
383
|
+
fullScreenToggle: _unref(toggle)
|
|
384
|
+
})]), _createElementVNode("div", _hoisted_2, [_createElementVNode("div", {
|
|
385
|
+
class: "jetlinks-edit-table-header",
|
|
386
|
+
style: _normalizeStyle({
|
|
387
|
+
height: '50px',
|
|
388
|
+
paddingRight: scrollWidth.value + 'px'
|
|
389
|
+
})
|
|
390
|
+
}, [_createVNode(Header, {
|
|
391
|
+
columns: myColumns.value,
|
|
392
|
+
"search-columns": __props.searchColumns,
|
|
393
|
+
style: _normalizeStyle({
|
|
394
|
+
width: tableStyle.width,
|
|
395
|
+
transform: `translateX(-${horizontalScrollLeft.value}px)`
|
|
396
|
+
})
|
|
397
|
+
}, null, 8 /* PROPS */, ["columns", "search-columns", "style"])], 4 /* STYLE */), _createElementVNode("div", {
|
|
398
|
+
class: "jetlinks-edit-table-body",
|
|
399
|
+
style: _normalizeStyle({
|
|
400
|
+
width: tableStyle.width,
|
|
401
|
+
height: `${_ctx.height}px`
|
|
402
|
+
})
|
|
403
|
+
}, [_createVNode(Body, {
|
|
404
|
+
ref_key: "tableBody",
|
|
405
|
+
ref: tableBody,
|
|
406
|
+
"data-source": bodyDataSource.value,
|
|
407
|
+
columns: myColumns.value,
|
|
408
|
+
"cell-height": _ctx.cellHeight,
|
|
409
|
+
height: _ctx.height,
|
|
410
|
+
"disable-menu": _ctx.disableMenu,
|
|
411
|
+
"row-key": _ctx.rowKey,
|
|
412
|
+
"group-key": _unref(groupActive).value,
|
|
413
|
+
"open-group": _ctx.openGroup,
|
|
414
|
+
"row-selection": _ctx.rowSelection,
|
|
415
|
+
readonly: __props.readonly,
|
|
416
|
+
width: horizontalScrollWidth.value,
|
|
417
|
+
onScrollDown: onScrollDown
|
|
418
|
+
}, _createSlots({
|
|
419
|
+
_: 2 /* DYNAMIC */
|
|
420
|
+
}, [_renderList(_unref(slots), (_, name) => {
|
|
421
|
+
return {
|
|
422
|
+
name: name,
|
|
423
|
+
fn: _withCtx(slotData => [_renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(slotData || {})))])
|
|
424
|
+
};
|
|
425
|
+
})]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["data-source", "columns", "cell-height", "height", "disable-menu", "row-key", "group-key", "open-group", "row-selection", "readonly", "width"]), _renderSlot(_ctx.$slots, "bodyExtra")], 4 /* STYLE */), showScroll.value ? (_openBlock(), _createElementBlock("div", _hoisted_3, [_createElementVNode("div", {
|
|
426
|
+
ref_key: "scrollBarRef",
|
|
427
|
+
ref: scrollBarRef,
|
|
428
|
+
class: "jetlinks-table-horizontal-scroll-bar",
|
|
429
|
+
style: {
|
|
430
|
+
width: 'calc(100% - 15px)',
|
|
431
|
+
height: '100%',
|
|
432
|
+
overflowX: 'scroll'
|
|
433
|
+
},
|
|
434
|
+
onScroll: onHorizontalScroll
|
|
435
|
+
}, [_createElementVNode("div", {
|
|
436
|
+
style: _normalizeStyle({
|
|
437
|
+
minWidth: horizontalScrollWidth.value + 'px',
|
|
438
|
+
maxWidth: horizontalScrollWidth.value + 'px',
|
|
439
|
+
height: '100%'
|
|
440
|
+
})
|
|
441
|
+
}, null, 4 /* STYLE */)], 544 /* NEED_HYDRATION, NEED_PATCH */), _cache[1] || (_cache[1] = _createElementVNode("div", {
|
|
442
|
+
style: {
|
|
443
|
+
"width": "15px",
|
|
444
|
+
"height": "100%",
|
|
445
|
+
"overflow-x": "hidden"
|
|
446
|
+
}
|
|
447
|
+
}, null, -1 /* CACHED */))])) : _createCommentVNode("v-if", true), _ctx.dataSource.length && _ctx.openGroup ? (_openBlock(), _createBlock(Group, {
|
|
448
|
+
key: 1,
|
|
449
|
+
"active-key": _unref(groupActive).value,
|
|
450
|
+
"onUpdate:activeKey": _cache[0] || (_cache[0] = $event => _unref(groupActive).value = $event),
|
|
451
|
+
options: _unref(groupOptions),
|
|
452
|
+
readonly: __props.readonly,
|
|
453
|
+
onAdd: _unref(addGroup),
|
|
454
|
+
onDelete: groupDelete,
|
|
455
|
+
onEdit: groupEdit,
|
|
456
|
+
onChange: _unref(updateGroupActive)
|
|
457
|
+
}, null, 8 /* PROPS */, ["active-key", "options", "readonly", "onAdd", "onChange"])) : _createCommentVNode("v-if", true)])], 2 /* CLASS */);
|
|
383
458
|
};
|
|
384
459
|
}
|
|
385
|
-
});
|
|
460
|
+
});
|
|
461
|
+
export default __sfc_main__;
|
package/es/EditTable/FormItem.js
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, Fragment as _Fragment } from "vue";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
style: {
|
|
5
|
+
"color": "#1d2129"
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_2 = ["id"];
|
|
9
|
+
import { onBeforeUnmount, computed, reactive, watch, provide } from 'vue';
|
|
3
10
|
import { get, isArray } from 'lodash-es';
|
|
4
11
|
import { useProvideFormItemContext } from 'ant-design-vue/es/form/FormItemContext';
|
|
5
12
|
import { useInjectError, useInjectForm } from './hooks';
|
|
6
13
|
import { TABLE_FORM_ITEM_ERROR } from './consts';
|
|
7
14
|
import genEditTableStyle from './style';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
ATooltip
|
|
15
|
+
const __sfc_main__ = _defineComponent({
|
|
16
|
+
...{
|
|
17
|
+
name: 'JEditTableFormItem'
|
|
12
18
|
},
|
|
19
|
+
__name: 'FormItem',
|
|
13
20
|
props: {
|
|
14
21
|
name: {
|
|
15
22
|
type: [String, Array],
|
|
16
|
-
|
|
23
|
+
required: false
|
|
17
24
|
},
|
|
18
25
|
required: {
|
|
19
26
|
type: Boolean,
|
|
20
|
-
|
|
27
|
+
required: false
|
|
21
28
|
}
|
|
22
29
|
},
|
|
23
30
|
emits: ['change'],
|
|
24
|
-
setup(
|
|
25
|
-
emit
|
|
31
|
+
setup(__props, {
|
|
32
|
+
emit: __emit
|
|
26
33
|
}) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
27
36
|
const prefixCls = computed(() => 'jetlinks-edit-table');
|
|
28
37
|
const [wrapSSR, hashId] = genEditTableStyle(prefixCls);
|
|
29
38
|
const context = useInjectForm();
|
|
@@ -55,7 +64,7 @@ export default defineComponent({
|
|
|
55
64
|
};
|
|
56
65
|
const removeTimer = () => {
|
|
57
66
|
if (hideTimer) {
|
|
58
|
-
|
|
67
|
+
clearTimeout(hideTimer);
|
|
59
68
|
hideTimer = null;
|
|
60
69
|
}
|
|
61
70
|
};
|
|
@@ -67,7 +76,7 @@ export default defineComponent({
|
|
|
67
76
|
const hideErrorTip = () => {
|
|
68
77
|
errorMap.visible = false;
|
|
69
78
|
removeTimer();
|
|
70
|
-
hideTimer =
|
|
79
|
+
hideTimer = setTimeout(() => {
|
|
71
80
|
errorMap.message = '';
|
|
72
81
|
}, 300);
|
|
73
82
|
};
|
|
@@ -130,11 +139,30 @@ export default defineComponent({
|
|
|
130
139
|
}, {
|
|
131
140
|
immediate: true
|
|
132
141
|
});
|
|
133
|
-
return {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
return (_ctx, _cache) => {
|
|
143
|
+
const _component_a_tooltip = _resolveComponent("a-tooltip");
|
|
144
|
+
return _openBlock(), _createElementBlock(_Fragment, null, [_createVNode(_component_a_tooltip, {
|
|
145
|
+
color: "#ffffff",
|
|
146
|
+
"get-popup-container": popContainer,
|
|
147
|
+
"arrow-point-at-center": ""
|
|
148
|
+
}, {
|
|
149
|
+
title: _withCtx(() => [_createElementVNode("span", _hoisted_1, _toDisplayString(errorMap.message), 1 /* TEXT */)]),
|
|
150
|
+
default: _withCtx(() => [errorMap.visible ? (_openBlock(), _createElementBlock("div", {
|
|
151
|
+
key: 0,
|
|
152
|
+
class: _normalizeClass(['jetlinks-table-form-error-target', _unref(hashId), 'hashId'])
|
|
153
|
+
}, null, 2 /* CLASS */)) : _createCommentVNode("v-if", true)]),
|
|
154
|
+
_: 1 /* STABLE */
|
|
155
|
+
}), _createElementVNode("div", {
|
|
156
|
+
id: eventKey.value,
|
|
157
|
+
style: {
|
|
158
|
+
"position": "relative"
|
|
159
|
+
},
|
|
160
|
+
class: _normalizeClass({
|
|
161
|
+
'jetlinks-edit-table-form-has-error': errorMap.message,
|
|
162
|
+
[_unref(hashId)]: true
|
|
163
|
+
})
|
|
164
|
+
}, [_renderSlot(_ctx.$slots, "default")], 10 /* CLASS, PROPS */, _hoisted_2)], 64 /* STABLE_FRAGMENT */);
|
|
138
165
|
};
|
|
139
166
|
}
|
|
140
|
-
});
|
|
167
|
+
});
|
|
168
|
+
export default __sfc_main__;
|