-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2ee300
commit 365076b
Showing
6 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...rmComponents/CheckboxInputDependsOnFieldComponent/CheckboxInputDependsOnFieldAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Kentico.Xperience.Admin.Base.FormAnnotations; | ||
|
||
namespace Xperience.DependingFieldComponents.FormComponents.CheckboxInputDependsOnFieldComponent | ||
{ | ||
public class CheckboxInputDependsOnFieldAttribute : FormComponentAttribute, IDependsOnPropertyProperties | ||
{ | ||
public string? DependsOn { get; set; } | ||
|
||
|
||
public string? ExpectedValue { get; set; } | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...rmComponents/CheckboxInputDependsOnFieldComponent/CheckboxInputDependsOnFieldComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Kentico.Xperience.Admin.Base.Forms; | ||
|
||
using Xperience.DependingFieldComponents; | ||
using Xperience.DependingFieldComponents.FormComponents.CheckboxInputDependsOnFieldComponent; | ||
using Xperience.DependingFieldComponents.VisibilityConditions; | ||
|
||
[assembly: RegisterFormComponent(DependingFieldComponentsConstants.CHECKBOXINPUT_IDENTIFIER, typeof(CheckboxInputDependsOnFieldComponent), DependingFieldComponentsConstants.CHECKBOXINPUT_FIELDDESCRIPTION)] | ||
namespace Xperience.DependingFieldComponents.FormComponents.CheckboxInputDependsOnFieldComponent | ||
{ | ||
/// <summary> | ||
/// A form component which can be configured to appear based on the value of another field. | ||
/// </summary> | ||
[ComponentAttribute(typeof(CheckboxInputDependsOnFieldAttribute))] | ||
public class CheckboxInputDependsOnFieldComponent : FormComponent<CheckboxInputDependsOnFieldProperties, CheckBoxClientProperties, bool> | ||
{ | ||
public override string ClientComponentName => "@kentico/xperience-admin-base/Checkbox"; | ||
|
||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="CheckboxInputDependsOnFieldComponent"/> | ||
/// </summary> | ||
public CheckboxInputDependsOnFieldComponent() | ||
{ | ||
} | ||
|
||
|
||
protected override void ConfigureComponent() | ||
{ | ||
DependingFieldVisibilityCondition.Configure(this); | ||
|
||
base.ConfigureComponent(); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...mComponents/CheckboxInputDependsOnFieldComponent/CheckboxInputDependsOnFieldProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Kentico.Xperience.Admin.Base.FormAnnotations; | ||
using Kentico.Xperience.Admin.Base.Forms; | ||
|
||
namespace Xperience.DependingFieldComponents.FormComponents.CheckboxInputDependsOnFieldComponent | ||
{ | ||
/// <summary> | ||
/// Properties for the <see cref="CheckboxInputDependsOnFieldComponent"/> component. | ||
/// </summary> | ||
public class CheckboxInputDependsOnFieldProperties : FormComponentProperties, IDependsOnPropertyProperties | ||
{ | ||
[TextInputComponent(Label = DependingFieldComponentsConstants.PROPERTY_DEPENDSON_LABEL, Tooltip = DependingFieldComponentsConstants.PROPERTY_DEPENDSON_TOOLTIP, Order = 1)] | ||
public string? DependsOn { get; set; } | ||
|
||
|
||
[TextInputComponent(Label = DependingFieldComponentsConstants.PROPERTY_EXPECTEDVALUE_LABEL, Tooltip = DependingFieldComponentsConstants.PROPERTY_EXPECTEDVALUE_TOOLTIP, Order = 2)] | ||
public string? ExpectedValue { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters