Skip to content

Commit c0fd102

Browse files
committed
1 parent 7558a48 commit c0fd102

7 files changed

+10
-60
lines changed

cosmoz-omnitable-column-list-data.js

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ class OmnitableColumnListData extends translatable(mixin(Template, PolymerElemen
127127
this._expanded = !this._expanded;
128128
event.stopPropagation();
129129
event.preventDefault();
130-
this.dispatchEvent(new CustomEvent('expand', { bubbles: true }));
131130
}
132131
}
133132

cosmoz-omnitable-column-list.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
onText,
1515
} from './cosmoz-omnitable-column-list-mixin';
1616
import '@neovici/cosmoz-autocomplete';
17-
import { notifyResize } from './lib/utils';
1817
import { columnSymbol } from './lib/use-dom-columns';
1918

2019
/**
@@ -41,10 +40,9 @@ class OmnitableColumnList extends listColumnMixin(columnMixin(PolymerElement)) {
4140
};
4241
}
4342

44-
renderCell({ valuePath, textProperty }, { item, index }) {
43+
renderCell({ valuePath, textProperty }, { item }) {
4544
return html`<cosmoz-omnitable-column-list-data
4645
.items=${getTexts(item, valuePath, textProperty)}
47-
@expand=${(event) => notifyResize(event.target, index)}
4846
></cosmoz-omnitable-column-list-data>`;
4947
}
5048

cosmoz-omnitable-item-expand.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { component, useEffect } from '@pionjs/pion';
33
import { html, nothing } from 'lit-html';
44
import './cosmoz-omnitable-item-expand-line';
5-
import { notifyResize } from './lib/utils';
65

76
const renderExpandList = ({
87
columns,
@@ -24,7 +23,7 @@ const renderExpandList = ({
2423
>`
2524
),
2625
ExpandList = (host) => {
27-
const { expanded, index, columns } = host;
26+
const { columns } = host;
2827

2928
useEffect(() => {
3029
if (columns?.length > 0) {
@@ -35,11 +34,6 @@ const renderExpandList = ({
3534
return () => host.removeAttribute('hidden');
3635
}, [columns?.length]);
3736

38-
useEffect(
39-
() => expanded && requestAnimationFrame(() => notifyResize(host, index)),
40-
[expanded]
41-
);
42-
4337
return Array.isArray(columns) && columns.length > 0 && host.expanded
4438
? renderExpandList(host)
4539
: nothing;

lib/use-list.js

-5
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ export const useList = ({
165165
);
166166
}, []);
167167

168-
useEffect(() => {
169-
host.shadowRoot.querySelector('#groupedList').scrollTarget =
170-
host.shadowRoot.querySelector('#scroller');
171-
}, []);
172-
173168
const { groupOnColumn } = sortAndGroupOptions,
174169
onItemChange = useCallback(
175170
(column, item) => (value) => _onItemChange(host, column, item, value),

lib/utils.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
const notifyResize = (target, index) =>
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');
92

10-
export { notifyResize, indexSymbol };
3+
export { indexSymbol };

package-lock.json

+5-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@neovici/cosmoz-collapse": "^1.1.0",
6565
"@neovici/cosmoz-datetime-input": "^4.0.0",
6666
"@neovici/cosmoz-dropdown": "^4.0.0",
67-
"@neovici/cosmoz-grouped-list": "^7.0.0",
67+
"@neovici/cosmoz-grouped-list": "^8.0.0",
6868
"@neovici/cosmoz-i18next": "^3.1.1",
6969
"@neovici/cosmoz-input": "^4.0.0",
7070
"@neovici/cosmoz-router": "^11.0.0",

0 commit comments

Comments
 (0)