generator properties & forced property order & factories

This commit is contained in:
timatifey
2023-03-06 13:21:24 +03:00
parent ba137d195e
commit 1a8ce3e2fa
131 changed files with 3501 additions and 1417 deletions
@@ -1,5 +1,5 @@
from __future__ import annotations
from typing import List, cast, Dict
from typing import List, cast, Dict, Optional
from ...schema.modeling.entities import (
Entity,
@@ -19,6 +19,7 @@ from ...schema.modeling.entities import (
Color,
String,
Dictionary,
DivanGeneratorProperties,
)
from ... import utils
from ...schema.modeling.text import Text
@@ -26,6 +27,54 @@ from ...schema.modeling.text import Text
GUARD_INSTANCE_PARAM = '`use named arguments`: Guard = Guard.instance,'
def preset_factory_method_declaration(
entity: DivanEntity,
factory_method_name: str,
inlines: Dict[str, str],
vararg_prop: DivanProperty,
vararg_items: bool,
remove_prefix: str
) -> Text:
type_name = full_name(entity, remove_prefix)
basic_method_name = entity.factory_method_name_with_parent
declaration = Text(f'fun DivScope.{factory_method_name}(')
vararg_prop_name_declaration = vararg_prop.name_declaration
array_vararg_type_name_declaration = cast(DivanPropertyType, vararg_prop.property_type).declaration(
prefixed=True,
remove_prefix=remove_prefix
)
array_item_vararg_type = cast(DivanPropertyType, cast(DivanArray, vararg_prop.property_type).property_type)
array_item_vararg_type_name_declaration = array_item_vararg_type.declaration(
prefixed=True,
remove_prefix=remove_prefix
)
if vararg_items:
items_prop_decl = f'vararg {vararg_prop_name_declaration}: {array_item_vararg_type_name_declaration},'
else:
items_prop_decl = f'{vararg_prop_name_declaration}: {array_vararg_type_name_declaration},'
declaration += utils.indented(items_prop_decl, level=1, indent_width=4)
declaration += entity.literal_properties_signature(
force_named_arguments=False,
force_default_nulls=False,
exclude=[vararg_prop.name, *inlines.keys()]
).indented(level=1, indent_width=4)
declaration += f'): {type_name} = {basic_method_name}('
for property in cast(List[DivanProperty], entity.instance_properties):
property_name_declaration = property.name_declaration
if property.name in inlines.keys():
prop_decl = f'{property_name_declaration} = {inlines[property.name]},'
elif property.name == vararg_prop.name and vararg_items:
prop_decl = f'{property_name_declaration} = {vararg_prop_name_declaration}.toList(),'
else:
prop_decl = f'{property_name_declaration} = {property_name_declaration},'
declaration += utils.indented(prop_decl, level=1, indent_width=4)
declaration += ')'
return declaration
def full_name(obj: Declarable, remove_prefix: str) -> str:
name = utils.capitalize_camel_case(obj.name, remove_prefix)
current_parent = obj.parent
@@ -97,6 +146,11 @@ class DivanEntity(Entity):
for prop in self.properties:
prop.__class__ = DivanProperty
cast(DivanProperty, prop).update_base()
self.generator_properties: Optional[DivanGeneratorProperties] = self.generator_properties
if self.generator_properties is not None:
forced_property_order = self.generator_properties.forced_properties_order
if forced_property_order:
self.apply_property_reorder()
@property
def supertype_declaration(self) -> str:
@@ -130,10 +184,40 @@ class DivanEntity(Entity):
return comment(*lines)
@property
def params_comment_block(self) -> Text:
def alternative_factories_declarations(self) -> List[(Text, Text)]:
result = []
if self.generator_properties is None:
return result
for factory in self.generator_properties.factories:
params_declaration = self.params_comment_block(exclude_params=list(factory.inlines.keys()))
vararg_prop = factory.vararg_property
vararg_prop.__class__ = DivanProperty
vararg_prop = cast(DivanProperty, vararg_prop)
vararg_prop.update_base()
result.append((params_declaration, preset_factory_method_declaration(
self,
factory_method_name=factory.factory_method_name,
inlines=factory.inlines,
vararg_prop=vararg_prop,
vararg_items=True,
remove_prefix=self.remove_prefix
)))
result.append((params_declaration, preset_factory_method_declaration(
self,
factory_method_name=factory.factory_method_name,
inlines=factory.inlines,
vararg_prop=vararg_prop,
vararg_items=False,
remove_prefix=self.remove_prefix
)))
return result
def params_comment_block(self, exclude_params: List[str] = None) -> Text:
if exclude_params is None:
exclude_params = []
params = [
f'@param {cast(DivanProperty, prop).name_declaration} {prop.description_doc()}'
for prop in self.properties if prop.description_doc() is not None
for prop in self.properties if prop.name not in exclude_params and prop.description_doc() is not None
]
return comment(*params) if params else Text()
@@ -146,18 +230,20 @@ class DivanEntity(Entity):
]
return comment(*params) if params else Text()
@property
def serialization_declaration(self) -> Text:
result = Text()
def serialization_declaration(self, has_properties: bool) -> Text:
result = Text('@JsonAnyGetter')
fun_declaration = 'internal fun getJsonProperties(): Map<String, Any>'
static_type = self.static_type
if static_type is None:
result += '@JsonAnyGetter'
result += 'internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(emptyMap())'
if has_properties:
if static_type is not None:
result += f'{fun_declaration} = properties.mergeWith('
result += utils.indented(f'mapOf("type" to "{static_type}")', indent_width=4)
result += ')'
else:
result += f'{fun_declaration} = properties.mergeWith(emptyMap())'
else:
result += '@JsonAnyGetter'
result += 'internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith('
result += f' mapOf("type" to "{static_type}")'
result += ')'
result += f'{fun_declaration} = mapOf("type" to "{static_type}")'
return result
def literal_properties_signature(
@@ -166,7 +252,9 @@ class DivanEntity(Entity):
force_default_nulls: bool,
exclude: List[str] = None,
) -> Text:
forced_property_order = []
forced_property_order: List[str] = []
if self.generator_properties is not None:
forced_property_order = self.generator_properties.forced_properties_order
if exclude is None:
exclude = []
is_named_guard_added = False
@@ -178,7 +266,7 @@ class DivanEntity(Entity):
if property.name not in forced_property_order or force_named_arguments:
signature_declaration += GUARD_INSTANCE_PARAM
is_named_guard_added = True
required = not force_default_nulls and not property.optional
required = False # not force_default_nulls and not property.optional
default = 'null'
property_type = cast(DivanPropertyType, property.property_type)
type_name_declaration = property_type.declaration(prefixed=True, remove_prefix=self.remove_prefix)
@@ -234,6 +322,11 @@ class DivanEntity(Entity):
def factory_method_declaration(self) -> Text:
type_name = full_name(self, self.remove_prefix)
method_name = self.factory_method_name_with_parent
has_properties = len(self.instance_properties) > 0
if not has_properties:
return Text(f'fun DivScope.{method_name}(): {type_name} = {type_name}')
declaration = Text(f'fun DivScope.{method_name}(')
declaration += self.literal_properties_signature(
force_named_arguments=False,
@@ -419,6 +512,16 @@ class DivanEntity(Entity):
declaration += ')'
return declaration
def apply_property_reorder(self):
if self.generator_properties is None:
return
forced_order = self.generator_properties.forced_properties_order
self._properties = sorted(
self._properties,
key=lambda property: property.name in forced_order,
reverse=True
)
@property
def factory_method_name_with_parent(self) -> str:
name = utils.capitalize_camel_case(self.name, self.remove_prefix)
@@ -469,7 +572,8 @@ class DivanProperty(Property):
comment_lines.append(translations["div_generator_default_value"].format(default_value))
if comment_lines:
declaration += comment(*comment_lines)
if self.is_deprecated:
declaration += f'@Deprecated("{translations["div_generator_deprecated_message"]}")'
declaration += f'val {self.name_declaration}: {type_declaration}?'
return declaration
@@ -522,8 +626,11 @@ class DivanPropertyType(PropertyType):
def is_primitive(self) -> bool:
if isinstance(self, (Int, Double, Bool, BoolInt, String, StaticString, Color, Url)):
return True
elif isinstance(self, (Dictionary, Array, Object)):
elif isinstance(self, (Dictionary, Array)):
return False
elif isinstance(self, Object):
inner_obj = self.object
return isinstance(inner_obj, StringEnumeration)
raise NotImplementedError
@@ -1,4 +1,4 @@
from typing import List, cast, Dict, Union
from typing import List, Dict, Union
from .divan_entities import (
update_base,
@@ -50,21 +50,32 @@ class DivanGenerator(Generator):
for annotation in self.top_level_annotations + self.kotlin_annotations:
result_declaration += annotation
result_declaration += f'class {utils.capitalize_camel_case(entity.name, self.remove_prefix)} internal constructor('
result_declaration += ' @JsonIgnore'
result_declaration += ' val properties: Properties,'
result_declaration += f'){entity.supertype_declaration} {{'
if entity.is_deprecated:
result_declaration += f'@Deprecated("{self.translations["div_generator_deprecated_message"]}")'
serialization_declaration = entity.serialization_declaration.indented(indent_width=4)
entity_name = utils.capitalize_camel_case(entity.name, self.remove_prefix)
has_properties = len(entity.instance_properties) > 0
if not has_properties:
result_declaration += f'object {entity_name}{entity.supertype_declaration} {{'
else:
result_declaration += f'class {entity_name} internal constructor('
result_declaration += ' @JsonIgnore'
result_declaration += ' val properties: Properties,'
result_declaration += f'){entity.supertype_declaration} {{'
serialization_declaration = entity.serialization_declaration(has_properties).indented(indent_width=4)
if serialization_declaration.lines:
result_declaration += serialization_declaration
if has_properties:
if entity.generator_properties is None or entity.generator_properties.plus_operator_declaration:
result_declaration += EMPTY
result_declaration += entity.operator_plus_declaration.indented(indent_width=4)
result_declaration += EMPTY
result_declaration += entity.operator_plus_declaration.indented(indent_width=4)
result_declaration += EMPTY
result_declaration += entity.properties_class_declaration(self.translations).indented(indent_width=4)
result_declaration += entity.properties_class_declaration(self.translations).indented(indent_width=4)
nested_classes_declaration = self.__nested_classes_declaration(entity)
if nested_classes_declaration.lines:
@@ -90,18 +101,23 @@ class DivanGenerator(Generator):
result_declaration += method_declaration
result_declaration += EMPTY
add_declaration(ent.params_comment_block, ent.factory_method_declaration)
add_declaration(ent.params_comment_block, ent.properties_factory_method_declaration)
add_declaration(ent.params_comment_block, ent.references_factory_method_declaration)
add_declaration(ent.params_comment_block, ent.override_method_declaration)
add_declaration(ent.params_comment_block, ent.defer_method_declaration)
add_declaration(ent.evaluatable_params_comment_block, ent.evaluate_method_declaration)
for comment_block, declaration in ent.alternative_factories_declarations:
add_declaration(comment_block, declaration)
if self.supertype_entities.intersection(ent.supertypes_list):
add_declaration(ent.params_comment_block, ent.override_component_method_declaration)
add_declaration(ent.params_comment_block, ent.defer_component_method_declaration)
add_declaration(ent.evaluatable_params_comment_block, ent.evaluate_component_method_declaration)
add_declaration(Text(), ent.operator_plus_component_declaration)
add_declaration(ent.params_comment_block(), ent.factory_method_declaration)
if has_properties:
add_declaration(ent.params_comment_block(), ent.properties_factory_method_declaration)
add_declaration(ent.params_comment_block(), ent.references_factory_method_declaration)
add_declaration(ent.params_comment_block(), ent.override_method_declaration)
add_declaration(ent.params_comment_block(), ent.defer_method_declaration)
add_declaration(ent.evaluatable_params_comment_block, ent.evaluate_method_declaration)
if self.supertype_entities.intersection(ent.supertypes_list):
add_declaration(ent.params_comment_block(), ent.override_component_method_declaration)
add_declaration(ent.params_comment_block(), ent.defer_component_method_declaration)
add_declaration(ent.evaluatable_params_comment_block, ent.evaluate_component_method_declaration)
add_declaration(Text(), ent.operator_plus_component_declaration)
add_declaration(Text(), ent.as_list_method_declaration)
@@ -110,10 +126,17 @@ class DivanGenerator(Generator):
add_methods_declarations(ent=entity)
inner_types = sorted(filter(lambda t: isinstance(t, Entity), entity.inner_types), key=sort_predicate)
inner_types = sorted(entity.inner_types, key=sort_predicate)
for ind, nested_entity in enumerate(inner_types):
nested_entity = update_base(nested_entity, self.remove_prefix)
add_methods_declarations(ent=cast(DivanEntity, nested_entity))
if isinstance(nested_entity, DivanEntity):
add_methods_declarations(ent=nested_entity)
elif isinstance(nested_entity, (DivanEntityEnumeration, DivanStringEnumeration)):
name = full_name(nested_entity, self.remove_prefix)
for annotation in self.top_level_annotations:
result_declaration += annotation
result_declaration += f'fun {name}.asList() = listOf(this)'
result_declaration += EMPTY
return result_declaration
@@ -133,8 +156,14 @@ class DivanGenerator(Generator):
return inner_types_decl
declarations = [declaration_of(StringEnumeration, self._string_enumeration_declaration),
declaration_of(EntityEnumeration, self._entity_enumeration_declaration),
declarations = [declaration_of(StringEnumeration,
lambda ent: self._enumeration_declaration(ent,
with_as_list_method=False)
),
declaration_of(EntityEnumeration,
lambda ent: self._enumeration_declaration(ent,
with_as_list_method=False)
),
declaration_of(Entity,
lambda ent: self.__entity_declaration_with(ent,
with_factory_methods=False)
@@ -150,12 +179,13 @@ class DivanGenerator(Generator):
return result
def _entity_enumeration_declaration(self, entity_enumeration: DivanEntityEnumeration) -> Text:
return self._enumeration_declaration(entity_enumeration)
return self._enumeration_declaration(entity_enumeration, with_as_list_method=True)
def _string_enumeration_declaration(self, string_enumeration: DivanStringEnumeration) -> Text:
return self._enumeration_declaration(string_enumeration)
return self._enumeration_declaration(string_enumeration, with_as_list_method=True)
def _enumeration_declaration(self, enumeration: Union[DivanEntityEnumeration, DivanStringEnumeration]) -> Text:
def _enumeration_declaration(self, enumeration: Union[DivanEntityEnumeration, DivanStringEnumeration],
with_as_list_method: bool) -> Text:
result_declaration = Text()
name = utils.capitalize_camel_case(enumeration.name, self.remove_prefix)
if isinstance(enumeration, DivanStringEnumeration):
@@ -164,8 +194,13 @@ class DivanGenerator(Generator):
result_declaration += annotation
result_declaration += f'sealed interface {name}'
result_declaration += EMPTY
result_declaration += f'fun {name}.asList() = listOf(this)'
if with_as_list_method:
result_declaration += EMPTY
for annotation in self.top_level_annotations + self.kotlin_annotations:
result_declaration += annotation
result_declaration += f'fun {name}.asList() = listOf(this)'
return result_declaration
def _generate_enums_values(self, divan_objects: List[Declarable]):
@@ -10,6 +10,10 @@ __full_translations: Dict[str, Dict[str, str]] = {
"en": "Default value: `{}`.",
"ru": "Значение по умолчанию: `{}`."
},
"div_generator_deprecated_message": {
"en": "Marked as deprecated in json schema",
"ru": "Помечен как устаревший в json схеме "
},
"div_generator_description": {
"en": "Description",
"ru": "Описание"
@@ -1,7 +1,8 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import List, Optional, Dict, Union, Tuple, cast
from copy import deepcopy
from typing import List, Optional, Dict, Union, Tuple, cast, Any, Set
from dataclasses import dataclass
from enum import Enum, auto
import re
@@ -9,6 +10,8 @@ import re
from ..utils import is_dict_with_keys_of_type, is_list_of_type
from .utils import (
alias,
alias_for,
fixing_reserved_typename
)
from ...utils import capitalize_camel_case
@@ -26,6 +29,94 @@ class DescriptionLanguage(str, Enum):
RU = 'ru'
def _build_generator_properties(
dictionary: Dict[str, Any],
location: ElementLocation,
config: Config.GenerationConfig,
mode: GenerationMode,
properties_list: List[Property],
) -> Optional[GeneratorProperties]:
generator_properties: Dict[str, Any] = dictionary.get("codegen", None)
generator_properties_location = location + "codegen"
if generator_properties is None:
return None
if not isinstance(generator_properties, Dict):
raise GenericError(
location=generator_properties_location,
text='Must have format {String : Any}'
)
lang: GeneratedLanguage = config.lang
specific_properties: Dict[str, Any] = generator_properties.get(lang.value, None)
if specific_properties is None:
return GeneralGeneratorProperties(
general_properties=generator_properties,
lang=lang,
mode=mode
)
if not isinstance(specific_properties, Dict):
raise GenericError(
location=generator_properties_location + lang.value,
text='Must have format {String : Any}'
)
if lang is GeneratedLanguage.DIVAN:
return DivanGeneratorProperties(
general_properties=generator_properties,
location=generator_properties_location,
lang=lang,
mode=mode,
specific_properties=specific_properties,
properties_list=properties_list,
)
generator_properties_classes = {
GeneratedLanguage.SWIFT: SwiftGeneratorProperties,
GeneratedLanguage.TYPE_SCRIPT: TypeScriptGeneratorProperties,
GeneratedLanguage.KOTLIN_DSL: KotlinDSLGeneratorProperties,
GeneratedLanguage.DOCUMENTATION: DocumentationGeneratorProperties,
}
specific_properties_class = generator_properties_classes.get(lang, None)
if specific_properties_class is None:
raise NotImplementedError
return specific_properties_class(
general_properties=generator_properties,
lang=lang,
mode=mode,
specific_properties=specific_properties,
)
def _get_property_by_name(name: str, properties: List[Property], location: ElementLocation) -> Property:
found_property = None
for property in properties:
if property.name == name:
found_property = property
break
if found_property is None:
raise GenericError(location, f"Object does not contains \"{name}\" property")
return deepcopy(found_property)
class GeneratorProperties(ABC):
def __init__(
self,
general_properties: Dict[str, Any],
lang: GeneratedLanguage,
mode: GenerationMode,
):
self.general_properties = general_properties
protocol_name = general_properties.get('protocol_name')
self.protocol_names: List[str] = []
if protocol_name is not None:
if not isinstance(protocol_name, List):
protocol_name = [protocol_name]
if is_list_of_type(protocol_name, str):
self.protocol_names: List[str] = list(map(lambda n: n + mode.name_suffix, protocol_name))
self.alias = alias_for(lang, general_properties)
def description_doc(description_translations: Dict[str, str], lang: DescriptionLanguage, description: str) -> str:
try:
return description_translations[lang.value]
@@ -194,6 +285,14 @@ class Entity(Declarable):
inner_type.parent = self
self.__resolve_property_objects()
self.generator_properties: Optional[GeneratorProperties] = _build_generator_properties(
dictionary,
location,
config,
mode,
self._properties
)
def __str__(self):
joined = '\n'.join(map(lambda x: f'\t{self._name} property: {x}', self._properties))
return f'Entity "{self._name}":\n{joined}'
@@ -233,6 +332,10 @@ class Entity(Declarable):
def super_entities(self) -> Optional[str]:
return self._super_entities
@property
def is_deprecated(self) -> bool:
return self._is_deprecated
@property
def swift_super_protocol(self) -> Optional[str]:
return self._swift_super_protocol
@@ -776,3 +879,130 @@ class Property:
def description_doc(self, lang: DescriptionLanguage = DescriptionLanguage.EN) -> str:
return description_doc(self.description_translations, lang, self.description)
class GeneralGeneratorProperties(GeneratorProperties):
pass
class TypeScriptGeneratorProperties(GeneratorProperties):
def __init__(
self,
general_properties: Dict[str, Any],
lang: GeneratedLanguage,
mode: GenerationMode,
specific_properties: Dict[str, Any],
):
super().__init__(general_properties, lang, mode)
self.templatable: bool = specific_properties.get('templatable', True)
class SwiftGeneratorProperties(GeneratorProperties):
def __init__(
self,
general_properties: Dict[str, Any],
lang: GeneratedLanguage,
mode: GenerationMode,
specific_properties: Dict[str, Any],
):
super().__init__(general_properties, lang, mode)
self.generate_optional_args: bool = specific_properties.get('generate_optional_arguments', True)
self.super_protocol: Optional[str] = specific_properties.get('super_protocol')
class DocumentationGeneratorProperties(GeneratorProperties):
def __init__(
self,
general_properties: Dict[str, Any],
lang: GeneratedLanguage,
mode: GenerationMode,
specific_properties: Dict[str, Any],
):
super().__init__(general_properties, lang, mode)
self.include_in_toc: bool = specific_properties.get('include_in_toc', False)
class KotlinDSLGeneratorProperties(GeneratorProperties):
def __init__(
self,
general_properties: Dict[str, Any],
lang: GeneratedLanguage,
mode: GenerationMode,
specific_properties: Dict[str, Any],
):
super().__init__(general_properties, lang, mode)
self.root_entity: bool = specific_properties.get('root_entity', False)
class DivanGeneratorProperties(GeneratorProperties):
def __init__(
self,
general_properties: Dict[str, Any],
location: ElementLocation,
lang: GeneratedLanguage,
mode: GenerationMode,
specific_properties: Dict[str, Any],
properties_list: List[Property],
):
super().__init__(general_properties, lang, mode)
self.forced_properties_order = specific_properties.get("forced_properties_order", [])
if not is_list_of_type(self.forced_properties_order, str):
raise GenericError(
location=location + lang.value + 'forced_properties_order',
text='Must have format [String]'
)
self.__resolve_forced_properties_order(location + lang.value + 'forced_properties_order', properties_list)
factories_dict: Dict[str, any] = specific_properties.get('factories')
self.factories: List[DivanFactory] = []
if factories_dict is not None:
self.__resolve_factories(location + lang.value + 'factories', factories_dict, properties_list)
self.plus_operator_declaration = specific_properties.get("plus_operator", True)
def __resolve_forced_properties_order(self, location: ElementLocation, properties_list: List[Property]):
found_properties: Set[str] = set()
for property in properties_list:
if property.name in self.forced_properties_order:
found_properties.add(property.name)
if len(self.forced_properties_order) != len(found_properties):
not_contains_props = ', '.join(filter(lambda prop: prop not in found_properties, self.forced_properties_order))
raise GenericError(location, f"Object does not contains properties: {not_contains_props}")
def __resolve_factories(
self,
location: ElementLocation,
factories_dict: Dict[str, any],
properties_list: List[Property]
):
for factory_method_name in factories_dict:
factory = factories_dict[factory_method_name]
divan_factory = DivanFactory(factory_method_name=factory_method_name)
if "vararg_property" in factory:
vararg_property = _get_property_by_name(
name=factory["vararg_property"],
properties=properties_list,
location=location + factory_method_name + "vararg_property",
)
if not isinstance(vararg_property.property_type, Array):
raise GenericError(location + factory_method_name + "vararg_property", "Expected array type")
divan_factory.vararg_property = vararg_property
if "inlines" in factory:
divan_factory.inlines = dict()
for inline_property_name, inline_value in factory["inlines"].items():
inline_property = _get_property_by_name(
name=inline_property_name,
properties=properties_list,
location=location + factory_method_name + "inlines",
)
divan_factory.inlines[inline_property.name] = inline_value
self.factories.append(divan_factory)
@dataclass
class DivanFactory:
factory_method_name: str
vararg_property: Optional[Property] = None
inlines: Optional[Dict[str, str]] = None
@@ -1,17 +1,25 @@
from typing import Dict, Optional, List
from ...config import GeneratedLanguage, Platform
from ..utils import get_value_with_optional_by_lang
from ..utils import get_value_with_optional_by_lang, get_value_by_specific_lang
def generate_cases_for_templates(lang: GeneratedLanguage, dictionary: Dict[str, any]) -> bool:
return get_value_with_optional_by_lang('generate_case_for_templates', lang, dictionary) or False
def generate_cases_for_templates_for(lang: GeneratedLanguage, dictionary: Dict[str, any]) -> bool:
return get_value_by_specific_lang('generate_case_for_templates', lang, dictionary) or False
def alias(lang: GeneratedLanguage, dictionary: Dict[str, any]) -> Optional[str]:
return get_value_with_optional_by_lang('alias', lang, dictionary)
def alias_for(lang: GeneratedLanguage, dictionary: Dict[str, any]) -> Optional[str]:
return get_value_by_specific_lang('alias', lang, dictionary)
def fixing_reserved_typename(typename: str, lang: GeneratedLanguage) -> str:
if lang is GeneratedLanguage.SWIFT:
return 'kind' if typename.lower() == 'type' else typename
@@ -21,10 +21,20 @@ def get_value_with_optional_by_lang(key: str, lang: GeneratedLanguage, dictionar
return dictionary.get(f'{key}_{lang.value}')
def get_value_by_specific_lang(key: str, lang: GeneratedLanguage, dictionary: Dict[str, any]) -> Optional[Value]:
if lang.value in dictionary:
return dictionary.get(str(lang.value)).get(key, dictionary.get(key))
return dictionary.get(key)
def code_generation_disabled(lang: GeneratedLanguage, dictionary: Dict[str, any]) -> bool:
return get_value_with_optional_by_lang('code_generation_disabled', lang, dictionary) or False
def code_generation_disabled_for(lang: GeneratedLanguage, dictionary: Dict[str, any]) -> bool:
return get_value_by_specific_lang('code_generation_disabled', lang, dictionary) or False
def is_list_of_type(value, list_type) -> bool:
return isinstance(value, List) and all(isinstance(element, list_type) for element in value)
@@ -24,4 +24,5 @@ import kotlin.collections.Map
@Generated
sealed interface Entity
@Generated
fun Entity.asList() = listOf(this)
@@ -57,7 +57,7 @@ class WithArray internal constructor(
@Generated
fun DivScope.withArray(
`use named arguments`: Guard = Guard.instance,
array: List<Entity>,
array: List<Entity>? = null,
): WithArray = WithArray(
WithArray.Properties(
array = valueOrNull(array),
@@ -58,14 +58,12 @@ class WithArrayOfEnums internal constructor(
*/
@Generated
sealed interface Item
fun Item.asList() = listOf(this)
}
@Generated
fun DivScope.withArrayOfEnums(
`use named arguments`: Guard = Guard.instance,
items: List<WithArrayOfEnums.Item>,
items: List<WithArrayOfEnums.Item>? = null,
): WithArrayOfEnums = WithArrayOfEnums(
WithArrayOfEnums.Properties(
items = valueOrNull(items),
@@ -138,3 +136,6 @@ operator fun Component<WithArrayOfEnums>.plus(additive: WithArrayOfEnums.Propert
@Generated
fun WithArrayOfEnums.asList() = listOf(this)
@Generated
fun WithArrayOfEnums.Item.asList() = listOf(this)
@@ -57,7 +57,7 @@ class WithArrayOfExpressions internal constructor(
@Generated
fun DivScope.withArrayOfExpressions(
`use named arguments`: Guard = Guard.instance,
items: List<String>,
items: List<String>? = null,
): WithArrayOfExpressions = WithArrayOfExpressions(
WithArrayOfExpressions.Properties(
items = valueOrNull(items),
@@ -92,7 +92,7 @@ class WithArrayOfNestedItems internal constructor(
@Generated
fun DivScope.withArrayOfNestedItems(
`use named arguments`: Guard = Guard.instance,
items: List<WithArrayOfNestedItems.Item>,
items: List<WithArrayOfNestedItems.Item>? = null,
): WithArrayOfNestedItems = WithArrayOfNestedItems(
WithArrayOfNestedItems.Properties(
items = valueOrNull(items),
@@ -169,8 +169,8 @@ fun WithArrayOfNestedItems.asList() = listOf(this)
@Generated
fun DivScope.withArrayOfNestedItemsItem(
`use named arguments`: Guard = Guard.instance,
entity: Entity,
property: String,
entity: Entity? = null,
property: String? = null,
): WithArrayOfNestedItems.Item = WithArrayOfNestedItems.Item(
WithArrayOfNestedItems.Item.Properties(
entity = valueOrNull(entity),
@@ -57,7 +57,7 @@ class WithArrayWithTransform internal constructor(
@Generated
fun DivScope.withArrayWithTransform(
`use named arguments`: Guard = Guard.instance,
array: List<Color>,
array: List<Color>? = null,
): WithArrayWithTransform = WithArrayWithTransform(
WithArrayWithTransform.Properties(
array = valueOrNull(array),
@@ -89,7 +89,7 @@ class WithComplexProperty internal constructor(
@Generated
fun DivScope.withComplexProperty(
`use named arguments`: Guard = Guard.instance,
property: WithComplexProperty.Property,
property: WithComplexProperty.Property? = null,
): WithComplexProperty = WithComplexProperty(
WithComplexProperty.Properties(
property = valueOrNull(property),
@@ -166,7 +166,7 @@ fun WithComplexProperty.asList() = listOf(this)
@Generated
fun DivScope.withComplexPropertyProperty(
`use named arguments`: Guard = Guard.instance,
value: Url,
value: Url? = null,
): WithComplexProperty.Property = WithComplexProperty.Property(
WithComplexProperty.Property.Properties(
value = valueOrNull(value),
@@ -169,7 +169,7 @@ fun WithComplexPropertyWithDefaultValue.asList() = listOf(this)
@Generated
fun DivScope.withComplexPropertyWithDefaultValueProperty(
`use named arguments`: Guard = Guard.instance,
value: String,
value: String? = null,
): WithComplexPropertyWithDefaultValue.Property = WithComplexPropertyWithDefaultValue.Property(
WithComplexPropertyWithDefaultValue.Property.Properties(
value = valueOrNull(value),
@@ -166,7 +166,7 @@ fun WithOptionalComplexProperty.asList() = listOf(this)
@Generated
fun DivScope.withOptionalComplexPropertyProperty(
`use named arguments`: Guard = Guard.instance,
value: Url,
value: Url? = null,
): WithOptionalComplexProperty.Property = WithOptionalComplexProperty.Property(
WithOptionalComplexProperty.Property.Properties(
value = valueOrNull(value),
@@ -58,8 +58,6 @@ class WithOptionalStringEnumProperty internal constructor(
*/
@Generated
sealed interface Property
fun Property.asList() = listOf(this)
}
@Generated
@@ -108,6 +106,16 @@ fun WithOptionalStringEnumProperty.defer(
)
)
@Generated
fun WithOptionalStringEnumProperty.evaluate(
`use named arguments`: Guard = Guard.instance,
property: ExpressionProperty<WithOptionalStringEnumProperty.Property>? = null,
): WithOptionalStringEnumProperty = WithOptionalStringEnumProperty(
WithOptionalStringEnumProperty.Properties(
property = property ?: properties.property,
)
)
@Generated
fun Component<WithOptionalStringEnumProperty>.override(
`use named arguments`: Guard = Guard.instance,
@@ -130,6 +138,17 @@ fun Component<WithOptionalStringEnumProperty>.defer(
).mergeWith(properties)
)
@Generated
fun Component<WithOptionalStringEnumProperty>.evaluate(
`use named arguments`: Guard = Guard.instance,
property: ExpressionProperty<WithOptionalStringEnumProperty.Property>? = null,
): Component<WithOptionalStringEnumProperty> = Component(
template = template,
properties = WithOptionalStringEnumProperty.Properties(
property = property,
).mergeWith(properties)
)
@Generated
operator fun Component<WithOptionalStringEnumProperty>.plus(additive: WithOptionalStringEnumProperty.Properties): Component<WithOptionalStringEnumProperty> = Component(
template = template,
@@ -138,3 +157,6 @@ operator fun Component<WithOptionalStringEnumProperty>.plus(additive: WithOption
@Generated
fun WithOptionalStringEnumProperty.asList() = listOf(this)
@Generated
fun WithOptionalStringEnumProperty.Property.asList() = listOf(this)
@@ -272,7 +272,7 @@ fun WithPropertyWithDefaultValue.asList() = listOf(this)
fun DivScope.withPropertyWithDefaultValueNested(
`use named arguments`: Guard = Guard.instance,
int: Int? = null,
nonOptional: String,
nonOptional: String? = null,
url: Url? = null,
): WithPropertyWithDefaultValue.Nested = WithPropertyWithDefaultValue.Nested(
WithPropertyWithDefaultValue.Nested.Properties(
@@ -57,7 +57,7 @@ class WithRequiredProperty internal constructor(
@Generated
fun DivScope.withRequiredProperty(
`use named arguments`: Guard = Guard.instance,
property: String,
property: String? = null,
): WithRequiredProperty = WithRequiredProperty(
WithRequiredProperty.Properties(
property = valueOrNull(property),
@@ -60,6 +60,7 @@ class WithSimpleProperties internal constructor(
/**
* Boolean value in numeric format.
*/
@Deprecated("Marked as deprecated in json schema")
val booleanInt: Property<Boolean>?,
/**
* Color.
@@ -57,7 +57,7 @@ class WithStrictArray internal constructor(
@Generated
fun DivScope.withStrictArray(
`use named arguments`: Guard = Guard.instance,
array: List<Entity>,
array: List<Entity>? = null,
): WithStrictArray = WithStrictArray(
WithStrictArray.Properties(
array = valueOrNull(array),
@@ -57,7 +57,7 @@ class WithStringArrayProperty internal constructor(
@Generated
fun DivScope.withStringArrayProperty(
`use named arguments`: Guard = Guard.instance,
array: List<String>,
array: List<String>? = null,
): WithStringArrayProperty = WithStringArrayProperty(
WithStringArrayProperty.Properties(
array = valueOrNull(array),
@@ -58,14 +58,12 @@ class WithStringEnumProperty internal constructor(
*/
@Generated
sealed interface Property
fun Property.asList() = listOf(this)
}
@Generated
fun DivScope.withStringEnumProperty(
`use named arguments`: Guard = Guard.instance,
property: WithStringEnumProperty.Property,
property: WithStringEnumProperty.Property? = null,
): WithStringEnumProperty = WithStringEnumProperty(
WithStringEnumProperty.Properties(
property = valueOrNull(property),
@@ -108,6 +106,16 @@ fun WithStringEnumProperty.defer(
)
)
@Generated
fun WithStringEnumProperty.evaluate(
`use named arguments`: Guard = Guard.instance,
property: ExpressionProperty<WithStringEnumProperty.Property>? = null,
): WithStringEnumProperty = WithStringEnumProperty(
WithStringEnumProperty.Properties(
property = property ?: properties.property,
)
)
@Generated
fun Component<WithStringEnumProperty>.override(
`use named arguments`: Guard = Guard.instance,
@@ -130,6 +138,17 @@ fun Component<WithStringEnumProperty>.defer(
).mergeWith(properties)
)
@Generated
fun Component<WithStringEnumProperty>.evaluate(
`use named arguments`: Guard = Guard.instance,
property: ExpressionProperty<WithStringEnumProperty.Property>? = null,
): Component<WithStringEnumProperty> = Component(
template = template,
properties = WithStringEnumProperty.Properties(
property = property,
).mergeWith(properties)
)
@Generated
operator fun Component<WithStringEnumProperty>.plus(additive: WithStringEnumProperty.Properties): Component<WithStringEnumProperty> = Component(
template = template,
@@ -138,3 +157,6 @@ operator fun Component<WithStringEnumProperty>.plus(additive: WithStringEnumProp
@Generated
fun WithStringEnumProperty.asList() = listOf(this)
@Generated
fun WithStringEnumProperty.Property.asList() = listOf(this)
@@ -61,8 +61,6 @@ class WithStringEnumPropertyWithDefaultValue internal constructor(
*/
@Generated
sealed interface Value
fun Value.asList() = listOf(this)
}
@Generated
@@ -111,6 +109,16 @@ fun WithStringEnumPropertyWithDefaultValue.defer(
)
)
@Generated
fun WithStringEnumPropertyWithDefaultValue.evaluate(
`use named arguments`: Guard = Guard.instance,
value: ExpressionProperty<WithStringEnumPropertyWithDefaultValue.Value>? = null,
): WithStringEnumPropertyWithDefaultValue = WithStringEnumPropertyWithDefaultValue(
WithStringEnumPropertyWithDefaultValue.Properties(
value = value ?: properties.value,
)
)
@Generated
fun Component<WithStringEnumPropertyWithDefaultValue>.override(
`use named arguments`: Guard = Guard.instance,
@@ -133,6 +141,17 @@ fun Component<WithStringEnumPropertyWithDefaultValue>.defer(
).mergeWith(properties)
)
@Generated
fun Component<WithStringEnumPropertyWithDefaultValue>.evaluate(
`use named arguments`: Guard = Guard.instance,
value: ExpressionProperty<WithStringEnumPropertyWithDefaultValue.Value>? = null,
): Component<WithStringEnumPropertyWithDefaultValue> = Component(
template = template,
properties = WithStringEnumPropertyWithDefaultValue.Properties(
value = value,
).mergeWith(properties)
)
@Generated
operator fun Component<WithStringEnumPropertyWithDefaultValue>.plus(additive: WithStringEnumPropertyWithDefaultValue.Properties): Component<WithStringEnumPropertyWithDefaultValue> = Component(
template = template,
@@ -141,3 +160,6 @@ operator fun Component<WithStringEnumPropertyWithDefaultValue>.plus(additive: Wi
@Generated
fun WithStringEnumPropertyWithDefaultValue.asList() = listOf(this)
@Generated
fun WithStringEnumPropertyWithDefaultValue.Value.asList() = listOf(this)
@@ -27,89 +27,13 @@ import kotlin.collections.Map
* Required properties: `type`.
*/
@Generated
class WithoutProperties internal constructor(
@JsonIgnore
val properties: Properties,
) : Entity {
object WithoutProperties : Entity {
@JsonAnyGetter
internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(
mapOf("type" to "entity_without_properties")
)
operator fun plus(additive: Properties): WithoutProperties = WithoutProperties(
Properties(
)
)
class Properties internal constructor(
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
return result
}
}
internal fun getJsonProperties(): Map<String, Any> = mapOf("type" to "entity_without_properties")
}
@Generated
fun DivScope.withoutProperties(
): WithoutProperties = WithoutProperties(
WithoutProperties.Properties(
)
)
@Generated
fun DivScope.withoutPropertiesProps(
) = WithoutProperties.Properties(
)
@Generated
fun TemplateScope.withoutPropertiesRefs(
`use named arguments`: Guard = Guard.instance,
) = WithoutProperties.Properties(
)
@Generated
fun WithoutProperties.override(
): WithoutProperties = WithoutProperties(
WithoutProperties.Properties(
)
)
@Generated
fun WithoutProperties.defer(
`use named arguments`: Guard = Guard.instance,
): WithoutProperties = WithoutProperties(
WithoutProperties.Properties(
)
)
@Generated
fun Component<WithoutProperties>.override(
): Component<WithoutProperties> = Component(
template = template,
properties = WithoutProperties.Properties(
).mergeWith(properties)
)
@Generated
fun Component<WithoutProperties>.defer(
`use named arguments`: Guard = Guard.instance,
): Component<WithoutProperties> = Component(
template = template,
properties = WithoutProperties.Properties(
).mergeWith(properties)
)
@Generated
operator fun Component<WithoutProperties>.plus(additive: WithoutProperties.Properties): Component<WithoutProperties> = Component(
template = template,
properties = additive.mergeWith(properties)
)
fun DivScope.withoutProperties(): WithoutProperties = WithoutProperties
@Generated
fun WithoutProperties.asList() = listOf(this)
@@ -90,8 +90,6 @@ class Accessibility internal constructor(
@Generated
sealed interface Mode
fun Mode.asList() = listOf(this)
/**
* Element role. Used to correctly identify an element by the accessibility service. For example, the `list` element is used to group list elements into one element.
*
@@ -99,8 +97,6 @@ class Accessibility internal constructor(
*/
@Generated
sealed interface Type
fun Type.asList() = listOf(this)
}
/**
@@ -242,6 +238,7 @@ fun Accessibility.defer(
/**
* @param description Element description. It is used as the main description for screen reading applications.
* @param hint A tooltip of what will happen during interaction. If Speak Hints is enabled in the VoiceOver settings on iOS, a tooltip is played after `description`.
* @param mode The way the accessibility tree is organized. In the `merge` mode the accessibility service perceives an element together with a subtree as a whole. In the `exclude` mode an element together with a subtree isn't available for accessibility.
* @param muteAfterAction Mutes the screen reader sound after interacting with the element.
* @param stateDescription Description of the current state of an element. For example, in the description you can specify a selected date for a date selection element and an on/off state for a switch.
*/
@@ -250,13 +247,14 @@ fun Accessibility.evaluate(
`use named arguments`: Guard = Guard.instance,
description: ExpressionProperty<String>? = null,
hint: ExpressionProperty<String>? = null,
mode: ExpressionProperty<Accessibility.Mode>? = null,
muteAfterAction: ExpressionProperty<Boolean>? = null,
stateDescription: ExpressionProperty<String>? = null,
): Accessibility = Accessibility(
Accessibility.Properties(
description = description ?: properties.description,
hint = hint ?: properties.hint,
mode = properties.mode,
mode = mode ?: properties.mode,
muteAfterAction = muteAfterAction ?: properties.muteAfterAction,
stateDescription = stateDescription ?: properties.stateDescription,
type = properties.type,
@@ -265,3 +263,9 @@ fun Accessibility.evaluate(
@Generated
fun Accessibility.asList() = listOf(this)
@Generated
fun Accessibility.Mode.asList() = listOf(this)
@Generated
fun Accessibility.Type.asList() = listOf(this)
@@ -102,8 +102,6 @@ class Action internal constructor(
@Generated
sealed interface Target
fun Target.asList() = listOf(this)
/**
* Can be created using the method [actionMenuItem].
*
@@ -166,7 +164,7 @@ class Action internal constructor(
fun DivScope.action(
`use named arguments`: Guard = Guard.instance,
downloadCallbacks: DownloadCallbacks? = null,
logId: String,
logId: String? = null,
logUrl: Url? = null,
menuItems: List<Action.MenuItem>? = null,
payload: Map<String, Any>? = null,
@@ -321,6 +319,7 @@ fun Action.defer(
/**
* @param logUrl URL for logging.
* @param referer Referer URL for logging.
* @param target The tab in which the URL must be opened.
* @param url URL. Possible values: `url` or `div-action://`. To learn more, see [Interaction with elements](../../interaction.dita).
*/
@Generated
@@ -328,6 +327,7 @@ fun Action.evaluate(
`use named arguments`: Guard = Guard.instance,
logUrl: ExpressionProperty<Url>? = null,
referer: ExpressionProperty<Url>? = null,
target: ExpressionProperty<Action.Target>? = null,
url: ExpressionProperty<Url>? = null,
): Action = Action(
Action.Properties(
@@ -337,7 +337,7 @@ fun Action.evaluate(
menuItems = properties.menuItems,
payload = properties.payload,
referer = referer ?: properties.referer,
target = properties.target,
target = target ?: properties.target,
url = url ?: properties.url,
)
)
@@ -355,7 +355,7 @@ fun DivScope.actionMenuItem(
`use named arguments`: Guard = Guard.instance,
action: Action? = null,
actions: List<Action>? = null,
text: String,
text: String? = null,
): Action.MenuItem = Action.MenuItem(
Action.MenuItem.Properties(
action = valueOrNull(action),
@@ -453,3 +453,6 @@ fun Action.MenuItem.evaluate(
@Generated
fun Action.MenuItem.asList() = listOf(this)
@Generated
fun Action.Target.asList() = listOf(this)
@@ -23,4 +23,5 @@ import kotlin.collections.Map
@Generated
sealed interface AlignmentHorizontal
@Generated
fun AlignmentHorizontal.asList() = listOf(this)
@@ -23,4 +23,5 @@ import kotlin.collections.Map
@Generated
sealed interface AlignmentVertical
@Generated
fun AlignmentVertical.asList() = listOf(this)
@@ -105,8 +105,6 @@ class Animation internal constructor(
*/
@Generated
sealed interface Name
fun Name.asList() = listOf(this)
}
/**
@@ -126,7 +124,7 @@ fun DivScope.animation(
endValue: Double? = null,
interpolator: AnimationInterpolator? = null,
items: List<Animation>? = null,
name: Animation.Name,
name: Animation.Name? = null,
repeat: Count? = null,
startDelay: Int? = null,
startValue: Double? = null,
@@ -278,6 +276,8 @@ fun Animation.defer(
/**
* @param duration Animation duration in milliseconds.
* @param endValue Final value of an animation.
* @param interpolator Animation speed nature. When the value is set to `spring` — animation of damping fluctuations cut to 0.7 with the `damping=1` parameter. Other options correspond to the Bezier curve:<li>`linear` — cubic-bezier(0, 0, 1, 1);</li><li>`ease` — cubic-bezier(0.25, 0.1, 0.25, 1);</li><li>`ease_in` — cubic-bezier(0.42, 0, 1, 1);</li><li>`ease_out` — cubic-bezier(0, 0, 0.58, 1);</li><li>`ease_in_out` — cubic-bezier(0.42, 0, 0.58, 1).</li>
* @param name Animation type.
* @param startDelay Delay in milliseconds before animation starts.
* @param startValue Starting value of an animation.
*/
@@ -286,15 +286,17 @@ fun Animation.evaluate(
`use named arguments`: Guard = Guard.instance,
duration: ExpressionProperty<Int>? = null,
endValue: ExpressionProperty<Double>? = null,
interpolator: ExpressionProperty<AnimationInterpolator>? = null,
name: ExpressionProperty<Animation.Name>? = null,
startDelay: ExpressionProperty<Int>? = null,
startValue: ExpressionProperty<Double>? = null,
): Animation = Animation(
Animation.Properties(
duration = duration ?: properties.duration,
endValue = endValue ?: properties.endValue,
interpolator = properties.interpolator,
interpolator = interpolator ?: properties.interpolator,
items = properties.items,
name = properties.name,
name = name ?: properties.name,
repeat = properties.repeat,
startDelay = startDelay ?: properties.startDelay,
startValue = startValue ?: properties.startValue,
@@ -303,3 +305,6 @@ fun Animation.evaluate(
@Generated
fun Animation.asList() = listOf(this)
@Generated
fun Animation.Name.asList() = listOf(this)
@@ -25,4 +25,5 @@ import kotlin.collections.Map
@Generated
sealed interface AnimationInterpolator
@Generated
fun AnimationInterpolator.asList() = listOf(this)
@@ -61,7 +61,7 @@ class AppearanceSetTransition internal constructor(
@Generated
fun DivScope.appearanceSetTransition(
`use named arguments`: Guard = Guard.instance,
items: List<AppearanceTransition>,
items: List<AppearanceTransition>? = null,
): AppearanceSetTransition = AppearanceSetTransition(
AppearanceSetTransition.Properties(
items = valueOrNull(items),
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface AppearanceTransition
@Generated
fun AppearanceTransition.asList() = listOf(this)
@@ -59,7 +59,7 @@ class Aspect internal constructor(
@Generated
fun DivScope.aspect(
`use named arguments`: Guard = Guard.instance,
ratio: Double,
ratio: Double? = null,
): Aspect = Aspect(
Aspect.Properties(
ratio = valueOrNull(ratio),
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Background
@Generated
fun Background.asList() = listOf(this)
@@ -25,4 +25,5 @@ import kotlin.collections.Map
@Generated
sealed interface BlendMode
@Generated
fun BlendMode.asList() = listOf(this)
@@ -61,7 +61,7 @@ class Blur internal constructor(
@Generated
fun DivScope.blur(
`use named arguments`: Guard = Guard.instance,
radius: Int,
radius: Int? = null,
): Blur = Blur(
Blur.Properties(
radius = valueOrNull(radius),
@@ -68,8 +68,8 @@ class BooleanVariable internal constructor(
@Generated
fun DivScope.booleanVariable(
`use named arguments`: Guard = Guard.instance,
name: String,
value: Boolean,
name: String? = null,
value: Boolean? = null,
): BooleanVariable = BooleanVariable(
BooleanVariable.Properties(
name = valueOrNull(name),
@@ -163,17 +163,19 @@ fun ChangeBoundsTransition.defer(
/**
* @param duration Animation duration in milliseconds.
* @param interpolator Transition speed nature.
* @param startDelay Delay in milliseconds before animation starts.
*/
@Generated
fun ChangeBoundsTransition.evaluate(
`use named arguments`: Guard = Guard.instance,
duration: ExpressionProperty<Int>? = null,
interpolator: ExpressionProperty<AnimationInterpolator>? = null,
startDelay: ExpressionProperty<Int>? = null,
): ChangeBoundsTransition = ChangeBoundsTransition(
ChangeBoundsTransition.Properties(
duration = duration ?: properties.duration,
interpolator = properties.interpolator,
interpolator = interpolator ?: properties.interpolator,
startDelay = startDelay ?: properties.startDelay,
)
)
@@ -61,7 +61,7 @@ class ChangeSetTransition internal constructor(
@Generated
fun DivScope.changeSetTransition(
`use named arguments`: Guard = Guard.instance,
items: List<ChangeTransition>,
items: List<ChangeTransition>? = null,
): ChangeSetTransition = ChangeSetTransition(
ChangeSetTransition.Properties(
items = valueOrNull(items),
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface ChangeTransition
@Generated
fun ChangeTransition.asList() = listOf(this)
@@ -68,8 +68,8 @@ class ColorVariable internal constructor(
@Generated
fun DivScope.colorVariable(
`use named arguments`: Guard = Guard.instance,
name: String,
value: Color,
name: String? = null,
value: Color? = null,
): ColorVariable = ColorVariable(
ColorVariable.Properties(
name = valueOrNull(name),
File diff suppressed because it is too large Load Diff
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Count
@Generated
fun Count.asList() = listOf(this)
@@ -262,7 +262,7 @@ fun DivScope.custom(
border: Border? = null,
columnSpan: Int? = null,
customProps: Map<String, Any>? = null,
customType: String,
customType: String? = null,
extensions: List<Extension>? = null,
focus: Focus? = null,
height: Size? = null,
@@ -688,21 +688,27 @@ fun Custom.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Custom.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Custom = Custom(
Custom.Properties(
accessibility = properties.accessibility,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
background = properties.background,
border = properties.border,
@@ -724,7 +730,7 @@ fun Custom.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -922,22 +928,28 @@ fun Component<Custom>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Component<Custom>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Custom> = Component(
template = template,
properties = Custom.Properties(
accessibility = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
background = null,
border = null,
@@ -959,7 +971,7 @@ fun Component<Custom>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -32,17 +32,6 @@ class Data internal constructor(
@JsonAnyGetter
internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(emptyMap())
operator fun plus(additive: Properties): Data = Data(
Properties(
logId = additive.logId ?: properties.logId,
states = additive.states ?: properties.states,
timers = additive.timers ?: properties.timers,
transitionAnimationSelector = additive.transitionAnimationSelector ?: properties.transitionAnimationSelector,
variableTriggers = additive.variableTriggers ?: properties.variableTriggers,
variables = additive.variables ?: properties.variables,
)
)
class Properties internal constructor(
/**
* Logging ID.
@@ -60,6 +49,7 @@ class Data internal constructor(
* Events that trigger transition animations.
* Default value: `none`.
*/
@Deprecated("Marked as deprecated in json schema")
val transitionAnimationSelector: Property<TransitionSelector>?,
/**
* Triggers for changing variables.
@@ -136,8 +126,8 @@ class Data internal constructor(
@Generated
fun DivScope.data(
`use named arguments`: Guard = Guard.instance,
logId: String,
states: List<Data.State>,
logId: String? = null,
states: List<Data.State>? = null,
timers: List<Timer>? = null,
transitionAnimationSelector: TransitionSelector? = null,
variableTriggers: List<Trigger>? = null,
@@ -261,6 +251,24 @@ fun Data.defer(
)
)
/**
* @param transitionAnimationSelector Events that trigger transition animations.
*/
@Generated
fun Data.evaluate(
`use named arguments`: Guard = Guard.instance,
transitionAnimationSelector: ExpressionProperty<TransitionSelector>? = null,
): Data = Data(
Data.Properties(
logId = properties.logId,
states = properties.states,
timers = properties.timers,
transitionAnimationSelector = transitionAnimationSelector ?: properties.transitionAnimationSelector,
variableTriggers = properties.variableTriggers,
variables = properties.variables,
)
)
@Generated
fun Data.asList() = listOf(this)
@@ -271,8 +279,8 @@ fun Data.asList() = listOf(this)
@Generated
fun DivScope.dataState(
`use named arguments`: Guard = Guard.instance,
div: Div,
stateId: Int,
div: Div? = null,
stateId: Int? = null,
): Data.State = Data.State(
Data.State.Properties(
div = valueOrNull(div),
@@ -34,26 +34,26 @@ class Dimension internal constructor(
operator fun plus(additive: Properties): Dimension = Dimension(
Properties(
unit = additive.unit ?: properties.unit,
value = additive.value ?: properties.value,
unit = additive.unit ?: properties.unit,
)
)
class Properties internal constructor(
/**
* Default value: `dp`.
*/
val unit: Property<SizeUnit>?,
/**
* Value.
*/
val value: Property<Double>?,
/**
* Default value: `dp`.
*/
val unit: Property<SizeUnit>?,
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
result.tryPutProperty("unit", unit)
result.tryPutProperty("value", value)
result.tryPutProperty("unit", unit)
return result
}
}
@@ -64,13 +64,13 @@ class Dimension internal constructor(
*/
@Generated
fun DivScope.dimension(
value: Double? = null,
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Double,
): Dimension = Dimension(
Dimension.Properties(
unit = valueOrNull(unit),
value = valueOrNull(value),
unit = valueOrNull(unit),
)
)
@@ -80,11 +80,11 @@ fun DivScope.dimension(
@Generated
fun DivScope.dimensionProps(
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Double? = null,
unit: SizeUnit? = null,
) = Dimension.Properties(
unit = valueOrNull(unit),
value = valueOrNull(value),
unit = valueOrNull(unit),
)
/**
@@ -93,11 +93,11 @@ fun DivScope.dimensionProps(
@Generated
fun TemplateScope.dimensionRefs(
`use named arguments`: Guard = Guard.instance,
unit: ReferenceProperty<SizeUnit>? = null,
value: ReferenceProperty<Double>? = null,
unit: ReferenceProperty<SizeUnit>? = null,
) = Dimension.Properties(
unit = unit,
value = value,
unit = unit,
)
/**
@@ -106,12 +106,12 @@ fun TemplateScope.dimensionRefs(
@Generated
fun Dimension.override(
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Double? = null,
unit: SizeUnit? = null,
): Dimension = Dimension(
Dimension.Properties(
unit = valueOrNull(unit) ?: properties.unit,
value = valueOrNull(value) ?: properties.value,
unit = valueOrNull(unit) ?: properties.unit,
)
)
@@ -121,12 +121,12 @@ fun Dimension.override(
@Generated
fun Dimension.defer(
`use named arguments`: Guard = Guard.instance,
unit: ReferenceProperty<SizeUnit>? = null,
value: ReferenceProperty<Double>? = null,
unit: ReferenceProperty<SizeUnit>? = null,
): Dimension = Dimension(
Dimension.Properties(
unit = unit ?: properties.unit,
value = value ?: properties.value,
unit = unit ?: properties.unit,
)
)
@@ -137,10 +137,11 @@ fun Dimension.defer(
fun Dimension.evaluate(
`use named arguments`: Guard = Guard.instance,
value: ExpressionProperty<Double>? = null,
unit: ExpressionProperty<SizeUnit>? = null,
): Dimension = Dimension(
Dimension.Properties(
unit = properties.unit,
value = value ?: properties.value,
unit = unit ?: properties.unit,
)
)
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Div
@Generated
fun Div.asList() = listOf(this)
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Drawable
@Generated
fun Drawable.asList() = listOf(this)
@@ -208,13 +208,14 @@ fun EdgeInsets.evaluate(
left: ExpressionProperty<Int>? = null,
right: ExpressionProperty<Int>? = null,
top: ExpressionProperty<Int>? = null,
unit: ExpressionProperty<SizeUnit>? = null,
): EdgeInsets = EdgeInsets(
EdgeInsets.Properties(
bottom = bottom ?: properties.bottom,
left = left ?: properties.left,
right = right ?: properties.right,
top = top ?: properties.top,
unit = properties.unit,
unit = unit ?: properties.unit,
)
)
@@ -23,6 +23,56 @@ sealed class EnumValue(
val serialized: String,
)
@Generated
object DefaultEnumValue : EnumValue("default"),
Accessibility.Mode,
Gallery.ScrollMode
@Generated
object MergeEnumValue : EnumValue("merge"),
Accessibility.Mode
@Generated
object ExcludeEnumValue : EnumValue("exclude"),
Accessibility.Mode
@Generated
object NoneEnumValue : EnumValue("none"),
Accessibility.Type,
LineStyle,
Tabs.TabTitleStyle.AnimationType,
Text.Truncate,
TransitionSelector
@Generated
object ButtonEnumValue : EnumValue("button"),
Accessibility.Type
@Generated
object ImageEnumValue : EnumValue("image"),
Accessibility.Type
@Generated
object TextEnumValue : EnumValue("text"),
Accessibility.Type,
FontFamily
@Generated
object EditTextEnumValue : EnumValue("edit_text"),
Accessibility.Type
@Generated
object HeaderEnumValue : EnumValue("header"),
Accessibility.Type
@Generated
object TabBarEnumValue : EnumValue("tab_bar"),
Accessibility.Type
@Generated
object ListEnumValue : EnumValue("list"),
Accessibility.Type
@Generated
object SelfEnumValue : EnumValue("_self"),
Action.Target
@@ -50,28 +100,20 @@ object RightEnumValue : EnumValue("right"),
Tooltip.Position
@Generated
object LinearEnumValue : EnumValue("linear"),
AnimationInterpolator
object TopEnumValue : EnumValue("top"),
AlignmentVertical,
SlideTransition.Edge,
Tooltip.Position
@Generated
object EaseEnumValue : EnumValue("ease"),
AnimationInterpolator
object BottomEnumValue : EnumValue("bottom"),
AlignmentVertical,
SlideTransition.Edge,
Tooltip.Position
@Generated
object EaseInEnumValue : EnumValue("ease_in"),
AnimationInterpolator
@Generated
object EaseOutEnumValue : EnumValue("ease_out"),
AnimationInterpolator
@Generated
object EaseInOutEnumValue : EnumValue("ease_in_out"),
AnimationInterpolator
@Generated
object SpringEnumValue : EnumValue("spring"),
AnimationInterpolator
object BaselineEnumValue : EnumValue("baseline"),
AlignmentVertical
@Generated
object FadeEnumValue : EnumValue("fade"),
@@ -100,9 +142,78 @@ object NoAnimationEnumValue : EnumValue("no_animation"),
Animation.Name
@Generated
object TextEnumValue : EnumValue("text"),
Accessibility.Type,
FontFamily
object LinearEnumValue : EnumValue("linear"),
AnimationInterpolator
@Generated
object EaseEnumValue : EnumValue("ease"),
AnimationInterpolator
@Generated
object EaseInEnumValue : EnumValue("ease_in"),
AnimationInterpolator
@Generated
object EaseOutEnumValue : EnumValue("ease_out"),
AnimationInterpolator
@Generated
object EaseInOutEnumValue : EnumValue("ease_in_out"),
AnimationInterpolator
@Generated
object SpringEnumValue : EnumValue("spring"),
AnimationInterpolator
@Generated
object SourceInEnumValue : EnumValue("source_in"),
BlendMode
@Generated
object SourceAtopEnumValue : EnumValue("source_atop"),
BlendMode
@Generated
object DarkenEnumValue : EnumValue("darken"),
BlendMode
@Generated
object LightenEnumValue : EnumValue("lighten"),
BlendMode
@Generated
object MultiplyEnumValue : EnumValue("multiply"),
BlendMode
@Generated
object ScreenEnumValue : EnumValue("screen"),
BlendMode
@Generated
object NoWrapEnumValue : EnumValue("no_wrap"),
Container.LayoutMode
@Generated
object WrapEnumValue : EnumValue("wrap"),
Container.LayoutMode
@Generated
object VerticalEnumValue : EnumValue("vertical"),
Container.Orientation,
Gallery.Orientation,
Pager.Orientation,
Separator.DelimiterStyle.Orientation
@Generated
object HorizontalEnumValue : EnumValue("horizontal"),
Container.Orientation,
Gallery.Orientation,
Pager.Orientation,
Separator.DelimiterStyle.Orientation
@Generated
object OverlapEnumValue : EnumValue("overlap"),
Container.Orientation
@Generated
object DisplayEnumValue : EnumValue("display"),
@@ -124,6 +235,20 @@ object RegularEnumValue : EnumValue("regular"),
object BoldEnumValue : EnumValue("bold"),
FontWeight
@Generated
object StartEnumValue : EnumValue("start"),
Gallery.CrossContentAlignment,
Text.Truncate
@Generated
object EndEnumValue : EnumValue("end"),
Gallery.CrossContentAlignment,
Text.Truncate
@Generated
object PagingEnumValue : EnumValue("paging"),
Gallery.ScrollMode
@Generated
object FillEnumValue : EnumValue("fill"),
ImageScale
@@ -137,12 +262,42 @@ object FitEnumValue : EnumValue("fit"),
ImageScale
@Generated
object NoneEnumValue : EnumValue("none"),
Accessibility.Type,
LineStyle,
Tabs.TabTitleStyle.AnimationType,
Text.Truncate,
TransitionSelector
object WormEnumValue : EnumValue("worm"),
Indicator.Animation
@Generated
object SliderEnumValue : EnumValue("slider"),
Indicator.Animation
@Generated
object SingleLineTextEnumValue : EnumValue("single_line_text"),
Input.KeyboardType,
KeyboardInput.KeyboardType
@Generated
object MultiLineTextEnumValue : EnumValue("multi_line_text"),
Input.KeyboardType,
KeyboardInput.KeyboardType
@Generated
object PhoneEnumValue : EnumValue("phone"),
Input.KeyboardType,
KeyboardInput.KeyboardType
@Generated
object NumberEnumValue : EnumValue("number"),
Input.KeyboardType,
KeyboardInput.KeyboardType
@Generated
object EmailEnumValue : EnumValue("email"),
Input.KeyboardType,
KeyboardInput.KeyboardType
@Generated
object UriEnumValue : EnumValue("uri"),
Input.KeyboardType,
KeyboardInput.KeyboardType
@Generated
object SingleEnumValue : EnumValue("single"),
@@ -157,18 +312,20 @@ object PartialEnumValue : EnumValue("partial"),
Patch.Mode
@Generated
object VerticalEnumValue : EnumValue("vertical"),
Container.Orientation,
Gallery.Orientation,
Pager.Orientation,
Separator.DelimiterStyle.Orientation
object NearestCornerEnumValue : EnumValue("nearest_corner"),
RadialGradientRelativeRadius.Value
@Generated
object HorizontalEnumValue : EnumValue("horizontal"),
Container.Orientation,
Gallery.Orientation,
Pager.Orientation,
Separator.DelimiterStyle.Orientation
object FarthestCornerEnumValue : EnumValue("farthest_corner"),
RadialGradientRelativeRadius.Value
@Generated
object NearestSideEnumValue : EnumValue("nearest_side"),
RadialGradientRelativeRadius.Value
@Generated
object FarthestSideEnumValue : EnumValue("farthest_side"),
RadialGradientRelativeRadius.Value
@Generated
object DpEnumValue : EnumValue("dp"),
@@ -183,16 +340,12 @@ object PxEnumValue : EnumValue("px"),
SizeUnit
@Generated
object TopEnumValue : EnumValue("top"),
AlignmentVertical,
SlideTransition.Edge,
Tooltip.Position
object SlideEnumValue : EnumValue("slide"),
Tabs.TabTitleStyle.AnimationType
@Generated
object BottomEnumValue : EnumValue("bottom"),
AlignmentVertical,
SlideTransition.Edge,
Tooltip.Position
object MiddleEnumValue : EnumValue("middle"),
Text.Truncate
@Generated
object TopLeftEnumValue : EnumValue("top-left"),
@@ -249,151 +402,48 @@ object GoneEnumValue : EnumValue("gone"),
Visibility
@Generated
object SourceInEnumValue : EnumValue("source_in"),
BlendMode
val DivScope.default: DefaultEnumValue
get() = DefaultEnumValue
@Generated
object SourceAtopEnumValue : EnumValue("source_atop"),
BlendMode
val DivScope.merge: MergeEnumValue
get() = MergeEnumValue
@Generated
object DarkenEnumValue : EnumValue("darken"),
BlendMode
val DivScope.exclude: ExcludeEnumValue
get() = ExcludeEnumValue
@Generated
object LightenEnumValue : EnumValue("lighten"),
BlendMode
val DivScope.none: NoneEnumValue
get() = NoneEnumValue
@Generated
object MultiplyEnumValue : EnumValue("multiply"),
BlendMode
val DivScope.button: ButtonEnumValue
get() = ButtonEnumValue
@Generated
object ScreenEnumValue : EnumValue("screen"),
BlendMode
val DivScope.image: ImageEnumValue
get() = ImageEnumValue
@Generated
object NearestCornerEnumValue : EnumValue("nearest_corner"),
RadialGradientRelativeRadius.Value
val DivScope.text: TextEnumValue
get() = TextEnumValue
@Generated
object FarthestCornerEnumValue : EnumValue("farthest_corner"),
RadialGradientRelativeRadius.Value
val DivScope.edit_text: EditTextEnumValue
get() = EditTextEnumValue
@Generated
object NearestSideEnumValue : EnumValue("nearest_side"),
RadialGradientRelativeRadius.Value
val DivScope.header: HeaderEnumValue
get() = HeaderEnumValue
@Generated
object FarthestSideEnumValue : EnumValue("farthest_side"),
RadialGradientRelativeRadius.Value
val DivScope.tab_bar: TabBarEnumValue
get() = TabBarEnumValue
@Generated
object SlideEnumValue : EnumValue("slide"),
Tabs.TabTitleStyle.AnimationType
@Generated
object StartEnumValue : EnumValue("start"),
Gallery.CrossContentAlignment,
Text.Truncate
@Generated
object EndEnumValue : EnumValue("end"),
Gallery.CrossContentAlignment,
Text.Truncate
@Generated
object PagingEnumValue : EnumValue("paging"),
Gallery.ScrollMode
@Generated
object DefaultEnumValue : EnumValue("default"),
Accessibility.Mode,
Gallery.ScrollMode
@Generated
object BaselineEnumValue : EnumValue("baseline"),
AlignmentVertical
@Generated
object MergeEnumValue : EnumValue("merge"),
Accessibility.Mode
@Generated
object ExcludeEnumValue : EnumValue("exclude"),
Accessibility.Mode
@Generated
object ButtonEnumValue : EnumValue("button"),
Accessibility.Type
@Generated
object ImageEnumValue : EnumValue("image"),
Accessibility.Type
@Generated
object EditTextEnumValue : EnumValue("edit_text"),
Accessibility.Type
@Generated
object HeaderEnumValue : EnumValue("header"),
Accessibility.Type
@Generated
object TabBarEnumValue : EnumValue("tab_bar"),
Accessibility.Type
@Generated
object ListEnumValue : EnumValue("list"),
Accessibility.Type
@Generated
object WormEnumValue : EnumValue("worm"),
Indicator.Animation
@Generated
object SliderEnumValue : EnumValue("slider"),
Indicator.Animation
@Generated
object MiddleEnumValue : EnumValue("middle"),
Text.Truncate
@Generated
object NoWrapEnumValue : EnumValue("no_wrap"),
Container.LayoutMode
@Generated
object WrapEnumValue : EnumValue("wrap"),
Container.LayoutMode
@Generated
object OverlapEnumValue : EnumValue("overlap"),
Container.Orientation
@Generated
object SingleLineTextEnumValue : EnumValue("single_line_text"),
Input.KeyboardType
@Generated
object MultiLineTextEnumValue : EnumValue("multi_line_text"),
Input.KeyboardType
@Generated
object PhoneEnumValue : EnumValue("phone"),
Input.KeyboardType
@Generated
object NumberEnumValue : EnumValue("number"),
Input.KeyboardType
@Generated
object EmailEnumValue : EnumValue("email"),
Input.KeyboardType
@Generated
object UriEnumValue : EnumValue("uri"),
Input.KeyboardType
val DivScope.list: ListEnumValue
get() = ListEnumValue
@Generated
val DivScope.self: SelfEnumValue
@@ -416,28 +466,16 @@ val DivScope.right: RightEnumValue
get() = RightEnumValue
@Generated
val DivScope.linear: LinearEnumValue
get() = LinearEnumValue
val DivScope.top: TopEnumValue
get() = TopEnumValue
@Generated
val DivScope.ease: EaseEnumValue
get() = EaseEnumValue
val DivScope.bottom: BottomEnumValue
get() = BottomEnumValue
@Generated
val DivScope.ease_in: EaseInEnumValue
get() = EaseInEnumValue
@Generated
val DivScope.ease_out: EaseOutEnumValue
get() = EaseOutEnumValue
@Generated
val DivScope.ease_in_out: EaseInOutEnumValue
get() = EaseInOutEnumValue
@Generated
val DivScope.spring: SpringEnumValue
get() = SpringEnumValue
val DivScope.baseline: BaselineEnumValue
get() = BaselineEnumValue
@Generated
val DivScope.fade: FadeEnumValue
@@ -464,8 +502,72 @@ val DivScope.no_animation: NoAnimationEnumValue
get() = NoAnimationEnumValue
@Generated
val DivScope.text: TextEnumValue
get() = TextEnumValue
val DivScope.linear: LinearEnumValue
get() = LinearEnumValue
@Generated
val DivScope.ease: EaseEnumValue
get() = EaseEnumValue
@Generated
val DivScope.ease_in: EaseInEnumValue
get() = EaseInEnumValue
@Generated
val DivScope.ease_out: EaseOutEnumValue
get() = EaseOutEnumValue
@Generated
val DivScope.ease_in_out: EaseInOutEnumValue
get() = EaseInOutEnumValue
@Generated
val DivScope.spring: SpringEnumValue
get() = SpringEnumValue
@Generated
val DivScope.source_in: SourceInEnumValue
get() = SourceInEnumValue
@Generated
val DivScope.source_atop: SourceAtopEnumValue
get() = SourceAtopEnumValue
@Generated
val DivScope.darken: DarkenEnumValue
get() = DarkenEnumValue
@Generated
val DivScope.lighten: LightenEnumValue
get() = LightenEnumValue
@Generated
val DivScope.multiply: MultiplyEnumValue
get() = MultiplyEnumValue
@Generated
val DivScope.screen: ScreenEnumValue
get() = ScreenEnumValue
@Generated
val DivScope.no_wrap: NoWrapEnumValue
get() = NoWrapEnumValue
@Generated
val DivScope.wrap: WrapEnumValue
get() = WrapEnumValue
@Generated
val DivScope.vertical: VerticalEnumValue
get() = VerticalEnumValue
@Generated
val DivScope.horizontal: HorizontalEnumValue
get() = HorizontalEnumValue
@Generated
val DivScope.overlap: OverlapEnumValue
get() = OverlapEnumValue
@Generated
val DivScope.display: DisplayEnumValue
@@ -487,6 +589,18 @@ val DivScope.regular: RegularEnumValue
val DivScope.bold: BoldEnumValue
get() = BoldEnumValue
@Generated
val DivScope.start: StartEnumValue
get() = StartEnumValue
@Generated
val DivScope.end: EndEnumValue
get() = EndEnumValue
@Generated
val DivScope.paging: PagingEnumValue
get() = PagingEnumValue
@Generated
val DivScope.fill: FillEnumValue
get() = FillEnumValue
@@ -500,8 +614,36 @@ val DivScope.fit: FitEnumValue
get() = FitEnumValue
@Generated
val DivScope.none: NoneEnumValue
get() = NoneEnumValue
val DivScope.worm: WormEnumValue
get() = WormEnumValue
@Generated
val DivScope.slider: SliderEnumValue
get() = SliderEnumValue
@Generated
val DivScope.single_line_text: SingleLineTextEnumValue
get() = SingleLineTextEnumValue
@Generated
val DivScope.multi_line_text: MultiLineTextEnumValue
get() = MultiLineTextEnumValue
@Generated
val DivScope.phone: PhoneEnumValue
get() = PhoneEnumValue
@Generated
val DivScope.number: NumberEnumValue
get() = NumberEnumValue
@Generated
val DivScope.email: EmailEnumValue
get() = EmailEnumValue
@Generated
val DivScope.uri: UriEnumValue
get() = UriEnumValue
@Generated
val DivScope.single: SingleEnumValue
@@ -516,12 +658,20 @@ val DivScope.partial: PartialEnumValue
get() = PartialEnumValue
@Generated
val DivScope.vertical: VerticalEnumValue
get() = VerticalEnumValue
val DivScope.nearest_corner: NearestCornerEnumValue
get() = NearestCornerEnumValue
@Generated
val DivScope.horizontal: HorizontalEnumValue
get() = HorizontalEnumValue
val DivScope.farthest_corner: FarthestCornerEnumValue
get() = FarthestCornerEnumValue
@Generated
val DivScope.nearest_side: NearestSideEnumValue
get() = NearestSideEnumValue
@Generated
val DivScope.farthest_side: FarthestSideEnumValue
get() = FarthestSideEnumValue
@Generated
val DivScope.dp: DpEnumValue
@@ -536,12 +686,12 @@ val DivScope.px: PxEnumValue
get() = PxEnumValue
@Generated
val DivScope.top: TopEnumValue
get() = TopEnumValue
val DivScope.slide: SlideEnumValue
get() = SlideEnumValue
@Generated
val DivScope.bottom: BottomEnumValue
get() = BottomEnumValue
val DivScope.middle: MiddleEnumValue
get() = MiddleEnumValue
@Generated
val DivScope.top_left: TopLeftEnumValue
@@ -594,147 +744,3 @@ val DivScope.invisible: InvisibleEnumValue
@Generated
val DivScope.gone: GoneEnumValue
get() = GoneEnumValue
@Generated
val DivScope.source_in: SourceInEnumValue
get() = SourceInEnumValue
@Generated
val DivScope.source_atop: SourceAtopEnumValue
get() = SourceAtopEnumValue
@Generated
val DivScope.darken: DarkenEnumValue
get() = DarkenEnumValue
@Generated
val DivScope.lighten: LightenEnumValue
get() = LightenEnumValue
@Generated
val DivScope.multiply: MultiplyEnumValue
get() = MultiplyEnumValue
@Generated
val DivScope.screen: ScreenEnumValue
get() = ScreenEnumValue
@Generated
val DivScope.nearest_corner: NearestCornerEnumValue
get() = NearestCornerEnumValue
@Generated
val DivScope.farthest_corner: FarthestCornerEnumValue
get() = FarthestCornerEnumValue
@Generated
val DivScope.nearest_side: NearestSideEnumValue
get() = NearestSideEnumValue
@Generated
val DivScope.farthest_side: FarthestSideEnumValue
get() = FarthestSideEnumValue
@Generated
val DivScope.slide: SlideEnumValue
get() = SlideEnumValue
@Generated
val DivScope.start: StartEnumValue
get() = StartEnumValue
@Generated
val DivScope.end: EndEnumValue
get() = EndEnumValue
@Generated
val DivScope.paging: PagingEnumValue
get() = PagingEnumValue
@Generated
val DivScope.default: DefaultEnumValue
get() = DefaultEnumValue
@Generated
val DivScope.baseline: BaselineEnumValue
get() = BaselineEnumValue
@Generated
val DivScope.merge: MergeEnumValue
get() = MergeEnumValue
@Generated
val DivScope.exclude: ExcludeEnumValue
get() = ExcludeEnumValue
@Generated
val DivScope.button: ButtonEnumValue
get() = ButtonEnumValue
@Generated
val DivScope.image: ImageEnumValue
get() = ImageEnumValue
@Generated
val DivScope.edit_text: EditTextEnumValue
get() = EditTextEnumValue
@Generated
val DivScope.header: HeaderEnumValue
get() = HeaderEnumValue
@Generated
val DivScope.tab_bar: TabBarEnumValue
get() = TabBarEnumValue
@Generated
val DivScope.list: ListEnumValue
get() = ListEnumValue
@Generated
val DivScope.worm: WormEnumValue
get() = WormEnumValue
@Generated
val DivScope.slider: SliderEnumValue
get() = SliderEnumValue
@Generated
val DivScope.middle: MiddleEnumValue
get() = MiddleEnumValue
@Generated
val DivScope.no_wrap: NoWrapEnumValue
get() = NoWrapEnumValue
@Generated
val DivScope.wrap: WrapEnumValue
get() = WrapEnumValue
@Generated
val DivScope.overlap: OverlapEnumValue
get() = OverlapEnumValue
@Generated
val DivScope.single_line_text: SingleLineTextEnumValue
get() = SingleLineTextEnumValue
@Generated
val DivScope.multi_line_text: MultiLineTextEnumValue
get() = MultiLineTextEnumValue
@Generated
val DivScope.phone: PhoneEnumValue
get() = PhoneEnumValue
@Generated
val DivScope.number: NumberEnumValue
get() = NumberEnumValue
@Generated
val DivScope.email: EmailEnumValue
get() = EmailEnumValue
@Generated
val DivScope.uri: UriEnumValue
get() = UriEnumValue
@@ -66,7 +66,7 @@ class Extension internal constructor(
@Generated
fun DivScope.extension(
`use named arguments`: Guard = Guard.instance,
id: String,
id: String? = null,
params: Map<String, Any>? = null,
): Extension = Extension(
Extension.Properties(
@@ -186,6 +186,7 @@ fun FadeTransition.defer(
/**
* @param alpha Value of the alpha channel which the element starts appearing from or at which it finishes disappearing.
* @param duration Animation duration in milliseconds.
* @param interpolator Transition speed nature.
* @param startDelay Delay in milliseconds before animation starts.
*/
@Generated
@@ -193,12 +194,13 @@ fun FadeTransition.evaluate(
`use named arguments`: Guard = Guard.instance,
alpha: ExpressionProperty<Double>? = null,
duration: ExpressionProperty<Int>? = null,
interpolator: ExpressionProperty<AnimationInterpolator>? = null,
startDelay: ExpressionProperty<Int>? = null,
): FadeTransition = FadeTransition(
FadeTransition.Properties(
alpha = alpha ?: properties.alpha,
duration = duration ?: properties.duration,
interpolator = properties.interpolator,
interpolator = interpolator ?: properties.interpolator,
startDelay = startDelay ?: properties.startDelay,
)
)
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Filter
@Generated
fun Filter.asList() = listOf(this)
@@ -61,7 +61,7 @@ class FixedCount internal constructor(
@Generated
fun DivScope.fixedCount(
`use named arguments`: Guard = Guard.instance,
value: Int,
value: Int? = null,
): FixedCount = FixedCount(
FixedCount.Properties(
value = valueOrNull(value),
@@ -127,8 +127,8 @@ class FixedLengthInputMask internal constructor(
fun DivScope.fixedLengthInputMask(
`use named arguments`: Guard = Guard.instance,
alwaysVisible: Boolean? = null,
pattern: String,
patternElements: List<FixedLengthInputMask.PatternElement>,
pattern: String? = null,
patternElements: List<FixedLengthInputMask.PatternElement>? = null,
): FixedLengthInputMask = FixedLengthInputMask(
FixedLengthInputMask.Properties(
alwaysVisible = valueOrNull(alwaysVisible),
@@ -237,7 +237,7 @@ fun FixedLengthInputMask.asList() = listOf(this)
@Generated
fun DivScope.fixedLengthInputMaskPatternElement(
`use named arguments`: Guard = Guard.instance,
key: String,
key: String? = null,
placeholder: String? = null,
regex: String? = null,
): FixedLengthInputMask.PatternElement = FixedLengthInputMask.PatternElement(
@@ -36,119 +36,121 @@ class FixedSize internal constructor(
operator fun plus(additive: Properties): FixedSize = FixedSize(
Properties(
unit = additive.unit ?: properties.unit,
value = additive.value ?: properties.value,
unit = additive.unit ?: properties.unit,
)
)
class Properties internal constructor(
/**
* Element size.
*/
val value: Property<Int>?,
/**
* Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* Default value: `dp`.
*/
val unit: Property<SizeUnit>?,
/**
* Element size.
*/
val value: Property<Int>?,
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
result.tryPutProperty("unit", unit)
result.tryPutProperty("value", value)
result.tryPutProperty("unit", unit)
return result
}
}
}
/**
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Element size.
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
*/
@Generated
fun DivScope.fixedSize(
value: Int? = null,
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Int,
): FixedSize = FixedSize(
FixedSize.Properties(
unit = valueOrNull(unit),
value = valueOrNull(value),
unit = valueOrNull(unit),
)
)
/**
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Element size.
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
*/
@Generated
fun DivScope.fixedSizeProps(
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Int? = null,
unit: SizeUnit? = null,
) = FixedSize.Properties(
unit = valueOrNull(unit),
value = valueOrNull(value),
unit = valueOrNull(unit),
)
/**
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Element size.
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
*/
@Generated
fun TemplateScope.fixedSizeRefs(
`use named arguments`: Guard = Guard.instance,
unit: ReferenceProperty<SizeUnit>? = null,
value: ReferenceProperty<Int>? = null,
unit: ReferenceProperty<SizeUnit>? = null,
) = FixedSize.Properties(
unit = unit,
value = value,
unit = unit,
)
/**
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Element size.
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
*/
@Generated
fun FixedSize.override(
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Int? = null,
unit: SizeUnit? = null,
): FixedSize = FixedSize(
FixedSize.Properties(
unit = valueOrNull(unit) ?: properties.unit,
value = valueOrNull(value) ?: properties.value,
unit = valueOrNull(unit) ?: properties.unit,
)
)
/**
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Element size.
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
*/
@Generated
fun FixedSize.defer(
`use named arguments`: Guard = Guard.instance,
unit: ReferenceProperty<SizeUnit>? = null,
value: ReferenceProperty<Int>? = null,
unit: ReferenceProperty<SizeUnit>? = null,
): FixedSize = FixedSize(
FixedSize.Properties(
unit = unit ?: properties.unit,
value = value ?: properties.value,
unit = unit ?: properties.unit,
)
)
/**
* @param value Element size.
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
*/
@Generated
fun FixedSize.evaluate(
`use named arguments`: Guard = Guard.instance,
value: ExpressionProperty<Int>? = null,
unit: ExpressionProperty<SizeUnit>? = null,
): FixedSize = FixedSize(
FixedSize.Properties(
unit = properties.unit,
value = value ?: properties.value,
unit = unit ?: properties.unit,
)
)
@@ -25,4 +25,5 @@ import kotlin.collections.Map
@Generated
sealed interface FontFamily
@Generated
fun FontFamily.asList() = listOf(this)
@@ -23,4 +23,5 @@ import kotlin.collections.Map
@Generated
sealed interface FontWeight
@Generated
fun FontWeight.asList() = listOf(this)
@@ -270,8 +270,6 @@ class Gallery internal constructor(
@Generated
sealed interface CrossContentAlignment
fun CrossContentAlignment.asList() = listOf(this)
/**
* Gallery orientation.
*
@@ -280,8 +278,6 @@ class Gallery internal constructor(
@Generated
sealed interface Orientation
fun Orientation.asList() = listOf(this)
/**
* Scroll type: `default` continuous, `paging` page-by-page.
*
@@ -289,8 +285,6 @@ class Gallery internal constructor(
*/
@Generated
sealed interface ScrollMode
fun ScrollMode.asList() = listOf(this)
}
/**
@@ -348,7 +342,7 @@ fun DivScope.gallery(
height: Size? = null,
id: String? = null,
itemSpacing: Int? = null,
items: List<Div>,
items: List<Div>? = null,
margins: EdgeInsets? = null,
orientation: Gallery.Orientation? = null,
paddings: EdgeInsets? = null,
@@ -850,37 +844,49 @@ fun Gallery.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnCount Number of columns for block layout.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param crossContentAlignment Aligning elements in the direction perpendicular to the scroll direction. In horizontal galleries:<li>`start` alignment to the top of the card;</li><li>`center` to the center;</li><li>`end` to the bottom.</li></p><p>In vertical galleries:<li>`start` alignment to the left of the card;</li><li>`center` to the center;</li><li>`end` to the right.</li>
* @param crossSpacing Spacing between elements across the scroll axis. By default, the value set to `item_spacing`.
* @param defaultItem Ordinal number of the gallery element to be scrolled to by default. For `scroll_mode`:<li>`default` the scroll position is set to the beginning of the element, without taking into account `item_spacing`;</li><li>`paging` the scroll position is set to the center of the element.</li>
* @param itemSpacing Spacing between elements.
* @param orientation Gallery orientation.
* @param restrictParentScroll If the parameter is enabled, the gallery won't transmit the scroll gesture to the parent element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param scrollMode Scroll type: `default` continuous, `paging` page-by-page.
* @param visibility Element visibility.
*/
@Generated
fun Gallery.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnCount: ExpressionProperty<Int>? = null,
columnSpan: ExpressionProperty<Int>? = null,
crossContentAlignment: ExpressionProperty<Gallery.CrossContentAlignment>? = null,
crossSpacing: ExpressionProperty<Int>? = null,
defaultItem: ExpressionProperty<Int>? = null,
itemSpacing: ExpressionProperty<Int>? = null,
orientation: ExpressionProperty<Gallery.Orientation>? = null,
restrictParentScroll: ExpressionProperty<Boolean>? = null,
rowSpan: ExpressionProperty<Int>? = null,
scrollMode: ExpressionProperty<Gallery.ScrollMode>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Gallery = Gallery(
Gallery.Properties(
accessibility = properties.accessibility,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
background = properties.background,
border = properties.border,
columnCount = columnCount ?: properties.columnCount,
columnSpan = columnSpan ?: properties.columnSpan,
crossContentAlignment = properties.crossContentAlignment,
crossContentAlignment = crossContentAlignment ?: properties.crossContentAlignment,
crossSpacing = crossSpacing ?: properties.crossSpacing,
defaultItem = defaultItem ?: properties.defaultItem,
extensions = properties.extensions,
@@ -890,11 +896,11 @@ fun Gallery.evaluate(
itemSpacing = itemSpacing ?: properties.itemSpacing,
items = properties.items,
margins = properties.margins,
orientation = properties.orientation,
orientation = orientation ?: properties.orientation,
paddings = properties.paddings,
restrictParentScroll = restrictParentScroll ?: properties.restrictParentScroll,
rowSpan = rowSpan ?: properties.rowSpan,
scrollMode = properties.scrollMode,
scrollMode = scrollMode ?: properties.scrollMode,
selectedActions = properties.selectedActions,
tooltips = properties.tooltips,
transform = properties.transform,
@@ -902,7 +908,7 @@ fun Gallery.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1136,38 +1142,50 @@ fun Component<Gallery>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnCount Number of columns for block layout.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param crossContentAlignment Aligning elements in the direction perpendicular to the scroll direction. In horizontal galleries:<li>`start` alignment to the top of the card;</li><li>`center` to the center;</li><li>`end` to the bottom.</li></p><p>In vertical galleries:<li>`start` alignment to the left of the card;</li><li>`center` to the center;</li><li>`end` to the right.</li>
* @param crossSpacing Spacing between elements across the scroll axis. By default, the value set to `item_spacing`.
* @param defaultItem Ordinal number of the gallery element to be scrolled to by default. For `scroll_mode`:<li>`default` the scroll position is set to the beginning of the element, without taking into account `item_spacing`;</li><li>`paging` the scroll position is set to the center of the element.</li>
* @param itemSpacing Spacing between elements.
* @param orientation Gallery orientation.
* @param restrictParentScroll If the parameter is enabled, the gallery won't transmit the scroll gesture to the parent element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param scrollMode Scroll type: `default` continuous, `paging` page-by-page.
* @param visibility Element visibility.
*/
@Generated
fun Component<Gallery>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnCount: ExpressionProperty<Int>? = null,
columnSpan: ExpressionProperty<Int>? = null,
crossContentAlignment: ExpressionProperty<Gallery.CrossContentAlignment>? = null,
crossSpacing: ExpressionProperty<Int>? = null,
defaultItem: ExpressionProperty<Int>? = null,
itemSpacing: ExpressionProperty<Int>? = null,
orientation: ExpressionProperty<Gallery.Orientation>? = null,
restrictParentScroll: ExpressionProperty<Boolean>? = null,
rowSpan: ExpressionProperty<Int>? = null,
scrollMode: ExpressionProperty<Gallery.ScrollMode>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Gallery> = Component(
template = template,
properties = Gallery.Properties(
accessibility = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
background = null,
border = null,
columnCount = columnCount,
columnSpan = columnSpan,
crossContentAlignment = null,
crossContentAlignment = crossContentAlignment,
crossSpacing = crossSpacing,
defaultItem = defaultItem,
extensions = null,
@@ -1177,11 +1195,11 @@ fun Component<Gallery>.evaluate(
itemSpacing = itemSpacing,
items = null,
margins = null,
orientation = null,
orientation = orientation,
paddings = null,
restrictParentScroll = restrictParentScroll,
rowSpan = rowSpan,
scrollMode = null,
scrollMode = scrollMode,
selectedActions = null,
tooltips = null,
transform = null,
@@ -1189,7 +1207,7 @@ fun Component<Gallery>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -1204,3 +1222,12 @@ operator fun Component<Gallery>.plus(additive: Gallery.Properties): Component<Ga
@Generated
fun Gallery.asList() = listOf(this)
@Generated
fun Gallery.CrossContentAlignment.asList() = listOf(this)
@Generated
fun Gallery.Orientation.asList() = listOf(this)
@Generated
fun Gallery.ScrollMode.asList() = listOf(this)
@@ -346,7 +346,7 @@ fun DivScope.gifImage(
doubletapActions: List<Action>? = null,
extensions: List<Extension>? = null,
focus: Focus? = null,
gifUrl: Url,
gifUrl: Url? = null,
height: Size? = null,
id: String? = null,
longtapActions: List<Action>? = null,
@@ -904,39 +904,51 @@ fun GifImage.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param contentAlignmentHorizontal Horizontal image alignment.
* @param contentAlignmentVertical Vertical image alignment.
* @param gifUrl Direct URL to a GIF image.
* @param placeholderColor Placeholder background before the image is loaded.
* @param preloadRequired Background image must be loaded before the display.
* @param preview Image preview encoded in `base64`. It will be shown instead of `placeholder_color` before the image is loaded. Format `data url`: `data:[;base64],<data>`
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param scale Image scaling:<li>`fit` places the entire image into the element (free space is filled with background);</li><li>`fill` scales the image to the element size and cuts off the excess.</li>
* @param visibility Element visibility.
*/
@Generated
fun GifImage.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
gifUrl: ExpressionProperty<Url>? = null,
placeholderColor: ExpressionProperty<Color>? = null,
preloadRequired: ExpressionProperty<Boolean>? = null,
preview: ExpressionProperty<String>? = null,
rowSpan: ExpressionProperty<Int>? = null,
scale: ExpressionProperty<ImageScale>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): GifImage = GifImage(
GifImage.Properties(
accessibility = properties.accessibility,
action = properties.action,
actionAnimation = properties.actionAnimation,
actions = properties.actions,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
aspect = properties.aspect,
background = properties.background,
border = properties.border,
columnSpan = columnSpan ?: properties.columnSpan,
contentAlignmentHorizontal = properties.contentAlignmentHorizontal,
contentAlignmentVertical = properties.contentAlignmentVertical,
contentAlignmentHorizontal = contentAlignmentHorizontal ?: properties.contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical ?: properties.contentAlignmentVertical,
doubletapActions = properties.doubletapActions,
extensions = properties.extensions,
focus = properties.focus,
@@ -950,7 +962,7 @@ fun GifImage.evaluate(
preloadRequired = preloadRequired ?: properties.preloadRequired,
preview = preview ?: properties.preview,
rowSpan = rowSpan ?: properties.rowSpan,
scale = properties.scale,
scale = scale ?: properties.scale,
selectedActions = properties.selectedActions,
tooltips = properties.tooltips,
transform = properties.transform,
@@ -958,7 +970,7 @@ fun GifImage.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1216,24 +1228,36 @@ fun Component<GifImage>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param contentAlignmentHorizontal Horizontal image alignment.
* @param contentAlignmentVertical Vertical image alignment.
* @param gifUrl Direct URL to a GIF image.
* @param placeholderColor Placeholder background before the image is loaded.
* @param preloadRequired Background image must be loaded before the display.
* @param preview Image preview encoded in `base64`. It will be shown instead of `placeholder_color` before the image is loaded. Format `data url`: `data:[;base64],<data>`
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param scale Image scaling:<li>`fit` places the entire image into the element (free space is filled with background);</li><li>`fill` scales the image to the element size and cuts off the excess.</li>
* @param visibility Element visibility.
*/
@Generated
fun Component<GifImage>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
gifUrl: ExpressionProperty<Url>? = null,
placeholderColor: ExpressionProperty<Color>? = null,
preloadRequired: ExpressionProperty<Boolean>? = null,
preview: ExpressionProperty<String>? = null,
rowSpan: ExpressionProperty<Int>? = null,
scale: ExpressionProperty<ImageScale>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<GifImage> = Component(
template = template,
properties = GifImage.Properties(
@@ -1241,15 +1265,15 @@ fun Component<GifImage>.evaluate(
action = null,
actionAnimation = null,
actions = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
aspect = null,
background = null,
border = null,
columnSpan = columnSpan,
contentAlignmentHorizontal = null,
contentAlignmentVertical = null,
contentAlignmentHorizontal = contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical,
doubletapActions = null,
extensions = null,
focus = null,
@@ -1263,7 +1287,7 @@ fun Component<GifImage>.evaluate(
preloadRequired = preloadRequired,
preview = preview,
rowSpan = rowSpan,
scale = null,
scale = scale,
selectedActions = null,
tooltips = null,
transform = null,
@@ -1271,7 +1295,7 @@ fun Component<GifImage>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -308,7 +308,7 @@ fun DivScope.grid(
alpha: Double? = null,
background: List<Background>? = null,
border: Border? = null,
columnCount: Int,
columnCount: Int? = null,
columnSpan: Int? = null,
contentAlignmentHorizontal: AlignmentHorizontal? = null,
contentAlignmentVertical: AlignmentVertical? = null,
@@ -317,7 +317,7 @@ fun DivScope.grid(
focus: Focus? = null,
height: Size? = null,
id: String? = null,
items: List<Div>,
items: List<Div>? = null,
longtapActions: List<Action>? = null,
margins: EdgeInsets? = null,
paddings: EdgeInsets? = null,
@@ -817,33 +817,43 @@ fun Grid.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnCount Number of columns.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param contentAlignmentHorizontal Horizontal alignment of grid contents.
* @param contentAlignmentVertical Vertical alignment of grid contents.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Grid.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnCount: ExpressionProperty<Int>? = null,
columnSpan: ExpressionProperty<Int>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Grid = Grid(
Grid.Properties(
accessibility = properties.accessibility,
action = properties.action,
actionAnimation = properties.actionAnimation,
actions = properties.actions,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
background = properties.background,
border = properties.border,
columnCount = columnCount ?: properties.columnCount,
columnSpan = columnSpan ?: properties.columnSpan,
contentAlignmentHorizontal = properties.contentAlignmentHorizontal,
contentAlignmentVertical = properties.contentAlignmentVertical,
contentAlignmentHorizontal = contentAlignmentHorizontal ?: properties.contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical ?: properties.contentAlignmentVertical,
doubletapActions = properties.doubletapActions,
extensions = properties.extensions,
focus = properties.focus,
@@ -861,7 +871,7 @@ fun Grid.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1095,18 +1105,28 @@ fun Component<Grid>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnCount Number of columns.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param contentAlignmentHorizontal Horizontal alignment of grid contents.
* @param contentAlignmentVertical Vertical alignment of grid contents.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Component<Grid>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnCount: ExpressionProperty<Int>? = null,
columnSpan: ExpressionProperty<Int>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Grid> = Component(
template = template,
properties = Grid.Properties(
@@ -1114,15 +1134,15 @@ fun Component<Grid>.evaluate(
action = null,
actionAnimation = null,
actions = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
background = null,
border = null,
columnCount = columnCount,
columnSpan = columnSpan,
contentAlignmentHorizontal = null,
contentAlignmentVertical = null,
contentAlignmentHorizontal = contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical,
doubletapActions = null,
extensions = null,
focus = null,
@@ -1140,7 +1160,7 @@ fun Component<Grid>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -36,6 +36,7 @@ class Image internal constructor(
operator fun plus(additive: Properties): Image = Image(
Properties(
imageUrl = additive.imageUrl ?: properties.imageUrl,
accessibility = additive.accessibility ?: properties.accessibility,
action = additive.action ?: properties.action,
actionAnimation = additive.actionAnimation ?: properties.actionAnimation,
@@ -57,7 +58,6 @@ class Image internal constructor(
height = additive.height ?: properties.height,
highPriorityPreviewShow = additive.highPriorityPreviewShow ?: properties.highPriorityPreviewShow,
id = additive.id ?: properties.id,
imageUrl = additive.imageUrl ?: properties.imageUrl,
longtapActions = additive.longtapActions ?: properties.longtapActions,
margins = additive.margins ?: properties.margins,
paddings = additive.paddings ?: properties.paddings,
@@ -83,6 +83,10 @@ class Image internal constructor(
)
class Properties internal constructor(
/**
* Direct URL to an image.
*/
val imageUrl: Property<Url>?,
/**
* Accessibility settings.
*/
@@ -173,10 +177,6 @@ class Image internal constructor(
* Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
*/
val id: Property<String>?,
/**
* Direct URL to an image.
*/
val imageUrl: Property<Url>?,
/**
* Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
*/
@@ -271,6 +271,7 @@ class Image internal constructor(
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
result.tryPutProperty("image_url", imageUrl)
result.tryPutProperty("accessibility", accessibility)
result.tryPutProperty("action", action)
result.tryPutProperty("action_animation", actionAnimation)
@@ -292,7 +293,6 @@ class Image internal constructor(
result.tryPutProperty("height", height)
result.tryPutProperty("high_priority_preview_show", highPriorityPreviewShow)
result.tryPutProperty("id", id)
result.tryPutProperty("image_url", imageUrl)
result.tryPutProperty("longtap_actions", longtapActions)
result.tryPutProperty("margins", margins)
result.tryPutProperty("paddings", paddings)
@@ -320,6 +320,7 @@ class Image internal constructor(
}
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -341,7 +342,6 @@ class Image internal constructor(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -366,6 +366,7 @@ class Image internal constructor(
*/
@Generated
fun DivScope.image(
imageUrl: Url? = null,
`use named arguments`: Guard = Guard.instance,
accessibility: Accessibility? = null,
action: Action? = null,
@@ -388,7 +389,6 @@ fun DivScope.image(
height: Size? = null,
highPriorityPreviewShow: Boolean? = null,
id: String? = null,
imageUrl: Url,
longtapActions: List<Action>? = null,
margins: EdgeInsets? = null,
paddings: EdgeInsets? = null,
@@ -412,6 +412,7 @@ fun DivScope.image(
width: Size? = null,
): Image = Image(
Image.Properties(
imageUrl = valueOrNull(imageUrl),
accessibility = valueOrNull(accessibility),
action = valueOrNull(action),
actionAnimation = valueOrNull(actionAnimation),
@@ -433,7 +434,6 @@ fun DivScope.image(
height = valueOrNull(height),
highPriorityPreviewShow = valueOrNull(highPriorityPreviewShow),
id = valueOrNull(id),
imageUrl = valueOrNull(imageUrl),
longtapActions = valueOrNull(longtapActions),
margins = valueOrNull(margins),
paddings = valueOrNull(paddings),
@@ -459,6 +459,7 @@ fun DivScope.image(
)
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -480,7 +481,6 @@ fun DivScope.image(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -506,6 +506,7 @@ fun DivScope.image(
@Generated
fun DivScope.imageProps(
`use named arguments`: Guard = Guard.instance,
imageUrl: Url? = null,
accessibility: Accessibility? = null,
action: Action? = null,
actionAnimation: Animation? = null,
@@ -527,7 +528,6 @@ fun DivScope.imageProps(
height: Size? = null,
highPriorityPreviewShow: Boolean? = null,
id: String? = null,
imageUrl: Url? = null,
longtapActions: List<Action>? = null,
margins: EdgeInsets? = null,
paddings: EdgeInsets? = null,
@@ -550,6 +550,7 @@ fun DivScope.imageProps(
visibilityActions: List<VisibilityAction>? = null,
width: Size? = null,
) = Image.Properties(
imageUrl = valueOrNull(imageUrl),
accessibility = valueOrNull(accessibility),
action = valueOrNull(action),
actionAnimation = valueOrNull(actionAnimation),
@@ -571,7 +572,6 @@ fun DivScope.imageProps(
height = valueOrNull(height),
highPriorityPreviewShow = valueOrNull(highPriorityPreviewShow),
id = valueOrNull(id),
imageUrl = valueOrNull(imageUrl),
longtapActions = valueOrNull(longtapActions),
margins = valueOrNull(margins),
paddings = valueOrNull(paddings),
@@ -596,6 +596,7 @@ fun DivScope.imageProps(
)
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -617,7 +618,6 @@ fun DivScope.imageProps(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -643,6 +643,7 @@ fun DivScope.imageProps(
@Generated
fun TemplateScope.imageRefs(
`use named arguments`: Guard = Guard.instance,
imageUrl: ReferenceProperty<Url>? = null,
accessibility: ReferenceProperty<Accessibility>? = null,
action: ReferenceProperty<Action>? = null,
actionAnimation: ReferenceProperty<Animation>? = null,
@@ -664,7 +665,6 @@ fun TemplateScope.imageRefs(
height: ReferenceProperty<Size>? = null,
highPriorityPreviewShow: ReferenceProperty<Boolean>? = null,
id: ReferenceProperty<String>? = null,
imageUrl: ReferenceProperty<Url>? = null,
longtapActions: ReferenceProperty<List<Action>>? = null,
margins: ReferenceProperty<EdgeInsets>? = null,
paddings: ReferenceProperty<EdgeInsets>? = null,
@@ -687,6 +687,7 @@ fun TemplateScope.imageRefs(
visibilityActions: ReferenceProperty<List<VisibilityAction>>? = null,
width: ReferenceProperty<Size>? = null,
) = Image.Properties(
imageUrl = imageUrl,
accessibility = accessibility,
action = action,
actionAnimation = actionAnimation,
@@ -708,7 +709,6 @@ fun TemplateScope.imageRefs(
height = height,
highPriorityPreviewShow = highPriorityPreviewShow,
id = id,
imageUrl = imageUrl,
longtapActions = longtapActions,
margins = margins,
paddings = paddings,
@@ -733,6 +733,7 @@ fun TemplateScope.imageRefs(
)
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -754,7 +755,6 @@ fun TemplateScope.imageRefs(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -780,6 +780,7 @@ fun TemplateScope.imageRefs(
@Generated
fun Image.override(
`use named arguments`: Guard = Guard.instance,
imageUrl: Url? = null,
accessibility: Accessibility? = null,
action: Action? = null,
actionAnimation: Animation? = null,
@@ -801,7 +802,6 @@ fun Image.override(
height: Size? = null,
highPriorityPreviewShow: Boolean? = null,
id: String? = null,
imageUrl: Url? = null,
longtapActions: List<Action>? = null,
margins: EdgeInsets? = null,
paddings: EdgeInsets? = null,
@@ -825,6 +825,7 @@ fun Image.override(
width: Size? = null,
): Image = Image(
Image.Properties(
imageUrl = valueOrNull(imageUrl) ?: properties.imageUrl,
accessibility = valueOrNull(accessibility) ?: properties.accessibility,
action = valueOrNull(action) ?: properties.action,
actionAnimation = valueOrNull(actionAnimation) ?: properties.actionAnimation,
@@ -846,7 +847,6 @@ fun Image.override(
height = valueOrNull(height) ?: properties.height,
highPriorityPreviewShow = valueOrNull(highPriorityPreviewShow) ?: properties.highPriorityPreviewShow,
id = valueOrNull(id) ?: properties.id,
imageUrl = valueOrNull(imageUrl) ?: properties.imageUrl,
longtapActions = valueOrNull(longtapActions) ?: properties.longtapActions,
margins = valueOrNull(margins) ?: properties.margins,
paddings = valueOrNull(paddings) ?: properties.paddings,
@@ -872,6 +872,7 @@ fun Image.override(
)
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -893,7 +894,6 @@ fun Image.override(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -919,6 +919,7 @@ fun Image.override(
@Generated
fun Image.defer(
`use named arguments`: Guard = Guard.instance,
imageUrl: ReferenceProperty<Url>? = null,
accessibility: ReferenceProperty<Accessibility>? = null,
action: ReferenceProperty<Action>? = null,
actionAnimation: ReferenceProperty<Animation>? = null,
@@ -940,7 +941,6 @@ fun Image.defer(
height: ReferenceProperty<Size>? = null,
highPriorityPreviewShow: ReferenceProperty<Boolean>? = null,
id: ReferenceProperty<String>? = null,
imageUrl: ReferenceProperty<Url>? = null,
longtapActions: ReferenceProperty<List<Action>>? = null,
margins: ReferenceProperty<EdgeInsets>? = null,
paddings: ReferenceProperty<EdgeInsets>? = null,
@@ -964,6 +964,7 @@ fun Image.defer(
width: ReferenceProperty<Size>? = null,
): Image = Image(
Image.Properties(
imageUrl = imageUrl ?: properties.imageUrl,
accessibility = accessibility ?: properties.accessibility,
action = action ?: properties.action,
actionAnimation = actionAnimation ?: properties.actionAnimation,
@@ -985,7 +986,6 @@ fun Image.defer(
height = height ?: properties.height,
highPriorityPreviewShow = highPriorityPreviewShow ?: properties.highPriorityPreviewShow,
id = id ?: properties.id,
imageUrl = imageUrl ?: properties.imageUrl,
longtapActions = longtapActions ?: properties.longtapActions,
margins = margins ?: properties.margins,
paddings = paddings ?: properties.paddings,
@@ -1011,44 +1011,59 @@ fun Image.defer(
)
/**
* @param imageUrl Direct URL to an image.
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param contentAlignmentHorizontal Horizontal image alignment.
* @param contentAlignmentVertical Vertical image alignment.
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param imageUrl Direct URL to an image.
* @param placeholderColor Placeholder background before the image is loaded.
* @param preloadRequired Background image must be loaded before the display.
* @param preview Image preview encoded in `base64`. It will be shown instead of `placeholder_color` before the image is loaded. Format `data url`: `data:[;base64],<data>`
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param scale Image scaling:<li>`fit` places the entire image into the element (free space is filled with background);</li><li>`fill` scales the image to the element size and cuts off the excess.</li>
* @param tintColor New color of a contour image.
* @param tintMode Blend mode of the color specified in `tint_color`.
* @param visibility Element visibility.
*/
@Generated
fun Image.evaluate(
`use named arguments`: Guard = Guard.instance,
imageUrl: ExpressionProperty<Url>? = null,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
highPriorityPreviewShow: ExpressionProperty<Boolean>? = null,
imageUrl: ExpressionProperty<Url>? = null,
placeholderColor: ExpressionProperty<Color>? = null,
preloadRequired: ExpressionProperty<Boolean>? = null,
preview: ExpressionProperty<String>? = null,
rowSpan: ExpressionProperty<Int>? = null,
scale: ExpressionProperty<ImageScale>? = null,
tintColor: ExpressionProperty<Color>? = null,
tintMode: ExpressionProperty<BlendMode>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Image = Image(
Image.Properties(
imageUrl = imageUrl ?: properties.imageUrl,
accessibility = properties.accessibility,
action = properties.action,
actionAnimation = properties.actionAnimation,
actions = properties.actions,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
appearanceAnimation = properties.appearanceAnimation,
aspect = properties.aspect,
background = properties.background,
border = properties.border,
columnSpan = columnSpan ?: properties.columnSpan,
contentAlignmentHorizontal = properties.contentAlignmentHorizontal,
contentAlignmentVertical = properties.contentAlignmentVertical,
contentAlignmentHorizontal = contentAlignmentHorizontal ?: properties.contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical ?: properties.contentAlignmentVertical,
doubletapActions = properties.doubletapActions,
extensions = properties.extensions,
filters = properties.filters,
@@ -1056,7 +1071,6 @@ fun Image.evaluate(
height = properties.height,
highPriorityPreviewShow = highPriorityPreviewShow ?: properties.highPriorityPreviewShow,
id = properties.id,
imageUrl = imageUrl ?: properties.imageUrl,
longtapActions = properties.longtapActions,
margins = properties.margins,
paddings = properties.paddings,
@@ -1064,17 +1078,17 @@ fun Image.evaluate(
preloadRequired = preloadRequired ?: properties.preloadRequired,
preview = preview ?: properties.preview,
rowSpan = rowSpan ?: properties.rowSpan,
scale = properties.scale,
scale = scale ?: properties.scale,
selectedActions = properties.selectedActions,
tintColor = tintColor ?: properties.tintColor,
tintMode = properties.tintMode,
tintMode = tintMode ?: properties.tintMode,
tooltips = properties.tooltips,
transform = properties.transform,
transitionChange = properties.transitionChange,
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1082,6 +1096,7 @@ fun Image.evaluate(
)
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -1103,7 +1118,6 @@ fun Image.evaluate(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -1129,6 +1143,7 @@ fun Image.evaluate(
@Generated
fun Component<Image>.override(
`use named arguments`: Guard = Guard.instance,
imageUrl: Url? = null,
accessibility: Accessibility? = null,
action: Action? = null,
actionAnimation: Animation? = null,
@@ -1150,7 +1165,6 @@ fun Component<Image>.override(
height: Size? = null,
highPriorityPreviewShow: Boolean? = null,
id: String? = null,
imageUrl: Url? = null,
longtapActions: List<Action>? = null,
margins: EdgeInsets? = null,
paddings: EdgeInsets? = null,
@@ -1175,6 +1189,7 @@ fun Component<Image>.override(
): Component<Image> = Component(
template = template,
properties = Image.Properties(
imageUrl = valueOrNull(imageUrl),
accessibility = valueOrNull(accessibility),
action = valueOrNull(action),
actionAnimation = valueOrNull(actionAnimation),
@@ -1196,7 +1211,6 @@ fun Component<Image>.override(
height = valueOrNull(height),
highPriorityPreviewShow = valueOrNull(highPriorityPreviewShow),
id = valueOrNull(id),
imageUrl = valueOrNull(imageUrl),
longtapActions = valueOrNull(longtapActions),
margins = valueOrNull(margins),
paddings = valueOrNull(paddings),
@@ -1222,6 +1236,7 @@ fun Component<Image>.override(
)
/**
* @param imageUrl Direct URL to an image.
* @param accessibility Accessibility settings.
* @param action One action when clicking on an element. Not used if the `actions` parameter is set.
* @param actionAnimation Click animation. The web only supports the following values: `fade`, `scale`, and `set`.
@@ -1243,7 +1258,6 @@ fun Component<Image>.override(
* @param height Element height. For Android: if there is text in this or in a child element, specify height in `sp` to scale the element together with the text. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param imageUrl Direct URL to an image.
* @param longtapActions Action when long-clicking an element. Doesn't work on devices that don't support touch gestures.
* @param margins External margins from the element stroke.
* @param paddings Internal margins from the element stroke.
@@ -1269,6 +1283,7 @@ fun Component<Image>.override(
@Generated
fun Component<Image>.defer(
`use named arguments`: Guard = Guard.instance,
imageUrl: ReferenceProperty<Url>? = null,
accessibility: ReferenceProperty<Accessibility>? = null,
action: ReferenceProperty<Action>? = null,
actionAnimation: ReferenceProperty<Animation>? = null,
@@ -1290,7 +1305,6 @@ fun Component<Image>.defer(
height: ReferenceProperty<Size>? = null,
highPriorityPreviewShow: ReferenceProperty<Boolean>? = null,
id: ReferenceProperty<String>? = null,
imageUrl: ReferenceProperty<Url>? = null,
longtapActions: ReferenceProperty<List<Action>>? = null,
margins: ReferenceProperty<EdgeInsets>? = null,
paddings: ReferenceProperty<EdgeInsets>? = null,
@@ -1315,6 +1329,7 @@ fun Component<Image>.defer(
): Component<Image> = Component(
template = template,
properties = Image.Properties(
imageUrl = imageUrl,
accessibility = accessibility,
action = action,
actionAnimation = actionAnimation,
@@ -1336,7 +1351,6 @@ fun Component<Image>.defer(
height = height,
highPriorityPreviewShow = highPriorityPreviewShow,
id = id,
imageUrl = imageUrl,
longtapActions = longtapActions,
margins = margins,
paddings = paddings,
@@ -1362,45 +1376,60 @@ fun Component<Image>.defer(
)
/**
* @param imageUrl Direct URL to an image.
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param contentAlignmentHorizontal Horizontal image alignment.
* @param contentAlignmentVertical Vertical image alignment.
* @param highPriorityPreviewShow It sets the priority of displaying the preview the preview is decoded in the main stream and displayed as the first frame. Use the parameter carefully it will worsen the preview display time and can worsen the application launch time.
* @param imageUrl Direct URL to an image.
* @param placeholderColor Placeholder background before the image is loaded.
* @param preloadRequired Background image must be loaded before the display.
* @param preview Image preview encoded in `base64`. It will be shown instead of `placeholder_color` before the image is loaded. Format `data url`: `data:[;base64],<data>`
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param scale Image scaling:<li>`fit` places the entire image into the element (free space is filled with background);</li><li>`fill` scales the image to the element size and cuts off the excess.</li>
* @param tintColor New color of a contour image.
* @param tintMode Blend mode of the color specified in `tint_color`.
* @param visibility Element visibility.
*/
@Generated
fun Component<Image>.evaluate(
`use named arguments`: Guard = Guard.instance,
imageUrl: ExpressionProperty<Url>? = null,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
highPriorityPreviewShow: ExpressionProperty<Boolean>? = null,
imageUrl: ExpressionProperty<Url>? = null,
placeholderColor: ExpressionProperty<Color>? = null,
preloadRequired: ExpressionProperty<Boolean>? = null,
preview: ExpressionProperty<String>? = null,
rowSpan: ExpressionProperty<Int>? = null,
scale: ExpressionProperty<ImageScale>? = null,
tintColor: ExpressionProperty<Color>? = null,
tintMode: ExpressionProperty<BlendMode>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Image> = Component(
template = template,
properties = Image.Properties(
imageUrl = imageUrl,
accessibility = null,
action = null,
actionAnimation = null,
actions = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
appearanceAnimation = null,
aspect = null,
background = null,
border = null,
columnSpan = columnSpan,
contentAlignmentHorizontal = null,
contentAlignmentVertical = null,
contentAlignmentHorizontal = contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical,
doubletapActions = null,
extensions = null,
filters = null,
@@ -1408,7 +1437,6 @@ fun Component<Image>.evaluate(
height = null,
highPriorityPreviewShow = highPriorityPreviewShow,
id = null,
imageUrl = imageUrl,
longtapActions = null,
margins = null,
paddings = null,
@@ -1416,17 +1444,17 @@ fun Component<Image>.evaluate(
preloadRequired = preloadRequired,
preview = preview,
rowSpan = rowSpan,
scale = null,
scale = scale,
selectedActions = null,
tintColor = tintColor,
tintMode = null,
tintMode = tintMode,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -112,7 +112,7 @@ fun DivScope.imageBackground(
contentAlignmentHorizontal: AlignmentHorizontal? = null,
contentAlignmentVertical: AlignmentVertical? = null,
filters: List<Filter>? = null,
imageUrl: Url,
imageUrl: Url? = null,
preloadRequired: Boolean? = null,
scale: ImageScale? = null,
): ImageBackground = ImageBackground(
@@ -249,24 +249,30 @@ fun ImageBackground.defer(
/**
* @param alpha Image transparency.
* @param contentAlignmentHorizontal Horizontal image alignment.
* @param contentAlignmentVertical Vertical image alignment.
* @param imageUrl Image URL.
* @param preloadRequired Background image must be loaded before the display.
* @param scale Image scaling.
*/
@Generated
fun ImageBackground.evaluate(
`use named arguments`: Guard = Guard.instance,
alpha: ExpressionProperty<Double>? = null,
contentAlignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
contentAlignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
imageUrl: ExpressionProperty<Url>? = null,
preloadRequired: ExpressionProperty<Boolean>? = null,
scale: ExpressionProperty<ImageScale>? = null,
): ImageBackground = ImageBackground(
ImageBackground.Properties(
alpha = alpha ?: properties.alpha,
contentAlignmentHorizontal = properties.contentAlignmentHorizontal,
contentAlignmentVertical = properties.contentAlignmentVertical,
contentAlignmentHorizontal = contentAlignmentHorizontal ?: properties.contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical ?: properties.contentAlignmentVertical,
filters = properties.filters,
imageUrl = imageUrl ?: properties.imageUrl,
preloadRequired = preloadRequired ?: properties.preloadRequired,
scale = properties.scale,
scale = scale ?: properties.scale,
)
)
@@ -23,4 +23,5 @@ import kotlin.collections.Map
@Generated
sealed interface ImageScale
@Generated
fun ImageScale.asList() = listOf(this)
@@ -85,11 +85,13 @@ class Indicator internal constructor(
* Active indicator color.
* Default value: `#ffdc60`.
*/
@Deprecated("Marked as deprecated in json schema")
val activeItemColor: Property<Color>?,
/**
* A size multiplier for an active indicator.
* Default value: `1.3`.
*/
@Deprecated("Marked as deprecated in json schema")
val activeItemSize: Property<Double>?,
/**
* Active indicator shape.
@@ -146,6 +148,7 @@ class Indicator internal constructor(
* Indicator color.
* Default value: `#33919cb5`.
*/
@Deprecated("Marked as deprecated in json schema")
val inactiveItemColor: Property<Color>?,
/**
* Inactive indicator shape, minimum size. Used when all the indicators don't fit on the screen.
@@ -167,6 +170,7 @@ class Indicator internal constructor(
* A size multiplier for a minimal indicator. It is used when the required number of indicators don't fit on the screen.
* Default value: `0.5`.
*/
@Deprecated("Marked as deprecated in json schema")
val minimumItemSize: Property<Double>?,
/**
* Internal margins from the element stroke.
@@ -188,11 +192,13 @@ class Indicator internal constructor(
* Indicator shape.
* Default value: `{"type":"rounded_rectangle"}`.
*/
@Deprecated("Marked as deprecated in json schema")
val shape: Property<Shape>?,
/**
* Spacing between indicator centers.
* Default value: `{"type": "fixed","value":15}`.
*/
@Deprecated("Marked as deprecated in json schema")
val spaceBetweenCenters: Property<FixedSize>?,
/**
* Tooltips linked to an element. A tooltip can be shown by `div-action://show_tooltip?id=`, hidden by `div-action://hide_tooltip?id=` where `id` — tooltip id.
@@ -288,8 +294,6 @@ class Indicator internal constructor(
*/
@Generated
sealed interface Animation
fun Animation.asList() = listOf(this)
}
/**
@@ -896,32 +900,40 @@ fun Indicator.defer(
/**
* @param activeItemColor Active indicator color.
* @param activeItemSize A size multiplier for an active indicator.
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param animation Animation of switching between indicators.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param inactiveItemColor Indicator color.
* @param minimumItemSize A size multiplier for a minimal indicator. It is used when the required number of indicators don't fit on the screen.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Indicator.evaluate(
`use named arguments`: Guard = Guard.instance,
activeItemColor: ExpressionProperty<Color>? = null,
activeItemSize: ExpressionProperty<Double>? = null,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
animation: ExpressionProperty<Indicator.Animation>? = null,
columnSpan: ExpressionProperty<Int>? = null,
inactiveItemColor: ExpressionProperty<Color>? = null,
minimumItemSize: ExpressionProperty<Double>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Indicator = Indicator(
Indicator.Properties(
accessibility = properties.accessibility,
activeItemColor = activeItemColor ?: properties.activeItemColor,
activeItemSize = activeItemSize ?: properties.activeItemSize,
activeShape = properties.activeShape,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
animation = properties.animation,
animation = animation ?: properties.animation,
background = properties.background,
border = properties.border,
columnSpan = columnSpan ?: properties.columnSpan,
@@ -947,7 +959,7 @@ fun Indicator.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1201,22 +1213,30 @@ fun Component<Indicator>.defer(
/**
* @param activeItemColor Active indicator color.
* @param activeItemSize A size multiplier for an active indicator.
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param animation Animation of switching between indicators.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param inactiveItemColor Indicator color.
* @param minimumItemSize A size multiplier for a minimal indicator. It is used when the required number of indicators don't fit on the screen.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Component<Indicator>.evaluate(
`use named arguments`: Guard = Guard.instance,
activeItemColor: ExpressionProperty<Color>? = null,
activeItemSize: ExpressionProperty<Double>? = null,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
animation: ExpressionProperty<Indicator.Animation>? = null,
columnSpan: ExpressionProperty<Int>? = null,
inactiveItemColor: ExpressionProperty<Color>? = null,
minimumItemSize: ExpressionProperty<Double>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Indicator> = Component(
template = template,
properties = Indicator.Properties(
@@ -1224,10 +1244,10 @@ fun Component<Indicator>.evaluate(
activeItemColor = activeItemColor,
activeItemSize = activeItemSize,
activeShape = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
animation = null,
animation = animation,
background = null,
border = null,
columnSpan = columnSpan,
@@ -1253,7 +1273,7 @@ fun Component<Indicator>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -1268,3 +1288,6 @@ operator fun Component<Indicator>.plus(additive: Indicator.Properties): Componen
@Generated
fun Indicator.asList() = listOf(this)
@Generated
fun Indicator.Animation.asList() = listOf(this)
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface IndicatorItemPlacement
@Generated
fun IndicatorItemPlacement.asList() = listOf(this)
@@ -25,65 +25,13 @@ import kotlin.collections.Map
* Required properties: `type`.
*/
@Generated
class InfinityCount internal constructor(
@JsonIgnore
val properties: Properties,
) : Count {
object InfinityCount : Count {
@JsonAnyGetter
internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(
mapOf("type" to "infinity")
)
operator fun plus(additive: Properties): InfinityCount = InfinityCount(
Properties(
)
)
class Properties internal constructor(
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
return result
}
}
internal fun getJsonProperties(): Map<String, Any> = mapOf("type" to "infinity")
}
@Generated
fun DivScope.infinityCount(
): InfinityCount = InfinityCount(
InfinityCount.Properties(
)
)
@Generated
fun DivScope.infinityCountProps(
) = InfinityCount.Properties(
)
@Generated
fun TemplateScope.infinityCountRefs(
`use named arguments`: Guard = Guard.instance,
) = InfinityCount.Properties(
)
@Generated
fun InfinityCount.override(
): InfinityCount = InfinityCount(
InfinityCount.Properties(
)
)
@Generated
fun InfinityCount.defer(
`use named arguments`: Guard = Guard.instance,
): InfinityCount = InfinityCount(
InfinityCount.Properties(
)
)
fun DivScope.infinityCount(): InfinityCount = InfinityCount
@Generated
fun InfinityCount.asList() = listOf(this)
@@ -54,6 +54,7 @@ class Input internal constructor(
hintColor = additive.hintColor ?: properties.hintColor,
hintText = additive.hintText ?: properties.hintText,
id = additive.id ?: properties.id,
inputMethod = additive.inputMethod ?: properties.inputMethod,
keyboardType = additive.keyboardType ?: properties.keyboardType,
letterSpacing = additive.letterSpacing ?: properties.letterSpacing,
lineHeight = additive.lineHeight ?: properties.lineHeight,
@@ -160,10 +161,15 @@ class Input internal constructor(
* Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
*/
val id: Property<String>?,
/**
* Data entry method. If nothing is specified, the value will be taken from keyboard_type.
*/
val inputMethod: Property<InputMethod>?,
/**
* Keyboard type.
* Default value: `multi_line_text`.
*/
@Deprecated("Marked as deprecated in json schema")
val keyboardType: Property<KeyboardType>?,
/**
* Spacing between characters.
@@ -280,6 +286,7 @@ class Input internal constructor(
result.tryPutProperty("hint_color", hintColor)
result.tryPutProperty("hint_text", hintText)
result.tryPutProperty("id", id)
result.tryPutProperty("input_method", inputMethod)
result.tryPutProperty("keyboard_type", keyboardType)
result.tryPutProperty("letter_spacing", letterSpacing)
result.tryPutProperty("line_height", lineHeight)
@@ -315,8 +322,6 @@ class Input internal constructor(
@Generated
sealed interface KeyboardType
fun KeyboardType.asList() = listOf(this)
/**
* Text input line used in the native interface.
*
@@ -374,6 +379,7 @@ class Input internal constructor(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -419,6 +425,7 @@ fun DivScope.input(
hintColor: Color? = null,
hintText: String? = null,
id: String? = null,
inputMethod: InputMethod? = null,
keyboardType: Input.KeyboardType? = null,
letterSpacing: Double? = null,
lineHeight: Int? = null,
@@ -431,7 +438,7 @@ fun DivScope.input(
selectAllOnFocus: Boolean? = null,
selectedActions: List<Action>? = null,
textColor: Color? = null,
textVariable: String,
textVariable: String? = null,
tooltips: List<Tooltip>? = null,
transform: Transform? = null,
transitionChange: ChangeTransition? = null,
@@ -462,6 +469,7 @@ fun DivScope.input(
hintColor = valueOrNull(hintColor),
hintText = valueOrNull(hintText),
id = valueOrNull(id),
inputMethod = valueOrNull(inputMethod),
keyboardType = valueOrNull(keyboardType),
letterSpacing = valueOrNull(letterSpacing),
lineHeight = valueOrNull(lineHeight),
@@ -507,6 +515,7 @@ fun DivScope.input(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -552,6 +561,7 @@ fun DivScope.inputProps(
hintColor: Color? = null,
hintText: String? = null,
id: String? = null,
inputMethod: InputMethod? = null,
keyboardType: Input.KeyboardType? = null,
letterSpacing: Double? = null,
lineHeight: Int? = null,
@@ -594,6 +604,7 @@ fun DivScope.inputProps(
hintColor = valueOrNull(hintColor),
hintText = valueOrNull(hintText),
id = valueOrNull(id),
inputMethod = valueOrNull(inputMethod),
keyboardType = valueOrNull(keyboardType),
letterSpacing = valueOrNull(letterSpacing),
lineHeight = valueOrNull(lineHeight),
@@ -638,6 +649,7 @@ fun DivScope.inputProps(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -683,6 +695,7 @@ fun TemplateScope.inputRefs(
hintColor: ReferenceProperty<Color>? = null,
hintText: ReferenceProperty<String>? = null,
id: ReferenceProperty<String>? = null,
inputMethod: ReferenceProperty<InputMethod>? = null,
keyboardType: ReferenceProperty<Input.KeyboardType>? = null,
letterSpacing: ReferenceProperty<Double>? = null,
lineHeight: ReferenceProperty<Int>? = null,
@@ -725,6 +738,7 @@ fun TemplateScope.inputRefs(
hintColor = hintColor,
hintText = hintText,
id = id,
inputMethod = inputMethod,
keyboardType = keyboardType,
letterSpacing = letterSpacing,
lineHeight = lineHeight,
@@ -769,6 +783,7 @@ fun TemplateScope.inputRefs(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -814,6 +829,7 @@ fun Input.override(
hintColor: Color? = null,
hintText: String? = null,
id: String? = null,
inputMethod: InputMethod? = null,
keyboardType: Input.KeyboardType? = null,
letterSpacing: Double? = null,
lineHeight: Int? = null,
@@ -857,6 +873,7 @@ fun Input.override(
hintColor = valueOrNull(hintColor) ?: properties.hintColor,
hintText = valueOrNull(hintText) ?: properties.hintText,
id = valueOrNull(id) ?: properties.id,
inputMethod = valueOrNull(inputMethod) ?: properties.inputMethod,
keyboardType = valueOrNull(keyboardType) ?: properties.keyboardType,
letterSpacing = valueOrNull(letterSpacing) ?: properties.letterSpacing,
lineHeight = valueOrNull(lineHeight) ?: properties.lineHeight,
@@ -902,6 +919,7 @@ fun Input.override(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -947,6 +965,7 @@ fun Input.defer(
hintColor: ReferenceProperty<Color>? = null,
hintText: ReferenceProperty<String>? = null,
id: ReferenceProperty<String>? = null,
inputMethod: ReferenceProperty<InputMethod>? = null,
keyboardType: ReferenceProperty<Input.KeyboardType>? = null,
letterSpacing: ReferenceProperty<Double>? = null,
lineHeight: ReferenceProperty<Int>? = null,
@@ -990,6 +1009,7 @@ fun Input.defer(
hintColor = hintColor ?: properties.hintColor,
hintText = hintText ?: properties.hintText,
id = id ?: properties.id,
inputMethod = inputMethod ?: properties.inputMethod,
keyboardType = keyboardType ?: properties.keyboardType,
letterSpacing = letterSpacing ?: properties.letterSpacing,
lineHeight = lineHeight ?: properties.lineHeight,
@@ -1017,55 +1037,70 @@ fun Input.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param fontFamily Font family:<li>`text` a standard text font;</li><li>`display` a family of fonts with a large font size.</li>
* @param fontSize Font size.
* @param fontSizeUnit Unit of measurement:<li>`px` a physical pixel.</li><li>`dp` a logical pixel that doesn't depend on screen density.</li><li>`sp` a logical pixel that depends on the font size on a device. Specify height in `sp`. Only available on Android.</li>
* @param fontWeight Style.
* @param highlightColor Text highlight color. If the value isn't set, the color set in the client will be used instead.
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
* @param maxVisibleLines Maximum number of lines to be displayed in the input field.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param selectAllOnFocus Highlighting input text when focused.
* @param textColor Text color.
* @param visibility Element visibility.
*/
@Generated
fun Input.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
fontFamily: ExpressionProperty<FontFamily>? = null,
fontSize: ExpressionProperty<Int>? = null,
fontSizeUnit: ExpressionProperty<SizeUnit>? = null,
fontWeight: ExpressionProperty<FontWeight>? = null,
highlightColor: ExpressionProperty<Color>? = null,
hintColor: ExpressionProperty<Color>? = null,
hintText: ExpressionProperty<String>? = null,
keyboardType: ExpressionProperty<Input.KeyboardType>? = null,
letterSpacing: ExpressionProperty<Double>? = null,
lineHeight: ExpressionProperty<Int>? = null,
maxVisibleLines: ExpressionProperty<Int>? = null,
rowSpan: ExpressionProperty<Int>? = null,
selectAllOnFocus: ExpressionProperty<Boolean>? = null,
textColor: ExpressionProperty<Color>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Input = Input(
Input.Properties(
accessibility = properties.accessibility,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
background = properties.background,
border = properties.border,
columnSpan = columnSpan ?: properties.columnSpan,
extensions = properties.extensions,
focus = properties.focus,
fontFamily = properties.fontFamily,
fontFamily = fontFamily ?: properties.fontFamily,
fontSize = fontSize ?: properties.fontSize,
fontSizeUnit = properties.fontSizeUnit,
fontWeight = properties.fontWeight,
fontSizeUnit = fontSizeUnit ?: properties.fontSizeUnit,
fontWeight = fontWeight ?: properties.fontWeight,
height = properties.height,
highlightColor = highlightColor ?: properties.highlightColor,
hintColor = hintColor ?: properties.hintColor,
hintText = hintText ?: properties.hintText,
id = properties.id,
keyboardType = properties.keyboardType,
inputMethod = properties.inputMethod,
keyboardType = keyboardType ?: properties.keyboardType,
letterSpacing = letterSpacing ?: properties.letterSpacing,
lineHeight = lineHeight ?: properties.lineHeight,
margins = properties.margins,
@@ -1084,7 +1119,7 @@ fun Input.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1110,6 +1145,7 @@ fun Input.evaluate(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -1155,6 +1191,7 @@ fun Component<Input>.override(
hintColor: Color? = null,
hintText: String? = null,
id: String? = null,
inputMethod: InputMethod? = null,
keyboardType: Input.KeyboardType? = null,
letterSpacing: Double? = null,
lineHeight: Int? = null,
@@ -1199,6 +1236,7 @@ fun Component<Input>.override(
hintColor = valueOrNull(hintColor),
hintText = valueOrNull(hintText),
id = valueOrNull(id),
inputMethod = valueOrNull(inputMethod),
keyboardType = valueOrNull(keyboardType),
letterSpacing = valueOrNull(letterSpacing),
lineHeight = valueOrNull(lineHeight),
@@ -1244,6 +1282,7 @@ fun Component<Input>.override(
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param id Element ID. It must be unique within the root element. It is used as `accessibilityIdentifier` on iOS.
* @param inputMethod Data entry method. If nothing is specified, the value will be taken from keyboard_type.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
@@ -1289,6 +1328,7 @@ fun Component<Input>.defer(
hintColor: ReferenceProperty<Color>? = null,
hintText: ReferenceProperty<String>? = null,
id: ReferenceProperty<String>? = null,
inputMethod: ReferenceProperty<InputMethod>? = null,
keyboardType: ReferenceProperty<Input.KeyboardType>? = null,
letterSpacing: ReferenceProperty<Double>? = null,
lineHeight: ReferenceProperty<Int>? = null,
@@ -1333,6 +1373,7 @@ fun Component<Input>.defer(
hintColor = hintColor,
hintText = hintText,
id = id,
inputMethod = inputMethod,
keyboardType = keyboardType,
letterSpacing = letterSpacing,
lineHeight = lineHeight,
@@ -1360,56 +1401,71 @@ fun Component<Input>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param fontFamily Font family:<li>`text` a standard text font;</li><li>`display` a family of fonts with a large font size.</li>
* @param fontSize Font size.
* @param fontSizeUnit Unit of measurement:<li>`px` a physical pixel.</li><li>`dp` a logical pixel that doesn't depend on screen density.</li><li>`sp` a logical pixel that depends on the font size on a device. Specify height in `sp`. Only available on Android.</li>
* @param fontWeight Style.
* @param highlightColor Text highlight color. If the value isn't set, the color set in the client will be used instead.
* @param hintColor Text color.
* @param hintText Tooltip text.
* @param keyboardType Keyboard type.
* @param letterSpacing Spacing between characters.
* @param lineHeight Line spacing of the text. Units specified in `font_size_unit`.
* @param maxVisibleLines Maximum number of lines to be displayed in the input field.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param selectAllOnFocus Highlighting input text when focused.
* @param textColor Text color.
* @param visibility Element visibility.
*/
@Generated
fun Component<Input>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
fontFamily: ExpressionProperty<FontFamily>? = null,
fontSize: ExpressionProperty<Int>? = null,
fontSizeUnit: ExpressionProperty<SizeUnit>? = null,
fontWeight: ExpressionProperty<FontWeight>? = null,
highlightColor: ExpressionProperty<Color>? = null,
hintColor: ExpressionProperty<Color>? = null,
hintText: ExpressionProperty<String>? = null,
keyboardType: ExpressionProperty<Input.KeyboardType>? = null,
letterSpacing: ExpressionProperty<Double>? = null,
lineHeight: ExpressionProperty<Int>? = null,
maxVisibleLines: ExpressionProperty<Int>? = null,
rowSpan: ExpressionProperty<Int>? = null,
selectAllOnFocus: ExpressionProperty<Boolean>? = null,
textColor: ExpressionProperty<Color>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Input> = Component(
template = template,
properties = Input.Properties(
accessibility = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
background = null,
border = null,
columnSpan = columnSpan,
extensions = null,
focus = null,
fontFamily = null,
fontFamily = fontFamily,
fontSize = fontSize,
fontSizeUnit = null,
fontWeight = null,
fontSizeUnit = fontSizeUnit,
fontWeight = fontWeight,
height = null,
highlightColor = highlightColor,
hintColor = hintColor,
hintText = hintText,
id = null,
keyboardType = null,
inputMethod = null,
keyboardType = keyboardType,
letterSpacing = letterSpacing,
lineHeight = lineHeight,
margins = null,
@@ -1428,7 +1484,7 @@ fun Component<Input>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -1444,13 +1500,16 @@ operator fun Component<Input>.plus(additive: Input.Properties): Component<Input>
@Generated
fun Input.asList() = listOf(this)
@Generated
fun Input.KeyboardType.asList() = listOf(this)
/**
* @param color Text input line color.
*/
@Generated
fun DivScope.inputNativeInterface(
`use named arguments`: Guard = Guard.instance,
color: Color,
color: Color? = null,
): Input.NativeInterface = Input.NativeInterface(
Input.NativeInterface.Properties(
color = valueOrNull(color),
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface InputMask
@Generated
fun InputMask.asList() = listOf(this)
@@ -0,0 +1,24 @@
@file:Suppress(
"unused",
"UNUSED_PARAMETER",
)
package divkit.dsl
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonValue
import divkit.dsl.annotation.*
import divkit.dsl.core.*
import divkit.dsl.scope.*
import kotlin.Any
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
@Generated
sealed interface InputMethod
@Generated
fun InputMethod.asList() = listOf(this)
@@ -68,8 +68,8 @@ class IntegerVariable internal constructor(
@Generated
fun DivScope.integerVariable(
`use named arguments`: Guard = Guard.instance,
name: String,
value: Int,
name: String? = null,
value: Int? = null,
): IntegerVariable = IntegerVariable(
IntegerVariable.Properties(
name = valueOrNull(name),
@@ -0,0 +1,145 @@
@file:Suppress(
"unused",
"UNUSED_PARAMETER",
)
package divkit.dsl
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonValue
import divkit.dsl.annotation.*
import divkit.dsl.core.*
import divkit.dsl.scope.*
import kotlin.Any
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
/**
* Keyboard input method.
*
* Can be created using the method [keyboardInput].
*
* Required properties: `type`.
*/
@Generated
class KeyboardInput internal constructor(
@JsonIgnore
val properties: Properties,
) : InputMethod {
@JsonAnyGetter
internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(
mapOf("type" to "keyboard")
)
operator fun plus(additive: Properties): KeyboardInput = KeyboardInput(
Properties(
keyboardType = additive.keyboardType ?: properties.keyboardType,
)
)
class Properties internal constructor(
/**
* Keyboard type.
* Default value: `multi_line_text`.
*/
val keyboardType: Property<KeyboardType>?,
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
result.tryPutProperty("keyboard_type", keyboardType)
return result
}
}
/**
* Keyboard type.
*
* Possible values: [single_line_text, multi_line_text, phone, number, email, uri].
*/
@Generated
sealed interface KeyboardType
}
/**
* @param keyboardType Keyboard type.
*/
@Generated
fun DivScope.keyboardInput(
`use named arguments`: Guard = Guard.instance,
keyboardType: KeyboardInput.KeyboardType? = null,
): KeyboardInput = KeyboardInput(
KeyboardInput.Properties(
keyboardType = valueOrNull(keyboardType),
)
)
/**
* @param keyboardType Keyboard type.
*/
@Generated
fun DivScope.keyboardInputProps(
`use named arguments`: Guard = Guard.instance,
keyboardType: KeyboardInput.KeyboardType? = null,
) = KeyboardInput.Properties(
keyboardType = valueOrNull(keyboardType),
)
/**
* @param keyboardType Keyboard type.
*/
@Generated
fun TemplateScope.keyboardInputRefs(
`use named arguments`: Guard = Guard.instance,
keyboardType: ReferenceProperty<KeyboardInput.KeyboardType>? = null,
) = KeyboardInput.Properties(
keyboardType = keyboardType,
)
/**
* @param keyboardType Keyboard type.
*/
@Generated
fun KeyboardInput.override(
`use named arguments`: Guard = Guard.instance,
keyboardType: KeyboardInput.KeyboardType? = null,
): KeyboardInput = KeyboardInput(
KeyboardInput.Properties(
keyboardType = valueOrNull(keyboardType) ?: properties.keyboardType,
)
)
/**
* @param keyboardType Keyboard type.
*/
@Generated
fun KeyboardInput.defer(
`use named arguments`: Guard = Guard.instance,
keyboardType: ReferenceProperty<KeyboardInput.KeyboardType>? = null,
): KeyboardInput = KeyboardInput(
KeyboardInput.Properties(
keyboardType = keyboardType ?: properties.keyboardType,
)
)
/**
* @param keyboardType Keyboard type.
*/
@Generated
fun KeyboardInput.evaluate(
`use named arguments`: Guard = Guard.instance,
keyboardType: ExpressionProperty<KeyboardInput.KeyboardType>? = null,
): KeyboardInput = KeyboardInput(
KeyboardInput.Properties(
keyboardType = keyboardType ?: properties.keyboardType,
)
)
@Generated
fun KeyboardInput.asList() = listOf(this)
@Generated
fun KeyboardInput.KeyboardType.asList() = listOf(this)
@@ -25,4 +25,5 @@ import kotlin.collections.Map
@Generated
sealed interface LineStyle
@Generated
fun LineStyle.asList() = listOf(this)
@@ -70,7 +70,7 @@ class LinearGradient internal constructor(
fun DivScope.linearGradient(
`use named arguments`: Guard = Guard.instance,
angle: Int? = null,
colors: List<Color>,
colors: List<Color>? = null,
): LinearGradient = LinearGradient(
LinearGradient.Properties(
angle = valueOrNull(angle),
@@ -61,7 +61,7 @@ class NeighbourPageSize internal constructor(
@Generated
fun DivScope.neighbourPageSize(
`use named arguments`: Guard = Guard.instance,
neighbourPageWidth: FixedSize,
neighbourPageWidth: FixedSize? = null,
): NeighbourPageSize = NeighbourPageSize(
NeighbourPageSize.Properties(
neighbourPageWidth = valueOrNull(neighbourPageWidth),
@@ -68,8 +68,8 @@ class NinePatchBackground internal constructor(
@Generated
fun DivScope.ninePatchBackground(
`use named arguments`: Guard = Guard.instance,
imageUrl: Url,
insets: AbsoluteEdgeInsets,
imageUrl: Url? = null,
insets: AbsoluteEdgeInsets? = null,
): NinePatchBackground = NinePatchBackground(
NinePatchBackground.Properties(
imageUrl = valueOrNull(imageUrl),
@@ -68,8 +68,8 @@ class NumberVariable internal constructor(
@Generated
fun DivScope.numberVariable(
`use named arguments`: Guard = Guard.instance,
name: String,
value: Double,
name: String? = null,
value: Double? = null,
): NumberVariable = NumberVariable(
NumberVariable.Properties(
name = valueOrNull(name),
@@ -61,7 +61,7 @@ class PageSize internal constructor(
@Generated
fun DivScope.pageSize(
`use named arguments`: Guard = Guard.instance,
pageWidth: PercentageSize,
pageWidth: PercentageSize? = null,
): PageSize = PageSize(
PageSize.Properties(
pageWidth = valueOrNull(pageWidth),
@@ -249,8 +249,6 @@ class Pager internal constructor(
*/
@Generated
sealed interface Orientation
fun Orientation.asList() = listOf(this)
}
/**
@@ -302,8 +300,8 @@ fun DivScope.pager(
height: Size? = null,
id: String? = null,
itemSpacing: FixedSize? = null,
items: List<Div>,
layoutMode: PagerLayoutMode,
items: List<Div>? = null,
layoutMode: PagerLayoutMode? = null,
margins: EdgeInsets? = null,
orientation: Pager.Orientation? = null,
paddings: EdgeInsets? = null,
@@ -765,25 +763,33 @@ fun Pager.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param defaultItem Ordinal number of the pager element that will be opened by default.
* @param orientation Pager orientation.
* @param restrictParentScroll If the parameter is enabled, the pager won't transmit the scroll gesture to the parent element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Pager.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
defaultItem: ExpressionProperty<Int>? = null,
orientation: ExpressionProperty<Pager.Orientation>? = null,
restrictParentScroll: ExpressionProperty<Boolean>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Pager = Pager(
Pager.Properties(
accessibility = properties.accessibility,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
background = properties.background,
border = properties.border,
@@ -797,7 +803,7 @@ fun Pager.evaluate(
items = properties.items,
layoutMode = properties.layoutMode,
margins = properties.margins,
orientation = properties.orientation,
orientation = orientation ?: properties.orientation,
paddings = properties.paddings,
restrictParentScroll = restrictParentScroll ?: properties.restrictParentScroll,
rowSpan = rowSpan ?: properties.rowSpan,
@@ -808,7 +814,7 @@ fun Pager.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1024,26 +1030,34 @@ fun Component<Pager>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param defaultItem Ordinal number of the pager element that will be opened by default.
* @param orientation Pager orientation.
* @param restrictParentScroll If the parameter is enabled, the pager won't transmit the scroll gesture to the parent element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Component<Pager>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
defaultItem: ExpressionProperty<Int>? = null,
orientation: ExpressionProperty<Pager.Orientation>? = null,
restrictParentScroll: ExpressionProperty<Boolean>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Pager> = Component(
template = template,
properties = Pager.Properties(
accessibility = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
background = null,
border = null,
@@ -1057,7 +1071,7 @@ fun Component<Pager>.evaluate(
items = null,
layoutMode = null,
margins = null,
orientation = null,
orientation = orientation,
paddings = null,
restrictParentScroll = restrictParentScroll,
rowSpan = rowSpan,
@@ -1068,7 +1082,7 @@ fun Component<Pager>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -1083,3 +1097,6 @@ operator fun Component<Pager>.plus(additive: Pager.Properties): Component<Pager>
@Generated
fun Pager.asList() = listOf(this)
@Generated
fun Pager.Orientation.asList() = listOf(this)
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface PagerLayoutMode
@Generated
fun PagerLayoutMode.asList() = listOf(this)
@@ -67,8 +67,6 @@ class Patch internal constructor(
@Generated
sealed interface Mode
fun Mode.asList() = listOf(this)
/**
* Can be created using the method [patchChange].
*
@@ -118,7 +116,7 @@ class Patch internal constructor(
@Generated
fun DivScope.patch(
`use named arguments`: Guard = Guard.instance,
changes: List<Patch.Change>,
changes: List<Patch.Change>? = null,
mode: Patch.Mode? = null,
): Patch = Patch(
Patch.Properties(
@@ -187,6 +185,20 @@ fun Patch.defer(
)
)
/**
* @param mode Procedure for applying changes:<li>`transactional` if an error occurs during application of at least one element, the changes aren't applied.</li><li>`partial` all possible changes are applied. If there are errors, they are reported.</li>
*/
@Generated
fun Patch.evaluate(
`use named arguments`: Guard = Guard.instance,
mode: ExpressionProperty<Patch.Mode>? = null,
): Patch = Patch(
Patch.Properties(
changes = properties.changes,
mode = mode ?: properties.mode,
)
)
@Generated
fun Patch.asList() = listOf(this)
@@ -197,7 +209,7 @@ fun Patch.asList() = listOf(this)
@Generated
fun DivScope.patchChange(
`use named arguments`: Guard = Guard.instance,
id: String,
id: String? = null,
items: List<Div>? = null,
): Patch.Change = Patch.Change(
Patch.Change.Properties(
@@ -268,3 +280,6 @@ fun Patch.Change.defer(
@Generated
fun Patch.Change.asList() = listOf(this)
@Generated
fun Patch.Mode.asList() = listOf(this)
@@ -61,7 +61,7 @@ class PercentageSize internal constructor(
@Generated
fun DivScope.percentageSize(
`use named arguments`: Guard = Guard.instance,
value: Double,
value: Double? = null,
): PercentageSize = PercentageSize(
PercentageSize.Properties(
value = valueOrNull(value),
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Pivot
@Generated
fun Pivot.asList() = listOf(this)
@@ -137,15 +137,17 @@ fun PivotFixed.defer(
)
/**
* @param unit Measurement unit. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Coordinate value.
*/
@Generated
fun PivotFixed.evaluate(
`use named arguments`: Guard = Guard.instance,
unit: ExpressionProperty<SizeUnit>? = null,
value: ExpressionProperty<Int>? = null,
): PivotFixed = PivotFixed(
PivotFixed.Properties(
unit = properties.unit,
unit = unit ?: properties.unit,
value = value ?: properties.value,
)
)
@@ -61,7 +61,7 @@ class PivotPercentage internal constructor(
@Generated
fun DivScope.pivotPercentage(
`use named arguments`: Guard = Guard.instance,
value: Double,
value: Double? = null,
): PivotPercentage = PivotPercentage(
PivotPercentage.Properties(
value = valueOrNull(value),
@@ -66,8 +66,8 @@ class Point internal constructor(
@Generated
fun DivScope.point(
`use named arguments`: Guard = Guard.instance,
x: Dimension,
y: Dimension,
x: Dimension? = null,
y: Dimension? = null,
): Point = Point(
Point.Properties(
x = valueOrNull(x),
@@ -87,7 +87,7 @@ fun DivScope.radialGradient(
`use named arguments`: Guard = Guard.instance,
centerX: RadialGradientCenter? = null,
centerY: RadialGradientCenter? = null,
colors: List<Color>,
colors: List<Color>? = null,
radius: RadialGradientRadius? = null,
): RadialGradient = RadialGradient(
RadialGradient.Properties(
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface RadialGradientCenter
@Generated
fun RadialGradientCenter.asList() = listOf(this)
@@ -70,7 +70,7 @@ class RadialGradientFixedCenter internal constructor(
fun DivScope.radialGradientFixedCenter(
`use named arguments`: Guard = Guard.instance,
unit: SizeUnit? = null,
value: Int,
value: Int? = null,
): RadialGradientFixedCenter = RadialGradientFixedCenter(
RadialGradientFixedCenter.Properties(
unit = valueOrNull(unit),
@@ -139,15 +139,17 @@ fun RadialGradientFixedCenter.defer(
)
/**
* @param unit Unit of measurement. To learn more about units of size measurement, see [Layout inside the card](../../layout.dita).
* @param value Coordinate value.
*/
@Generated
fun RadialGradientFixedCenter.evaluate(
`use named arguments`: Guard = Guard.instance,
unit: ExpressionProperty<SizeUnit>? = null,
value: ExpressionProperty<Int>? = null,
): RadialGradientFixedCenter = RadialGradientFixedCenter(
RadialGradientFixedCenter.Properties(
unit = properties.unit,
unit = unit ?: properties.unit,
value = value ?: properties.value,
)
)
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface RadialGradientRadius
@Generated
fun RadialGradientRadius.asList() = listOf(this)
@@ -61,7 +61,7 @@ class RadialGradientRelativeCenter internal constructor(
@Generated
fun DivScope.radialGradientRelativeCenter(
`use named arguments`: Guard = Guard.instance,
value: Double,
value: Double? = null,
): RadialGradientRelativeCenter = RadialGradientRelativeCenter(
RadialGradientRelativeCenter.Properties(
value = valueOrNull(value),
@@ -61,8 +61,6 @@ class RadialGradientRelativeRadius internal constructor(
*/
@Generated
sealed interface Value
fun Value.asList() = listOf(this)
}
/**
@@ -71,7 +69,7 @@ class RadialGradientRelativeRadius internal constructor(
@Generated
fun DivScope.radialGradientRelativeRadius(
`use named arguments`: Guard = Guard.instance,
value: RadialGradientRelativeRadius.Value,
value: RadialGradientRelativeRadius.Value? = null,
): RadialGradientRelativeRadius = RadialGradientRelativeRadius(
RadialGradientRelativeRadius.Properties(
value = valueOrNull(value),
@@ -126,5 +124,21 @@ fun RadialGradientRelativeRadius.defer(
)
)
/**
* @param value Type of the relative radius of the gradient transition.
*/
@Generated
fun RadialGradientRelativeRadius.evaluate(
`use named arguments`: Guard = Guard.instance,
value: ExpressionProperty<RadialGradientRelativeRadius.Value>? = null,
): RadialGradientRelativeRadius = RadialGradientRelativeRadius(
RadialGradientRelativeRadius.Properties(
value = value ?: properties.value,
)
)
@Generated
fun RadialGradientRelativeRadius.asList() = listOf(this)
@Generated
fun RadialGradientRelativeRadius.Value.asList() = listOf(this)
@@ -229,6 +229,7 @@ fun ScaleTransition.defer(
/**
* @param duration Animation duration in milliseconds.
* @param interpolator Transition speed nature.
* @param pivotX Relative coordinate `X` of the point that won't change its position in case of scaling.
* @param pivotY Relative coordinate `Y` of the point that won't change its position in case of scaling.
* @param scale Value of the scale from which the element starts appearing or at which it finishes disappearing.
@@ -238,6 +239,7 @@ fun ScaleTransition.defer(
fun ScaleTransition.evaluate(
`use named arguments`: Guard = Guard.instance,
duration: ExpressionProperty<Int>? = null,
interpolator: ExpressionProperty<AnimationInterpolator>? = null,
pivotX: ExpressionProperty<Double>? = null,
pivotY: ExpressionProperty<Double>? = null,
scale: ExpressionProperty<Double>? = null,
@@ -245,7 +247,7 @@ fun ScaleTransition.evaluate(
): ScaleTransition = ScaleTransition(
ScaleTransition.Properties(
duration = duration ?: properties.duration,
interpolator = properties.interpolator,
interpolator = interpolator ?: properties.interpolator,
pivotX = pivotX ?: properties.pivotX,
pivotY = pivotY ?: properties.pivotY,
scale = scale ?: properties.scale,
@@ -0,0 +1,240 @@
@file:Suppress(
"unused",
"UNUSED_PARAMETER",
)
package divkit.dsl
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonValue
import divkit.dsl.annotation.*
import divkit.dsl.core.*
import divkit.dsl.scope.*
import kotlin.Any
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
/**
* The input method using the selection menu. The text in the input corresponds to the selected item from the menu. If the value has not yet been selected, then the value that matches the value of the text_variable variable will be taken.
*
* Can be created using the method [selectionInput].
*
* Required properties: `type, items`.
*/
@Generated
class SelectionInput internal constructor(
@JsonIgnore
val properties: Properties,
) : InputMethod {
@JsonAnyGetter
internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(
mapOf("type" to "selection")
)
operator fun plus(additive: Properties): SelectionInput = SelectionInput(
Properties(
items = additive.items ?: properties.items,
)
)
class Properties internal constructor(
val items: Property<List<Item>>?,
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
result.tryPutProperty("items", items)
return result
}
}
/**
* Selection item from the menu.
*
* Can be created using the method [selectionInputItem].
*
* Required properties: `text`.
*/
@Generated
class Item internal constructor(
@JsonIgnore
val properties: Properties,
) {
@JsonAnyGetter
internal fun getJsonProperties(): Map<String, Any> = properties.mergeWith(emptyMap())
operator fun plus(additive: Properties): Item = Item(
Properties(
text = additive.text ?: properties.text,
value = additive.value ?: properties.value,
)
)
class Properties internal constructor(
/**
* The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
*/
val text: Property<String>?,
/**
* Value of the item that is displayed in the selection menu.
*/
val value: Property<String>?,
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
val result = mutableMapOf<String, Any>()
result.putAll(properties)
result.tryPutProperty("text", text)
result.tryPutProperty("value", value)
return result
}
}
}
}
@Generated
fun DivScope.selectionInput(
`use named arguments`: Guard = Guard.instance,
items: List<SelectionInput.Item>? = null,
): SelectionInput = SelectionInput(
SelectionInput.Properties(
items = valueOrNull(items),
)
)
@Generated
fun DivScope.selectionInputProps(
`use named arguments`: Guard = Guard.instance,
items: List<SelectionInput.Item>? = null,
) = SelectionInput.Properties(
items = valueOrNull(items),
)
@Generated
fun TemplateScope.selectionInputRefs(
`use named arguments`: Guard = Guard.instance,
items: ReferenceProperty<List<SelectionInput.Item>>? = null,
) = SelectionInput.Properties(
items = items,
)
@Generated
fun SelectionInput.override(
`use named arguments`: Guard = Guard.instance,
items: List<SelectionInput.Item>? = null,
): SelectionInput = SelectionInput(
SelectionInput.Properties(
items = valueOrNull(items) ?: properties.items,
)
)
@Generated
fun SelectionInput.defer(
`use named arguments`: Guard = Guard.instance,
items: ReferenceProperty<List<SelectionInput.Item>>? = null,
): SelectionInput = SelectionInput(
SelectionInput.Properties(
items = items ?: properties.items,
)
)
@Generated
fun SelectionInput.asList() = listOf(this)
/**
* @param text The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
* @param value Value of the item that is displayed in the selection menu.
*/
@Generated
fun DivScope.selectionInputItem(
`use named arguments`: Guard = Guard.instance,
text: String? = null,
value: String? = null,
): SelectionInput.Item = SelectionInput.Item(
SelectionInput.Item.Properties(
text = valueOrNull(text),
value = valueOrNull(value),
)
)
/**
* @param text The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
* @param value Value of the item that is displayed in the selection menu.
*/
@Generated
fun DivScope.selectionInputItemProps(
`use named arguments`: Guard = Guard.instance,
text: String? = null,
value: String? = null,
) = SelectionInput.Item.Properties(
text = valueOrNull(text),
value = valueOrNull(value),
)
/**
* @param text The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
* @param value Value of the item that is displayed in the selection menu.
*/
@Generated
fun TemplateScope.selectionInputItemRefs(
`use named arguments`: Guard = Guard.instance,
text: ReferenceProperty<String>? = null,
value: ReferenceProperty<String>? = null,
) = SelectionInput.Item.Properties(
text = text,
value = value,
)
/**
* @param text The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
* @param value Value of the item that is displayed in the selection menu.
*/
@Generated
fun SelectionInput.Item.override(
`use named arguments`: Guard = Guard.instance,
text: String? = null,
value: String? = null,
): SelectionInput.Item = SelectionInput.Item(
SelectionInput.Item.Properties(
text = valueOrNull(text) ?: properties.text,
value = valueOrNull(value) ?: properties.value,
)
)
/**
* @param text The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
* @param value Value of the item that is displayed in the selection menu.
*/
@Generated
fun SelectionInput.Item.defer(
`use named arguments`: Guard = Guard.instance,
text: ReferenceProperty<String>? = null,
value: ReferenceProperty<String>? = null,
): SelectionInput.Item = SelectionInput.Item(
SelectionInput.Item.Properties(
text = text ?: properties.text,
value = value ?: properties.value,
)
)
/**
* @param text The text that is displayed in the input. If the value is missing, the text from div_selection_input_item_value will appear in the input.
* @param value Value of the item that is displayed in the selection menu.
*/
@Generated
fun SelectionInput.Item.evaluate(
`use named arguments`: Guard = Guard.instance,
text: ExpressionProperty<String>? = null,
value: ExpressionProperty<String>? = null,
): SelectionInput.Item = SelectionInput.Item(
SelectionInput.Item.Properties(
text = text ?: properties.text,
value = value ?: properties.value,
)
)
@Generated
fun SelectionInput.Item.asList() = listOf(this)
@@ -287,8 +287,6 @@ class Separator internal constructor(
*/
@Generated
sealed interface Orientation
fun Orientation.asList() = listOf(this)
}
}
@@ -805,24 +803,30 @@ fun Separator.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Separator.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Separator = Separator(
Separator.Properties(
accessibility = properties.accessibility,
action = properties.action,
actionAnimation = properties.actionAnimation,
actions = properties.actions,
alignmentHorizontal = properties.alignmentHorizontal,
alignmentVertical = properties.alignmentVertical,
alignmentHorizontal = alignmentHorizontal ?: properties.alignmentHorizontal,
alignmentVertical = alignmentVertical ?: properties.alignmentVertical,
alpha = alpha ?: properties.alpha,
background = properties.background,
border = properties.border,
@@ -844,7 +848,7 @@ fun Separator.evaluate(
transitionIn = properties.transitionIn,
transitionOut = properties.transitionOut,
transitionTriggers = properties.transitionTriggers,
visibility = properties.visibility,
visibility = visibility ?: properties.visibility,
visibilityAction = properties.visibilityAction,
visibilityActions = properties.visibilityActions,
width = properties.width,
@@ -1060,16 +1064,22 @@ fun Component<Separator>.defer(
)
/**
* @param alignmentHorizontal Horizontal alignment of an element inside the parent element.
* @param alignmentVertical Vertical alignment of an element inside the parent element.
* @param alpha Sets transparency of the entire element: `0` completely transparent, `1` opaque.
* @param columnSpan Merges cells in a column of the [grid](div-grid.md) element.
* @param rowSpan Merges cells in a string of the [grid](div-grid.md) element.
* @param visibility Element visibility.
*/
@Generated
fun Component<Separator>.evaluate(
`use named arguments`: Guard = Guard.instance,
alignmentHorizontal: ExpressionProperty<AlignmentHorizontal>? = null,
alignmentVertical: ExpressionProperty<AlignmentVertical>? = null,
alpha: ExpressionProperty<Double>? = null,
columnSpan: ExpressionProperty<Int>? = null,
rowSpan: ExpressionProperty<Int>? = null,
visibility: ExpressionProperty<Visibility>? = null,
): Component<Separator> = Component(
template = template,
properties = Separator.Properties(
@@ -1077,8 +1087,8 @@ fun Component<Separator>.evaluate(
action = null,
actionAnimation = null,
actions = null,
alignmentHorizontal = null,
alignmentVertical = null,
alignmentHorizontal = alignmentHorizontal,
alignmentVertical = alignmentVertical,
alpha = alpha,
background = null,
border = null,
@@ -1100,7 +1110,7 @@ fun Component<Separator>.evaluate(
transitionIn = null,
transitionOut = null,
transitionTriggers = null,
visibility = null,
visibility = visibility,
visibilityAction = null,
visibilityActions = null,
width = null,
@@ -1194,15 +1204,17 @@ fun Separator.DelimiterStyle.defer(
/**
* @param color Separator color. To prevent the separator from being displayed, set transparency in the alpha channel. For example, `#00FFFFFF`.
* @param orientation Separator orientation:<li>`vertical` vertical;</li><li>`horizontal` horizontal.</li><
*/
@Generated
fun Separator.DelimiterStyle.evaluate(
`use named arguments`: Guard = Guard.instance,
color: ExpressionProperty<Color>? = null,
orientation: ExpressionProperty<Separator.DelimiterStyle.Orientation>? = null,
): Separator.DelimiterStyle = Separator.DelimiterStyle(
Separator.DelimiterStyle.Properties(
color = color ?: properties.color,
orientation = properties.orientation,
orientation = orientation ?: properties.orientation,
)
)
@@ -86,7 +86,7 @@ fun DivScope.shadow(
alpha: Double? = null,
blur: Int? = null,
color: Color? = null,
offset: Point,
offset: Point? = null,
): Shadow = Shadow(
Shadow.Properties(
alpha = valueOrNull(alpha),
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Shape
@Generated
fun Shape.asList() = listOf(this)
@@ -46,6 +46,7 @@ class ShapeDrawable internal constructor(
/**
* Fill color.
*/
@Deprecated("Marked as deprecated in json schema")
val color: Property<Color>?,
/**
* Shape.
@@ -54,6 +55,7 @@ class ShapeDrawable internal constructor(
/**
* Stroke style.
*/
@Deprecated("Marked as deprecated in json schema")
val stroke: Property<Stroke>?,
) {
internal fun mergeWith(properties: Map<String, Any>): Map<String, Any> {
@@ -75,8 +77,8 @@ class ShapeDrawable internal constructor(
@Generated
fun DivScope.shapeDrawable(
`use named arguments`: Guard = Guard.instance,
color: Color,
shape: Shape,
color: Color? = null,
shape: Shape? = null,
stroke: Stroke? = null,
): ShapeDrawable = ShapeDrawable(
ShapeDrawable.Properties(
@@ -20,4 +20,5 @@ import kotlin.collections.Map
@Generated
sealed interface Size
@Generated
fun Size.asList() = listOf(this)
@@ -25,4 +25,5 @@ import kotlin.collections.Map
@Generated
sealed interface SizeUnit
@Generated
fun SizeUnit.asList() = listOf(this)

Some files were not shown because too many files have changed in this diff Show More