@94ai/nf-virtual-select 8.3.23 → 9.0.0

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.
@@ -1,4 +1,439 @@
1
- declare var _default: import("vue").DefineComponent<import("vue").ComponentPropsOptions<import("vue").Data>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<string[]> | import("vue").ExtractPropTypes<import("vue/types/v3-component-props").ComponentObjectPropsOptions<import("vue").Data>>>, {
2
- [x: number]: string;
3
- } | {}>;
4
- export default _default;
1
+ declare var _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
+ headerTag: {
58
+ type: StringConstructor;
59
+ default: string;
60
+ };
61
+ headeClass: {
62
+ type: StringConstructor;
63
+ default: string;
64
+ };
65
+ headerStyle: {
66
+ type: ObjectConstructor;
67
+ default: () => {};
68
+ };
69
+ footerTag: {
70
+ type: StringConstructor;
71
+ default: string;
72
+ };
73
+ footerClass: {
74
+ type: StringConstructor;
75
+ default: string;
76
+ };
77
+ footerStyle: {
78
+ type: ObjectConstructor;
79
+ default: () => {};
80
+ };
81
+ keeps: {
82
+ type: NumberConstructor;
83
+ default: number;
84
+ };
85
+ estimateSize: {
86
+ type: NumberConstructor;
87
+ default: number;
88
+ };
89
+ echoValueTop: {
90
+ type: BooleanConstructor;
91
+ default: boolean;
92
+ };
93
+ extraProps: {
94
+ type: ObjectConstructor;
95
+ default: () => {
96
+ label: string;
97
+ value: string;
98
+ };
99
+ };
100
+ dataComponent: {
101
+ type: ObjectConstructor;
102
+ };
103
+ dataKey: {
104
+ type: (StringConstructor | FunctionConstructor)[];
105
+ default: string;
106
+ };
107
+ value: {
108
+ type: (NumberConstructor | StringConstructor | ArrayConstructor | BooleanConstructor)[];
109
+ default: () => "";
110
+ };
111
+ showTip: {
112
+ type: BooleanConstructor;
113
+ default: boolean;
114
+ };
115
+ keyValue: {
116
+ type: ArrayConstructor;
117
+ default: () => string[];
118
+ };
119
+ itemOptions: {
120
+ type: ObjectConstructor;
121
+ default(): {
122
+ options: never[];
123
+ virtualList: boolean;
124
+ };
125
+ };
126
+ virtualList: {
127
+ type: BooleanConstructor;
128
+ default: boolean;
129
+ };
130
+ options: {
131
+ type: ArrayConstructor;
132
+ default: () => never[];
133
+ };
134
+ placeholder: {
135
+ type: StringConstructor;
136
+ default: undefined;
137
+ };
138
+ multiple: {
139
+ type: BooleanConstructor;
140
+ default: boolean;
141
+ };
142
+ selectAll: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
146
+ selectAllText: {
147
+ type: StringConstructor;
148
+ default: undefined;
149
+ };
150
+ width: {
151
+ type: StringConstructor;
152
+ default: string;
153
+ };
154
+ maxWidth: {
155
+ type: StringConstructor;
156
+ default: undefined;
157
+ };
158
+ height: {
159
+ type: StringConstructor;
160
+ default: string;
161
+ };
162
+ filterable: {
163
+ type: BooleanConstructor;
164
+ default: boolean;
165
+ };
166
+ keywordHighlight: {
167
+ type: BooleanConstructor;
168
+ default: boolean;
169
+ };
170
+ keywordLabelAlias: {
171
+ type: StringConstructor;
172
+ default: string;
173
+ };
174
+ clearable: {
175
+ type: BooleanConstructor;
176
+ default: boolean;
177
+ };
178
+ reserveKeyword: {
179
+ type: BooleanConstructor;
180
+ default: boolean;
181
+ };
182
+ }, {}, {
183
+ itemComponent: never;
184
+ selectArr: never[];
185
+ keyword: string;
186
+ }, {
187
+ localeText(): {
188
+ placeholder: any;
189
+ selectAllText: any;
190
+ };
191
+ isKeywordHighlight(): any;
192
+ config(): {
193
+ 'filter-method'?: any;
194
+ filterable?: boolean | undefined;
195
+ 'popper-class': string;
196
+ };
197
+ currentVal: {
198
+ get(): any;
199
+ set(v: any): void;
200
+ };
201
+ bindProps(): any;
202
+ bindEvents(): any;
203
+ isVirtualSelect(): any;
204
+ isMultipleSelect(): any;
205
+ isReserveKeyword(): any;
206
+ placeholderDesc(): any;
207
+ optionsList(): any;
208
+ nfVirtualSelect(): any;
209
+ matchedCount(): any;
210
+ }, {}, {
211
+ methods: {
212
+ t(path: string, params?: Record<string, any> | undefined): string;
213
+ };
214
+ }, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
215
+ tag: {
216
+ type: StringConstructor;
217
+ default: string;
218
+ };
219
+ offset: {
220
+ type: NumberConstructor;
221
+ default: number;
222
+ };
223
+ start: {
224
+ type: NumberConstructor;
225
+ default: number;
226
+ };
227
+ pageMode: {
228
+ type: BooleanConstructor;
229
+ default: boolean;
230
+ };
231
+ direction: {
232
+ type: StringConstructor;
233
+ default: string;
234
+ };
235
+ topThreshold: {
236
+ type: NumberConstructor;
237
+ default: number;
238
+ };
239
+ bottomThreshold: {
240
+ type: NumberConstructor;
241
+ default: number;
242
+ };
243
+ rootTag: {
244
+ type: StringConstructor;
245
+ default: string;
246
+ };
247
+ wrapTag: {
248
+ type: StringConstructor;
249
+ default: string;
250
+ };
251
+ wrapStyle: {
252
+ type: ObjectConstructor;
253
+ default: () => {};
254
+ };
255
+ itemTag: {
256
+ type: StringConstructor;
257
+ default: string;
258
+ };
259
+ itemClass: {
260
+ type: StringConstructor;
261
+ default: string;
262
+ };
263
+ itemClassAdd: {
264
+ type: FunctionConstructor;
265
+ };
266
+ itemStyle: {
267
+ type: ObjectConstructor;
268
+ default: () => {};
269
+ };
270
+ headerTag: {
271
+ type: StringConstructor;
272
+ default: string;
273
+ };
274
+ headeClass: {
275
+ type: StringConstructor;
276
+ default: string;
277
+ };
278
+ headerStyle: {
279
+ type: ObjectConstructor;
280
+ default: () => {};
281
+ };
282
+ footerTag: {
283
+ type: StringConstructor;
284
+ default: string;
285
+ };
286
+ footerClass: {
287
+ type: StringConstructor;
288
+ default: string;
289
+ };
290
+ footerStyle: {
291
+ type: ObjectConstructor;
292
+ default: () => {};
293
+ };
294
+ keeps: {
295
+ type: NumberConstructor;
296
+ default: number;
297
+ };
298
+ estimateSize: {
299
+ type: NumberConstructor;
300
+ default: number;
301
+ };
302
+ echoValueTop: {
303
+ type: BooleanConstructor;
304
+ default: boolean;
305
+ };
306
+ extraProps: {
307
+ type: ObjectConstructor;
308
+ default: () => {
309
+ label: string;
310
+ value: string;
311
+ };
312
+ };
313
+ dataComponent: {
314
+ type: ObjectConstructor;
315
+ };
316
+ dataKey: {
317
+ type: (StringConstructor | FunctionConstructor)[];
318
+ default: string;
319
+ };
320
+ value: {
321
+ type: (NumberConstructor | StringConstructor | ArrayConstructor | BooleanConstructor)[];
322
+ default: () => "";
323
+ };
324
+ showTip: {
325
+ type: BooleanConstructor;
326
+ default: boolean;
327
+ };
328
+ keyValue: {
329
+ type: ArrayConstructor;
330
+ default: () => string[];
331
+ };
332
+ itemOptions: {
333
+ type: ObjectConstructor;
334
+ default(): {
335
+ options: never[];
336
+ virtualList: boolean;
337
+ };
338
+ };
339
+ virtualList: {
340
+ type: BooleanConstructor;
341
+ default: boolean;
342
+ };
343
+ options: {
344
+ type: ArrayConstructor;
345
+ default: () => never[];
346
+ };
347
+ placeholder: {
348
+ type: StringConstructor;
349
+ default: undefined;
350
+ };
351
+ multiple: {
352
+ type: BooleanConstructor;
353
+ default: boolean;
354
+ };
355
+ selectAll: {
356
+ type: BooleanConstructor;
357
+ default: boolean;
358
+ };
359
+ selectAllText: {
360
+ type: StringConstructor;
361
+ default: undefined;
362
+ };
363
+ width: {
364
+ type: StringConstructor;
365
+ default: string;
366
+ };
367
+ maxWidth: {
368
+ type: StringConstructor;
369
+ default: undefined;
370
+ };
371
+ height: {
372
+ type: StringConstructor;
373
+ default: string;
374
+ };
375
+ filterable: {
376
+ type: BooleanConstructor;
377
+ default: boolean;
378
+ };
379
+ keywordHighlight: {
380
+ type: BooleanConstructor;
381
+ default: boolean;
382
+ };
383
+ keywordLabelAlias: {
384
+ type: StringConstructor;
385
+ default: string;
386
+ };
387
+ clearable: {
388
+ type: BooleanConstructor;
389
+ default: boolean;
390
+ };
391
+ reserveKeyword: {
392
+ type: BooleanConstructor;
393
+ default: boolean;
394
+ };
395
+ }>>, {
396
+ value: string | number | boolean | unknown[];
397
+ showTip: boolean;
398
+ keywordLabelAlias: string;
399
+ tag: string;
400
+ multiple: boolean;
401
+ direction: string;
402
+ height: string;
403
+ maxWidth: string;
404
+ offset: number;
405
+ width: string;
406
+ start: number;
407
+ pageMode: boolean;
408
+ topThreshold: number;
409
+ bottomThreshold: number;
410
+ rootTag: string;
411
+ wrapTag: string;
412
+ wrapStyle: Record<string, any>;
413
+ itemTag: string;
414
+ itemClass: string;
415
+ itemStyle: Record<string, any>;
416
+ headerTag: string;
417
+ headeClass: string;
418
+ headerStyle: Record<string, any>;
419
+ footerTag: string;
420
+ footerClass: string;
421
+ footerStyle: Record<string, any>;
422
+ keeps: number;
423
+ estimateSize: number;
424
+ echoValueTop: boolean;
425
+ extraProps: Record<string, any>;
426
+ dataKey: string | Function;
427
+ keyValue: unknown[];
428
+ itemOptions: Record<string, any>;
429
+ virtualList: boolean;
430
+ options: unknown[];
431
+ placeholder: string;
432
+ selectAll: boolean;
433
+ selectAllText: string;
434
+ filterable: boolean;
435
+ keywordHighlight: boolean;
436
+ clearable: boolean;
437
+ reserveKeyword: boolean;
438
+ }>;
439
+ export default _default;
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -66,7 +66,7 @@
66
66
  <el-checkbox
