@neovici/cosmoz-omnitable 8.0.0-beta.1 → 8.0.0-beta.10
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.
- package/README.md +0 -23
- package/cosmoz-omnitable-column-amount.js +7 -7
- package/cosmoz-omnitable-column-autocomplete.js +6 -4
- package/cosmoz-omnitable-column-date.js +7 -7
- package/cosmoz-omnitable-column-datetime.js +7 -7
- package/cosmoz-omnitable-column-list-mixin.js +4 -2
- package/cosmoz-omnitable-column-mixin.js +5 -4
- package/cosmoz-omnitable-column-number.js +7 -7
- package/cosmoz-omnitable-column-time.js +7 -7
- package/cosmoz-omnitable-styles.js +3 -3
- package/cosmoz-omnitable.js +2 -8
- package/lib/cosmoz-omnitable-settings.js +1 -1
- package/lib/normalize-settings.js +2 -5
- package/lib/use-dom-columns.js +33 -23
- package/lib/use-fast-layout.js +23 -18
- package/lib/use-omnitable.js +61 -14
- package/lib/use-processed-items.js +7 -6
- package/lib/use-resizable-columns.js +1 -2
- package/lib/utils-amount.js +4 -4
- package/lib/utils-data.js +6 -1
- package/lib/utils-date.js +7 -7
- package/lib/utils-number.js +4 -4
- package/lib/utils-time.js +4 -4
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -5,26 +5,3 @@ cosmoz-omnitable
|
|
|
5
5
|
[](https://codeclimate.com/github/Neovici/cosmoz-omnitable/maintainability)
|
|
6
6
|
[](https://codecov.io/gh/Neovici/cosmoz-omnitable)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
migration TODO:
|
|
11
|
-
|
|
12
|
-
* check if dropping the visibility code has any adverse effect (might be related to hash-params)
|
|
13
|
-
x add legacy ots compatibility layer: dispatch filter-changed and other similar events from the columns
|
|
14
|
-
* verify each custom render function in FE
|
|
15
|
-
x convert DOM columns to config
|
|
16
|
-
x empty columns of all state
|
|
17
|
-
x hash params
|
|
18
|
-
x xlsx + csv export
|
|
19
|
-
* test for source
|
|
20
|
-
|
|
21
|
-
FE editable columns in:
|
|
22
|
-
views/administration/accounting-model/dimension-values.html.js
|
|
23
|
-
views/administration/periods/list.js
|
|
24
|
-
|
|
25
|
-
FE column-item-changed in:
|
|
26
|
-
views/administration/periods/list.js
|
|
27
|
-
|
|
28
|
-
BUGS:
|
|
29
|
-
* when navigating the queue, filters are not reset when view-core is reused
|
|
30
|
-
* autocomplete columns without valueProperty might not work
|
|
@@ -7,7 +7,7 @@ import { PolymerElement } from '@polymer/polymer/polymer-element';
|
|
|
7
7
|
import { html } from 'lit-html';
|
|
8
8
|
|
|
9
9
|
import { columnMixin } from './cosmoz-omnitable-column-mixin';
|
|
10
|
-
import {
|
|
10
|
+
import { defaultComputeSource } from './lib/utils-data';
|
|
11
11
|
import './lib/cosmoz-omnitable-amount-range-input';
|
|
12
12
|
import { getComparableValue, getCurrency, applySingleFilter, getString, getInputString, toAmount, toHashString, fromHashString } from './lib/utils-amount';
|
|
13
13
|
import { get } from '@polymer/polymer/lib/utils/path';
|
|
@@ -35,8 +35,8 @@ class OmnitableColumnAmount extends columnMixin(PolymerElement) {
|
|
|
35
35
|
|
|
36
36
|
getFilterFn(column, filter) {
|
|
37
37
|
const
|
|
38
|
-
min = getComparableValue(
|
|
39
|
-
max = getComparableValue(
|
|
38
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
39
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
40
40
|
|
|
41
41
|
if (min == null && max == null) {
|
|
42
42
|
return;
|
|
@@ -56,8 +56,8 @@ class OmnitableColumnAmount extends columnMixin(PolymerElement) {
|
|
|
56
56
|
return getString(column, item);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
getComparableValue(
|
|
60
|
-
return getComparableValue(
|
|
59
|
+
getComparableValue(column, item) {
|
|
60
|
+
return getComparableValue(column, item);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
serializeFilter({ rates }, filter) {
|
|
@@ -134,8 +134,8 @@ class OmnitableColumnAmount extends columnMixin(PolymerElement) {
|
|
|
134
134
|
></cosmoz-omnitable-amount-range-input>`;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
computeSource(
|
|
138
|
-
return
|
|
137
|
+
computeSource(column, data) {
|
|
138
|
+
return defaultComputeSource(column, data);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { get } from '@polymer/polymer/lib/utils/path';
|
|
15
15
|
|
|
16
16
|
export const
|
|
17
|
-
getComparableValue = (
|
|
17
|
+
getComparableValue = ({ valuePath, textProperty, valueProperty }, item) => {
|
|
18
18
|
const property = textProperty ? strProp(textProperty) : prop(valueProperty),
|
|
19
19
|
values = array(valuePath && get(item, valuePath)).map(property);
|
|
20
20
|
return values.length > 1 ? values.filter(Boolean).join(',') : values[0];
|
|
@@ -63,12 +63,14 @@ class OmnitableColumnAutocomplete extends listColumnMixin(columnMixin(PolymerEle
|
|
|
63
63
|
>${ spinner }</cosmoz-autocomplete-ui>`;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
getComparableValue(
|
|
67
|
-
return getComparableValue(
|
|
66
|
+
getComparableValue(column, item) {
|
|
67
|
+
return getComparableValue(column, item);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
computeSource(column, data) {
|
|
71
|
-
return
|
|
71
|
+
return column.externalValues || typeof column.values === 'function'
|
|
72
|
+
? column.values
|
|
73
|
+
: computeSource(column, data);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
}
|
|
@@ -9,7 +9,7 @@ import { html } from 'lit-html';
|
|
|
9
9
|
|
|
10
10
|
import { columnMixin } from './cosmoz-omnitable-column-mixin';
|
|
11
11
|
import './lib/cosmoz-omnitable-date-range-input';
|
|
12
|
-
import {
|
|
12
|
+
import { defaultComputeSource } from './lib/utils-data';
|
|
13
13
|
import { getString, getComparableValue, toDate, toHashString, toXlsxValue, applySingleFilter, getInputString, fromInputString } from './lib/utils-date';
|
|
14
14
|
|
|
15
15
|
class OmnitableColumnDate extends columnMixin(PolymerElement) {
|
|
@@ -27,8 +27,8 @@ class OmnitableColumnDate extends columnMixin(PolymerElement) {
|
|
|
27
27
|
|
|
28
28
|
getFilterFn(column, filter) {
|
|
29
29
|
const
|
|
30
|
-
min = getComparableValue(
|
|
31
|
-
max = getComparableValue(
|
|
30
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
31
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
32
32
|
|
|
33
33
|
if (min == null && max == null) {
|
|
34
34
|
return;
|
|
@@ -48,8 +48,8 @@ class OmnitableColumnDate extends columnMixin(PolymerElement) {
|
|
|
48
48
|
return getString(column, item);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
getComparableValue(
|
|
52
|
-
return getComparableValue(
|
|
51
|
+
getComparableValue(column, item) {
|
|
52
|
+
return getComparableValue(column, item);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
serializeFilter(column, filter) {
|
|
@@ -117,8 +117,8 @@ class OmnitableColumnDate extends columnMixin(PolymerElement) {
|
|
|
117
117
|
></cosmoz-omnitable-date-range-input>`;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
computeSource(
|
|
121
|
-
return
|
|
120
|
+
computeSource(column, data) {
|
|
121
|
+
return defaultComputeSource(column, data);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
customElements.define('cosmoz-omnitable-column-date', OmnitableColumnDate);
|
|
@@ -8,7 +8,7 @@ import { PolymerElement } from '@polymer/polymer/polymer-element';
|
|
|
8
8
|
import { html } from 'lit-html';
|
|
9
9
|
import { fromHashString, getString, toHashString, toXlsxValue } from './lib/utils-datetime';
|
|
10
10
|
import { applySingleFilter, fromInputString, getComparableValue, toDate } from './lib/utils-date';
|
|
11
|
-
import {
|
|
11
|
+
import { defaultComputeSource } from './lib/utils-data';
|
|
12
12
|
import './lib/cosmoz-omnitable-datetime-range-input';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -36,8 +36,8 @@ class OmnitableColumnDatetime extends columnMixin(PolymerElement) {
|
|
|
36
36
|
|
|
37
37
|
getFilterFn(column, filter) {
|
|
38
38
|
const
|
|
39
|
-
min = getComparableValue(
|
|
40
|
-
max = getComparableValue(
|
|
39
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
40
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
41
41
|
|
|
42
42
|
if (min == null && max == null) {
|
|
43
43
|
return;
|
|
@@ -57,8 +57,8 @@ class OmnitableColumnDatetime extends columnMixin(PolymerElement) {
|
|
|
57
57
|
return getString(column, item);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
getComparableValue(
|
|
61
|
-
return getComparableValue(
|
|
60
|
+
getComparableValue(column, item) {
|
|
61
|
+
return getComparableValue(column, item);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
serializeFilter(column, filter) {
|
|
@@ -123,8 +123,8 @@ class OmnitableColumnDatetime extends columnMixin(PolymerElement) {
|
|
|
123
123
|
></cosmoz-omnitable-datetime-range-input>`;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
computeSource(
|
|
127
|
-
return
|
|
126
|
+
computeSource(column, data) {
|
|
127
|
+
return defaultComputeSource(column, data);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -130,7 +130,7 @@ const
|
|
|
130
130
|
return getString(column, item);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
getComparableValue(
|
|
133
|
+
getComparableValue({ valuePath, valueProperty }, item) {
|
|
134
134
|
const value = get(item, valuePath);
|
|
135
135
|
if (valueProperty == null) {
|
|
136
136
|
return value;
|
|
@@ -160,7 +160,9 @@ const
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
computeSource(column, data) {
|
|
163
|
-
return
|
|
163
|
+
return column.externalValues || typeof column.values === 'function'
|
|
164
|
+
? column.values
|
|
165
|
+
: computeSource(column, data);
|
|
164
166
|
}
|
|
165
167
|
};
|
|
166
168
|
|
|
@@ -3,6 +3,7 @@ import { get } from '@polymer/polymer/lib/utils/path';
|
|
|
3
3
|
export const
|
|
4
4
|
getString = ({ valuePath }, item) => get(item, valuePath),
|
|
5
5
|
toXlsxValue = getString,
|
|
6
|
+
getComparableValue = getString,
|
|
6
7
|
|
|
7
8
|
applySingleFilter = ({ valuePath }, filter) => item => {
|
|
8
9
|
const value = get(item, valuePath);
|
|
@@ -87,12 +88,12 @@ export const
|
|
|
87
88
|
return filter;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
getComparableValue(
|
|
91
|
-
return
|
|
91
|
+
getComparableValue(column, item) {
|
|
92
|
+
return getComparableValue(column, item);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
computeSource() {
|
|
95
|
-
return
|
|
95
|
+
computeSource(column, data) {
|
|
96
|
+
return data;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
_propertiesChanged(currentProps, changedProps, oldProps) {
|
|
@@ -8,7 +8,7 @@ import { html } from 'lit-html';
|
|
|
8
8
|
import { columnMixin } from './cosmoz-omnitable-column-mixin';
|
|
9
9
|
|
|
10
10
|
import './lib/cosmoz-omnitable-number-range-input';
|
|
11
|
-
import {
|
|
11
|
+
import { defaultComputeSource } from './lib/utils-data';
|
|
12
12
|
import { applySingleFilter, getComparableValue, getInputString, getString, toHashString, toNumber } from './lib/utils-number';
|
|
13
13
|
import { get } from '@polymer/polymer/lib/utils/path';
|
|
14
14
|
|
|
@@ -36,8 +36,8 @@ class OmnitableColumnNumber extends columnMixin(PolymerElement) {
|
|
|
36
36
|
|
|
37
37
|
getFilterFn(column, filter) {
|
|
38
38
|
const
|
|
39
|
-
min = getComparableValue(
|
|
40
|
-
max = getComparableValue(
|
|
39
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
40
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
41
41
|
|
|
42
42
|
if (min == null && max == null) {
|
|
43
43
|
return;
|
|
@@ -57,8 +57,8 @@ class OmnitableColumnNumber extends columnMixin(PolymerElement) {
|
|
|
57
57
|
return getString(column, item);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
getComparableValue(
|
|
61
|
-
return getComparableValue(
|
|
60
|
+
getComparableValue(column, item) {
|
|
61
|
+
return getComparableValue(column, item);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
serializeFilter(column, filter) {
|
|
@@ -127,8 +127,8 @@ class OmnitableColumnNumber extends columnMixin(PolymerElement) {
|
|
|
127
127
|
></cosmoz-omnitable-number-range-input>`;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
computeSource(
|
|
131
|
-
return
|
|
130
|
+
computeSource(column, data) {
|
|
131
|
+
return defaultComputeSource(column, data);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
customElements.define('cosmoz-omnitable-column-number', OmnitableColumnNumber);
|
|
@@ -10,7 +10,7 @@ import { html } from 'lit-html';
|
|
|
10
10
|
import { columnMixin } from './cosmoz-omnitable-column-mixin';
|
|
11
11
|
import { getComparableValue, getString, toXlsxValue, applySingleFilter, toDate, toHashString, fromHashString } from './lib/utils-time';
|
|
12
12
|
import './lib/cosmoz-omnitable-time-range-input';
|
|
13
|
-
import {
|
|
13
|
+
import { defaultComputeSource } from './lib/utils-data';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @polymer
|
|
@@ -38,8 +38,8 @@ class OmnitableColumnTime extends columnMixin(PolymerElement) {
|
|
|
38
38
|
|
|
39
39
|
getFilterFn(column, filter) {
|
|
40
40
|
const
|
|
41
|
-
min = getComparableValue(
|
|
42
|
-
max = getComparableValue(
|
|
41
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
42
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
43
43
|
|
|
44
44
|
if (min == null && max == null) {
|
|
45
45
|
return;
|
|
@@ -59,8 +59,8 @@ class OmnitableColumnTime extends columnMixin(PolymerElement) {
|
|
|
59
59
|
return getString(column, item);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
getComparableValue(
|
|
63
|
-
return getComparableValue(
|
|
62
|
+
getComparableValue(column, item) {
|
|
63
|
+
return getComparableValue(column, item);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
serializeFilter(column, filter) {
|
|
@@ -124,8 +124,8 @@ class OmnitableColumnTime extends columnMixin(PolymerElement) {
|
|
|
124
124
|
></cosmoz-omnitable-time-range-input>`;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
computeSource(
|
|
128
|
-
return
|
|
127
|
+
computeSource(column, data) {
|
|
128
|
+
return defaultComputeSource(column, data);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
customElements.define('cosmoz-omnitable-column-time', OmnitableColumnTime);
|
|
@@ -22,7 +22,7 @@ const checkbox = `
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.checkbox:checked {
|
|
25
|
-
background-color: var(--
|
|
25
|
+
background-color: var(--cosmoz-omnitable-checkbox-checked-color, var(--primary-color));
|
|
26
26
|
box-shadow: none;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -63,7 +63,7 @@ const checkbox = `
|
|
|
63
63
|
height: 2px;
|
|
64
64
|
left: 4px;
|
|
65
65
|
top: 8px;
|
|
66
|
-
|
|
66
|
+
background-color: var(--cosmoz-omnitable-checkbox-checked-color, var(--primary-color));
|
|
67
67
|
}
|
|
68
68
|
`;
|
|
69
69
|
|
|
@@ -282,7 +282,7 @@ export default `<style>
|
|
|
282
282
|
display: flex;
|
|
283
283
|
align-items: center;
|
|
284
284
|
border-top: solid 1px #e8e8e8;
|
|
285
|
-
background-color: #f5f5f5;
|
|
285
|
+
background-color: var(--cosmoz-omnitable-footer-bg-color, #f5f5f5);
|
|
286
286
|
min-height: 25px;
|
|
287
287
|
height: 63px;
|
|
288
288
|
margin-bottom: 1px; /* Chrome overflow rendering bug? When only component in a view */
|
package/cosmoz-omnitable.js
CHANGED
|
@@ -3,7 +3,6 @@ import '@polymer/iron-icons/iron-icons';
|
|
|
3
3
|
import '@polymer/iron-icon/iron-icon';
|
|
4
4
|
import '@polymer/iron-label/iron-label';
|
|
5
5
|
import '@polymer/paper-button/paper-button';
|
|
6
|
-
import '@polymer/paper-checkbox/paper-checkbox';
|
|
7
6
|
import '@polymer/paper-dropdown-menu/paper-dropdown-menu';
|
|
8
7
|
import '@polymer/paper-icon-button/paper-icon-button';
|
|
9
8
|
import '@polymer/paper-item/paper-item';
|
|
@@ -24,7 +23,7 @@ import styles from './cosmoz-omnitable-styles';
|
|
|
24
23
|
|
|
25
24
|
import { PolymerElement } from '@polymer/polymer/polymer-element';
|
|
26
25
|
import { html } from '@polymer/polymer/lib/utils/html-tag';
|
|
27
|
-
import { html as litHtml
|
|
26
|
+
import { html as litHtml } from 'lit-html';
|
|
28
27
|
|
|
29
28
|
import { translatable } from '@neovici/cosmoz-i18next';
|
|
30
29
|
import { mixin, hauntedPolymer } from '@neovici/cosmoz-utils';
|
|
@@ -276,8 +275,7 @@ class Omnitable extends hauntedPolymer(useOmnitable)(mixin({ isEmpty }, translat
|
|
|
276
275
|
|
|
277
276
|
static get observers() {
|
|
278
277
|
return [
|
|
279
|
-
'_selectedItemsChanged(selectedItems.*)'
|
|
280
|
-
'renderFastLayoutCss(layoutCss, $.layoutStyle)'
|
|
278
|
+
'_selectedItemsChanged(selectedItems.*)'
|
|
281
279
|
];
|
|
282
280
|
}
|
|
283
281
|
|
|
@@ -517,10 +515,6 @@ class Omnitable extends hauntedPolymer(useOmnitable)(mixin({ isEmpty }, translat
|
|
|
517
515
|
return this.ngettext('{0} row', '{0} rows', numRows);
|
|
518
516
|
}
|
|
519
517
|
|
|
520
|
-
renderFastLayoutCss(layoutCss, outlet) {
|
|
521
|
-
render(layoutCss, outlet);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
518
|
_onCompleteValues(columns, type, value) { /* eslint-disable-next-line no-bitwise */
|
|
525
519
|
return columns?.filter?.(c => c[type]).sort((a, b) => ((b === value) >> 0) - ((a === value) >> 0));
|
|
526
520
|
}
|
|
@@ -232,7 +232,7 @@ const settingsStyles = `
|
|
|
232
232
|
position: absolute;
|
|
233
233
|
top: 1px;
|
|
234
234
|
right: -4px;
|
|
235
|
-
background-color: var(--
|
|
235
|
+
background-color: var(--cosmoz-omnitable-checkbox-checked-color, var(--primary-color));
|
|
236
236
|
width: 8px;
|
|
237
237
|
height: 8px;
|
|
238
238
|
border-radius: 100%;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const byName = name => item => item.name === name;
|
|
2
2
|
|
|
3
3
|
export const
|
|
4
|
-
columnSymbol = Symbol('column'),
|
|
5
4
|
normalizeSettings = (columns = [], settings = [], savedSettings = []) => {
|
|
6
5
|
const
|
|
7
6
|
cols = columns.filter(column => !settings.some(byName(column.name)) && !savedSettings.some(byName(column.name))),
|
|
@@ -20,8 +19,7 @@ export const
|
|
|
20
19
|
return {
|
|
21
20
|
...setting,
|
|
22
21
|
title: column.title,
|
|
23
|
-
minWidth: parseInt(column.minWidth, 10)
|
|
24
|
-
[columnSymbol]: column
|
|
22
|
+
minWidth: parseInt(column.minWidth, 10)
|
|
25
23
|
};
|
|
26
24
|
}),
|
|
27
25
|
...cols.map(column => {
|
|
@@ -32,8 +30,7 @@ export const
|
|
|
32
30
|
priority,
|
|
33
31
|
minWidth: parseInt(minWidth, 10),
|
|
34
32
|
width: parseInt(width, 10),
|
|
35
|
-
flex: parseInt(flex, 10)
|
|
36
|
-
[columnSymbol]: column
|
|
33
|
+
flex: parseInt(flex, 10)
|
|
37
34
|
};
|
|
38
35
|
})
|
|
39
36
|
];
|
package/lib/use-dom-columns.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState } from 'haunted';
|
|
2
2
|
import { memooize } from './memoize';
|
|
3
|
-
import { columnSymbol } from './normalize-settings';
|
|
4
3
|
|
|
5
4
|
const
|
|
5
|
+
columnSymbol = Symbol('column'),
|
|
6
6
|
verifyColumnSetup = columns => {
|
|
7
7
|
let ok = true;
|
|
8
8
|
const columnNames = columns.map(c => c.name);
|
|
@@ -17,7 +17,7 @@ const
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
columns.forEach(column => {
|
|
20
|
-
if (columnNames.indexOf(name) === columnNames.lastIndexOf(name)) {
|
|
20
|
+
if (columnNames.indexOf(column.name) === columnNames.lastIndexOf(column.name)) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
ok = false;
|
|
@@ -41,6 +41,7 @@ const
|
|
|
41
41
|
? domColumns.filter(column => enabledColumns.includes(column.name))
|
|
42
42
|
: domColumns.filter(column => !column.disabled);
|
|
43
43
|
|
|
44
|
+
// eslint-disable-next-line max-lines-per-function
|
|
44
45
|
return columns.map(column => ({
|
|
45
46
|
name: column.name,
|
|
46
47
|
title: column.title,
|
|
@@ -66,14 +67,13 @@ const
|
|
|
66
67
|
renderGroup: column.renderGroup,
|
|
67
68
|
cellTitleFn: column.cellTitleFn,
|
|
68
69
|
getFilterFn: column.getFilterFn,
|
|
70
|
+
headerCellClass: column.headerCellClass,
|
|
69
71
|
cellClass: column.cellClass,
|
|
70
72
|
|
|
71
73
|
editable: column.editable,
|
|
72
74
|
|
|
73
75
|
values: column.values,
|
|
74
|
-
source: memooize(
|
|
75
|
-
? column.values
|
|
76
|
-
: column.computeSource(column, data)),
|
|
76
|
+
source: memooize(column.computeSource),
|
|
77
77
|
|
|
78
78
|
// @deprecated
|
|
79
79
|
loading: column.loading,
|
|
@@ -105,29 +105,39 @@ const
|
|
|
105
105
|
rates: column.rates,
|
|
106
106
|
autodetect: column.autodetect,
|
|
107
107
|
|
|
108
|
+
// treenode columns
|
|
109
|
+
ownerTree: column.ownerTree,
|
|
110
|
+
keyProperty: column.keyProperty,
|
|
111
|
+
|
|
108
112
|
[columnSymbol]: column
|
|
109
113
|
}));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export const useDOMColumns = (host, { enabledColumns }) => {
|
|
113
|
-
const
|
|
114
|
-
[columns, setColumns] = useState(() => domColumnsToConfig(host, { enabledColumns }));
|
|
114
|
+
},
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
useDOMColumns = (host, { enabledColumns }) => {
|
|
117
117
|
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
[columns, setColumns] = useState(() => domColumnsToConfig(host, { enabledColumns }));
|
|
119
|
+
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const
|
|
122
|
+
slot = host.shadowRoot.querySelector('#columnsSlot'),
|
|
123
|
+
handler = () => {
|
|
124
|
+
host.suppressNextScrollReset();
|
|
125
|
+
setColumns(domColumnsToConfig(host, { enabledColumns }));
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
slot.addEventListener('slotchange', handler);
|
|
129
|
+
host.addEventListener('cosmoz-column-prop-changed', handler);
|
|
130
|
+
return () => {
|
|
131
|
+
slot.removeEventListener('slotchange', handler);
|
|
132
|
+
host.removeEventListener('cosmoz-column-prop-changed', handler);
|
|
122
133
|
};
|
|
134
|
+
}, []);
|
|
135
|
+
|
|
136
|
+
return columns;
|
|
137
|
+
};
|
|
123
138
|
|
|
124
|
-
slot.addEventListener('slotchange', handler);
|
|
125
|
-
host.addEventListener('cosmoz-column-prop-changed', handler);
|
|
126
|
-
return () => {
|
|
127
|
-
slot.removeEventListener('slotchange', handler);
|
|
128
|
-
host.removeEventListener('cosmoz-column-prop-changed', handler);
|
|
129
|
-
};
|
|
130
|
-
}, []);
|
|
131
139
|
|
|
132
|
-
|
|
140
|
+
export {
|
|
141
|
+
columnSymbol,
|
|
142
|
+
useDOMColumns
|
|
133
143
|
};
|
package/lib/use-fast-layout.js
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
import { useMemo } from 'haunted';
|
|
1
|
+
import { useEffect, useLayoutEffect, useMemo } from 'haunted';
|
|
2
2
|
import { toCss } from './compute-layout';
|
|
3
3
|
import { useResizableColumns } from './use-resizable-columns';
|
|
4
4
|
import { useCanvasWidth } from './use-canvas-width';
|
|
5
5
|
import { useTweenArray } from './use-tween-array';
|
|
6
6
|
import { useLayout } from './use-layout';
|
|
7
|
-
import {
|
|
7
|
+
import { render } from 'lit-html';
|
|
8
8
|
|
|
9
9
|
export const useFastLayout = ({ host, settings, setSettings, groupOnColumn, resizeSpeedFactor }) => {
|
|
10
10
|
const
|
|
11
11
|
canvasWidth = useCanvasWidth(host),
|
|
12
12
|
layout = useLayout({ canvasWidth, groupOnColumn, config: settings }),
|
|
13
13
|
tweenedlayout = useTweenArray(layout, resizeSpeedFactor),
|
|
14
|
-
layoutCss = useMemo(() => toCss(tweenedlayout, settings), [tweenedlayout])
|
|
15
|
-
|
|
16
|
-
collapsedColumns = useMemo(() => Array.isArray(settings)
|
|
17
|
-
? settings.reduce((acc, column, index) =>
|
|
18
|
-
layout[index] != null
|
|
19
|
-
|| column.name === groupOnColumn?.name
|
|
20
|
-
|| column.disabled
|
|
21
|
-
? acc
|
|
22
|
-
: [...acc, column[columnSymbol]],
|
|
23
|
-
[])
|
|
24
|
-
: []
|
|
25
|
-
, [settings, layout]);
|
|
14
|
+
layoutCss = useMemo(() => toCss(tweenedlayout, settings), [tweenedlayout]);
|
|
26
15
|
|
|
27
16
|
useResizableColumns({ host, canvasWidth, layout, setSettings: update => setSettings(update(settings)) });
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
useLayoutEffect(() => render(layoutCss, host.$.layoutStyle), [layoutCss]);
|
|
19
|
+
|
|
20
|
+
// force iron-list to render when the omnitable becomes visible
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
let lastWidth = 0;
|
|
23
|
+
|
|
24
|
+
const
|
|
25
|
+
onResize = ([entry]) => {
|
|
26
|
+
if (lastWidth === 0) {
|
|
27
|
+
requestAnimationFrame(() => host.$.groupedList.$.list._render());
|
|
28
|
+
}
|
|
29
|
+
lastWidth = entry.contentRect?.width;
|
|
30
|
+
},
|
|
31
|
+
observer = new ResizeObserver(onResize);
|
|
32
|
+
|
|
33
|
+
observer.observe(host);
|
|
34
|
+
return () => observer.unobserve(host);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
return layout;
|
|
33
38
|
};
|
package/lib/use-omnitable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from 'haunted';
|
|
2
|
-
import {
|
|
2
|
+
import { normalizeSettings } from './normalize-settings';
|
|
3
3
|
import { useProcessedItems } from './use-processed-items';
|
|
4
4
|
import { useFastLayout } from './use-fast-layout';
|
|
5
5
|
import { useSavedSettings } from './use-saved-settings';
|
|
@@ -9,23 +9,68 @@ import { onItemChange } from './utils-data';
|
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line max-lines-per-function
|
|
11
11
|
export const useOmnitable = host => {
|
|
12
|
-
const
|
|
13
|
-
{ enabledColumns, hashParam } = host,
|
|
12
|
+
const { enabledColumns, hashParam } = host,
|
|
14
13
|
columns = useDOMColumns(host, { enabledColumns }),
|
|
15
|
-
sortAndGroupOptions = useSortAndGroupOptions(
|
|
14
|
+
sortAndGroupOptions = useSortAndGroupOptions(
|
|
15
|
+
columns,
|
|
16
|
+
hashParam,
|
|
17
|
+
host.sortOn,
|
|
18
|
+
host.groupOn
|
|
19
|
+
),
|
|
16
20
|
{ groupOnColumn, groupOnDescending, sortOnColumn, descending } = sortAndGroupOptions,
|
|
17
21
|
{ data, resizeSpeedFactor, settingsId } = host,
|
|
18
22
|
// TODO: drop filterFunctions
|
|
19
|
-
{
|
|
20
|
-
|
|
23
|
+
{
|
|
24
|
+
processedItems,
|
|
25
|
+
filters,
|
|
26
|
+
setFilterState,
|
|
27
|
+
numProcessedItems,
|
|
28
|
+
filterFunctions,
|
|
29
|
+
groupsCount
|
|
30
|
+
} = useProcessedItems({
|
|
31
|
+
data,
|
|
32
|
+
columns,
|
|
33
|
+
groupOnColumn,
|
|
34
|
+
groupOnDescending,
|
|
35
|
+
sortOnColumn,
|
|
36
|
+
descending,
|
|
37
|
+
hashParam
|
|
38
|
+
}),
|
|
21
39
|
[settings, setSettings] = useState([]),
|
|
22
|
-
{ savedSettings, onSettingsSave, onSettingsReset, hasChangedSettings } =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
{ savedSettings, onSettingsSave, onSettingsReset, hasChangedSettings } =
|
|
41
|
+
useSavedSettings(settingsId, settings, setSettings),
|
|
42
|
+
normalizedSettings = useMemo(
|
|
43
|
+
() => normalizeSettings(columns, settings, savedSettings),
|
|
44
|
+
[columns, settings, savedSettings]
|
|
45
|
+
),
|
|
46
|
+
normalizedColumns = useMemo(
|
|
47
|
+
() => normalizedSettings.map(s => columns.find(c => c.name === s.name)),
|
|
48
|
+
[columns, ...normalizedSettings.map(s => s.name)]
|
|
49
|
+
),
|
|
50
|
+
layout = useFastLayout({
|
|
51
|
+
host,
|
|
52
|
+
settings: normalizedSettings,
|
|
53
|
+
setSettings,
|
|
54
|
+
groupOnColumn,
|
|
55
|
+
resizeSpeedFactor
|
|
56
|
+
}),
|
|
57
|
+
collapsedColumns = useMemo(
|
|
58
|
+
() => normalizedSettings.reduce((acc, column, index) =>
|
|
59
|
+
layout[index] != null ||
|
|
60
|
+
column.name === groupOnColumn?.name ||
|
|
61
|
+
column.disabled
|
|
62
|
+
? acc
|
|
63
|
+
: [...acc, columns.find(c => c.name === column.name)],
|
|
64
|
+
[]),
|
|
65
|
+
[columns, normalizedSettings, layout]
|
|
66
|
+
),
|
|
26
67
|
hasHiddenFilter = useMemo(
|
|
27
|
-
() =>
|
|
28
|
-
|
|
68
|
+
() =>
|
|
69
|
+
[
|
|
70
|
+
groupOnColumn,
|
|
71
|
+
...collapsedColumns,
|
|
72
|
+
...normalizedSettings.filter(s => s.disabled)
|
|
73
|
+
].some(column => column && Object.keys(filterFunctions).includes(column.name)),
|
|
29
74
|
[filterFunctions, normalizedSettings, collapsedColumns]
|
|
30
75
|
);
|
|
31
76
|
|
|
@@ -34,7 +79,6 @@ export const useOmnitable = host => {
|
|
|
34
79
|
|
|
35
80
|
...sortAndGroupOptions,
|
|
36
81
|
|
|
37
|
-
layoutCss,
|
|
38
82
|
setSettings,
|
|
39
83
|
normalizedSettings,
|
|
40
84
|
normalizedColumns,
|
|
@@ -45,7 +89,10 @@ export const useOmnitable = host => {
|
|
|
45
89
|
hasChangedSettings,
|
|
46
90
|
filters,
|
|
47
91
|
setFilterState,
|
|
48
|
-
onItemChange: useCallback(
|
|
92
|
+
onItemChange: useCallback(
|
|
93
|
+
(column, item) => value => onItemChange(host, column, item, value),
|
|
94
|
+
[]
|
|
95
|
+
),
|
|
49
96
|
numProcessedItems,
|
|
50
97
|
groupsCount,
|
|
51
98
|
sortedFilteredGroupedItems: processedItems
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'haunted';
|
|
2
2
|
import { genericSorter } from './generic-sorter';
|
|
3
3
|
import { invoke } from './invoke';
|
|
4
|
-
import { columnSymbol } from './
|
|
4
|
+
import { columnSymbol } from './use-dom-columns';
|
|
5
5
|
import { useHashState } from './use-hash-state';
|
|
6
6
|
|
|
7
7
|
const
|
|
@@ -14,7 +14,7 @@ const
|
|
|
14
14
|
|
|
15
15
|
Object.entries(changes).forEach(([key, value]) => {
|
|
16
16
|
column[columnSymbol][key] = value;
|
|
17
|
-
column[columnSymbol].dispatchEvent(new CustomEvent(`${ kebab(key) }-changed`, { bubbles: true, value }));
|
|
17
|
+
column[columnSymbol].dispatchEvent(new CustomEvent(`${ kebab(key) }-changed`, { bubbles: true, detail: { value }}));
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -78,12 +78,12 @@ export const useProcessedItems = ({ data, columns, groupOnColumn, groupOnDescend
|
|
|
78
78
|
// todo: extract function
|
|
79
79
|
processedItems = useMemo(() => {
|
|
80
80
|
if (!groupOnColumn && sortOnColumn != null && sortOnColumn.sortOn != null) {
|
|
81
|
-
return filteredItems.slice().sort(sortBy(a => sortOnColumn.getComparableValue(
|
|
81
|
+
return filteredItems.slice().sort(sortBy(a => sortOnColumn.getComparableValue({ ...sortOnColumn, valuePath: sortOnColumn.sortOn }, a), descending));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (groupOnColumn != null && groupOnColumn.groupOn != null) {
|
|
85
85
|
const groupedResults = filteredItems.reduce((acc, item) => {
|
|
86
|
-
const gval = groupOnColumn.getComparableValue(
|
|
86
|
+
const gval = groupOnColumn.getComparableValue({ ...groupOnColumn, valuePath: groupOnColumn.groupOn }, item);
|
|
87
87
|
|
|
88
88
|
if (gval === undefined) {
|
|
89
89
|
return acc;
|
|
@@ -104,7 +104,8 @@ export const useProcessedItems = ({ data, columns, groupOnColumn, groupOnDescend
|
|
|
104
104
|
return acc;
|
|
105
105
|
}, []);
|
|
106
106
|
|
|
107
|
-
groupedResults.sort(sortBy(
|
|
107
|
+
groupedResults.sort(sortBy(
|
|
108
|
+
a => groupOnColumn.getComparableValue({ ...groupOnColumn, valuePath: groupOnColumn.groupOn }, a.items[0]), groupOnDescending));
|
|
108
109
|
|
|
109
110
|
if (!sortOnColumn) {
|
|
110
111
|
return groupedResults;
|
|
@@ -113,7 +114,7 @@ export const useProcessedItems = ({ data, columns, groupOnColumn, groupOnDescend
|
|
|
113
114
|
return groupedResults
|
|
114
115
|
.filter(group => Array.isArray(group.items))
|
|
115
116
|
.map(group => {
|
|
116
|
-
group.items.sort(sortBy(a => sortOnColumn.getComparableValue(
|
|
117
|
+
group.items.sort(sortBy(a => sortOnColumn.getComparableValue({ ...sortOnColumn, valuePath: sortOnColumn.sortOn }, a), descending));
|
|
117
118
|
return group;
|
|
118
119
|
});
|
|
119
120
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'haunted';
|
|
2
|
-
import { columnSymbol } from './normalize-settings';
|
|
3
2
|
|
|
4
3
|
export const useResizableColumns = ({ host, canvasWidth, layout, setSettings }) => {
|
|
5
4
|
const onColumnResizeRef = useRef();
|
|
@@ -7,7 +6,7 @@ export const useResizableColumns = ({ host, canvasWidth, layout, setSettings })
|
|
|
7
6
|
onColumnResizeRef.current = ev => setSettings(config => {
|
|
8
7
|
const
|
|
9
8
|
{ detail: { newWidth, column }} = ev,
|
|
10
|
-
columnIndex = config.findIndex(c => c
|
|
9
|
+
columnIndex = config.findIndex(c => c.name === column.name),
|
|
11
10
|
newConfig = [],
|
|
12
11
|
maxPriority = config.reduce((p, c) => Math.max(p, c.priority), -Infinity);
|
|
13
12
|
|
package/lib/utils-amount.js
CHANGED
|
@@ -45,7 +45,7 @@ export const
|
|
|
45
45
|
return lNumber === valAmount ? amount : lAmount;
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
-
getComparableValue = (
|
|
48
|
+
getComparableValue = ({ valuePath, rates }, item) => {
|
|
49
49
|
if (item == null) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
@@ -70,15 +70,15 @@ export const
|
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
applySingleFilter = (column, filter) => item => {
|
|
73
|
-
const value = getComparableValue(
|
|
73
|
+
const value = getComparableValue(column, item);
|
|
74
74
|
|
|
75
75
|
if (value == null) {
|
|
76
76
|
return false;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
const
|
|
80
|
-
min = getComparableValue(
|
|
81
|
-
max = getComparableValue(
|
|
80
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
81
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
82
82
|
|
|
83
83
|
return !(value < min || value > max);
|
|
84
84
|
},
|
package/lib/utils-data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { get, set } from '@polymer/polymer/lib/utils/path';
|
|
2
|
-
import { columnSymbol } from './
|
|
2
|
+
import { columnSymbol } from './use-dom-columns';
|
|
3
3
|
|
|
4
4
|
export const
|
|
5
5
|
valuesFrom = (data, valuePath) => data
|
|
@@ -8,6 +8,11 @@ export const
|
|
|
8
8
|
value != null && self.indexOf(value) === index
|
|
9
9
|
),
|
|
10
10
|
|
|
11
|
+
defaultComputeSource = ({ externalValues, values, valuePath }, data) =>
|
|
12
|
+
externalValues || typeof values === 'function'
|
|
13
|
+
? values
|
|
14
|
+
: valuesFrom(data, valuePath),
|
|
15
|
+
|
|
11
16
|
onItemChange = (host, column, item, value) => {
|
|
12
17
|
const
|
|
13
18
|
{ valuePath } = column,
|
package/lib/utils-date.js
CHANGED
|
@@ -56,11 +56,11 @@ export const
|
|
|
56
56
|
/**
|
|
57
57
|
* Get comparable number from date
|
|
58
58
|
*
|
|
59
|
-
* @param {Object} item Item to be processed
|
|
60
59
|
* @param {String} valuePath Property path
|
|
60
|
+
* @param {Object} item Item to be processed
|
|
61
61
|
* @returns {Number|void} Valid value or void
|
|
62
62
|
*/
|
|
63
|
-
getComparableValue = (
|
|
63
|
+
getComparableValue = ({ valuePath }, item) => {
|
|
64
64
|
if (item == null) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
@@ -100,8 +100,8 @@ export const
|
|
|
100
100
|
return date;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
const comparableDate = getComparableValue(date),
|
|
104
|
-
comparableLDate = getComparableValue(lDate),
|
|
103
|
+
const comparableDate = getComparableValue({}, date),
|
|
104
|
+
comparableLDate = getComparableValue({}, lDate),
|
|
105
105
|
limitedValue = limitFunc(comparableDate, comparableLDate);
|
|
106
106
|
return limitedValue === comparableDate ? date : lDate;
|
|
107
107
|
},
|
|
@@ -188,15 +188,15 @@ export const
|
|
|
188
188
|
},
|
|
189
189
|
|
|
190
190
|
applySingleFilter = (column, filter) => item => {
|
|
191
|
-
const value = getComparableValue(
|
|
191
|
+
const value = getComparableValue(column, item);
|
|
192
192
|
|
|
193
193
|
if (value == null) {
|
|
194
194
|
return false;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
const
|
|
198
|
-
min = getComparableValue(
|
|
199
|
-
max = getComparableValue(
|
|
198
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
199
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
200
200
|
|
|
201
201
|
return !(value < min || value > max);
|
|
202
202
|
};
|
package/lib/utils-number.js
CHANGED
|
@@ -50,7 +50,7 @@ export const
|
|
|
50
50
|
return string;
|
|
51
51
|
},
|
|
52
52
|
|
|
53
|
-
getComparableValue = (
|
|
53
|
+
getComparableValue = ({ valuePath, maximumFractionDigits }, item) => {
|
|
54
54
|
if (item == null) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -98,15 +98,15 @@ export const
|
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
applySingleFilter = (column, filter) => item => {
|
|
101
|
-
const value = getComparableValue(
|
|
101
|
+
const value = getComparableValue(column, item);
|
|
102
102
|
|
|
103
103
|
if (value == null) {
|
|
104
104
|
return false;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
const
|
|
108
|
-
min = getComparableValue(
|
|
109
|
-
max = getComparableValue(
|
|
108
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
109
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
110
110
|
|
|
111
111
|
return !(value < min || value > max);
|
|
112
112
|
};
|
package/lib/utils-time.js
CHANGED
|
@@ -67,7 +67,7 @@ export const
|
|
|
67
67
|
return toLocalISOString(date).slice(11, 19);
|
|
68
68
|
},
|
|
69
69
|
|
|
70
|
-
getComparableValue = (
|
|
70
|
+
getComparableValue = ({ valuePath }, item) => {
|
|
71
71
|
if (item == null) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
@@ -83,15 +83,15 @@ export const
|
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
applySingleFilter = (column, filter) => item => {
|
|
86
|
-
const value = getComparableValue(
|
|
86
|
+
const value = getComparableValue(column, item);
|
|
87
87
|
|
|
88
88
|
if (value == null) {
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const
|
|
93
|
-
min = getComparableValue(
|
|
94
|
-
max = getComparableValue(
|
|
93
|
+
min = getComparableValue({ ...column, valuePath: 'min' }, filter),
|
|
94
|
+
max = getComparableValue({ ...column, valuePath: 'max' }, filter);
|
|
95
95
|
|
|
96
96
|
return !(value < min || value > max);
|
|
97
97
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-omnitable",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.10",
|
|
4
4
|
"description": "[](https://travis-ci.org/Neovici/cosmoz-omnitable)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components"
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"@polymer/iron-icons": "^3.0.0",
|
|
65
65
|
"@polymer/iron-label": "^3.0.0",
|
|
66
66
|
"@polymer/paper-button": "^3.0.0",
|
|
67
|
-
"@polymer/paper-checkbox": "^3.0.0",
|
|
68
67
|
"@polymer/paper-dropdown-menu": "^3.2.0",
|
|
69
68
|
"@polymer/paper-icon-button": "^3.0.0",
|
|
70
69
|
"@polymer/paper-input": "^3.2.0",
|