@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/demo/api.md CHANGED
@@ -1,36 +1,46 @@
1
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=../docs/api.md) -->
2
- <!-- The below content is automatically added from ../docs/api.md -->
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
- ## Properties
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
- | Property | Attribute | Type | Default |
9
- |-----------------|-----------------|-----------|---------|
10
- | [columnHeaders](#columnHeaders) | `columnHeaders` | `array` | |
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
- ## API Examples
29
+ ## Generated Table
16
30
 
17
- The `auro-table` component supports two methods of table generation, either via data provided by attributes, or by projecting your own custom table into the component to be styled.
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
- ### Attribute Data Table
33
+ ### columnHeaders
20
34
 
21
- In order to have the component generate your table for you, you can pass data to the `column-headers` and `component-data` attributes to define your column headers and cell data respectively.
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
- ##### `component-data`
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/basic_attributes.html) -->
54
- <!-- The below content is automatically added from ../apiExamples/basic_attributes.html -->
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/basic_attributes.html) -->
70
- <!-- The below code snippet is automatically added from ../apiExamples/basic_attributes.html -->
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
- ### Custom Table
97
+ ## Projected Table
88
98
 
89
- Alternatively, you can simply provide your own table into the `auro-table` tag and fill it with whatever content you like and it will be styled appropriately.
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/basic_slot.html) -->
93
- <!-- The below content is automatically added from ../apiExamples/basic_slot.html -->
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/basic_slot.html) -->
157
- <!-- The below code snippet is automatically added from ../apiExamples/basic_slot.html -->
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
- #### noWrap
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
- ## Theme Support
273
+ ## Restyle Component with CSS Variables
262
274
 
263
- The component may be restyled using the following code sample and changing the values of the following token(s).
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 -->