@aurodesignsystem-dev/auro-table 0.0.0-pr135.0 → 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 CHANGED
@@ -21,24 +21,26 @@ The following sections are editable by making changes to the following files:
21
21
 
22
22
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
23
23
  <!-- The below content is automatically added from ./docs/partials/description.md -->
24
- Use the `auro-table` custom element to illustrate tabular data or content. The auro-table element is responsive, with a flexible layout and an easy-to-use JSON API.
24
+ Use the `auro-table` custom element to illustrate tabular data or content. The auro-table element is responsive, with a flexible layout and an easy-to-use JSON API. Alternatively, an HTML5 `<table>` may be used inside of the tag to create more dynamic tabular data.
25
25
  <!-- AURO-GENERATED-CONTENT:END -->
26
26
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
27
27
  <!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
28
28
  <!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
29
29
  <!-- AURO-GENERATED-CONTENT:END -->
30
30
 
31
- ## UI development browser support
31
+ ## Use Cases
32
32
 
33
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
34
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
33
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
34
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
35
+ The `<auro-table>` element should be used in situations where users may:
35
36
 
37
+ * Show static or dynamic tabular data or content
36
38
  <!-- AURO-GENERATED-CONTENT:END -->
37
39
 
38
40
  ## Install
39
41
 
40
42
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
41
- [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-table/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-table/actions/workflows/testPublish.yml)
43
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-table/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-table/actions/workflows/release.yml)
42
44
  [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-table?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-table)
43
45
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-table?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
44
46
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -49,17 +51,10 @@ $ npm i @aurodesignsystem/auro-table
49
51
 
50
52
  <!-- AURO-GENERATED-CONTENT:END -->
51
53
 
52
- ### Design Token CSS Custom Property dependency
53
-
54
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
55
- The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
56
-
57
- <!-- AURO-GENERATED-CONTENT:END -->
58
-
59
- ### Define dependency in project component
54
+ ### Define Dependency in Project
60
55
 
61
56
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
62
- Defining the component dependency within each component that is using the `<auro-table>` component.
57
+ Defining the dependency within each project that is using the `<auro-table>` component.
63
58
 
64
59
  <!-- AURO-GENERATED-CONTENT:END -->
65
60
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -69,7 +64,20 @@ import "@aurodesignsystem/auro-table";
69
64
  ```
70
65
 
71
66
  <!-- AURO-GENERATED-CONTENT:END -->
72
- **Reference component in HTML**
67
+
68
+ ### Use CDN
69
+
70
+ <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
71
+ In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
72
+
73
+ ```html
74
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-table@latest/+esm"></script>
75
+ ```
76
+
77
+ <!-- AURO-GENERATED-CONTENT:END -->
78
+
79
+ ## Basic Example
80
+
73
81
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
74
82
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
75
83
 
@@ -145,45 +153,100 @@ import "@aurodesignsystem/auro-table";
145
153
  ```
146
154
  <!-- AURO-GENERATED-CONTENT:END -->
147
155
 
148
- ## Use CDN
156
+ ## Custom Component Registration for Version Management
149
157
 
150
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
151
- In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
158
+ There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
159
+ The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
152
160
 
153
- ```html
154
- <script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-table@latest/+esm"></script>
155
- ```
161
+ When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
156
162
 
157
- <!-- AURO-GENERATED-CONTENT:END -->
158
-
159
- ## auro-table use cases
163
+ However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
160
164
 
161
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
162
- <!-- The below content is automatically added from ./docs/partials/useCases.md -->
163
- The `<auro-table>` element should be used in situations where users may:
165
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
164
166
 
165
- * Show static or dynamic tabular data or content
166
- <!-- AURO-GENERATED-CONTENT:END -->
167
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
168
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
167
169
 
