Skip to content

Commit

Permalink
Merge branch 'fix-styles-issue-23' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
budnix committed Jun 1, 2016
2 parents 4a42a99 + a40f177 commit 176ce9f
Show file tree
Hide file tree
Showing 4 changed files with 2,128 additions and 4 deletions.
193 changes: 193 additions & 0 deletions index-shadow-dom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&lt;hot-table&gt;</title>

<!-- Importing Web Component's Polyfill -->
<script src="../webcomponentsjs/webcomponents.js"></script>
<script>
window.Polymer = window.Polymer || {};
window.Polymer.dom = "shadow";
</script>

<!-- Code highlighter -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>

<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="examples/css/main.css"/>

<!-- Importing Custom Elements -->
<link rel="import" href="hot-table.html">
<style is="custom-style" include="hot-table-style"></style>
</head>
<body>

<div id="wrapper">
<header>
<h1>&lt;hot-table&gt;</h1>
<h2 class="logo-desc">Polymer Element wrapper for <a href="http://handsontable.com">Handsontable</a> data grid editor</h2>
</header>

<p class="warning">Some stuff does not work yet. <b>For now it is not ready for production!</b> <br>
But feel free to submit issues on GitHub.</p>

<h2>Install</h2>
<br>
Install the component using Bower:
<pre><code class="bash">
$ bower install hot-table --save
</code></pre>
Or <a href="https://github.com/handsontable/hot-table/archive/master.zip">download as ZIP</a>.

<h2>Usage</h2>
<br>
1. Import Web Components' polyfill:
<pre><code class="html">
&#x3C;script src=&#x22;bower_components/webcomponentsjs/webcomponents-lite.js&#x22;&#x3E;&#x3C;/script&#x3E;
</code></pre>
2. Import Custom Element:
<pre><code class="html">
&#x3C;link rel=&#x22;import&#x22; href=&#x22;bower_components/hot-table/hot-table.html&#x22;&#x3E;
</code></pre>
3. Start using it!
<pre><code class="html">
&#x3C;hot-table datarows=&#x22;{{ itemsArray }}&#x22;&#x3E;&#x3C;/hot-table&#x3E;
</code></pre>

<a href="https://github.com/handsontable/hot-table" class="fork-me">
<img src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-dusk-blue@2x.png" alt="Fork me on GitHub">
</a>

<h2>Simple Example</h2>

<div class="example">
<template id="tpl" is="dom-bind">
<p>
Name of first person: <strong>{{ people.0.name.first }}</strong> | Highlighted row: <strong>{{ highlightedRow }}</strong>
</p>
<hot-table width="655" height="295" datarows="{{ people }}" context-menu max-rows="{{ people.length }}"
highlighted-row="{{ highlightedRow }}" class="htLeft">
<hot-column width="30" read-only value="id" header="ID"></hot-column>
<hot-column value="name.first" header="First Name">
<template data-hot-role="renderer" is="dom-template"><span>{{ value }}</span>...</template>
</hot-column>
<hot-column width="100" value="name.last" header="Last Name"></hot-column>
<hot-column width="100" type="date" value="date" header="Birthday"></hot-column>
<hot-column value="gender" header="Gender" source="[[ genderSource ]]" type="dropdown"></hot-column>
<hot-column type="numeric" value="age" header="Age"></hot-column>
<hot-column type="checkbox" value="languages.english" header="English" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="checkbox" value="languages.spanish" header="Spanish" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="checkbox" value="languages.french" header="French" checked-template="Yes"
unchecked-template="No"></hot-column>
<hot-column type="numeric" value="salary" header="Salary" format="$ 0,0.00"></hot-column>
</hot-table>
</template>
</div>

<h2>Code</h2>

<pre><code class="html">
&#x3C;template id=&#x22;tpl&#x22; is=&#x22;dom-bind&#x22;&#x3E;
&#x3C;p&#x3E;
Name of first person: &#x3C;strong&#x3E;{{ people.0.name.first }}&#x3C;/strong&#x3E; | Highlighted row: &#x3C;strong&#x3E;{{ highlightedRow }}&#x3C;/strong&#x3E;
&#x3C;/p&#x3E;
&#x3C;hot-table width=&#x22;655&#x22; height=&#x22;295&#x22; datarows=&#x22;{{ people }}&#x22; context-menu max-rows=&#x22;{{ people.length }}&#x22;
highlighted-row=&#x22;{{ highlightedRow }}&#x22; class=&#x22;htLeft&#x22;&#x3E;
&#x3C;hot-column width=&#x22;30&#x22; read-only value=&#x22;id&#x22; header=&#x22;ID&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column value=&#x22;name.first&#x22; header=&#x22;First Name&#x22;&#x3E;
&#x3C;template data-hot-role=&#x22;renderer&#x22; is=&#x22;dom-template&#x22;&#x3E;&#x3C;span&#x3E;{{ value }}&#x3C;/span&#x3E;...&#x3C;/template&#x3E;
&#x3C;/hot-column&#x3E;
&#x3C;hot-column width=&#x22;100&#x22; value=&#x22;name.last&#x22; header=&#x22;Last Name&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column width=&#x22;100&#x22; type=&#x22;date&#x22; value=&#x22;date&#x22; header=&#x22;Birthday&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column value=&#x22;gender&#x22; header=&#x22;Gender&#x22; source=&#x22;[[ genderSource ]]&#x22; type=&#x22;dropdown&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column type=&#x22;numeric&#x22; value=&#x22;age&#x22; header=&#x22;Age&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column type=&#x22;checkbox&#x22; value=&#x22;languages.english&#x22; header=&#x22;English&#x22; checked-template=&#x22;Yes&#x22;
unchecked-template=&#x22;No&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column type=&#x22;checkbox&#x22; value=&#x22;languages.spanish&#x22; header=&#x22;Spanish&#x22; checked-template=&#x22;Yes&#x22;
unchecked-template=&#x22;No&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column type=&#x22;checkbox&#x22; value=&#x22;languages.french&#x22; header=&#x22;French&#x22; checked-template=&#x22;Yes&#x22;
unchecked-template=&#x22;No&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;hot-column type=&#x22;numeric&#x22; value=&#x22;salary&#x22; header=&#x22;Salary&#x22; format=&#x22;$ 0,0.00&#x22;&#x3E;&#x3C;/hot-column&#x3E;
&#x3C;/hot-table&#x3E;
&#x3C;/template&#x3E;
</code></pre>

<h2>More demos</h2>

<ul>
<li><a href="examples/renderers.html">Custom Renderers</a></li>
<li><a href="examples/editors.html">Custom Editors</a></li>
<li><a href="examples/dashboard.html">Dashboard</a></li>
<li><a href="examples/persistent-state.html">Saving table state (persistent state)</a></li>
<li><a href="examples/dynamically-generated-context-menu.html">Dynamically generated context menu</a></li>
<li>Nested Tables (comming soon)</li>
</ul>

<h2>PRO features</h2>
<br>
<p>
To install Handsontable PRO follow by this instructions.
</p>
Install the component using Bower:
<pre><code class="bash">
$ bower install hot-table --save
</code></pre>

Overwrite handsontable version with handsontable PRO:
<pre><code class="bash">
$ bower install handsontable=git@git.handsontable.com:handsontable/handsontable-pro.git --save
</code></pre>
<i>If you don't have license for Pro yet, please click <a href="https://handsontable.com/pricing.html">here</a> for more info.</i>

<h2>Demos</h2>

<ul>
<li><a href="examples/data-filtering.html">Data filtering</a></li>
<li><a href="examples/bind-rows-with-headers.html">Bind rows with headers</a></li>
<li><a href="examples/fixing-bottom-rows.html">Fixing bottom rows</a></li>
<li><a href="examples/collapsing-columns.html">Collapsing columns with nested headers</a></li>
</ul>

<script>
var people = [
{id: 1, date: '24/12/1986', name: {first: 'Joe', last: 'Fabiano'}, gender: 'Male', age: 21,
languages: {english: 'Yes', spanish: 'Yes', french: 'No'}, salary: 2000},
{id: 2, date: '30/01/1976', name: {first: 'Fred', last: 'Wecler'}, gender: 'Male', age: 25,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 2500},
{id: 3, date: '14/07/1967', name: {first: 'Steve', last: 'Wilson'}, gender: 'Male', age: 32,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 1700},
{id: 4, date: '14/06/1956', name: {first: 'Maria', last: 'Fernandez'}, gender: 'Female', age: 27,
languages: {english: 'No', spanish: 'Yes', french: 'Yes'}, salary: 3000},
{id: 5, date: '09/05/1975', name: {first: 'Pierre', last: 'Barbault'}, gender: 'Male', age: 46,
languages: {english: 'Yes', spanish: 'No', french: 'Yes'}, salary: 1450},
{id: 6, date: '01/01/1986', name: {first: 'Nancy', last: 'Moore'}, gender: 'Female', age: 34,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 2300},
{id: 7, date: '04/03/1994', name: {first: 'Barbara', last: 'MacDonald'}, gender: 'Female', age: 19,
languages: {english: 'Yes', spanish: 'No', french: 'No'}, salary: 1900},
{id: 8, date: '01/04/1993', name: {first: 'Wilma', last: 'Williams'}, gender: 'Female', age: 33,
languages: {english: 'Yes', spanish: 'Yes', french: 'Yes'}, salary: 2400},
{id: 9, date: '01/05/1982', name: {first: 'Sasha', last: 'Silver'}, gender: 'Male', age: 27,
languages: {english: 'Yes', spanish: 'No', french: 'Yes'}, salary: 2110},
{id: 10, date: '03/10/1992', name: {first: 'Don', last: 'Pérignon'}, gender: 'Male', age: 42,
languages: {english: 'No', spanish: 'No', french: 'Yes'}, salary: 2090},
{id: 11, date: '01/10/1991', name: {first: 'Aaron', last: 'Kinley'}, gender: 'Female', age: 33,
languages: {english: 'Yes', spanish: 'Yes', french: 'Yes'}, salary: 2799}
];

window.addEventListener('dom-change', function () {
var tpl = document.getElementById('tpl');

tpl.highlightedRow = -1;
tpl.people = people;
tpl.genderSource = ['Male', 'Female'];
});
</script>
<script>hljs.initHighlightingOnLoad();</script>
</div>

</body>
</html>
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="examples/css/main.css"/>

<!-- SOME ELEMENTS LIKE CONTEXT MENU ARE OUTSIDE HOT-TABLE DIRECTIVE -> CSS FILE IS REQUIRED IN HEAD -->
<link rel="stylesheet" href="../handsontable/dist/handsontable.full.css">

<!-- Importing Custom Elements -->
<link rel="import" href="hot-table.html">
<style is="custom-style" include="hot-table-style"></style>
</head>
<body>

Expand Down

0 comments on commit 176ce9f

Please sign in to comment.