@umbraco-ui/uui-table 0.0.19 → 0.1.0
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.
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@umbraco-ui/uui-table)
|
|
4
4
|
|
|
5
|
+
### See it in action
|
|
6
|
+
|
|
7
|
+
Preview the component on [Storybook](https://uui.umbraco.com/?path=/story/uui-table)
|
|
8
|
+
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
7
11
|
### ES imports
|
package/custom-elements.json
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"slots": [
|
|
57
57
|
{
|
|
58
58
|
"name": "",
|
|
59
|
-
"description": "for table cell content"
|
|
59
|
+
"description": "slot for table cell content"
|
|
60
60
|
}
|
|
61
61
|
]
|
|
62
62
|
},
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"slots": [
|
|
128
128
|
{
|
|
129
129
|
"name": "",
|
|
130
|
-
"description": "for table cell content"
|
|
130
|
+
"description": "slot for table cell content"
|
|
131
131
|
}
|
|
132
132
|
]
|
|
133
133
|
},
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"slots": [
|
|
146
146
|
{
|
|
147
147
|
"name": "",
|
|
148
|
-
"description": "for uui-table-head-cell elements."
|
|
148
|
+
"description": "slot for uui-table-head-cell elements."
|
|
149
149
|
}
|
|
150
150
|
]
|
|
151
151
|
},
|
|
@@ -197,6 +197,16 @@
|
|
|
197
197
|
"default": "false"
|
|
198
198
|
}
|
|
199
199
|
],
|
|
200
|
+
"events": [
|
|
201
|
+
{
|
|
202
|
+
"name": "selected",
|
|
203
|
+
"description": "fires when the media card is selected"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "unselected",
|
|
207
|
+
"description": "fires when the media card is unselected"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
200
210
|
"slots": [
|
|
201
211
|
{
|
|
202
212
|
"name": "",
|
|
@@ -218,7 +228,7 @@
|
|
|
218
228
|
"slots": [
|
|
219
229
|
{
|
|
220
230
|
"name": "",
|
|
221
|
-
"description": "for uui-table-head and uui-table-row elements. Make a table out of them."
|
|
231
|
+
"description": "slot for `<uui-table-head>` and `<uui-table-row>` elements. Make a table out of them."
|
|
222
232
|
}
|
|
223
233
|
]
|
|
224
234
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
2
2
|
import { css, LitElement, html } from 'lit';
|
|
3
|
-
import { property,
|
|
3
|
+
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
4
4
|
import { SelectOnlyMixin, SelectableMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
|
5
5
|
|
|
6
6
|
var __defProp$5 = Object.defineProperty;
|
|
@@ -246,10 +246,15 @@ let UUITableRowElement = class extends SelectOnlyMixin(SelectableMixin(LitElemen
|
|
|
246
246
|
updateChildSelectOnly() {
|
|
247
247
|
if (this.slotCellNodes) {
|
|
248
248
|
this.slotCellNodes.forEach((el) => {
|
|
249
|
-
|
|
249
|
+
if (this.elementIsTableCell(el)) {
|
|
250
|
+
el.disableChildInteraction = this.selectOnly;
|
|
251
|
+
}
|
|
250
252
|
});
|
|
251
253
|
}
|
|
252
254
|
}
|
|
255
|
+
elementIsTableCell(element) {
|
|
256
|
+
return element instanceof UUITableCellElement;
|
|
257
|
+
}
|
|
253
258
|
render() {
|
|
254
259
|
return html` <slot @slotchanged=${this.updateChildSelectOnly}></slot> `;
|
|
255
260
|
}
|
|
@@ -272,7 +277,10 @@ UUITableRowElement.styles = [
|
|
|
272
277
|
`
|
|
273
278
|
];
|
|
274
279
|
__decorateClass([
|
|
275
|
-
|
|
280
|
+
queryAssignedElements({
|
|
281
|
+
flatten: true,
|
|
282
|
+
selector: "uui-table-cell, [uui-table-cell], [role=cell]"
|
|
283
|
+
})
|
|
276
284
|
], UUITableRowElement.prototype, "slotCellNodes", 2);
|
|
277
285
|
UUITableRowElement = __decorateClass([
|
|
278
286
|
defineElement("uui-table-row")
|
|
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
/**
|
|
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
|
-
* @slot for table cell content
|
|
5
|
+
* @slot - slot for table cell content
|
|
6
6
|
*/
|
|
7
7
|
export declare class UUITableCellElement extends LitElement {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
/**
|
|
3
3
|
* Table head element. Holds the styles for table head. Parent to uui-table-head-cell.
|
|
4
4
|
* @element uui-table-head
|
|
5
|
-
* @slot for uui-table-head-cell elements.
|
|
5
|
+
* @slot - slot for uui-table-head-cell elements.
|
|
6
6
|
*/
|
|
7
7
|
export declare class UUITableHeadElement extends LitElement {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
@@ -11,6 +11,7 @@ export declare class UUITableRowElement extends UUITableRowElement_base {
|
|
|
11
11
|
private slotCellNodes?;
|
|
12
12
|
protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
13
13
|
private updateChildSelectOnly;
|
|
14
|
+
private elementIsTableCell;
|
|
14
15
|
render(): import("lit-html").TemplateResult<1>;
|
|
15
16
|
}
|
|
16
17
|
declare global {
|
|
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
/**
|
|
3
3
|
* Recreation of native table and it's child elements. `<uui-table>` is a parent element to `<uui-table-head>` `<and uui-table-row>`. To make it fully accessible remember to add aria-label and aria-describedby.
|
|
4
4
|
* @element uui-table
|
|
5
|
-
* @slot for uui-table-head and uui-table-row elements. Make a table out of them.
|
|
5
|
+
* @slot - slot for `<uui-table-head>` and `<uui-table-row>` elements. Make a table out of them.
|
|
6
6
|
*/
|
|
7
7
|
export declare class UUITableElement extends LitElement {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-table",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
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.0
|
|
33
|
+
"@umbraco-ui/uui-base": "0.1.0"
|
|
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": "
|
|
44
|
+
"gitHead": "9ed7860ce865d310b85bd1718f37b59db873aefd"
|
|
45
45
|
}
|