@94ai/nf-virtual-select 3.1.13

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.
@@ -0,0 +1,369 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ tag: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ offset: {
7
+ type: NumberConstructor;
8
+ default: number;
9
+ };
10
+ start: {
11
+ type: NumberConstructor;
12
+ default: number;
13
+ };
14
+ pageMode: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ direction: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ topThreshold: {
23
+ type: NumberConstructor;
24
+ default: number;
25
+ };
26
+ bottomThreshold: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ rootTag: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ wrapTag: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ wrapStyle: {
39
+ type: ObjectConstructor;
40
+ default: () => {};
41
+ };
42
+ itemTag: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ };
46
+ itemClass: {
47
+ type: StringConstructor;
48
+ default: string;
49
+ };
50
+ itemClassAdd: {
51
+ type: FunctionConstructor;
52
+ };
53
+ itemStyle: {
54
+ type: ObjectConstructor;
55
+ default: () => {};
56
+ };
57
+ itemScopedSlots: {
58
+ type: ObjectConstructor;
59
+ default: () => {};
60
+ };
61
+ headerTag: {
62
+ type: StringConstructor;
63
+ default: string;
64
+ };
65
+ headeClass: {
66
+ type: StringConstructor;
67
+ default: string;
68
+ };
69
+ headerStyle: {
70
+ type: ObjectConstructor;
71
+ default: () => {};
72
+ };
73
+ footerTag: {
74
+ type: StringConstructor;
75
+ default: string;
76
+ };
77
+ footerClass: {
78
+ type: StringConstructor;
79
+ default: string;
80
+ };
81
+ footerStyle: {
82
+ type: ObjectConstructor;
83
+ default: () => {};
84
+ };
85
+ keeps: {
86
+ type: NumberConstructor;
87
+ default: number;
88
+ };
89
+ estimateSize: {
90
+ type: NumberConstructor;
91
+ default: number;
92
+ };
93
+ echoValueTop: {
94
+ type: BooleanConstructor;
95
+ default: boolean;
96
+ };
97
+ extraProps: {
98
+ type: ObjectConstructor;
99
+ default: () => {
100
+ label: string;
101
+ value: string;
102
+ };
103
+ };
104
+ dataComponent: {
105
+ type: ObjectConstructor;
106
+ };
107
+ dataKey: {
108
+ type: (StringConstructor | FunctionConstructor)[];
109
+ default: string;
110
+ };
111
+ value: {
112
+ type: (NumberConstructor | StringConstructor | ArrayConstructor)[];
113
+ default: () => "";
114
+ };
115
+ showTip: {
116
+ type: BooleanConstructor;
117
+ default: boolean;
118
+ };
119
+ keyValue: {
120
+ type: ArrayConstructor;
121
+ default: () => string[];
122
+ };
123
+ itemOptions: {
124
+ type: ObjectConstructor;
125
+ default(): {
126
+ options: never[];
127
+ virtualList: boolean;
128
+ };
129
+ };
130
+ virtualList: {
131
+ type: BooleanConstructor;
132
+ default: boolean;
133
+ };
134
+ options: {
135
+ type: ArrayConstructor;
136
+ default: () => never[];
137
+ };
138
+ placeholder: {
139
+ type: StringConstructor;
140
+ default: string;
141
+ };
142
+ multiple: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
146
+ width: {
147
+ type: StringConstructor;
148
+ default: string;
149
+ };
150
+ maxWidth: {
151
+ type: StringConstructor;
152
+ default: undefined;
153
+ };
154
+ height: {
155
+ type: StringConstructor;
156
+ default: string;
157
+ };
158
+ }, {}, {
159
+ itemComponent: any;
160
+ selectArr: never[];
161
+ }, {
162
+ config(): any;
163
+ currentVal: {
164
+ get(): any;
165
+ set(v: any): void;
166
+ };
167
+ bindProps(): any;
168
+ bindEvents(): any;
169
+ isVirtualSelect(): any;
170
+ isMultipleSelect(): any;
171
+ placeholderDesc(): any;
172
+ optionsList(): any;
173
+ nfVirtualSelect(): any;
174
+ }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
175
+ tag: {
176
+ type: StringConstructor;
177
+ default: string;
178
+ };
179
+ offset: {
180
+ type: NumberConstructor;
181
+ default: number;
182
+ };
183
+ start: {
184
+ type: NumberConstructor;
185
+ default: number;
186
+ };
187
+ pageMode: {
188
+ type: BooleanConstructor;
189
+ default: boolean;
190
+ };
191
+ direction: {
192
+ type: StringConstructor;
193
+ default: string;
194
+ };
195
+ topThreshold: {
196
+ type: NumberConstructor;
197
+ default: number;
198
+ };
199
+ bottomThreshold: {
200
+ type: NumberConstructor;
201
+ default: number;
202
+ };
203
+ rootTag: {
204
+ type: StringConstructor;
205
+ default: string;
206
+ };
207
+ wrapTag: {
208
+ type: StringConstructor;
209
+ default: string;
210
+ };
211
+ wrapStyle: {
212
+ type: ObjectConstructor;
213
+ default: () => {};
214
+ };
215
+ itemTag: {
216
+ type: StringConstructor;
217
+ default: string;
218
+ };
219
+ itemClass: {
220
+ type: StringConstructor;
221
+ default: string;
222
+ };
223
+ itemClassAdd: {
224
+ type: FunctionConstructor;
225
+ };
226
+ itemStyle: {
227
+ type: ObjectConstructor;
228
+ default: () => {};
229
+ };
230
+ itemScopedSlots: {
231
+ type: ObjectConstructor;
232
+ default: () => {};
233
+ };
234
+ headerTag: {
235
+ type: StringConstructor;
236
+ default: string;
237
+ };
238
+ headeClass: {
239
+ type: StringConstructor;
240
+ default: string;
241
+ };
242
+ headerStyle: {
243
+ type: ObjectConstructor;
244
+ default: () => {};
245
+ };
246
+ footerTag: {
247
+ type: StringConstructor;
248
+ default: string;
249
+ };
250
+ footerClass: {
251
+ type: StringConstructor;
252
+ default: string;
253
+ };
254
+ footerStyle: {
255
+ type: ObjectConstructor;
256
+ default: () => {};
257
+ };
258
+ keeps: {
259
+ type: NumberConstructor;
260
+ default: number;
261
+ };
262
+ estimateSize: {
263
+ type: NumberConstructor;
264
+ default: number;
265
+ };
266
+ echoValueTop: {
267
+ type: BooleanConstructor;
268
+ default: boolean;
269
+ };
270
+ extraProps: {
271
+ type: ObjectConstructor;
272
+ default: () => {
273
+ label: string;
274
+ value: string;
275
+ };
276
+ };
277
+ dataComponent: {
278
+ type: ObjectConstructor;
279
+ };
280
+ dataKey: {
281
+ type: (StringConstructor | FunctionConstructor)[];
282
+ default: string;
283
+ };
284
+ value: {
285
+ type: (NumberConstructor | StringConstructor | ArrayConstructor)[];
286
+ default: () => "";
287
+ };
288
+ showTip: {
289
+ type: BooleanConstructor;
290
+ default: boolean;
291
+ };
292
+ keyValue: {
293
+ type: ArrayConstructor;
294
+ default: () => string[];
295
+ };
296
+ itemOptions: {
297
+ type: ObjectConstructor;
298
+ default(): {
299
+ options: never[];
300
+ virtualList: boolean;
301
+ };
302
+ };
303
+ virtualList: {
304
+ type: BooleanConstructor;
305
+ default: boolean;
306
+ };
307
+ options: {
308
+ type: ArrayConstructor;
309
+ default: () => never[];
310
+ };
311
+ placeholder: {
312
+ type: StringConstructor;
313
+ default: string;
314
+ };
315
+ multiple: {
316
+ type: BooleanConstructor;
317
+ default: boolean;
318
+ };
319
+ width: {
320
+ type: StringConstructor;
321
+ default: string;
322
+ };
323
+ maxWidth: {
324
+ type: StringConstructor;
325
+ default: undefined;
326
+ };
327
+ height: {
328
+ type: StringConstructor;
329
+ default: string;
330
+ };
331
+ }>>, {
332
+ value: string | number | unknown[];
333
+ showTip: boolean;
334
+ tag: string;
335
+ offset: number;
336
+ start: number;
337
+ pageMode: boolean;
338
+ direction: string;
339
+ topThreshold: number;
340
+ bottomThreshold: number;
341
+ rootTag: string;
342
+ wrapTag: string;
343
+ wrapStyle: Record<string, any>;
344
+ itemTag: string;
345
+ itemClass: string;
346
+ itemStyle: Record<string, any>;
347
+ itemScopedSlots: Record<string, any>;
348
+ headerTag: string;
349
+ headeClass: string;
350
+ headerStyle: Record<string, any>;
351
+ footerTag: string;
352
+ footerClass: string;
353
+ footerStyle: Record<string, any>;
354
+ keeps: number;
355
+ estimateSize: number;
356
+ echoValueTop: boolean;
357
+ extraProps: Record<string, any>;
358
+ dataKey: string | Function;
359
+ keyValue: unknown[];
360
+ itemOptions: Record<string, any>;
361
+ virtualList: boolean;
362
+ options: unknown[];
363
+ placeholder: string;
364
+ multiple: boolean;
365
+ width: string;
366
+ maxWidth: string;
367
+ height: string;
368
+ }>;
369
+ export default _default;
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ import '@94ai/nf-theme-chalk/lib/css/nf-virtual-select.css'
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ import '@94ai/nf-theme-chalk/lib/nf-virtual-select.scss'
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <el-option
3
+ :key="index"
4
+ :label="source[label]"
5
+ :value="source[value]"
6
+ :disabled="source['disabled']"
7
+ >
8
+ <el-tooltip v-if="showTip"
9
+ :content="source[label]"
10
+ :open-delay="1000"
11
+ effect="dark"
12
+ placement="left"
13
+ >
14
+ <span>{{ source[label] }}</span>
15
+ </el-tooltip>
16
+ <span v-else>{{ source[label] }}</span>
17
+ </el-option>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ name: 'ItemComponent',
23
+ props: {
24
+ index: { // 每一行的索引
25
+ type: Number,
26
+ required: true
27
+ },
28
+ source: { // 每一行的内容
29
+ type: Object,
30
+ default() {
31
+ return {}
32
+ }
33
+ },
34
+ label: { // 要显示的名称
35
+ type: String,
36
+ required: true
37
+ },
38
+ value: { // 绑定的值
39
+ type: [String, Number, Array],
40
+ required: true
41
+ },
42
+ showTip: { // 提示
43
+ type: Boolean,
44
+ default: false
45
+ }
46
+ }
47
+ }
48
+ </script>
@@ -0,0 +1,8 @@
1
+ import NfVirtualSelect from './nf-virtual-select.vue'
2
+ import { Vue2, PluginObject } from 'vue-demi'
3
+
4
+ NfVirtualSelect.install = (app: typeof Vue2) => {
5
+ app!.component('nf-virtual-select', NfVirtualSelect)
6
+ }
7
+
8
+ export default NfVirtualSelect as typeof NfVirtualSelect & PluginObject<undefined>
@@ -0,0 +1,68 @@
1
+ <script lang="tsx">
2
+ import {
3
+ defineComponent,
4
+ } from 'vue-demi'
5
+
6
+ export default defineComponent({
7
+ name: 'nf-virtual-select-container',
8
+ props: {
9
+ /**
10
+ * 指定容器类型
11
+ */
12
+ tag: {
13
+ type: String,
14
+ default: 'el-select',
15
+ },
16
+ value: {
17
+ type: [String, Number, Array],
18
+ default: () => '',
19
+ },
20
+ config: {
21
+ type: Object,
22
+ default: () => ({})
23
+ }
24
+ },
25
+ render() {
26
+ const Tag = this.tag;
27
+ const on = this.$listeners
28
+ return (
29
+ <Tag
30
+ ref="nfVirtualSelect"
31
+ {...{
32
+ props: {
33
+ ...this.config,
34
+ value: this.value
35
+ },
36
+ }}
37
+ {...{
38
+ on: {
39
+ ...on,
40
+ input: (val) => {
41
+ if (this.tag === 'el-select' || this.tag === 'custom-select-dropdown') {
42
+ this.$emit('update:value', val)
43
+ this.$emit('change', val)
44
+ this.$emit('input', val)
45
+ }
46
+ },
47
+ }
48
+ }}
49
+ >
50
+ {this.$scopedSlots.default?.({})}
51
+ <template slot="prefix">
52
+ {this.$scopedSlots.prefix?.({})}
53
+ </template>
54
+ <template slot="empty">
55
+ {this.$scopedSlots.empty?.({})}
56
+ </template>
57
+ <template slot="footer">
58
+ {this.$scopedSlots.footer?.({})}
59
+ </template>
60
+ <template slot="header">
61
+ {this.$scopedSlots.header?.({})}
62
+ </template>
63
+ </Tag>
64
+ );
65
+ },
66
+ });
67
+ </script>
68
+