Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
beyaz committed Sep 30, 2024
1 parent 07dcc5d commit 60c0ec7
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 117 deletions.
31 changes: 28 additions & 3 deletions ReactWithDotNet.WebSite/Pages/PageTechnicalDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,39 @@ protected override Element render()
SpaceY(50),
new p
{
"Lets see what is incoming from server"
"Lets see what is incoming from server to client"
},

SpaceY(20),
new img(WidthFull, ObjectFitContain)
{
Src(Asset("TechnicalDetail.IO.drawio.png"))
}
Src(Asset("TechnicalDetail.I.drawio.png"))
},

SpaceY(50),
new p
{
"Lets see what is outgoing from client to server"
},

SpaceY(20),
new img(WidthFull, ObjectFitContain)
{
Src(Asset("TechnicalDetail.O.drawio.png"))
},
SpaceY(20),
new p
{
"As you can see at images, main idea is server driven UI, just like react server components.",
br,
"Main differences server is not nodejs, language is not typescript or js.",
br,
"Server is .NetCore server and language is c# language.",
br,
"As a result; power of two technology is combined. " +
"We have many benefits of c# language and serverside approach and react components flexibility."
},
SpaceY(50)
};
}
}
69 changes: 27 additions & 42 deletions ReactWithDotNet.WebSite/wwwroot/assets/TechnicalDetail.O.drawio

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,6 @@ function HasId(htmlElement)
return htmlElement.id !== "";
}

function GoUpwardFindFirst(htmlElement, findFunc)
{
while (htmlElement)
{
if (findFunc(htmlElement))
{
return htmlElement;
}

htmlElement = htmlElement.parentElement;
}

return null;
}

function OnDocumentReady(callback)
{
const stateCheck = setInterval(function ()
Expand Down Expand Up @@ -478,16 +463,6 @@ function ShouldBeNumber(value)
throw CreateNewDeveloperError("value should be number.");
}

function NVL(a, b)
{
if (a == null)
{
return b;
}

return a;
}

function Clone(obj)
{
return JSON.parse(JSON.stringify(obj));
Expand Down Expand Up @@ -1390,15 +1365,7 @@ function IsSerializablePrimitiveJsValue(value)

function ConvertToSyntheticMouseEvent(e)
{
let firstNotEmptyId = NVL(GoUpwardFindFirst(e.target, HasId), e.target).id;
if (firstNotEmptyId === '')
{
firstNotEmptyId = null;
}

return {
FirstNotEmptyId: firstNotEmptyId,

altKey: e.altKey,
bubbles: e.bubbles,
clientX: e.clientX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,6 @@ function HasId(htmlElement)
return htmlElement.id !== "";
}

function GoUpwardFindFirst(htmlElement, findFunc)
{
while (htmlElement)
{
if (findFunc(htmlElement))
{
return htmlElement;
}

htmlElement = htmlElement.parentElement;
}

return null;
}

function OnDocumentReady(callback)
{
const stateCheck = setInterval(function ()
Expand Down Expand Up @@ -478,16 +463,6 @@ function ShouldBeNumber(value)
throw CreateNewDeveloperError("value should be number.");
}

function NVL(a, b)
{
if (a == null)
{
return b;
}

return a;
}

function Clone(obj)
{
return JSON.parse(JSON.stringify(obj));
Expand Down Expand Up @@ -1390,15 +1365,7 @@ function IsSerializablePrimitiveJsValue(value)

function ConvertToSyntheticMouseEvent(e)
{
let firstNotEmptyId = NVL(GoUpwardFindFirst(e.target, HasId), e.target).id;
if (firstNotEmptyId === '')
{
firstNotEmptyId = null;
}

return {
FirstNotEmptyId: firstNotEmptyId,

altKey: e.altKey,
bubbles: e.bubbles,
clientX: e.clientX,
Expand Down
7 changes: 1 addition & 6 deletions ReactWithDotNet/SyntheticEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,7 @@ public sealed class MouseEvent : UIEvent
public int clientX { get; init; }
public int clientY { get; init; }
public bool ctrlKey { get; init; }

/// <summary>
/// this is the id of first element id which is 'has id value'
/// </summary>
public string FirstNotEmptyId { get; set; } // todo: remove


public bool metaKey { get; init; }

public double movementX { get; init; }
Expand Down

0 comments on commit 60c0ec7

Please sign in to comment.