@neovici/cosmoz-omnitable 12.7.0 → 12.7.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.
|
@@ -9,8 +9,9 @@ const parseIndex = (str) => {
|
|
|
9
9
|
// eslint-disable-next-line max-lines-per-function
|
|
10
10
|
export default (host) => {
|
|
11
11
|
const { config } = host,
|
|
12
|
-
{ settings, setSettings } = config,
|
|
12
|
+
{ settings, setSettings, collapsed } = config,
|
|
13
13
|
meta = useMeta({
|
|
14
|
+
collapsed,
|
|
14
15
|
settings: settings.columns,
|
|
15
16
|
setSettings: useCallback(
|
|
16
17
|
(columns) =>
|
|
@@ -105,19 +106,21 @@ export default (host) => {
|
|
|
105
106
|
|
|
106
107
|
onToggle: useCallback(
|
|
107
108
|
(e) => {
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
const { settings, setSettings } = meta,
|
|
110
|
+
newSettings = settings.map((column) => ({
|
|
111
|
+
...column,
|
|
112
|
+
disabled:
|
|
113
|
+
column.disabled ||
|
|
114
|
+
meta.collapsed?.some((c) => c.name === column.name),
|
|
115
|
+
})),
|
|
116
|
+
idx = parseIndex(e.target.closest('[data-index]')?.dataset.index);
|
|
116
117
|
|
|
117
118
|
newSettings.splice(idx, 1, {
|
|
118
119
|
...settings[idx],
|
|
119
|
-
disabled: !checked,
|
|
120
|
-
priority
|
|
120
|
+
disabled: !e.target.checked,
|
|
121
|
+
priority: e.target.checked
|
|
122
|
+
? settings.reduce((acc, s) => Math.max(acc, s.priority), 0) + 1
|
|
123
|
+
: settings[idx].priority,
|
|
121
124
|
});
|
|
122
125
|
setSettings(newSettings);
|
|
123
126
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-omnitable",
|
|
3
|
-
"version": "12.7.
|
|
3
|
+
"version": "12.7.1",
|
|
4
4
|
"description": "[](https://travis-ci.org/Neovici/cosmoz-omnitable)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components"
|