@umbraco-ui/uui-table 1.0.0-rc.0 → 1.0.0-rc.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.
@@ -58,6 +58,16 @@
58
58
  "name": "",
59
59
  "description": "slot for table cell content"
60
60
  }
61
+ ],
62
+ "cssProperties": [
63
+ {
64
+ "name": "--uui-table-cell-padding",
65
+ "description": "overwrite the table cell padding"
66
+ },
67
+ {
68
+ "name": "--uui-table-cell-height",
69
+ "description": "overwrite the table cell height"
70
+ }
61
71
  ]
62
72
  },
63
73
  {
@@ -129,6 +139,16 @@
129
139
  "name": "",
130
140
  "description": "slot for table cell content"
131
141
  }
142
+ ],
143
+ "cssProperties": [
144
+ {
145
+ "name": "--uui-table-cell-padding",
146
+ "description": "overwrite the table cell padding"
147
+ },
148
+ {
149
+ "name": "--uui-table-cell-height",
150
+ "description": "overwrite the table cell height"
151
+ }
132
152
  ]
133
153
  },
134
154
  {
@@ -212,6 +232,12 @@
212
232
  "name": "",
213
233
  "description": "for <uui-table-cell> elements that should be in the row."
214
234
  }
235
+ ],
236
+ "cssProperties": [
237
+ {
238
+ "name": "--uui-table-row-color-selected",
239
+ "description": "overwrite the color of the selected row"
240
+ }
215
241
  ]
216
242
  },
217
243
  {
package/lib/index.js CHANGED
@@ -92,8 +92,9 @@ let UUITableCellElement = class extends LitElement {
92
92
  UUITableCellElement.styles = [
93
93
  css`
94
94
  :host {
95
+ position: relative;
95
96
  display: table-cell;
96
- height: var(--uui-size-12,36px);
97
+ height: var(--uui-table-cell-height, var(--uui-size-12,36px));
97
98
  padding: var(
98
99
  --uui-table-cell-padding,
99
100
  var(--uui-size-4,12px) var(--uui-size-5,15px)
@@ -119,6 +120,10 @@ UUITableCellElement.styles = [
119
120
  position: absolute;
120
121
  inset: 0;
121
122
  }
123
+
124
+ :host([no-padding]) {
125
+ padding: 0;
126
+ }
122
127
  `
123
128
  ];
124
129
  __decorateClass$4([
@@ -234,7 +239,26 @@ var __decorateClass = (decorators, target, key, kind) => {
234
239
  __defProp(target, key, result);
235
240
  return result;
236
241
  };
237
- let UUITableRowElement = class extends SelectOnlyMixin(SelectableMixin(LitElement)) {
242
+ let UUITableRowElement = class extends SelectOnlyMixin(
243
+ SelectableMixin(LitElement)
244
+ ) {
245
+ constructor() {
246
+ super();
247
+ let hadMouseDown = false;
248
+ this.addEventListener("blur", () => {
249
+ if (hadMouseDown === false) {
250
+ this.style.setProperty("--uui-show-focus-outline", "1");
251
+ }
252
+ hadMouseDown = false;
253
+ });
254
+ this.addEventListener("mousedown", () => {
255
+ this.style.setProperty("--uui-show-focus-outline", "0");
256
+ hadMouseDown = true;
257
+ });
258
+ this.addEventListener("mouseup", () => {
259
+ hadMouseDown = false;
260
+ });
261
+ }
238
262
  connectedCallback() {
239
263
  super.connectedCallback();
240
264
  this.setAttribute("role", "row");
@@ -264,15 +288,23 @@ UUITableRowElement.styles = [
264
288
  :host {
265
289
  display: table-row;
266
290
  position: relative;
291
+ outline-offset: -3px;
267
292
  }
268
293
 
269
294
  :host([selectable]) {
270
295
  cursor: pointer;
271
296
  }
272
297
 
298
+ :host(:focus) {
299
+ outline: calc(2px * var(--uui-show-focus-outline, 1)) solid
300
+ var(--uui-color-focus,#3879ff);
301
+ }
273
302
  :host([selected]) {
274
- outline: 2px solid var(--uui-color-selected,#3544b1);
275
- outline-offset: -3px;
303
+ outline: 2px solid
304
+ var(--uui-table-row-color-selected, var(--uui-color-selected,#3544b1));
305
+ }
306
+ :host([selected]:focus) {
307
+ outline-color: var(--uui-color-focus,#3879ff);
276
308
  }
277
309
  `
278
310
  ];
@@ -3,6 +3,8 @@ import { LitElement } from 'lit';
3
3
  * Table cell that detects if it has overflow and if so it'll add a title attribute to itself to display full text. Must be a child of uui-table-row
4
4
  * @element uui-table-cell
5
5
  * @slot - slot for table cell content
6
+ * @cssprop --uui-table-cell-padding - overwrite the table cell padding
7
+ * @cssprop --uui-table-cell-height - overwrite the table cell height
6
8
  */
7
9
  export declare class UUITableCellElement extends LitElement {
8
10
  static styles: import("lit").CSSResult[];
@@ -4,9 +4,11 @@ declare const UUITableRowElement_base: (new (...args: any[]) => import("@umbraco
4
4
  * Table row element with option to set is as selectable. Parent for uui-table-cell. Must be a child of uui-table.
5
5
  * @element uui-table-row
6
6
  * @slot for <uui-table-cell> elements that should be in the row.
7
+ * @cssprop --uui-table-row-color-selected - overwrite the color of the selected row
7
8
  */
8
9
  export declare class UUITableRowElement extends UUITableRowElement_base {
9
10
  static styles: import("lit").CSSResult[];
11
+ constructor();
10
12
  connectedCallback(): void;
11
13
  private slotCellNodes?;
12
14
  protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-table",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.3",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,7 +30,7 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.0.0-rc.0"
33
+ "@umbraco-ui/uui-base": "1.0.0-rc.3"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
@@ -41,5 +41,5 @@
41
41
  "access": "public"
42
42
  },
43
43
  "homepage": "https://uui.umbraco.com/?path=/story/uui-table",
44
- "gitHead": "b03d833ef438156f3e87d3ffa29a4dcca7d560cd"
44
+ "gitHead": "7d643a3d5f7204efbc3aaad83889c2fd5200af73"
45
45
  }