Skip to content

Commit f43050b

Browse files
committed
Start wiring up layers and colors in demo.
1 parent 1b03159 commit f43050b

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/pg/inputPixelEditor/__examples__/basic/basic.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ <h3>Drawing Tools</h3>
5252
<div>
5353
<h3>Color Tools</h3>
5454
<button part="addColor">Add Color</button>
55-
<pre part="colors"></pre>
55+
<pg-table part="colors"></pg-table>
5656
</div>
5757
<div>
5858
<h3>Layer Tools</h3>
5959
<button part="addLayer">Add Layer</button>
60-
<pre part="layers"></pre>
60+
<pg-table part="layers"></table>
6161
</div>
6262
<div>
6363
<h3>Example Tools</h3>

src/pg/inputPixelEditor/__examples__/basic/basic.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { patterns } from './constants';
55

66
import template from './basic.html';
77
import style from './basic.css';
8+
import PgTable from 'pg/table/table';
89

910
@Component({
1011
selector: 'x-pg-input-pixel-editor-basic',
@@ -45,9 +46,8 @@ export default class XPgInputPixelEditorBasic extends HTMLElement {
4546

4647
@Part() $addLayer: HTMLButtonElement;
4748

48-
// MAKE A LIST COMPONENT!!!! [text | delete]
49-
@Part() $colors: HTMLPreElement;
50-
@Part() $layers: HTMLPreElement;
49+
@Part() $colors: PgTable;
50+
@Part() $layers: PgTable;
5151

5252
connectedCallback() {
5353
this.$width.value = '10';
@@ -144,10 +144,20 @@ export default class XPgInputPixelEditorBasic extends HTMLElement {
144144
// no save
145145
}
146146
});
147+
// Layers
148+
this.$layers.columns = [{
149+
label: 'Color',
150+
key: 'color'
151+
}];
147152
this.$addLayer.addEventListener('click', () => {
148153
// number[][][]
149154
// this.$input.addLayer();
150155
});
156+
// Colors
157+
this.$colors.columns = [{
158+
label: 'Name',
159+
key: 'name'
160+
}];
151161
}
152162

153163
handleFile(e) {

src/pg/table/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import PgTable, { createTableItem } from '@pictogrammers/components/pg/table';
2525
| ------------------- | --------- | ----------- |
2626
| `--pg-tree-font-size` | `inherit` | Font size |
2727
| `--pg-tree-border-color` | `3rem` | Width |
28-
| `--pg-avatar-height` | `3rem` | Height |
28+
| `--pg-table-row-background-color` | `#f1f1f1` | Row background |
2929

3030
## Columns
3131

0 commit comments

Comments
 (0)