diff --git a/package.json b/package.json index 6792cec..89affb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pcp-design", - "version": "1.4.1", + "version": "1.4.2", "description": "", "main": "index.js", "scripts": { diff --git a/src/component_adjust.html b/src/component_adjust.html index a9412f7..c55e972 100644 --- a/src/component_adjust.html +++ b/src/component_adjust.html @@ -40,10 +40,10 @@

FSA Design System References

Sample

-
+
{% include: 'includes/pcp-adjust__terminal.html' @title:'Terminal Adjustments' %}
-
+
{% include: 'includes/pcp-adjust__state.html' @title:'State Adjustments' %}
diff --git a/src/component_card.html b/src/component_card.html new file mode 100644 index 0000000..168d981 --- /dev/null +++ b/src/component_card.html @@ -0,0 +1,58 @@ +{% include: 'includes/html.html' %} + +{% include: 'includes/head.html' @title:'Component' %} + + + + {% include: 'includes/fsa-browser-upgrade.html' %} + + {% include: 'includes/skipnav.html' %} + +
+ {% include: 'includes/pcp-header-project.html' %} +
+ +
+ +
+ +
+ +

Component: Card

+ +
class="pcp-card"
+ +
+
+

As seen on

+ +
+
+

FSA Design System References

+ +
+
+ +

Sample

+ + {% include: 'includes/pcp-card__hrw.html' %} + +
+ +
+ +
+ +
+ {% include: 'includes/pcp-footer-project.html' %} +
+ + {% include: 'includes/scripts.html' %} + + + + diff --git a/src/component_mapping.html b/src/component_mapping.html index 0c524cf..46a3d03 100644 --- a/src/component_mapping.html +++ b/src/component_mapping.html @@ -37,6 +37,10 @@

FSA Design System References

+

Default

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

Sample

{% include: 'includes/pcp-mapping.html' %} diff --git a/src/includes/pcp-adjust__state.html b/src/includes/pcp-adjust__state.html index 6e3e56f..30989b4 100644 --- a/src/includes/pcp-adjust__state.html +++ b/src/includes/pcp-adjust__state.html @@ -17,37 +17,37 @@

{{ title }}

KS GLF {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55sefj9fa' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + OK GLF {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5shod21a' @VALUE:'-0.03' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + CO GLF {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5sssthi9' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - -0.08 + -0.08 NE GLF {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5ss66h' @VALUE:'-0.05' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + SD GLF {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5sssssh' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + CA GLF {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__5s553fdgsh' @VALUE:'0.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + diff --git a/src/includes/pcp-adjust__terminal.html b/src/includes/pcp-adjust__terminal.html index d6ebe60..a31f689 100644 --- a/src/includes/pcp-adjust__terminal.html +++ b/src/includes/pcp-adjust__terminal.html @@ -19,42 +19,42 @@

{{ title }}

3.13 -0.01 {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55s5g89s5sssa' @VALUE:'-0.07' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - -0.02 + -0.02 KCM 4.49 0.01 {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55s5ssgsaa' @VALUE:'-1.06' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + GLF 4.63 0.00 {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__55s5hh7jaa' @VALUE:'-0.73' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + MIN 4.18 -0.02 {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__555d5d63jaa' @VALUE:'-0.67' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + PWN 4.81 0.00 {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__sshggaai' @VALUE:'-1.00' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + WCD 4.84 0.04 {% include: 'includes/spinbox.html' @ID:'lorem-ipsum-amount__ssswsgsaai' @VALUE:'-1.28' @STEP:'0.01' @CLASS:'pcp-adjust__spinbox' %} - + diff --git a/src/includes/pcp-mapping__structure.html b/src/includes/pcp-mapping__structure.html new file mode 100644 index 0000000..1adfec4 --- /dev/null +++ b/src/includes/pcp-mapping__structure.html @@ -0,0 +1,51 @@ +
+
+ [Component: Content Tabs] +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ [Component: Card] +
+
+
+ [Component: Adjustment Table] +
+
+
+ [Component: Adjustment Table] +
+
+
+ +
+ +
+ [Component: Marker * n] +
+ +
+ [Component: Rift Detail x n] +
+ +
+ +
+ +
+ (zoom, threshold, layers, etc) +
+ +
+
+
diff --git a/src/includes/prototype-list.html b/src/includes/prototype-list.html index 588d0e1..77f3264 100644 --- a/src/includes/prototype-list.html +++ b/src/includes/prototype-list.html @@ -17,6 +17,7 @@
  • Component: Marker
  • Component: Mapping
  • +
  • Component: Card
  • Component: Content Tabs
  • Component: Stepped Tabs
  • Component: Adjustment Table
  • diff --git a/src/includes/spinbox.html b/src/includes/spinbox.html index 18cbc58..e3f0969 100644 --- a/src/includes/spinbox.html +++ b/src/includes/spinbox.html @@ -1,9 +1,9 @@
    - +
    - - + +
    diff --git a/src/js/prototype.js b/src/js/prototype.js index d26cddb..22991de 100644 --- a/src/js/prototype.js +++ b/src/js/prototype.js @@ -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'); } }) @@ -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'); } });