Skip to content

Commit

Permalink
chore(data-table): rename to v2, add hidden config for v2 alias
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Apr 11, 2019
1 parent a25672f commit f65a6fe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/components/data-table-v2/data-table-v2.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

module.exports = {
hidden: true,
};
24 changes: 12 additions & 12 deletions src/components/data-table/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ The update to tables splits out the `scss` files into multiple partial files wit

#### Files

| Name | Description |
| -------------------------- | ---------------------------------------- |
| `data-table` | index file, brings in all functionality |
| `data-table-v2-core` | Core styles and base modifiers, required |
| `data-table-v2-action` | Action bar styles |
| `data-table-v2-expandable` | Expandable row styles |
| `data-table-v2-sort` | Sortable header styles |
| Name | Description |
| ----------------------- | ---------------------------------------- |
| `data-table` | index file, brings in all functionality |
| `data-table-core` | Core styles and base modifiers, required |
| `data-table-action` | Action bar styles |
| `data-table-expandable` | Expandable row styles |
| `data-table-sort` | Sortable header styles |

#### Modifiers

Expand All @@ -30,20 +30,20 @@ The update to tables splits out the `scss` files into multiple partial files wit
##### ES2015

```javascript
import { DataTableV2 } from 'carbon-components';
import { DataTable } from 'carbon-components';
```

##### With pre-build bundle (`carbon-components.min.js`)

```javascript
var DataTableV2 = CarbonComponents.DataTableV2;
var DataTable = CarbonComponents.DataTable;
```

#### Instantiating

```javascript
// `#my-data-table` is an element with `[data-data-table]` attribute
DataTableV2.create(document.getElementById('my-data-table'));
DataTable.create(document.getElementById('my-data-table'));
```

#### Public Methods
Expand All @@ -57,8 +57,8 @@ DataTableV2.create(document.getElementById('my-data-table'));

```javascript
// `#my-data-table` is an element with `[data-data-table]` attribute
var dataTableV2Instance = DataTableV2.create(document.getElementById('my-data-table'));
dataTableV2Instance.refreshRows();
var dataTableInstance = DataTable.create(document.getElementById('my-data-table'));
dataTableInstance.refreshRows();
```

#### Events
Expand Down
4 changes: 2 additions & 2 deletions src/components/data-table/data-table.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,15 @@ const rowsExpandable = [
];

module.exports = {
label: 'Data Table V2',
label: 'Data Table',
context: {
prefix,
componentsX,
},
variants: [
{
name: 'default',
label: 'Data Table V2',
label: 'Data Table',
notes: `
Data Tables are used to represent a collection of resources, displaying a
subset of their fields in columns, or headers.
Expand Down

0 comments on commit f65a6fe

Please sign in to comment.