@94ai/nf-table 8.3.23 → 10.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.
- package/lib/index.d.ts +67 -154
- package/lib/nf-column-check-dialog.vue.d.ts +2 -2
- package/lib/nf-table.cjs.js +318 -182
- package/lib/nf-table.esm-bundler.js +320 -184
- package/lib/nf-table.vue.d.ts +12 -42
- package/lib/types.d.ts +3 -0
- package/package/nf-column-check-drawer.vue +9 -13
- package/package/nf-table.vue +303 -123
- package/package/types.ts +5 -0
- package/package.json +14 -14
package/lib/nf-table.vue.d.ts
CHANGED
|
@@ -143,18 +143,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
143
143
|
columnCheckBeforeClose: undefined;
|
|
144
144
|
columnCheckCenter: boolean;
|
|
145
145
|
columnCheckDestroyOnClose: boolean;
|
|
146
|
-
selectEmptyWarningTips: string;
|
|
147
|
-
columnDisplayBtnText: string;
|
|
148
|
-
columnCheckTitle: string;
|
|
149
|
-
columnCheckCancelButtonText: string;
|
|
150
|
-
columnCheckConfirmButtonText: string;
|
|
151
|
-
columnCheckSearchPlaceholder: string;
|
|
152
|
-
columnCheckFixedLeftDesc: string;
|
|
153
|
-
columnCheckClearDesc: string;
|
|
154
|
-
columnCheckNoFixedDesc: string;
|
|
155
|
-
columnCheckBasicFieldDesc: string;
|
|
156
|
-
columnCheckGetCheckedLengthDesc: (length: any) => (length: any) => string;
|
|
157
|
-
columnCheckGetAllCheckDesc: (length: any) => (length: any) => string;
|
|
158
146
|
drawerProps: () => {};
|
|
159
147
|
virtualized: boolean;
|
|
160
148
|
virtualTableData: () => never[];
|
|
@@ -214,6 +202,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
214
202
|
singleHeadMutiColSlot?: any;
|
|
215
203
|
operationSpan?: number | undefined;
|
|
216
204
|
operationList?: object[] | undefined;
|
|
205
|
+
fit?: {
|
|
206
|
+
tags?: string[] | undefined;
|
|
207
|
+
} | undefined;
|
|
217
208
|
attr?: {
|
|
218
209
|
type?: "index" | "selection" | "expand" | undefined;
|
|
219
210
|
label?: string | undefined;
|
|
@@ -231,7 +222,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
231
222
|
resizable?: boolean | undefined;
|
|
232
223
|
formatter?: Function | undefined;
|
|
233
224
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
234
|
-
align?: "
|
|
225
|
+
align?: "center" | "left" | "right" | undefined;
|
|
235
226
|
'class-name'?: string | undefined;
|
|
236
227
|
'label-class-name'?: string | undefined;
|
|
237
228
|
selectable?: Function | undefined;
|
|
@@ -240,7 +231,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
240
231
|
text?: string | number | undefined;
|
|
241
232
|
value?: string | number | undefined;
|
|
242
233
|
}[] | undefined;
|
|
243
|
-
'filter-placement'?: "
|
|
234
|
+
'filter-placement'?: "top" | "left" | "right" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
244
235
|
'filter-multiple'?: boolean | undefined;
|
|
245
236
|
'filter-method'?: Function | undefined;
|
|
246
237
|
'filtered-value'?: string[] | undefined;
|
|
@@ -418,18 +409,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
418
409
|
columnCheckBeforeClose: undefined;
|
|
419
410
|
columnCheckCenter: boolean;
|
|
420
411
|
columnCheckDestroyOnClose: boolean;
|
|
421
|
-
selectEmptyWarningTips: string;
|
|
422
|
-
columnDisplayBtnText: string;
|
|
423
|
-
columnCheckTitle: string;
|
|
424
|
-
columnCheckCancelButtonText: string;
|
|
425
|
-
columnCheckConfirmButtonText: string;
|
|
426
|
-
columnCheckSearchPlaceholder: string;
|
|
427
|
-
columnCheckFixedLeftDesc: string;
|
|
428
|
-
columnCheckClearDesc: string;
|
|
429
|
-
columnCheckNoFixedDesc: string;
|
|
430
|
-
columnCheckBasicFieldDesc: string;
|
|
431
|
-
columnCheckGetCheckedLengthDesc: (length: any) => (length: any) => string;
|
|
432
|
-
columnCheckGetAllCheckDesc: (length: any) => (length: any) => string;
|
|
433
412
|
drawerProps: () => {};
|
|
434
413
|
virtualized: boolean;
|
|
435
414
|
virtualTableData: () => never[];
|
|
@@ -438,8 +417,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
438
417
|
dragIndicatorPaddingRight: number;
|
|
439
418
|
fixedRightDragEnabled: boolean;
|
|
440
419
|
}>>>, {
|
|
441
|
-
background: string;
|
|
442
|
-
columns: NfTableColumnAttributes[] | any;
|
|
443
420
|
columnEdit: boolean;
|
|
444
421
|
operationPropKey: string;
|
|
445
422
|
storageKey: string;
|
|
@@ -448,9 +425,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
448
425
|
data: Record<string, any>[];
|
|
449
426
|
body: boolean;
|
|
450
427
|
text: string;
|
|
451
|
-
selectEmptyWarningTips: string;
|
|
452
428
|
showColumn: string[];
|
|
453
429
|
viewIdentity: string;
|
|
430
|
+
columns: NfTableColumnAttributes[] | any;
|
|
454
431
|
searchFormAttrs: NfSearchFormAttributes;
|
|
455
432
|
searchFormEvents: Partial<Record<NfSearchFormEventKey, Function>>;
|
|
456
433
|
tableAttrs: ElTableAttributes;
|
|
@@ -480,11 +457,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
480
457
|
columnDisplayBtnCircle: boolean;
|
|
481
458
|
columnDisplayBtnLoading: boolean;
|
|
482
459
|
columnDisplayBtnDisabled: boolean;
|
|
483
|
-
columnDisplayBtnText: string;
|
|
484
|
-
columnCheckTitle: string;
|
|
485
|
-
columnCheckCancelButtonText: string;
|
|
486
|
-
columnCheckConfirmButtonText: string;
|
|
487
|
-
columnCheckBasicFieldDesc: string;
|
|
488
460
|
columnCheckWidth: string;
|
|
489
461
|
columnCheckModalAppendToBody: boolean;
|
|
490
462
|
columnCheckModal: boolean;
|
|
@@ -499,16 +471,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
499
471
|
columnCheckBeforeClose: Function;
|
|
500
472
|
columnCheckCenter: boolean;
|
|
501
473
|
columnCheckDestroyOnClose: boolean;
|
|
502
|
-
columnCheckSearchPlaceholder: string;
|
|
503
|
-
columnCheckFixedLeftDesc: string;
|
|
504
|
-
columnCheckClearDesc: string;
|
|
505
|
-
columnCheckNoFixedDesc: string;
|
|
506
|
-
columnCheckGetCheckedLengthDesc: any;
|
|
507
|
-
columnCheckGetAllCheckDesc: any;
|
|
508
474
|
loading: boolean;
|
|
509
475
|
target: HTMLElement;
|
|
510
476
|
lock: boolean;
|
|
511
477
|
spinner: string;
|
|
478
|
+
background: string;
|
|
512
479
|
alwaysShowPage: boolean;
|
|
513
480
|
drawerProps: Record<string, any>;
|
|
514
481
|
virtualized: boolean;
|
|
@@ -615,6 +582,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
615
582
|
singleHeadMutiColSlot?: any;
|
|
616
583
|
operationSpan?: number | undefined;
|
|
617
584
|
operationList?: object[] | undefined;
|
|
585
|
+
fit?: {
|
|
586
|
+
tags?: string[] | undefined;
|
|
587
|
+
} | undefined;
|
|
618
588
|
attr?: {
|
|
619
589
|
type?: "index" | "selection" | "expand" | undefined;
|
|
620
590
|
label?: string | undefined;
|
|
@@ -632,7 +602,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
632
602
|
resizable?: boolean | undefined;
|
|
633
603
|
formatter?: Function | undefined;
|
|
634
604
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
635
|
-
align?: "
|
|
605
|
+
align?: "center" | "left" | "right" | undefined;
|
|
636
606
|
'class-name'?: string | undefined;
|
|
637
607
|
'label-class-name'?: string | undefined;
|
|
638
608
|
selectable?: Function | undefined;
|
|
@@ -641,7 +611,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
641
611
|
text?: string | number | undefined;
|
|
642
612
|
value?: string | number | undefined;
|
|
643
613
|
}[] | undefined;
|
|
644
|
-
'filter-placement'?: "
|
|
614
|
+
'filter-placement'?: "top" | "left" | "right" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
645
615
|
'filter-multiple'?: boolean | undefined;
|
|
646
616
|
'filter-method'?: Function | undefined;
|
|
647
617
|
'filtered-value'?: string[] | undefined;
|
package/lib/types.d.ts
CHANGED
|
@@ -198,6 +198,9 @@ export interface NfTableColumnAttributes {
|
|
|
198
198
|
singleHeadMutiColSlot?: any;
|
|
199
199
|
operationSpan?: number;
|
|
200
200
|
operationList?: object[];
|
|
201
|
+
fit?: {
|
|
202
|
+
tags?: string[];
|
|
203
|
+
};
|
|
201
204
|
attr?: ElTableColumnAttributes;
|
|
202
205
|
}
|
|
203
206
|
export interface NfTableActionBtnAttributes {
|
|
@@ -291,16 +291,12 @@ const pullAwayColumn = (column) => {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
const insertColumn = (column
|
|
294
|
+
const insertColumn = (column) => {
|
|
295
295
|
if (!unChangedColumn.value.includes(column.prop)) {
|
|
296
296
|
const unFixedIndex = unFixedColumn.value.findIndex(item => item.prop === column.prop)
|
|
297
297
|
const fixedIndex = fixedColumn.value.findIndex(item => item.prop === column.prop)
|
|
298
298
|
if (unFixedIndex === -1 && fixedIndex === -1) {
|
|
299
|
-
|
|
300
|
-
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column)
|
|
301
|
-
} else {
|
|
302
|
-
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).unshift(column)
|
|
303
|
-
}
|
|
299
|
+
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column)
|
|
304
300
|
}
|
|
305
301
|
}
|
|
306
302
|
}
|
|
@@ -368,13 +364,14 @@ const handleCheckAllChange = (v) => {
|
|
|
368
364
|
if (item) {
|
|
369
365
|
item.initHidden = false
|
|
370
366
|
const cloneItem = deepClone(item)
|
|
371
|
-
if (!cloneItem.attr) {
|
|
372
|
-
cloneItem.attr = {}
|
|
373
|
-
}
|
|
374
367
|
newColumns.push(cloneItem)
|
|
375
368
|
}
|
|
376
369
|
})
|
|
377
370
|
currentTable.value = newColumns
|
|
371
|
+
if (columnName.value) {
|
|
372
|
+
searchValue = currentTable.value.filter(item => (item.addLabel || item.label)?.includes(columnName.value))
|
|
373
|
+
setFields(searchValue)
|
|
374
|
+
}
|
|
378
375
|
currentTable.value.map(item => {
|
|
379
376
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
380
377
|
if (item.attr.fixed) {
|
|
@@ -394,7 +391,7 @@ const handleCheckAllChange = (v) => {
|
|
|
394
391
|
searchValue.map(item => {
|
|
395
392
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
396
393
|
if (v) { // 追加
|
|
397
|
-
insertColumn(item
|
|
394
|
+
insertColumn(item)
|
|
398
395
|
} else {
|
|
399
396
|
pullAwayColumn(item)
|
|
400
397
|
}
|
|
@@ -407,7 +404,7 @@ const handleCheckAllChange = (v) => {
|
|
|
407
404
|
currentTable.value.map(item => {
|
|
408
405
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
409
406
|
if (v) { // 追加
|
|
410
|
-
insertColumn(item
|
|
407
|
+
insertColumn(item)
|
|
411
408
|
} else {
|
|
412
409
|
pullAwayColumn(item)
|
|
413
410
|
}
|
|
@@ -432,7 +429,7 @@ const handleCheckedChange = (v, prop) => {
|
|
|
432
429
|
item.initHidden = !v
|
|
433
430
|
// 清除列目时,清除固定属性
|
|
434
431
|
v ? '' : item.attr.fixed = false
|
|
435
|
-
v ? insertColumn(item
|
|
432
|
+
v ? insertColumn(item) : pullAwayColumn(item)
|
|
436
433
|
}
|
|
437
434
|
})
|
|
438
435
|
updateCheckStatus()
|
|
@@ -548,4 +545,3 @@ defineExpose({
|
|
|
548
545
|
drag,
|
|
549
546
|
})
|
|
550
547
|
</script>
|
|
551
|
-
|