@neovici/cosmoz-omnitable 12.2.0 → 12.3.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.
@@ -106,6 +106,18 @@ export default `
106
106
  align-items: flex-end;
107
107
  }
108
108
 
109
+ .headerDots {
110
+ align-items: center;
111
+ cursor: default;
112
+ display: flex;
113
+ font-size: 20px;
114
+ height: 30px;
115
+ justify-content: center;
116
+ min-width: 42px;
117
+ padding-bottom: 12px;
118
+ transform: rotate(90deg);
119
+ }
120
+
109
121
  [hidden] {
110
122
  display: none;
111
123
  }
@@ -49,7 +49,7 @@ const Omnitable = (host) => {
49
49
  customElements.define(
50
50
  'cosmoz-omnitable',
51
51
  component(Omnitable, {
52
- observedAttributes: ['hash-param', 'sort-on', 'group-on'],
52
+ observedAttributes: ['hash-param', 'sort-on', 'group-on', 'hide-select-all'],
53
53
  })
54
54
  );
55
55
 
@@ -1,4 +1,5 @@
1
1
  import { html } from 'lit-html';
2
+ import { when } from 'lit-html/directives/when.js';
2
3
 
3
4
  export const renderHeader = ({
4
5
  allSelected,
@@ -11,16 +12,25 @@ export const renderHeader = ({
11
12
  groupOnColumn,
12
13
  setFilterState,
13
14
  settingsConfig,
15
+ hideSelectAll
14
16
  }) => {
15
17
  return html` <sort-and-group-provider .value=${sortAndGroup}>
16
18
  <div class="header" id="header">
17
- <input
18
- class="checkbox all"
19
- type="checkbox"
20
- .checked=${allSelected}
21
- @input=${onAllCheckboxChange}
22
- ?disabled=${!dataIsValid}
23
- />
19
+ ${when(
20
+ !hideSelectAll,
21
+ () => html`<input
22
+ class="checkbox all"
23
+ type="checkbox"
24
+ .checked=${allSelected}
25
+ @input=${onAllCheckboxChange}
26
+ ?disabled=${!dataIsValid}
27
+ />`
28
+ )}
29
+ ${when(
30
+ hideSelectAll,
31
+ () => html`<div class="headerDots"><span>...</span></div>`
32
+ )}
33
+
24
34
  <cosmoz-omnitable-header-row
25
35
  .data=${data}
26
36
  .columns=${columns}
@@ -69,6 +69,7 @@ export const useOmnitable = (host) => {
69
69
  filterFunctions,
70
70
  settingS,
71
71
  setFilterState,
72
+ hideSelectAll: host.hideSelectAll
72
73
  }),
73
74
  list: useList({
74
75
  host,
@@ -48,6 +48,12 @@ export const usePublicInterface = ({ host, visibleData, ...api }) => {
48
48
  selectItem = (item) => {
49
49
  host.shadowRoot.querySelector('#groupedList').select(item);
50
50
  },
51
+ selectAll = () => {
52
+ host.shadowRoot.querySelector('#groupedList').selectAll();
53
+ },
54
+ deselectAll = () => {
55
+ host.shadowRoot.querySelector('#groupedList').deselectAll();
56
+ },
51
57
  deselectItem = (item) => {
52
58
  host.shadowRoot.querySelector('#groupedList').deselect(item);
53
59
  },
@@ -72,6 +78,8 @@ export const usePublicInterface = ({ host, visibleData, ...api }) => {
72
78
  api.sortedFilteredGroupedItems
73
79
  );
74
80
  useNotifyProperty('selectedItems', api.selectedItems);
81
+ useNotifyProperty('sortOn', api.sortOn)
82
+ useNotifyProperty('descending', api.descending)
75
83
 
76
84
  useImperativeApi(
77
85
  {
@@ -80,7 +88,9 @@ export const usePublicInterface = ({ host, visibleData, ...api }) => {
80
88
  replaceItem,
81
89
  replaceItemAtIndex,
82
90
  selectItem,
91
+ selectAll,
83
92
  deselectItem,
93
+ deselectAll,
84
94
  isItemSelected,
85
95
  },
86
96
  [
@@ -89,7 +99,9 @@ export const usePublicInterface = ({ host, visibleData, ...api }) => {
89
99
  replaceItem,
90
100
  replaceItemAtIndex,
91
101
  selectItem,
102
+ selectAll,
92
103
  deselectItem,
104
+ deselectAll,
93
105
  isItemSelected,
94
106
  ]
95
107
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "12.2.0",
3
+ "version": "12.3.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"