diff --git a/src/Element/WebformRating.php b/src/Element/WebformRating.php index 67a736ad..2d87b83c 100644 --- a/src/Element/WebformRating.php +++ b/src/Element/WebformRating.php @@ -61,7 +61,7 @@ class WebformRating extends Range { static::setAttributes($element, ['form-webform-rating']); // If value is an empty string set it the min. - if ($element['#attributes']['value'] == '') { + if (isset($element['#attributes']['value']) && $element['#attributes']['value'] === '') { $element['#attributes']['value'] = $element['#attributes']['min']; } diff --git a/src/Entity/Webform.php b/src/Entity/Webform.php index 588b48e5..b4f668d4 100644 --- a/src/Entity/Webform.php +++ b/src/Entity/Webform.php @@ -1170,14 +1170,25 @@ class Webform extends ConfigEntityBundleBase implements WebformInterface { /** * {@inheritdoc} */ - public function getElementsSelectorOptions() { + public function getElementsSelectorOptions($options = []) { /** @var \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager */ $element_manager = \Drupal::service('plugin.manager.webform.element'); + // The value element is excluded because it is not available + // to the #states API. The value element is available to WebformHandles. + // @see \Drupal\webform\Form\WebformHandlerFormBase + $options += ['excluded_elements' => ['value']]; + $selectors = []; $elements = $this->getElementsInitializedAndFlattened(); foreach ($elements as $element) { $element_plugin = $element_manager->getElementInstance($element); + + // Check excluded elements. + if ($options['excluded_elements'] && in_array($element_plugin->getPluginId(), $options['excluded_elements'])) { + continue; + } + $element_selectors = $element_plugin->getElementSelectorOptions($element); foreach ($element_selectors as $element_selector_key => $element_selector_value) { // Suffix duplicate selector optgroups with empty characters. diff --git a/src/Form/WebformHandlerFormBase.php b/src/Form/WebformHandlerFormBase.php index ed237696..e17cf0ac 100644 --- a/src/Form/WebformHandlerFormBase.php +++ b/src/Form/WebformHandlerFormBase.php @@ -233,7 +233,7 @@ abstract class WebformHandlerFormBase extends FormBase { 'enabled' => $this->t('Enabled'), 'disabled' => $this->t('Disabled'), ], - '#selector_options' => $webform->getElementsSelectorOptions(), + '#selector_options' => $webform->getElementsSelectorOptions(['excluded_elements' => []]), '#multiple' => FALSE, '#default_value' => $this->webformHandler->getConditions(), ]; diff --git a/src/Plugin/WebformElement/Value.php b/src/Plugin/WebformElement/Value.php index fbc84f30..319ecb3f 100644 --- a/src/Plugin/WebformElement/Value.php +++ b/src/Plugin/WebformElement/Value.php @@ -32,14 +32,11 @@ class Value extends TextBase { * {@inheritdoc} */ public function preview() { - return []; - } - - /** - * {@inheritdoc} - */ - public function getElementSelectorOptions(array $element) { - return []; + return [ + '#type' => 'value', + '#title' => $this->t('Value'), + '#value' => 'preview', + ]; } /** diff --git a/src/Tests/Element/WebformElementStatesSelectorsTest.php b/src/Tests/Element/WebformElementStatesSelectorsTest.php index 1f9e16bc..2d28690f 100644 --- a/src/Tests/Element/WebformElementStatesSelectorsTest.php +++ b/src/Tests/Element/WebformElementStatesSelectorsTest.php @@ -70,6 +70,16 @@ class WebformElementStatesSelectorsTest extends WebformElementTestBase { $this->assertCssSelect($selector); } } + + $webform = Webform::load('test_example_elements'); + + // Check the value element is excluded. + $selectors = $webform->getElementsSelectorOptions(); + $this->assert(!isset($selectors[':input[name="value"]'])); + + // Check the value element is included. + $selectors = $webform->getElementsSelectorOptions(['excluded_elements' => []]); + $this->assertEqual($selectors[':input[name="value"]'], 'Value [Value]'); } } diff --git a/src/WebformInterface.php b/src/WebformInterface.php index b32eb2d6..eec75e07 100644 --- a/src/WebformInterface.php +++ b/src/WebformInterface.php @@ -721,10 +721,13 @@ interface WebformInterface extends ConfigEntityInterface, EntityWithPluginCollec /** * Get webform element's selectors as options. * + * @param array $options + * (Optional) Options to be appled to element selectors. + * * @return array * Webform elements selectors as options. */ - public function getElementsSelectorOptions(); + public function getElementsSelectorOptions($options = []); /** * Get webform element options as autocomplete source values. diff --git a/tests/modules/webform_test/config/install/webform.webform.test_composite_format.yml b/tests/modules/webform_test/config/install/webform.webform.test_composite_format.yml index d1324028..f0c1b512 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_composite_format.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_composite_format.yml @@ -89,6 +89,12 @@ elements: | text_format: '#type': details '#title': 'Text format' + text_format_plain_text: + '#type': text_format + '#title': 'Text format (Plain text)' + '#default_value': + value: '
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Negat esse eam, inquit, propter se expetendam. Primum Theophrasti, Strato, physicum se voluit; Id mihi magnum videtur. Itaque mihi non satis videmini considerare quod iter sit naturae quaeque progressio. Quare hoc videndum est, possitne nobis hoc ratio philosophorum dare. Est enim tanti philosophi tamque nobilis audacter sua decreta defendere.
' + '#format': plain_text text_format_basic_html: '#type': text_format '#title': 'Text format (Basic HTML)' @@ -101,12 +107,6 @@ elements: | '#default_value': value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Negat esse eam, inquit, propter se expetendam. Primum Theophrasti, Strato, physicum se voluit; Id mihi magnum videtur. Itaque mihi non satis videmini considerare quod iter sit naturae quaeque progressio. Quare hoc videndum est, possitne nobis hoc ratio philosophorum dare. Est enim tanti philosophi tamque nobilis audacter sua decreta defendere.
' '#format': full_html - text_format_plain_text: - '#type': text_format - '#title': 'Text format (Plain text)' - '#default_value': - value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Negat esse eam, inquit, propter se expetendam. Primum Theophrasti, Strato, physicum se voluit; Id mihi magnum videtur. Itaque mihi non satis videmini considerare quod iter sit naturae quaeque progressio. Quare hoc videndum est, possitne nobis hoc ratio philosophorum dare. Est enim tanti philosophi tamque nobilis audacter sua decreta defendere.
' - '#format': plain_text text_format_restricted_html: '#type': text_format '#title': 'Text format (Restricted HTML)' @@ -117,6 +117,42 @@ elements: | '#type': details '#title': 'Composite elements' '#open': true + webform_address: + '#type': details + '#title': 'Basic address' + webform_address_value: + '#type': webform_address + '#title': 'Basic address (Value)' + '#default_value': + address: '10 Main Street' + address_2: '10 Main Street' + city: Springfield + state_province: Alabama + postal_code: '11111' + country: Afghanistan + '#format': value + webform_address_raw: + '#type': webform_address + '#title': 'Basic address (Raw value)' + '#default_value': + address: '10 Main Street' + address_2: '10 Main Street' + city: Springfield + state_province: Alabama + postal_code: '11111' + country: Afghanistan + '#format': raw + webform_address_list: + '#type': webform_address + '#title': 'Basic address (List)' + '#default_value': + address: '10 Main Street' + address_2: '10 Main Street' + city: Springfield + state_province: Alabama + postal_code: '11111' + country: Afghanistan + '#format': list address: '#type': details '#title': 'Advanced address' @@ -162,42 +198,6 @@ elements: | country_code: US langcode: en '#format': list - webform_address: - '#type': details - '#title': 'Basic address' - webform_address_value: - '#type': webform_address - '#title': 'Basic address (Value)' - '#default_value': - address: '10 Main Street' - address_2: '10 Main Street' - city: Springfield - state_province: Alabama - postal_code: '11111' - country: Afghanistan - '#format': value - webform_address_raw: - '#type': webform_address - '#title': 'Basic address (Raw value)' - '#default_value': - address: '10 Main Street' - address_2: '10 Main Street' - city: Springfield - state_province: Alabama - postal_code: '11111' - country: Afghanistan - '#format': raw - webform_address_list: - '#type': webform_address - '#title': 'Basic address (List)' - '#default_value': - address: '10 Main Street' - address_2: '10 Main Street' - city: Springfield - state_province: Alabama - postal_code: '11111' - country: Afghanistan - '#format': list webform_contact: '#type': details '#title': Contact @@ -270,36 +270,87 @@ elements: | title: Loremipsum url: 'http://example.com' '#format': list + webform_location_places: + '#type': details + '#title': 'Location (Algolia Places)' + webform_location_places_value: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (Value)' + '#default_value': + value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format': value + webform_location_places_raw: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (Raw value)' + '#default_value': + value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format': raw + webform_location_places_list: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (List)' + '#default_value': + value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format': list webform_location_geocomplete: '#type': details - '#title': Location + '#title': 'Location (Geocomplete)' webform_location_geocomplete_value: - '#type': webform_location_places - '#title': 'Location (Value)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Value)' '#map': true '#geolocation': true '#format': value '#default_value': value: 'The White House, 1600 Pennsylvania Ave NW, Washington, DC 20500, USA' webform_location_geocomplete_raw: - '#type': webform_location_places - '#title': 'Location (Raw value)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Raw value)' '#map': true '#geolocation': true '#format': raw '#default_value': value: 'The White House, 1600 Pennsylvania Ave NW, Washington, DC 20500, USA' webform_location_geocomplete_list: - '#type': webform_location_places - '#title': 'Location (List)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (List)' '#map': true '#geolocation': true '#format': list '#default_value': value: 'The White House, 1600 Pennsylvania Ave NW, Washington, DC 20500, USA' webform_location_geocomplete_map: - '#type': webform_location_places - '#title': 'Location (Map)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Map)' '#map': true '#geolocation': true '#format': map diff --git a/tests/modules/webform_test/config/install/webform.webform.test_composite_format_multiple.yml b/tests/modules/webform_test/config/install/webform.webform.test_composite_format_multiple.yml index f086f198..581df67d 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_composite_format_multiple.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_composite_format_multiple.yml @@ -19,69 +19,6 @@ elements: | '#type': details '#title': 'Composite elements' '#open': true - address: - '#type': details - '#title': 'Advanced address' - address_ol: - '#type': address - '#title': 'Advanced address (Ordered list)' - '#multiple': true - '#default_value': - - given_name: John - family_name: Smith - organization: 'Google Inc.' - address_line1: '1098 Alta Ave' - postal_code: '94043' - locality: 'Mountain View' - administrative_area: CA - country_code: US - langcode: en - '#format_items': ol - address_ul: - '#type': address - '#title': 'Advanced address (Unordered list)' - '#multiple': true - '#default_value': - - given_name: John - family_name: Smith - organization: 'Google Inc.' - address_line1: '1098 Alta Ave' - postal_code: '94043' - locality: 'Mountain View' - administrative_area: CA - country_code: US - langcode: en - '#format_items': ul - address_hr: - '#type': address - '#title': 'Advanced address (Horizontal rule)' - '#multiple': true - '#default_value': - - given_name: John - family_name: Smith - organization: 'Google Inc.' - address_line1: '1098 Alta Ave' - postal_code: '94043' - locality: 'Mountain View' - administrative_area: CA - country_code: US - langcode: en - '#format_items': hr - address_table: - '#type': address - '#title': 'Advanced address (Table)' - '#multiple': true - '#default_value': - - given_name: John - family_name: Smith - organization: 'Google Inc.' - address_line1: '1098 Alta Ave' - postal_code: '94043' - locality: 'Mountain View' - administrative_area: CA - country_code: US - langcode: en - '#format_items': table webform_address: '#type': details '#title': 'Basic address' @@ -181,6 +118,69 @@ elements: | postal_code: '11111' country: Afghanistan '#format_items': table + address: + '#type': details + '#title': 'Advanced address' + address_ol: + '#type': address + '#title': 'Advanced address (Ordered list)' + '#multiple': true + '#default_value': + - given_name: John + family_name: Smith + organization: 'Google Inc.' + address_line1: '1098 Alta Ave' + postal_code: '94043' + locality: 'Mountain View' + administrative_area: CA + country_code: US + langcode: en + '#format_items': ol + address_ul: + '#type': address + '#title': 'Advanced address (Unordered list)' + '#multiple': true + '#default_value': + - given_name: John + family_name: Smith + organization: 'Google Inc.' + address_line1: '1098 Alta Ave' + postal_code: '94043' + locality: 'Mountain View' + administrative_area: CA + country_code: US + langcode: en + '#format_items': ul + address_hr: + '#type': address + '#title': 'Advanced address (Horizontal rule)' + '#multiple': true + '#default_value': + - given_name: John + family_name: Smith + organization: 'Google Inc.' + address_line1: '1098 Alta Ave' + postal_code: '94043' + locality: 'Mountain View' + administrative_area: CA + country_code: US + langcode: en + '#format_items': hr + address_table: + '#type': address + '#title': 'Advanced address (Table)' + '#multiple': true + '#default_value': + - given_name: John + family_name: Smith + organization: 'Google Inc.' + address_line1: '1098 Alta Ave' + postal_code: '94043' + locality: 'Mountain View' + administrative_area: CA + country_code: US + langcode: en + '#format_items': table webform_contact: '#type': details '#title': Contact @@ -478,12 +478,83 @@ elements: | - title: Loremipsum url: 'http://example.com' '#format_items': table + webform_location_places: + '#type': details + '#title': 'Location (Algolia Places)' + webform_location_places_ol: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (Ordered list)' + '#multiple': true + '#default_value': + - value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format_items': ol + webform_location_places_ul: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (Unordered list)' + '#multiple': true + '#default_value': + - value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format_items': ul + webform_location_places_hr: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (Horizontal rule)' + '#multiple': true + '#default_value': + - value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format_items': hr + webform_location_places_table: + '#type': webform_location_places + '#title': 'Location (Algolia Places) (Table)' + '#multiple': true + '#default_value': + - value: '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America' + lat: '38.8635' + lng: '-76.946' + name: '1600 Pennsylvania Avenue' + city: Washington + country: 'United States of America' + country_code: us + administrative: 'District of Columbia' + county: 'Prince George''s County' + suburb: '' + postcode: '20020' + '#format_items': table webform_location_geocomplete: '#type': details - '#title': Location + '#title': 'Location (Geocomplete)' webform_location_geocomplete_ol: - '#type': webform_location_places - '#title': 'Location (Ordered list)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Ordered list)' '#map': true '#geolocation': true '#format': map @@ -494,8 +565,8 @@ elements: | - value: 'Moscow, Russia, 10307' '#format_items': ol webform_location_geocomplete_ul: - '#type': webform_location_places - '#title': 'Location (Unordered list)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Unordered list)' '#map': true '#geolocation': true '#format': map @@ -506,8 +577,8 @@ elements: | - value: 'Moscow, Russia, 10307' '#format_items': ul webform_location_geocomplete_hr: - '#type': webform_location_places - '#title': 'Location (Horizontal rule)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Horizontal rule)' '#map': true '#geolocation': true '#format': map @@ -518,8 +589,8 @@ elements: | - value: 'Moscow, Russia, 10307' '#format_items': hr webform_location_geocomplete_table: - '#type': webform_location_places - '#title': 'Location (Table)' + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) (Table)' '#map': true '#geolocation': true '#format': map diff --git a/tests/modules/webform_test/config/install/webform.webform.test_element_description_tooltip.yml b/tests/modules/webform_test/config/install/webform.webform.test_element_description_tooltip.yml index 034e1910..3843f77b 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_element_description_tooltip.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_element_description_tooltip.yml @@ -143,35 +143,6 @@ elements: | '#title': URL '#description': 'This is a description for the ''url'' element.' '#description_display': tooltip - file_upload_elements: - '#type': details - '#title': 'File upload elements' - '#open': true - webform_audio_file: - '#type': webform_audio_file - '#title': 'Audio file' - '#description': 'This is a description for the ''webform_audio_file'' element.' - '#description_display': tooltip - webform_document_file: - '#type': webform_document_file - '#title': 'Document file' - '#description': 'This is a description for the ''webform_document_file'' element.' - '#description_display': tooltip - managed_file: - '#type': managed_file - '#title': File - '#description': 'This is a description for the ''managed_file'' element.' - '#description_display': tooltip - webform_image_file: - '#type': webform_image_file - '#title': 'Image file' - '#description': 'This is a description for the ''webform_image_file'' element.' - '#description_display': tooltip - webform_video_file: - '#type': webform_video_file - '#title': 'Video file' - '#description': 'This is a description for the ''webform_video_file'' element.' - '#description_display': tooltip composite_elements: '#type': details '#title': 'Composite elements' @@ -181,6 +152,11 @@ elements: | '#title': 'Basic address' '#description': 'This is a description for the ''webform_address'' element.' '#description_display': tooltip + address: + '#type': address + '#title': 'Advanced address' + '#description': 'This is a description for the ''address'' element.' + '#description_display': tooltip webform_contact: '#type': webform_contact '#title': Contact @@ -208,9 +184,14 @@ elements: | '#title': Link '#description': 'This is a description for the ''webform_link'' element.' '#description_display': tooltip - webform_location_geocomplete: + webform_location_places: '#type': webform_location_places - '#title': Location + '#title': 'Location (Algolia Places)' + '#description': 'This is a description for the ''webform_location_places'' element.' + '#description_display': tooltip + webform_location_geocomplete: + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete)' '#map': true '#geolocation': true '#format': map @@ -226,6 +207,35 @@ elements: | '#title': 'Telephone advanced' '#description': 'This is a description for the ''webform_telephone'' element.' '#description_display': tooltip + file_upload_elements: + '#type': details + '#title': 'File upload elements' + '#open': true + webform_audio_file: + '#type': webform_audio_file + '#title': 'Audio file' + '#description': 'This is a description for the ''webform_audio_file'' element.' + '#description_display': tooltip + webform_document_file: + '#type': webform_document_file + '#title': 'Document file' + '#description': 'This is a description for the ''webform_document_file'' element.' + '#description_display': tooltip + managed_file: + '#type': managed_file + '#title': File + '#description': 'This is a description for the ''managed_file'' element.' + '#description_display': tooltip + webform_image_file: + '#type': webform_image_file + '#title': 'Image file' + '#description': 'This is a description for the ''webform_image_file'' element.' + '#description_display': tooltip + webform_video_file: + '#type': webform_video_file + '#title': 'Video file' + '#description': 'This is a description for the ''webform_video_file'' element.' + '#description_display': tooltip options_elements: '#type': details '#title': 'Options elements' @@ -351,15 +361,15 @@ elements: | webform_computed_token: '#type': webform_computed_token '#title': 'Computed token' + '#template': 'This is a Computed token value.' '#description': 'This is a description for the ''webform_computed_token'' element.' '#description_display': tooltip - '#template': 'This is a Computed token value.' webform_computed_twig: '#type': webform_computed_twig '#title': 'Computed Twig' + '#template': 'This is a Computed Twig value.' '#description': 'This is a description for the ''webform_computed_twig'' element.' '#description_display': tooltip - '#template': 'This is a Computed Twig value.' date_time_elements: '#type': details '#title': 'Date/time elements' @@ -451,6 +461,11 @@ elements: | '#type': details '#title': Containers '#open': true + fieldset: + '#type': fieldset + '#title': Fieldset + '#description': 'This is a description for the ''fieldset'' element.' + '#description_display': tooltip item: '#type': item '#title': Item diff --git a/tests/modules/webform_test/config/install/webform.webform.test_element_disabled.yml b/tests/modules/webform_test/config/install/webform.webform.test_element_disabled.yml index 0f3262e3..80ac6cb2 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_element_disabled.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_element_disabled.yml @@ -15,6 +15,10 @@ title: 'Test: Element disabled' description: 'Test disabling element.' category: 'Test: Element' elements: | + webform_address: + '#type': webform_address + '#title': 'Basic address' + '#disabled': true webform_audio_file: '#type': webform_audio_file '#title': 'Audio file' @@ -23,10 +27,6 @@ elements: | '#type': webform_autocomplete '#title': Autocomplete '#disabled': true - webform_address: - '#type': webform_address - '#title': 'Basic address' - '#disabled': true webform_buttons: '#type': webform_buttons '#title': Buttons @@ -197,9 +197,13 @@ elements: | '#type': webform_link '#title': Link '#disabled': true - webform_location_geocomplete: + webform_location_places: '#type': webform_location_places - '#title': Location + '#title': 'Location (Algolia Places)' + '#disabled': true + webform_location_geocomplete: + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete)' '#map': true '#geolocation': true '#format': map diff --git a/tests/modules/webform_test/config/install/webform.webform.test_element_flexbox.yml b/tests/modules/webform_test/config/install/webform.webform.test_element_flexbox.yml index 67b1919f..f0b6bdd4 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_element_flexbox.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_element_flexbox.yml @@ -57,6 +57,14 @@ elements: | flex_table_right: '#type': table '#title': 'Table 02' + flexbox_webform_address: + '#type': webform_flexbox + flex_webform_address_left: + '#type': webform_address + '#title': 'Basic address 01' + flex_webform_address_right: + '#type': webform_address + '#title': 'Basic address 02' flexbox_address: '#type': webform_flexbox flex_address_left: @@ -89,14 +97,6 @@ elements: | flex_webform_autocomplete_right: '#type': webform_autocomplete '#title': 'Autocomplete 02' - flexbox_webform_address: - '#type': webform_flexbox - flex_webform_address_left: - '#type': webform_address - '#title': 'Basic address 01' - flex_webform_address_right: - '#type': webform_address - '#title': 'Basic address 02' flexbox_webform_markup: '#type': webform_flexbox flex_webform_markup_left: @@ -551,13 +551,21 @@ elements: | '#type': webform_flexbox flex_webform_location_places_left: '#type': webform_location_places - '#title': 'Location 01' + '#title': 'Location (Algolia Places) 01' + flex_webform_location_places_right: + '#type': webform_location_places + '#title': 'Location (Algolia Places) 02' + flexbox_webform_location_geocomplete: + '#type': webform_flexbox + flex_webform_location_geocomplete_left: + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) 01' '#map': true '#geolocation': true '#format': map - flex_webform_location_places_right: - '#type': webform_location_places - '#title': 'Location 02' + flex_webform_location_geocomplete_right: + '#type': webform_location_geocomplete + '#title': 'Location (Geocomplete) 02' '#map': true '#geolocation': true '#format': map @@ -966,7 +974,7 @@ elements: | toggle_rating: '#type': rating '#title': rating - + css: '' javascript: '' settings: diff --git a/tests/modules/webform_test/config/install/webform.webform.test_element_format.yml b/tests/modules/webform_test/config/install/webform.webform.test_element_format.yml index 917d0eb7..7f6644b5 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_element_format.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_element_format.yml @@ -363,6 +363,86 @@ elements: | '#title': 'URL (Link)' '#default_value': 'http://example.com' '#format': link + value: + '#type': details + '#title': Value + value_value: + '#type': value + '#title': 'Value (Value)' + '#value': preview + '#format': value + value_raw: + '#type': value + '#title': 'Value (Raw value)' + '#value': preview + '#format': raw + file_attachment_elements: + '#type': details + '#title': 'File attachment elements' + '#open': true + 'webform_entity_print_attachment:pdf': + '#type': details + '#title': 'Attachment PDF' + 'webform_entity_print_attachment:pdf_link': + '#type': webform_entity_print_attachment + '#title': 'Attachment PDF (File link)' + '#default_value': Loremipsum + '#format': link + 'webform_entity_print_attachment:pdf_name': + '#type': webform_entity_print_attachment + '#title': 'Attachment PDF (File name)' + '#default_value': Loremipsum + '#format': name + 'webform_entity_print_attachment:pdf_url': + '#type': webform_entity_print_attachment + '#title': 'Attachment PDF (File URL)' + '#default_value': Loremipsum + '#format': url + webform_attachment_token: + '#type': details + '#title': 'Attachment token' + webform_attachment_token_link: + '#type': webform_attachment_token + '#title': 'Attachment token (File link)' + '#format': link + webform_attachment_token_name: + '#type': webform_attachment_token + '#title': 'Attachment token (File name)' + '#format': name + webform_attachment_token_url: + '#type': webform_attachment_token + '#title': 'Attachment token (File URL)' + '#format': url + webform_attachment_twig: + '#type': details + '#title': 'Attachment Twig' + webform_attachment_twig_link: + '#type': webform_attachment_twig + '#title': 'Attachment Twig (File link)' + '#format': link + webform_attachment_twig_name: + '#type': webform_attachment_twig + '#title': 'Attachment Twig (File name)' + '#format': name + webform_attachment_twig_url: + '#type': webform_attachment_twig + '#title': 'Attachment Twig (File URL)' + '#format': url + webform_attachment_url: + '#type': details + '#title': 'Attachment URL' + webform_attachment_url_link: + '#type': webform_attachment_url + '#title': 'Attachment URL (File link)' + '#format': link + webform_attachment_url_name: + '#type': webform_attachment_url + '#title': 'Attachment URL (File name)' + '#format': name + webform_attachment_url_url: + '#type': webform_attachment_url + '#title': 'Attachment URL (File URL)' + '#format': url options_elements: '#type': details '#title': 'Options elements' @@ -558,26 +638,26 @@ elements: | webform_computed_token_value: '#type': webform_computed_token '#title': 'Computed token (Value)' - '#format': value '#template': 'This is a Computed token value.' + '#format': value webform_computed_token_raw: '#type': webform_computed_token '#title': 'Computed token (Raw value)' - '#format': raw '#template': 'This is a Computed token value.' + '#format': raw webform_computed_twig: '#type': details '#title': 'Computed Twig' webform_computed_twig_value: '#type': webform_computed_twig '#title': 'Computed Twig (Value)' - '#format': value '#template': 'This is a Computed Twig value.' + '#format': value webform_computed_twig_raw: '#type': webform_computed_twig '#title': 'Computed Twig (Raw value)' - '#format': raw '#template': 'This is a Computed Twig value.' + '#format': raw date_time_elements: '#type': details '#title': 'Date/time elements' @@ -813,7 +893,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': value entity_autocomplete_raw: '#type': entity_autocomplete @@ -822,7 +902,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': raw entity_autocomplete_link: '#type': entity_autocomplete @@ -831,7 +911,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': link entity_autocomplete_id: '#type': entity_autocomplete @@ -840,7 +920,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': id entity_autocomplete_label: '#type': entity_autocomplete @@ -849,7 +929,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': label entity_autocomplete_text: '#type': entity_autocomplete @@ -858,7 +938,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': text entity_autocomplete_teaser: '#type': entity_autocomplete @@ -867,7 +947,7 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 + '#default_value': 2 '#format': teaser entity_autocomplete_default: '#type': entity_autocomplete @@ -876,8 +956,8 @@ elements: | '#selection_handler': 'default:user' '#selection_settings': include_anonymous: true - '#default_value': 1 - '#format': _default + '#default_value': 2 + '#format': default webform_entity_radios: '#type': details '#title': 'Entity radios' @@ -984,7 +1064,7 @@ elements: | 1: Administrator 0: Anonymous '#default_value': 1 - '#format': _default + '#format': default webform_entity_select: '#type': details '#title': 'Entity select' @@ -1083,7 +1163,7 @@ elements: | 1: Administrator 0: Anonymous '#default_value': 1 - '#format': _default + '#format': default webform_term_select: '#type': details '#title': 'Term select' @@ -1134,7 +1214,7 @@ elements: | '#title': 'Term select (Default)' '#vocabulary': tags '#default_value': Loremipsum - '#format': _default + '#format': default webform_term_select_breadcrumb: '#type': webform_term_select '#title': 'Term select (Breadcrumb)' diff --git a/tests/modules/webform_test/config/install/webform.webform.test_element_format_multiple.yml b/tests/modules/webform_test/config/install/webform.webform.test_element_format_multiple.yml index 65f18e3d..5bda3812 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_element_format_multiple.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_element_format_multiple.yml @@ -1272,7 +1272,9 @@ elements: | include_anonymous: true '#multiple': true '#default_value': - - 1 + - 8 + - 4 + - 10 '#format_items': comma entity_autocomplete_semicolon: '#type': entity_autocomplete @@ -1283,7 +1285,9 @@ elements: | include_anonymous: true '#multiple': true '#default_value': - - 1 + - 8 + - 4 + - 10 '#format_items': semicolon entity_autocomplete_and: '#type': entity_autocomplete @@ -1294,7 +1298,9 @@ elements: | include_anonymous: true '#multiple': true '#default_value': - - 1 + - 8 + - 4 + - 10 '#format_items': and entity_autocomplete_ol: '#type': entity_autocomplete @@ -1305,7 +1311,9 @@ elements: | include_anonymous: true '#multiple': true '#default_value': - - 1 + - 8 + - 4 + - 10 '#format_items': ol entity_autocomplete_ul: '#type': entity_autocomplete @@ -1316,7 +1324,9 @@ elements: | include_anonymous: true '#multiple': true '#default_value': - - 1 + - 8 + - 4 + - 10 '#format_items': ul webform_entity_checkboxes: '#type': details diff --git a/tests/modules/webform_test/config/install/webform.webform.test_element_html_escape.yml b/tests/modules/webform_test/config/install/webform.webform.test_element_html_escape.yml index 65eaa557..caae5a1d 100644 --- a/tests/modules/webform_test/config/install/webform.webform.test_element_html_escape.yml +++ b/tests/modules/webform_test/config/install/webform.webform.test_element_html_escape.yml @@ -137,6 +137,10 @@ elements: | '#type': url '#title': 'URL multiple | ' '#multiple': true + value: + '#type': value + '#title': 'Value | ' + '#value': preview markup_elements: '#type': details '#title': 'Markup elements | ' @@ -154,12 +158,31 @@ elements: | class: - webform-horizontal-rule--dotted - webform-horizontal-rule--thick + label: + '#type': label + '#title': 'Label | ' webform_message: '#type': webform_message '#title': 'Message | ' '#message_type': warning '#message_message': 'This is a warning message.' '#description': 'Known Issues: