Skip to content
Snippets Groups Projects
Commit a732d26e authored by Mikael Meulle's avatar Mikael Meulle
Browse files

Merge branch '3494404-add-data-from' into '2.0.x'

Resolve #3494404 "Add data from"

See merge request !300
parents f0735579 84348ec2
No related branches found
No related tags found
No related merge requests found
Pipeline #370871 passed
......@@ -17,6 +17,7 @@ use Drupal\ui_patterns\PropTypePluginBase;
label: new TranslatableMarkup('Variant'),
description: new TranslatableMarkup('Prop type for component variants.'),
default_source: 'select',
convert_from: ['string'],
schema: ['type' => ['string'], 'enum' => []],
priority: 1
)]
......@@ -36,4 +37,13 @@ class VariantPropType extends PropTypePluginBase {
return static::normalizeEnumValue($value, $enum);
}
/**
* {@inheritdoc}
*/
public static function convertFrom(string $prop_type, mixed $value): mixed {
return match ($prop_type) {
'string' => (string) $value,
};
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment