@neovici/cosmoz-omnitable 12.25.2 → 12.26.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.
@@ -13,37 +13,52 @@ export const renderList = ({
13
13
  setSelectedItems,
14
14
  renderItem,
15
15
  renderGroup,
16
+ error,
16
17
  }) => {
17
18
  return html` ${when(
18
- !dataIsValid,
19
- () => html` <div class="tableContent-empty">
20
- <slot name="empty-set-message">
21
- <iron-icon icon="icons:announcement"></iron-icon>
22
- <div class="tableContent-empty-message">
23
- <h3>${_('Working set empty')}</h3>
24
- <p>${_('No data to display')}</p>
25
- </div>
26
- </slot>
27
- </div>`
19
+ !dataIsValid && !error,
20
+ () =>
21
+ html` <div class="tableContent-empty">
22
+ <slot name="empty-set-message">
23
+ <iron-icon icon="icons:announcement"></iron-icon>
24
+ <div class="tableContent-empty-message">
25
+ <h3>${_('Working set empty')}</h3>
26
+ <p>${_('No data to display')}</p>
27
+ </div>
28
+ </slot>
29
+ </div>`,
28
30
  )}
29
31
  ${when(
30
32
  filterIsTooStrict,
31
- () => html` <div class="tableContent-empty">
32
- <iron-icon icon="icons:announcement"></iron-icon>
33
- <div>
34
- <h3>${_('Filter too strict')}</h3>
35
- <p>${_('No matches for selection')}</p>
36
- </div>
37
- </div>`
33
+ () =>
34
+ html` <div class="tableContent-empty">
35
+ <iron-icon icon="icons:announcement"></iron-icon>
36
+ <div>
37
+ <h3>${_('Filter too strict')}</h3>
38
+ <p>${_('No matches for selection')}</p>
39
+ </div>
40
+ </div>`,
38
41
  )}
39
42
  ${when(
40
43
  loading,
41
- () => html` <div class="tableContent-empty overlay">
42
- <paper-spinner-lite active></paper-spinner-lite>
43
- <div>
44
- <h3>${_('Data set is updating')}</h3>
45
- </div>
46
- </div>`
44
+ () =>
45
+ html` <div class="tableContent-empty overlay">
46
+ <paper-spinner-lite active></paper-spinner-lite>
47
+ <div>
48
+ <h3>${_('Data set is updating')}</h3>
49
+ </div>
50
+ </div>`,
51
+ )}
52
+ ${when(
53
+ error,
54
+ () =>
55
+ html` <div class="tableContent-empty overlay">
56
+ <iron-icon icon="icons:error"></iron-icon>
57
+ <div class="tableContent-empty-message">
58
+ <h3>${_('Error loading data')}</h3>
59
+ <p>${error.message}</p>
60
+ </div>
61
+ </div>`,
47
62
  )}
48
63
  <div class="tableContent-scroller" id="scroller">
49
64
  <cosmoz-grouped-list
@@ -14,7 +14,7 @@ const columnSymbol = Symbol('column'),
14
14
  // eslint-disable-next-line no-console
15
15
  console.error(
16
16
  'The name attribute needs to be set on all columns! Missing on column',
17
- column
17
+ column,
18
18
  );
19
19
  });
20
20
 
@@ -29,7 +29,7 @@ const columnSymbol = Symbol('column'),
29
29
  // eslint-disable-next-line no-console
30
30
  console.error(
31
31
  'The name attribute needs to be unique among all columns! Not unique on column',
32
- column
32
+ column,
33
33
  );
34
34
  });
35
35
  return ok;
@@ -50,79 +50,83 @@ const columnSymbol = Symbol('column'),
50
50
  : domColumns.filter((column) => !column.disabled);
51
51
 
52
52
  // eslint-disable-next-line max-lines-per-function
53
- return columns.map((column) => ({
54
- name: column.name,
55
- title: column.title,
56
-
57
- valuePath: column.valuePath ?? column.name,
58
- groupOn: column.groupOn ?? column.valuePath,
59
- sortOn: column.sortOn ?? column.valuePath,
60
-
61
- minWidth: column.minWidth,
62
- width: column.width,
63
- flex: column.flex,
64
- priority: column.priority,
65
-
66
- getString: column.getString,
67
- getComparableValue: column.getComparableValue,
68
- serializeFilter: column.serializeFilter,
69
- deserializeFilter: column.deserializeFilter,
70
- toXlsxValue: column.toXlsxValue,
71
-
72
- renderHeader: column.renderHeader,
73
- renderCell: column.renderCell,
74
- renderEditCell: column.renderEditCell,
75
- renderGroup: column.renderGroup,
76
- cellTitleFn: column.cellTitleFn,
77
- getFilterFn: column.getFilterFn,
78
- headerCellClass: column.headerCellClass,
79
- cellClass: column.cellClass,
80
-
81
- editable: column.editable,
82
-
83
- values: column.values,
84
- source: memooize(column.computeSource),
85
-
86
- noLocalFilter: column.noLocalFilter,
87
-
88
- // @deprecated
89
- loading: column.loading,
90
- externalValues: column.externalValues,
91
- computeSource: column.computeSource,
92
-
93
- // boolean columns
94
- trueLabel: column.trueLabel,
95
- falseLabel: column.falseLabel,
96
-
97
- // list columns
98
- valueProperty: column.valueProperty,
99
- textProperty: column.textProperty,
100
- emptyLabel: column.emptyLabel,
101
- emptyValue: column.emptyValue,
102
-
103
- // range columns
104
- min: column.min,
105
- max: column.max,
106
- locale: column.locale,
107
- autoupdate: column.autoupdate,
108
-
109
- // number columns
110
- maximumFractionDigits: column.maximumFractionDigits,
111
- minimumFractionDigits: column.minimumFractionDigits,
112
-
113
- // amount columns
114
- currency: column.currency,
115
- rates: column.rates,
116
- autodetect: column.autodetect,
117
-
118
- // treenode columns
119
- ownerTree: column.ownerTree,
120
- keyProperty: column.keyProperty,
121
-
122
- ...column.getConfig?.(column),
123
-
124
- [columnSymbol]: column,
125
- }));
53
+ return columns.map((column) => {
54
+ const valuePath = column.valuePath ?? column.name;
55
+
56
+ return {
57
+ name: column.name,
58
+ title: column.title,
59
+
60
+ valuePath,
61
+ groupOn: column.groupOn ?? valuePath,
62
+ sortOn: column.sortOn ?? valuePath,
63
+
64
+ minWidth: column.minWidth,
65
+ width: column.width,
66
+ flex: column.flex,
67
+ priority: column.priority,
68
+
69
+ getString: column.getString,
70
+ getComparableValue: column.getComparableValue,
71
+ serializeFilter: column.serializeFilter,
72
+ deserializeFilter: column.deserializeFilter,
73
+ toXlsxValue: column.toXlsxValue,
74
+
75
+ renderHeader: column.renderHeader,
76
+ renderCell: column.renderCell,
77
+ renderEditCell: column.renderEditCell,
78
+ renderGroup: column.renderGroup,
79
+ cellTitleFn: column.cellTitleFn,
80
+ getFilterFn: column.getFilterFn,
81
+ headerCellClass: column.headerCellClass,
82
+ cellClass: column.cellClass,
83
+
84
+ editable: column.editable,
85
+
86
+ values: column.values,
87
+ source: memooize(column.computeSource),
88
+
89
+ noLocalFilter: column.noLocalFilter,
90
+
91
+ // @deprecated
92
+ loading: column.loading,
93
+ externalValues: column.externalValues,
94
+ computeSource: column.computeSource,
95
+
96
+ // boolean columns
97
+ trueLabel: column.trueLabel,
98
+ falseLabel: column.falseLabel,
99
+
100
+ // list columns
101
+ valueProperty: column.valueProperty,
102
+ textProperty: column.textProperty,
103
+ emptyLabel: column.emptyLabel,
104
+ emptyValue: column.emptyValue,
105
+
106
+ // range columns
107
+ min: column.min,
108
+ max: column.max,
109
+ locale: column.locale,
110
+ autoupdate: column.autoupdate,
111
+
112
+ // number columns
113
+ maximumFractionDigits: column.maximumFractionDigits,
114
+ minimumFractionDigits: column.minimumFractionDigits,
115
+
116
+ // amount columns
117
+ currency: column.currency,
118
+ rates: column.rates,
119
+ autodetect: column.autodetect,
120
+
121
+ // treenode columns
122
+ ownerTree: column.ownerTree,
123
+ keyProperty: column.keyProperty,
124
+
125
+ ...column.getConfig?.(column),
126
+
127
+ [columnSymbol]: column,
128
+ };
129
+ });
126
130
  },
127
131
  useDOMColumns = (host, { enabledColumns }) => {
128
132
  const [columns, setColumns] = useState([]);
package/lib/use-list.js CHANGED
@@ -99,6 +99,7 @@ const _getGroupRowClasses = (folded) =>
99
99
 
100
100
  export const useList = ({
101
101
  host,
102
+ error,
102
103
  dataIsValid,
103
104
  processedItems,
104
105
  columns,
@@ -179,6 +180,7 @@ export const useList = ({
179
180
  loading,
180
181
  compareItemsFn,
181
182
  displayEmptyGroups,
183
+ error,
182
184
 
183
185
  renderItem: useMemo(
184
186
  () =>
@@ -18,6 +18,7 @@ export const useOmnitable = (host) => {
18
18
  noLocal,
19
19
  noLocalSort = noLocal,
20
20
  noLocalFilter = noLocal,
21
+ error
21
22
  } = host,
22
23
  settingS = useSettings({ settingsId, host }),
23
24
  { settings, setSettings, columns, resetRef } = settingS,
@@ -78,6 +79,7 @@ export const useOmnitable = (host) => {
78
79
  }),
79
80
  list: useList({
80
81
  host,
82
+ error,
81
83
  dataIsValid,
82
84
  processedItems,
83
85
  setSelectedItems,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "12.25.2",
3
+ "version": "12.26.1",
4
4
  "description": "[![Build Status](https://travis-ci.org/Neovici/cosmoz-omnitable.svg?branch=master)](https://travis-ci.org/Neovici/cosmoz-omnitable)",
5
5
  "keywords": [
6
6
  "web-components"