This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { useFormikContext, useField } from 'formik'; | |
import { DateInput } from 'govuk-react-jsx/govuk'; | |
function DateField(props) { | |
const { values, errors } = useFormikContext(); | |
const { namePrefix, items, ...restProps } = props; | |
const [field, meta, helpers] = useField(namePrefix); // eslint-disable-line no-unused-vars | |
const { setValue, setTouched } = helpers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* NOTE: This script is deprecated and I no longer recommend it's use. | |
* Within HM Land Registry it is supereceded by https://github.com/LandRegistry/govuk-frontend-jinja | |
* This repository was born from the outputs of this conversion script, but has had numerous fixes since | |
* so if you are looking for a stable and accurate jinja implementation of govuk-frontend I would look there first. | |
*/ | |
const path = require('path') | |
const fs = require('fs') | |
const es = require('event-stream') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jinja2 import PackageLoader, PrefixLoader | |
... | |
app.jinja_loader = PrefixLoader({ | |
'app': PackageLoader('name_of_app_folder'), | |
'govuk_elements_jinja_macros': PackageLoader('govuk_elements_jinja_macros') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setuptools.setup(name='govuk-elements-jinja-macros', | |
version='1.0.7', | |
description='GOV.UK elements Jinja macros', | |
packages=['govuk_elements_jinja_macros'], | |
package_data={'govuk_elements_jinja_macros': ['templates/*.html']} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-10-24T14:58:38.529Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Multiline var declarations | |
var foo = 1, | |
bar = 2, | |
wibble = 3; | |
// ... are all too easily turned into this, with a one character change | |
var foo = 1, | |
bar = 2; // BOOM: Global scope leakage | |
wibble = 3; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var lazy_load_image = require('../plugins/lazy-load-image.js'); | |
var domready = require('detect-dom-ready'); | |
var pubsub = require('pubsub-js'); | |
// @TODO: This should only load images which are visible by default, not things that are inside hidden tabs etc | |
// @TODO: This loop probably belongs inside the plugin, not here | |
// @TODO: Select via data attributes instead of classes assuming IE8 supports this? | |
function process(element) { |
NewerOlder