@wfrog/vc-ui 1.13.1 → 1.13.2

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.
@@ -5,6 +5,7 @@ export interface IExplorerFilterProps {
5
5
  create?: boolean;
6
6
  debounce?: number;
7
7
  disabled?: boolean;
8
+ closeFilter?: boolean;
8
9
  }
9
10
  export interface IExplorerFilterEmits {
10
11
  (e: 'filter', keyword: string): void;
@@ -17,12 +17,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  paddingBottom: { default: 8 },
18
18
  create: { type: Boolean },
19
19
  debounce: { default: 300 },
20
- disabled: { type: Boolean }
20
+ disabled: { type: Boolean },
21
+ closeFilter: { type: Boolean, default: false }
21
22
  },
22
23
  emits: ["filter", "create"],
23
24
  setup(__props, { emit: __emit }) {
24
25
  useCssVars((_ctx) => ({
25
- "cd3fe400": `${_ctx.paddingBottom}px`
26
+ "v649a28c7": `${_ctx.paddingBottom}px`
26
27
  }));
27
28
  const props = __props;
28
29
  const emits = __emit;
@@ -32,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
33
  if (filterKeyword.value === keyword.value) {
33
34
  return;
34
35
  }
35
- filterKeyword.value = keyword.value;
36
+ !props.closeFilter && (filterKeyword.value = keyword.value);
36
37
  emits("filter", keyword.value);
37
38
  }
38
39
  const keywordChange = debounce(() => handleFilter(), props.debounce);
@@ -10,5 +10,6 @@ declare const _default: import('vue').DefineComponent<IExplorerFilterProps, {},
10
10
  clearable: boolean;
11
11
  debounce: number;
12
12
  paddingBottom: number;
13
+ closeFilter: boolean;
13
14
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
14
15
  export default _default;
@@ -1,6 +1,6 @@
1
1
  /* source: src/components/explorer-filter/explorer-filter.vue */
2
2
  ._explorer-filter_fuuuf_1 {
3
- padding-bottom: var(--cd3fe400);
3
+ padding-bottom: var(--v649a28c7);
4
4
  display: flex;
5
5
  column-gap: 8px;
6
6
  border-bottom: 1px solid var(--el-border-color-lighter);
@@ -11,10 +11,6 @@ export interface IExplorerListProps {
11
11
  data: IExplorerListItem[];
12
12
  actions?: ('create' | 'modify' | 'remove' | 'up' | 'down' | 'action')[];
13
13
  filterMethod?: (keyword: string, item: IExplorerListItem) => boolean;
14
- emptyText?: string;
15
- pending?: boolean;
16
- loading?: boolean;
17
- loadingText?: string;
18
14
  highlightCurrent?: boolean;
19
15
  cancelHighlight?: boolean;
20
16
  showCheckbox?: boolean;
@@ -1,11 +1,9 @@
1
1
  import './index.css'
2
- import { ElCheckboxGroup, ElCheckbox, ElIcon } from 'element-plus/es';
2
+ import { ElCheckboxGroup, ElCheckbox } 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/checkbox-group/style/css';
6
5
  import 'element-plus/es/components/checkbox/style/css';
7
- import { defineComponent, useCssVars, unref, computed, ref, createBlock, openBlock, normalizeClass, withCtx, withDirectives, createElementBlock, createCommentVNode, createElementVNode, createVNode, isRef, Fragment, renderList, renderSlot, createTextVNode, toDisplayString, mergeProps, vShow } from 'vue';
8
- import { Loading } from '@element-plus/icons-vue';
6
+ import { defineComponent, useCssVars, unref, computed, ref, createBlock, openBlock, normalizeClass, createSlots, withCtx, createVNode, isRef, createElementBlock, Fragment, renderList, renderSlot, createElementVNode, createCommentVNode, createTextVNode, toDisplayString, mergeProps } from 'vue';
9
7
  import { C as Component$3 } from '../button/button.mjs';
10
8
  import { i as injectExplorerPanelState } from '../explorer-panel/explorer-panel2.mjs';
11
9
  import { C as Component$2 } from '../iconify-icon/iconify-icon.mjs';
@@ -23,10 +21,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
21
  filterMethod: { type: Function, default: (keyword, item) => {
24
22
  return item.label.toLowerCase().includes(keyword.toLowerCase());
25
23
  } },
26
- emptyText: { default: "没有数据" },
27
- pending: { type: Boolean },
28
- loading: { type: Boolean },
29
- loadingText: { default: "数据加载中..." },
30
24
  highlightCurrent: { type: Boolean, default: true },
31
25
  cancelHighlight: { type: Boolean, default: false },
32
26
  showCheckbox: { type: Boolean },
@@ -38,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
32
  emits: ["update:modelValue", "valueChange", "itemClick", "create", "modify", "remove", "up", "down"],
39
33
  setup(__props, { expose: __expose, emit: __emit }) {
40
34
  useCssVars((_ctx) => ({
41
- "v7fa588cc": unref(cursorStyle)
35
+ "ac031736": unref(cursorStyle)
42
36
  }));
43
37
  const props = __props;
44
38
  const emits = __emit;
@@ -55,7 +49,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55
49
  const myData = computed(() => {
56
50
  return filterKeyword.value ? props.data.filter((item) => props.filterMethod(filterKeyword.value, item)) : props.data;
57
51
  });
58
- const isEmpty = computed(() => myData.value.length === 0);
59
52
  const cursorStyle = computed(() => props.highlightCurrent ? "pointer" : "unset");
60
53
  function handleClick(item) {
61
54
  if (!props.highlightCurrent) {
@@ -92,141 +85,138 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
92
85
  return (_ctx, _cache) => {
93
86
  const _component_el_checkbox = ElCheckbox;
94
87
  const _component_el_checkbox_group = ElCheckboxGroup;
95
- const _component_ElIcon = ElIcon;
96
88
  return openBlock(), createBlock(Component$1, {
97
89
  always: "",
98
90
  class: normalizeClass(_ctx.$style.scrollbar)
99
- }, {
91
+ }, createSlots({
100
92
  default: withCtx(() => [
101
- withDirectives(createElementVNode("div", null, [
102
- createVNode(_component_el_checkbox_group, {
103
- modelValue: unref(myValue),
104
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(myValue) ? myValue.value = $event : null),
105
- disabled: unref(checkboxGroupDisabled),
106
- onChange: _cache[1] || (_cache[1] = (val) => emits("valueChange", val))
107
- }, {
108
- default: withCtx(() => [
109
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(myData), (item, index) => {
110
- return openBlock(), createElementBlock("div", {
111
- key: item.value,
112
- class: normalizeClass([_ctx.$style.item, { [_ctx.$style.active]: unref(actived) === item.value }]),
113
- onClick: () => handleClick(item)
114
- }, [
115
- renderSlot(_ctx.$slots, "item", {
116
- data: item,
117
- index
118
- }, () => [
119
- createElementVNode("div", {
120
- class: normalizeClass(_ctx.$style.label)
121
- }, [
122
- __props.showCheckbox ? (openBlock(), createBlock(_component_el_checkbox, {
123
- key: 0,
124
- value: item.value
125
- }, {
126
- default: withCtx(() => [
127
- renderSlot(_ctx.$slots, "label", {
128
- data: item,
129
- index
130
- }, () => [
131
- item.icon ? (openBlock(), createBlock(Component$2, {
132
- key: 0,
133
- name: item.icon,
134
- class: normalizeClass(_ctx.$style.icon)
135
- }, null, 8, ["name", "class"])) : createCommentVNode("", true),
136
- createTextVNode(toDisplayString(item.label), 1)
137
- ])
138
- ]),
139
- _: 2
140
- }, 1032, ["value"])) : renderSlot(_ctx.$slots, "label", {
141
- key: 1,
142
- data: item,
143
- index
144
- }, () => [
145
- item.icon ? (openBlock(), createBlock(Component$2, {
146
- key: 0,
147
- name: item.icon,
148
- class: normalizeClass(_ctx.$style.icon)
149
- }, null, 8, ["name", "class"])) : createCommentVNode("", true),
150
- createTextVNode(toDisplayString(item.label), 1)
151
- ])
152
- ], 2),
153
- __props.actions.length ? (openBlock(), createElementBlock("div", {
93
+ createVNode(_component_el_checkbox_group, {
94
+ modelValue: unref(myValue),
95
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(myValue) ? myValue.value = $event : null),
96
+ disabled: unref(checkboxGroupDisabled),
97
+ onChange: _cache[1] || (_cache[1] = (val) => emits("valueChange", val))
98
+ }, {
99
+ default: withCtx(() => [
100
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(myData), (item, index) => {
101
+ return openBlock(), createElementBlock("div", {
102
+ key: item.value,
103
+ class: normalizeClass([_ctx.$style.item, { [_ctx.$style.active]: unref(actived) === item.value }]),
104
+ onClick: () => handleClick(item)
105
+ }, [
106
+ renderSlot(_ctx.$slots, "item", {
107
+ data: item,
108
+ index
109
+ }, () => [
110
+ createElementVNode("div", {
111
+ class: normalizeClass(_ctx.$style.label)
112
+ }, [
113
+ __props.showCheckbox ? (openBlock(), createBlock(_component_el_checkbox, {
154
114
  key: 0,
155
- class: normalizeClass(_ctx.$style.actions)
156
- }, [
157
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (action) => {
158
- return openBlock(), createElementBlock(Fragment, { key: action }, [
159
- action === "action" ? renderSlot(_ctx.$slots, "action", {
115
+ value: item.value
116
+ }, {
117
+ default: withCtx(() => [
118
+ renderSlot(_ctx.$slots, "label", {
119
+ data: item,
120
+ index
121
+ }, () => [
122
+ item.icon ? (openBlock(), createBlock(Component$2, {
160
123
  key: 0,
161
- data: item,
162
- index
163
- }) : (openBlock(), createBlock(Component$3, mergeProps({
164
- key: 1,
165
- ref_for: true
166
- }, actionsMapping[action], {
167
- confirm: action === "remove" ? __props.confirmParams(item) : void 0,
168
- class: action === "remove" ? _ctx.$style.remove : void 0,
169
- link: "",
170
- icon: { type: "el", name: actionsMapping[action].icon },
171
- stop: "",
172
- disabled: myDisabled(action, item),
173
- onClick: ($event) => emits(action, item.value, item)
174
- }), null, 16, ["confirm", "class", "icon", "disabled", "onClick"]))
175
- ], 64);
176
- }), 128))
177
- ], 2)) : createCommentVNode("", true),
178
- renderSlot(_ctx.$slots, "extra-label", {
124
+ name: item.icon,
125
+ class: normalizeClass(_ctx.$style.icon)
126
+ }, null, 8, ["name", "class"])) : createCommentVNode("", true),
127
+ createTextVNode(toDisplayString(item.label), 1)
128
+ ])
129
+ ]),
130
+ _: 2
131
+ }, 1032, ["value"])) : renderSlot(_ctx.$slots, "label", {
132
+ key: 1,
179
133
  data: item,
180
134
  index
181
- })
182
- ])
183
- ], 10, _hoisted_1);
184
- }), 128))
185
- ]),
186
- _: 3
187
- }, 8, ["modelValue", "disabled"])
188
- ], 512), [
189
- [vShow, !__props.loading]
190
- ]),
191
- unref(isEmpty) && !__props.loading && !__props.pending ? (openBlock(), createElementBlock("div", {
192
- key: 0,
193
- class: normalizeClass(_ctx.$style.empty)
194
- }, toDisplayString(__props.emptyText), 3)) : createCommentVNode("", true),
195
- __props.loading ? (openBlock(), createElementBlock("div", {
196
- key: 1,
197
- class: normalizeClass(_ctx.$style.loading)
198
- }, [
199
- createVNode(_component_ElIcon, { class: "is-loading" }, {
200
- default: withCtx(() => [
201
- createVNode(unref(Loading))
202
- ]),
203
- _: 1
204
- }),
205
- createTextVNode(toDisplayString(__props.loadingText), 1)
206
- ], 2)) : createCommentVNode("", true)
135
+ }, () => [
136
+ item.icon ? (openBlock(), createBlock(Component$2, {
137
+ key: 0,
138
+ name: item.icon,
139
+ class: normalizeClass(_ctx.$style.icon)
140
+ }, null, 8, ["name", "class"])) : createCommentVNode("", true),
141
+ createTextVNode(toDisplayString(item.label), 1)
142
+ ])
143
+ ], 2),
144
+ __props.actions.length ? (openBlock(), createElementBlock("div", {
145
+ key: 0,
146
+ class: normalizeClass(_ctx.$style.actions)
147
+ }, [
148
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (action) => {
149
+ return openBlock(), createElementBlock(Fragment, { key: action }, [
150
+ action === "action" ? renderSlot(_ctx.$slots, "action", {
151
+ key: 0,
152
+ data: item,
153
+ index
154
+ }) : (openBlock(), createBlock(Component$3, mergeProps({
155
+ key: 1,
156
+ ref_for: true
157
+ }, actionsMapping[action], {
158
+ confirm: action === "remove" ? __props.confirmParams(item) : void 0,
159
+ class: action === "remove" ? _ctx.$style.remove : void 0,
160
+ link: "",
161
+ icon: { type: "el", name: actionsMapping[action].icon },
162
+ stop: "",
163
+ disabled: myDisabled(action, item),
164
+ onClick: ($event) => emits(action, item.value, item)
165
+ }), null, 16, ["confirm", "class", "icon", "disabled", "onClick"]))
166
+ ], 64);
167
+ }), 128))
168
+ ], 2)) : createCommentVNode("", true),
169
+ renderSlot(_ctx.$slots, "extra-label", {
170
+ data: item,
171
+ index
172
+ })
173
+ ])
174
+ ], 10, _hoisted_1);
175
+ }), 128))
176
+ ]),
177
+ _: 3
178
+ }, 8, ["modelValue", "disabled"])
207
179
  ]),
