@umbraco-ui/uui-table 0.2.1 → 1.0.0-rc.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.
@@ -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
@@ -29,7 +29,7 @@ UUITableElement.styles = [
29
29
  display: table;
30
30
  width: 100%;
31
31
  border-radius: var(--uui-border-radius,3px);
32
- background-color: var(--uui-interface-surface,#fefefe);
32
+ background-color: var(--uui-color-surface,#fff);
33
33
  cursor: default;
34
34
  }
35
35
  `
@@ -92,13 +92,14 @@ 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)
100
101
  );
101
- border-top: 1px solid var(--uui-interface-border,#c4c4c4);
102
+ border-top: 1px solid var(--uui-color-border,#d8d7d9);
102
103
  vertical-align: middle;
103
104
  }
104
105
 
@@ -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([
@@ -235,6 +240,23 @@ var __decorateClass = (decorators, target, key, kind) => {
235
240
  return result;
236
241
  };
237
242
  let UUITableRowElement = class extends SelectOnlyMixin(SelectableMixin(LitElement)) {
243
+ constructor() {
244
+ super();
245
+ let hadMouseDown = false;
246
+ this.addEventListener("blur", () => {
247
+ if (hadMouseDown === false) {
248
+ this.style.setProperty("--uui-show-focus-outline", "1");
249
+ }
250
+ hadMouseDown = false;
251
+ });
252
+ this.addEventListener("mousedown", () => {
253
+ this.style.setProperty("--uui-show-focus-outline", "0");
254
+ hadMouseDown = true;
255
+ });
256
+ this.addEventListener("mouseup", () => {
257
+ hadMouseDown = false;
258
+ });
259
+ }
238
260
  connectedCallback() {
239
261
  super.connectedCallback();
240
262
  this.setAttribute("role", "row");
@@ -264,15 +286,23 @@ UUITableRowElement.styles = [
264
286
  :host {
265
287
  display: table-row;
266
288
  position: relative;
289
+ outline-offset: -3px;
267
290
  }
268
291
 
269
292
  :host([selectable]) {
270
293
  cursor: pointer;
271
294
  }
272
295
 
296
+ :host(:focus) {
297
+ outline: calc(2px * var(--uui-show-focus-outline, 1)) solid
298
+ var(--uui-color-focus,#3879ff);
299
+ }
273
300
  :host([selected]) {
274
- outline: 2px solid var(--uui-interface-select,#3544b1);
275
- outline-offset: -3px;
301
+ outline: 2px solid
302
+ var(--uui-table-row-color-selected, var(--uui-color-selected,#3544b1));
303
+ }
304
+ :host([selected]:focus) {
305
+ outline-color: var(--uui-color-focus,#3879ff);
276
306
  }
277
307
  `
278
308
  ];
@@ -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": "0.2.1",
3
+ "version": "1.0.0-rc.1",
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": "0.2.1"
33
+ "@umbraco-ui/uui-base": "1.0.0-rc.1"
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": "cb61546f85d6c2f122fa8c130409507e8def4bd5"
44
+ "gitHead": "127e036dbafa18cc37027591d6548a4cb4700d33"
45
45
  }