168
- ## API Code Examples
169
-
170
- ### Default auro-table
170
+ ```js
171
+ // Import the class only
172
+ import { AuroTable } from '@aurodesignsystem/auro-table/class';
171
173
 
172
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
173
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
174
+ // Register with a custom name if desired
175
+ AuroTable.register('custom-table');
176
+ ```
177
+
178
+ This will create a new custom element `<custom-table>` that behaves exactly like `<auro-table>`, allowing both to coexist on the same page without interfering with each other.
179
+ <!-- AURO-GENERATED-CONTENT:END -->
180
+ <div class="exampleWrapper exampleWrapper--flex">
181
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
182
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
183
+ <custom-table>
184
+ <table>
185
+ <thead>
186
+ <tr>
187
+ <th></th>
188
+ <th>Monday</th>
189
+ <th>Tuesday</th>
190
+ <th>Wednesday</th>
191
+ <th>Thursday</th>
192
+ <th>Friday</th>
193
+ <th>Saturday</th>
194
+ <th>Sunday</th>
195
+ </tr>
196
+ </thead>
197
+ <tbody>
198
+ <tr>
199
+ <td>Dance class</td>
200
+ <td>5:00pm</td>
201
+ <td></td>
202
+ <td>5:00pm</td>
203
+ <td></td>
204
+ <td></td>
205
+ <td></td>
206
+ <td></td>
207
+ </tr>
208
+ <tr>
209
+ <td>Night classes</td>
210
+ <td></td>
211
+ <td></td>
212
+ <td></td>
213
+ <td>7:00pm</td>
214
+ <td>7:00pm</td>
215
+ <td></td>
216
+ <td></td>
217
+ </tr>
218
+ <tr>
219
+ <td>Team meeting</td>
220
+ <td></td>
221
+ <td></td>
222
+ <td>10:00am</td>
223
+ <td></td>
224
+ <td></td>
225
+ <td></td>
226
+ <td></td>
227
+ </tr>
228
+ <tr>
229
+ <td>Morning workout</td>
230
+ <td>8:00am</td>
231
+ <td>8:00am</td>
232
+ <td>8:00am</td>
233
+ <td>8:00am</td>
234
+ <td>8:00am</td>
235
+ <td></td>
236
+ <td></td>
237
+ </tr>
238
+ </tbody>
239
+ </table>
240
+ </custom-table>
241
+ <!-- AURO-GENERATED-CONTENT:END -->
242
+ </div>
243
+ <auro-accordion alignRight>
244
+ <span slot="trigger">See code</span>
245
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
246
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
174
247
 
175
248
  ```html
176
- <auro-table
177
- columnHeaders='["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]'
178
- componentData='[
179
- {"": "Dance class", "Monday": "5:00pm","Wednesday": "5:00pm" },
180
- {"": "Night classes", "Thursday": "7:00pm","Friday": "7:00pm" },
181
- {"": "Team meeting", "Wednesday": "10:00am" },
182
- {"": "Morning workout", "Monday": "8:00am", "Tuesday": "8:00am", "Wednesday": "8:00am", "Thursday": "8:00am", "Friday": "8:00am" }
183
- ]'
184
- >
185
- </auro-table>
186
- <auro-table>
249
+ <custom-table>
187
250
  <table>
188
251
  <thead>
189
252
  <tr>
@@ -240,35 +303,7 @@ The `<auro-table>` element should be used in situations where users may:
240
303
  </tr>
241
304
  </tbody>
242
305
  </table>
243
- </auro-table>
306
+ </custom-table>
244
307
  ```
245
308
  <!-- AURO-GENERATED-CONTENT:END -->
246
-
247
- ## Development
248
-
249
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
250
- In order to develop against this project, if you are not part of the core team, you will be required to fork the project prior to submitting a pull request.
251
-
252
- Please be sure to review the [contribution guidelines](https://auro.alaskaair.com/contributing) for this project. Please make sure to **pay special attention** to the **conventional commits** section of the document.
253
-
254
- <!-- AURO-GENERATED-CONTENT:END -->
255
-
256
- ### Start development environment
257
-
258
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
259
- Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the **dev server**.
260
-
261
- ```shell
262
- $ npm run dev
263
- ```
264
-
265
- Open [localhost:8000](http://localhost:8000/)
266
-
267
- <!-- AURO-GENERATED-CONTENT:END -->
268
-
269
- ### Testing
270
-
271
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
272
- Automated tests are required for every Auro component. See `.\test\auro-table.test.js` for the tests for this component. Run `npm run test` to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See [the testing documentation](https://auro.alaskaair.com/support/tests) for more details.
273
-
274
- <!-- AURO-GENERATED-CONTENT:END -->
309
+ </auro-accordion>