Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
francisrupert committed Apr 20, 2017
2 parents cd8f739 + 65f25f4 commit 9fab2fc
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcp-design",
"version": "1.4.1",
"version": "1.4.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/component_adjust.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ <h2 class="fsa-font--sans">FSA Design System References</h2>
<h2 class="fsa-font--sans">Sample</h2>

<div class="fsa-grid">
<div class="fsa-grid__1 fsa-grid__4/12@m fsa-grid__3/12@l">
<div class="fsa-grid__1 fsa-grid__6/12@m fsa-grid__4/12@l">
{% include: 'includes/pcp-adjust__terminal.html' @title:'Terminal Adjustments' %}
</div>
<div class="fsa-grid__1 fsa-grid__4/12@m fsa-grid__3/12@l">
<div class="fsa-grid__1 fsa-grid__6/12@m fsa-grid__4/12@l">
{% include: 'includes/pcp-adjust__state.html' @title:'State Adjustments' %}
</div>
</div>
Expand Down
58 changes: 58 additions & 0 deletions src/component_card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{% include: 'includes/html.html' %}

{% include: 'includes/head.html' @title:'Component' %}

<body class="pcp-app">

{% include: 'includes/fsa-browser-upgrade.html' %}

{% include: 'includes/skipnav.html' %}

<header>
{% include: 'includes/pcp-header-project.html' %}
</header>

<main id="main-content" tabindex="-1">

<div class="pcp-section">

<div class="pcp-section__bd">

<h1 class="fsa-font--sans">Component: Card</h1>

<pre class="pcp-code-block"><code>class="<strong style="color:black">pcp-card</strong>"</code></pre>

<div class="fsa-grid">
<div class="fsa-grid__1/1 fsa-grid__1/2@m">
<h2 class="fsa-font--sans">As seen on</h2>
<ul>
<li><a href="workflow_mapping.html">Workflow > Mapping</a></li>
</ul>
</div>
<div class="fsa-grid__1/1 fsa-grid__1/2@m">
<h2 class="fsa-font--sans">FSA Design System References</h2>
<ul>
<li><a href="http://usda-fsa.github.io/fsa-design-system/?preview">FSA Design System</a></li>
</ul>
</div>
</div>

<h2 class="fsa-font--sans">Sample</h2>

{% include: 'includes/pcp-card__hrw.html' %}

</div>

</div>

</main>

<footer>
{% include: 'includes/pcp-footer-project.html' %}
</footer>

{% include: 'includes/scripts.html' %}

</body>

</html>
4 changes: 4 additions & 0 deletions src/component_mapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ <h2 class="fsa-font--sans">FSA Design System References</h2>
</div>
</div>

<h2 class="fsa-font--sans">Default</h2>

{% include: 'includes/pcp-mapping__structure.html' %}

<h2 class="fsa-font--sans">Sample</h2>

