File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.SummerNote Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.0.8 </Version >
4+ <Version >9.0.9 </Version >
55 </PropertyGroup >
66
77 <PropertyGroup >
Original file line number Diff line number Diff line change 77{
88 <BootstrapLabel required =" @Required" for =" @Id" ShowLabelTooltip =" ShowLabelTooltip" Value =" @DisplayText" />
99}
10- <div @attributes =" @AdditionalAttributes" id =" @Id" class =" editor " data-bb-submit =" @ShowSubmitString" >
10+ <div @attributes =" @AdditionalAttributes" id =" @Id" class =" @ClassString " data-bb-submit =" @ShowSubmitString" >
1111 <div class =" @EditClassString" placeholder =" @PlaceHolder" ></div >
1212</div >
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ namespace BootstrapBlazor.Components;
1313/// </summary>
1414public partial class Editor
1515{
16+ private string ? ClassString => CssBuilder . Default ( "editor" )
17+ . AddClass ( CssClass ) . AddClass ( ValidCss )
18+ . Build ( ) ;
19+
1620 /// <summary>
1721 /// 获得 Editor 样式
1822 /// </summary>
@@ -182,20 +186,10 @@ protected override async Task InvokeInitAsync()
182186 /// </summary>
183187 /// <param name="value"></param>
184188 [ JSInvokable ]
185- public async Task Update ( string value )
189+ public void Update ( string value )
186190 {
187- Value = value ;
188- _lastValue = Value ;
189-
190- if ( ValueChanged . HasDelegate )
191- {
192- await ValueChanged . InvokeAsync ( Value ) ;
193- }
194-
195- if ( OnValueChanged != null )
196- {
197- await OnValueChanged . Invoke ( value ) ;
198- }
191+ CurrentValue = value ;
192+ _lastValue = value ;
199193 }
200194
201195 /// <summary>
Original file line number Diff line number Diff line change 1- import '../../js/summernote-bs5.min.js'
1+ import '../../js/summernote-bs5.min.js'
22import { addLink , addScript } from '../../../BootstrapBlazor/modules/utility.js'
33import Data from '../../../BootstrapBlazor/modules/data.js'
44import EventHandler from '../../../BootstrapBlazor/modules/event-handler.js'
@@ -175,7 +175,11 @@ export function getCode(id) {
175175}
176176
177177export function reset ( id ) {
178- const editor = Data . get ( id )
178+ const editor = Data . get ( id ) ;
179+ if ( ! editor . $editor ) {
180+ return ;
181+ }
182+
179183 const context = editor . $editor . data ( 'summernote' )
180184
181185 const showSubmit = editor . el . getAttribute ( "data-bb-submit" ) === "true"
Original file line number Diff line number Diff line change 1- .editor .editor-body {
1+ .editor .editor-body {
22 cursor : pointer;
33 min-height : 50px ;
44 height : auto;
5858 display : block;
5959}
6060
61+ .editor .is-invalid .note-frame ,
62+ .editor .is-invalid > .form-control {
63+ border : 1px solid var (--bs-danger ) !important ;
64+ }
65+
66+ .editor .is-valid .note-frame ,
67+ .editor .is-valid > .form-control {
68+ border : 1px solid var (--bs-success ) !important ;
69+ }
70+
6171.modal-body .note-form-group : not (: last-child ) {
6272 margin-bottom : 0.5rem ;
6373}
You can’t perform that action at this time.
0 commit comments