@neovici/cosmoz-omnitable 8.14.0 → 8.14.3

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.
@@ -95,11 +95,11 @@ class Omnitable extends hauntedPolymer(useOmnitable)(mixin({ isEmpty }, translat
95
95
  >
96
96
  <template slot="templates" data-type="item">
97
97
  <div class="item-row-wrapper">
98
- <div selected$="[[ selected ]]" part="itemRow itemRow-[[ index ]]" data-index$="[[ index ]]" class="itemRow">
98
+ <div selected$="[[ selected ]]" part="itemRow itemRow-[[ index ]]" data-index$="[[ index ]]" class="itemRow" on-click="onItemClick">
99
99
  <input class="checkbox" type="checkbox" checked="[[ selected ]]" on-input="_onCheckboxChange" disabled$="[[ !_dataIsValid ]]" />
100
100
  <cosmoz-omnitable-item-row columns="[[ columns ]]"
101
101
  selected="[[ selected ]]" expanded="{{ expanded }}" item="[[ item ]]" group-on-column="[[ groupOnColumn ]]"
102
- on-item-change="[[ onItemChange ]]" on-click="onItemClick">
102
+ on-item-change="[[ onItemChange ]]">
103
103
  </cosmoz-omnitable-item-row>
104
104
  <paper-icon-button
105
105
  class="expand"
@@ -545,20 +545,26 @@ class Omnitable extends hauntedPolymer(useOmnitable)(mixin({ isEmpty }, translat
545
545
  value && close(); /* eslint-disable-line no-unused-expressions */
546
546
  };
547
547
  }
548
- onItemClick(e){
549
- const path = e.composedPath(),
550
- hasLinks = path.slice(0, path.indexOf(e.currentTarget))
551
- .find(e => e.matches?.('a'));
552
548
 
553
- this.dispatchEvent(new window.CustomEvent('omnitable-item-click', {
554
- bubbles: true,
555
- composed: true,
556
- detail: {
557
- item: e.model.item,
558
- index: e.model.index,
559
- hasLinks
560
- }
561
- }));
549
+ onItemClick(e) {
550
+ const composedPath = e.composedPath(),
551
+ path = composedPath.slice(0, composedPath.indexOf(e.currentTarget));
552
+
553
+ if (path.find((e) => e.matches?.('a, .checkbox, .expand'))) {
554
+ return;
555
+ }
556
+
557
+
558
+ this.dispatchEvent(
559
+ new window.CustomEvent('omnitable-item-click', {
560
+ bubbles: true,
561
+ composed: true,
562
+ detail: {
563
+ item: e.model.item,
564
+ index: e.model.index,
565
+ },
566
+ })
567
+ );
562
568
  }
563
569
  }
564
570
  customElements.define('cosmoz-omnitable', Omnitable);
@@ -72,7 +72,14 @@ const placement = ['bottom-right', ...defaultPlacement],
72
72
  </style>
73
73
  <div class="headline">
74
74
  ${_('Sort and filter')}
75
- <button class="close" @click=${(e) => e.currentTarget?.blur()}>
75
+ <button
76
+ class="close"
77
+ @click=${(e) => {
78
+ const tg = e.currentTarget;
79
+ tg?.focus();
80
+ tg?.blur();
81
+ }}
82
+ >
76
83
  ${close}
77
84
  </button>
78
85
  </div>
@@ -17,14 +17,15 @@ export default css`
17
17
  font-weight: 500;
18
18
  font-size: 16px;
19
19
  line-height: 0.95;
20
- padding: 12px 14px 11px 14px;
20
+ padding: 10px 14px;
21
21
  display: flex;
22
+ align-items: center
22
23
  }
23
24
  .close {
24
25
  border: none;
25
26
  background: none;
26
27
  cursor: pointer;
27
- padding: 0;
28
+ padding: 2.5px 6px;
28
29
  margin-left: auto;
29
30
  }
30
31
 
@@ -56,6 +57,7 @@ export default css`
56
57
  }
57
58
  .heading svg {
58
59
  margin-left: auto;
60
+ margin-right: 4px;
59
61
  }
60
62
  .heading[data-opened] svg {
61
63
  transform: scaleY(-1);
@@ -147,6 +149,7 @@ export default css`
147
149
  padding: 14px;
148
150
  }
149
151
  .sg {
152
+ color: inherit;
150
153
  border: 1px solid rgba(0, 0, 0, 0.2);
151
154
  border-radius: 2px;
152
155
  font-size: 13px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "8.14.0",
3
+ "version": "8.14.3",
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"