@94ai/nf-table 8.0.5 → 8.0.8
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 +2244 -2244
- package/lib/nf-table.cjs.js +42 -43
- package/lib/nf-table.esm-bundler.js +42 -43
- package/lib/nf-table.vue.d.ts +632 -632
- package/lib/style/css.d.ts +1 -1
- package/lib/style/index.d.ts +1 -1
- package/lib/types.d.ts +281 -281
- package/package/nf-table.vue +42 -42
- package/package/types.ts +2 -2
- package/package.json +9 -9
package/package/nf-table.vue
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
:key="column.key || column.prop || column.type"
|
|
63
63
|
:type="column.type"
|
|
64
64
|
:prop="column.prop"
|
|
65
|
-
:label="column.label"
|
|
65
|
+
:label="resolveValue(column.label)"
|
|
66
66
|
v-bind="column.attr"
|
|
67
67
|
>
|
|
68
68
|
</el-table-column>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
:key="column.key || column.prop || column.type"
|
|
72
72
|
:type="column.type"
|
|
73
73
|
:prop="column.prop"
|
|
74
|
-
:label="column.label"
|
|
74
|
+
:label="resolveValue(column.label)"
|
|
75
75
|
v-bind="column.attr"
|
|
76
76
|
>
|
|
77
77
|
<template slot-scope="scope" v-if="column.slot">
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
:key="column.key || column.prop || column.type"
|
|
85
85
|
:type="column.type"
|
|
86
86
|
:prop="column.prop"
|
|
87
|
-
:label="column.label"
|
|
87
|
+
:label="resolveValue(column.label)"
|
|
88
88
|
v-bind="column.attr"
|
|
89
89
|
>
|
|
90
90
|
<!-- column套column -->
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
name="operationIconColumnCheck"
|
|
102
102
|
:column="column"
|
|
103
103
|
>
|
|
104
|
-
<span style="white-space:nowrap"> {{ column.label }} </span>
|
|
104
|
+
<span style="white-space:nowrap"> {{ resolveValue(column.label) }} </span>
|
|
105
105
|
<el-tooltip
|
|
106
106
|
popper-class="actionTooltipRef"
|
|
107
107
|
placement="top"
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<template v-else-if="column.labelTooltip">
|
|
117
117
|
<el-tooltip :placement="column.labelTooltipPlacement || 'right'" effect="dark">
|
|
118
118
|
<div slot="content">{{ column.labelTooltip }}</div>
|
|
119
|
-
<span class="bottom-line" style="white-space:nowrap"> {{ column.label }} </span>
|
|
119
|
+
<span class="bottom-line" style="white-space:nowrap"> {{ resolveValue(column.label) }} </span>
|
|
120
120
|
</el-tooltip>
|
|
121
121
|
</template>
|
|
122
122
|
<!-- 头部插槽 -->
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
</template>
|
|
126
126
|
<!-- 默认 -->
|
|
127
127
|
<span v-else>
|
|
128
|
-
{{ column.label }}
|
|
128
|
+
{{ resolveValue(column.label) }}
|
|
129
129
|
</span>
|
|
130
130
|
</template>
|
|
131
131
|
<!-- -------------- 内容区域 -------------- -->
|
|
@@ -152,20 +152,20 @@
|
|
|
152
152
|
<template v-for="(item, index) in getOperationListLocal(column, scope)">
|
|
153
153
|
<nf-button
|
|
154
154
|
v-if="!resolveValue(item.destroy, scope.row, scope)"
|
|
155
|
-
:size="item.size || 'mini'"
|
|
156
|
-
:type="resolveValue(item.type || 'primary', scope.row, scope)"
|
|
157
|
-
:text="item.text
|
|
155
|
+
:size="resolveValue(item.size || 'mini', scope.row, scope)"
|
|
156
|
+
:type="resolveValue(item.type || 'primary', scope.row, scope, scope.row, scope)"
|
|
157
|
+
:text="resolveValue(item.text === undefined ? true : item.text, scope.row, scope)"
|
|
158
158
|
:disabled="resolveValue(item.disabled, scope.row, scope)"
|
|
159
159
|
:loading="resolveValue(item.loading, scope.row, scope)"
|
|
160
|
-
:class="item.class"
|
|
161
|
-
:plain="item.plain"
|
|
162
|
-
:icon="item.icon"
|
|
163
|
-
:round="item.round"
|
|
164
|
-
:circle="item.circle"
|
|
165
|
-
:style="item.style"
|
|
160
|
+
:class="resolveValue(item.class, scope.row, scope)"
|
|
161
|
+
:plain="resolveValue(item.plain, scope.row, scope)"
|
|
162
|
+
:icon="resolveValue(item.icon, scope.row, scope)"
|
|
163
|
+
:round="resolveValue(item.round, scope.row, scope)"
|
|
164
|
+
:circle="resolveValue(item.circle, scope.row, scope)"
|
|
165
|
+
:style="resolveValue(item.style, scope.row, scope)"
|
|
166
166
|
v-on="eventsOperationListBtns(item, scope)"
|
|
167
167
|
:key="item.key || index"
|
|
168
|
-
>{{ item.name }}
|
|
168
|
+
>{{ resolveValue(item.name, scope.row, scope) }}
|
|
169
169
|
</nf-button>
|
|
170
170
|
</template>
|
|
171
171
|
</nf-action>
|
|
@@ -200,19 +200,19 @@
|
|
|
200
200
|
<nf-button
|
|
201
201
|
:key="item.key || index"
|
|
202
202
|
v-if="item.element === 'el-button'"
|
|
203
|
-
:size="item.size || 'mini'"
|
|
204
|
-
:type="item.type || 'text'"
|
|
205
|
-
:text="item.text
|
|
203
|
+
:size="resolveValue(item.size || 'mini')"
|
|
204
|
+
:type="resolveValue(item.type || 'text')"
|
|
205
|
+
:text="resolveValue(item.text === undefined ? true : item.text)"
|
|
206
206
|
:disabled="resolveValue(item.disabled)"
|
|
207
207
|
:loading="resolveValue(item.loading)"
|
|
208
|
-
:class="item.class"
|
|
209
|
-
:plain="item.plain"
|
|
210
|
-
:icon="item.icon"
|
|
211
|
-
:round="item.round"
|
|
212
|
-
:circle="item.circle"
|
|
208
|
+
:class="resolveValue(item.class)"
|
|
209
|
+
:plain="resolveValue(item.plain)"
|
|
210
|
+
:icon="resolveValue(item.icon)"
|
|
211
|
+
:round="resolveValue(item.round)"
|
|
212
|
+
:circle="resolveValue(item.circle)"
|
|
213
213
|
:style="getActionBarItemStyle(item, {marginLeft: '0px'})"
|
|
214
214
|
v-on="item.events"
|
|
215
|
-
>{{ item.value }}
|
|
215
|
+
>{{ resolveValue(item.value) }}
|
|
216
216
|
</nf-button>
|
|
217
217
|
<el-checkbox
|
|
218
218
|
:key="item.key || index"
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
:style="getActionBarItemStyle(item)"
|
|
231
231
|
v-if="item.element === 'el-checkbox'"
|
|
232
232
|
v-on="item.events"
|
|
233
|
-
>{{ item.text }}
|
|
233
|
+
>{{ resolveValue(item.text) }}
|
|
234
234
|
</el-checkbox>
|
|
235
235
|
<el-checkbox-group
|
|
236
236
|
:key="item.key || index"
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
:style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '16px'}"
|
|
270
270
|
v-if="itemChildren.element === 'el-checkbox'"
|
|
271
271
|
v-on="itemChildren.events"
|
|
272
|
-
>{{ item.text }}
|
|
272
|
+
>{{ resolveValue(item.text) }}
|
|
273
273
|
</el-checkbox>
|
|
274
274
|
<el-checkbox-button
|
|
275
275
|
:key="itemChildren.key || j"
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
:style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '16px'}"
|
|
288
288
|
v-if="itemChildren.element === 'el-checkbox-button'"
|
|
289
289
|
v-on="itemChildren.events"
|
|
290
|
-
>{{ item.text }}
|
|
290
|
+
>{{ resolveValue(item.text) }}
|
|
291
291
|
</el-checkbox-button>
|
|
292
292
|
</template>
|
|
293
293
|
</template>
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
:style="getActionBarItemStyle(item)"
|
|
309
309
|
v-if="item.element === 'el-checkbox-button'"
|
|
310
310
|
v-on="item.events"
|
|
311
|
-
>{{ item.text }}
|
|
311
|
+
>{{ resolveValue(item.text) }}
|
|
312
312
|
</el-checkbox-button>
|
|
313
313
|
<el-radio
|
|
314
314
|
:key="item.key || index"
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
:style="getActionBarItemStyle(item)"
|
|
323
323
|
v-if="item.element === 'el-radio'"
|
|
324
324
|
v-on="item.events"
|
|
325
|
-
>{{ item.text }}
|
|
325
|
+
>{{ resolveValue(item.text) }}
|
|
326
326
|
</el-radio>
|
|
327
327
|
<el-radio-group
|
|
328
328
|
:key="item.key || index"
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
:style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '16px'}"
|
|
353
353
|
v-if="itemChildren.element === 'el-radio'"
|
|
354
354
|
v-on="itemChildren.events"
|
|
355
|
-
>{{ item.text }}
|
|
355
|
+
>{{ resolveValue(item.text) }}
|
|
356
356
|
</el-radio>
|
|
357
357
|
<el-radio-button
|
|
358
358
|
:key="itemChildren.key || j"
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
:style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '16px'}"
|
|
367
367
|
v-if="itemChildren.element === 'el-radio-button'"
|
|
368
368
|
v-on="itemChildren.events"
|
|
369
|
-
>{{ item.text }}
|
|
369
|
+
>{{ resolveValue(item.text) }}
|
|
370
370
|
</el-radio-button>
|
|
371
371
|
</template>
|
|
372
372
|
</template>
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
:style="getActionBarItemStyle(item)"
|
|
384
384
|
v-if="item.element === 'el-radio-button'"
|
|
385
385
|
v-on="item.events"
|
|
386
|
-
>{{ item.text }}
|
|
386
|
+
>{{ resolveValue(item.text) }}
|
|
387
387
|
</el-radio-button>
|
|
388
388
|
<el-input
|
|
389
389
|
:key="item.key || index"
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
:style="getActionBarItemStyle(item)"
|
|
472
472
|
v-if="item.element === 'el-switch'"
|
|
473
473
|
v-on="item.events"
|
|
474
|
-
>{{ item.text }}
|
|
474
|
+
>{{ resolveValue(item.text) }}
|
|
475
475
|
</el-switch>
|
|
476
476
|
<el-input-number
|
|
477
477
|
:key="item.key || index"
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
v-on="item.events"
|
|
502
502
|
v-bind="item.attr"
|
|
503
503
|
>
|
|
504
|
-
{{ item.value }}
|
|
504
|
+
{{ resolveValue(item.value) }}
|
|
505
505
|
</span>
|
|
506
506
|
</template>
|
|
507
507
|
</template>
|
|
@@ -1051,19 +1051,19 @@ const initCachedData = async () => {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
1053
|
const getMinWidth = (column) => {
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
const columnLabel = resolveValue(column.label)
|
|
1055
|
+
if (columnLabel?.indexOf('$$') === 0) {
|
|
1056
|
+
const value = Number(columnLabel.replace('$$', ''))
|
|
1056
1057
|
if (!Number.isNaN(value) && value) {
|
|
1057
1058
|
return value
|
|
1058
1059
|
}
|
|
1059
1060
|
}
|
|
1060
1061
|
const fs = 14
|
|
1061
|
-
const
|
|
1062
|
-
const char = label.match(/[\u2E80-\u9FFF]/g)
|
|
1062
|
+
const char = columnLabel.match(/[\u2E80-\u9FFF]/g)
|
|
1063
1063
|
const charLen = char ? char.length : 0
|
|
1064
|
-
const num =
|
|
1064
|
+
const num = columnLabel.match(/\d|\./g)
|
|
1065
1065
|
const numLen = num ? num.length : 0
|
|
1066
|
-
const otherLen =
|
|
1066
|
+
const otherLen = columnLabel.length - charLen - numLen
|
|
1067
1067
|
return fs * (charLen * 1 + numLen * 0.7 + otherLen * 0.58) + 20 + (column.sortable ? 24 : 0)
|
|
1068
1068
|
}
|
|
1069
1069
|
|
|
@@ -1092,7 +1092,7 @@ const syncCookiesToTableColumn = async (readCached = true) => {
|
|
|
1092
1092
|
delete item.attr.label
|
|
1093
1093
|
item._index = index
|
|
1094
1094
|
set(item, 'initHidden', item.initHidden)
|
|
1095
|
-
set(item, 'destory',
|
|
1095
|
+
set(item, 'destory', item.destory)
|
|
1096
1096
|
item.__index = index
|
|
1097
1097
|
// 根据id映射文案
|
|
1098
1098
|
set(item, 'optionsTag', {})
|
package/package/types.ts
CHANGED
|
@@ -244,9 +244,9 @@ export interface NfTableColumnAttributes {
|
|
|
244
244
|
_index?: number
|
|
245
245
|
__index?: number
|
|
246
246
|
initHidden?: boolean
|
|
247
|
-
destory?: boolean | ((any) => boolean)
|
|
247
|
+
destory?: boolean | ((any: any) => boolean)
|
|
248
248
|
type?: 'selection' | 'index' | 'expand'
|
|
249
|
-
label?: string
|
|
249
|
+
label?: string | ((any: any) => string)
|
|
250
250
|
addLabel?: string
|
|
251
251
|
prop?: string
|
|
252
252
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-table",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.8",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/common-utils": "^8.0.
|
|
18
|
-
"@94ai/nf-button": "^8.0.
|
|
19
|
-
"@94ai/nf-drawer": "^8.0.
|
|
20
|
-
"@94ai/nf-message": "^8.0.
|
|
21
|
-
"@94ai/nf-search-form": "^8.0.
|
|
22
|
-
"@94ai/nf-tag": "^8.0.
|
|
23
|
-
"@94ai/nf-theme-chalk": "^8.0.
|
|
17
|
+
"@94ai/common-utils": "^8.0.8",
|
|
18
|
+
"@94ai/nf-button": "^8.0.8",
|
|
19
|
+
"@94ai/nf-drawer": "^8.0.8",
|
|
20
|
+
"@94ai/nf-message": "^8.0.8",
|
|
21
|
+
"@94ai/nf-search-form": "^8.0.8",
|
|
22
|
+
"@94ai/nf-tag": "^8.0.8",
|
|
23
|
+
"@94ai/nf-theme-chalk": "^8.0.8",
|
|
24
24
|
"idb-keyval": "^6.2.1",
|
|
25
25
|
"vue-demi": "^0.14.5",
|
|
26
26
|
"vue-router": "3.6.4",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"types": "lib/index.d.ts",
|
|
40
40
|
"main": "lib/nf-table.cjs.js",
|
|
41
41
|
"module": "lib/nf-table.esm-bundler.js",
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "348837ce37e1b93e62681cbd0021bc66cc94e660"
|
|
43
43
|
}
|