@wfrog/vc-ui 1.13.1 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/explorer/docs/data.d.ts +15 -1
- package/dist/es/components/explorer-filter/explorer-filter.d.ts +1 -0
- package/dist/es/components/explorer-filter/explorer-filter.mjs +4 -3
- package/dist/es/components/explorer-filter/explorer-filter.vue.d.ts +1 -0
- package/dist/es/components/explorer-filter/index.css +1 -1
- package/dist/es/components/explorer-list/explorer-list.d.ts +0 -4
- package/dist/es/components/explorer-list/explorer-list.mjs +116 -126
- package/dist/es/components/explorer-list/explorer-list.vue.d.ts +3 -2
- package/dist/es/components/explorer-list/index.css +27 -35
- package/dist/es/components/explorer-table/explorer-table.d.ts +6 -1
- package/dist/es/components/explorer-table/explorer-table.mjs +197 -134
- package/dist/es/components/explorer-table/explorer-table.vue.d.ts +14 -3
- package/dist/es/components/explorer-table/index.css +25 -15
- package/dist/es/components/explorer-tree/explorer-tree.d.ts +0 -4
- package/dist/es/components/explorer-tree/explorer-tree.mjs +16 -41
- package/dist/es/components/explorer-tree/explorer-tree.vue.d.ts +0 -2
- package/dist/es/components/explorer-tree/index.css +26 -32
- package/dist/es/components/icon-picker/components/collections.vue.d.ts +42 -4
- package/dist/es/components/scrollbar/index.css +21 -7
- package/dist/es/components/scrollbar/scrollbar.d.ts +9 -0
- package/dist/es/components/scrollbar/scrollbar.mjs +95 -8
- package/dist/es/components/scrollbar/scrollbar.vue.d.ts +19 -1
- package/dist/es/index.mjs +1 -1
- package/dist/index.css +100 -90
- package/package.json +1 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import { ElTree
|
|
2
|
+
import { ElTree } from 'element-plus/es';
|
|
3
3
|
import 'element-plus/es/components/base/style/css';
|
|
4
|
-
import 'element-plus/es/components/icon/style/css';
|
|
5
4
|
import 'element-plus/es/components/tree/style/css';
|
|
6
|
-
import { defineComponent, useTemplateRef, computed,
|
|
7
|
-
import { Loading } from '@element-plus/icons-vue';
|
|
5
|
+
import { defineComponent, useTemplateRef, computed, watch, ref, onBeforeUnmount, createBlock, openBlock, normalizeClass, withCtx, withDirectives, createVNode, mergeProps, unref, renderSlot, createElementVNode, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, Fragment, renderList, vShow } from 'vue';
|
|
8
6
|
import '../../chunk/D9iEroQw.mjs';
|
|
9
7
|
import { C as Component$3 } from '../button/button.mjs';
|
|
10
8
|
import { i as injectExplorerPanelState } from '../explorer-panel/explorer-panel2.mjs';
|
|
@@ -118,11 +116,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
118
116
|
data: {},
|
|
119
117
|
actions: { default: () => [] },
|
|
120
118
|
treeProps: {},
|
|
121
|
-
emptyText: { default: "没有数据" },
|
|
122
119
|
defaultExpandAll: { type: Boolean, default: true },
|
|
123
|
-
pending: { type: Boolean },
|
|
124
|
-
loading: { type: Boolean },
|
|
125
|
-
loadingText: { default: "数据加载中..." },
|
|
126
120
|
confirmParams: { type: Function, default: (node) => {
|
|
127
121
|
return { msg: `确定要删除 ${node.data.label} 吗?` };
|
|
128
122
|
} },
|
|
@@ -137,6 +131,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
137
131
|
const emits = __emit;
|
|
138
132
|
const treeRef = useTemplateRef("treeRef");
|
|
139
133
|
const { filterKeyword } = injectExplorerPanelState();
|
|
134
|
+
const treeVisible = computed(() => Array.isArray(props.data) && props.data.length > 0);
|
|
140
135
|
const actionsMapping = {
|
|
141
136
|
create: { title: "新增", type: "primary", icon: "Plus" },
|
|
142
137
|
modify: { title: "修改", type: "primary", icon: "Edit" },
|
|
@@ -145,7 +140,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
145
140
|
down: { title: "下移", type: "success", icon: "Bottom" }
|
|
146
141
|
};
|
|
147
142
|
const treeProps = computed(() => ({
|
|
148
|
-
emptyText: props.emptyText,
|
|
149
143
|
defaultExpandAll: props.defaultExpandAll,
|
|
150
144
|
expandOnClickNode: false,
|
|
151
145
|
highlightCurrent: props.highlightCurrent,
|
|
@@ -153,22 +147,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
153
147
|
nodeKey: "value",
|
|
154
148
|
...props.treeProps
|
|
155
149
|
}));
|
|
156
|
-
const myTreeData = ref();
|
|
157
150
|
watch(() => props.disabled, () => {
|
|
158
151
|
if (props.disabled) {
|
|
159
|
-
index.traverse(
|
|
152
|
+
index.traverse(props.data || [], (node) => {
|
|
160
153
|
node.originDisabled = node.disabled;
|
|
161
154
|
node.disabled = true;
|
|
162
155
|
});
|
|
163
156
|
} else {
|
|
164
|
-
index.traverse(
|
|
157
|
+
index.traverse(props.data || [], (node) => {
|
|
165
158
|
node.disabled = node.originDisabled ?? false;
|
|
166
159
|
});
|
|
167
160
|
}
|
|
168
|
-
});
|
|
169
|
-
watch(() => props.data, () => {
|
|
170
|
-
myTreeData.value = props.data;
|
|
171
|
-
}, { immediate: true, deep: true });
|
|
161
|
+
}, { immediate: true });
|
|
172
162
|
function filterNode(value, data) {
|
|
173
163
|
if (!value || !filterKeyword.value) {
|
|
174
164
|
return true;
|
|
@@ -215,7 +205,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
215
205
|
});
|
|
216
206
|
return (_ctx, _cache) => {
|
|
217
207
|
const _component_ElTree = ElTree;
|
|
218
|
-
const _component_ElIcon = ElIcon;
|
|
219
208
|
return openBlock(), createBlock(Component$1, {
|
|
220
209
|
always: "",
|
|
221
210
|
class: normalizeClass(_ctx.$style.scrollbar)
|
|
@@ -224,8 +213,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
224
213
|
withDirectives(createVNode(_component_ElTree, mergeProps({
|
|
225
214
|
ref_key: "treeRef",
|
|
226
215
|
ref: treeRef,
|
|
227
|
-
data:
|
|
228
|
-
},
|
|
216
|
+
data: __props.data
|
|
217
|
+
}, unref(treeProps), {
|
|
229
218
|
class: _ctx.$style.tree,
|
|
230
219
|
"filter-node-method": filterNode,
|
|
231
220
|
onNodeClick: handleNodeClick
|
|
@@ -286,20 +275,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
286
275
|
]),
|
|
287
276
|
_: 3
|
|
288
277
|
}, 16, ["data", "class"]), [
|
|
289
|
-
[vShow,
|
|
290
|
-
])
|
|
291
|
-
__props.loading ? (openBlock(), createElementBlock("div", {
|
|
292
|
-
key: 0,
|
|
293
|
-
class: normalizeClass(_ctx.$style.loading)
|
|
294
|
-
}, [
|
|
295
|
-
createVNode(_component_ElIcon, { class: "is-loading" }, {
|
|
296
|
-
default: withCtx(() => [
|
|
297
|
-
createVNode(unref(Loading))
|
|
298
|
-
]),
|
|
299
|
-
_: 1
|
|
300
|
-
}),
|
|
301
|
-
createTextVNode(toDisplayString(__props.loadingText), 1)
|
|
302
|
-
], 2)) : createCommentVNode("", true)
|
|
278
|
+
[vShow, unref(treeVisible)]
|
|
279
|
+
])
|
|
303
280
|
]),
|
|
304
281
|
_: 3
|
|
305
282
|
}, 8, ["class"]);
|
|
@@ -307,20 +284,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
307
284
|
}
|
|
308
285
|
});
|
|
309
286
|
|
|
310
|
-
/* unplugin-vue-components disabled */const tree = "
|
|
311
|
-
const node = "
|
|
312
|
-
const label = "
|
|
313
|
-
const actions = "
|
|
314
|
-
const remove = "
|
|
315
|
-
const
|
|
316
|
-
const scrollbar = "_scrollbar_oy44a_72";
|
|
287
|
+
/* unplugin-vue-components disabled */const tree = "_tree_1vdtr_1";
|
|
288
|
+
const node = "_node_1vdtr_28";
|
|
289
|
+
const label = "_label_1vdtr_38";
|
|
290
|
+
const actions = "_actions_1vdtr_48";
|
|
291
|
+
const remove = "_remove_1vdtr_61";
|
|
292
|
+
const scrollbar = "_scrollbar_1vdtr_65";
|
|
317
293
|
const style0 = {
|
|
318
294
|
tree: tree,
|
|
319
295
|
node: node,
|
|
320
296
|
label: label,
|
|
321
297
|
actions: actions,
|
|
322
298
|
remove: remove,
|
|
323
|
-
loading: loading,
|
|
324
299
|
scrollbar: scrollbar
|
|
325
300
|
};
|
|
326
301
|
|
|
@@ -2057,8 +2057,6 @@ declare const __VLS_component: import('vue').DefineComponent<IExplorerTreeProps,
|
|
|
2057
2057
|
onNodeClick?: ((value: string | number | undefined, node: Node, instance: ComponentInternalInstance | null, event: MouseEvent) => any) | undefined;
|
|
2058
2058
|
}>, {
|
|
2059
2059
|
disabled: boolean | ((action: string, node: Node) => boolean);
|
|
2060
|
-
loadingText: string;
|
|
2061
|
-
emptyText: string;
|
|
2062
2060
|
highlightCurrent: boolean;
|
|
2063
2061
|
defaultExpandAll: boolean;
|
|
2064
2062
|
actions: ("create" | "modify" | "remove" | "up" | "down" | "action")[];
|
|
@@ -1,69 +1,63 @@
|
|
|
1
1
|
/* source: src/components/explorer-tree/explorer-tree.vue */
|
|
2
|
-
.
|
|
3
|
-
display: flex;
|
|
2
|
+
._tree_1vdtr_1 .el-tree-node__content {
|
|
4
3
|
align-items: center;
|
|
4
|
+
display: flex;
|
|
5
5
|
}
|
|
6
|
-
.
|
|
6
|
+
._tree_1vdtr_1 .el-tree-node__content:hover {
|
|
7
7
|
background-color: var(--vc-highlight-bg-color, var(--el-fill-color-light));
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
._tree_1vdtr_1 .el-tree-node__content:hover .vc-actions {
|
|
10
10
|
display: inline-flex;
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
._tree_1vdtr_1 .el-tree-node:focus > .el-tree-node__content {
|
|
13
13
|
background-color: var(--vc-highlight-bg-color, var(--el-fill-color-light));
|
|
14
14
|
}
|
|
15
|
-
.
|
|
16
|
-
color: var(--el-color-primary);
|
|
15
|
+
._tree_1vdtr_1 .is-current > .el-tree-node__content {
|
|
17
16
|
background-color: var(--vc-highlight-bg-color, var(--el-fill-color-light)) !important;
|
|
17
|
+
color: var(--el-color-primary);
|
|
18
18
|
}
|
|
19
|
-
.
|
|
20
|
-
|
|
19
|
+
._tree_1vdtr_1 .el-tree__empty-block {
|
|
20
|
+
box-sizing: border-box;
|
|
21
21
|
min-height: unset;
|
|
22
22
|
padding: 4px 8px;
|
|
23
|
+
text-align: left;
|
|
23
24
|
}
|
|
24
|
-
.
|
|
25
|
+
._tree_1vdtr_1 .el-tree__empty-text {
|
|
25
26
|
position: static;
|
|
26
27
|
}
|
|
27
|
-
.
|
|
28
|
-
display: flex;
|
|
29
|
-
justify-content: space-between;
|
|
28
|
+
._node_1vdtr_28 {
|
|
30
29
|
align-items: center;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
display: flex;
|
|
31
32
|
flex-grow: 1;
|
|
33
|
+
justify-content: space-between;
|
|
32
34
|
padding: 4px 8px 4px 0;
|
|
33
|
-
box-sizing: border-box;
|
|
34
35
|
width: 100px;
|
|
35
36
|
}
|
|
36
|
-
.
|
|
37
|
+
._label_1vdtr_38 {
|
|
37
38
|
overflow: hidden;
|
|
38
39
|
text-overflow: ellipsis;
|
|
39
|
-
white-space: nowrap;
|
|
40
40
|
transform: translateY(-1px);
|
|
41
|
+
white-space: nowrap;
|
|
41
42
|
}
|
|
42
|
-
.
|
|
43
|
+
._label_1vdtr_38 .iconify {
|
|
43
44
|
margin-right: 4px;
|
|
44
45
|
}
|
|
45
|
-
.
|
|
46
|
-
display: none;
|
|
46
|
+
._actions_1vdtr_48 {
|
|
47
47
|
column-gap: 4px;
|
|
48
|
+
display: none;
|
|
48
49
|
}
|
|
49
|
-
.
|
|
50
|
-
margin-left: 0 !important;
|
|
51
|
-
font-size: 1.2em;
|
|
50
|
+
._actions_1vdtr_48 > button {
|
|
52
51
|
border: 1px solid var(--el-border-color-light) !important;
|
|
52
|
+
font-size: 1.2em;
|
|
53
|
+
margin-left: 0 !important;
|
|
53
54
|
}
|
|
54
|
-
.
|
|
55
|
+
._actions_1vdtr_48 > button:hover {
|
|
55
56
|
border-color: var(--el-border-color-dark) !important;
|
|
56
57
|
}
|
|
57
|
-
.
|
|
58
|
+
._remove_1vdtr_61 {
|
|
58
59
|
transform: translateY(-1px);
|
|
59
60
|
}
|
|
60
|
-
.
|
|
61
|
-
padding: 4px 8px;
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
column-gap: 4px;
|
|
65
|
-
color: var(--el-text-color-secondary);
|
|
66
|
-
}
|
|
67
|
-
._scrollbar_oy44a_72 {
|
|
61
|
+
._scrollbar_1vdtr_65 {
|
|
68
62
|
margin: 0 -8px;
|
|
69
63
|
}
|
|
@@ -14,6 +14,16 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
14
14
|
readonly flex?: boolean | undefined;
|
|
15
15
|
readonly fillHeight?: boolean | undefined;
|
|
16
16
|
readonly viewMargin?: string | undefined;
|
|
17
|
+
readonly scrollLoad?: boolean | undefined;
|
|
18
|
+
readonly scrollLoadDisabled?: boolean | undefined;
|
|
19
|
+
readonly scrollLoadRootMargin?: string | undefined;
|
|
20
|
+
readonly scrollLoadThreshold?: number | undefined;
|
|
21
|
+
readonly loading?: boolean | undefined;
|
|
22
|
+
readonly loadingText?: string | undefined;
|
|
23
|
+
readonly noMoreText?: string | undefined;
|
|
24
|
+
readonly empty?: boolean | undefined;
|
|
25
|
+
readonly emptyText?: string | undefined;
|
|
26
|
+
readonly onLoadMore?: (() => any) | undefined;
|
|
17
27
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
18
28
|
$attrs: {
|
|
19
29
|
[x: string]: unknown;
|
|
@@ -216,6 +226,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
216
226
|
default?: (props: {}) => any;
|
|
217
227
|
};
|
|
218
228
|
}) | null;
|
|
229
|
+
sentinelRef: HTMLDivElement;
|
|
219
230
|
};
|
|
220
231
|
$slots: Readonly<{
|
|
221
232
|
[name: string]: globalThis.Slot | undefined;
|
|
@@ -223,9 +234,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
223
234
|
$root: ComponentPublicInstance | null;
|
|
224
235
|
$parent: ComponentPublicInstance | null;
|
|
225
236
|
$host: Element | null;
|
|
226
|
-
$emit: (event:
|
|
237
|
+
$emit: (event: "loadMore") => void;
|
|
227
238
|
$el: any;
|
|
228
|
-
$options: import('vue').ComponentOptionsBase<Readonly<import('../../scrollbar/scrollbar').IScrollbarProps> & Readonly<{
|
|
239
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('../../scrollbar/scrollbar').IScrollbarProps> & Readonly<{
|
|
240
|
+
onLoadMore?: (() => any) | undefined;
|
|
241
|
+
}>, {
|
|
229
242
|
scrollbarRef: Readonly<globalThis.ShallowRef<({
|
|
230
243
|
$: import('vue').ComponentInternalInstance;
|
|
231
244
|
$data: {};
|
|
@@ -421,10 +434,21 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
421
434
|
default?: (props: {}) => any;
|
|
422
435
|
};
|
|
423
436
|
}) | null>>;
|
|
424
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}
|
|
437
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
438
|
+
loadMore: () => any;
|
|
439
|
+
}, string, {
|
|
440
|
+
loading: boolean;
|
|
425
441
|
flex: boolean;
|
|
426
442
|
fillHeight: boolean;
|
|
427
443
|
viewMargin: string;
|
|
444
|
+
scrollLoad: boolean;
|
|
445
|
+
scrollLoadDisabled: boolean;
|
|
446
|
+
scrollLoadRootMargin: string;
|
|
447
|
+
scrollLoadThreshold: number;
|
|
448
|
+
loadingText: string;
|
|
449
|
+
noMoreText: string;
|
|
450
|
+
empty: boolean;
|
|
451
|
+
emptyText: string;
|
|
428
452
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
429
453
|
beforeCreate?: (() => void) | (() => void)[];
|
|
430
454
|
created?: (() => void) | (() => void)[];
|
|
@@ -446,10 +470,21 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
446
470
|
$nextTick: typeof import('vue').nextTick;
|
|
447
471
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
448
472
|
} & Readonly<{
|
|
473
|
+
loading: boolean;
|
|
449
474
|
flex: boolean;
|
|
450
475
|
fillHeight: boolean;
|
|
451
476
|
viewMargin: string;
|
|
452
|
-
|
|
477
|
+
scrollLoad: boolean;
|
|
478
|
+
scrollLoadDisabled: boolean;
|
|
479
|
+
scrollLoadRootMargin: string;
|
|
480
|
+
scrollLoadThreshold: number;
|
|
481
|
+
loadingText: string;
|
|
482
|
+
noMoreText: string;
|
|
483
|
+
empty: boolean;
|
|
484
|
+
emptyText: string;
|
|
485
|
+
}> & Omit<Readonly<import('../../scrollbar/scrollbar').IScrollbarProps> & Readonly<{
|
|
486
|
+
onLoadMore?: (() => any) | undefined;
|
|
487
|
+
}>, ("loading" | "flex" | "fillHeight" | "viewMargin" | "scrollLoad" | "scrollLoadDisabled" | "scrollLoadRootMargin" | "scrollLoadThreshold" | "loadingText" | "noMoreText" | "empty" | "emptyText") | "scrollbarRef"> & import('vue').ShallowUnwrapRef<{
|
|
453
488
|
scrollbarRef: Readonly<globalThis.ShallowRef<({
|
|
454
489
|
$: import('vue').ComponentInternalInstance;
|
|
455
490
|
$data: {};
|
|
@@ -648,6 +683,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
648
683
|
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
649
684
|
$slots: {
|
|
650
685
|
default?(_: {}): any;
|
|
686
|
+
empty?(_: {}): any;
|
|
687
|
+
loading?(_: {}): any;
|
|
688
|
+
'no-more'?(_: {}): any;
|
|
651
689
|
};
|
|
652
690
|
}) | null;
|
|
653
691
|
}, HTMLDivElement>;
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
/* source: src/components/scrollbar/scrollbar.vue */
|
|
2
|
-
.
|
|
2
|
+
._scrollbar_ro2ve_1 {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
flex-grow: 1;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
8
|
-
flex-grow: 1;
|
|
9
|
-
flex-direction: column;
|
|
7
|
+
._scrollbar_ro2ve_1 > .el-scrollbar__wrap {
|
|
10
8
|
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
flex-grow: 1;
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
._scrollbar_ro2ve_1 > .el-scrollbar__wrap > .el-scrollbar__view {
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
flex-grow: 1;
|
|
16
|
-
margin: var(--
|
|
16
|
+
margin: var(--v64cfbc6c);
|
|
17
17
|
}
|
|
18
|
-
._fill-
|
|
18
|
+
._fill-height_ro2ve_18 {
|
|
19
19
|
height: 10px;
|
|
20
|
+
}
|
|
21
|
+
._sentinel_ro2ve_22 {
|
|
22
|
+
height: 0;
|
|
23
|
+
}
|
|
24
|
+
._loading_ro2ve_26 {
|
|
25
|
+
align-items: center;
|
|
26
|
+
column-gap: 4px;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
padding: 12px;
|
|
30
|
+
}
|
|
31
|
+
._status-text_ro2ve_34 {
|
|
32
|
+
padding: 12px;
|
|
33
|
+
text-align: center;
|
|
20
34
|
}
|
|
@@ -2,4 +2,13 @@ export interface IScrollbarProps {
|
|
|
2
2
|
flex?: boolean;
|
|
3
3
|
fillHeight?: boolean;
|
|
4
4
|
viewMargin?: string;
|
|
5
|
+
scrollLoad?: boolean;
|
|
6
|
+
scrollLoadDisabled?: boolean;
|
|
7
|
+
scrollLoadRootMargin?: string;
|
|
8
|
+
scrollLoadThreshold?: number;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
loadingText?: string;
|
|
11
|
+
noMoreText?: string;
|
|
12
|
+
empty?: boolean;
|
|
13
|
+
emptyText?: string;
|
|
5
14
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import { ElScrollbar } from 'element-plus/es';
|
|
2
|
+
import { ElScrollbar, ElText, ElIcon } from 'element-plus/es';
|
|
3
3
|
import 'element-plus/es/components/base/style/css';
|
|
4
4
|
import 'element-plus/es/components/scrollbar/style/css';
|
|
5
|
-
import
|
|
5
|
+
import 'element-plus/es/components/icon/style/css';
|
|
6
|
+
import 'element-plus/es/components/text/style/css';
|
|
7
|
+
import { defineComponent, useCssVars, useTemplateRef, computed, createBlock, openBlock, normalizeClass, withCtx, renderSlot, createElementBlock, createCommentVNode, createElementVNode, createVNode, createTextVNode, toDisplayString, unref } from 'vue';
|
|
8
|
+
import { Loading } from '@element-plus/icons-vue';
|
|
9
|
+
import { useIntersectionObserver } from '@vueuse/core';
|
|
6
10
|
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
|
|
7
11
|
|
|
8
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -10,15 +14,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
14
|
props: {
|
|
11
15
|
flex: { type: Boolean, default: true },
|
|
12
16
|
fillHeight: { type: Boolean, default: true },
|
|
13
|
-
viewMargin: { default: "0 10px" }
|
|
17
|
+
viewMargin: { default: "0 10px" },
|
|
18
|
+
scrollLoad: { type: Boolean, default: false },
|
|
19
|
+
scrollLoadDisabled: { type: Boolean, default: false },
|
|
20
|
+
scrollLoadRootMargin: { default: "100px" },
|
|
21
|
+
scrollLoadThreshold: { default: 0 },
|
|
22
|
+
loading: { type: Boolean, default: false },
|
|
23
|
+
loadingText: { default: "加载中" },
|
|
24
|
+
noMoreText: { default: "没有更多了" },
|
|
25
|
+
empty: { type: Boolean, default: false },
|
|
26
|
+
emptyText: { default: "暂无数据" }
|
|
14
27
|
},
|
|
15
|
-
|
|
28
|
+
emits: ["loadMore"],
|
|
29
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
16
30
|
useCssVars((_ctx) => ({
|
|
17
|
-
"
|
|
31
|
+
"v64cfbc6c": _ctx.viewMargin
|
|
18
32
|
}));
|
|
33
|
+
const props = __props;
|
|
34
|
+
const emits = __emit;
|
|
19
35
|
const scrollbarRef = useTemplateRef("scrollbarRef");
|
|
36
|
+
const sentinelRef = useTemplateRef("sentinelRef");
|
|
37
|
+
const scrollLoadEnabled = computed(
|
|
38
|
+
() => props.scrollLoad && !props.loading && !props.scrollLoadDisabled
|
|
39
|
+
);
|
|
40
|
+
const scrollRoot = computed(() => scrollbarRef.value?.wrapRef ?? null);
|
|
41
|
+
useIntersectionObserver(
|
|
42
|
+
sentinelRef,
|
|
43
|
+
([{ isIntersecting }]) => {
|
|
44
|
+
if (isIntersecting && scrollLoadEnabled.value) {
|
|
45
|
+
emits("loadMore");
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
root: scrollRoot,
|
|
50
|
+
rootMargin: props.scrollLoadRootMargin,
|
|
51
|
+
threshold: props.scrollLoadThreshold
|
|
52
|
+
}
|
|
53
|
+
);
|
|
20
54
|
__expose({ scrollbarRef });
|
|
21
55
|
return (_ctx, _cache) => {
|
|
56
|
+
const _component_ElText = ElText;
|
|
57
|
+
const _component_ElIcon = ElIcon;
|
|
22
58
|
const _component_ElScrollbar = ElScrollbar;
|
|
23
59
|
return openBlock(), createBlock(_component_ElScrollbar, {
|
|
24
60
|
ref_key: "scrollbarRef",
|
|
@@ -26,7 +62,53 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
62
|
class: normalizeClass({ [_ctx.$style.scrollbar]: __props.flex, [_ctx.$style[`fill-height`]]: __props.fillHeight })
|
|
27
63
|
}, {
|
|
28
64
|
default: withCtx(() => [
|
|
29
|
-
renderSlot(_ctx.$slots, "default")
|
|
65
|
+
!__props.empty ? renderSlot(_ctx.$slots, "default", { key: 0 }) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
66
|
+
createElementVNode("div", {
|
|
67
|
+
class: normalizeClass(_ctx.$style["status-text"])
|
|
68
|
+
}, [
|
|
69
|
+
createVNode(_component_ElText, { type: "info" }, {
|
|
70
|
+
default: withCtx(() => [
|
|
71
|
+
createTextVNode(toDisplayString(__props.emptyText), 1)
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
})
|
|
75
|
+
], 2)
|
|
76
|
+
]),
|
|
77
|
+
__props.scrollLoad && !__props.empty ? (openBlock(), createElementBlock("div", {
|
|
78
|
+
key: 2,
|
|
79
|
+
ref_key: "sentinelRef",
|
|
80
|
+
ref: sentinelRef,
|
|
81
|
+
class: normalizeClass(_ctx.$style.sentinel)
|
|
82
|
+
}, null, 2)) : createCommentVNode("", true),
|
|
83
|
+
__props.loading ? renderSlot(_ctx.$slots, "loading", { key: 3 }, () => [
|
|
84
|
+
createElementVNode("div", {
|
|
85
|
+
class: normalizeClass(_ctx.$style.loading)
|
|
86
|
+
}, [
|
|
87
|
+
createVNode(_component_ElIcon, { class: "is-loading" }, {
|
|
88
|
+
default: withCtx(() => [
|
|
89
|
+
createVNode(unref(Loading))
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}),
|
|
93
|
+
createVNode(_component_ElText, { type: "info" }, {
|
|
94
|
+
default: withCtx(() => [
|
|
95
|
+
createTextVNode(toDisplayString(__props.loadingText), 1)
|
|
96
|
+
]),
|
|
97
|
+
_: 1
|
|
98
|
+
})
|
|
99
|
+
], 2)
|
|
100
|
+
]) : __props.scrollLoadDisabled ? renderSlot(_ctx.$slots, "no-more", { key: 4 }, () => [
|
|
101
|
+
createElementVNode("div", {
|
|
102
|
+
class: normalizeClass(_ctx.$style["status-text"])
|
|
103
|
+
}, [
|
|
104
|
+
createVNode(_component_ElText, { type: "info" }, {
|
|
105
|
+
default: withCtx(() => [
|
|
106
|
+
createTextVNode(toDisplayString(__props.noMoreText), 1)
|
|
107
|
+
]),
|
|
108
|
+
_: 1
|
|
109
|
+
})
|
|
110
|
+
], 2)
|
|
111
|
+
]) : createCommentVNode("", true)
|
|
30
112
|
]),
|
|
31
113
|
_: 3
|
|
32
114
|
}, 8, ["class"]);
|
|
@@ -34,10 +116,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
116
|
}
|
|
35
117
|
});
|
|
36
118
|
|
|
37
|
-
/* unplugin-vue-components disabled */const scrollbar = "
|
|
119
|
+
/* unplugin-vue-components disabled */const scrollbar = "_scrollbar_ro2ve_1";
|
|
120
|
+
const sentinel = "_sentinel_ro2ve_22";
|
|
121
|
+
const loading = "_loading_ro2ve_26";
|
|
38
122
|
const style0 = {
|
|
39
123
|
scrollbar: scrollbar,
|
|
40
|
-
"fill-height": "_fill-
|
|
124
|
+
"fill-height": "_fill-height_ro2ve_18",
|
|
125
|
+
sentinel: sentinel,
|
|
126
|
+
loading: loading,
|
|
127
|
+
"status-text": "_status-text_ro2ve_34"
|
|
41
128
|
};
|
|
42
129
|
|
|
43
130
|
const cssModules = {
|
|
@@ -3,6 +3,9 @@ declare function __VLS_template(): {
|
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
5
|
default?(_: {}): any;
|
|
6
|
+
empty?(_: {}): any;
|
|
7
|
+
loading?(_: {}): any;
|
|
8
|
+
'no-more'?(_: {}): any;
|
|
6
9
|
};
|
|
7
10
|
refs: {
|
|
8
11
|
scrollbarRef: ({
|
|
@@ -200,6 +203,7 @@ declare function __VLS_template(): {
|
|
|
200
203
|
default?: (props: {}) => any;
|
|
201
204
|
};
|
|
202
205
|
}) | null;
|
|
206
|
+
sentinelRef: HTMLDivElement;
|
|
203
207
|
};
|
|
204
208
|
rootEl: any;
|
|
205
209
|
};
|
|
@@ -400,10 +404,23 @@ declare const __VLS_component: import('vue').DefineComponent<IScrollbarProps, {
|
|
|
400
404
|
default?: (props: {}) => any;
|
|
401
405
|
};
|
|
402
406
|
}) | null>>;
|
|
403
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}
|
|
407
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
408
|
+
loadMore: () => any;
|
|
409
|
+
}, string, import('vue').PublicProps, Readonly<IScrollbarProps> & Readonly<{
|
|
410
|
+
onLoadMore?: (() => any) | undefined;
|
|
411
|
+
}>, {
|
|
412
|
+
loading: boolean;
|
|
404
413
|
flex: boolean;
|
|
405
414
|
fillHeight: boolean;
|
|
406
415
|
viewMargin: string;
|
|
416
|
+
scrollLoad: boolean;
|
|
417
|
+
scrollLoadDisabled: boolean;
|
|
418
|
+
scrollLoadRootMargin: string;
|
|
419
|
+
scrollLoadThreshold: number;
|
|
420
|
+
loadingText: string;
|
|
421
|
+
noMoreText: string;
|
|
422
|
+
empty: boolean;
|
|
423
|
+
emptyText: string;
|
|
407
424
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
408
425
|
scrollbarRef: ({
|
|
409
426
|
$: import('vue').ComponentInternalInstance;
|
|
@@ -600,6 +617,7 @@ declare const __VLS_component: import('vue').DefineComponent<IScrollbarProps, {
|
|
|
600
617
|
default?: (props: {}) => any;
|
|
601
618
|
};
|
|
602
619
|
}) | null;
|
|
620
|
+
sentinelRef: HTMLDivElement;
|
|
603
621
|
}, any>;
|
|
604
622
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
605
623
|
export default _default;
|
package/dist/es/index.mjs
CHANGED
|
@@ -164,7 +164,7 @@ const __vite_glob_0_50 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePr
|
|
|
164
164
|
default: _sfc_main$8
|
|
165
165
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
166
166
|
|
|
167
|
-
const version = "1.13.
|
|
167
|
+
const version = "1.13.3";
|
|
168
168
|
|
|
169
169
|
const modules = /* #__PURE__ */ Object.assign({"./components/awesome-icon/awesome-icon.vue": __vite_glob_0_0,"./components/backbottom/backbottom.vue": __vite_glob_0_1,"./components/button/button.vue": __vite_glob_0_2,"./components/chat-container/chat-container.vue": __vite_glob_0_3,"./components/choice-boolean/choice-boolean.vue": __vite_glob_0_4,"./components/choice/choice.vue": __vite_glob_0_5,"./components/color-switch/color-switch.vue": __vite_glob_0_6,"./components/config-provider/config-provider.vue": __vite_glob_0_7,"./components/cropper/cropper.vue": __vite_glob_0_8,"./components/currency/currency.vue": __vite_glob_0_9,"./components/dark-switch/dark-switch.vue": __vite_glob_0_10,"./components/daterange-picker/daterange-picker.vue": __vite_glob_0_11,"./components/dialog-camera-upload/dialog-camera-upload.vue": __vite_glob_0_12,"./components/dialog-map-point/dialog-map-point.vue": __vite_glob_0_13,"./components/dialog-upload-images/dialog-upload-images.vue": __vite_glob_0_14,"./components/dialog/dialog.vue": __vite_glob_0_15,"./components/drag-verify/drag-verify.vue": __vite_glob_0_16,"./components/drawer/drawer.vue": __vite_glob_0_17,"./components/easy-pagination/easy-pagination.vue": __vite_glob_0_18,"./components/el-icon/el-icon.vue": __vite_glob_0_19,"./components/explorer-column-table/explorer-column-table.vue": __vite_glob_0_20,"./components/explorer-container/explorer-container.vue": __vite_glob_0_21,"./components/explorer-filter/explorer-filter.vue": __vite_glob_0_22,"./components/explorer-footer/explorer-footer.vue": __vite_glob_0_23,"./components/explorer-form/explorer-form.vue": __vite_glob_0_24,"./components/explorer-list/explorer-list.vue": __vite_glob_0_25,"./components/explorer-modal-form/explorer-modal-form.vue": __vite_glob_0_26,"./components/explorer-panel/explorer-panel.vue": __vite_glob_0_27,"./components/explorer-query/explorer-query.vue": __vite_glob_0_28,"./components/explorer-table/explorer-table.vue": __vite_glob_0_29,"./components/explorer-tools/explorer-tools.vue": __vite_glob_0_30,"./components/explorer-tree/explorer-tree.vue": __vite_glob_0_31,"./components/explorer/explorer.vue": __vite_glob_0_32,"./components/flag/flag.vue": __vite_glob_0_33,"./components/form-item/form-item.vue": __vite_glob_0_34,"./components/gen-input/gen-input.vue": __vite_glob_0_35,"./components/icon-picker/icon-picker.vue": __vite_glob_0_36,"./components/icon/icon.vue": __vite_glob_0_37,"./components/iconify-icon/iconify-icon.vue": __vite_glob_0_38,"./components/image/image.vue": __vite_glob_0_39,"./components/info-tooltip/info-tooltip.vue": __vite_glob_0_40,"./components/input-number/input-number.vue": __vite_glob_0_41,"./components/input/input.vue": __vite_glob_0_42,"./components/pca-picker/pca-picker.vue": __vite_glob_0_43,"./components/qr-code/qr-code.vue": __vite_glob_0_44,"./components/screenfull/screenfull.vue": __vite_glob_0_45,"./components/scrollbar/scrollbar.vue": __vite_glob_0_46,"./components/select/select.vue": __vite_glob_0_47,"./components/single-player/single-player.vue": __vite_glob_0_48,"./components/splitter-panel/splitter-panel.vue": __vite_glob_0_49,"./components/splitter/splitter.vue": __vite_glob_0_50,"./components/svg-icon/svg-icon.vue": __vite_glob_0_51,"./components/switch/switch.vue": __vite_glob_0_52,"./components/sync-scroll-container/sync-scroll-container.vue": __vite_glob_0_53,"./components/tags/tags.vue": __vite_glob_0_54,"./components/text-ellipsis/text-ellipsis.vue": __vite_glob_0_55,"./components/thousand-input/thousand-input.vue": __vite_glob_0_56,"./components/tinymce/tinymce.vue": __vite_glob_0_57,"./components/transfer-panel/transfer-panel.vue": __vite_glob_0_58,"./components/transfer/transfer.vue": __vite_glob_0_59,"./components/tree-picker/tree-picker.vue": __vite_glob_0_60,"./components/tree-select/tree-select.vue": __vite_glob_0_61,"./components/upload-file/upload-file.vue": __vite_glob_0_62});
|
|
170
170
|
const upper = (_, letter) => letter.toUpperCase();
|