Skip to content

Commit

Permalink
Merge pull request #46 from majorimi/dev/color
Browse files Browse the repository at this point in the history
release fixes.
  • Loading branch information
majorimi authored Nov 30, 2020
2 parents 4de6314 + 0b08420 commit 9f87263
Show file tree
Hide file tree
Showing 27 changed files with 765 additions and 55 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,41 @@ Blazor Components
[![Build Status](https://dev.azure.com/major-soft/GitHub/_apis/build/status/blazor-components/blazor-components-Nuget?branchName=master)](https://dev.azure.com/major-soft/GitHub/_build/latest?definitionId=7&branchName=master)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/majorimi/blazor-components/blob/master/LICENSE)

Blazor Components is a set of UI Components and other useful Extensions for [Blazor](https://blazor.net) applications.
Majorsoft Blazor Components is a set of UI Components and other useful Extensions for [Blazor](https://blazor.net) applications.
All components are available on [NuGet](https://www.nuget.org/profiles/Blazor.Components).

Detailed descriptions and usage code samples are available on separated readme files.
## About the project
**Majorsoft Blazor Components** is one of the newest but the most modern Blazor library. The main goal of this project is to provide an easy to use, feature reach full set of components with other
useful extensions. Which can boost Blazor app developments by:
- Providing reusable components which are the main building blocks of Blazor.
- Hiding CSS details but allowing component customizations as well (no dependency on CSS libraries).
- Hiding JS implementations but exposing many reusable JS functionality and events via new C# APIs (no dependency on JS libraries).
- All running on the fastest ever .NET framework: **.NET 5**. Fully leveraging CSS and JS isolation, JS object reference and modul exports, etc.
- Modular project each package has "single responsibility" install only what you need, reduce download size.
- As simple as possible setup (custom JS referencing not required) all documented with usage examples and demo app.
- All components work on Blazor Server and Clint side.
- Components are extensible, provided extensions and services can be used in other components.
- All components and extensions written in C# (with some required JS) and unit tested with [bUnit](https://github.com/egil/bUnit).

## Prerequisites
- .NET 5
- Visual Studio 2019.

## Majorsoft Blazor Components and Extensions

Detailed descriptions and usage code samples are available on separated docs files.
Please follow the link provided on each bullet points. Also you can try out all components and extensions by launching the [demo app](https://blazorextensions.z6.web.core.windows.net/).

## Blazor Extensions
Check out our planned components and extensions on the project [Wiki page](https://github.com/majorimi/blazor-components/wiki).

### Blazor Extensions

Blazor Extensions are providing useful features to develop Balazor applications:

- **Blazor.Server.Logging.Console**: Enables [browser conole logging](https://github.com/majorimi/blazor-components/blob/master/.github/docs/ServerHostedLogging.md) for Blazor applications using **Server Hosted model**.
- **Blazor.WebAssembly.Logging.Console**: Enables [browser conole logging](https://github.com/majorimi/blazor-components/blob/master/.github/docs/WebAssemblyHostedLogging.md) for Blazor applications using **WebAssembly Hosting model**.

## Blazor Components
### Blazor Components

Blazor Components are providing custom UI components to develop Balazor applications:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<RepositoryType>Git</RepositoryType>
<PackageTags>.Net5 Blazor Color Picker, RGB, HEX, HSL</PackageTags>
<PackageReleaseNotes>See Releases here: https://github.com/majorimi/blazor-components/releases</PackageReleaseNotes>
<Description>Blazor component that renders a Blazor Color Picker control with color info.</Description>
<Description>Blazor component that renders a Blazor Color Picker control with color info. Part of Majorsoft Blazor library.</Description>
<Title>Blazor Components Typeahead Input</Title>
<PackageLicenseFile>License.txt</PackageLicenseFile>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<RepositoryUrl>https://github.com/majorimi/blazor-components</RepositoryUrl>
<PackageIcon>blazor.components.png</PackageIcon>
<RepositoryType>Git</RepositoryType>
<Description>Blazor component that provides useful functionality which can be achieved only with Js Interop.</Description>
<Description>Blazor component that provides useful functionality which can be achieved only with Js Interop. Part of Majorsoft Blazor library.</Description>
<PackageReleaseNotes>See Releases here: https://github.com/majorimi/blazor-components/releases</PackageReleaseNotes>
<PackageTags>.Net5 Blazor Js Interop Click Scroll Focus BoundRect</PackageTags>
<PackageLicenseFile>License.txt</PackageLicenseFile>
Expand Down
17 changes: 9 additions & 8 deletions src/Blazor.Components.Common.JsInterop/wwwroot/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ export function scrollToElementByName(name) {
}
}

let undef = "undefined";
//Element scrolled inside another element
export function scrollToElementInParent(parent, element) {
if (parent && element && typeof parent.hasOwnProperty("scrollTop") && isElementHidden(element)) {
if (parent && element && typeof parent.scrollTop !== undef && isElementHidden(element)) {
parent.scrollTop = element.offsetHeight;
}
}
export function scrollInParentById(parent, elementId) {
if (parent && elementId && typeof parent.hasOwnProperty("scrollTop")) {
if (parent && elementId && typeof parent.scrollTop !== undef) {
let element = document.getElementById(elementId);

if (element && isElementHidden(element)) {
Expand All @@ -35,7 +36,7 @@ export function scrollInParentById(parent, elementId) {
}
}
export function scrollInParentByClass(parent, elementClass) {
if (parent && elementClass && typeof parent.hasOwnProperty("scrollTop")) {
if (parent && elementClass && typeof parent.scrollTop !== undef) {
let elements = document.getElementsByClassName(elementClass);

if (elements && elements[0]) {
Expand Down Expand Up @@ -75,27 +76,27 @@ export function isElementHiddenAbove(element) {

//Scrolling inside an element use it for e.g. Textarea
export function scrollToEnd(element) {
if (element && typeof element.hasOwnProperty("scrollTop") && element.hasOwnProperty("scrollHeight")) {
if (element && typeof element.scrollTop !== undef && typeof element.scrollHeight !== undef) {
element.scrollTop = element.scrollHeight;
}
}
export function scrollToTop(element) {
if (element && typeof element.hasOwnProperty("scrollTop")) {
if (element && typeof element.scrollTop !== undef) {
element.scrollTop = 0;
}
}
export function scrollToX(element, x) {
if (element && typeof element.hasOwnProperty("scrollTop")) {
if (element && typeof element.scrollTop !== undef) {
element.scrollTop = x;
}
}
export function scrollToY(element, y) {
if (element && typeof element.hasOwnProperty("scrollLeft")) {
if (element && typeof element.scrollLeft !== undef) {
element.scrollLeft = y;
}
}
export function getScrollXPosition(element) {
if (element && typeof element.hasOwnProperty("scrollTop")) {
if (element && typeof element.scrollTop !== undef) {
return element.scrollTop;
}
}
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201020-06" />
<PackageReference Include="Moq" Version="4.15.1" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Product>Blazor Components</Product>
<Copyright>Imre Toth 2020</Copyright>
<PackageLicenseExpression></PackageLicenseExpression>
<Description>Blazor Extensions and Components wrapper to notify on CSS Transition and Animation events.</Description>
<Description>Blazor Extensions and Components wrapper to notify on CSS Transition and Animation events. Part of Majorsoft Blazor library.</Description>
<PackageProjectUrl>https://github.com/majorimi/blazor-components/blob/master/.github/docs/CssEvents.md</PackageProjectUrl>
<RepositoryUrl>https://github.com/majorimi/blazor-components</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="bunit" Version="1.0.0-beta-11" />
<PackageReference Include="bunit.web" Version="1.0.0-beta-11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201020-06" />
<PackageReference Include="Moq" Version="4.15.1" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageLicenseExpression></PackageLicenseExpression>
<PackageReleaseNotes>See Releases here: https://github.com/majorimi/blazor-components/releases </PackageReleaseNotes>
<Copyright>Imre Toth 2020</Copyright>
<Description>Blazor component that renders an Input, InputText, Textarea or InputTextarea, etc. element with debounced onChange.</Description>
<Description>Blazor component that renders an Input, InputText, Textarea or InputTextarea, etc. element with debounced onChange. Part of Majorsoft Blazor library.</Description>
<Title>Blazor Components Debounce Input</Title>
<PackageLicenseFile>License.txt</PackageLicenseFile>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
Expand All @@ -12,7 +12,7 @@
<Product>Blazor Components</Product>
<Copyright>Imre Toth 2020</Copyright>
<PackageLicenseExpression></PackageLicenseExpression>
<Description>Blazor component that renders wrapper components to enables Drag and Drop in Blazor Apps.</Description>
<Description>Blazor component that renders wrapper components to enables Drag and Drop in Blazor Apps. Part of Majorsoft Blazor library.</Description>
<PackageProjectUrl>https://github.com/majorimi/blazor-components/blob/master/.github/docs/DragAndDrop.md</PackageProjectUrl>
<RepositoryUrl>https://github.com/majorimi/blazor-components</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="bunit" Version="1.0.0-beta-11" />
<PackageReference Include="bunit.web" Version="1.0.0-beta-11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201020-06" />
<PackageReference Include="Moq" Version="4.15.1" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<RepositoryUrl>https://github.com/majorimi/blazor-components</RepositoryUrl>
<PackageIcon>blazor.components.png</PackageIcon>
<RepositoryType>Git</RepositoryType>
<Description>Blazor components that renders Overlay for page load. HTML Button with customizable content to show during async operation progress/loading state.</Description>
<Description>Blazor components that renders Overlay for page load. HTML Button with customizable content to show during async operation progress/loading state. Part of Majorsoft Blazor library.</Description>
<PackageReleaseNotes>See Releases here: https://github.com/majorimi/blazor-components/releases</PackageReleaseNotes>
<PackageTags>.Net5 Blazor Htlm.Button Loading Progress</PackageTags>
<PackageLicenseFile>License.txt</PackageLicenseFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="bunit" Version="1.0.0-beta-11" />
<PackageReference Include="bunit.web" Version="1.0.0-beta-11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201020-06" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Blazor.Components.Common.JsInterop\Blazor.Components.Common.JsInterop.csproj" />
<ProjectReference Include="..\Blazor.Components.CssEvents\Blazor.Components.CssEvents.csproj" />
<ProjectReference Include="..\Blazor.Components.Modal\Blazor.Components.Modal.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 9f87263

Please sign in to comment.