Skip to content

Commit

Permalink
Merge pull request #33 from yagizhanNY/update-siemens-ix-2.1.2
Browse files Browse the repository at this point in the history
Update siemens ix 2.1.2
  • Loading branch information
yagizhanNY authored Mar 21, 2024
2 parents 3cc61e3 + fca36ec commit 93e1ffe
Show file tree
Hide file tree
Showing 116 changed files with 293 additions and 142 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,4 @@ FodyWeavers.xsd
/SiemensIXBlazor.DemoApp
/SiemensIXBlazor.TestApp
/SiemensIXBlazorTestApp
/TestBlazorApp
13 changes: 13 additions & 0 deletions SiemensIXBlazor/Components/Application/Application.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@namespace SiemensIXBlazor.Components
@inherits IXBaseComponent
@using Microsoft.JSInterop
@inject IJSRuntime JSRuntime

<ix-application class="@Class" style="@Style" @attributes="UserAttributes"
id="@Id"
breakpoints="@Breakpoints"
force-breakpoint="@ForceBreakpoint"
theme="@Theme"
theme-system-appearance="@ThemeSystemAppearance">
@ChildContent
</ix-application>
57 changes: 57 additions & 0 deletions SiemensIXBlazor/Components/Application/Application.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace SiemensIXBlazor.Components;

using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using SiemensIXBlazor.Enums;
using SiemensIXBlazor.Interops;
using SiemensIXBlazor.Objects.Application;

public partial class Application
{
private Lazy<Task<IJSObjectReference>>? moduleTask;
private BaseInterop? _interop;
private AppSwitchConfig _appSwitchConfig;

[Parameter]
public RenderFragment? ChildContent { get; set; }
[Parameter, EditorRequired]
public string Id { get; set; } = string.Empty;
[Parameter]
public string[] Breakpoints { get; set; } = ["sm", "md", "lg"];
[Parameter]
public ForceBreakpoint? ForceBreakpoint { get; set; }
[Parameter]
public string? Theme { get; set; }
[Parameter]
public bool ThemeSystemAppearance { get; set; } = false;
public AppSwitchConfig AppSwitchConfig
{
get => _appSwitchConfig;
set
{
_appSwitchConfig = value;
InitialParameter("setApplicationConfig", _appSwitchConfig);
}
}

private void InitialParameter(string functionName, object param)
{

moduleTask = new(() => JSRuntime.InvokeAsync<IJSObjectReference>(
"import", $"./_content/SiemensIXBlazor/js/interops/applicationInterop.js").AsTask());

Task.Run(async () =>
{
var module = await moduleTask.Value;
if (module != null)
{
await module.InvokeVoidAsync(functionName, Id, JsonConvert.SerializeObject(param, new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
}));
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@namespace SiemensIXBlazor.Components
@inherits IXBaseComponent

<ix-application-header class="@Class" style="@Style" @attributes="UserAttributes" name="@Name">
@ChildContent
</ix-application-header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Components;

namespace SiemensIXBlazor.Components
{
public partial class ApplicationHeader
{
[Parameter]
public RenderFragment? ChildContent { get; set; }
[Parameter]
public string? Name { get; set; }
}
}
5 changes: 3 additions & 2 deletions SiemensIXBlazor/Components/Button/IconButton.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ outline="@Outline"
selected="@Selected"
type="@Enum.GetName(Type)?.ToLower()"
variant="@Enum.GetName(Variant)?.ToLower()"
color="@Color"
icon-color="@IconColor"
icon="@Icon"
oval="@Oval"
loading="@Loading"
data-tooltip="@DataTooltip"
size="@((int)Size)">
size="@((int)Size)"
a11y-label="@A11yLabel">
</ix-icon-button>
4 changes: 3 additions & 1 deletion SiemensIXBlazor/Components/Button/IconButton.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SiemensIXBlazor.Components
public partial class IconButton
{
[Parameter]
public string? Color { get; set; }
public string? IconColor { get; set; }
[Parameter]
public bool Disabled { get; set; } = false;
[Parameter]
Expand All @@ -28,6 +28,8 @@ public partial class IconButton
[Parameter]
public ButtonType Type { get; set; } = ButtonType.Button;
[Parameter]
public string? A11yLabel { get; set; }
[Parameter]
public ButtonVariant Variant { get; set; } = ButtonVariant.primary;
[Parameter]
public EventCallback ClickEvent { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
i-1-8n-logout="@I18NLogout"
image="@Image"
initials="@Initials"
top="@Top">
top="@Top"
show-logout-button="@ShowLogoutButton">
@ChildContent
</ix-menu-avatar>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public partial class NavigationMenuAvatar
[Parameter]
public string? Initials { get; set; }
[Parameter]
public bool ShowLogoutButton { get; set; } = true;
[Parameter]
public string? Top { get; set; }
[Parameter]
public EventCallback LogoutClickedEvent { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion SiemensIXBlazor/Components/PushCard/PushCard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
notification="@Notification"
heading="@Heading"
subheading="@SubHeading"
variant="@(EnumParser<PushCardVariant>.ParseEnumToString(Variant))">
variant="@(EnumParser<PushCardVariant>.ParseEnumToString(Variant))"
collapsed="@Collapsed">
</ix-push-card>

2 changes: 2 additions & 0 deletions SiemensIXBlazor/Components/PushCard/PushCard.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public partial class PushCard
/// </summary>
[Parameter]
public string? SubHeading { get; set; }
[Parameter]
public bool Collapsed { get; set; } = true;
/// <summary>
/// Card variant
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions SiemensIXBlazor/Enums/Application/ForceBreakpointEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace SiemensIXBlazor.Enums;

public enum ForceBreakpoint
{
lg,
md,
sm
}
12 changes: 12 additions & 0 deletions SiemensIXBlazor/Objects/Application/AppSwitchConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace SiemensIXBlazor.Objects.Application;

public class AppSwitchConfig
{
public string CurrentAppId { get; set; } = string.Empty;
public List<App> Apps { get; set; } = [];
public string? I18nAppSwitch { get; set; }
public string? I18nLoadingApps { get; set; }

}
14 changes: 14 additions & 0 deletions SiemensIXBlazor/Objects/Application/Apps.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Text.Json.Serialization;

namespace SiemensIXBlazor.Objects.Application;

public class App
{
public string Id { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string Url { get; set; } = string.Empty;
public string Target { get; set; } = string.Empty;
public string IconSrc { get; set; } = string.Empty;
}

1 change: 1 addition & 0 deletions SiemensIXBlazor/SiemensIXBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<ItemGroup>
<Folder Include="wwwroot\js\siemens-ix\" />
<Folder Include="wwwroot\js\interops\" />
<Folder Include="Components\KeyValueList\" />
<Folder Include="Components\KeyValue\" />
<Folder Include="Components\EmptyState\" />
Expand Down
98 changes: 49 additions & 49 deletions SiemensIXBlazor/SiemensIXBlazor_NpmJS/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 93e1ffe

Please sign in to comment.