@ministryofjustice/fb-nunjucks-helpers
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -77,5 +77,5 @@ const Markdown = require('markdown-it')() | ||
} | ||
const widthDelimiter = parseInt(data[prop], 10) > 0 ? 'c-input--width' : '!-width' | ||
const widthDelimiter = parseInt(data[prop], 10) > 0 ? 'input--' : '!-' | ||
data.classes = data.classes ? `${data.classes} ` : '' | ||
data.classes += `govuk-${widthDelimiter}-${data[prop]}` | ||
data.classes += `govuk-${widthDelimiter}width-${data[prop]}` | ||
return data | ||
@@ -82,0 +82,0 @@ } |
@@ -153,3 +153,3 @@ const test = require('tape') | ||
}) | ||
t.equals(widthClass10.classes, 'govuk-c-input--width-20', 'it should set the character-based classes') | ||
t.equals(widthClass10.classes, 'govuk-input--width-20', 'it should set the character-based classes') | ||
@@ -162,3 +162,3 @@ const widthClassOneThird = classMethod({ | ||
const widthClassDefault = classMethod({}, 10) | ||
t.equals(widthClassDefault.classes, 'govuk-c-input--width-10', 'it should use the default if no property is set') | ||
t.equals(widthClassDefault.classes, 'govuk-input--width-10', 'it should use the default if no property is set') | ||
@@ -174,3 +174,3 @@ const widthClassDefaultWithValue = classMethod({ | ||
}) | ||
t.equals(widthClasses.classes, 'class-value govuk-c-input--width-20', 'it should keep any previous set value of the classes property') | ||
t.equals(widthClasses.classes, 'class-value govuk-input--width-20', 'it should keep any previous set value of the classes property') | ||
@@ -177,0 +177,0 @@ t.end() |
{ | ||
"name": "@ministryofjustice/fb-nunjucks-helpers", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Form Builder Nunjucks helpers", | ||
@@ -5,0 +5,0 @@ "main": "lib/fb-nunjucks-helpers.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25532