@neovici/cosmoz-omnitable 12.25.2 → 12.26.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.
@@ -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
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.0",
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"