{% include: 'includes/pcp-mapping.html' %}
Expand Down
12 changes: 6 additions & 6 deletions src/includes/pcp-adjust__state.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@ <h3 class="pcp-adjust__title">{{ title }}</h3>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Kansas">KS</abbr></td>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--bisect"><abbr title="Gulf">GLF</abbr></td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55sefj9fa' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span id="lorem-ipsum-change__55sefj9fa"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Oklahoma">OK</abbr></td>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--bisect"><abbr title="Gulf">GLF</abbr></td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5shod21a' @VALUE:'-0.03' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span id="lorem-ipsum-change__5shod21a"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Colorado">CO</abbr></td>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--bisect"><abbr title="Gulf">GLF</abbr></td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5sssthi9' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span id="lorem-ipsum-change__5sssthi9">-0.08</span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value">-0.08</span></td>
</tr>
<tr>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Nebraska">NE</abbr></td>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--bisect"><abbr title="Gulf">GLF</abbr></td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5ss66h' @VALUE:'-0.05' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span id="lorem-ipsum-change__5ss66h"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="South Dakota">SD</abbr></td>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--bisect"><abbr title="Gulf">GLF</abbr></td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5sssssh' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span id="lorem-ipsum-change__5sssssh"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="California">CA</abbr></td>
<td colspan="6" class="pcp-adjust__td pcp-adjust__td--bisect"><abbr title="Gulf">GLF</abbr></td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5s553fdgsh' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span id="lorem-ipsum-change__5s553fdgsh"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
</tbody>
</table>
Expand Down
12 changes: 6 additions & 6 deletions src/includes/pcp-adjust__terminal.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,42 @@ <h3 class="pcp-adjust__title">{{ title }}</h3>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--number">3.13</td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--bisect pcp-adjust__td--number">-0.01</td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55s5g89s5sssa' @VALUE:'-0.07' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj pcp-adjust__td--editable"><span id="lorem-ipsum-amochange5s5g89s5sssa">-0.02</span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value">-0.02</span></td>
</tr>
<tr>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Kansas City Market">KCM</abbr></td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--number">4.49</td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--bisect pcp-adjust__td--number">0.01</td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55s5ssgsaa' @VALUE:'-1.06' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj pcp-adjust__td--editable"><span id="lorem-ipsum-change__55s5ssgsaa"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Gulf">GLF</abbr></td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--number">4.63</td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--bisect pcp-adjust__td--number">0.00</td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55s5hh7jaa' @VALUE:'-0.73' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj pcp-adjust__td--editable"><span id="lorem-ipsum-change__55s5hh7jaa"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Minnesota">MIN</abbr></td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--number">4.18</td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--bisect pcp-adjust__td--number">-0.02</td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__555d5d63jaa' @VALUE:'-0.67' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj pcp-adjust__td--editable"><span id="lorem-ipsum-achange_555d5d63jaa"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Pacific Northwest">PWN</abbr></td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--number">4.81</td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--bisect pcp-adjust__td--number">0.00</td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__sshggaai' @VALUE:'-1.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj pcp-adjust__td--editable"><span id="lorem-ipsuchangent__sshggaai"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
<tr>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--first"><abbr title="Pacific Northwest">WCD</abbr></td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--number">4.84</td>
<td colspan="4" class="pcp-adjust__td pcp-adjust__td--bisect pcp-adjust__td--number">0.04</td>
<td colspan="7" class="pcp-adjust__td pcp-adjust__td--adj pcp-adjust__td--editable">{% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__ssswsgsaai' @VALUE:'-1.28' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %}</td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj pcp-adjust__td--editable"><span id="lorem-ipsum-change__ssswsgsaai"></span></td>
<td colspan="3" class="pcp-adjust__td pcp-adjust__td--number pcp-adjust__td--last pcp-adjust__td--adj"><span class="pcp-adjust__change-value"></span></td>
</tr>
</tbody>
</table>
Expand Down
51 changes: 51 additions & 0 deletions src/includes/pcp-mapping__structure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<div class="pcp-mapping">
<div class="pcp-mapping__hd">
[<strong>Component:</strong> <a href="component_content-tabs.html">Content Tabs</a>]
</div>
<div class="pcp-mapping__bd">

<div class="pcp-mapping__map" data-behavior="DEMO-CLOSE-RIFT-DETAILS"></div>

<div class="pcp-mapping__panel pcp-mapping__panel--visible">

<div class="pcp-mapping__panel-toggle">
<button class="pcp-mapping__panel-btn" type="button" data-behavior="panel-toggle" title="Toggle Panel">Toggle Panel</button>
</div>

<div class="pcp-mapping__panel-splitter"><i></i></div>

<div class="pcp-mapping__panel-hd">
[<strong>Component:</strong> <a href="component_card.html">Card</a>]
</div>
<div class="pcp-mapping__panel-bd pcp-mapping__panel-bd--scrollable">
<div class="pcp-mapping__panel-bd-scroll-item pcp-mapping__panel-bd-scroll-item--top">
[<strong>Component:</strong> <a href="component_adjust.html">Adjustment Table</a>]
</div>
<div class="pcp-mapping__panel-bd--splitter"><i></i></div>
<div class="pcp-mapping__panel-bd-scroll-item pcp-mapping__panel-bd-scroll-item--bottom">
[<strong>Component:</strong> <a href="component_adjust.html">Adjustment Table</a>]
</div>
</div>
<div class="pcp-mapping__panel-ft"></div>

</div>

<div class="pcp-mapping__marker" style="top: 130px; left: 805px;">
[<strong>Component:</strong> <a href="component_marker.html">Marker</a> * <em>n</em>]
</div>

<div class="pcp-mapping__rift-detail" id="UNIQUE-ID-ashasdfjkhsdafhjkl454555">
[<strong>Component:</strong> <a href="component_rift-detail.html">Rift Detail</a> x <em>n</em>]
</div>

<div class="pcp-mapping__tools-primary">
<button class="pcp-mapping__zoom" type="button" data-behavior="fullscreen-toggle" title="Fullscreen">[O]</button>
</div>

<div class="pcp-mapping__tools-secondary">
(zoom, threshold, layers, etc)
</div>

</div>
<div class="pcp-mapping__ft"></div>
</div>
1 change: 1 addition & 0 deletions src/includes/prototype-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<li>Component: <a href="component_marker.html">Marker</a></li>

<li>Component: <a href="component_mapping.html">Mapping</a></li>
<li>Component: <a href="component_card.html">Card</a></li>
<li>Component: <a href="component_content-tabs.html">Content Tabs</a></li>
<li>Component: <a href="component_stepped-tabs.html">Stepped Tabs</a></li>
<li>Component: <a href="component_adjust.html">Adjustment Table</a></li>
Expand Down
6 changes: 3 additions & 3 deletions src/includes/spinbox.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="pcp-spinbox pcp-spinbox--small pcp-spinbox--right {{CLASS}}">
<div class="pcp-spinbox__number">
<input class="fsa-input fsa-input--small pcp-spinbox__input" data-behavior="spinbox-kill-keypress spinbox-demo-change" id="{{ID}}" name="{{ID}}" type="number" value="{{VALUE}}" step="{{STEP}}">
<input class="fsa-input fsa-input--small pcp-spinbox__input" data-behavior="spinbox-kill-keypress spinbox-demo-change" id="{{ID}}" name="{{ID}}" type="number" value="{{VALUE}}" step="{{STEP}}" onchange="pcpDemoHighlightText('UNIQUE-ID-74851');">
</div>
<div class="pcp-spinbox__actions">
<button class="pcp-spinbox__btn pcp-spinbox__btn--increment" type="button" data-behavior="spinbox spin--increment" data-amount="{{STEP}}" aria-label="Increase" title="Increase"></button>
<button class="pcp-spinbox__btn pcp-spinbox__btn--decrement" type="button" data-behavior="spinbox spin--decrement" data-amount="{{STEP}}" aria-label="Decrease" title="Decrease"></button>
<button class="pcp-spinbox__btn pcp-spinbox__btn--increment" type="button" data-behavior="spinbox spin--increment" data-amount="{{STEP}}" aria-label="Increase" title="Increase" onclick="pcpDemoHighlightText('UNIQUE-ID-74851');"></button>
<button class="pcp-spinbox__btn pcp-spinbox__btn--decrement" type="button" data-behavior="spinbox spin--decrement" data-amount="{{STEP}}" aria-label="Decrease" title="Decrease" onclick="pcpDemoHighlightText('UNIQUE-ID-74851');"></button>
</div>
</div>
44 changes: 33 additions & 11 deletions src/js/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,12 @@ $('body').on('click', '[data-behavior~="spinbox"]', function(event) {

console.log('"currentValue" is ' + currentValue + ' and "stepAmt" is ' + stepAmt);

// It better be a valid number. I didn't get around do doing this
// if (isNaN(number)){
// ...
// }

if ($self.hasClass('pcp-spinbox__btn--increment')) {
$target.val(currentValue + stepAmt);
} else {
$target.val(currentValue - stepAmt);
newAdjAmt = currentValue + stepAmt;
$target.val(newAdjAmt.toFixed(2)).trigger('change');
} else { // pcp-spinbox__btn--decrement
newAdjAmt = currentValue - stepAmt;
$target.val(newAdjAmt.toFixed(2)).trigger('change');
}

})
Expand Down Expand Up @@ -381,13 +378,38 @@ $('body').on('blur', '.pcp-spinbox__input, .pcp-spinbox__btn', function(event) {

})

$('body').on('change', '[data-behavior~="spinbox-demo-change"]', function() {
$('body').on('change', '[data-behavior~="spinbox-demo-change"]', function(event) {

// ---------------------------------------------------------------------------
var $self = $(this);
thisAmt = parseFloat($self.val());
var $row = $self.closest('tr');

// ---------------------------------------------------------------------------
currentChg = $row.find('.pcp-adjust__change-value');
stepAmt = parseFloat($self.attr('step'));
currentChgAmt = parseFloat(currentChg.html());

if ($.isNumeric(currentChgAmt)) {
newChgAmt = currentChgAmt + stepAmt;
} else {
newChgAmt = 0 + stepAmt;
}

if (thisAmt == '0') {
if (newChgAmt == '0') {
currentChg.html('');
} else {
currentChg.html(newChgAmt.toFixed(2));
}

// ---------------------------------------------------------------------------
thisAmt = parseFloat($self.val()).toFixed(2);

if ($.isNumeric(thisAmt)) {
$self.val(thisAmt);
console.log('yup, IS a number');
} else {
$self.val('0.00');
console.log('nope, NOT a number');
}

});
Expand Down

0 comments on commit 9fab2fc

Please sign in to comment.