208
- _: 3
209
- }, 8, ["class"]);
180
+ _: 2
181
+ }, [
182
+ _ctx.$slots.empty ? {
183
+ name: "empty",
184
+ fn: withCtx(() => [
185
+ renderSlot(_ctx.$slots, "empty")
186
+ ]),
187
+ key: "0"
188
+ } : void 0,
189
+ _ctx.$slots.loading ? {
190
+ name: "loading",
191
+ fn: withCtx(() => [
192
+ renderSlot(_ctx.$slots, "loading")
193
+ ]),
194
+ key: "1"
195
+ } : void 0,
196
+ _ctx.$slots["no-more"] ? {
197
+ name: "no-more",
198
+ fn: withCtx(() => [
199
+ renderSlot(_ctx.$slots, "no-more")
200
+ ]),
201
+ key: "2"
202
+ } : void 0
203
+ ]), 1032, ["class"]);
210
204
  };
211
205
  }
212
206
  });
213
207
 
214
- /* unplugin-vue-components disabled */const item = "_item_14vaz_1";
215
- const actions = "_actions_14vaz_16";
216
- const active = "_active_14vaz_20";
217
- const label = "_label_14vaz_25";
218
- const remove = "_remove_14vaz_58";
219
- const empty = "_empty_14vaz_62";
220
- const loading = "_loading_14vaz_63";
221
- const scrollbar = "_scrollbar_14vaz_71";
208
+ /* unplugin-vue-components disabled */const item = "_item_13vx0_1";
209
+ const actions = "_actions_13vx0_16";
210
+ const active = "_active_13vx0_20";
211
+ const label = "_label_13vx0_25";
212
+ const remove = "_remove_13vx0_58";
213
+ const scrollbar = "_scrollbar_13vx0_62";
222
214
  const style0 = {
223
215
  item: item,
224
216
  actions: actions,
225
217
  active: active,
226
218
  label: label,
227
219
  remove: remove,
228
- empty: empty,
229
- loading: loading,
230
220
  scrollbar: scrollbar
231
221
  };
