258258 margin : 0 4px ;
259259 }
260260
261+ .stats-table {
262+ display : flex;
263+ flex-direction : column;
264+ gap : 8px ;
265+ }
266+
267+ .stats-row {
268+ display : flex;
269+ justify-content : space-between;
270+ align-items : baseline;
271+ padding : 6px 0 ;
272+ border-bottom : 1px solid # eef3f3 ;
273+ }
274+
275+ .stats-row : last-child {
276+ border-bottom : 0 ;
277+ }
278+
279+ .stats-label {
280+ font-size : 14px ;
281+ color : # 355059 ;
282+ }
283+
284+ .stats-value {
285+ font-size : 14px ;
286+ font-weight : 700 ;
287+ color : # 1d2629 ;
288+ font-family : var (--mono );
289+ min-width : 40px ;
290+ text-align : right;
291+ }
292+
261293 .form-shell {
262294 width : min (540px , 100% );
263295 background : # ffffff ;
@@ -716,6 +748,7 @@ <h1>QML 组件模拟器</h1>
716748 < button class ="nav-btn " data-target ="form "> FormDialog.qml</ button >
717749 < button class ="nav-btn " data-target ="font "> FontSelector.qml</ button >
718750 < button class ="nav-btn " data-target ="paragraph "> ParagraphFormat.qml</ button >
751+ < button class ="nav-btn " data-target ="statistics "> Statistics.qml</ button >
719752 < div class ="sidebar-foot "> 模拟目标: DialogShell / DialogButtons / EnumCombo / SelectableList / PreviewPane 组合逻辑。</ div >
720753 </ aside >
721754
@@ -999,6 +1032,51 @@ <h4>字号</h4>
9991032 Cancel/重置走快照撤销(initial-snapshot + revert-to-snapshot)
10001033 </ p >
10011034 </ section >
1035+
1036+ < section class ="panel " id ="panel-statistics ">
1037+ < article class ="dialog " style ="max-width: 380px; ">
1038+ < h3 > Document statistics</ h3 >
1039+ < div class ="stats-table ">
1040+ < div class ="stats-row ">
1041+ < span class ="stats-label "> Page count</ span >
1042+ < span class ="stats-value "> 1</ span >
1043+ </ div >
1044+ < div class ="stats-row ">
1045+ < span class ="stats-label "> Word count</ span >
1046+ < span class ="stats-value "> 42</ span >
1047+ </ div >
1048+ < div class ="stats-row ">
1049+ < span class ="stats-label "> Character count (with spaces)</ span >
1050+ < span class ="stats-value "> 256</ span >
1051+ </ div >
1052+ < div class ="stats-row ">
1053+ < span class ="stats-label "> Character count (without spaces)</ span >
1054+ < span class ="stats-value "> 230</ span >
1055+ </ div >
1056+ < div class ="stats-row ">
1057+ < span class ="stats-label "> Paragraph count</ span >
1058+ < span class ="stats-value "> 5</ span >
1059+ </ div >
1060+ < div class ="stats-row ">
1061+ < span class ="stats-label "> Non-Chinese word</ span >
1062+ < span class ="stats-value "> 30</ span >
1063+ </ div >
1064+ < div class ="stats-row ">
1065+ < span class ="stats-label "> Chinese character</ span >
1066+ < span class ="stats-value "> 120</ span >
1067+ </ div >
1068+ </ div >
1069+ < div class ="btn-row " style ="margin-top: 20px; ">
1070+ < button class ="btn primary " data-log ="Statistics: closeBridge.choose(0) 关闭 "> 关闭</ button >
1071+ </ div >
1072+ </ article >
1073+ < p class ="legend ">
1074+ 对应 QML: < code > statsModel: [{label, value}, ...]</ code >
1075+ < code > statsTitle: dialogTitle</ code >
1076+ < code > buttonLabels: dialogButtons</ code >
1077+ < code > onClicked -> closeBridge.choose(0)</ code >
1078+ </ p >
1079+ </ section >
10021080 </ main >
10031081 </ div >
10041082
@@ -1009,21 +1087,24 @@ <h4>字号</h4>
10091087 confirm : document . getElementById ( 'panel-confirm' ) ,
10101088 form : document . getElementById ( 'panel-form' ) ,
10111089 font : document . getElementById ( 'panel-font' ) ,
1012- paragraph : document . getElementById ( 'panel-paragraph' )
1090+ paragraph : document . getElementById ( 'panel-paragraph' ) ,
1091+ statistics : document . getElementById ( 'panel-statistics' )
10131092 } ;
10141093
10151094 const titleMap = {
10161095 confirm : 'ConfirmClose.qml 模拟' ,
10171096 form : 'FormDialog.qml 模拟' ,
10181097 font : 'FontSelector.qml 模拟' ,
1019- paragraph : 'ParagraphFormat.qml 模拟'
1098+ paragraph : 'ParagraphFormat.qml 模拟' ,
1099+ statistics : 'Statistics.qml 模拟'
10201100 } ;
10211101
10221102 const codeMap = {
10231103 confirm : 'dialogMessage + dialogButtons + closeBridge.choose()' ,
10241104 form : 'formFields + values 收集 + closeBridge.submit(values)' ,
10251105 font : 'fontBridge 联动: family/style/filter/customize/preview' ,
1026- paragraph : 'EnumCombo x N + tabs(基础/高级) + make-multi-line-with 写回'
1106+ paragraph : 'EnumCombo x N + tabs(基础/高级) + make-multi-line-with 写回' ,
1107+ statistics : 'statsModel: [{label, value}, ...] + closeBridge.choose(0) 关闭'
10271108 } ;
10281109
10291110 const viewTitle = document . getElementById ( 'view-title' ) ;
0 commit comments