inviton-powerduck 0.0.78 → 0.0.79
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.
|
@@ -301,6 +301,7 @@ export interface TableColumn {
|
|
|
301
301
|
mobileShouldRenderRow?: (row) => boolean;
|
|
302
302
|
exportInclude?: boolean;
|
|
303
303
|
exportValue?: (row) => any;
|
|
304
|
+
customValue?: (row) => string;
|
|
304
305
|
customRender?: (h, row) => void;
|
|
305
306
|
clientsideFilter?: (row: any, filterDefinition: DataTablePostBackFilterItem) => boolean;
|
|
306
307
|
}
|
|
@@ -1132,6 +1133,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1132
1133
|
let val: any;
|
|
1133
1134
|
if (column?.customFilterValue != null) {
|
|
1134
1135
|
val = column.customFilterValue(p);
|
|
1136
|
+
} else if (column?.customValue != null) {
|
|
1137
|
+
val = column.customValue(p);
|
|
1135
1138
|
} else {
|
|
1136
1139
|
val = p[filterData.PropertyName];
|
|
1137
1140
|
}
|
|
@@ -1151,6 +1154,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1151
1154
|
let propVal: any;
|
|
1152
1155
|
if (column?.customFilterValue != null) {
|
|
1153
1156
|
propVal = column.customFilterValue(p);
|
|
1157
|
+
} else if (column?.customValue != null) {
|
|
1158
|
+
propVal = column.customValue(p);
|
|
1154
1159
|
} else {
|
|
1155
1160
|
propVal = p[filterData.PropertyName];
|
|
1156
1161
|
}
|
|
@@ -1175,6 +1180,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1175
1180
|
let propVal: any;
|
|
1176
1181
|
if (column?.customFilterValue != null) {
|
|
1177
1182
|
propVal = column.customFilterValue(p);
|
|
1183
|
+
} else if (column?.customValue != null) {
|
|
1184
|
+
propVal = column.customValue(p);
|
|
1178
1185
|
} else {
|
|
1179
1186
|
propVal = p[filterData.PropertyName];
|
|
1180
1187
|
}
|
|
@@ -1195,6 +1202,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1195
1202
|
let propVal: any;
|
|
1196
1203
|
if (column?.customFilterValue != null) {
|
|
1197
1204
|
propVal = column.customFilterValue(p);
|
|
1205
|
+
} else if (column?.customValue != null) {
|
|
1206
|
+
propVal = column.customValue(p);
|
|
1198
1207
|
} else {
|
|
1199
1208
|
propVal = p[filterData.PropertyName];
|
|
1200
1209
|
}
|
|
@@ -1219,6 +1228,8 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1219
1228
|
|
|
1220
1229
|
if (column?.customFilterValue != null) {
|
|
1221
1230
|
propVal = column.customFilterValue(row);
|
|
1231
|
+
} else if (column?.customValue != null) {
|
|
1232
|
+
propVal = column.customValue(row);
|
|
1222
1233
|
} else {
|
|
1223
1234
|
propVal = row[propName];
|
|
1224
1235
|
}
|
|
@@ -1756,6 +1767,10 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
1756
1767
|
|
|
1757
1768
|
shouldRenderMobileRowColumn(row, dtColumn: TableColumn): boolean {
|
|
1758
1769
|
if (dtColumn.customRender == null) {
|
|
1770
|
+
if (dtColumn.customValue != null) {
|
|
1771
|
+
return dtColumn.customValue(row) != null;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1759
1774
|
return row[dtColumn.id] != null;
|
|
1760
1775
|
}
|
|
1761
1776
|
|
|
@@ -2025,7 +2040,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
2025
2040
|
</td>
|
|
2026
2041
|
|
|
2027
2042
|
{columns.map((dtColumn, j) => (
|
|
2028
|
-
<td class={this.getTableItemCssClass(dtColumn, j)}>{dtColumn.customRender == null ? row[dtColumn.id] : dtColumn.customRender(h, row)}</td>
|
|
2043
|
+
<td class={this.getTableItemCssClass(dtColumn, j)}>{dtColumn.customRender == null ? (dtColumn.customValue == null ? row[dtColumn.id] : dtColumn.customValue(row)) : dtColumn.customRender(h, row)}</td>
|
|
2029
2044
|
))}
|
|
2030
2045
|
</tr>
|
|
2031
2046
|
))}
|
|
@@ -2051,7 +2066,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
2051
2066
|
</td>
|
|
2052
2067
|
|
|
2053
2068
|
{columns.map((dtColumn, j) => (
|
|
2054
|
-
<td class={this.getTableItemCssClass(dtColumn, j)}>{dtColumn.customRender == null ? row[dtColumn.id] : dtColumn.customRender(h, row)}</td>
|
|
2069
|
+
<td class={this.getTableItemCssClass(dtColumn, j)}>{dtColumn.customRender == null ? (dtColumn.customValue == null ? row[dtColumn.id] : dtColumn.customValue(row)) : dtColumn.customRender(h, row)}</td>
|
|
2055
2070
|
))}
|
|
2056
2071
|
</tr>
|
|
2057
2072
|
))}
|
|
@@ -2151,7 +2166,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
2151
2166
|
{columns.map((dtColumn, j) => (
|
|
2152
2167
|
<div class="dt-vert-item" style={this.getTableColumnOrderStyle(dtColumn, row)}>
|
|
2153
2168
|
<div class="dt-vert-caption">{dtColumn.caption}</div>
|
|
2154
|
-
<div class="dt-vert-value">{dtColumn.customRender == null ? row[dtColumn.id] : dtColumn.customRender(h, row)}</div>
|
|
2169
|
+
<div class="dt-vert-value">{dtColumn.customRender == null ? (dtColumn.customValue == null ? row[dtColumn.id] : dtColumn.customValue(row)) : dtColumn.customRender(h, row)}</div>
|
|
2155
2170
|
</div>
|
|
2156
2171
|
))}
|
|
2157
2172
|
</div>
|
|
@@ -2211,7 +2226,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
2211
2226
|
<div class="dt-mobile-item-inner">
|
|
2212
2227
|
{dtColumn.mobileCaption != false && <div class="dt-mobile-caption">{dtColumn.caption}</div>}
|
|
2213
2228
|
|
|
2214
|
-
<div class="dt-mobile-value">{dtColumn.customRender == null ? row[dtColumn.id] : dtColumn.customRender(h, row)}</div>
|
|
2229
|
+
<div class="dt-mobile-value">{dtColumn.customRender == null ? (dtColumn.customValue == null ? row[dtColumn.id] : dtColumn.customValue(row)) : dtColumn.customRender(h, row)}</div>
|
|
2215
2230
|
</div>
|
|
2216
2231
|
)}
|
|
2217
2232
|
{dtColumn.mobileRender && dtColumn.mobileRender(h, row)}
|
|
@@ -2279,7 +2294,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
|
|
|
2279
2294
|
|
|
2280
2295
|
protected renderColumnValue(h, dtColumn: TableColumn, row) {
|
|
2281
2296
|
if (dtColumn.customRender == null) {
|
|
2282
|
-
return row[dtColumn.id];
|
|
2297
|
+
return (dtColumn.customValue == null ? row[dtColumn.id] : dtColumn.customValue(row));
|
|
2283
2298
|
} else {
|
|
2284
2299
|
return dtColumn.customRender(h, row);
|
|
2285
2300
|
}
|
|
@@ -17,8 +17,8 @@ interface TableExportModalArgs {
|
|
|
17
17
|
apiClient: IWebApiClient
|
|
18
18
|
apiMethod: WebClientApiMethod
|
|
19
19
|
apiArgs?: any
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
exportConfig: DataTableExportConfig
|
|
21
|
+
paginationOffset?: number;
|
|
22
22
|
paginationLength: number;
|
|
23
23
|
totalFilteredCount: number;
|
|
24
24
|
}
|
|
@@ -73,20 +73,20 @@ class TableExportModalComponent extends TsxComponent<TableExportModalBindingArgs
|
|
|
73
73
|
ajaxArgs.PaginationPosition = steps + 1;
|
|
74
74
|
ajaxArgs.PaginationLength = paginationLength || STEP_COUNT;
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
if (exportConfig != null) {
|
|
77
|
+
if (exportConfig.limitName != null) {
|
|
78
|
+
ajaxArgs[exportConfig.limitName] = paginationLength || STEP_COUNT;
|
|
79
|
+
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
if (exportConfig.pageName != null) {
|
|
82
|
+
ajaxArgs[exportConfig.pageName] = steps + 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
85
|
|
|
86
86
|
var mySelf = this;
|
|
87
87
|
apiClient[apiMethod](ajaxArgs).then((data: any) => {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
const attrName = exportConfig != null && exportConfig.attrName != null ? exportConfig.attrName : 'Rows';
|
|
89
|
+
const rows = data[attrName];
|
|
90
90
|
|
|
91
91
|
rows.forEach(function (row) {
|
|
92
92
|
mySelf.rows.push(row);
|
|
@@ -150,6 +150,8 @@ class TableExportModalComponent extends TsxComponent<TableExportModalBindingArgs
|
|
|
150
150
|
if (col.exportInclude != false) {
|
|
151
151
|
if (col.exportValue != null) {
|
|
152
152
|
rowExportData.push(col.exportValue(row));
|
|
153
|
+
} else if (col.customValue != null) {
|
|
154
|
+
rowExportData.push(col.customValue(row));
|
|
153
155
|
} else {
|
|
154
156
|
rowExportData.push(row[col.id]);
|
|
155
157
|
}
|
|
@@ -196,5 +198,5 @@ class TableExportModalComponent extends TsxComponent<TableExportModalBindingArgs
|
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
|
|
199
|
-
const TableExportModal = toNative(TableExportModalComponent)
|
|
200
|
-
export default TableExportModal
|
|
201
|
+
const TableExportModal = toNative(TableExportModalComponent)
|
|
202
|
+
export default TableExportModal
|