@neovici/cosmoz-omnitable 12.6.3 → 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.
@@ -11,6 +11,7 @@ import { computeSource, listColumnMixin, onChange, onFocus, onText, toAutocomple
11
11
  import {
12
12
  prop, strProp, array
13
13
  } from '@neovici/cosmoz-autocomplete/lib/utils';
14
+ import { columnSymbol } from './lib/use-dom-columns';
14
15
  import { get } from '@polymer/polymer/lib/utils/path';
15
16
 
16
17
  export const
@@ -55,6 +56,7 @@ class OmnitableColumnAutocomplete extends listColumnMixin(columnMixin(PolymerEle
55
56
  .source=${ toAutocompleteSource(source, column.valueProperty, column.textProperty) }
56
57
  .textProperty=${ column.textProperty }
57
58
  .valueProperty=${ column.valueProperty }
59
+ .itemRenderer=${column[columnSymbol]?.itemRenderer}
58
60
  .value=${ filter }
59
61
  .text=${ query }
60
62
  .onChange=${ onChange(setState) }
@@ -14,6 +14,7 @@ import {
14
14
  } from './cosmoz-omnitable-column-list-mixin';
15
15
  import '@neovici/cosmoz-autocomplete';
16
16
  import { notifyResize } from './lib/utils';
17
+ import { columnSymbol } from './lib/use-dom-columns';
17
18
 
18
19
  /**
19
20
  * @polymer
@@ -50,13 +51,13 @@ class OmnitableColumnList extends listColumnMixin(columnMixin(PolymerElement)) {
50
51
  active
51
52
  ></paper-spinner-lite>`
52
53
  : nothing;
53
-
54
54
  return html`<cosmoz-autocomplete-ui
55
55
  class="external-values-${column.externalValues}"
56
56
  .label=${column.title}
57
57
  .source=${source}
58
58
  .textProperty=${column.textProperty}
59
59
  .valueProperty=${column.valueProperty}
60
+ .itemRenderer=${column[columnSymbol]?.itemRenderer}
60
61
  .value=${filter}
61
62
  .text=${query}
62
63
  .onChange=${onChange(setState)}
@@ -49,7 +49,6 @@ const placement = ['bottom-right', ...defaultPlacement],
49
49
  .checked=${checked}
50
50
  @click=${onToggle}
51
51
  .indeterminate=${indeterminate}
52
- .windeterminate=${indeterminate}
53
52
  />
54
53
  </div>`;
55
54
  },
@@ -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 checked = e.target.checked,
109
- idx = parseIndex(e.target.closest('[data-index]')?.dataset.index),
110
- { settings, setSettings } = meta,
111
- newSettings = settings.slice(),
112
- setting = settings[idx],
113
- priority = e.target.windeterminate
114
- ? settings.reduce((acc, s) => Math.max(acc, s.priority), 0) + 1
115
- : setting.priority;
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.6.3",
3
+ "version": "12.7.1",
4
4
  "description": "[![Build Status](https://travis-ci.org/Neovici/cosmoz-omnitable.svg?branch=master)](https://travis-ci.org/Neovici/cosmoz-omnitable)",
5
5
  "keywords": [
6
6
  "web-components"
@@ -96,7 +96,7 @@
96
96
  "@semantic-release/git": "^10.0.0",
97
97
  "@web/dev-server": "^0.1.10",
98
98
  "husky": "^8.0.0",
99
- "semantic-release": "^19.0.0",
99
+ "semantic-release": "^20.0.0",
100
100
  "sinon": "^15.0.0",
101
101
  "web-animations-js": "^2.3.0"
102
102
  }