232
222
 
@@ -22,6 +22,9 @@ declare function __VLS_template(): {
22
22
  data: IExplorerListItem<any>;
23
23
  index: number;
24
24
  }): any;
25
+ empty?(_: {}): any;
26
+ loading?(_: {}): any;
27
+ 'no-more'?(_: {}): any;
25
28
  };
26
29
  refs: {};
27
30
  rootEl: any;
@@ -50,9 +53,7 @@ declare const __VLS_component: import('vue').DefineComponent<IExplorerListProps,
50
53
  }>, {
51
54
  data: IExplorerListItem[];
52
55
  disabled: boolean | ((action: string, item: IExplorerListItem) => boolean);
53
- loadingText: string;
54
56
  filterMethod: (keyword: string, item: IExplorerListItem) => boolean;
55
- emptyText: string;
56
57
  highlightCurrent: boolean;
57
58
  actions: ("create" | "modify" | "remove" | "up" | "down" | "action")[];
58
59
  cancelHighlight: boolean;
@@ -1,7 +1,7 @@
1
1
  /* source: src/components/explorer-list/explorer-list.vue */
2
- ._item_14vaz_1 {
2
+ ._item_13vx0_1 {
3
3
  padding: 4px 8px;
4
- cursor: var(--v7fa588cc);
4
+ cursor: var(--ac031736);
5
5
  display: flex;
6
6
  justify-content: space-between;
7
7
  align-items: center;
@@ -11,59 +11,51 @@
11
11
  box-sizing: border-box;
12
12
  line-height: 1;
13
13
  }
14
- ._item_14vaz_1:hover {
14
+ ._item_13vx0_1:hover {
15
15
  background-color: var(--vc-highlight-bg-color, var(--el-fill-color-light));
16
16
  }
17
- ._item_14vaz_1:hover ._actions_14vaz_16 {
17
+ ._item_13vx0_1:hover ._actions_13vx0_16 {
18
18
  display: inline-flex;
19
19
  align-items: flex-start;
20
20
  }
21
- ._item_14vaz_1._active_14vaz_20 {
21
+ ._item_13vx0_1._active_13vx0_20 {
22
22
  color: var(--el-color-primary);
23
23
  background-color: var(--vc-highlight-bg-color, var(--el-fill-color-light));
24
24
  }
25
- ._label_14vaz_25 {
25
+ ._label_13vx0_25 {
26
26
  overflow: hidden;
27
27
  text-overflow: ellipsis;
28
28
  white-space: nowrap;
29
29
  --el-checkbox-height: 24px;
30
30
  }
31
- ._label_14vaz_25 .iconify {
31
+ ._label_13vx0_25 .iconify {
32
32
  margin-right: 4px;
33
33
  }
34
- ._label_14vaz_25 .el-checkbox {
34
+ ._label_13vx0_25 .el-checkbox {
35
35
  width: 100%;
36
36
  }
37
- ._label_14vaz_25 .el-checkbox__label {
37
+ ._label_13vx0_25 .el-checkbox__label {
38
38
  overflow: hidden;
39
39
  text-overflow: ellipsis;
40
40
  white-space: nowrap;
41
41
  color: var(--el-text-color-regular) !important;
42
42
  cursor: pointer !important;
43
43
  }
44
- ._actions_14vaz_16 {
44
+ ._actions_13vx0_16 {
45
45
  display: none;
46
46
  column-gap: 4px;
47
47
  }
48
- ._actions_14vaz_16 > button {
48
+ ._actions_13vx0_16 > button {
49
49
  margin-left: 0 !important;
50
50
  font-size: 1.2em;
51
51
  border: 1px solid var(--el-border-color-light) !important;
52
52
  }
53
- ._actions_14vaz_16 > button:hover {
53
+ ._actions_13vx0_16 > button:hover {
54
54
  border-color: var(--el-border-color-dark) !important;
55
55
  }
56
- ._remove_14vaz_58 {
56
+ ._remove_13vx0_58 {
57
57
  transform: translateY(-1px);
58
58
  }
59
- ._empty_14vaz_62,
60
- ._loading_14vaz_63 {
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_14vaz_71 {
59
+ ._scrollbar_13vx0_62 {
68
60
  margin: 0 -8px;
69
61
  }
@@ -9,7 +9,7 @@ export interface IExplorerTableProps {
9
9
  highlightCurrent?: boolean;
10
10
  empty?: boolean;
11
11
  emptyText?: string;
12
- pending?: boolean;
12
+ noMoreText?: string;
13
13
  loading?: boolean;
14
14
  loadingText?: string;
15
15
  size?: 'small' | 'default' | 'large';
@@ -22,6 +22,10 @@ export interface IExplorerTableProps {
22
22
  }) => string) | string;
23
23
  startIndex?: number;
24
24
  rowKey?: string | ((row: any) => string);
25
+ scrollLoad?: boolean;
26
+ scrollLoadDisabled?: boolean;
27
+ scrollLoadRootMargin?: string;
28
+ scrollLoadThreshold?: number;
25
29
  }
26
30
  export interface IExplorerTableEmits {
27
31
  (e: 'columnEvent', column: IColumnConfig, row: Record<string, any>, value: Record<string, any>): void;
@@ -29,4 +33,5 @@ export interface IExplorerTableEmits {
29
33
  (e: 'multipleSelectionChange', row: Record<string, any>, values: Array<string | number>): void;
30
34
  (e: 'selectionChange', rows: Record<string, any>[]): void;
31
35
  (e: 'selectAll', checked: boolean, values: Array<string | number>): void;
36
+ (e: 'loadMore'): void;
32
37
  }