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.
Files changed (2) hide show
  1. package/index.js +10 -10
  2. 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
- if (type === 'date') {
420
- return new AIODate().getDateByPattern(cellValue, pattern);
421
- }
422
- else {
423
- return pattern.replace('{value}', cellValue);
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aio-table",
3
- "version": "11.0.2",
3
+ "version": "11.1.0",
4
4
  "description": "all in one table. tree mode , simple mode , tree mode, gantt mode , groupby mode, freeze mode.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",