67
67
  :value="matchedCount === selectArr?.length"
68
68
  @change="toggleCheckAll"
69
- >{{selectAllText}}
69
+ >{{localeText.selectAllText}}
70
70
  <span v-if="selectArr?.length">({{`${matchedCount}/${selectArr?.length}`}})</span>
71
71
  </el-checkbox>
72
72
  </div>
@@ -99,6 +99,8 @@
99
99
  </template>
100
100
 
101
101
  <script>
102
+ import { LocaleMixin } from '@94ai/common-utils'
103
+
102
104
  import virtualList from 'vue-virtual-scroll-list'
103
105
  import ElOptionNode from './el-option-node.vue'
104
106
  import { isEqual } from 'lodash-es'
@@ -106,6 +108,7 @@ import VirtualSelectContainer from './nf-virtual-select-container.vue'
106
108
 
107
109
  export default {
108
110
  name: 'nf-virtual-select',
111
+ mixins: [LocaleMixin],
109
112
  components: {
110
113
  'virtual-list': virtualList,
111
114
  'virtual-select-container': VirtualSelectContainer
@@ -272,7 +275,7 @@ export default {
272
275
  },
273
276
  placeholder: {
274
277
  type: String,
275
- default: '请选择'
278
+ default: undefined
276
279
  },
277
280
  multiple: {
278
281
  type: Boolean,
@@ -286,7 +289,7 @@ export default {
286
289
  /** 全部 文字(兼容国际化翻译) */
287
290
  selectAllText: {
288
291
  type: String,
289
- default: '全部'
292
+ default: undefined
290
293
  },
291
294
  width: {
292
295
  type: String,
@@ -360,6 +363,12 @@ export default {
360
363
  }
361
364
  },
362
365
  computed: {
366
+ localeText() {
367
+ return {
368
+ placeholder: this.placeholder ?? this.t('nf.common.placeholderSelect'),
369
+ selectAllText: this.selectAllText ?? this.t('nf.common.all'),
370
+ }
371
+ },
363
372
  /** 当前条件是否符合关键词高亮 */
364
373
  isKeywordHighlight() {
365
374
  return this.bindProps.keywordHighlight && !!(this.bindProps.filterable || this.isVirtualSelect)
@@ -451,7 +460,7 @@ export default {
451
460
  return this.reserveKeyword || this.itemOptions.reserveKeyword
452
461
  },
453
462
  placeholderDesc() {
454
- return this.itemOptions.placeholder || this.placeholder
463
+ return this.itemOptions.placeholder || this.localeText.placeholder
455
464
  },
456
465
  optionsList() {
457
466
  if (this.options.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-virtual-select",
3
- "version": "8.3.23",
3
+ "version": "9.0.0",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>,DESKTOP-1EDDQ79\\dev026 <liuxiangxiang@94ai.com>",
@@ -11,11 +11,11 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
14
+ "url": "http://gitlab.94ai.pro/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/common-utils": "^8.3.23",
18
- "@94ai/nf-theme-chalk": "^8.3.23",
17
+ "@94ai/common-utils": "^9.0.0",
18
+ "@94ai/nf-theme-chalk": "^9.0.0",
19
19
  "lodash-es": "^4.17.21",
20
20
  "sortablejs": "^1.15.3",
21
21
  "vue-demi": "^0.14.5",
@@ -34,5 +34,5 @@
34
34
  "types": "lib/index.d.ts",
35
35
  "main": "lib/nf-virtual-select.cjs.js",
36
36
  "module": "lib/nf-virtual-select.esm-bundler.js",
37
- "gitHead": "74e871c7972dc4576480bee02b1dc61a3eafc6ba"
37
+ "gitHead": "afe3016f0e42dfb7fedf6cbbe400ec08bf4b8662"
38
38
  }