Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions frameworks/keyed/wp-directives/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": ["last 1 chrome versions"]
}
}
],
"@babel/preset-react"
],
"plugins": [
[
"@babel/plugin-transform-react-jsx",
{
"runtime": "automatic",
"importSource": "preact"
}
]
]
}
76 changes: 76 additions & 0 deletions frameworks/keyed/wp-directives/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<title>WP-directives-keyed</title>
<link href="/css/currentStyle.css" rel="stylesheet" />
</head>

<body>
<div class="container" id="main" wp-context='{ "rows": { "data": [] } }'>
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
<h1>WP-directives-keyed</h1>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="run" wp-on:click="actions.run">
Create 1,000 rows
</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="runlots" wp-on:click="actions.runLots">
Create 10,000 rows
</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="add" wp-on:click="actions.add">
Append 1,000 rows
</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="update" wp-on:click="actions.update">
Update every 10th row
</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="clear" wp-on:click="actions.clear">
Clear
</button>
</div>
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="swaprows" wp-on:click="actions.swapRows">
Swap Rows
</button>
</div>
</div>
</div>
</div>
</div>
<table class="table table-hover table-striped test-data">
<tbody>
<template wp-each:item="state.data" wp-key="id">
<tr class="" wp-class:danger="state.isSelected">
<td class="col-md-1" wp-bind:children="state.itemId"></td>
<td class="col-md-4">
<a wp-on:click="actions.select" wp-bind:children="state.itemLabel"></a>
</td>
<td class="col-md-1">
<a wp-on:click="actions.remove"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
</td>
<td class="col-md-6"></td>
</tr>
</template>
</tbody>
</table>

<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
</div>

<script src="dist/main.js"></script>
</body>

</html>
Loading