@aurodesignsystem-dev/auro-table 0.0.0-pr134.1 → 0.0.0-pr139.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 +267 -43
- package/custom-elements.json +563 -0
- package/demo/api.html +1 -1
- package/demo/api.md +43 -31
- package/demo/auro-table.min.js +532 -59
- package/demo/index.html +1 -1
- package/demo/index.md +26 -120
- package/dist/auro-table-C52RNUva.js +12 -0
- package/dist/index.d.ts +185 -15
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +20 -11
- package/dist/auro-table-CifFJTj6.js +0 -11
package/demo/api.md
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src
|
|
2
|
-
<!-- The below content is automatically added from
|
|
1
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/api.md) -->
|
|
2
|
+
<!-- The below content is automatically added from ./../docs/api.md -->
|
|
3
3
|
|
|
4
4
|
# auro-table
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The `auro-table` element supports two types of tables, either a generated table created by providing data for columns and rows via attributes, or by projecting your own custom table into the default slot of the component to be styled.
|
|
7
|
+
|
|
8
|
+
### Properties & Attributes
|
|
9
|
+
|
|
10
|
+
| Properties | Attributes | Modifiers | Type | Default | Description |
|
|
11
|
+
| ------------- | ------------- | --------- | ------- | ------- | ------------------------------------------------------------ |
|
|
12
|
+
| columnHeaders | columnHeaders | | array | | An array of strings representing the table's column headers. |
|
|
13
|
+
| componentData | componentData | | array | | An array of objects representing the table's data rows. |
|
|
14
|
+
| nowrap | nowrap | | boolean | | When true, prevents the table from wrapping its content. |
|
|
15
|
+
|
|
16
|
+
### Methods
|
|
17
|
+
|
|
18
|
+
| Name | Parameters | Return | Description |
|
|
19
|
+
| -------- | -------------------------------------------------------------------- | ------ | ------------------------------------------------- |
|
|
20
|
+
| register | `name` (string) - The name of the element that you want to register. | | This will register this element with the browser. |
|
|
21
|
+
|
|
22
|
+
### Slots
|
|
7
23
|
|
|
8
|
-
|
|
|
9
|
-
|
|
10
|
-
|
|
|
11
|
-
| [componentData](#componentData) | `componentData` | `array` | |
|
|
12
|
-
| [nowrap](#nowrap) | `nowrap` | `boolean` | false |
|
|
24
|
+
| Name | Description |
|
|
25
|
+
| --------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| (default) | Default slot for projecting a native `<table>` element. Only available when `columnHeaders` and `componentData` are not set. |
|
|
13
27
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
14
28
|
|
|
15
|
-
##
|
|
29
|
+
## Generated Table
|
|
16
30
|
|
|
17
|
-
|
|
31
|
+
In order to have the component generate your table for you, you can pass data to the `columnHeaders` and `componentData` attributes to define your column headers and cell data respectively.
|
|
18
32
|
|
|
19
|
-
###
|
|
33
|
+
### columnHeaders
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
#### Attribute Definitions
|
|
24
|
-
|
|
25
|
-
##### `column-headers`
|
|
26
|
-
This attribute takes an array of column headers to use, and accepts blank strings for empty columns. It does not support duplicate values, including empty strings, as each value is used as a key to project data into the table cells via the `component-data` attribute.
|
|
35
|
+
This attribute takes an array of column headers to use, and accepts blank strings for empty columns. It does not support duplicate values, including empty strings, as each value is used as a key to project data into the table cells via the `componentData` attribute.
|
|
27
36
|
|
|
28
37
|
Example:
|
|
29
38
|
```javascript
|
|
30
39
|
["Column 1", "Column 2", "Column 3"]
|
|
31
40
|
```
|
|
32
41
|
|
|
33
|
-
|
|
42
|
+
### componentData
|
|
43
|
+
|
|
34
44
|
This attribute takes an array of objects, with each object representing a row with data defined for each cell by specifying the matching column-header value.
|
|
35
45
|
|
|
36
46
|
Example:
|
|
@@ -50,8 +60,8 @@ Example:
|
|
|
50
60
|
```
|
|
51
61
|
|
|
52
62
|
<div class="exampleWrapper">
|
|
53
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/
|
|
54
|
-
<!-- The below content is automatically added from ../apiExamples/
|
|
63
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/basic-attributes.html) -->
|
|
64
|
+
<!-- The below content is automatically added from ../apiExamples/basic-attributes.html -->
|
|
55
65
|
<auro-table
|
|
56
66
|
columnHeaders='["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]'
|
|
57
67
|
componentData='[
|
|
@@ -66,8 +76,8 @@ Example:
|
|
|
66
76
|
</div>
|
|
67
77
|
<auro-accordion alignRight>
|
|
68
78
|
<span slot="trigger">See code</span>
|
|
69
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/
|
|
70
|
-
<!-- The below code snippet is automatically added from ../apiExamples/
|
|
79
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/basic-attributes.html) -->
|
|
80
|
+
<!-- The below code snippet is automatically added from ../apiExamples/basic-attributes.html -->
|
|
71
81
|
|
|
72
82
|
```html
|
|
73
83
|
<auro-table
|
|
@@ -84,13 +94,13 @@ Example:
|
|
|
84
94
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
85
95
|
</auro-accordion>
|
|
86
96
|
|
|
87
|
-
|
|
97
|
+
## Projected Table
|
|
88
98
|
|
|
89
|
-
|
|
99
|
+
For more dynamic content, you can provide your own custom HTML5 `<table>` element inside the `auro-table` tag to be projected into the default slot and styled appropriately. The `auro-table` component will add any supporting classes needed for styling. Mutations to the table, such as adding and removing columns and cells, are supported.
|
|
90
100
|
|
|
91
101
|
<div class="exampleWrapper">
|
|
92
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/
|
|
93
|
-
<!-- The below content is automatically added from ../apiExamples/
|
|
102
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/basic-slot.html) -->
|
|
103
|
+
<!-- The below content is automatically added from ../apiExamples/basic-slot.html -->
|
|
94
104
|
<auro-table>
|
|
95
105
|
<table>
|
|
96
106
|
<thead>
|
|
@@ -153,8 +163,8 @@ Alternatively, you can simply provide your own table into the `auro-table` tag a
|
|
|
153
163
|
</div>
|
|
154
164
|
<auro-accordion alignRight>
|
|
155
165
|
<span slot="trigger">See code</span>
|
|
156
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/
|
|
157
|
-
<!-- The below code snippet is automatically added from ../apiExamples/
|
|
166
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/basic-slot.html) -->
|
|
167
|
+
<!-- The below code snippet is automatically added from ../apiExamples/basic-slot.html -->
|
|
158
168
|
|
|
159
169
|
```html
|
|
160
170
|
<auro-table>
|
|
@@ -219,7 +229,9 @@ Alternatively, you can simply provide your own table into the `auro-table` tag a
|
|
|
219
229
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
220
230
|
</auro-accordion>
|
|
221
231
|
|
|
222
|
-
|
|
232
|
+
## Property & Attribute Examples
|
|
233
|
+
|
|
234
|
+
### noWrap
|
|
223
235
|
|
|
224
236
|
The `nowrap` attribute, when applied, will prevent table content from word wrapping, i.e. all text content will be on a single line.
|
|
225
237
|
|
|
@@ -258,9 +270,9 @@ The `nowrap` attribute, when applied, will prevent table content from word wrapp
|
|
|
258
270
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
259
271
|
</auro-accordion>
|
|
260
272
|
|
|
261
|
-
##
|
|
273
|
+
## Restyle Component with CSS Variables
|
|
262
274
|
|
|
263
|
-
The component may be restyled
|
|
275
|
+
The component may be restyled by changing the values of the following token(s).
|
|
264
276
|
|
|
265
277
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
266
278
|
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|