-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve look & feel of disabled state (#43)
* Improve look & feel of disabled state * Cleanup node stuff
- Loading branch information
1 parent
842a0db
commit 4c2ee77
Showing
9 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/Spillgebees.Blazor.RichTextEditor.Assets/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
22 changes: 22 additions & 0 deletions
22
src/Spillgebees.Blazor.RichTextEditor.Assets/src/styles.css
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 |
---|---|---|
@@ -1,6 +1,28 @@ | ||
@import '../node_modules/quill/dist/quill.bubble.css'; | ||
@import '../node_modules/quill/dist/quill.snow.css'; | ||
|
||
.rich-text-editor-container.rich-text-editor-container-disabled { | ||
cursor: not-allowed; | ||
opacity: 0.38; | ||
pointer-events: all; | ||
} | ||
|
||
.rich-text-editor-editor-container.rich-text-editor-editor-container-disabled { | ||
pointer-events: none; | ||
} | ||
|
||
.ql-toolbar.ql-snow.rich-text-editor-toolbar-container-bottom { | ||
border-top: none; | ||
} | ||
|
||
.ql-toolbar.ql-snow.rich-text-editor-toolbar-container-hidden + .ql-container.ql-snow.ql-disabled.rich-text-editor-editor-container { | ||
border-top: 1px solid #ccc; | ||
} | ||
|
||
.ql-toolbar.ql-snow.rich-text-editor-toolbar-container-disabled { | ||
pointer-events: none; | ||
} | ||
|
||
.ql-toolbar.ql-snow.rich-text-editor-toolbar-container-hidden { | ||
display: none; | ||
} |
25 changes: 25 additions & 0 deletions
25
...illgebees.Blazor.RichTextEditor.Samples.Shared/Examples/HiddenRichTextEditorExample.razor
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,25 @@ | ||
<div> | ||
<h3>Disabled editor with <code class="hljs">ToolbarDisabledBehavior.Hidden</code></h3> | ||
<CodeSnippet Code="@Code"> | ||
<Component> | ||
<CodeSnippet Code="@_content" | ||
CodeFormat="CodeFormat.Html" | ||
Summary="Show HTML"> | ||
<Component> | ||
<RichTextEditor @bind-Content="@_content" | ||
IsEditorEnabled="@false" | ||
ToolbarOptions="ToolbarOptions.BasicToolbarOptions with { ToolbarDisabledBehavior = ToolbarDisabledBehavior.Hidden }"/> | ||
</Component> | ||
</CodeSnippet> | ||
</Component> | ||
</CodeSnippet> | ||
</div> | ||
|
||
@code { | ||
private const string Code = | ||
@"<RichTextEditor @bind-Content=""@_content"" | ||
IsEditorEnabled=""@false"" | ||
ToolbarOptions=""ToolbarOptions.BasicToolbarOptions with { ToolbarDisabledBehavior = ToolbarDisabledBehavior.Hidden }""/>"; | ||
|
||
private string _content = "<b>Hello! \ud83d\udc4b</b>"; | ||
} |
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
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
7 changes: 7 additions & 0 deletions
7
src/Spillgebees.Blazor.RichTextEditor/Components/Toolbar/ToolbarDisabledBehavior.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,7 @@ | ||
namespace Spillgebees.Blazor.RichTextEditor.Components.Toolbar; | ||
|
||
public enum ToolbarDisabledBehavior | ||
{ | ||
Disabled, | ||
Hidden | ||
} |
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