@neovici/cosmoz-omnitable 14.11.1 → 14.12.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.
@@ -1,7 +1,8 @@
1
1
  import { layout } from './layout';
2
+ import { findLastIndex } from './utils';
2
3
 
3
4
  const _toCss = (layout, config) => {
4
- const lastVisibleIndex = layout.findLastIndex(
5
+ const lastVisibleIndex = findLastIndex(layout,
5
6
  (width) => width != null && width > 0,
6
7
  ),
7
8
  generateCellCSS = (itemName, width) =>
@@ -9,12 +9,16 @@ export default css`
9
9
  max-height: var(--ot-height, 60vh);
10
10
  outline: none;
11
11
  min-width: 270px;
12
+ background-color: var(--cosmoz-omnitable-settings-bg-color, #fff);
12
13
  }
13
14
 
14
15
  .headline {
15
16
  font-weight: 500;
16
17
  font-size: 13px;
17
- color: var(--cosmoz-omnitable-settings-color, #101010);
18
+ color: var(
19
+ --cosmoz-omnitable-settings-color,
20
+ var(--cz-text-color, #101010)
21
+ );
18
22
  text-transform: uppercase;
19
23
  line-height: 0.95;
20
24
  padding: 10px 14px;
@@ -35,7 +39,10 @@ export default css`
35
39
  scrollbar-gutter: stable;
36
40
  text-transform: uppercase;
37
41
  font-size: 12px;
38
- color: var(--cosmoz-omnitable-settings-color, #101010);
42
+ color: var(
43
+ --cosmoz-omnitable-settings-color,
44
+ var(--cz-text-color, #101010)
45
+ );
39
46
  }
40
47
  .contents::-webkit-scrollbar {
41
48
  width: 2px;
@@ -52,7 +59,10 @@ export default css`
52
59
  box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.15);
53
60
  font-weight: 400;
54
61
  font-size: 13px;
55
- color: var(--cosmoz-omnitable-settings-color, #101010);
62
+ color: var(
63
+ --cosmoz-omnitable-settings-color,
64
+ var(--cz-text-color, #101010)
65
+ );
56
66
  line-height: 0.95;
57
67
  padding: 14px;
58
68
  display: flex;
@@ -80,7 +90,10 @@ export default css`
80
90
  .item {
81
91
  display: flex;
82
92
  align-items: center;
83
- background: var(--cosmoz-omnitable-settings-item-bg-color, #fff);
93
+ background: var(
94
+ --cosmoz-omnitable-settings-item-bg-color,
95
+ var(--cz-surface-light, #fff)
96
+ );
84
97
  }
85
98
  .item.drag {
86
99
  opacity: 0.6;
@@ -98,12 +111,19 @@ export default css`
98
111
  background: transparent;
99
112
  cursor: move;
100
113
  margin-right: 12px;
101
- color: #c4c4c4;
114
+ color: var(
115
+ --cosmoz-omnitable-settings-pull-color,
116
+ var(--cz-color-muted, #c4c4c4)
117
+ );
102
118
  }
103
119
  .title {
104
120
  flex: auto;
105
121
  overflow: hidden;
106
122
  text-overflow: ellipsis;
123
+ color: var(
124
+ --cosmoz-omnitable-settings-title-color,
125
+ var(--cz-text-color, inherit)
126
+ );
107
127
  }
108
128
  .title[has-filter] {
109
129
  font-weight: bold;
@@ -133,7 +153,7 @@ export default css`
133
153
  flex: 1;
134
154
  }
135
155
  .button:not(.reset):hover {
136
- background: var(--cosmoz-button-hover-bg-color, #3a3f44);
156
+ background: var(--cz-action-button-hover-bg, #3a3f44);
137
157
  }
138
158
  .button[disabled] {
139
159
  opacity: 0.2;
@@ -193,7 +213,10 @@ export default css`
193
213
  export const dropdown = css`
194
214
  :host {
195
215
  display: contents;
196
- color: var(--cosmoz-omnitable-settings-color, #101010);
216
+ color: var(
217
+ --cosmoz-omnitable-settings-color,
218
+ var(--cz-text-color, #101010)
219
+ );
197
220
  --cosmoz-dropdown-box-shadow: 0 3px 4px 0 rgb(0 0 0 / 14%),
198
221
  0 1px 8px 0 rgb(0 0 0 / 12%), 0 3px 3px -2px rgb(0 0 0 / 40%);
199
222
  }
package/lib/utils.js CHANGED
@@ -1,3 +1,17 @@
1
1
  const indexSymbol = Symbol('index');
2
2
 
3
3
  export { indexSymbol };
4
+
5
+ export const findLastIndex = (array, predicate) => {
6
+ if (Array.prototype.findLastIndex) {
7
+ return array.findLastIndex(predicate);
8
+ }
9
+
10
+ for (let i = array.length - 1; i >= 0; i--) {
11
+ if (predicate(array[i], i, array)) {
12
+ return i;
13
+ }
14
+ }
15
+
16
+ return -1;
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "14.11.1",
3
+ "version": "14.12.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"