Module: Dsfr::Components
- Includes:
- ActiveSupport::Configurable
- Defined in:
- lib/dsfr/components/engine.rb,
lib/dsfr/components/version.rb,
lib/dsfr/components/helpers/css_utilities.rb
Defined Under Namespace
Modules: Helpers Classes: Engine
Defaults collapse
- DEFAULTS =
Default components configuration
:default_back_link_textDefault text for the back link, defaults toBack:default_breadcrumbs_collapse_on_mobilefalse:default_breadcrumbs_hide_in_printfalse:default_cookie_banner_aria_label“Cookie banner”:default_cookie_banner_hide_in_printtrue:default_header_navigation_label‘Navigation menu’:default_header_menu_button_label‘Show or hide navigation menu’:default_header_logotype‘GOV.UK’:default_header_homepage_url‘/’:default_header_service_namenil:default_header_service_url‘/’:default_footer_meta_textnil:default_footer_copyright_text‘© Crown copyright’:default_footer_copyright_url“www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/”:default_pagination_landmark_label“results”:default_pagination_next_textDefault ‘next’ text for pagination. AnArraywhere the first item is visible and the second visually hidden. Defaults to [“Next”, “page”]:default_pagination_previous_textDefault ‘previous’ text for pagination. AnArraywhere the first item is visible and the second visually hidden. Defaults to [“Previous”, “page”]:default_phase_banner_tagnil:default_phase_banner_textnil:default_section_break_visiblefalse:default_section_break_sizeSize of the section break, possible values:m,landxl. Defaults to nil.:default_tag_colourthe default colour for tags, possible values:grey,green,turquoise,blue,red,purple,pink,orange,yellow. Defaults tonil:default_start_button_as_buttonfalse:default_summary_list_borderstrue:default_notification_banner_title_id“govuk-notification-banner-title”:default_notification_disable_auto_focusnil:default_notification_title_heading_level2:default_notification_title_successfalse:default_warning_text_icon_fallback_text“Warning”:default_warning_text_icon“!”:require_summary_list_action_visually_hidden_textwhen true forces visually hidden text to be set for every action. It can still be explicitly skipped by passing innil. Defaults tofalse { default_back_link_text: 'Back', default_breadcrumbs_collapse_on_mobile: false, default_breadcrumbs_hide_in_print: false, default_cookie_banner_aria_label: "Cookie banner", default_cookie_banner_hide_in_print: true, default_header_navigation_label: 'Navigation menu', default_header_menu_button_label: 'Show or hide navigation menu', default_header_logotype: 'GOV.UK', default_header_homepage_url: '/', default_header_service_name: nil, default_header_service_url: '/', default_footer_meta_text: nil, default_footer_copyright_text: '© Crown copyright', default_footer_copyright_url: "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/", default_pagination_landmark_label: "results", default_pagination_next_text: %w(Next page), default_pagination_previous_text: %w(Previous page), default_phase_banner_tag: nil, default_phase_banner_text: nil, default_section_break_visible: false, default_section_break_size: nil, default_tag_colour: nil, default_start_button_as_button: false, default_summary_list_borders: true, default_notification_banner_title_id: "govuk-notification-banner-title", default_notification_disable_auto_focus: nil, default_notification_title_heading_level: 2, default_notification_title_success: false, default_warning_text_icon_fallback_text: "Warning", default_warning_text_icon: "!", require_summary_list_action_visually_hidden_text: false, }.freeze
Constant Summary collapse
- VERSION =
'2.0.1'.freeze
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Configure the form builder in the usual manner.
-
.reset! ⇒ Object
Resets each of the configurable values to its default.
Class Method Details
.configure {|config| ... } ⇒ Object
Configure the form builder in the usual manner. All of the keys in DEFAULTS can be configured as per the example below
16 17 18 |
# File 'lib/dsfr/components/engine.rb', line 16 def configure yield(config) end |
.reset! ⇒ Object
This method is only really intended for use to clean up during testing
Resets each of the configurable values to its default
24 25 26 27 28 |
# File 'lib/dsfr/components/engine.rb', line 24 def reset! configure do |c| DEFAULTS.each { |k, v| c.send("#{k}=", v) } end end |