aio-table 11.0.2 → 11.1.1
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 +11 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -105,6 +105,7 @@ const AIOTable = (props) => {
|
|
|
105
105
|
return sorts;
|
|
106
106
|
};
|
|
107
107
|
const sortHook = UT.useSort({
|
|
108
|
+
fa: props.fa,
|
|
108
109
|
sorts: [],
|
|
109
110
|
rows: propsRef.current.value,
|
|
110
111
|
onChangeRows: props.onChange,
|
|
@@ -137,9 +138,6 @@ const AIOTable = (props) => {
|
|
|
137
138
|
}
|
|
138
139
|
return column;
|
|
139
140
|
});
|
|
140
|
-
if (props.onChangeColumns) {
|
|
141
|
-
props.onChangeColumns(updatedColumns);
|
|
142
|
-
}
|
|
143
141
|
setSearchColumns(searchColumns);
|
|
144
142
|
setExcelColumns(excelColumns);
|
|
145
143
|
setFilterColumns(filterColumns);
|
|
@@ -333,7 +331,7 @@ const TableToolbar = () => {
|
|
|
333
331
|
};
|
|
334
332
|
return (_jsxs("div", Object.assign({}, toolbarAttrs, { children: [toolbar && _jsx("div", { className: 'aio-table-toolbar-content', children: typeof toolbar === 'function' ? toolbar() : toolbar }), !!onSearch &&
|
|
335
333
|
_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: {
|
|
334
|
+
_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
335
|
text: (column) => getColumnOptionWrapper(column.id, 'title'),
|
|
338
336
|
checked: (column) => getColumnOptionWrapper(column.id, 'show'),
|
|
339
337
|
onClick: (column) => {
|
|
@@ -415,13 +413,16 @@ const TableCell = (props) => {
|
|
|
415
413
|
return columnOption.template(cellDetail);
|
|
416
414
|
}
|
|
417
415
|
const pattern = getColumnOption('pattern', cellDetail);
|
|
418
|
-
if (pattern) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
416
|
+
if (pattern && cellValue) {
|
|
417
|
+
try {
|
|
418
|
+
if (type === 'date') {
|
|
419
|
+
return new AIODate().getDateByPattern(cellValue, pattern);
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
return pattern.replace('{value}', cellValue);
|
|
423
|
+
}
|
|
424
424
|
}
|
|
425
|
+
catch (_a) { }
|
|
425
426
|
}
|
|
426
427
|
};
|
|
427
428
|
const templateValue = getTemplateValue();
|