@*note: stopping the click propagation is important here. otherwise checking the checkbox results in click events on its parent (i.e. table row), which is generally not what you would want*@
/// The method is used to determinate if an item can be dropped within a drop zone
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicFunc<T,string,bool>CanDrop{get;set;}
/// <summary>
/// The CSS class(es), that is applied to drop zones that are a valid target for drag and drop transaction
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicstringCanDropClass{get;set;}
/// <summary>
/// The CSS class(es), that is applied to drop zones that are NOT valid target for drag and drop transaction
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicstringNoDropClass{get;set;}
/// <summary>
/// If true, drop classes CanDropClass <see cref="CanDropClass"/> or NoDropClass <see cref="NoDropClass"/> or applied as soon, as a transaction has started
/// The method is used to determinate if an item can be dropped within a drop zone
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Items)]
publicFunc<T,string,bool>ItemsSelector{get;set;}
/// <summary>
/// If true, drop classes CanDropClass <see cref="CanDropClass"/> or NoDropClass <see cref="NoDropClass"/> or applied as soon, as a transaction has started
@ -24,103 +27,9 @@ public partial class DropZone<T> : UIComponent, IDisposable
[CascadingParameter]
protectedDropContainer<T>Container{get;set;}
/// <summary>
/// Child content of component
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Appearance)]
publicRenderFragmentChildContent{get;set;}
/// <summary>
/// The unique identifier of this drop zone. It is used within transaction to
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Appearance)]
publicstringIdentifier{get;set;}
/// <summary>
/// The render fragment (template) that should be used to render the items within a drop zone. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Items)]
publicRenderFragment<T>ItemRenderer{get;set;}
/// <summary>
/// The method is used to determinate if an item can be dropped within a drop zone. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Items)]
publicFunc<T,bool>ItemsSelector{get;set;}
/// <summary>
/// The method is used to determinate if an item can be dropped within a drop zone. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicFunc<T,bool>CanDrop{get;set;}
/// <summary>
/// The CSS class(es), that is applied to drop zones that are a valid target for drag and drop transaction. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicstringCanDropClass{get;set;}
/// <summary>
/// The CSS class(es), that is applied to drop zones that are NOT valid target for drag and drop transaction. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicstringNoDropClass{get;set;}
/// <summary>
/// If true, drop classes CanDropClass <see cref="CanDropClass"/> or NoDropClass <see cref="NoDropClass"/> or applied as soon, as a transaction has started. Overrides value provided by drop container
/// The method is used to determinate if an item should be disabled for dragging. Defaults to allow all items. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Disabled)]
publicFunc<T,bool>ItemIsDisabled{get;set;}
/// <summary>
/// If a drop item is disabled (determinate by <see cref="ItemIsDisabled"/>). This class is applied to the element. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Disabled)]
publicstringDisabledClass{get;set;}
/// <summary>
/// An additional class that is applied to the drop zone where a drag operation started
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DraggingClass)]
publicstringDraggingClass{get;set;}
/// <summary>
/// An additional class that is applied to an drop item, when it is dragged
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DraggingClass)]
publicstringItemDraggingClass{get;set;}
[Parameter]
[Category(CategoryTypes.DropZone.Behavior)]
publicboolAllowReorder{get;set;}
/// <summary>
/// If true, will only act as a dropable zone and not render any items.
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Behavior)]
publicboolOnlyZone{get;set;}
#region view helper
#endregion
#region Events
privateintGetItemIndex(Titem)
{
if(_indicies.ContainsKey(item)==false)
@ -178,52 +87,6 @@ public partial class DropZone<T> : UIComponent, IDisposable
/// The unique identifier of this drop zone. It is used within transaction to
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Appearance)]
publicstringIdentifier{get;set;}
/// <summary>
/// The render fragment (template) that should be used to render the items within a drop zone. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Items)]
publicRenderFragment<T>ItemRenderer{get;set;}
/// <summary>
/// The method is used to determinate if an item can be dropped within a drop zone. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Items)]
publicFunc<T,bool>ItemsSelector{get;set;}
#endregion
#region Styling
/// <summary>
/// The CSS class(es), that is applied to drop zones that are a valid target for drag and drop transaction. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicstringCanDropClass{get;set;}
/// <summary>
/// The CSS class(es), that is applied to drop zones that are NOT valid target for drag and drop transaction. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicstringNoDropClass{get;set;}
/// <summary>
/// The method is used to determinate if an item should be disabled for dragging. Defaults to allow all items. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Disabled)]
publicFunc<T,bool>ItemIsDisabled{get;set;}
/// <summary>
/// If a drop item is disabled (determinate by <see cref="ItemIsDisabled"/>). This class is applied to the element. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.Disabled)]
publicstringDisabledClass{get;set;}
/// <summary>
/// An additional class that is applied to the drop zone where a drag operation started
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DraggingClass)]
publicstringDraggingClass{get;set;}
/// <summary>
/// An additional class that is applied to an drop item, when it is dragged
/// The method is used to determinate if an item can be dropped within a drop zone. Overrides value provided by drop container
/// </summary>
[Parameter]
[Category(CategoryTypes.DropZone.DropRules)]
publicFunc<T,bool>CanDrop{get;set;}
/// <summary>
/// If true, drop classes CanDropClass <see cref="CanDropClass"/> or NoDropClass <see cref="NoDropClass"/> or applied as soon, as a transaction has started. Overrides value provided by drop container
@ -21,50 +17,10 @@ public partial class FocusTrap : IDisposable
privatebool_disabled;
privatebool_initialized;
/// <summary>
/// Child content of the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.FocusTrap.Behavior)]
publicRenderFragmentChildContent{get;set;}
/// <summary>
/// If true, the focus will no longer loop inside the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.FocusTrap.Behavior)]
publicboolDisabled
{
get=>_disabled;
set
{
if(_disabled!=value)
{
_disabled=value;
_initialized=false;
}
}
}
/// <summary>
/// Defines on which element to set the focus when the component is created or enabled.
/// When DefaultFocus.Element is used, the focus will be set to the FocusTrap itself, so the user will have to press TAB key once to focus the first tabbable element.
@ -142,9 +98,50 @@ public partial class FocusTrap : IDisposable
{
return_root.SaveFocusAsync().AsTask();
}
#endregion
bool_shouldRender=true;
#region Content
/// <summary>
/// Child content of the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.FocusTrap.Behavior)]
publicRenderFragmentChildContent{get;set;}
#endregion
#region Styling
protectedstringClassname=>
newCssBuilder("outline-none")
.AddClass(AdditionalClassList)
.Build();
/// <summary>
/// Defines on which element to set the focus when the component is created or enabled.
/// When DefaultFocus.Element is used, the focus will be set to the FocusTrap itself, so the user will have to press TAB key once to focus the first tabbable element.
/// A default validation func or a validation attribute to use for form controls that don't have one.
/// Supported types are:
/// <para>Func<T, bool> ... will output the standard error message "Invalid" if false</para>
/// <para>Func<T, string> ... outputs the result as error message, no error if null </para>
/// <para>Func<T, IEnumerable< string >> ... outputs all the returned error messages, no error if empty</para>
/// <para>Func<object, string, IEnumerable< string >> input Form.Model, Full Path of Member ... outputs all the returned error messages, no error if empty</para>
/// <para>Func<T, Task< bool >> ... will output the standard error message "Invalid" if false</para>
/// <para>Func<T, Task< string >> ... outputs the result as error message, no error if null</para>
/// <para>Func<T, Task<IEnumerable< string >>> ... outputs all the returned error messages, no error if empty</para>
/// <para>Func<object, string, Task<IEnumerable< string >>> input Form.Model, Full Path of Member ... outputs all the returned error messages, no error if empty</para>
// keeps track of validation. if the input was validated at least once the value will be true
/// <summary>
/// A default validation func or a validation attribute to use for form controls that don't have one.
/// Supported types are:
/// <para>Func<T, bool> ... will output the standard error message "Invalid" if false</para>
/// <para>Func<T, string> ... outputs the result as error message, no error if null </para>
/// <para>Func<T, IEnumerable< string >> ... outputs all the returned error messages, no error if empty</para>
/// <para>Func<object, string, IEnumerable< string >> input Form.Model, Full Path of Member ... outputs all the returned error messages, no error if empty</para>
/// <para>Func<T, Task< bool >> ... will output the standard error message "Invalid" if false</para>
/// <para>Func<T, Task< string >> ... outputs the result as error message, no error if null</para>
/// <para>Func<T, Task<IEnumerable< string >>> ... outputs all the returned error messages, no error if empty</para>
/// <para>Func<object, string, Task<IEnumerable< string >>> input Form.Model, Full Path of Member ... outputs all the returned error messages, no error if empty</para>