mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
Bump pydivkit and python codegen
This commit is contained in:
@@ -16,7 +16,8 @@ from ...schema.modeling.entities import (
|
||||
Object,
|
||||
StaticString,
|
||||
String,
|
||||
Url
|
||||
StringEnumeration,
|
||||
Url,
|
||||
)
|
||||
from ... import utils
|
||||
from ...schema.modeling.text import Text, EMPTY
|
||||
@@ -121,20 +122,19 @@ class PythonEntity(Entity):
|
||||
instance_properties = self.instance_properties
|
||||
optional = list(map(lambda p: f'{p.escaped_name}: str = {p.static_value}', static_properties))
|
||||
for p in cast(List[PythonProperty], instance_properties):
|
||||
if p.optional:
|
||||
optional.append(f'{p.escaped_name}: typing.Optional[{p.property_type_py.type_name(filename)}] = None')
|
||||
else:
|
||||
required.append(f'{p.escaped_name}: {p.property_type_py.type_name(filename)}')
|
||||
optional.append(f'{p.escaped_name}: typing.Optional[{p.property_type_py.final_type(filename)}] = None')
|
||||
result = Text()
|
||||
result += 'def __init__('
|
||||
result += Text(', '.join(main_required) + ',').indented(indent_width=4)
|
||||
for p in required + optional:
|
||||
result += Text(p + ',').indented(indent_width=4)
|
||||
result += Text('**kwargs: typing.Any,').indented(indent_width=4)
|
||||
result += '):'
|
||||
super_init = Text('super().__init__(')
|
||||
for p in cast(List[PythonProperty], static_properties + instance_properties):
|
||||
escaped_name = p.escaped_name
|
||||
super_init += Text(f'{escaped_name}={escaped_name},').indented(indent_width=4)
|
||||
super_init += Text('**kwargs,').indented(indent_width=4)
|
||||
super_init += ')'
|
||||
result += super_init.indented(indent_width=4)
|
||||
return result
|
||||
@@ -157,6 +157,7 @@ class PythonEntity(Entity):
|
||||
commentary, indent=indent, indent_first_line=False
|
||||
)
|
||||
field += f", description={commentary}"
|
||||
|
||||
result += Text(f'{p.escaped_name}: str = Field({field})').indented(indent_width=4)
|
||||
dynamic_declaration = self.dynamic_properties_declaration
|
||||
if dynamic_declaration.lines:
|
||||
@@ -188,12 +189,12 @@ class PythonProperty(Property):
|
||||
def constructor_required_value(self, filename: str) -> Optional[str]:
|
||||
if self.optional:
|
||||
return None
|
||||
return f'{self.escaped_name}: {self.property_type_py.type_name(filename)}'
|
||||
return f'{self.escaped_name}: {self.property_type_py.final_type(filename)}'
|
||||
|
||||
def constructor_optional_value(self, filename: str) -> Optional[str]:
|
||||
if not self.optional:
|
||||
return None
|
||||
return f'{self.escaped_name}: typing.Optional[{self.property_type_py.type_name(filename)}] = None'
|
||||
return f'{self.escaped_name}: typing.Optional[{self.property_type_py.final_type(filename)}] = None'
|
||||
|
||||
@property
|
||||
def static_value(self) -> str:
|
||||
@@ -237,7 +238,7 @@ class PythonProperty(Property):
|
||||
else:
|
||||
prefix = ''
|
||||
suffix = ''
|
||||
type_decl = f'{prefix}{self.property_type_py.type_name(filename)}{suffix}'
|
||||
type_decl = f'{prefix}{self.property_type_py.final_type(filename)}{suffix}'
|
||||
|
||||
fields_text = utils.indent(", \n".join(fields), indent=4)
|
||||
return Text(f'{self.escaped_name}: {type_decl} = Field(\n{fields_text})')
|
||||
@@ -255,6 +256,24 @@ class PythonPropertyType(PropertyType):
|
||||
return self.property_type_py.referenced_top_level_type_name
|
||||
return None
|
||||
|
||||
def is_expr(self) -> bool:
|
||||
if isinstance(self, (Int, Double)):
|
||||
return True
|
||||
if isinstance(self, (Bool, BoolInt)):
|
||||
return True
|
||||
if isinstance(self, (Color, String, Url)):
|
||||
return True
|
||||
if isinstance(self, Object):
|
||||
if isinstance(self.object, StringEnumeration):
|
||||
return True
|
||||
return False
|
||||
|
||||
def final_type(self, filename: str) -> str:
|
||||
typename = self.type_name(filename)
|
||||
if self.is_expr():
|
||||
return f"typing.Union[Expr, {typename}]"
|
||||
return typename
|
||||
|
||||
def type_name(self, filename: str) -> str:
|
||||
if isinstance(self, Int):
|
||||
return 'int'
|
||||
@@ -269,7 +288,7 @@ class PythonPropertyType(PropertyType):
|
||||
elif isinstance(self, Dictionary):
|
||||
return 'typing.Dict[str, typing.Any]'
|
||||
elif isinstance(self, PythonArray):
|
||||
return f'typing.List[{self.property_type_py.type_name(filename)}]'
|
||||
return f'typing.Sequence[{self.property_type_py.final_type(filename)}]'
|
||||
elif isinstance(self, Object):
|
||||
if self.object is None:
|
||||
raise ValueError(f'Invalid {self}')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"lang": "python",
|
||||
"header": "# Generated code. Do not modify.\n\nfrom __future__ import annotations\nfrom pydivkit.core import BaseDiv, Field\nimport enum\nimport typing\n"
|
||||
"header": "# Generated code. Do not modify.\n\nfrom __future__ import annotations\nfrom pydivkit.core import BaseDiv, Field, Expr\nimport enum\nimport typing\n"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -12,16 +12,18 @@ class EntityWithArray(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
array: typing.List[entity.Entity],
|
||||
type: str = 'entity_with_array',
|
||||
array: typing.Optional[typing.Sequence[entity.Entity]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
array=array,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_array')
|
||||
array: typing.List[entity.Entity] = Field(
|
||||
array: typing.Sequence[entity.Entity] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,16 +10,18 @@ class EntityWithArrayOfEnums(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[EntityWithArrayOfEnumsItem],
|
||||
type: str = 'entity_with_array_of_enums',
|
||||
items: typing.Optional[typing.Sequence[typing.Union[Expr, EntityWithArrayOfEnumsItem]]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
items=items,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_array_of_enums')
|
||||
items: typing.List[EntityWithArrayOfEnumsItem] = Field(
|
||||
items: typing.Sequence[typing.Union[Expr, EntityWithArrayOfEnumsItem]] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,16 +10,18 @@ class EntityWithArrayOfExpressions(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[str],
|
||||
type: str = 'entity_with_array_of_expressions',
|
||||
items: typing.Optional[typing.Sequence[typing.Union[Expr, str]]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
items=items,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_array_of_expressions')
|
||||
items: typing.List[str] = Field(
|
||||
items: typing.Sequence[typing.Union[Expr, str]] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -12,16 +12,18 @@ class EntityWithArrayOfNestedItems(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[EntityWithArrayOfNestedItemsItem],
|
||||
type: str = 'entity_with_array_of_nested_items',
|
||||
items: typing.Optional[typing.Sequence[EntityWithArrayOfNestedItemsItem]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
items=items,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_array_of_nested_items')
|
||||
items: typing.List[EntityWithArrayOfNestedItemsItem] = Field(
|
||||
items: typing.Sequence[EntityWithArrayOfNestedItemsItem] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
@@ -30,17 +32,19 @@ class EntityWithArrayOfNestedItemsItem(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
entity: entity.Entity,
|
||||
property: str,
|
||||
entity: typing.Optional[entity.Entity] = None,
|
||||
property: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
entity=entity,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
entity: entity.Entity = Field(
|
||||
)
|
||||
property: str = Field(
|
||||
property: typing.Union[Expr, str] = Field(
|
||||
min_length=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,16 +10,18 @@ class EntityWithArrayWithTransform(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
array: typing.List[str],
|
||||
type: str = 'entity_with_array_with_transform',
|
||||
array: typing.Optional[typing.Sequence[typing.Union[Expr, str]]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
array=array,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_array_with_transform')
|
||||
array: typing.List[str] = Field(
|
||||
array: typing.Sequence[typing.Union[Expr, str]] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,12 +10,14 @@ class EntityWithComplexProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
property: EntityWithComplexPropertyProperty,
|
||||
type: str = 'entity_with_complex_property',
|
||||
property: typing.Optional[EntityWithComplexPropertyProperty] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_complex_property')
|
||||
@@ -27,13 +29,15 @@ class EntityWithComplexPropertyProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
value: str,
|
||||
value: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
value: str = Field(
|
||||
value: typing.Union[Expr, str] = Field(
|
||||
format="uri"
|
||||
)
|
||||
|
||||
|
||||
+7
-3
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -12,10 +12,12 @@ class EntityWithComplexPropertyWithDefaultValue(BaseDiv):
|
||||
self, *,
|
||||
type: str = 'entity_with_complex_property_with_default_value',
|
||||
property: typing.Optional[EntityWithComplexPropertyWithDefaultValueProperty] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_complex_property_with_default_value')
|
||||
@@ -27,13 +29,15 @@ class EntityWithComplexPropertyWithDefaultValueProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
value: str,
|
||||
value: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
value: str = Field(
|
||||
value: typing.Union[Expr, str] = Field(
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -14,10 +14,12 @@ class EntityWithEntityProperty(BaseDiv):
|
||||
self, *,
|
||||
type: str = 'entity_with_entity_property',
|
||||
entity: typing.Optional[entity.Entity] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
entity=entity,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_entity_property')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -12,10 +12,12 @@ class EntityWithOptionalComplexProperty(BaseDiv):
|
||||
self, *,
|
||||
type: str = 'entity_with_optional_complex_property',
|
||||
property: typing.Optional[EntityWithOptionalComplexPropertyProperty] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_optional_complex_property')
|
||||
@@ -27,13 +29,15 @@ class EntityWithOptionalComplexPropertyProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
value: str,
|
||||
value: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
value: str = Field(
|
||||
value: typing.Union[Expr, str] = Field(
|
||||
format="uri"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -11,15 +11,17 @@ class EntityWithOptionalProperty(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = 'entity_with_optional_property',
|
||||
property: typing.Optional[str] = None,
|
||||
property: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_optional_property')
|
||||
property: typing.Optional[str] = Field(
|
||||
property: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -11,15 +11,17 @@ class EntityWithOptionalStringEnumProperty(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = 'entity_with_optional_string_enum_property',
|
||||
property: typing.Optional[EntityWithOptionalStringEnumPropertyProperty] = None,
|
||||
property: typing.Optional[typing.Union[Expr, EntityWithOptionalStringEnumPropertyProperty]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_optional_string_enum_property')
|
||||
property: typing.Optional[EntityWithOptionalStringEnumPropertyProperty] = Field(
|
||||
property: typing.Optional[typing.Union[Expr, EntityWithOptionalStringEnumPropertyProperty]] = Field(
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -11,19 +11,21 @@ class EntityWithPropertyWithDefaultValue(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = 'entity_with_property_with_default_value',
|
||||
int: typing.Optional[int] = None,
|
||||
int: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
nested: typing.Optional[EntityWithPropertyWithDefaultValueNested] = None,
|
||||
url: typing.Optional[str] = None,
|
||||
url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
int=int,
|
||||
nested=nested,
|
||||
url=url,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_property_with_default_value')
|
||||
int: typing.Optional[int] = Field(
|
||||
int: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
)
|
||||
nested: typing.Optional[EntityWithPropertyWithDefaultValueNested] = Field(
|
||||
description=(
|
||||
@@ -31,7 +33,7 @@ class EntityWithPropertyWithDefaultValue(BaseDiv):
|
||||
"value for object withall-optional fields."
|
||||
)
|
||||
)
|
||||
url: typing.Optional[str] = Field(
|
||||
url: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri"
|
||||
)
|
||||
|
||||
@@ -42,21 +44,23 @@ class EntityWithPropertyWithDefaultValueNested(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
non_optional: str,
|
||||
int: typing.Optional[int] = None,
|
||||
url: typing.Optional[str] = None,
|
||||
int: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
non_optional: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
int=int,
|
||||
non_optional=non_optional,
|
||||
url=url,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
int: typing.Optional[int] = Field(
|
||||
int: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
)
|
||||
non_optional: str = Field(
|
||||
non_optional: typing.Union[Expr, str] = Field(
|
||||
)
|
||||
url: typing.Optional[str] = Field(
|
||||
url: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,16 +10,18 @@ class EntityWithRequiredProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
property: str,
|
||||
type: str = 'entity_with_required_property',
|
||||
property: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_required_property')
|
||||
property: str = Field(
|
||||
property: typing.Union[Expr, str] = Field(
|
||||
min_length=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -12,15 +12,16 @@ class EntityWithSimpleProperties(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = 'entity_with_simple_properties',
|
||||
boolean: typing.Optional[bool] = None,
|
||||
boolean_int: typing.Optional[bool] = None,
|
||||
color: typing.Optional[str] = None,
|
||||
double: typing.Optional[float] = None,
|
||||
id: typing.Optional[int] = None,
|
||||
integer: typing.Optional[int] = None,
|
||||
positive_integer: typing.Optional[int] = None,
|
||||
string: typing.Optional[str] = None,
|
||||
url: typing.Optional[str] = None,
|
||||
boolean: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
boolean_int: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
double: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
id: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
integer: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
positive_integer: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
string: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -33,36 +34,37 @@ class EntityWithSimpleProperties(BaseDiv):
|
||||
positive_integer=positive_integer,
|
||||
string=string,
|
||||
url=url,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_simple_properties')
|
||||
boolean: typing.Optional[bool] = Field(
|
||||
boolean: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Boolean property."
|
||||
)
|
||||
boolean_int: typing.Optional[bool] = Field(
|
||||
boolean_int: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Boolean value in numeric format. @deprecated"
|
||||
)
|
||||
color: typing.Optional[str] = Field(
|
||||
color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Color."
|
||||
)
|
||||
double: typing.Optional[float] = Field(
|
||||
double: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description="Floating point number."
|
||||
)
|
||||
id: typing.Optional[int] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="ID. Can\'t contain expressions."
|
||||
)
|
||||
integer: typing.Optional[int] = Field(
|
||||
integer: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Integer."
|
||||
)
|
||||
positive_integer: typing.Optional[int] = Field(
|
||||
positive_integer: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Positive integer."
|
||||
)
|
||||
string: typing.Optional[str] = Field(
|
||||
string: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description="String."
|
||||
)
|
||||
url: typing.Optional[str] = Field(
|
||||
url: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -12,16 +12,18 @@ class EntityWithStrictArray(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
array: typing.List[entity.Entity],
|
||||
type: str = 'entity_with_strict_array',
|
||||
array: typing.Optional[typing.Sequence[entity.Entity]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
array=array,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_strict_array')
|
||||
array: typing.List[entity.Entity] = Field(
|
||||
array: typing.Sequence[entity.Entity] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,16 +10,18 @@ class EntityWithStringArrayProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
array: typing.List[str],
|
||||
type: str = 'entity_with_string_array_property',
|
||||
array: typing.Optional[typing.Sequence[typing.Union[Expr, str]]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
array=array,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_string_array_property')
|
||||
array: typing.List[str] = Field(
|
||||
array: typing.Sequence[typing.Union[Expr, str]] = Field(
|
||||
min_items=1
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -10,16 +10,18 @@ class EntityWithStringEnumProperty(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
property: EntityWithStringEnumPropertyProperty,
|
||||
type: str = 'entity_with_string_enum_property',
|
||||
property: typing.Optional[typing.Union[Expr, EntityWithStringEnumPropertyProperty]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
property=property,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_string_enum_property')
|
||||
property: EntityWithStringEnumPropertyProperty = Field(
|
||||
property: typing.Union[Expr, EntityWithStringEnumPropertyProperty] = Field(
|
||||
)
|
||||
|
||||
|
||||
|
||||
+5
-3
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -11,15 +11,17 @@ class EntityWithStringEnumPropertyWithDefaultValue(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = 'entity_with_string_enum_property_with_default_value',
|
||||
value: typing.Optional[EntityWithStringEnumPropertyWithDefaultValueValue] = None,
|
||||
value: typing.Optional[typing.Union[Expr, EntityWithStringEnumPropertyWithDefaultValueValue]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_with_string_enum_property_with_default_value')
|
||||
value: typing.Optional[EntityWithStringEnumPropertyWithDefaultValueValue] = Field(
|
||||
value: typing.Optional[typing.Union[Expr, EntityWithStringEnumPropertyWithDefaultValueValue]] = Field(
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated code. Do not modify.
|
||||
|
||||
from __future__ import annotations
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Field, Expr
|
||||
import enum
|
||||
import typing
|
||||
|
||||
@@ -11,9 +11,11 @@ class EntityWithoutProperties(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = 'entity_without_properties',
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default='entity_without_properties')
|
||||
|
||||
@@ -309,50 +309,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity.json": {
|
||||
"anyOf": [
|
||||
@@ -474,85 +430,47 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"nested": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/nested"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0",
|
||||
"$typename": "int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"$typename": "url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"non_optional"
|
||||
],
|
||||
"$typename": "nested",
|
||||
"description_translations": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
}
|
||||
}
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -717,54 +635,84 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$resolved_refs": [
|
||||
"entity.json"
|
||||
],
|
||||
"type": "$defined_entity"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
"format": "uri"
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
"nested": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/nested"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0",
|
||||
"$typename": "int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"$typename": "url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"minItems": 1
|
||||
"required": [
|
||||
"non_optional"
|
||||
],
|
||||
"$typename": "nested",
|
||||
"description_translations": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
"type"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -885,6 +833,58 @@
|
||||
"ru": "Объект с простыми свойствами."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$resolved_refs": [
|
||||
"entity.json"
|
||||
],
|
||||
"type": "$defined_entity"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -288,50 +288,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity.json": {
|
||||
"anyOf": [
|
||||
@@ -396,61 +352,47 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"int_prop": {
|
||||
"$ref": "common.json#/non_negative_integer",
|
||||
"default_value": "0"
|
||||
},
|
||||
"url_prop": {
|
||||
"$ref": "common.json#/url",
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru"
|
||||
},
|
||||
"nested": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"$description": "translations.json#/entity_with_property_with_default_value_nested",
|
||||
"required": [
|
||||
"non_optional"
|
||||
]
|
||||
}
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"nested": {
|
||||
"$ref": "#/definitions/nested"
|
||||
}
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -595,51 +537,60 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"int_prop": {
|
||||
"$ref": "common.json#/non_negative_integer",
|
||||
"default_value": "0"
|
||||
},
|
||||
"url_prop": {
|
||||
"$ref": "common.json#/url",
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru"
|
||||
},
|
||||
"nested": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"$description": "translations.json#/entity_with_property_with_default_value_nested",
|
||||
"required": [
|
||||
"non_optional"
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "entity.json"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"nested": {
|
||||
"$ref": "#/definitions/nested"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
"type"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -708,6 +659,55 @@
|
||||
"type"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "entity.json"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -369,50 +369,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity.json": {
|
||||
"anyOf": [
|
||||
@@ -534,142 +490,47 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"int_prop": {
|
||||
"default_value": "0",
|
||||
"$resolved_refs": [
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url_prop": {
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"$resolved_refs": [
|
||||
"common.json#/url"
|
||||
],
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"nested": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"non_optional"
|
||||
],
|
||||
"description_translations": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
}
|
||||
}
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"nested": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/nested"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0",
|
||||
"$typename": "int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"$typename": "url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"non_optional"
|
||||
],
|
||||
"$typename": "nested",
|
||||
"description_translations": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
}
|
||||
}
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -858,54 +719,141 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"int_prop": {
|
||||
"default_value": "0",
|
||||
"$resolved_refs": [
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url_prop": {
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"$resolved_refs": [
|
||||
"common.json#/url"
|
||||
],
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"nested": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"non_optional"
|
||||
],
|
||||
"description_translations": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
}
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$resolved_refs": [
|
||||
"entity.json"
|
||||
],
|
||||
"type": "$defined_entity"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
"format": "uri"
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
"nested": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/nested"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$resolved_refs": [
|
||||
"#/definitions/int_prop",
|
||||
"common.json#/non_negative_integer"
|
||||
],
|
||||
"default_value": "0",
|
||||
"type": "integer",
|
||||
"constraint": "number >= 0",
|
||||
"$typename": "int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$resolved_refs": [
|
||||
"#/definitions/url_prop",
|
||||
"common.json#/url"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru",
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"$typename": "url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"minItems": 1
|
||||
"required": [
|
||||
"non_optional"
|
||||
],
|
||||
"$typename": "nested",
|
||||
"description_translations": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
"type"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -1026,6 +974,58 @@
|
||||
"ru": "Объект с простыми свойствами."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$resolved_refs": [
|
||||
"entity.json"
|
||||
],
|
||||
"type": "$defined_entity"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -288,50 +288,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity.json": {
|
||||
"anyOf": [
|
||||
@@ -396,61 +352,47 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"int_prop": {
|
||||
"$ref": "common.json#/non_negative_integer",
|
||||
"default_value": "0"
|
||||
},
|
||||
"url_prop": {
|
||||
"$ref": "common.json#/url",
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru"
|
||||
},
|
||||
"nested": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"$description": "translations.json#/entity_with_property_with_default_value_nested",
|
||||
"required": [
|
||||
"non_optional"
|
||||
]
|
||||
}
|
||||
"translations.json": {
|
||||
"entity_with_property_with_default_value_nested": {
|
||||
"en": "non_optional is used to suppress auto-generation of default value for object with all-optional fields.",
|
||||
"ru": "non_optional используется, чтобы запретить автогенерацию дефолтного значения для объекта, все свойства которого опциональны."
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"nested": {
|
||||
"$ref": "#/definitions/nested"
|
||||
}
|
||||
"entity_with_simple_properties": {
|
||||
"en": "Entity with simple properties.",
|
||||
"ru": "Объект с простыми свойствами."
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
"entity_with_simple_properties_id": {
|
||||
"en": "ID. Can't contain expressions.",
|
||||
"ru": "Идентификатор. Не может содержать выражение."
|
||||
},
|
||||
"entity_with_simple_properties_string": {
|
||||
"en": "String.",
|
||||
"ru": "Строка."
|
||||
},
|
||||
"entity_with_simple_properties_integer": {
|
||||
"en": "Integer.",
|
||||
"ru": "Целое число."
|
||||
},
|
||||
"entity_with_simple_properties_double": {
|
||||
"en": "Floating point number.",
|
||||
"ru": "Число с плавающей точкой."
|
||||
},
|
||||
"entity_with_simple_properties_boolean": {
|
||||
"en": "Boolean property.",
|
||||
"ru": "Логическое значение."
|
||||
},
|
||||
"entity_with_simple_properties_boolean_int": {
|
||||
"en": "Boolean value in numeric format.",
|
||||
"ru": "Логическое значение в числовом формате."
|
||||
},
|
||||
"entity_with_simple_properties_positive_integer": {
|
||||
"en": "Positive integer.",
|
||||
"ru": "Положительное целое число."
|
||||
},
|
||||
"entity_with_simple_properties_color": {
|
||||
"en": "Color.",
|
||||
"ru": "Цвет."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -595,51 +537,60 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"entity_with_property_with_default_value.json": {
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"int_prop": {
|
||||
"$ref": "common.json#/non_negative_integer",
|
||||
"default_value": "0"
|
||||
},
|
||||
"url_prop": {
|
||||
"$ref": "common.json#/url",
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"default_value": "https://yandex.ru"
|
||||
},
|
||||
"nested": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"non_optional": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"$description": "translations.json#/entity_with_property_with_default_value_nested",
|
||||
"required": [
|
||||
"non_optional"
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
"entity_with_property_with_default_value"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "entity.json"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
"int": {
|
||||
"alias_dart": "iNum",
|
||||
"$ref": "#/definitions/int_prop"
|
||||
},
|
||||
"url": {
|
||||
"$ref": "#/definitions/url_prop"
|
||||
},
|
||||
"nested": {
|
||||
"$ref": "#/definitions/nested"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
"type"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -708,6 +659,55 @@
|
||||
"type"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_strict_array.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_strict_array"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "entity.json"
|
||||
},
|
||||
"minItems": 1,
|
||||
"strictParsing": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity_with_string_array_property.json": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"entity_with_string_array_property"
|
||||
]
|
||||
},
|
||||
"array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"array"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"lang": "python",
|
||||
"header": "# Generated code. Do not modify.\n# flake8: noqa: F401, F405, F811\n\nfrom __future__ import annotations\nfrom pydivkit.core import BaseDiv, Field\nimport enum\nimport typing\n\n"
|
||||
"header": "# Generated code. Do not modify.\n# flake8: noqa: F401, F405, F811\n\nfrom __future__ import annotations\nfrom pydivkit.core import BaseDiv, Field, Expr\nimport enum\nimport typing\n\n"
|
||||
}
|
||||
|
||||
Generated
+512
-758
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,12 @@
|
||||
# flake8: noqa: F405
|
||||
from typing import Dict, Any
|
||||
from typing import Any, Dict
|
||||
|
||||
from pydivkit.core import Field, Ref
|
||||
from pydivkit.div import *
|
||||
from pydivkit.div import __all__ as __div_all__
|
||||
|
||||
|
||||
def make_card(log_id: str, *divs: Div):
|
||||
def make_card(log_id: str, *divs: Div) -> DivData:
|
||||
return DivData(
|
||||
log_id=log_id,
|
||||
states=[
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from .entities import BaseDiv, BaseEntity
|
||||
from .fields import Field, Ref
|
||||
from .fields import Expr, Field, Ref
|
||||
|
||||
|
||||
__all__ = (
|
||||
"BaseEntity",
|
||||
"BaseDiv",
|
||||
"Field",
|
||||
"Ref",
|
||||
"Expr",
|
||||
)
|
||||
|
||||
@@ -10,11 +10,11 @@ from functools import reduce
|
||||
from types import MappingProxyType
|
||||
from typing import (
|
||||
Any, Dict, FrozenSet, List, Mapping, Optional, Sequence, Set, Type, Union,
|
||||
get_args, get_origin, get_type_hints,
|
||||
get_args, get_origin, get_type_hints, Iterator, Tuple,
|
||||
)
|
||||
|
||||
from .compat import classproperty
|
||||
from .fields import _Field
|
||||
from .fields import Expr, _Field
|
||||
from .types.union import inject_types
|
||||
|
||||
|
||||
@@ -54,16 +54,20 @@ def _cast_value_type(value: Any, type_: Any) -> Any: # noqa
|
||||
return value
|
||||
|
||||
origin_type = get_origin(type_)
|
||||
if origin_type is list:
|
||||
if not isinstance(value, list):
|
||||
|
||||
if isinstance(origin_type, type) and isinstance(origin_type, (str, bytes)):
|
||||
return type_(value)
|
||||
|
||||
if isinstance(origin_type, type) and issubclass(origin_type, Sequence):
|
||||
if not isinstance(value, Sequence):
|
||||
raise ValueError(
|
||||
f"Value {value} has wrong type. Expected type is {type_}.",
|
||||
)
|
||||
element_type, *_ = get_args(type_)
|
||||
return [_cast_value_type(v, element_type) for v in value]
|
||||
|
||||
if origin_type is dict:
|
||||
if not isinstance(value, dict):
|
||||
if isinstance(origin_type, type) and issubclass(origin_type, Mapping):
|
||||
if not isinstance(value, Mapping):
|
||||
raise ValueError(
|
||||
f"Value {value} has wrong type. Expected type is {type_}.",
|
||||
)
|
||||
@@ -88,7 +92,9 @@ def _cast_value_type(value: Any, type_: Any) -> Any: # noqa
|
||||
raise ValueError(
|
||||
f"Union {type_} does not contain type {type_value}.",
|
||||
)
|
||||
raise ValueError(f"Value {value} does not have field {TYPE_FIELD}.")
|
||||
raise ValueError(
|
||||
f"Value {value} does not have field {TYPE_FIELD}.",
|
||||
)
|
||||
for u_type in get_args(type_):
|
||||
try:
|
||||
return _cast_value_type(value, u_type)
|
||||
@@ -123,11 +129,17 @@ def _cast_value_type(value: Any, type_: Any) -> Any: # noqa
|
||||
|
||||
|
||||
def dump(obj: Any) -> Any:
|
||||
if isinstance(obj, list):
|
||||
if isinstance(obj, (str, bytes)):
|
||||
return obj
|
||||
if isinstance(obj, Sequence):
|
||||
return [dump(obj_item) for obj_item in obj]
|
||||
elif isinstance(obj, BaseEntity):
|
||||
if isinstance(obj, Mapping):
|
||||
return {k: v for k, v in obj.items()}
|
||||
if isinstance(obj, Expr):
|
||||
return str(obj)
|
||||
if isinstance(obj, BaseEntity):
|
||||
return obj.dict()
|
||||
elif isinstance(obj, enum.Enum):
|
||||
if isinstance(obj, enum.Enum):
|
||||
return obj.value
|
||||
return obj
|
||||
|
||||
@@ -173,6 +185,8 @@ BUILTIN_TYPES_TO_SCHEMA: Mapping[type, Mapping[str, Any]] = MappingProxyType(
|
||||
},
|
||||
),
|
||||
str: MappingProxyType({"type": "string"}),
|
||||
bytes: MappingProxyType({"type": "string"}),
|
||||
Expr: MappingProxyType({"type": "string", "pattern": "^@{.*}$"}),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -244,14 +258,14 @@ def _field_to_schema(
|
||||
schema: Optional[SchemaType] = None
|
||||
if field and field.name == TYPE_FIELD and field.default:
|
||||
schema = _type_field_to_schema(field)
|
||||
elif origin is list:
|
||||
elif type_ in BUILTIN_TYPES_TO_SCHEMA:
|
||||
schema = {**BUILTIN_TYPES_TO_SCHEMA[type_]}
|
||||
elif isinstance(origin, type) and issubclass(origin, Sequence):
|
||||
schema = _list_to_schema(type_, definitions, exclude)
|
||||
elif origin is dict:
|
||||
elif isinstance(origin, type) and issubclass(origin, Mapping):
|
||||
schema = _dict_to_schema()
|
||||
elif origin is Union:
|
||||
schema = _union_to_schema(field, type_, exclude, definitions)
|
||||
elif type_ in BUILTIN_TYPES_TO_SCHEMA:
|
||||
schema = {**BUILTIN_TYPES_TO_SCHEMA[type_]}
|
||||
elif issubclass(type_, BaseEntity):
|
||||
schema = type_.schema_as_ref(definitions, exclude)
|
||||
elif issubclass(type_, enum.Enum):
|
||||
@@ -509,7 +523,9 @@ class BaseEntity:
|
||||
field_value = getattr(self, field_name, field.default)
|
||||
if field_value is not None:
|
||||
if isinstance(field_value, _Field) and field_value.ref_to:
|
||||
result[f"${field.field_name}"] = field_value.ref_to.field_name
|
||||
result[
|
||||
f"${field.field_name}"
|
||||
] = field_value.ref_to.field_name
|
||||
else:
|
||||
result[field.field_name] = dump(field_value)
|
||||
return result
|
||||
@@ -681,6 +697,44 @@ class BaseDiv(BaseEntity):
|
||||
ref_types[ref_uid] = field_type
|
||||
return MappingProxyType(ref_types)
|
||||
|
||||
@staticmethod
|
||||
def _make_union(type: Type[Any]) -> Set[Type[Any]]:
|
||||
if get_origin(type) is Union:
|
||||
return set(get_args(type))
|
||||
return {type}
|
||||
|
||||
@classmethod
|
||||
def _validate_subclass(
|
||||
cls,
|
||||
ref_type: Type[Any],
|
||||
expected_field_type: Type[Any],
|
||||
) -> bool:
|
||||
def _check_origins() -> Iterator[Tuple[Tuple[Any, ...], Tuple[Any, ...]]]:
|
||||
for ref in cls._make_union(ref_type):
|
||||
for expect in cls._make_union(expected_field_type):
|
||||
if get_origin(expect) == get_origin(ref):
|
||||
yield get_args(ref), get_args(expect)
|
||||
return None
|
||||
|
||||
for origins in _check_origins():
|
||||
if origins is None:
|
||||
return False
|
||||
|
||||
expect, ref = origins
|
||||
|
||||
if get_args(expect) == get_args(ref):
|
||||
return True
|
||||
|
||||
if not any(
|
||||
issubclass(exp, get_args(ref))
|
||||
for exp in get_args(expect)
|
||||
if get_origin(exp) is not Union
|
||||
):
|
||||
continue
|
||||
|
||||
return True
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def _validate_ref_types(cls) -> None:
|
||||
ref_types = cls._merge_ref_types(
|
||||
@@ -693,6 +747,9 @@ class BaseDiv(BaseEntity):
|
||||
if (
|
||||
ref_type != expected_field_type
|
||||
and ref_type != Optional[expected_field_type]
|
||||
and ref_type != Union[expected_field_type, Expr]
|
||||
and ref_type != Union[expected_field_type, Expr, None]
|
||||
and not cls._validate_subclass(ref_type, expected_field_type)
|
||||
):
|
||||
raise TypeError(
|
||||
f"Type of attribute '{field_name}' does "
|
||||
|
||||
@@ -23,7 +23,9 @@ class _Field:
|
||||
|
||||
def apply_constraints(self, constraints: Mapping[str, Any]) -> None:
|
||||
for c_key, c_value in constraints.items():
|
||||
if self.constraints.get(c_key) and self.constraints[c_key] != c_value:
|
||||
if self.constraints.get(c_key) and self.constraints[
|
||||
c_key
|
||||
] != c_value:
|
||||
raise ValueError(
|
||||
f"Incompatible constraints: {c_key} = "
|
||||
f"{self.constraints[c_key]} and {c_key} = {c_value}",
|
||||
@@ -82,3 +84,19 @@ def Ref(field: Any) -> Any:
|
||||
)
|
||||
field.is_ref = True
|
||||
return _Field(ref_to=field)
|
||||
|
||||
|
||||
class Expr:
|
||||
__slots__ = ("v",)
|
||||
v: str
|
||||
|
||||
def __init__(self, v: str):
|
||||
if not v.startswith("@{") or not v.endswith("}"):
|
||||
raise ValueError(f"failed to initiate Expr with {v}")
|
||||
self.v = v
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"Expr({self.v})"
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.v
|
||||
|
||||
@@ -19,6 +19,7 @@ from .div_aspect import DivAspect
|
||||
from .div_background import DivBackground
|
||||
from .div_base import DivBase
|
||||
from .div_blend_mode import DivBlendMode
|
||||
from .div_blur import DivBlur
|
||||
from .div_border import DivBorder
|
||||
from .div_change_bounds_transition import DivChangeBoundsTransition
|
||||
from .div_change_set_transition import DivChangeSetTransition
|
||||
@@ -30,15 +31,24 @@ from .div_container import (
|
||||
)
|
||||
from .div_corners_radius import DivCornersRadius
|
||||
from .div_count import DivCount
|
||||
from .div_currency_input_mask import DivCurrencyInputMask
|
||||
from .div_custom import DivCustom
|
||||
from .div_data import DivData, DivDataState
|
||||
from .div_default_indicator_item_placement import (
|
||||
DivDefaultIndicatorItemPlacement,
|
||||
)
|
||||
from .div_dimension import DivDimension
|
||||
from .div_disappear_action import DivDisappearAction
|
||||
from .div_download_callbacks import DivDownloadCallbacks
|
||||
from .div_drawable import DivDrawable
|
||||
from .div_edge_insets import DivEdgeInsets
|
||||
from .div_extension import DivExtension
|
||||
from .div_fade_transition import DivFadeTransition
|
||||
from .div_filter import DivFilter
|
||||
from .div_fixed_count import DivFixedCount
|
||||
from .div_fixed_length_input_mask import (
|
||||
DivFixedLengthInputMask, DivFixedLengthInputMaskPatternElement,
|
||||
)
|
||||
from .div_fixed_size import DivFixedSize
|
||||
from .div_focus import DivFocus, DivFocusNextFocusIds
|
||||
from .div_font_family import DivFontFamily
|
||||
@@ -53,8 +63,15 @@ from .div_image import DivImage
|
||||
from .div_image_background import DivImageBackground
|
||||
from .div_image_scale import DivImageScale
|
||||
from .div_indicator import DivIndicator, DivIndicatorAnimation
|
||||
from .div_indicator_item_placement import DivIndicatorItemPlacement
|
||||
from .div_infinity_count import DivInfinityCount
|
||||
from .div_input import DivInput, DivInputKeyboardType, DivInputNativeInterface
|
||||
from .div_input_mask import DivInputMask
|
||||
from .div_input_mask_base import DivInputMaskBase
|
||||
from .div_input_validator import DivInputValidator
|
||||
from .div_input_validator_base import DivInputValidatorBase
|
||||
from .div_input_validator_expression import DivInputValidatorExpression
|
||||
from .div_input_validator_regex import DivInputValidatorRegex
|
||||
from .div_line_style import DivLineStyle
|
||||
from .div_linear_gradient import DivLinearGradient
|
||||
from .div_match_parent_size import DivMatchParentSize
|
||||
@@ -79,6 +96,7 @@ from .div_radial_gradient_relative_radius import (
|
||||
)
|
||||
from .div_rounded_rectangle_shape import DivRoundedRectangleShape
|
||||
from .div_scale_transition import DivScaleTransition
|
||||
from .div_select import DivSelect, DivSelectOption
|
||||
from .div_separator import (
|
||||
DelimiterStyleOrientation, DivSeparator, DivSeparatorDelimiterStyle,
|
||||
)
|
||||
@@ -91,6 +109,9 @@ from .div_slide_transition import DivSlideTransition, DivSlideTransitionEdge
|
||||
from .div_slider import DivSlider, DivSliderTextStyle
|
||||
from .div_solid_background import DivSolidBackground
|
||||
from .div_state import DivState, DivStateState
|
||||
from .div_stretch_indicator_item_placement import (
|
||||
DivStretchIndicatorItemPlacement,
|
||||
)
|
||||
from .div_stroke import DivStroke
|
||||
from .div_tabs import (
|
||||
DivTabs, DivTabsItem, DivTabsTabTitleStyle, TabTitleStyleAnimationType,
|
||||
@@ -99,6 +120,9 @@ from .div_text import (
|
||||
DivText, DivTextEllipsis, DivTextImage, DivTextRange, DivTextTruncate,
|
||||
)
|
||||
from .div_text_gradient import DivTextGradient
|
||||
from .div_text_range_background import DivTextRangeBackground
|
||||
from .div_text_range_border import DivTextRangeBorder
|
||||
from .div_timer import DivTimer
|
||||
from .div_tooltip import DivTooltip, DivTooltipPosition
|
||||
from .div_transform import DivTransform
|
||||
from .div_transition_base import DivTransitionBase
|
||||
@@ -106,9 +130,13 @@ from .div_transition_selector import DivTransitionSelector
|
||||
from .div_transition_trigger import DivTransitionTrigger
|
||||
from .div_trigger import DivTrigger, DivTriggerMode
|
||||
from .div_variable import DivVariable
|
||||
from .div_video import DivVideo
|
||||
from .div_video_source import DivVideoSource, DivVideoSourceResolution
|
||||
from .div_visibility import DivVisibility
|
||||
from .div_visibility_action import DivVisibilityAction
|
||||
from .div_wrap_content_size import DivWrapContentSize
|
||||
from .div_wrap_content_size import (
|
||||
DivWrapContentSize, DivWrapContentSizeConstraintSize,
|
||||
)
|
||||
from .integer_variable import IntegerVariable
|
||||
from .number_variable import NumberVariable
|
||||
from .string_variable import StringVariable
|
||||
@@ -125,6 +153,7 @@ DivAnimation.update_forward_refs()
|
||||
DivAppearanceSetTransition.update_forward_refs()
|
||||
DivAspect.update_forward_refs()
|
||||
DivBase.update_forward_refs()
|
||||
DivBlur.update_forward_refs()
|
||||
DivBorder.update_forward_refs()
|
||||
DivChangeBoundsTransition.update_forward_refs()
|
||||
DivChangeSetTransition.update_forward_refs()
|
||||
@@ -132,15 +161,20 @@ DivCircleShape.update_forward_refs()
|
||||
DivContainer.update_forward_refs()
|
||||
DivContainerSeparator.update_forward_refs()
|
||||
DivCornersRadius.update_forward_refs()
|
||||
DivCurrencyInputMask.update_forward_refs()
|
||||
DivCustom.update_forward_refs()
|
||||
DivData.update_forward_refs()
|
||||
DivDataState.update_forward_refs()
|
||||
DivDefaultIndicatorItemPlacement.update_forward_refs()
|
||||
DivDimension.update_forward_refs()
|
||||
DivDisappearAction.update_forward_refs()
|
||||
DivDownloadCallbacks.update_forward_refs()
|
||||
DivEdgeInsets.update_forward_refs()
|
||||
DivExtension.update_forward_refs()
|
||||
DivFadeTransition.update_forward_refs()
|
||||
DivFixedCount.update_forward_refs()
|
||||
DivFixedLengthInputMask.update_forward_refs()
|
||||
DivFixedLengthInputMaskPatternElement.update_forward_refs()
|
||||
DivFixedSize.update_forward_refs()
|
||||
DivFocus.update_forward_refs()
|
||||
DivFocusNextFocusIds.update_forward_refs()
|
||||
@@ -153,6 +187,10 @@ DivIndicator.update_forward_refs()
|
||||
DivInfinityCount.update_forward_refs()
|
||||
DivInput.update_forward_refs()
|
||||
DivInputNativeInterface.update_forward_refs()
|
||||
DivInputMaskBase.update_forward_refs()
|
||||
DivInputValidatorBase.update_forward_refs()
|
||||
DivInputValidatorExpression.update_forward_refs()
|
||||
DivInputValidatorRegex.update_forward_refs()
|
||||
DivLinearGradient.update_forward_refs()
|
||||
DivMatchParentSize.update_forward_refs()
|
||||
DivNeighbourPageSize.update_forward_refs()
|
||||
@@ -171,6 +209,8 @@ DivRadialGradientRelativeCenter.update_forward_refs()
|
||||
DivRadialGradientRelativeRadius.update_forward_refs()
|
||||
DivRoundedRectangleShape.update_forward_refs()
|
||||
DivScaleTransition.update_forward_refs()
|
||||
DivSelect.update_forward_refs()
|
||||
DivSelectOption.update_forward_refs()
|
||||
DivSeparator.update_forward_refs()
|
||||
DivSeparatorDelimiterStyle.update_forward_refs()
|
||||
DivShadow.update_forward_refs()
|
||||
@@ -181,6 +221,7 @@ DivSliderTextStyle.update_forward_refs()
|
||||
DivSolidBackground.update_forward_refs()
|
||||
DivState.update_forward_refs()
|
||||
DivStateState.update_forward_refs()
|
||||
DivStretchIndicatorItemPlacement.update_forward_refs()
|
||||
DivStroke.update_forward_refs()
|
||||
DivTabs.update_forward_refs()
|
||||
DivTabsItem.update_forward_refs()
|
||||
@@ -189,15 +230,21 @@ DivText.update_forward_refs()
|
||||
DivTextEllipsis.update_forward_refs()
|
||||
DivTextImage.update_forward_refs()
|
||||
DivTextRange.update_forward_refs()
|
||||
DivTextRangeBorder.update_forward_refs()
|
||||
DivTimer.update_forward_refs()
|
||||
DivTooltip.update_forward_refs()
|
||||
DivTransform.update_forward_refs()
|
||||
DivTransitionBase.update_forward_refs()
|
||||
DivTrigger.update_forward_refs()
|
||||
DivVideo.update_forward_refs()
|
||||
DivVideoSource.update_forward_refs()
|
||||
DivVideoSourceResolution.update_forward_refs()
|
||||
DivVisibilityAction.update_forward_refs()
|
||||
DivWrapContentSize.update_forward_refs()
|
||||
DivWrapContentSizeConstraintSize.update_forward_refs()
|
||||
IntegerVariable.update_forward_refs()
|
||||
NumberVariable.update_forward_refs()
|
||||
StringVariable.update_forward_refs()
|
||||
UrlVariable.update_forward_refs()
|
||||
|
||||
__all__ = ("BooleanVariable", "ColorVariable", "DelimiterStyleOrientation", "Div", "DivAbsoluteEdgeInsets", "DivAccessibility", "DivAccessibilityMode", "DivAccessibilityType", "DivAction", "DivActionMenuItem", "DivActionTarget", "DivAlignmentHorizontal", "DivAlignmentVertical", "DivAnimation", "DivAnimationInterpolator", "DivAnimationName", "DivAppearanceSetTransition", "DivAppearanceTransition", "DivAspect", "DivBackground", "DivBase", "DivBlendMode", "DivBorder", "DivChangeBoundsTransition", "DivChangeSetTransition", "DivChangeTransition", "DivCircleShape", "DivContainer", "DivContainerLayoutMode", "DivContainerOrientation", "DivContainerSeparator", "DivCornersRadius", "DivCount", "DivCustom", "DivData", "DivDataState", "DivDimension", "DivDownloadCallbacks", "DivDrawable", "DivEdgeInsets", "DivExtension", "DivFadeTransition", "DivFixedCount", "DivFixedSize", "DivFocus", "DivFocusNextFocusIds", "DivFontFamily", "DivFontWeight", "DivGallery", "DivGalleryCrossContentAlignment", "DivGalleryOrientation", "DivGalleryScrollMode", "DivGifImage", "DivGrid", "DivImage", "DivImageBackground", "DivImageScale", "DivIndicator", "DivIndicatorAnimation", "DivInfinityCount", "DivInput", "DivInputKeyboardType", "DivInputNativeInterface", "DivLineStyle", "DivLinearGradient", "DivMatchParentSize", "DivNeighbourPageSize", "DivNinePatchBackground", "DivPageSize", "DivPager", "DivPagerLayoutMode", "DivPagerOrientation", "DivPatch", "DivPatchChange", "DivPatchMode", "DivPercentageSize", "DivPivot", "DivPivotFixed", "DivPivotPercentage", "DivPoint", "DivRadialGradient", "DivRadialGradientCenter", "DivRadialGradientFixedCenter", "DivRadialGradientRadius", "DivRadialGradientRelativeCenter", "DivRadialGradientRelativeRadius", "DivRadialGradientRelativeRadiusValue", "DivRoundedRectangleShape", "DivScaleTransition", "DivSeparator", "DivSeparatorDelimiterStyle", "DivShadow", "DivShape", "DivShapeDrawable", "DivSize", "DivSizeUnit", "DivSlideTransition", "DivSlideTransitionEdge", "DivSlider", "DivSliderTextStyle", "DivSolidBackground", "DivState", "DivStateState", "DivStroke", "DivTabs", "DivTabsItem", "DivTabsTabTitleStyle", "DivText", "DivTextEllipsis", "DivTextGradient", "DivTextImage", "DivTextRange", "DivTextTruncate", "DivTooltip", "DivTooltipPosition", "DivTransform", "DivTransitionBase", "DivTransitionSelector", "DivTransitionTrigger", "DivTrigger", "DivTriggerMode", "DivVariable", "DivVisibility", "DivVisibilityAction", "DivWrapContentSize", "IntegerVariable", "NumberVariable", "StringVariable", "TabTitleStyleAnimationType", "UrlVariable")
|
||||
__all__ = ("BooleanVariable", "ColorVariable", "DelimiterStyleOrientation", "Div", "DivAbsoluteEdgeInsets", "DivAccessibility", "DivAccessibilityMode", "DivAccessibilityType", "DivAction", "DivActionMenuItem", "DivActionTarget", "DivAlignmentHorizontal", "DivAlignmentVertical", "DivAnimation", "DivAnimationInterpolator", "DivAnimationName", "DivAppearanceSetTransition", "DivAppearanceTransition", "DivAspect", "DivBackground", "DivBase", "DivBlendMode", "DivBlur", "DivBorder", "DivChangeBoundsTransition", "DivChangeSetTransition", "DivChangeTransition", "DivCircleShape", "DivContainer", "DivContainerLayoutMode", "DivContainerOrientation", "DivContainerSeparator", "DivCornersRadius", "DivCount", "DivCurrencyInputMask", "DivCustom", "DivData", "DivDataState", "DivDefaultIndicatorItemPlacement", "DivDimension", "DivDisappearAction", "DivDownloadCallbacks", "DivDrawable", "DivEdgeInsets", "DivExtension", "DivFadeTransition", "DivFilter", "DivFixedCount", "DivFixedLengthInputMask", "DivFixedLengthInputMaskPatternElement", "DivFixedSize", "DivFocus", "DivFocusNextFocusIds", "DivFontFamily", "DivFontWeight", "DivGallery", "DivGalleryCrossContentAlignment", "DivGalleryOrientation", "DivGalleryScrollMode", "DivGifImage", "DivGrid", "DivImage", "DivImageBackground", "DivImageScale", "DivIndicator", "DivIndicatorAnimation", "DivIndicatorItemPlacement", "DivInfinityCount", "DivInput", "DivInputKeyboardType", "DivInputMask", "DivInputMaskBase", "DivInputNativeInterface", "DivInputValidator", "DivInputValidatorBase", "DivInputValidatorExpression", "DivInputValidatorRegex", "DivLineStyle", "DivLinearGradient", "DivMatchParentSize", "DivNeighbourPageSize", "DivNinePatchBackground", "DivPageSize", "DivPager", "DivPagerLayoutMode", "DivPagerOrientation", "DivPatch", "DivPatchChange", "DivPatchMode", "DivPercentageSize", "DivPivot", "DivPivotFixed", "DivPivotPercentage", "DivPoint", "DivRadialGradient", "DivRadialGradientCenter", "DivRadialGradientFixedCenter", "DivRadialGradientRadius", "DivRadialGradientRelativeCenter", "DivRadialGradientRelativeRadius", "DivRadialGradientRelativeRadiusValue", "DivRoundedRectangleShape", "DivScaleTransition", "DivSelect", "DivSelectOption", "DivSeparator", "DivSeparatorDelimiterStyle", "DivShadow", "DivShape", "DivShapeDrawable", "DivSize", "DivSizeUnit", "DivSlideTransition", "DivSlideTransitionEdge", "DivSlider", "DivSliderTextStyle", "DivSolidBackground", "DivState", "DivStateState", "DivStretchIndicatorItemPlacement", "DivStroke", "DivTabs", "DivTabsItem", "DivTabsTabTitleStyle", "DivText", "DivTextEllipsis", "DivTextGradient", "DivTextImage", "DivTextRange", "DivTextRangeBackground", "DivTextRangeBorder", "DivTextTruncate", "DivTimer", "DivTooltip", "DivTooltipPosition", "DivTransform", "DivTransitionBase", "DivTransitionSelector", "DivTransitionTrigger", "DivTrigger", "DivTriggerMode", "DivVariable", "DivVideo", "DivVideoSource", "DivVideoSourceResolution", "DivVisibility", "DivVisibilityAction", "DivWrapContentSize", "DivWrapContentSizeConstraintSize", "IntegerVariable", "NumberVariable", "StringVariable", "TabTitleStyleAnimationType", "UrlVariable")
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# A Boolean variable in binary format.
|
||||
@@ -14,22 +14,24 @@ class BooleanVariable(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
name: str,
|
||||
value: bool,
|
||||
type: str = "boolean",
|
||||
name: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
value: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
name=name,
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="boolean")
|
||||
name: str = Field(
|
||||
name: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Variable name.",
|
||||
)
|
||||
value: bool = Field(
|
||||
value: typing.Union[Expr, bool] = Field(
|
||||
description="Value.",
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Variable — HEX color as a string.
|
||||
@@ -14,22 +14,24 @@ class ColorVariable(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
name: str,
|
||||
value: str,
|
||||
type: str = "color",
|
||||
name: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
value: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
name=name,
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="color")
|
||||
name: str = Field(
|
||||
name: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Variable name.",
|
||||
)
|
||||
value: str = Field(
|
||||
value: typing.Union[Expr, str] = Field(
|
||||
format="color",
|
||||
description="Value.",
|
||||
)
|
||||
|
||||
@@ -7,12 +7,12 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_container, div_custom, div_gallery, div_gif_image, div_grid, div_image,
|
||||
div_indicator, div_input, div_pager, div_separator, div_slider, div_state,
|
||||
div_tabs, div_text,
|
||||
div_indicator, div_input, div_pager, div_select, div_separator, div_slider,
|
||||
div_state, div_tabs, div_text, div_video,
|
||||
)
|
||||
|
||||
|
||||
@@ -31,4 +31,6 @@ Div = Union[
|
||||
div_indicator.DivIndicator,
|
||||
div_slider.DivSlider,
|
||||
div_input.DivInput,
|
||||
div_select.DivSelect,
|
||||
div_video.DivVideo,
|
||||
]
|
||||
|
||||
@@ -6,36 +6,38 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Sets the margins, without taking the properties of the screen.
|
||||
# Sets margins without regard to screen properties.
|
||||
class DivAbsoluteEdgeInsets(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
bottom: typing.Optional[int] = None,
|
||||
left: typing.Optional[int] = None,
|
||||
right: typing.Optional[int] = None,
|
||||
top: typing.Optional[int] = None,
|
||||
bottom: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
left: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
right: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
top: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
bottom=bottom,
|
||||
left=left,
|
||||
right=right,
|
||||
top=top,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
bottom: typing.Optional[int] = Field(
|
||||
bottom: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Bottom margin.",
|
||||
)
|
||||
left: typing.Optional[int] = Field(
|
||||
left: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Left margin.",
|
||||
)
|
||||
right: typing.Optional[int] = Field(
|
||||
right: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Right margin.",
|
||||
)
|
||||
top: typing.Optional[int] = Field(
|
||||
top: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Top margin.",
|
||||
)
|
||||
|
||||
|
||||
@@ -6,20 +6,21 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Accessibility for disabled people.
|
||||
# Accessibility settings.
|
||||
class DivAccessibility(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
description: typing.Optional[str] = None,
|
||||
hint: typing.Optional[str] = None,
|
||||
mode: typing.Optional[DivAccessibilityMode] = None,
|
||||
mute_after_action: typing.Optional[bool] = None,
|
||||
state_description: typing.Optional[str] = None,
|
||||
type: typing.Optional[DivAccessibilityType] = None,
|
||||
description: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
hint: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
mode: typing.Optional[typing.Union[Expr, DivAccessibilityMode]] = None,
|
||||
mute_after_action: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
state_description: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
type: typing.Optional[typing.Union[Expr, DivAccessibilityType]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
description=description,
|
||||
@@ -28,16 +29,17 @@ class DivAccessibility(BaseDiv):
|
||||
mute_after_action=mute_after_action,
|
||||
state_description=state_description,
|
||||
type=type,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
description: typing.Optional[str] = Field(
|
||||
description: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element description. It is used as the main description for "
|
||||
"screen readingapplications."
|
||||
),
|
||||
)
|
||||
hint: typing.Optional[str] = Field(
|
||||
hint: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"A tooltip of what will happen during interaction. If Speak "
|
||||
@@ -45,7 +47,7 @@ class DivAccessibility(BaseDiv):
|
||||
"is played after `description`."
|
||||
),
|
||||
)
|
||||
mode: typing.Optional[DivAccessibilityMode] = Field(
|
||||
mode: typing.Optional[typing.Union[Expr, DivAccessibilityMode]] = Field(
|
||||
description=(
|
||||
"The way the accessibility tree is organized. In the `merge` "
|
||||
"mode theaccessibility service perceives an element together "
|
||||
@@ -53,13 +55,13 @@ class DivAccessibility(BaseDiv):
|
||||
"together with a subtree isn\'t available foraccessibility."
|
||||
),
|
||||
)
|
||||
mute_after_action: typing.Optional[bool] = Field(
|
||||
mute_after_action: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description=(
|
||||
"Mutes the sound of the screen reader after interacting with "
|
||||
"the element."
|
||||
"Mutes the screen reader sound after interacting with the "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
state_description: typing.Optional[str] = Field(
|
||||
state_description: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Description of the current state of an element. For "
|
||||
@@ -68,10 +70,11 @@ class DivAccessibility(BaseDiv):
|
||||
"switch."
|
||||
),
|
||||
)
|
||||
type: typing.Optional[DivAccessibilityType] = Field(
|
||||
type: typing.Optional[typing.Union[Expr, DivAccessibilityType]] = Field(
|
||||
description=(
|
||||
"Element role. It is used for correct identification of an "
|
||||
"element by anaccessibility service."
|
||||
"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."
|
||||
),
|
||||
)
|
||||
|
||||
@@ -90,6 +93,7 @@ class DivAccessibilityType(str, enum.Enum):
|
||||
EDIT_TEXT = "edit_text"
|
||||
HEADER = "header"
|
||||
TAB_BAR = "tab_bar"
|
||||
LIST = "list"
|
||||
|
||||
|
||||
DivAccessibility.update_forward_refs()
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_download_callbacks
|
||||
|
||||
@@ -16,14 +16,15 @@ class DivAction(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
log_id: str,
|
||||
download_callbacks: typing.Optional[div_download_callbacks.DivDownloadCallbacks] = None,
|
||||
log_url: typing.Optional[str] = None,
|
||||
menu_items: typing.Optional[typing.List[DivActionMenuItem]] = None,
|
||||
log_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
log_url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
menu_items: typing.Optional[typing.Sequence[DivActionMenuItem]] = None,
|
||||
payload: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
referer: typing.Optional[str] = None,
|
||||
target: typing.Optional[DivActionTarget] = None,
|
||||
url: typing.Optional[str] = None,
|
||||
referer: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
target: typing.Optional[typing.Union[Expr, DivActionTarget]] = None,
|
||||
url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
download_callbacks=download_callbacks,
|
||||
@@ -34,6 +35,7 @@ class DivAction(BaseDiv):
|
||||
referer=referer,
|
||||
target=target,
|
||||
url=url,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
download_callbacks: typing.Optional[div_download_callbacks.DivDownloadCallbacks] = Field(
|
||||
@@ -42,29 +44,29 @@ class DivAction(BaseDiv):
|
||||
"[dataloading](../../interaction.dita#loading-data)."
|
||||
),
|
||||
)
|
||||
log_id: str = Field(
|
||||
log_id: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Logging ID.",
|
||||
)
|
||||
log_url: typing.Optional[str] = Field(
|
||||
log_url: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri",
|
||||
description="URL for logging.",
|
||||
)
|
||||
menu_items: typing.Optional[typing.List[DivActionMenuItem]] = Field(
|
||||
menu_items: typing.Optional[typing.Sequence[DivActionMenuItem]] = Field(
|
||||
min_items=1,
|
||||
description="Context menu.",
|
||||
)
|
||||
payload: typing.Optional[typing.Dict[str, typing.Any]] = Field(
|
||||
description="Additional parameters, passed to the host application.",
|
||||
)
|
||||
referer: typing.Optional[str] = Field(
|
||||
referer: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri",
|
||||
description="Referer URL for logging.",
|
||||
)
|
||||
target: typing.Optional[DivActionTarget] = Field(
|
||||
target: typing.Optional[typing.Union[Expr, DivActionTarget]] = Field(
|
||||
description="The tab in which the URL must be opened.",
|
||||
)
|
||||
url: typing.Optional[str] = Field(
|
||||
url: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri",
|
||||
description=(
|
||||
"URL. Possible values: `url` or `div-action://`. To learn "
|
||||
@@ -83,14 +85,16 @@ class DivActionMenuItem(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
text: str,
|
||||
action: typing.Optional[DivAction] = None,
|
||||
actions: typing.Optional[typing.List[DivAction]] = None,
|
||||
actions: typing.Optional[typing.Sequence[DivAction]] = None,
|
||||
text: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
action=action,
|
||||
actions=actions,
|
||||
text=text,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
action: typing.Optional[DivAction] = Field(
|
||||
@@ -99,11 +103,11 @@ class DivActionMenuItem(BaseDiv):
|
||||
"`actions` parameter isset."
|
||||
),
|
||||
)
|
||||
actions: typing.Optional[typing.List[DivAction]] = Field(
|
||||
actions: typing.Optional[typing.Sequence[DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Multiple actions when clicking on a menu item.",
|
||||
)
|
||||
text: str = Field(
|
||||
text: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Menu item title.",
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivAlignmentHorizontal(str, enum.Enum):
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivAlignmentVertical(str, enum.Enum):
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_animation_interpolator, div_count
|
||||
|
||||
@@ -16,14 +16,15 @@ class DivAnimation(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
name: DivAnimationName,
|
||||
duration: typing.Optional[int] = None,
|
||||
end_value: typing.Optional[float] = None,
|
||||
interpolator: typing.Optional[div_animation_interpolator.DivAnimationInterpolator] = None,
|
||||
items: typing.Optional[typing.List[DivAnimation]] = None,
|
||||
duration: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
end_value: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
interpolator: typing.Optional[typing.Union[Expr, div_animation_interpolator.DivAnimationInterpolator]] = None,
|
||||
items: typing.Optional[typing.Sequence[DivAnimation]] = None,
|
||||
name: typing.Optional[typing.Union[Expr, DivAnimationName]] = None,
|
||||
repeat: typing.Optional[div_count.DivCount] = None,
|
||||
start_delay: typing.Optional[int] = None,
|
||||
start_value: typing.Optional[float] = None,
|
||||
start_delay: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
start_value: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
duration=duration,
|
||||
@@ -34,15 +35,16 @@ class DivAnimation(BaseDiv):
|
||||
repeat=repeat,
|
||||
start_delay=start_delay,
|
||||
start_value=start_value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
duration: typing.Optional[int] = Field(
|
||||
duration: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Animation duration in milliseconds.",
|
||||
)
|
||||
end_value: typing.Optional[float] = Field(
|
||||
end_value: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description="Final value of an animation.",
|
||||
)
|
||||
interpolator: typing.Optional[div_animation_interpolator.DivAnimationInterpolator] = Field(
|
||||
interpolator: typing.Optional[typing.Union[Expr, div_animation_interpolator.DivAnimationInterpolator]] = Field(
|
||||
description=(
|
||||
"Animation speed nature. When the value is set to `spring` — "
|
||||
"animation of dampingfluctuations cut to 0.7 with the "
|
||||
@@ -53,20 +55,20 @@ class DivAnimation(BaseDiv):
|
||||
"0.58, 1);`ease_in_out` — cubic-bezier(0.42, 0,0.58, 1)."
|
||||
),
|
||||
)
|
||||
items: typing.Optional[typing.List[DivAnimation]] = Field(
|
||||
items: typing.Optional[typing.Sequence[DivAnimation]] = Field(
|
||||
min_items=1,
|
||||
description="Animation elements.",
|
||||
)
|
||||
name: DivAnimationName = Field(
|
||||
name: typing.Union[Expr, DivAnimationName] = Field(
|
||||
description="Animation type.",
|
||||
)
|
||||
repeat: typing.Optional[div_count.DivCount] = Field(
|
||||
description="Number of animation repetitions.",
|
||||
)
|
||||
start_delay: typing.Optional[int] = Field(
|
||||
start_delay: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Delay in milliseconds before animation starts.",
|
||||
)
|
||||
start_value: typing.Optional[float] = Field(
|
||||
start_value: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description="Starting value of an animation.",
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivAnimationInterpolator(str, enum.Enum):
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_appearance_transition
|
||||
|
||||
@@ -16,16 +16,18 @@ class DivAppearanceSetTransition(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[div_appearance_transition.DivAppearanceTransition],
|
||||
type: str = "set",
|
||||
items: typing.Optional[typing.Sequence[div_appearance_transition.DivAppearanceTransition]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
items=items,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="set")
|
||||
items: typing.List[div_appearance_transition.DivAppearanceTransition] = Field(
|
||||
items: typing.Sequence[div_appearance_transition.DivAppearanceTransition] = Field(
|
||||
min_items=1,
|
||||
description="An array of animations.",
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_appearance_set_transition, div_fade_transition, div_scale_transition,
|
||||
|
||||
@@ -6,23 +6,25 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Size with a fixed aspect ratio. It counts height from width and ignores other
|
||||
# specified height values.
|
||||
# Fixed aspect ratio. The element's height is calculated based on the width,
|
||||
# ignoring the `height` value.
|
||||
class DivAspect(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
ratio: float,
|
||||
ratio: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
ratio=ratio,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
ratio: float = Field(
|
||||
description="`ratio = width / height`.",
|
||||
ratio: typing.Union[Expr, float] = Field(
|
||||
description="`height = width / ratio`.",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_image_background, div_linear_gradient, div_nine_patch_background,
|
||||
|
||||
@@ -6,14 +6,14 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_appearance_transition, div_background,
|
||||
div_border, div_change_transition, div_edge_insets, div_extension,
|
||||
div_focus, div_size, div_tooltip, div_transform, div_transition_trigger,
|
||||
div_visibility, div_visibility_action,
|
||||
div_border, div_change_transition, div_disappear_action, div_edge_insets,
|
||||
div_extension, div_focus, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -22,30 +22,32 @@ class DivBase(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
accessibility=accessibility,
|
||||
@@ -55,6 +57,7 @@ class DivBase(BaseDiv):
|
||||
background=background,
|
||||
border=border,
|
||||
column_span=column_span,
|
||||
disappear_actions=disappear_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
height=height,
|
||||
@@ -73,42 +76,47 @@ class DivBase(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -128,7 +136,7 @@ class DivBase(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
@@ -141,20 +149,20 @@ class DivBase(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -164,9 +172,8 @@ class DivBase(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -190,14 +197,14 @@ class DivBase(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -206,7 +213,7 @@ class DivBase(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivBlendMode(str, enum.Enum):
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Gaussian image blur.
|
||||
class DivBlur(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "blur",
|
||||
radius: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
radius=radius,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="blur")
|
||||
radius: typing.Union[Expr, int] = Field(
|
||||
description=(
|
||||
"Blur radius. Defines how many pixels blend into each other. "
|
||||
"Specified in: `dp`."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
DivBlur.update_forward_refs()
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_corners_radius, div_shadow, div_stroke
|
||||
|
||||
@@ -16,11 +16,12 @@ class DivBorder(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
corner_radius: typing.Optional[int] = None,
|
||||
corner_radius: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
corners_radius: typing.Optional[div_corners_radius.DivCornersRadius] = None,
|
||||
has_shadow: typing.Optional[bool] = None,
|
||||
has_shadow: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
shadow: typing.Optional[div_shadow.DivShadow] = None,
|
||||
stroke: typing.Optional[div_stroke.DivStroke] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
corner_radius=corner_radius,
|
||||
@@ -28,9 +29,10 @@ class DivBorder(BaseDiv):
|
||||
has_shadow=has_shadow,
|
||||
shadow=shadow,
|
||||
stroke=stroke,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
corner_radius: typing.Optional[int] = Field(
|
||||
corner_radius: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"One radius of element and stroke corner rounding. Has a "
|
||||
"lower priority than`corners_radius`."
|
||||
@@ -39,7 +41,7 @@ class DivBorder(BaseDiv):
|
||||
corners_radius: typing.Optional[div_corners_radius.DivCornersRadius] = Field(
|
||||
description="Multiple radii of element and stroke corner rounding.",
|
||||
)
|
||||
has_shadow: typing.Optional[bool] = Field(
|
||||
has_shadow: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Adding shadow.",
|
||||
)
|
||||
shadow: typing.Optional[div_shadow.DivShadow] = Field(
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_animation_interpolator
|
||||
|
||||
@@ -17,25 +17,27 @@ class DivChangeBoundsTransition(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "change_bounds",
|
||||
duration: typing.Optional[int] = None,
|
||||
interpolator: typing.Optional[div_animation_interpolator.DivAnimationInterpolator] = None,
|
||||
start_delay: typing.Optional[int] = None,
|
||||
duration: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
interpolator: typing.Optional[typing.Union[Expr, div_animation_interpolator.DivAnimationInterpolator]] = None,
|
||||
start_delay: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
duration=duration,
|
||||
interpolator=interpolator,
|
||||
start_delay=start_delay,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="change_bounds")
|
||||
duration: typing.Optional[int] = Field(
|
||||
duration: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Animation duration in milliseconds.",
|
||||
)
|
||||
interpolator: typing.Optional[div_animation_interpolator.DivAnimationInterpolator] = Field(
|
||||
interpolator: typing.Optional[typing.Union[Expr, div_animation_interpolator.DivAnimationInterpolator]] = Field(
|
||||
description="Transition speed nature.",
|
||||
)
|
||||
start_delay: typing.Optional[int] = Field(
|
||||
start_delay: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Delay in milliseconds before animation starts.",
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_change_transition
|
||||
|
||||
@@ -16,16 +16,18 @@ class DivChangeSetTransition(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[div_change_transition.DivChangeTransition],
|
||||
type: str = "set",
|
||||
items: typing.Optional[typing.Sequence[div_change_transition.DivChangeTransition]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
items=items,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="set")
|
||||
items: typing.List[div_change_transition.DivChangeTransition] = Field(
|
||||
items: typing.Sequence[div_change_transition.DivChangeTransition] = Field(
|
||||
min_items=1,
|
||||
description="List of animations.",
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_change_bounds_transition, div_change_set_transition
|
||||
|
||||
|
||||
@@ -6,28 +6,41 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_fixed_size
|
||||
from . import div_fixed_size, div_stroke
|
||||
|
||||
|
||||
# A circle.
|
||||
# Circle.
|
||||
class DivCircleShape(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "circle",
|
||||
background_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
radius: typing.Optional[div_fixed_size.DivFixedSize] = None,
|
||||
stroke: typing.Optional[div_stroke.DivStroke] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
background_color=background_color,
|
||||
radius=radius,
|
||||
stroke=stroke,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="circle")
|
||||
background_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Fill color.",
|
||||
)
|
||||
radius: typing.Optional[div_fixed_size.DivFixedSize] = Field(
|
||||
description="Radius.",
|
||||
)
|
||||
stroke: typing.Optional[div_stroke.DivStroke] = Field(
|
||||
description="Stroke style.",
|
||||
)
|
||||
|
||||
|
||||
DivCircleShape.update_forward_refs()
|
||||
|
||||
@@ -6,15 +6,15 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div, div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_animation, div_appearance_transition,
|
||||
div_background, div_border, div_change_transition, div_drawable,
|
||||
div_edge_insets, div_extension, div_focus, div_size, div_tooltip,
|
||||
div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
div_aspect, div_background, div_border, div_change_transition,
|
||||
div_disappear_action, div_drawable, div_edge_insets, div_extension,
|
||||
div_focus, div_size, div_tooltip, div_transform, div_transition_trigger,
|
||||
div_visibility, div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -25,44 +25,47 @@ class DivContainer(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[div.Div],
|
||||
type: str = "container",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
action: typing.Optional[div_action.DivAction] = None,
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = None,
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
aspect: typing.Optional[div_aspect.DivAspect] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
layout_mode: typing.Optional[DivContainerLayoutMode] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
items: typing.Optional[typing.Sequence[div.Div]] = None,
|
||||
layout_mode: typing.Optional[typing.Union[Expr, DivContainerLayoutMode]] = None,
|
||||
line_separator: typing.Optional[DivContainerSeparator] = None,
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
orientation: typing.Optional[DivContainerOrientation] = None,
|
||||
orientation: typing.Optional[typing.Union[Expr, DivContainerOrientation]] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
separator: typing.Optional[DivContainerSeparator] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -73,11 +76,13 @@ class DivContainer(BaseDiv):
|
||||
alignment_horizontal=alignment_horizontal,
|
||||
alignment_vertical=alignment_vertical,
|
||||
alpha=alpha,
|
||||
aspect=aspect,
|
||||
background=background,
|
||||
border=border,
|
||||
column_span=column_span,
|
||||
content_alignment_horizontal=content_alignment_horizontal,
|
||||
content_alignment_vertical=content_alignment_vertical,
|
||||
disappear_actions=disappear_actions,
|
||||
doubletap_actions=doubletap_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
@@ -103,11 +108,12 @@ class DivContainer(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="container")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
action: typing.Optional[div_action.DivAction] = Field(
|
||||
description=(
|
||||
@@ -117,65 +123,78 @@ class DivContainer(BaseDiv):
|
||||
)
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = Field(
|
||||
description=(
|
||||
"Action animation. Web supports `fade`, `scale` and `set` "
|
||||
"only."
|
||||
"Click animation. The web only supports the following "
|
||||
"values: `fade`, `scale`,`native`, `no_animation` and `set`."
|
||||
),
|
||||
)
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Multiple actions when clicking on an element.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
aspect: typing.Optional[div_aspect.DivAspect] = Field(
|
||||
description=(
|
||||
"Fixed aspect ratio of the container. The element\'s height "
|
||||
"is calculated based onthe width, ignoring the `height` "
|
||||
"parameter\'s value. On the web, support for "
|
||||
"the`aspect-ratio` CSS property is required to use this "
|
||||
"parameter."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Default alignment of elements. Not used if the "
|
||||
"`alignment_horizontal` parameteris set from the element "
|
||||
"field."
|
||||
"Horizontal element alignment. For child elements, it can be "
|
||||
"redefined using the`alignment_horizontal` property."
|
||||
),
|
||||
)
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Default alignment of elements. `baseline` value aligns "
|
||||
"elements having their ownbaseline along this baseline. "
|
||||
"Other elements are aligned by top side in thiscase. Not "
|
||||
"used if the `alignment_vertical` parameter is set from the "
|
||||
"elementfield."
|
||||
"Vertical element alignment. The `baseline` value aligns "
|
||||
"elements along their ownspecified baseline (for text and "
|
||||
"other elements that have a baseline). Elementsthat don\'t "
|
||||
"have their baseline value specified are aligned along the "
|
||||
"top edge.For child elements, it can be redefined using the "
|
||||
"`alignment_vertical` property."
|
||||
),
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Action when double-clicking on an element.",
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -195,45 +214,46 @@ class DivContainer(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
items: typing.List[div.Div] = Field(
|
||||
items: typing.Sequence[div.Div] = Field(
|
||||
min_items=1,
|
||||
description="Nested elements.",
|
||||
)
|
||||
layout_mode: typing.Optional[DivContainerLayoutMode] = Field(
|
||||
layout_mode: typing.Optional[typing.Union[Expr, DivContainerLayoutMode]] = Field(
|
||||
description=(
|
||||
"Method of placing elements. `wrap` value includes the "
|
||||
"transfer of elements to thenext line if they did not fit in "
|
||||
"the previous one. If the value is set to `wrap`,then a "
|
||||
"separate line will be allocated for all elements with a "
|
||||
"size value of`match_parent` along the main axis. If the "
|
||||
"value is set to `wrap`, then elementswith a size value of "
|
||||
"`match_parent` along the cross axis will be ignored."
|
||||
"Element placement method. The `wrap` value transfers "
|
||||
"elements to the next line ifthey don\'t fit in the previous "
|
||||
"one. If the `wrap` value is set:A separate line isallocated "
|
||||
"for each element along the main axis with the size value "
|
||||
"set to`match_parent`.Elements along the cross axis with the "
|
||||
"size value `match_parent`are ignored."
|
||||
),
|
||||
)
|
||||
line_separator: typing.Optional[DivContainerSeparator] = Field(
|
||||
description=(
|
||||
"Separator between elements along the cross axis. Not used "
|
||||
"if the `layout_mode`parameter has the value `no_wrap\'."
|
||||
"if the `layout_mode`parameter is set to `no_wrap`. Only new "
|
||||
"browsers are supported on the web (the`gap` property must "
|
||||
"be supported for flex blocks)."
|
||||
),
|
||||
)
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Action when long-clicking on an element. Doesn\'t work on "
|
||||
"the devices w/o touchgestures."
|
||||
"Action when long-clicking an element. Doesn\'t work on "
|
||||
"devices that don\'t supporttouch gestures."
|
||||
),
|
||||
)
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="External margins from the element stroke.",
|
||||
)
|
||||
orientation: typing.Optional[DivContainerOrientation] = Field(
|
||||
orientation: typing.Optional[typing.Union[Expr, DivContainerOrientation]] = Field(
|
||||
description=(
|
||||
"Location of elements. `overlap` value overlays elements on "
|
||||
"top of each other inthe order of enumeration. The lowest is "
|
||||
@@ -243,13 +263,13 @@ class DivContainer(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
@@ -259,10 +279,12 @@ class DivContainer(BaseDiv):
|
||||
separator: typing.Optional[DivContainerSeparator] = Field(
|
||||
description=(
|
||||
"Separator between elements along the main axis. Not used if "
|
||||
"the `orientation`parameter has the value `overlap\'."
|
||||
"the `orientation`parameter is set to `overlap`. Only new "
|
||||
"browsers are supported on the web (the`gap` property must "
|
||||
"be supported for flex blocks)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -272,9 +294,8 @@ class DivContainer(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -298,14 +319,14 @@ class DivContainer(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -314,7 +335,7 @@ class DivContainer(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
@@ -338,29 +359,31 @@ class DivContainerSeparator(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
style: div_drawable.DivDrawable,
|
||||
show_at_end: typing.Optional[bool] = None,
|
||||
show_at_start: typing.Optional[bool] = None,
|
||||
show_between: typing.Optional[bool] = None,
|
||||
show_at_end: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
show_at_start: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
show_between: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
style: typing.Optional[div_drawable.DivDrawable] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
show_at_end=show_at_end,
|
||||
show_at_start=show_at_start,
|
||||
show_between=show_between,
|
||||
style=style,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
show_at_end: typing.Optional[bool] = Field(
|
||||
description="Enables showing of separator after the last item.",
|
||||
show_at_end: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Enables displaying the separator after the last item.",
|
||||
)
|
||||
show_at_start: typing.Optional[bool] = Field(
|
||||
description="Enables showing of separator before the first item.",
|
||||
show_at_start: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Enables displaying the separator before the first item.",
|
||||
)
|
||||
show_between: typing.Optional[bool] = Field(
|
||||
description="Enables showing of separator between items.",
|
||||
show_between: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Enables displaying the separator between items.",
|
||||
)
|
||||
style: div_drawable.DivDrawable = Field(
|
||||
description="Style of the separator.",
|
||||
description="Separator style.",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Sets corner rounding.
|
||||
@@ -14,19 +14,21 @@ class DivCornersRadius(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
bottom_left: typing.Optional[int] = None,
|
||||
bottom_right: typing.Optional[int] = None,
|
||||
top_left: typing.Optional[int] = None,
|
||||
top_right: typing.Optional[int] = None,
|
||||
bottom_left: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
bottom_right: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
top_left: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
top_right: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
bottom_left=bottom_left,
|
||||
bottom_right=bottom_right,
|
||||
top_left=top_left,
|
||||
top_right=top_right,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
bottom_left: typing.Optional[int] = Field(
|
||||
bottom_left: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Rounding radius of a lower left corner. If not specified, "
|
||||
"then `corner_radius` isused."
|
||||
@@ -34,7 +36,7 @@ class DivCornersRadius(BaseDiv):
|
||||
,
|
||||
name="bottom-left",
|
||||
)
|
||||
bottom_right: typing.Optional[int] = Field(
|
||||
bottom_right: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Rounding radius of a lower right corner. If not specified, "
|
||||
"then `corner_radius`is used."
|
||||
@@ -42,7 +44,7 @@ class DivCornersRadius(BaseDiv):
|
||||
,
|
||||
name="bottom-right",
|
||||
)
|
||||
top_left: typing.Optional[int] = Field(
|
||||
top_left: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Rounding radius of an upper left corner. If not specified, "
|
||||
"then `corner_radius`is used."
|
||||
@@ -50,7 +52,7 @@ class DivCornersRadius(BaseDiv):
|
||||
,
|
||||
name="top-left",
|
||||
)
|
||||
top_right: typing.Optional[int] = Field(
|
||||
top_right: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Rounding radius of an upper right corner. If not specified, "
|
||||
"then `corner_radius`is used."
|
||||
|
||||
@@ -7,7 +7,7 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_fixed_count, div_infinity_count
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Mask for entering currency in the specified regional format.
|
||||
class DivCurrencyInputMask(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "currency",
|
||||
locale: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
raw_text_variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
locale=locale,
|
||||
raw_text_variable=raw_text_variable,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="currency")
|
||||
locale: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Language tag that the currency format should match, as per "
|
||||
"[IETF "
|
||||
"BCP47](https://en.wikipedia.org/wiki/IETF_language_tag). If "
|
||||
"the language is not set,it is defined automatically."
|
||||
),
|
||||
)
|
||||
raw_text_variable: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Name of the variable to store the unprocessed value.",
|
||||
)
|
||||
|
||||
|
||||
DivCurrencyInputMask.update_forward_refs()
|
||||
@@ -6,14 +6,14 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div, div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_appearance_transition, div_background,
|
||||
div_border, div_change_transition, div_edge_insets, div_extension,
|
||||
div_focus, div_size, div_tooltip, div_transform, div_transition_trigger,
|
||||
div_visibility, div_visibility_action,
|
||||
div_border, div_change_transition, div_disappear_action, div_edge_insets,
|
||||
div_extension, div_focus, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -23,35 +23,37 @@ class DivCustom(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
custom_type: str,
|
||||
type: str = "custom",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
custom_props: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
custom_type: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
items: typing.Optional[typing.List[div.Div]] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
items: typing.Optional[typing.Sequence[div.Div]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -64,6 +66,7 @@ class DivCustom(BaseDiv):
|
||||
column_span=column_span,
|
||||
custom_props=custom_props,
|
||||
custom_type=custom_type,
|
||||
disappear_actions=disappear_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
height=height,
|
||||
@@ -83,37 +86,38 @@ class DivCustom(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="custom")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
@@ -122,10 +126,14 @@ class DivCustom(BaseDiv):
|
||||
custom_props: typing.Optional[typing.Dict[str, typing.Any]] = Field(
|
||||
description="Element data for a host application.",
|
||||
)
|
||||
custom_type: str = Field(
|
||||
custom_type: typing.Union[Expr, str] = Field(
|
||||
description="Subtype of an element for a host application.",
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -145,14 +153,14 @@ class DivCustom(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
items: typing.Optional[typing.List[div.Div]] = Field(
|
||||
items: typing.Optional[typing.Sequence[div.Div]] = Field(
|
||||
min_items=1,
|
||||
description="Nested elements.",
|
||||
)
|
||||
@@ -162,20 +170,20 @@ class DivCustom(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -185,9 +193,8 @@ class DivCustom(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -211,14 +218,14 @@ class DivCustom(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -227,7 +234,7 @@ class DivCustom(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -6,9 +6,9 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div, div_transition_selector, div_trigger, div_variable
|
||||
from . import div, div_timer, div_transition_selector, div_trigger, div_variable
|
||||
|
||||
|
||||
# Root structure.
|
||||
@@ -16,25 +16,29 @@ class DivData(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
log_id: str,
|
||||
states: typing.List[DivDataState],
|
||||
transition_animation_selector: typing.Optional[div_transition_selector.DivTransitionSelector] = None,
|
||||
variable_triggers: typing.Optional[typing.List[div_trigger.DivTrigger]] = None,
|
||||
variables: typing.Optional[typing.List[div_variable.DivVariable]] = None,
|
||||
log_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
states: typing.Optional[typing.Sequence[DivDataState]] = None,
|
||||
timers: typing.Optional[typing.Sequence[div_timer.DivTimer]] = None,
|
||||
transition_animation_selector: typing.Optional[typing.Union[Expr, div_transition_selector.DivTransitionSelector]] = None,
|
||||
variable_triggers: typing.Optional[typing.Sequence[div_trigger.DivTrigger]] = None,
|
||||
variables: typing.Optional[typing.Sequence[div_variable.DivVariable]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
log_id=log_id,
|
||||
states=states,
|
||||
timers=timers,
|
||||
transition_animation_selector=transition_animation_selector,
|
||||
variable_triggers=variable_triggers,
|
||||
variables=variables,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
log_id: str = Field(
|
||||
log_id: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Logging ID.",
|
||||
)
|
||||
states: typing.List[DivDataState] = Field(
|
||||
states: typing.Sequence[DivDataState] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"A set of visual element states. Each element can have a few "
|
||||
@@ -43,14 +47,18 @@ class DivData(BaseDiv):
|
||||
"using[action](div-action.md)."
|
||||
),
|
||||
)
|
||||
transition_animation_selector: typing.Optional[div_transition_selector.DivTransitionSelector] = Field(
|
||||
timers: typing.Optional[typing.Sequence[div_timer.DivTimer]] = Field(
|
||||
min_items=1,
|
||||
description="List of timers.",
|
||||
)
|
||||
transition_animation_selector: typing.Optional[typing.Union[Expr, div_transition_selector.DivTransitionSelector]] = Field(
|
||||
description="Events that trigger transition animations. @deprecated",
|
||||
)
|
||||
variable_triggers: typing.Optional[typing.List[div_trigger.DivTrigger]] = Field(
|
||||
variable_triggers: typing.Optional[typing.Sequence[div_trigger.DivTrigger]] = Field(
|
||||
min_items=1,
|
||||
description="Triggers for changing variables.",
|
||||
)
|
||||
variables: typing.Optional[typing.List[div_variable.DivVariable]] = Field(
|
||||
variables: typing.Optional[typing.Sequence[div_variable.DivVariable]] = Field(
|
||||
min_items=1,
|
||||
description="Declaration of variables that can be used in an element.",
|
||||
)
|
||||
@@ -60,18 +68,20 @@ class DivDataState(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
div: div.Div,
|
||||
state_id: int,
|
||||
div: typing.Optional[div.Div] = None,
|
||||
state_id: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
div=div,
|
||||
state_id=state_id,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
div: div.Div = Field(
|
||||
description="Contents.",
|
||||
)
|
||||
state_id: int = Field(
|
||||
state_id: typing.Union[Expr, int] = Field(
|
||||
description="State ID.",
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_fixed_size
|
||||
|
||||
|
||||
# Element size adjusts to a parent element.
|
||||
class DivDefaultIndicatorItemPlacement(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "default",
|
||||
space_between_centers: typing.Optional[div_fixed_size.DivFixedSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
space_between_centers=space_between_centers,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="default")
|
||||
space_between_centers: typing.Optional[div_fixed_size.DivFixedSize] = Field(
|
||||
description="Spacing between indicator centers.",
|
||||
)
|
||||
|
||||
|
||||
DivDefaultIndicatorItemPlacement.update_forward_refs()
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_size_unit
|
||||
|
||||
@@ -16,17 +16,19 @@ class DivDimension(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
value: float,
|
||||
unit: typing.Optional[div_size_unit.DivSizeUnit] = None,
|
||||
unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = None,
|
||||
value: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
unit=unit,
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
unit: typing.Optional[div_size_unit.DivSizeUnit] = Field(
|
||||
unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = Field(
|
||||
)
|
||||
value: float = Field(
|
||||
value: typing.Union[Expr, float] = Field(
|
||||
description="Value.",
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_download_callbacks
|
||||
|
||||
|
||||
# Actions performed when an element becomes invisible.
|
||||
class DivDisappearAction(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
disappear_duration: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
download_callbacks: typing.Optional[div_download_callbacks.DivDownloadCallbacks] = None,
|
||||
log_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
log_limit: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
payload: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
referer: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
visibility_percentage: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
disappear_duration=disappear_duration,
|
||||
download_callbacks=download_callbacks,
|
||||
log_id=log_id,
|
||||
log_limit=log_limit,
|
||||
payload=payload,
|
||||
referer=referer,
|
||||
url=url,
|
||||
visibility_percentage=visibility_percentage,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
disappear_duration: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Time in milliseconds during which an element must be "
|
||||
"invisible to trigger`disappear-action`."
|
||||
),
|
||||
)
|
||||
download_callbacks: typing.Optional[div_download_callbacks.DivDownloadCallbacks] = Field(
|
||||
description=(
|
||||
"Callbacks that are called after "
|
||||
"[dataloading](../../interaction.dita#loading-data)."
|
||||
),
|
||||
)
|
||||
log_id: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Logging ID.",
|
||||
)
|
||||
log_limit: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Limit on the number of loggings. If `0`, the limit is "
|
||||
"removed."
|
||||
),
|
||||
)
|
||||
payload: typing.Optional[typing.Dict[str, typing.Any]] = Field(
|
||||
description="Additional parameters, passed to the host application.",
|
||||
)
|
||||
referer: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri",
|
||||
description="Referer URL for logging.",
|
||||
)
|
||||
url: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="uri",
|
||||
description=(
|
||||
"URL. Possible values: `url` or `div-action://`. To learn "
|
||||
"more, see [Interactionwith "
|
||||
"elements](../../interaction.dita)."
|
||||
),
|
||||
)
|
||||
visibility_percentage: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Percentage of the visible part of an element that triggers "
|
||||
"`disappear-action`."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
DivDisappearAction.update_forward_refs()
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_action
|
||||
|
||||
@@ -17,22 +17,24 @@ class DivDownloadCallbacks(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
on_fail_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
on_success_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
on_fail_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
on_success_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
on_fail_actions=on_fail_actions,
|
||||
on_success_actions=on_success_actions,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
on_fail_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
on_fail_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Actions in case of unsuccessful loading if the host "
|
||||
"reported it or the waitingtime expired."
|
||||
),
|
||||
)
|
||||
on_success_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
on_success_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions in case of successful loading.",
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_shape_drawable
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_size_unit
|
||||
|
||||
@@ -16,11 +16,12 @@ class DivEdgeInsets(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
bottom: typing.Optional[int] = None,
|
||||
left: typing.Optional[int] = None,
|
||||
right: typing.Optional[int] = None,
|
||||
top: typing.Optional[int] = None,
|
||||
unit: typing.Optional[div_size_unit.DivSizeUnit] = None,
|
||||
bottom: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
left: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
right: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
top: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
bottom=bottom,
|
||||
@@ -28,21 +29,22 @@ class DivEdgeInsets(BaseDiv):
|
||||
right=right,
|
||||
top=top,
|
||||
unit=unit,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
bottom: typing.Optional[int] = Field(
|
||||
bottom: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Bottom margin.",
|
||||
)
|
||||
left: typing.Optional[int] = Field(
|
||||
left: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Left margin.",
|
||||
)
|
||||
right: typing.Optional[int] = Field(
|
||||
right: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Right margin.",
|
||||
)
|
||||
top: typing.Optional[int] = Field(
|
||||
top: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Top margin.",
|
||||
)
|
||||
unit: typing.Optional[div_size_unit.DivSizeUnit] = Field(
|
||||
unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = Field(
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Extension that affects an element.
|
||||
@@ -14,15 +14,17 @@ class DivExtension(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
id: str,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
id=id,
|
||||
params=params,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
id: str = Field(
|
||||
id: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Extension ID.",
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_animation_interpolator
|
||||
|
||||
@@ -17,10 +17,11 @@ class DivFadeTransition(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "fade",
|
||||
alpha: typing.Optional[float] = None,
|
||||
duration: typing.Optional[int] = None,
|
||||
interpolator: typing.Optional[div_animation_interpolator.DivAnimationInterpolator] = None,
|
||||
start_delay: typing.Optional[int] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
duration: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
interpolator: typing.Optional[typing.Union[Expr, div_animation_interpolator.DivAnimationInterpolator]] = None,
|
||||
start_delay: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -28,22 +29,23 @@ class DivFadeTransition(BaseDiv):
|
||||
duration=duration,
|
||||
interpolator=interpolator,
|
||||
start_delay=start_delay,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="fade")
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Value of the alpha channel which the element starts "
|
||||
"appearing from or at which itfinishes disappearing."
|
||||
),
|
||||
)
|
||||
duration: typing.Optional[int] = Field(
|
||||
duration: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Animation duration in milliseconds.",
|
||||
)
|
||||
interpolator: typing.Optional[div_animation_interpolator.DivAnimationInterpolator] = Field(
|
||||
interpolator: typing.Optional[typing.Union[Expr, div_animation_interpolator.DivAnimationInterpolator]] = Field(
|
||||
description="Transition speed nature.",
|
||||
)
|
||||
start_delay: typing.Optional[int] = Field(
|
||||
start_delay: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Delay in milliseconds before animation starts.",
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_blur
|
||||
|
||||
|
||||
DivFilter = Union[
|
||||
div_blur.DivBlur,
|
||||
]
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Fixed number of repetitions.
|
||||
@@ -14,16 +14,18 @@ class DivFixedCount(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
value: int,
|
||||
type: str = "fixed",
|
||||
value: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="fixed")
|
||||
value: int = Field(
|
||||
value: typing.Union[Expr, int] = Field(
|
||||
description="Number of repetitions.",
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Mask for entering text with a fixed number of characters.
|
||||
class DivFixedLengthInputMask(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "fixed_length",
|
||||
always_visible: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
pattern: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
pattern_elements: typing.Optional[typing.Sequence[DivFixedLengthInputMaskPatternElement]] = None,
|
||||
raw_text_variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
always_visible=always_visible,
|
||||
pattern=pattern,
|
||||
pattern_elements=pattern_elements,
|
||||
raw_text_variable=raw_text_variable,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="fixed_length")
|
||||
always_visible: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description=(
|
||||
"If this option is enabled, the text field contains the mask "
|
||||
"before being filledin."
|
||||
),
|
||||
)
|
||||
pattern: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"String that sets the text input template. For example, the "
|
||||
"`+7 (###) ###-##-#`template for a phone number."
|
||||
),
|
||||
)
|
||||
pattern_elements: typing.Sequence[DivFixedLengthInputMaskPatternElement] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Template decoding is a description of the characters that "
|
||||
"will be replaced withuser input."
|
||||
),
|
||||
)
|
||||
raw_text_variable: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Name of the variable to store the unprocessed value.",
|
||||
)
|
||||
|
||||
|
||||
# Template decoding is a description of the characters that will be replaced with
|
||||
# user input.
|
||||
class DivFixedLengthInputMaskPatternElement(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
key: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
placeholder: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
regex: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
key=key,
|
||||
placeholder=placeholder,
|
||||
regex=regex,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
key: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"A character in the template that will be replaced with a "
|
||||
"user-defined character."
|
||||
),
|
||||
)
|
||||
placeholder: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
description=(
|
||||
"The character that\'s displayed in the input field where "
|
||||
"the user is expected toenter text. This is used if mask "
|
||||
"display is enabled."
|
||||
),
|
||||
)
|
||||
regex: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Regular expression for validating character inputs. For "
|
||||
"example, when a mask isdigit-only."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
DivFixedLengthInputMaskPatternElement.update_forward_refs()
|
||||
|
||||
|
||||
DivFixedLengthInputMask.update_forward_refs()
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_size_unit
|
||||
|
||||
@@ -16,25 +16,27 @@ class DivFixedSize(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
value: int,
|
||||
type: str = "fixed",
|
||||
unit: typing.Optional[div_size_unit.DivSizeUnit] = None,
|
||||
unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = None,
|
||||
value: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
unit=unit,
|
||||
value=value,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="fixed")
|
||||
unit: typing.Optional[div_size_unit.DivSizeUnit] = Field(
|
||||
unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = Field(
|
||||
description=(
|
||||
"Unit of measurement. To learn more about units of size "
|
||||
"measurement, see [Layoutinside the "
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
value: int = Field(
|
||||
value: typing.Union[Expr, int] = Field(
|
||||
description="Element size.",
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_action, div_background, div_border
|
||||
|
||||
@@ -16,11 +16,12 @@ class DivFocus(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
next_focus_ids: typing.Optional[DivFocusNextFocusIds] = None,
|
||||
on_blur: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
on_focus: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
on_blur: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
on_focus: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
background=background,
|
||||
@@ -28,9 +29,10 @@ class DivFocus(BaseDiv):
|
||||
next_focus_ids=next_focus_ids,
|
||||
on_blur=on_blur,
|
||||
on_focus=on_focus,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Background of an element when it is in focus. It can "
|
||||
@@ -38,16 +40,16 @@ class DivFocus(BaseDiv):
|
||||
),
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Border of an element when it is in focus",
|
||||
description="Border of an element when it\'s in focus.",
|
||||
)
|
||||
next_focus_ids: typing.Optional[DivFocusNextFocusIds] = Field(
|
||||
description="IDs of elements that will be next to get focus.",
|
||||
)
|
||||
on_blur: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
on_blur: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element loses focus.",
|
||||
)
|
||||
on_focus: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
on_focus: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element gets focus.",
|
||||
)
|
||||
@@ -58,11 +60,12 @@ class DivFocusNextFocusIds(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
down: typing.Optional[str] = None,
|
||||
forward: typing.Optional[str] = None,
|
||||
left: typing.Optional[str] = None,
|
||||
right: typing.Optional[str] = None,
|
||||
up: typing.Optional[str] = None,
|
||||
down: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
forward: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
left: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
right: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
up: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
down=down,
|
||||
@@ -70,21 +73,22 @@ class DivFocusNextFocusIds(BaseDiv):
|
||||
left=left,
|
||||
right=right,
|
||||
up=up,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
down: typing.Optional[str] = Field(
|
||||
down: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
)
|
||||
forward: typing.Optional[str] = Field(
|
||||
forward: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
)
|
||||
left: typing.Optional[str] = Field(
|
||||
left: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
)
|
||||
right: typing.Optional[str] = Field(
|
||||
right: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
)
|
||||
up: typing.Optional[str] = Field(
|
||||
up: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivFontFamily(str, enum.Enum):
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivFontWeight(str, enum.Enum):
|
||||
|
||||
@@ -6,14 +6,14 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div, div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_appearance_transition, div_background,
|
||||
div_border, div_change_transition, div_edge_insets, div_extension,
|
||||
div_focus, div_size, div_tooltip, div_transform, div_transition_trigger,
|
||||
div_visibility, div_visibility_action,
|
||||
div_border, div_change_transition, div_disappear_action, div_edge_insets,
|
||||
div_extension, div_focus, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -22,41 +22,43 @@ class DivGallery(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[div.Div],
|
||||
type: str = "gallery",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_count: typing.Optional[int] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
cross_content_alignment: typing.Optional[DivGalleryCrossContentAlignment] = None,
|
||||
cross_spacing: typing.Optional[int] = None,
|
||||
default_item: typing.Optional[int] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_count: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
cross_content_alignment: typing.Optional[typing.Union[Expr, DivGalleryCrossContentAlignment]] = None,
|
||||
cross_spacing: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
default_item: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
item_spacing: typing.Optional[int] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
item_spacing: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
items: typing.Optional[typing.Sequence[div.Div]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
orientation: typing.Optional[DivGalleryOrientation] = None,
|
||||
orientation: typing.Optional[typing.Union[Expr, DivGalleryOrientation]] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
restrict_parent_scroll: typing.Optional[bool] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
scroll_mode: typing.Optional[DivGalleryScrollMode] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
restrict_parent_scroll: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
scroll_mode: typing.Optional[typing.Union[Expr, DivGalleryScrollMode]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -71,6 +73,7 @@ class DivGallery(BaseDiv):
|
||||
cross_content_alignment=cross_content_alignment,
|
||||
cross_spacing=cross_spacing,
|
||||
default_item=default_item,
|
||||
disappear_actions=disappear_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
height=height,
|
||||
@@ -94,46 +97,47 @@ class DivGallery(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="gallery")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_count: typing.Optional[int] = Field(
|
||||
column_count: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Number of columns for block layout.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
cross_content_alignment: typing.Optional[DivGalleryCrossContentAlignment] = Field(
|
||||
cross_content_alignment: typing.Optional[typing.Union[Expr, DivGalleryCrossContentAlignment]] = Field(
|
||||
description=(
|
||||
"Aligning elements in the direction perpendicular to the "
|
||||
"scroll direction. Inhorizontal galleries:`start` — "
|
||||
@@ -143,13 +147,13 @@ class DivGallery(BaseDiv):
|
||||
"card;`center` — to the center;`end` — to the right."
|
||||
),
|
||||
)
|
||||
cross_spacing: typing.Optional[int] = Field(
|
||||
cross_spacing: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Spacing between elements across the scroll axis. Default "
|
||||
"value is `item_spacing`"
|
||||
"Spacing between elements across the scroll axis. By "
|
||||
"default, the value set to`item_spacing`."
|
||||
),
|
||||
)
|
||||
default_item: typing.Optional[int] = Field(
|
||||
default_item: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Ordinal number of the gallery element to be scrolled to by "
|
||||
"default. For`scroll_mode`:`default` — the scroll position "
|
||||
@@ -158,7 +162,11 @@ class DivGallery(BaseDiv):
|
||||
"to the center of the element."
|
||||
),
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -178,17 +186,17 @@ class DivGallery(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
item_spacing: typing.Optional[int] = Field(
|
||||
item_spacing: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Spacing between elements.",
|
||||
)
|
||||
items: typing.List[div.Div] = Field(
|
||||
items: typing.Sequence[div.Div] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Gallery elements. Scrolling to elements can be "
|
||||
@@ -211,38 +219,38 @@ class DivGallery(BaseDiv):
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="External margins from the element stroke.",
|
||||
)
|
||||
orientation: typing.Optional[DivGalleryOrientation] = Field(
|
||||
orientation: typing.Optional[typing.Union[Expr, DivGalleryOrientation]] = Field(
|
||||
description="Gallery orientation.",
|
||||
)
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
restrict_parent_scroll: typing.Optional[bool] = Field(
|
||||
restrict_parent_scroll: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description=(
|
||||
"If the parameter is enabled, the gallery won\'t transmit "
|
||||
"the scroll gesture to theparent element."
|
||||
),
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
scroll_mode: typing.Optional[DivGalleryScrollMode] = Field(
|
||||
scroll_mode: typing.Optional[typing.Union[Expr, DivGalleryScrollMode]] = Field(
|
||||
description=(
|
||||
"Scroll type: `default` — continuous, `paging` — "
|
||||
"page-by-page."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -252,9 +260,8 @@ class DivGallery(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -278,14 +285,14 @@ class DivGallery(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -294,7 +301,7 @@ class DivGallery(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -6,15 +6,15 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_animation, div_appearance_transition,
|
||||
div_aspect, div_background, div_border, div_change_transition,
|
||||
div_edge_insets, div_extension, div_focus, div_image_scale, div_size,
|
||||
div_tooltip, div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
div_disappear_action, div_edge_insets, div_extension, div_focus,
|
||||
div_image_scale, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -23,45 +23,47 @@ class DivGifImage(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
gif_url: str,
|
||||
type: str = "gif",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
action: typing.Optional[div_action.DivAction] = None,
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = None,
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
aspect: typing.Optional[div_aspect.DivAspect] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
gif_url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
placeholder_color: typing.Optional[str] = None,
|
||||
preload_required: typing.Optional[bool] = None,
|
||||
preview: typing.Optional[str] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
scale: typing.Optional[div_image_scale.DivImageScale] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
placeholder_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
preload_required: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
preview: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
scale: typing.Optional[typing.Union[Expr, div_image_scale.DivImageScale]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -78,6 +80,7 @@ class DivGifImage(BaseDiv):
|
||||
column_span=column_span,
|
||||
content_alignment_horizontal=content_alignment_horizontal,
|
||||
content_alignment_vertical=content_alignment_vertical,
|
||||
disappear_actions=disappear_actions,
|
||||
doubletap_actions=doubletap_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
@@ -103,11 +106,12 @@ class DivGifImage(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="gif")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
action: typing.Optional[div_action.DivAction] = Field(
|
||||
description=(
|
||||
@@ -117,57 +121,65 @@ class DivGifImage(BaseDiv):
|
||||
)
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = Field(
|
||||
description=(
|
||||
"Action animation. Web supports `fade`, `scale` and `set` "
|
||||
"only."
|
||||
"Click animation. The web only supports the following "
|
||||
"values: `fade`, `scale`,`native`, `no_animation` and `set`."
|
||||
),
|
||||
)
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Multiple actions when clicking on an element.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
aspect: typing.Optional[div_aspect.DivAspect] = Field(
|
||||
description=(
|
||||
"Fixed aspect ratio. The element\'s height is calculated "
|
||||
"based on the width,ignoring the `height` value."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description="Horizontal image alignment.",
|
||||
)
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description="Vertical image alignment.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Action when double-clicking on an element.",
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -178,7 +190,7 @@ class DivGifImage(BaseDiv):
|
||||
focus: typing.Optional[div_focus.DivFocus] = Field(
|
||||
description="Parameters when focusing on an element or losing focus.",
|
||||
)
|
||||
gif_url: str = Field(
|
||||
gif_url: typing.Union[Expr, str] = Field(
|
||||
format="uri",
|
||||
description="Direct URL to a GIF image.",
|
||||
)
|
||||
@@ -191,18 +203,18 @@ class DivGifImage(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Action when long-clicking on an element. Doesn\'t work on "
|
||||
"the devices w/o touchgestures."
|
||||
"Action when long-clicking an element. Doesn\'t work on "
|
||||
"devices that don\'t supporttouch gestures."
|
||||
),
|
||||
)
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
@@ -211,14 +223,14 @@ class DivGifImage(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
placeholder_color: typing.Optional[str] = Field(
|
||||
placeholder_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Placeholder background before the image is loaded.",
|
||||
)
|
||||
preload_required: typing.Optional[bool] = Field(
|
||||
preload_required: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Background image must be loaded before the display.",
|
||||
)
|
||||
preview: typing.Optional[str] = Field(
|
||||
preview: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Image preview encoded in `base64`. It will be shown instead "
|
||||
@@ -226,27 +238,27 @@ class DivGifImage(BaseDiv):
|
||||
"`data url`:`data:[;base64],<data>`"
|
||||
),
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
scale: typing.Optional[div_image_scale.DivImageScale] = Field(
|
||||
scale: typing.Optional[typing.Union[Expr, div_image_scale.DivImageScale]] = Field(
|
||||
description=(
|
||||
"Image scaling:`fit` places the entire image into the "
|
||||
"element (free space isfilled with background);`fill` scales "
|
||||
"the image to the element size and cuts offthe excess."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -256,9 +268,8 @@ class DivGifImage(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -282,14 +293,14 @@ class DivGifImage(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -298,7 +309,7 @@ class DivGifImage(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -6,14 +6,15 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div, div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_animation, div_appearance_transition,
|
||||
div_background, div_border, div_change_transition, div_edge_insets,
|
||||
div_extension, div_focus, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
div_background, div_border, div_change_transition, div_disappear_action,
|
||||
div_edge_insets, div_extension, div_focus, div_size, div_tooltip,
|
||||
div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -22,41 +23,43 @@ class DivGrid(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
column_count: int,
|
||||
items: typing.List[div.Div],
|
||||
type: str = "grid",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
action: typing.Optional[div_action.DivAction] = None,
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = None,
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_count: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
items: typing.Optional[typing.Sequence[div.Div]] = None,
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -73,6 +76,7 @@ class DivGrid(BaseDiv):
|
||||
column_span=column_span,
|
||||
content_alignment_horizontal=content_alignment_horizontal,
|
||||
content_alignment_vertical=content_alignment_vertical,
|
||||
disappear_actions=disappear_actions,
|
||||
doubletap_actions=doubletap_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
@@ -94,11 +98,12 @@ class DivGrid(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="grid")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
action: typing.Optional[div_action.DivAction] = Field(
|
||||
description=(
|
||||
@@ -108,58 +113,62 @@ class DivGrid(BaseDiv):
|
||||
)
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = Field(
|
||||
description=(
|
||||
"Action animation. Web supports `fade`, `scale` and `set` "
|
||||
"only."
|
||||
"Click animation. The web only supports the following "
|
||||
"values: `fade`, `scale`,`native`, `no_animation` and `set`."
|
||||
),
|
||||
)
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Multiple actions when clicking on an element.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_count: int = Field(
|
||||
column_count: typing.Union[Expr, int] = Field(
|
||||
description="Number of columns.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description="Horizontal alignment of grid contents.",
|
||||
)
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description="Vertical alignment of grid contents.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Action when double-clicking on an element.",
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -179,22 +188,22 @@ class DivGrid(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
items: typing.List[div.Div] = Field(
|
||||
items: typing.Sequence[div.Div] = Field(
|
||||
min_items=1,
|
||||
description="Contents.",
|
||||
)
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Action when long-clicking on an element. Doesn\'t work on "
|
||||
"the devices w/o touchgestures."
|
||||
"Action when long-clicking an element. Doesn\'t work on "
|
||||
"devices that don\'t supporttouch gestures."
|
||||
),
|
||||
)
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
@@ -203,20 +212,20 @@ class DivGrid(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -226,9 +235,8 @@ class DivGrid(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -252,14 +260,14 @@ class DivGrid(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -268,7 +276,7 @@ class DivGrid(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -6,15 +6,16 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_animation, div_appearance_transition,
|
||||
div_aspect, div_background, div_blend_mode, div_border,
|
||||
div_change_transition, div_edge_insets, div_extension, div_fade_transition,
|
||||
div_focus, div_image_scale, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
div_change_transition, div_disappear_action, div_edge_insets, div_extension,
|
||||
div_fade_transition, div_filter, div_focus, div_image_scale, div_size,
|
||||
div_tooltip, div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -23,49 +24,52 @@ class DivImage(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
image_url: str,
|
||||
type: str = "image",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
action: typing.Optional[div_action.DivAction] = None,
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = None,
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
appearance_animation: typing.Optional[div_fade_transition.DivFadeTransition] = None,
|
||||
aspect: typing.Optional[div_aspect.DivAspect] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
filters: typing.Optional[typing.Sequence[div_filter.DivFilter]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
high_priority_preview_show: typing.Optional[bool] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
high_priority_preview_show: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
image_url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
placeholder_color: typing.Optional[str] = None,
|
||||
preload_required: typing.Optional[bool] = None,
|
||||
preview: typing.Optional[str] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
scale: typing.Optional[div_image_scale.DivImageScale] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tint_color: typing.Optional[str] = None,
|
||||
tint_mode: typing.Optional[div_blend_mode.DivBlendMode] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
placeholder_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
preload_required: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
preview: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
scale: typing.Optional[typing.Union[Expr, div_image_scale.DivImageScale]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tint_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
tint_mode: typing.Optional[typing.Union[Expr, div_blend_mode.DivBlendMode]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -83,8 +87,10 @@ class DivImage(BaseDiv):
|
||||
column_span=column_span,
|
||||
content_alignment_horizontal=content_alignment_horizontal,
|
||||
content_alignment_vertical=content_alignment_vertical,
|
||||
disappear_actions=disappear_actions,
|
||||
doubletap_actions=doubletap_actions,
|
||||
extensions=extensions,
|
||||
filters=filters,
|
||||
focus=focus,
|
||||
height=height,
|
||||
high_priority_preview_show=high_priority_preview_show,
|
||||
@@ -111,11 +117,12 @@ class DivImage(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="image")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
action: typing.Optional[div_action.DivAction] = Field(
|
||||
description=(
|
||||
@@ -125,26 +132,26 @@ class DivImage(BaseDiv):
|
||||
)
|
||||
action_animation: typing.Optional[div_animation.DivAnimation] = Field(
|
||||
description=(
|
||||
"Action animation. Web supports `fade`, `scale` and `set` "
|
||||
"only."
|
||||
"Click animation. The web only supports the following "
|
||||
"values: `fade`, `scale`,`native`, `no_animation` and `set`."
|
||||
),
|
||||
)
|
||||
actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Multiple actions when clicking on an element.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
@@ -154,31 +161,39 @@ class DivImage(BaseDiv):
|
||||
description="Transparency animation when loading an image.",
|
||||
)
|
||||
aspect: typing.Optional[div_aspect.DivAspect] = Field(
|
||||
description=(
|
||||
"Fixed aspect ratio. The element\'s height is calculated "
|
||||
"based on the width,ignoring the `height` value."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description="Horizontal image alignment.",
|
||||
)
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description="Vertical image alignment.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
doubletap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description="Action when double-clicking on an element.",
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -186,6 +201,10 @@ class DivImage(BaseDiv):
|
||||
"[DivExtension](../../extensions.dita)."
|
||||
),
|
||||
)
|
||||
filters: typing.Optional[typing.Sequence[div_filter.DivFilter]] = Field(
|
||||
min_items=1,
|
||||
description="Image filters.",
|
||||
)
|
||||
focus: typing.Optional[div_focus.DivFocus] = Field(
|
||||
description="Parameters when focusing on an element or losing focus.",
|
||||
)
|
||||
@@ -198,7 +217,7 @@ class DivImage(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
high_priority_preview_show: typing.Optional[bool] = Field(
|
||||
high_priority_preview_show: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description=(
|
||||
"It sets the priority of displaying the preview — the "
|
||||
"preview is decoded in themain stream and displayed as the "
|
||||
@@ -207,22 +226,22 @@ class DivImage(BaseDiv):
|
||||
"launch time."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
image_url: str = Field(
|
||||
image_url: typing.Union[Expr, str] = Field(
|
||||
format="uri",
|
||||
description="Direct URL to an image.",
|
||||
)
|
||||
longtap_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
longtap_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Action when long-clicking on an element. Doesn\'t work on "
|
||||
"the devices w/o touchgestures."
|
||||
"Action when long-clicking an element. Doesn\'t work on "
|
||||
"devices that don\'t supporttouch gestures."
|
||||
),
|
||||
)
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
@@ -231,14 +250,14 @@ class DivImage(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
placeholder_color: typing.Optional[str] = Field(
|
||||
placeholder_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Placeholder background before the image is loaded.",
|
||||
)
|
||||
preload_required: typing.Optional[bool] = Field(
|
||||
preload_required: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Background image must be loaded before the display.",
|
||||
)
|
||||
preview: typing.Optional[str] = Field(
|
||||
preview: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Image preview encoded in `base64`. It will be shown instead "
|
||||
@@ -246,34 +265,34 @@ class DivImage(BaseDiv):
|
||||
"`data url`:`data:[;base64],<data>`"
|
||||
),
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
scale: typing.Optional[div_image_scale.DivImageScale] = Field(
|
||||
scale: typing.Optional[typing.Union[Expr, div_image_scale.DivImageScale]] = Field(
|
||||
description=(
|
||||
"Image scaling:`fit` places the entire image into the "
|
||||
"element (free space isfilled with background);`fill` scales "
|
||||
"the image to the element size and cuts offthe excess."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tint_color: typing.Optional[str] = Field(
|
||||
tint_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="New color of a contour image.",
|
||||
)
|
||||
tint_mode: typing.Optional[div_blend_mode.DivBlendMode] = Field(
|
||||
description="The blend mode of color specified in tint_color.",
|
||||
tint_mode: typing.Optional[typing.Union[Expr, div_blend_mode.DivBlendMode]] = Field(
|
||||
description="Blend mode of the color specified in `tint_color`.",
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -283,9 +302,8 @@ class DivImage(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -309,14 +327,14 @@ class DivImage(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -325,7 +343,7 @@ class DivImage(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -6,9 +6,12 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_alignment_horizontal, div_alignment_vertical, div_image_scale
|
||||
from . import (
|
||||
div_alignment_horizontal, div_alignment_vertical, div_filter,
|
||||
div_image_scale,
|
||||
)
|
||||
|
||||
|
||||
# Background image.
|
||||
@@ -16,42 +19,50 @@ class DivImageBackground(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
image_url: str,
|
||||
type: str = "image",
|
||||
alpha: typing.Optional[float] = None,
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
preload_required: typing.Optional[bool] = None,
|
||||
scale: typing.Optional[div_image_scale.DivImageScale] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
filters: typing.Optional[typing.Sequence[div_filter.DivFilter]] = None,
|
||||
image_url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
preload_required: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
scale: typing.Optional[typing.Union[Expr, div_image_scale.DivImageScale]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
alpha=alpha,
|
||||
content_alignment_horizontal=content_alignment_horizontal,
|
||||
content_alignment_vertical=content_alignment_vertical,
|
||||
filters=filters,
|
||||
image_url=image_url,
|
||||
preload_required=preload_required,
|
||||
scale=scale,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="image")
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description="Image transparency.",
|
||||
)
|
||||
content_alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
content_alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description="Horizontal image alignment.",
|
||||
)
|
||||
content_alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
content_alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description="Vertical image alignment.",
|
||||
)
|
||||
image_url: str = Field(
|
||||
filters: typing.Optional[typing.Sequence[div_filter.DivFilter]] = Field(
|
||||
min_items=1,
|
||||
description="Image filters.",
|
||||
)
|
||||
image_url: typing.Union[Expr, str] = Field(
|
||||
format="uri",
|
||||
description="Image URL.",
|
||||
)
|
||||
preload_required: typing.Optional[bool] = Field(
|
||||
preload_required: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Background image must be loaded before the display.",
|
||||
)
|
||||
scale: typing.Optional[div_image_scale.DivImageScale] = Field(
|
||||
scale: typing.Optional[typing.Union[Expr, div_image_scale.DivImageScale]] = Field(
|
||||
description="Image scaling.",
|
||||
)
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivImageScale(str, enum.Enum):
|
||||
FILL = "fill"
|
||||
NO_SCALE = "no_scale"
|
||||
FIT = "fit"
|
||||
STRETCH = "stretch"
|
||||
|
||||
@@ -6,14 +6,16 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_appearance_transition, div_background,
|
||||
div_border, div_change_transition, div_edge_insets, div_extension,
|
||||
div_fixed_size, div_focus, div_shape, div_size, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
div_border, div_change_transition, div_disappear_action, div_edge_insets,
|
||||
div_extension, div_fixed_size, div_focus, div_indicator_item_placement,
|
||||
div_rounded_rectangle_shape, div_shape, div_size, div_tooltip,
|
||||
div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -24,44 +26,51 @@ class DivIndicator(BaseDiv):
|
||||
self, *,
|
||||
type: str = "indicator",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
active_item_color: typing.Optional[str] = None,
|
||||
active_item_size: typing.Optional[float] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
animation: typing.Optional[DivIndicatorAnimation] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
active_item_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
active_item_size: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
active_shape: typing.Optional[div_rounded_rectangle_shape.DivRoundedRectangleShape] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
animation: typing.Optional[typing.Union[Expr, DivIndicatorAnimation]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
inactive_item_color: typing.Optional[str] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
inactive_item_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
inactive_minimum_shape: typing.Optional[div_rounded_rectangle_shape.DivRoundedRectangleShape] = None,
|
||||
inactive_shape: typing.Optional[div_rounded_rectangle_shape.DivRoundedRectangleShape] = None,
|
||||
items_placement: typing.Optional[div_indicator_item_placement.DivIndicatorItemPlacement] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
minimum_item_size: typing.Optional[float] = None,
|
||||
minimum_item_size: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
pager_id: typing.Optional[str] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
pager_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
shape: typing.Optional[div_shape.DivShape] = None,
|
||||
space_between_centers: typing.Optional[div_fixed_size.DivFixedSize] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
accessibility=accessibility,
|
||||
active_item_color=active_item_color,
|
||||
active_item_size=active_item_size,
|
||||
active_shape=active_shape,
|
||||
alignment_horizontal=alignment_horizontal,
|
||||
alignment_vertical=alignment_vertical,
|
||||
alpha=alpha,
|
||||
@@ -69,11 +78,15 @@ class DivIndicator(BaseDiv):
|
||||
background=background,
|
||||
border=border,
|
||||
column_span=column_span,
|
||||
disappear_actions=disappear_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
height=height,
|
||||
id=id,
|
||||
inactive_item_color=inactive_item_color,
|
||||
inactive_minimum_shape=inactive_minimum_shape,
|
||||
inactive_shape=inactive_shape,
|
||||
items_placement=items_placement,
|
||||
margins=margins,
|
||||
minimum_item_size=minimum_item_size,
|
||||
paddings=paddings,
|
||||
@@ -92,53 +105,61 @@ class DivIndicator(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="indicator")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
active_item_color: typing.Optional[str] = Field(
|
||||
active_item_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Active indicator color.",
|
||||
description="Active indicator color. @deprecated",
|
||||
)
|
||||
active_item_size: typing.Optional[float] = Field(
|
||||
description="A size multiplier for an active indicator.",
|
||||
active_item_size: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description="A size multiplier for an active indicator. @deprecated",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
active_shape: typing.Optional[div_rounded_rectangle_shape.DivRoundedRectangleShape] = Field(
|
||||
description="Active indicator shape.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
animation: typing.Optional[DivIndicatorAnimation] = Field(
|
||||
animation: typing.Optional[typing.Union[Expr, DivIndicatorAnimation]] = Field(
|
||||
description="Animation of switching between indicators.",
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -158,39 +179,56 @@ class DivIndicator(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
inactive_item_color: typing.Optional[str] = Field(
|
||||
inactive_item_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Indicator color.",
|
||||
description="Indicator color. @deprecated",
|
||||
)
|
||||
inactive_minimum_shape: typing.Optional[div_rounded_rectangle_shape.DivRoundedRectangleShape] = Field(
|
||||
description=(
|
||||
"Inactive indicator shape, minimum size. Used when all the "
|
||||
"indicators don\'t fit onthe screen."
|
||||
),
|
||||
)
|
||||
inactive_shape: typing.Optional[div_rounded_rectangle_shape.DivRoundedRectangleShape] = Field(
|
||||
description="Indicator shape.",
|
||||
)
|
||||
items_placement: typing.Optional[div_indicator_item_placement.DivIndicatorItemPlacement] = Field(
|
||||
description=(
|
||||
"Indicator items placement mode:Default: Indicators\' width "
|
||||
"is fixed and defined bythe `shape` parameters.Stretch: "
|
||||
"Indicators are expanded to fill the entire width."
|
||||
),
|
||||
)
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="External margins from the element stroke.",
|
||||
)
|
||||
minimum_item_size: typing.Optional[float] = Field(
|
||||
minimum_item_size: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"A size multiplier for a minimal indicator. It is used when "
|
||||
"the required number ofindicators don\'t fit on the screen."
|
||||
"the required number ofindicators don\'t fit on the screen. "
|
||||
"@deprecated"
|
||||
),
|
||||
)
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
pager_id: typing.Optional[str] = Field(
|
||||
pager_id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
description="ID of the pager that is a data source for an indicator.",
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
@@ -198,12 +236,12 @@ class DivIndicator(BaseDiv):
|
||||
),
|
||||
)
|
||||
shape: typing.Optional[div_shape.DivShape] = Field(
|
||||
description="Indicator shape.",
|
||||
description="Indicator shape. @deprecated",
|
||||
)
|
||||
space_between_centers: typing.Optional[div_fixed_size.DivFixedSize] = Field(
|
||||
description="Spacing between indicator centers.",
|
||||
description="Spacing between indicator centers. @deprecated",
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -213,9 +251,8 @@ class DivIndicator(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -239,14 +276,14 @@ class DivIndicator(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -255,7 +292,7 @@ class DivIndicator(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_default_indicator_item_placement, div_stretch_indicator_item_placement,
|
||||
)
|
||||
|
||||
|
||||
DivIndicatorItemPlacement = Union[
|
||||
div_default_indicator_item_placement.DivDefaultIndicatorItemPlacement,
|
||||
div_stretch_indicator_item_placement.DivStretchIndicatorItemPlacement,
|
||||
]
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Infinite number of repetitions.
|
||||
@@ -15,9 +15,11 @@ class DivInfinityCount(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "infinity",
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="infinity")
|
||||
|
||||
@@ -6,15 +6,15 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_appearance_transition, div_background,
|
||||
div_border, div_change_transition, div_edge_insets, div_extension,
|
||||
div_focus, div_font_family, div_font_weight, div_size, div_size_unit,
|
||||
div_tooltip, div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
div_border, div_change_transition, div_disappear_action, div_edge_insets,
|
||||
div_extension, div_focus, div_font_family, div_font_weight, div_input_mask,
|
||||
div_input_validator, div_size, div_size_unit, div_tooltip, div_transform,
|
||||
div_transition_trigger, div_visibility, div_visibility_action,
|
||||
)
|
||||
|
||||
|
||||
@@ -23,47 +23,51 @@ class DivInput(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
text_variable: str,
|
||||
type: str = "input",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
font_family: typing.Optional[div_font_family.DivFontFamily] = None,
|
||||
font_size: typing.Optional[int] = None,
|
||||
font_size_unit: typing.Optional[div_size_unit.DivSizeUnit] = None,
|
||||
font_weight: typing.Optional[div_font_weight.DivFontWeight] = None,
|
||||
font_family: typing.Optional[typing.Union[Expr, div_font_family.DivFontFamily]] = None,
|
||||
font_size: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
font_size_unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = None,
|
||||
font_weight: typing.Optional[typing.Union[Expr, div_font_weight.DivFontWeight]] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
highlight_color: typing.Optional[str] = None,
|
||||
hint_color: typing.Optional[str] = None,
|
||||
hint_text: typing.Optional[str] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
keyboard_type: typing.Optional[DivInputKeyboardType] = None,
|
||||
letter_spacing: typing.Optional[float] = None,
|
||||
line_height: typing.Optional[int] = None,
|
||||
highlight_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
hint_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
hint_text: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
keyboard_type: typing.Optional[typing.Union[Expr, DivInputKeyboardType]] = None,
|
||||
letter_spacing: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
line_height: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
max_visible_lines: typing.Optional[int] = None,
|
||||
mask: typing.Optional[div_input_mask.DivInputMask] = None,
|
||||
max_visible_lines: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
native_interface: typing.Optional[DivInputNativeInterface] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
select_all_on_focus: typing.Optional[bool] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
text_color: typing.Optional[str] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
select_all_on_focus: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
text_color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
text_variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
validators: typing.Optional[typing.Sequence[div_input_validator.DivInputValidator]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -74,6 +78,7 @@ class DivInput(BaseDiv):
|
||||
background=background,
|
||||
border=border,
|
||||
column_span=column_span,
|
||||
disappear_actions=disappear_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
font_family=font_family,
|
||||
@@ -89,6 +94,7 @@ class DivInput(BaseDiv):
|
||||
letter_spacing=letter_spacing,
|
||||
line_height=line_height,
|
||||
margins=margins,
|
||||
mask=mask,
|
||||
max_visible_lines=max_visible_lines,
|
||||
native_interface=native_interface,
|
||||
paddings=paddings,
|
||||
@@ -103,47 +109,53 @@ class DivInput(BaseDiv):
|
||||
transition_in=transition_in,
|
||||
transition_out=transition_out,
|
||||
transition_triggers=transition_triggers,
|
||||
validators=validators,
|
||||
visibility=visibility,
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="input")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -154,16 +166,16 @@ class DivInput(BaseDiv):
|
||||
focus: typing.Optional[div_focus.DivFocus] = Field(
|
||||
description="Parameters when focusing on an element or losing focus.",
|
||||
)
|
||||
font_family: typing.Optional[div_font_family.DivFontFamily] = Field(
|
||||
font_family: typing.Optional[typing.Union[Expr, div_font_family.DivFontFamily]] = Field(
|
||||
description=(
|
||||
"Font family:`text` — a standard text font;`display` — a "
|
||||
"family of fonts with alarge font size."
|
||||
),
|
||||
)
|
||||
font_size: typing.Optional[int] = Field(
|
||||
font_size: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Font size.",
|
||||
)
|
||||
font_size_unit: typing.Optional[div_size_unit.DivSizeUnit] = Field(
|
||||
font_size_unit: typing.Optional[typing.Union[Expr, div_size_unit.DivSizeUnit]] = Field(
|
||||
description=(
|
||||
"Unit of measurement:`px` — a physical pixel.`dp` — a "
|
||||
"logical pixel that doesn\'tdepend on screen density.`sp` — "
|
||||
@@ -171,7 +183,7 @@ class DivInput(BaseDiv):
|
||||
"Specify height in `sp`. Only available on Android."
|
||||
),
|
||||
)
|
||||
font_weight: typing.Optional[div_font_weight.DivFontWeight] = Field(
|
||||
font_weight: typing.Optional[typing.Union[Expr, div_font_weight.DivFontWeight]] = Field(
|
||||
description="Style.",
|
||||
)
|
||||
height: typing.Optional[div_size.DivSize] = Field(
|
||||
@@ -183,48 +195,49 @@ class DivInput(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
highlight_color: typing.Optional[str] = Field(
|
||||
highlight_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description=(
|
||||
"Text highlight color. If the value isn\'t set, the color "
|
||||
"set in the client will beused instead."
|
||||
),
|
||||
)
|
||||
hint_color: typing.Optional[str] = Field(
|
||||
hint_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Text color.",
|
||||
)
|
||||
hint_text: typing.Optional[str] = Field(
|
||||
hint_text: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description="Tooltip text.",
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
"is used as`accessibilityIdentifier` on iOS."
|
||||
),
|
||||
)
|
||||
keyboard_type: typing.Optional[DivInputKeyboardType] = Field(
|
||||
keyboard_type: typing.Optional[typing.Union[Expr, DivInputKeyboardType]] = Field(
|
||||
description="Keyboard type.",
|
||||
)
|
||||
letter_spacing: typing.Optional[float] = Field(
|
||||
letter_spacing: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description="Spacing between characters.",
|
||||
)
|
||||
line_height: typing.Optional[int] = Field(
|
||||
line_height: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Line spacing of the text range. The count is taken from the "
|
||||
"font baseline.Measured in units specified in "
|
||||
"Line spacing of the text. Units specified in "
|
||||
"`font_size_unit`."
|
||||
),
|
||||
)
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="External margins from the element stroke.",
|
||||
)
|
||||
max_visible_lines: typing.Optional[int] = Field(
|
||||
mask: typing.Optional[div_input_mask.DivInputMask] = Field(
|
||||
description="Mask for entering text based on the specified template.",
|
||||
)
|
||||
max_visible_lines: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Maximum number of lines that will be visible in the input "
|
||||
"view."
|
||||
"Maximum number of lines to be displayed in the input field."
|
||||
),
|
||||
)
|
||||
native_interface: typing.Optional[DivInputNativeInterface] = Field(
|
||||
@@ -233,31 +246,31 @@ class DivInput(BaseDiv):
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
select_all_on_focus: typing.Optional[bool] = Field(
|
||||
select_all_on_focus: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Highlighting input text when focused.",
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
text_color: typing.Optional[str] = Field(
|
||||
text_color: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
format="color",
|
||||
description="Text color.",
|
||||
)
|
||||
text_variable: str = Field(
|
||||
text_variable: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Name of text storage variable.",
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -267,9 +280,8 @@ class DivInput(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -293,14 +305,18 @@ class DivInput(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
validators: typing.Optional[typing.Sequence[div_input_validator.DivInputValidator]] = Field(
|
||||
min_items=1,
|
||||
description="Validators for text value.",
|
||||
)
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -309,7 +325,7 @@ class DivInput(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
@@ -332,13 +348,15 @@ class DivInputNativeInterface(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
color: str,
|
||||
color: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
color=color,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
color: str = Field(
|
||||
color: typing.Union[Expr, str] = Field(
|
||||
format="color",
|
||||
description="Text input line color.",
|
||||
)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_currency_input_mask, div_fixed_length_input_mask
|
||||
|
||||
|
||||
DivInputMask = Union[
|
||||
div_fixed_length_input_mask.DivFixedLengthInputMask,
|
||||
div_currency_input_mask.DivCurrencyInputMask,
|
||||
]
|
||||
@@ -0,0 +1,30 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivInputMaskBase(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
raw_text_variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
raw_text_variable=raw_text_variable,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
raw_text_variable: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Name of the variable to store the unprocessed value.",
|
||||
)
|
||||
|
||||
|
||||
DivInputMaskBase.update_forward_refs()
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_input_validator_expression, div_input_validator_regex
|
||||
|
||||
|
||||
DivInputValidator = Union[
|
||||
div_input_validator_regex.DivInputValidatorRegex,
|
||||
div_input_validator_expression.DivInputValidatorExpression,
|
||||
]
|
||||
@@ -0,0 +1,44 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivInputValidatorBase(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
allow_empty: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
label_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
allow_empty=allow_empty,
|
||||
label_id=label_id,
|
||||
variable=variable,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
allow_empty: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Whether an empty value is correct. By default, false.",
|
||||
)
|
||||
label_id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"ID of the text div containing the error message, which will "
|
||||
"also be used foraccessibility."
|
||||
),
|
||||
)
|
||||
variable: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description="Name of validation storage variable.",
|
||||
)
|
||||
|
||||
|
||||
DivInputValidatorBase.update_forward_refs()
|
||||
@@ -0,0 +1,54 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Expression validator.
|
||||
class DivInputValidatorExpression(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "expression",
|
||||
allow_empty: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
condition: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
label_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
allow_empty=allow_empty,
|
||||
condition=condition,
|
||||
label_id=label_id,
|
||||
variable=variable,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="expression")
|
||||
allow_empty: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Whether an empty value is correct. By default, false.",
|
||||
)
|
||||
condition: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Expression condition for evaluating.",
|
||||
)
|
||||
label_id: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"ID of the text div containing the error message, which will "
|
||||
"also be used foraccessibility."
|
||||
),
|
||||
)
|
||||
variable: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Name of validation storage variable.",
|
||||
)
|
||||
|
||||
|
||||
DivInputValidatorExpression.update_forward_refs()
|
||||
@@ -0,0 +1,54 @@
|
||||
# Generated code. Do not modify.
|
||||
# flake8: noqa: F401, F405, F811
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Regex validator.
|
||||
class DivInputValidatorRegex(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "regex",
|
||||
allow_empty: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
label_id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
pattern: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
variable: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
allow_empty=allow_empty,
|
||||
label_id=label_id,
|
||||
pattern=pattern,
|
||||
variable=variable,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="regex")
|
||||
allow_empty: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description="Whether an empty value is correct. By default, false.",
|
||||
)
|
||||
label_id: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"ID of the text div containing the error message, which will "
|
||||
"also be used foraccessibility."
|
||||
),
|
||||
)
|
||||
pattern: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Regex pattern for matching.",
|
||||
)
|
||||
variable: typing.Union[Expr, str] = Field(
|
||||
min_length=1,
|
||||
description="Name of validation storage variable.",
|
||||
)
|
||||
|
||||
|
||||
DivInputValidatorRegex.update_forward_refs()
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
class DivLineStyle(str, enum.Enum):
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Linear gradient.
|
||||
@@ -14,25 +14,27 @@ class DivLinearGradient(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
colors: typing.List[str],
|
||||
type: str = "gradient",
|
||||
angle: typing.Optional[int] = None,
|
||||
angle: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
colors: typing.Optional[typing.Sequence[typing.Union[Expr, str]]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
angle=angle,
|
||||
colors=colors,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="gradient")
|
||||
angle: typing.Optional[int] = Field(
|
||||
angle: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description="Angle of gradient direction.",
|
||||
)
|
||||
colors: typing.List[str] = Field(
|
||||
colors: typing.Sequence[typing.Union[Expr, str]] = Field(
|
||||
min_items=2,
|
||||
description=(
|
||||
"Colors. Gradient points will be located at an equal "
|
||||
"distance from each other."
|
||||
"Colors. Gradient points are located at an equal distance "
|
||||
"from each other."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
|
||||
# Element size adjusts to a parent element.
|
||||
@@ -15,15 +15,17 @@ class DivMatchParentSize(BaseDiv):
|
||||
def __init__(
|
||||
self, *,
|
||||
type: str = "match_parent",
|
||||
weight: typing.Optional[float] = None,
|
||||
weight: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
weight=weight,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="match_parent")
|
||||
weight: typing.Optional[float] = Field(
|
||||
weight: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Weight when distributing free space between elements with "
|
||||
"the size type`match_parent` inside an element. If the "
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_fixed_size
|
||||
|
||||
@@ -16,12 +16,14 @@ class DivNeighbourPageSize(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
neighbour_page_width: div_fixed_size.DivFixedSize,
|
||||
type: str = "fixed",
|
||||
neighbour_page_width: typing.Optional[div_fixed_size.DivFixedSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
neighbour_page_width=neighbour_page_width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="fixed")
|
||||
|
||||
@@ -6,38 +6,39 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_absolute_edge_insets
|
||||
|
||||
|
||||
# Image in nine patch format.
|
||||
# https://developer.android.com/studio/write/draw9patch.
|
||||
# Image in 9-patch format (https://developer.android.com/studio/write/draw9patch).
|
||||
class DivNinePatchBackground(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
image_url: str,
|
||||
insets: div_absolute_edge_insets.DivAbsoluteEdgeInsets,
|
||||
type: str = "nine_patch_image",
|
||||
image_url: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
insets: typing.Optional[div_absolute_edge_insets.DivAbsoluteEdgeInsets] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
image_url=image_url,
|
||||
insets=insets,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="nine_patch_image")
|
||||
image_url: str = Field(
|
||||
image_url: typing.Union[Expr, str] = Field(
|
||||
format="uri",
|
||||
description="Image URL.",
|
||||
)
|
||||
insets: div_absolute_edge_insets.DivAbsoluteEdgeInsets = Field(
|
||||
description=(
|
||||
"Margins that break images into parts, according to the "
|
||||
"rule, are similar "
|
||||
"toborder-image-slice.(https://developer.mozilla.org/en-US/d"
|
||||
"ocs/Web/CSS/border-image-slice)"
|
||||
"Margins that break the image into parts using the same "
|
||||
"rules as the CSS`border-image-slice` "
|
||||
"property(https://developer.mozilla.org/en-US/docs/Web/CSS/b"
|
||||
"order-image-slice)."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -6,22 +6,24 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_percentage_size
|
||||
|
||||
|
||||
# Percentage value of the page width.
|
||||
# Page width (%).
|
||||
class DivPageSize(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
page_width: div_percentage_size.DivPercentageSize,
|
||||
type: str = "percentage",
|
||||
page_width: typing.Optional[div_percentage_size.DivPercentageSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
page_width=page_width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="percentage")
|
||||
|
||||
@@ -6,14 +6,14 @@ from __future__ import annotations
|
||||
import enum
|
||||
import typing
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import (
|
||||
div, div_accessibility, div_action, div_alignment_horizontal,
|
||||
div_alignment_vertical, div_appearance_transition, div_background,
|
||||
div_border, div_change_transition, div_edge_insets, div_extension,
|
||||
div_fixed_size, div_focus, div_pager_layout_mode, div_size, div_tooltip,
|
||||
div_transform, div_transition_trigger, div_visibility,
|
||||
div_border, div_change_transition, div_disappear_action, div_edge_insets,
|
||||
div_extension, div_fixed_size, div_focus, div_pager_layout_mode, div_size,
|
||||
div_tooltip, div_transform, div_transition_trigger, div_visibility,
|
||||
div_visibility_action,
|
||||
)
|
||||
|
||||
@@ -24,38 +24,40 @@ class DivPager(BaseDiv):
|
||||
|
||||
def __init__(
|
||||
self, *,
|
||||
items: typing.List[div.Div],
|
||||
layout_mode: div_pager_layout_mode.DivPagerLayoutMode,
|
||||
type: str = "pager",
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = None,
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = None,
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = None,
|
||||
alpha: typing.Optional[float] = None,
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = None,
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = None,
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = None,
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = None,
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = None,
|
||||
border: typing.Optional[div_border.DivBorder] = None,
|
||||
column_span: typing.Optional[int] = None,
|
||||
default_item: typing.Optional[int] = None,
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = None,
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
default_item: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = None,
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = None,
|
||||
focus: typing.Optional[div_focus.DivFocus] = None,
|
||||
height: typing.Optional[div_size.DivSize] = None,
|
||||
id: typing.Optional[str] = None,
|
||||
id: typing.Optional[typing.Union[Expr, str]] = None,
|
||||
item_spacing: typing.Optional[div_fixed_size.DivFixedSize] = None,
|
||||
items: typing.Optional[typing.Sequence[div.Div]] = None,
|
||||
layout_mode: typing.Optional[div_pager_layout_mode.DivPagerLayoutMode] = None,
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
orientation: typing.Optional[DivPagerOrientation] = None,
|
||||
orientation: typing.Optional[typing.Union[Expr, DivPagerOrientation]] = None,
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = None,
|
||||
restrict_parent_scroll: typing.Optional[bool] = None,
|
||||
row_span: typing.Optional[int] = None,
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = None,
|
||||
restrict_parent_scroll: typing.Optional[typing.Union[Expr, bool]] = None,
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = None,
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = None,
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = None,
|
||||
transform: typing.Optional[div_transform.DivTransform] = None,
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = None,
|
||||
transition_in: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_out: typing.Optional[div_appearance_transition.DivAppearanceTransition] = None,
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = None,
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = None,
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = None,
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = None,
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = None,
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = None,
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = None,
|
||||
width: typing.Optional[div_size.DivSize] = None,
|
||||
**kwargs: typing.Any,
|
||||
):
|
||||
super().__init__(
|
||||
type=type,
|
||||
@@ -67,6 +69,7 @@ class DivPager(BaseDiv):
|
||||
border=border,
|
||||
column_span=column_span,
|
||||
default_item=default_item,
|
||||
disappear_actions=disappear_actions,
|
||||
extensions=extensions,
|
||||
focus=focus,
|
||||
height=height,
|
||||
@@ -90,49 +93,54 @@ class DivPager(BaseDiv):
|
||||
visibility_action=visibility_action,
|
||||
visibility_actions=visibility_actions,
|
||||
width=width,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
type: str = Field(default="pager")
|
||||
accessibility: typing.Optional[div_accessibility.DivAccessibility] = Field(
|
||||
description="Accessibility for disabled people.",
|
||||
description="Accessibility settings.",
|
||||
)
|
||||
alignment_horizontal: typing.Optional[div_alignment_horizontal.DivAlignmentHorizontal] = Field(
|
||||
alignment_horizontal: typing.Optional[typing.Union[Expr, div_alignment_horizontal.DivAlignmentHorizontal]] = Field(
|
||||
description=(
|
||||
"Horizontal alignment of an element inside the parent "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
alignment_vertical: typing.Optional[div_alignment_vertical.DivAlignmentVertical] = Field(
|
||||
alignment_vertical: typing.Optional[typing.Union[Expr, div_alignment_vertical.DivAlignmentVertical]] = Field(
|
||||
description=(
|
||||
"Vertical alignment of an element inside the parent element."
|
||||
),
|
||||
)
|
||||
alpha: typing.Optional[float] = Field(
|
||||
alpha: typing.Optional[typing.Union[Expr, float]] = Field(
|
||||
description=(
|
||||
"Sets transparency of the entire element: `0` — completely "
|
||||
"transparent, `1` —opaque."
|
||||
),
|
||||
)
|
||||
background: typing.Optional[typing.List[div_background.DivBackground]] = Field(
|
||||
background: typing.Optional[typing.Sequence[div_background.DivBackground]] = Field(
|
||||
min_items=1,
|
||||
description="Element background. It can contain multiple layers.",
|
||||
)
|
||||
border: typing.Optional[div_border.DivBorder] = Field(
|
||||
description="Element stroke.",
|
||||
)
|
||||
column_span: typing.Optional[int] = Field(
|
||||
column_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a column of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
default_item: typing.Optional[int] = Field(
|
||||
default_item: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Ordinal number of the pager element that will be opened by "
|
||||
"default."
|
||||
),
|
||||
)
|
||||
extensions: typing.Optional[typing.List[div_extension.DivExtension]] = Field(
|
||||
disappear_actions: typing.Optional[typing.Sequence[div_disappear_action.DivDisappearAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element disappears from the screen.",
|
||||
)
|
||||
extensions: typing.Optional[typing.Sequence[div_extension.DivExtension]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Extensions for additional processing of an element. The "
|
||||
@@ -152,7 +160,7 @@ class DivPager(BaseDiv):
|
||||
"card](../../layout.dita)."
|
||||
),
|
||||
)
|
||||
id: typing.Optional[str] = Field(
|
||||
id: typing.Optional[typing.Union[Expr, str]] = Field(
|
||||
min_length=1,
|
||||
description=(
|
||||
"Element ID. It must be unique within the root element. It "
|
||||
@@ -162,7 +170,7 @@ class DivPager(BaseDiv):
|
||||
item_spacing: typing.Optional[div_fixed_size.DivFixedSize] = Field(
|
||||
description="Spacing between elements.",
|
||||
)
|
||||
items: typing.List[div.Div] = Field(
|
||||
items: typing.Sequence[div.Div] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Pager elements. Page-by-page transition options can be "
|
||||
@@ -193,32 +201,32 @@ class DivPager(BaseDiv):
|
||||
margins: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="External margins from the element stroke.",
|
||||
)
|
||||
orientation: typing.Optional[DivPagerOrientation] = Field(
|
||||
orientation: typing.Optional[typing.Union[Expr, DivPagerOrientation]] = Field(
|
||||
description="Pager orientation.",
|
||||
)
|
||||
paddings: typing.Optional[div_edge_insets.DivEdgeInsets] = Field(
|
||||
description="Internal margins from the element stroke.",
|
||||
)
|
||||
restrict_parent_scroll: typing.Optional[bool] = Field(
|
||||
restrict_parent_scroll: typing.Optional[typing.Union[Expr, bool]] = Field(
|
||||
description=(
|
||||
"If the parameter is enabled, the pager won\'t transmit the "
|
||||
"scroll gesture to theparent element."
|
||||
),
|
||||
)
|
||||
row_span: typing.Optional[int] = Field(
|
||||
row_span: typing.Optional[typing.Union[Expr, int]] = Field(
|
||||
description=(
|
||||
"Merges cells in a string of the [grid](div-grid.md) "
|
||||
"element."
|
||||
),
|
||||
)
|
||||
selected_actions: typing.Optional[typing.List[div_action.DivAction]] = Field(
|
||||
selected_actions: typing.Optional[typing.Sequence[div_action.DivAction]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"List of [actions](div-action.md) to be executed when "
|
||||
"selecting an element in[pager](div-pager.md)."
|
||||
),
|
||||
)
|
||||
tooltips: typing.Optional[typing.List[div_tooltip.DivTooltip]] = Field(
|
||||
tooltips: typing.Optional[typing.Sequence[div_tooltip.DivTooltip]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Tooltips linked to an element. A tooltip can be shown "
|
||||
@@ -228,9 +236,8 @@ class DivPager(BaseDiv):
|
||||
)
|
||||
transform: typing.Optional[div_transform.DivTransform] = Field(
|
||||
description=(
|
||||
"Transformation of the element. Applies the passed transform "
|
||||
"to the element. Thecontent that does not fit into the "
|
||||
"original view will be cut off."
|
||||
"Applies the passed transformation to the element. Content "
|
||||
"that doesn\'t fit intothe original view area is cut off."
|
||||
),
|
||||
)
|
||||
transition_change: typing.Optional[div_change_transition.DivChangeTransition] = Field(
|
||||
@@ -254,14 +261,14 @@ class DivPager(BaseDiv):
|
||||
"disappears in the newlayout."
|
||||
),
|
||||
)
|
||||
transition_triggers: typing.Optional[typing.List[div_transition_trigger.DivTransitionTrigger]] = Field(
|
||||
transition_triggers: typing.Optional[typing.Sequence[typing.Union[Expr, div_transition_trigger.DivTransitionTrigger]]] = Field(
|
||||
min_items=1,
|
||||
description=(
|
||||
"Animation starting triggers. Default value: `[state_change, "
|
||||
"visibility_change]`."
|
||||
),
|
||||
)
|
||||
visibility: typing.Optional[div_visibility.DivVisibility] = Field(
|
||||
visibility: typing.Optional[typing.Union[Expr, div_visibility.DivVisibility]] = Field(
|
||||
description="Element visibility.",
|
||||
)
|
||||
visibility_action: typing.Optional[div_visibility_action.DivVisibilityAction] = Field(
|
||||
@@ -270,7 +277,7 @@ class DivPager(BaseDiv):
|
||||
"`visibility_actions`parameter is set."
|
||||
),
|
||||
)
|
||||
visibility_actions: typing.Optional[typing.List[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
visibility_actions: typing.Optional[typing.Sequence[div_visibility_action.DivVisibilityAction]] = Field(
|
||||
min_items=1,
|
||||
description="Actions when an element appears on the screen.",
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import enum
|
||||
import typing
|
||||
from typing import Union
|
||||
|
||||
from pydivkit.core import BaseDiv, Field
|
||||
from pydivkit.core import BaseDiv, Expr, Field
|
||||
|
||||
from . import div_neighbour_page_size, div_page_size
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user