aio-table 11.0.2 → 11.1.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/index.js +10 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -137,9 +137,6 @@ const AIOTable = (props) => {
|
|
|
137
137
|
}
|
|
138
138
|
return column;
|
|
139
139
|
});
|
|
140
|
-
if (props.onChangeColumns) {
|
|
141
|
-
props.onChangeColumns(updatedColumns);
|
|
142
|
-
}
|
|
143
140
|
setSearchColumns(searchColumns);
|
|
144
141
|
setExcelColumns(excelColumns);
|
|
145
142
|
setFilterColumns(filterColumns);
|
|
@@ -333,7 +330,7 @@ const TableToolbar = () => {
|
|
|
333
330
|
};
|
|
334
331
|
return (_jsxs("div", Object.assign({}, toolbarAttrs, { children: [toolbar && _jsx("div", { className: 'aio-table-toolbar-content', children: typeof toolbar === 'function' ? toolbar() : toolbar }), !!onSearch &&
|
|
335
332
|
_jsx("div", { className: 'aio-table-search', children: _jsx(AIOInput, { type: 'text', onChange: (value) => search(value), after: getIcon('mdiMagnify', 0.7) }) }), sortHook.renderSortButton(), !!excelColumns.length && _jsx("div", { className: 'aio-table-toolbar-button aio-table-excel-button', onClick: () => exportToExcel(), children: getIcon('mdiFileExcel', 0.8) }), !!toggleColumns.length &&
|
|
336
|
-
_jsx("div", { className: 'aio-table-toolbar-button aio-table-toggle-button', children: _jsx(AISelect, { text: getIcon('mdiEye', 0.8), hideTags: true, options: toggleColumns, caret: false, option: {
|
|
333
|
+
_jsx("div", { className: 'aio-table-toolbar-button aio-table-toggle-button', children: _jsx(AISelect, { text: getIcon('mdiEye', 0.8), hideTags: true, options: toggleColumns.map((o) => (Object.assign(Object.assign({}, o), { show: true }))), caret: false, option: {
|
|
337
334
|
text: (column) => getColumnOptionWrapper(column.id, 'title'),
|
|
338
335
|
checked: (column) => getColumnOptionWrapper(column.id, 'show'),
|
|
339
336
|
onClick: (column) => {
|
|
@@ -415,13 +412,16 @@ const TableCell = (props) => {
|
|
|
415
412
|
return columnOption.template(cellDetail);
|
|
416
413
|
}
|
|
417
414
|
const pattern = getColumnOption('pattern', cellDetail);
|
|
418
|
-
if (pattern) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
415
|
+
if (pattern && cellValue) {
|
|
416
|
+
try {
|
|
417
|
+
if (type === 'date') {
|
|
418
|
+
return new AIODate().getDateByPattern(cellValue, pattern);
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
return pattern.replace('{value}', cellValue);
|
|
422
|
+
}
|
|
424
423
|
}
|
|
424
|
+
catch (_a) { }
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
427
|
const templateValue = getTemplateValue();
|