@neovici/cosmoz-omnitable 8.0.0-beta.6 → 8.0.0-beta.7
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/cosmoz-omnitable-column-amount.js +3 -3
- package/cosmoz-omnitable-column-autocomplete.js +3 -1
- package/cosmoz-omnitable-column-date.js +3 -3
- package/cosmoz-omnitable-column-datetime.js +3 -3
- package/cosmoz-omnitable-column-list-mixin.js +3 -1
- package/cosmoz-omnitable-column-number.js +3 -3
- package/cosmoz-omnitable-column-time.js +3 -3
- package/lib/use-dom-columns.js +3 -4
- package/lib/utils-data.js +5 -0
- package/package.json +1 -1
|
@@ -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';
|
|
@@ -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
|
|
|
@@ -68,7 +68,9 @@ class OmnitableColumnAutocomplete extends listColumnMixin(columnMixin(PolymerEle
|
|
|
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) {
|
|
@@ -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
|
/**
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
@@ -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);
|
package/lib/use-dom-columns.js
CHANGED
|
@@ -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,
|
|
@@ -107,7 +107,6 @@ const
|
|
|
107
107
|
|
|
108
108
|
// treenode columns
|
|
109
109
|
ownerTree: column.ownerTree,
|
|
110
|
-
showMaxNodes: column.showMaxNodes,
|
|
111
110
|
keyProperty: column.keyProperty,
|
|
112
111
|
|
|
113
112
|
[columnSymbol]: column
|
package/lib/utils-data.js
CHANGED
|
@@ -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/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.7",
|
|
4
4
|
"description": "[](https://travis-ci.org/Neovici/cosmoz-omnitable)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components"
|