@neovici/cosmoz-omnitable 13.0.0 → 13.2.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.
|
@@ -127,7 +127,6 @@ class OmnitableColumnListData extends translatable(mixin(Template, PolymerElemen
|
|
|
127
127
|
this._expanded = !this._expanded;
|
|
128
128
|
event.stopPropagation();
|
|
129
129
|
event.preventDefault();
|
|
130
|
-
this.dispatchEvent(new CustomEvent('expand', { bubbles: true }));
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
onText,
|
|
15
15
|
} from './cosmoz-omnitable-column-list-mixin';
|
|
16
16
|
import '@neovici/cosmoz-autocomplete';
|
|
17
|
-
import { notifyResize } from './lib/utils';
|
|
18
17
|
import { columnSymbol } from './lib/use-dom-columns';
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -41,10 +40,9 @@ class OmnitableColumnList extends listColumnMixin(columnMixin(PolymerElement)) {
|
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
renderCell({ valuePath, textProperty }, { item
|
|
43
|
+
renderCell({ valuePath, textProperty }, { item }) {
|
|
45
44
|
return html`<cosmoz-omnitable-column-list-data
|
|
46
45
|
.items=${getTexts(item, valuePath, textProperty)}
|
|
47
|
-
@expand=${(event) => notifyResize(event.target, index)}
|
|
48
46
|
></cosmoz-omnitable-column-list-data>`;
|
|
49
47
|
}
|
|
50
48
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { component, useEffect } from '@pionjs/pion';
|
|
3
3
|
import { html, nothing } from 'lit-html';
|
|
4
4
|
import './cosmoz-omnitable-item-expand-line';
|
|
5
|
-
import { notifyResize } from './lib/utils';
|
|
6
5
|
|
|
7
6
|
const renderExpandList = ({
|
|
8
7
|
columns,
|
|
@@ -24,7 +23,7 @@ const renderExpandList = ({
|
|
|
24
23
|
>`
|
|
25
24
|
),
|
|
26
25
|
ExpandList = (host) => {
|
|
27
|
-
const {
|
|
26
|
+
const { columns } = host;
|
|
28
27
|
|
|
29
28
|
useEffect(() => {
|
|
30
29
|
if (columns?.length > 0) {
|
|
@@ -35,11 +34,6 @@ const renderExpandList = ({
|
|
|
35
34
|
return () => host.removeAttribute('hidden');
|
|
36
35
|
}, [columns?.length]);
|
|
37
36
|
|
|
38
|
-
useEffect(
|
|
39
|
-
() => expanded && requestAnimationFrame(() => notifyResize(host, index)),
|
|
40
|
-
[expanded]
|
|
41
|
-
);
|
|
42
|
-
|
|
43
37
|
return Array.isArray(columns) && columns.length > 0 && host.expanded
|
|
44
38
|
? renderExpandList(host)
|
|
45
39
|
: nothing;
|
package/lib/use-list.js
CHANGED
|
@@ -7,20 +7,24 @@ import { onItemChange as _onItemChange } from './utils-data';
|
|
|
7
7
|
const _getGroupRowClasses = (folded) =>
|
|
8
8
|
folded ? 'groupRow groupRow-folded' : 'groupRow',
|
|
9
9
|
_getFoldIcon = (expanded) => (expanded ? 'expand-less' : 'expand-more'),
|
|
10
|
-
renderItem =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
renderItem =
|
|
11
|
+
({
|
|
12
|
+
columns,
|
|
13
|
+
collapsedColumns,
|
|
14
|
+
onItemClick,
|
|
15
|
+
onCheckboxChange,
|
|
16
|
+
dataIsValid,
|
|
17
|
+
groupOnColumn,
|
|
18
|
+
onItemChange,
|
|
19
|
+
rowPartFn,
|
|
20
|
+
}) =>
|
|
21
|
+
(item, index, { selected, expanded, toggleCollapse }) =>
|
|
22
|
+
html` <div class="item-row-wrapper">
|
|
21
23
|
<div
|
|
22
24
|
?selected=${selected}
|
|
23
|
-
part="itemRow itemRow-${item[indexSymbol]}
|
|
25
|
+
part="${['itemRow', `itemRow-${item[indexSymbol]}`, rowPartFn?.(item, index)]
|
|
26
|
+
.filter(Boolean)
|
|
27
|
+
.join(' ')}"
|
|
24
28
|
.dataIndex=${item[indexSymbol]}
|
|
25
29
|
.dataItem=${item}
|
|
26
30
|
class="itemRow"
|
|
@@ -62,9 +66,7 @@ const _getGroupRowClasses = (folded) =>
|
|
|
62
66
|
part="item-expand"
|
|
63
67
|
>
|
|
64
68
|
</cosmoz-omnitable-item-expand>
|
|
65
|
-
</div
|
|
66
|
-
};
|
|
67
|
-
},
|
|
69
|
+
</div>`,
|
|
68
70
|
renderGroup = ({ onCheckboxChange, dataIsValid, groupOnColumn }) => {
|
|
69
71
|
return (item, index, { selected, folded, toggleFold }) =>
|
|
70
72
|
html` <div
|
|
@@ -106,6 +108,7 @@ export const useList = ({
|
|
|
106
108
|
columns,
|
|
107
109
|
collapsedColumns,
|
|
108
110
|
sortAndGroupOptions,
|
|
111
|
+
rowPartFn,
|
|
109
112
|
...rest
|
|
110
113
|
}) => {
|
|
111
114
|
const { loading = false, displayEmptyGroups = false, compareItemsFn } = host,
|
|
@@ -162,11 +165,6 @@ export const useList = ({
|
|
|
162
165
|
);
|
|
163
166
|
}, []);
|
|
164
167
|
|
|
165
|
-
useEffect(() => {
|
|
166
|
-
host.shadowRoot.querySelector('#groupedList').scrollTarget =
|
|
167
|
-
host.shadowRoot.querySelector('#scroller');
|
|
168
|
-
}, []);
|
|
169
|
-
|
|
170
168
|
const { groupOnColumn } = sortAndGroupOptions,
|
|
171
169
|
onItemChange = useCallback(
|
|
172
170
|
(column, item) => (value) => _onItemChange(host, column, item, value),
|
|
@@ -193,6 +191,7 @@ export const useList = ({
|
|
|
193
191
|
dataIsValid,
|
|
194
192
|
groupOnColumn,
|
|
195
193
|
onItemChange,
|
|
194
|
+
rowPartFn,
|
|
196
195
|
}),
|
|
197
196
|
[
|
|
198
197
|
columns,
|
|
@@ -202,6 +201,7 @@ export const useList = ({
|
|
|
202
201
|
dataIsValid,
|
|
203
202
|
groupOnColumn,
|
|
204
203
|
onItemChange,
|
|
204
|
+
rowPartFn,
|
|
205
205
|
],
|
|
206
206
|
),
|
|
207
207
|
renderGroup: useMemo(
|
package/lib/use-omnitable.js
CHANGED
|
@@ -18,7 +18,8 @@ export const useOmnitable = (host) => {
|
|
|
18
18
|
noLocal,
|
|
19
19
|
noLocalSort = noLocal,
|
|
20
20
|
noLocalFilter = noLocal,
|
|
21
|
-
error
|
|
21
|
+
error,
|
|
22
|
+
rowPartFn
|
|
22
23
|
} = host,
|
|
23
24
|
settingS = useSettings({ settingsId, host }),
|
|
24
25
|
{ settings, setSettings, columns, resetRef } = settingS,
|
|
@@ -86,6 +87,7 @@ export const useOmnitable = (host) => {
|
|
|
86
87
|
columns,
|
|
87
88
|
collapsedColumns,
|
|
88
89
|
sortAndGroupOptions,
|
|
90
|
+
rowPartFn
|
|
89
91
|
}),
|
|
90
92
|
footer: useFooter({
|
|
91
93
|
host,
|
package/lib/utils.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
target.dispatchEvent(
|
|
3
|
-
new CustomEvent('update-item-size', {
|
|
4
|
-
bubbles: true,
|
|
5
|
-
detail: { index },
|
|
6
|
-
})
|
|
7
|
-
),
|
|
8
|
-
indexSymbol = Symbol('index');
|
|
1
|
+
const indexSymbol = Symbol('index');
|
|
9
2
|
|
|
10
|
-
export {
|
|
3
|
+
export { indexSymbol };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-omnitable",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "[](https://travis-ci.org/Neovici/cosmoz-omnitable)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@neovici/cosmoz-collapse": "^1.1.0",
|
|
65
65
|
"@neovici/cosmoz-datetime-input": "^4.0.0",
|
|
66
66
|
"@neovici/cosmoz-dropdown": "^4.0.0",
|
|
67
|
-
"@neovici/cosmoz-grouped-list": "^
|
|
67
|
+
"@neovici/cosmoz-grouped-list": "^8.0.0",
|
|
68
68
|
"@neovici/cosmoz-i18next": "^3.1.1",
|
|
69
69
|
"@neovici/cosmoz-input": "^4.0.0",
|
|
70
70
|
"@neovici/cosmoz-router": "^11.0.0",
|