ht-emr 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas-editor.js +1503 -307
- package/dist/canvas-editor.js.map +1 -1
- package/dist/canvas-editor.umd.cjs +26 -26
- package/dist/canvas-editor.umd.cjs.map +1 -1
- package/dist/src/editor/core/cursor/Cursor.d.ts +100 -0
- package/dist/src/editor/core/cursor/CursorAgent.d.ts +79 -0
- package/dist/src/editor/core/draw/Draw.d.ts +533 -0
- package/dist/src/editor/core/draw/particle/MacroParticle.d.ts +0 -5
- package/dist/src/editor/core/event/CanvasEvent.d.ts +143 -0
- package/dist/src/editor/core/position/Position.d.ts +132 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +278 -0
- package/dist/src/editor/index.d.ts +58 -0
- package/package.json +1 -1
package/dist/canvas-editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-style",e.appendChild(document.createTextNode(`.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;overflow-y:auto}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-calculator{position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;padding:8px;width:200px}.ce-calculator-display{width:100%;height:40px;line-height:40px;text-align:right;padding:0 10px;margin-bottom:8px;border:1px solid #e4e7ed;border-radius:4px;background-color:#f5f7fa;font-size:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.ce-calculator-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ce-calculator-button{width:100%;height:36px;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;font-size:14px;cursor:pointer;transition:all .2s;box-sizing:border-box}.ce-calculator-button:hover{background-color:#eef2fd;border-color:#c6d1ff}.ce-calculator-button:active{background-color:#e1e8ff}.ce-calculator-button.operator{background-color:#f5f7fa}.ce-calculator-button.operator:hover{background-color:#eef2fd}.ce-calculator-button.equal{background-color:var(--COLOR-HOVER, #5175f4);color:#fff;border-color:var(--COLOR-HOVER, #5175f4)}.ce-calculator-button.equal:hover{background-color:var(--COLOR-HOVER, #6a84ff);border-color:var(--COLOR-HOVER, #6a84ff)}.ce-calculator-button.utility{background-color:#f0f2f5}.ce-calculator-button.utility:hover{background-color:#e6e8eb}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#fff;border-radius:4px;padding:10px;-webkit-user-select:none;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:calc(100%/7);text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:calc(100%/7);height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175f4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-block-item .ce-resizer-selection{width:100%;height:100%}.ce-block-item .ce-resizer-mask{position:absolute;inset:0;z-index:1;background-color:transparent}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.97%207l1.415%201.414-7.779%207.778%207.779%207.779-1.414%201.414-7.779-7.779-7.778%207.779L7%2023.97l7.778-7.779L7%208.414%208.414%207l7.778%207.778L23.971%207z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e") no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%2014v-4h2v4h4v2h-4v4h-2v-4h-4v-2h4zm8.749%2010.163A11.952%2011.952%200%200115%2027C8.373%2027%203%2021.627%203%2015S8.373%203%2015%203s12%205.373%2012%2012c0%202.954-1.067%205.658-2.837%207.749l4.908%204.908-1.414%201.414-4.908-4.908zM15%2025c5.523%200%2010-4.477%2010-10S20.523%205%2015%205%205%209.477%205%2015s4.477%2010%2010%2010z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.749%2024.163A11.952%2011.952%200%200115%2027C8.373%2027%203%2021.627%203%2015S8.373%203%2015%203s12%205.373%2012%2012c0%202.954-1.067%205.658-2.837%207.749l4.908%204.908-1.414%201.414-4.908-4.908zM15%2025c5.523%200%2010-4.477%2010-10S20.523%205%2015%205%205%209.477%205%2015s4.477%2010%2010%2010zm-5-11h10v2H10v-2z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.rotate{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M16%204c6.627%200%2012%205.373%2012%2012a11.97%2011.97%200%2001-4%208.944V23h-.86A9.968%209.968%200%200026%2016c0-5.523-4.477-10-10-10S6%2010.477%206%2016c0%205.185%203.947%209.449%209%209.95v2.009C8.84%2027.451%204%2022.291%204%2016%204%209.373%209.373%204%2016%204z'%20fill-rule='nonzero'/%3e%3cpath%20d='M19.879%2027.328l1.767-6.717%204.95%204.95z'/%3e%3c/g%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.original-size{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%204h24v24H4V4zm2%202v20h20V6H6zm4%205h2v10h-2V11zm5%202h2v2h-2v-2zm0%204h2v2h-2v-2zm5-6h2v10h-2V11z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.image-download{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.5%2015v3.5h15V15H21v5H3v-5h1.5zm8.232-11.226v9.196l4.05-4.05%201.06%201.06-5.834%205.834-5.833-5.833%201.06-1.06%203.998%203.996V3.774h1.5z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%204.063L6.875%2010l5.625%205.938'%20stroke='%233D4757'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.image-next{background-image:url("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.5%204.063L13.125%2010%207.5%2015.938'%20stroke='%233D4757'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M0%200h16v16H0z'/%3e%3cg%20fill='%23767C85'%3e%3cpath%20d='M7%2012.243l-.707-.707%204.243-4.243.707.707z'/%3e%3cpath%20d='M6.293%204.464L7%203.757%2011.243%208l-.707.707z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:#1937580a}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.ce-contextmenu-print{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M12%204h-1V2H5v2H4V2a1%201%200%20011-1h6a1%201%200%20011%201v2zm0%205v4a1%201%200%2001-1%201H5a1%201%200%2001-1-1V9h1v4h6V9h1z'/%3e%3cpath%20d='M12%2012v-1h2V5H2v6h2v1H2a1%201%200%2001-1-1V5a1%201%200%20011-1h12a1%201%200%20011%201v6a1%201%200%2001-1%201h-2z'/%3e%3cpath%20d='M3%208h10v1H3zm8-2h2v1h-2z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-image{background-image:url("data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_插入图片-16px-'%3e%3cg%20id='Group-19'%20transform='translate(1%201)'%3e%3cpath%20id='Combined-Shape'%20class='st0'%20d='M1%200h12c.6%200%201%20.4%201%201v11c0%20.6-.4%201-1%201H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1zm0%201v11h12V1H1z'/%3e%3ccircle%20id='椭圆形'%20class='st0'%20cx='10'%20cy='4'%20r='1'/%3e%3cpath%20id='Path'%20class='st0'%20d='M8.5%2011.2l-4-4.1L1%2010.7V9.2c1.7-1.6%202.7-2.5%203-2.8.4-.5.7-.4%201%200L8.5%2010%2011%207.3c.4-.5.6-.5%201-.1l2%202.8v1.5l-2.5-3.4-3%203.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-image-change{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(2%204)'%20fill='%233D4757'%3e%3ccircle%20fill-rule='nonzero'%20cx='3'%20cy='1'%20r='1'/%3e%3cpath%20d='M7.473%208.223L3.47%204.107%200%207.667v-1.5C1.715%204.6%202.707%203.664%202.975%203.358c.402-.457.651-.39%201.042%200L7.473%207%209.96%204.349c.414-.462.62-.462%201.011-.071L13%207.06v1.5l-2.51-3.41-3.017%203.072z'/%3e%3c/g%3e%3cpath%20d='M6%201.5H1.5v12h13v-4V13a.5.5%200%2001-.5.5H2a.5.5%200%2001-.5-.5V2a.5.5%200%2001.5-.5h4zm8.5%208V6l-.5.5h1l-.5-.5v3.5zM6%201.5h4L9.5%201v1l.5-.5H6z'%20stroke='%233D4757'/%3e%3cpath%20d='M13.085%201.316l-3.814%204a1%201%200%20001.458%201.368l3.815-4a1%201%200%2010-1.459-1.368z'%20fill='%233D4757'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-row-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%233D4757'%20d='M8.5%205.5h6v4h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M4%207v1h2V7zm-3%20.5L4%205v5zM1%201h12v1H1zm0%2012h12v1H1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-top-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M8%205H7v3h1zm-.5-3L10%205H5z'/%3e%3crect%20stroke='%233D4757'%20x='1.5'%20y='10.5'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-bottom-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M7%2011h1V8H7zm.5%203L5%2011h5z'/%3e%3crect%20stroke='%233D4757'%20x='1.5'%20y='2.5'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-left-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M11%207v1h3V7zm-3%20.5L11%205v5z'/%3e%3crect%20stroke='%233D4757'%20transform='rotate(90%204%207.5)'%20x='-2'%20y='6'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-right-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M5%208V7H2v1zm3-.5L5%2010V5z'/%3e%3crect%20stroke='%233D4757'%20transform='rotate(90%2012%207.5)'%20x='6'%20y='6'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-row-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M8.5%206.5h6v2h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M2%2012h11v1H2zM2%202h11v1H2zm.63%203L7%209.35l-.635.65L2%205.63z'/%3e%3cpath%20fill='%233D4757'%20d='M2%209.363L6.355%205%207%205.707%202.695%2010z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M8.5%205.5h6v4h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M1%2013h12v1H1zM1%201h12v1H1zm0%204h1v1H1zm1%201h1v1H2zm1%201h1v1H3zm1-1h1v1H4zm1-1h1v1H5zM4%208h1v1H4zM2%208h1v1H2zm3%201h1v1H5zM1%209h1v1H1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M5.5%207.5v-6h4v6z'/%3e%3cpath%20fill='%233D4757'%20d='M13%2015V3h1v12zM1%2015V3h1v12zm4%200v-1h1v1zm1-1v-1h1v1zm1-1v-1h1v1zm-1-1v-1h1v1zm-1-1v-1h1v1zm3%201v-1h1v1zm0%202v-1h1v1zm1-3v-1h1v1zm0%204v-1h1v1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-table{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M14%2013h-1v-3H2v3H1v-3a1%201%200%20011-1h11a1%201%200%20011%201v3z'%20fill-rule='nonzero'/%3e%3cpath%20d='M5.625%202L10%206.375%209.375%207%205%202.625z'/%3e%3cpath%20d='M5%206.375L9.375%202l.625.625L5.625%207z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-merge-cell{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6%201v1H2v11h4v1H2a1%201%200%2001-1-1V2a1%201%200%20011-1h4zm3%200h4a1%201%200%20011%201v11a1%201%200%2001-1%201H9v-1h4V2H9V1z'/%3e%3cpath%20fill-rule='nonzero'%20d='M6%201h1v4H6zm2%200h1v4H8z'/%3e%3cpath%20d='M8%207.5L10%206v3zm-1%200L5%206v3z'/%3e%3cpath%20d='M9%207h3v1H9zM3%207h3v1H3z'/%3e%3cpath%20fill-rule='nonzero'%20d='M8%2010h1v4H8zm-2%200h1v4H6z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-merge-cancel-cell{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6%201v1H2v11h4v1H2a1%201%200%2001-1-1V2a1%201%200%20011-1h4zm3%200h4a1%201%200%20011%201v11a1%201%200%2001-1%201H9v-1h4V2H9V1z'/%3e%3cpath%20fill-rule='nonzero'%20d='M6%201h1v4H6zm2%200h1v4H8z'/%3e%3cpath%20d='M3%207.5L5%206v3zm9%200L10%206v3z'/%3e%3cpath%20d='M4%207h3v1H4zm4%200h3v1H8z'/%3e%3cpath%20fill-rule='nonzero'%20d='M8%2010h1v4H8zm-2%200h1v4H6z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-vertical-align{background-image:url("data:image/svg+xml,%3csvg%20height='16'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2zm0-3h8v1H2zm0-3h12v1H2zm0-6h12v1H2zm0%203h8v1H2z'%20fill='%233d4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-top{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%208H7v6h1zm-.5-3L10%208H5zM2%203h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-middle{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%2012H7v3h1zm-.5-3l2.5%203H5zM7%203h1V0H7zm.5%203L5%203h5zM2%207h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-bottom{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%209h1V3H7zm.5%203L5%209h5zM2%2013h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-border-all{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M3%208h11v1H3z'/%3e%3cpath%20fill='%233D4757'%20d='M9%203v11H8V3z'/%3e%3c/svg%3e")}.ce-contextmenu-border-empty{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13%203h-1V2h1a1%201%200%20011%201v1h-1V3zm-3-1v1H8.5v2h-1V3H6V2h4zM4%202v1H3v1H2V3a1%201%200%20011-1h1zM2%206h1v1.5h2v1H3V10H2V6zm0%206h1v1h1v1H3a1%201%200%2001-1-1v-1zm4%202v-1h1.5v-2h1v2H10v1H6zm6%200v-1h1v-1h1v1a1%201%200%2001-1%201h-1zm2-4h-1V8.5h-2v-1h2V6h1v4zM8.5%207.5v-1h-1v1h-1v1h1v1h1v-1h1v-1h-1z'%20fill='%23AAACB0'/%3e%3c/svg%3e")}.ce-contextmenu-border-dash{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13%203h-1V2h1a1%201%200%20011%201v1h-1V3zm-3-1v1H8.5v2h-1V3H6V2h4zM4%202v1H3v1H2V3a1%201%200%20011-1h1zM2%206h1v1.5h2v1H3V10H2V6zm0%206h1v1h1v1H3a1%201%200%2001-1-1v-1zm4%202v-1h1.5v-2h1v2H10v1H6zm6%200v-1h1v-1h1v1a1%201%200%2001-1%201h-1zm2-4h-1V8.5h-2v-1h2V6h1v4zM8.5%207.5v-1h-1v1h-1v1h1v1h1v-1h1v-1h-1z'%20fill='%23000000'/%3e%3c/svg%3e")}.ce-contextmenu-border-external{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%233D4757'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%205V3H8v2h1zm0%209v-2H8v2h1zM5%208H3v1h2V8zm9%200h-2v1h2V8zM9%207v1h1v1H9v1H8V9H7V8h1V7h1z'%20fill='%23AAACB0'/%3e%3c/svg%3e")}.ce-contextmenu-border-internal{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%205V3H8v2h1zm0%209v-2H8v2h1zM5%208H3v1h2V8zm9%200h-2v1h2V8zM9%207v1h1v1H9v1H8V9H7V8h1V7h1z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-contextmenu-border-td{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20d='M8.5%202.5%20v6%20h-6'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-top{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M2.5%203%20h12'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-left{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M3%203%20v11'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-bottom{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M2.5%2014%20h12'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-right{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M14%203%20v11'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-forward{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'%20/%3e%3cpath%20stroke='%233D4757'%20d='M14%203%20l-11%2011'%20/%3e%3c/svg%3e")}.ce-contextmenu-border-td-back{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'%20/%3e%3cpath%20stroke='%233D4757'%20d='M3%203%20l11%2011'%20/%3e%3c/svg%3e")}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:#dae7fc;position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;-webkit-user-select:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{min-width:60px!important;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;-webkit-user-select:none;user-select:none;caret-color:transparent;background-color:transparent;white-space:pre}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}.ce-button-input-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-button-input-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:320px;max-width:480px;box-shadow:0 4px 20px #00000026}.ce-button-input-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.ce-button-input-modal__textarea{width:100%;min-height:100px;padding:10px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;line-height:1.5;resize:vertical;outline:none;box-sizing:border-box;font-family:inherit}.ce-button-input-modal__textarea:focus{border-color:#5175f4}.ce-button-input-modal__textarea::placeholder{color:#c0c4cc}.ce-button-input-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-button-input-modal__cancel,.ce-button-input-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-button-input-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-button-input-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-button-input-modal__confirm:hover{background:#409eff;border-color:#409eff}.ce-button-edit-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-button-edit-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:320px;max-width:480px;box-shadow:0 4px 20px #00000026}.ce-button-edit-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:16px}.ce-button-edit-modal__form{display:flex;flex-direction:column;gap:12px}.ce-button-edit-modal__field{display:flex;align-items:center;gap:8px}.ce-button-edit-modal__field label{min-width:80px;font-size:13px;color:#606266}.ce-button-edit-modal__field input{flex:1;padding:8px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;outline:none;box-sizing:border-box}.ce-button-edit-modal__field input:focus{border-color:#5175f4}.ce-button-edit-modal__field input::placeholder{color:#c0c4cc}.ce-button-edit-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-button-edit-modal__cancel,.ce-button-edit-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-button-edit-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-button-edit-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-button-edit-modal__confirm:hover{background:#409eff;border-color:#409eff}.ce-number-input-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-number-input-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:300px;max-width:400px;box-shadow:0 4px 20px #00000026}.ce-number-input-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.ce-number-input-modal__hint{font-size:12px;color:#909399;margin-bottom:12px}.ce-number-input-modal__input{width:100%;padding:10px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;outline:none;box-sizing:border-box}.ce-number-input-modal__input:focus{border-color:#5175f4}.ce-number-input-modal__input::placeholder{color:#c0c4cc}.ce-number-input-modal__error{font-size:12px;color:#f56c6c;margin-top:8px}.ce-number-input-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-number-input-modal__cancel,.ce-number-input-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-number-input-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-number-input-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-number-input-modal__confirm:hover{background:#409eff;border-color:#409eff}.tooth-position-edit-modal,.tooth-position-create-modal{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000}.tooth-position-modal__mask{position:absolute;top:0;left:0;width:100%;height:100%;background:#00000080}.tooth-position-modal__container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;min-width:400px;max-width:90vw}.tooth-position-modal__header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e8e8e8}.tooth-position-modal__header span{font-size:16px;font-weight:500;color:#333}.tooth-position-modal__close{font-size:20px;cursor:pointer;color:#999;line-height:1}.tooth-position-modal__close:hover{color:#333}.tooth-position-modal__content{padding:20px;max-height:60vh;overflow-y:auto}.tooth-section{margin-bottom:20px}.tooth-section:last-child{margin-bottom:0}.tooth-section-title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px;padding-left:8px;border-left:3px solid #1890ff}.tooth-row{display:flex;align-items:center;margin-bottom:8px}.tooth-row:last-child{margin-bottom:0}.tooth-row-label{width:30px;font-size:13px;color:#666}.tooth-buttons{display:flex;gap:8px;flex-wrap:wrap}.letter-buttons{margin-left:30px}.tooth-checkbox{display:flex;align-items:center;cursor:pointer}.tooth-checkbox input{display:none}.tooth-checkbox span{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;background:#f5f5f5;font-size:14px;color:#333;transition:all .2s}.tooth-checkbox input:checked+span{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-checkbox:hover span{border-color:#1890ff}.tooth-position-modal__footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid #e8e8e8}.tooth-position-modal__footer .btn-cancel,.tooth-position-modal__footer .btn-confirm{padding:8px 20px;font-size:14px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.tooth-position-modal__footer .btn-cancel:hover{color:#1890ff;border-color:#1890ff}.tooth-position-modal__footer .btn-confirm{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-position-modal__footer .btn-confirm:hover{background:#40a9ff;border-color:#40a9ff}.tooth-grid-container{display:flex;flex-direction:column;align-items:center;padding:15px 20px;background:#fafafa;border-radius:8px;margin-bottom:15px;position:relative}.tooth-quick-buttons{display:flex;gap:6px;margin-bottom:16px}.tooth-quick-buttons-left{display:flex;flex-direction:column;gap:6px;flex:1}.tooth-quick-buttons-row{display:flex;gap:6px}.tooth-quick-btn{padding:6px 12px;font-size:12px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;background:#fff;color:#333;transition:all .2s;white-space:nowrap}.tooth-quick-btn:hover{border-color:#1890ff;color:#1890ff}.tooth-quick-btn.selected{background:#0ff;border-color:#0ff;color:#fff}.tooth-quick-btn--clear{background:#ff6b6b;border-color:#ff6b6b;color:#fff}.tooth-quick-btn--clear:hover{background:#ff5252;border-color:#ff5252;color:#fff}.tooth-grid-container:before{content:"";position:absolute;left:50%;top:20px;bottom:20px;width:2px;background:#000;transform:translate(-50%);z-index:1}.tooth-grid-container:after{content:"";position:absolute;left:20px;right:20px;top:50%;height:2px;background:#000;transform:translateY(-50%);z-index:1}.tooth-grid-letter-row,.tooth-grid-number-row{display:flex;align-items:center;justify-content:center;position:relative;z-index:2}.tooth-grid-half{display:flex;align-items:center;justify-content:center;gap:4px}.tooth-grid-half.left{justify-content:flex-end;padding-right:15px}.tooth-grid-half.right{justify-content:flex-start;padding-left:15px}.tooth-grid-divider-v,.tooth-grid-divider-h{display:none}.tooth-grid-number-item{width:34px;height:32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#333;cursor:pointer;background:#fff;transition:all .2s;box-sizing:border-box;border:1px solid #d9d9d9;border-radius:12px}.upper-number-row .tooth-grid-number-item{border-top:none;border-radius:0 0 12px 12px}.lower-number-row .tooth-grid-number-item{border-bottom:none;border-radius:12px 12px 0 0}.tooth-grid-number-item[data-value="1"],.tooth-grid-number-item[data-value="2"],.tooth-grid-number-item[data-value="3"]{border-radius:50px}.upper-number-row .tooth-grid-number-item[data-value="1"],.upper-number-row .tooth-grid-number-item[data-value="2"],.upper-number-row .tooth-grid-number-item[data-value="3"]{border-top:none!important;border-radius:0 0 50px 50px!important}.lower-number-row .tooth-grid-number-item[data-value="1"],.lower-number-row .tooth-grid-number-item[data-value="2"],.lower-number-row .tooth-grid-number-item[data-value="3"]{border-bottom:none!important;border-radius:50px 50px 0 0!important}.tooth-grid-number-item:hover{border-color:#1890ff;color:#1890ff}.tooth-grid-number-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-grid-letter-item{width:34px;height:32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px solid #d9d9d9;transition:all .2s;box-sizing:border-box;border-radius:12px}.upper-letter-row .tooth-grid-letter-item{border-top:none;border-radius:0 0 12px 12px}.lower-letter-row .tooth-grid-letter-item{border-bottom:none;border-radius:12px 12px 0 0}.tooth-grid-letter-item[data-value=A],.tooth-grid-letter-item[data-value=B],.tooth-grid-letter-item[data-value=C]{border-radius:50px}.upper-letter-row .tooth-grid-letter-item[data-value=A],.upper-letter-row .tooth-grid-letter-item[data-value=B],.upper-letter-row .tooth-grid-letter-item[data-value=C]{border-top:none!important;border-radius:0 0 50px 50px!important}.lower-letter-row .tooth-grid-letter-item[data-value=A],.lower-letter-row .tooth-grid-letter-item[data-value=B],.lower-letter-row .tooth-grid-letter-item[data-value=C]{border-bottom:none!important;border-radius:50px 50px 0 0!important}.tooth-grid-letter-item:hover{border-color:#1890ff;color:#1890ff}.tooth-grid-letter-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-grid-letter-row.hidden,.tooth-grid-number-row.hidden{display:none}.tooth-grid-letter-row{margin-bottom:8px}.tooth-grid-number-row.upper-number-row{margin-bottom:15px}.tooth-grid-number-row.lower-number-row{margin-top:15px}.tooth-grid-letter-row.lower-letter-row{margin-top:8px}.tooth-preview-section{padding-top:10px;border-top:1px solid #e8e8e8}.tooth-preview-title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.tooth-preview-wrapper{display:flex;gap:15px}.tooth-preview-container{display:flex;justify-content:center;align-items:center;padding:10px;background:#fafafa;border-radius:8px;flex:1;min-height:60px}.tooth-preview-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:0;width:100%;min-height:70px;position:relative}.tooth-preview-grid:before{content:"";position:absolute;left:50%;top:0;bottom:0;width:1px;background:#000;transform:translate(-50%)}.tooth-preview-grid:after{content:"";position:absolute;top:50%;left:0;right:0;height:1px;background:#000;transform:translateY(-50%)}.tooth-preview-quadrant{display:flex;align-items:center;padding:5px 10px;font-size:12px;flex-wrap:wrap;gap:4px;justify-content:center}.tooth-preview-upper-left{justify-content:flex-end}.tooth-preview-upper-right{justify-content:flex-start}.tooth-preview-lower-left{justify-content:flex-end}.tooth-preview-lower-right{justify-content:flex-start}.tooth-preview-tooth{position:relative;display:inline;margin:0 4px}.tooth-preview-tooth-value{font-size:12px}.tooth-preview-tooth-value--deciduous{font-size:10px}.tooth-preview-tooth-bracket{font-size:12px}.tooth-preview-supernumerary{font-size:9px;vertical-align:super;margin:0 1px}.tooth-preview-surface{font-size:9px;vertical-align:super;margin-left:1px}.tooth-extra-panel{width:100px;display:flex;flex-direction:column;gap:10px}.tooth-surface-panel{background:#fafafa;border-radius:8px;padding:10px 20px}.tooth-surface-title{font-size:12px;font-weight:500;color:#333;margin-bottom:8px;text-align:center}.tooth-surface-grid{display:flex;flex-direction:column;gap:4px;align-items:center}.tooth-surface-row{display:flex;gap:4px;justify-content:center}.tooth-surface-item{width:30px;height:30px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px dashed #d9d9d9;border-radius:5px;transition:all .2s;box-sizing:border-box}.tooth-surface-item--indent{margin-left:17px}.tooth-surface-item:hover{border-color:#1890ff;color:#1890ff}.tooth-surface-item.selected{background:#1890ff;border-color:#1890ff;border-style:solid;color:#fff}.tooth-supernumerary-panel{background:#fafafa;border-radius:8px;padding:10px 20px}.tooth-supernumerary-title{font-size:12px;font-weight:500;color:#333;margin-bottom:4px;text-align:center}.tooth-supernumerary-hint{font-size:10px;color:#999;font-weight:400}.tooth-supernumerary-grid{display:flex;gap:8px;justify-content:center;margin-top:8px}.tooth-supernumerary-item{width:30px;height:35px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px solid #d9d9d9;border-bottom:none;border-radius:50px;transition:all .2s;box-sizing:border-box}.tooth-supernumerary-item:hover{border-color:#1890ff;color:#1890ff}.tooth-supernumerary-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.dialog-mask{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000;z-index:99}.dialog-container{position:fixed;inset:0;overflow:auto;z-index:999;margin:0;display:flex;justify-content:center;align-items:center}.dialog{position:absolute;padding:0 30px 30px;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.dialog-title{position:relative;border-bottom:1px solid #e2e6ed;margin-bottom:30px;height:60px;display:flex;align-items:center;justify-content:space-between}.dialog-title i{width:16px;height:16px;cursor:pointer;display:inline-block;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.9%208.192l4.242%204.243-.707.707L8.192%208.9%203.95%2013.142l-.707-.707%204.242-4.243L3.243%203.95l.707-.707%204.242%204.242%204.243-4.242.707.707L8.9%208.192z'%20fill='%236A6A6A'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.dialog-option__item{margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}.dialog-option__item span{margin-right:12px;font-size:14px;color:#3d4757;position:relative}.dialog-option__item input,.dialog-option__item textarea,.dialog-option__item select{width:276px;height:30px;border-radius:2px;border:1px solid #d3d3d3;min-height:30px;padding:5px;box-sizing:border-box;outline:none;appearance:none;-webkit-user-select:none;user-select:none;font-family:inherit}.dialog-option__item input:focus,.dialog-option__item textarea:focus{border-color:#4991f2}.dialog-option__item--require:before{content:"*";color:#f56c6c;margin-right:4px;position:absolute;left:-8px}.dialog-menu{display:flex;align-items:center;justify-content:flex-end}.dialog-menu button{position:relative;display:inline-block;border:1px solid #e2e6ed;border-radius:2px;background:#fff;line-height:22px;padding:0 16px;white-space:nowrap;cursor:pointer}.dialog-menu button:hover{background:#1937580a}.dialog-menu__cancel{margin-right:16px}.dialog-menu button[type=submit]{color:#fff;background:#4991f2;border-color:#4991f2}.dialog-menu button[type=submit]:hover{background:#5b9cf3;border-color:#5b9cf3}.dialog-radio-group{display:flex;flex-direction:column;gap:8px}.dialog-radio-group--horizontal{flex-direction:row;gap:16px}.dialog-radio-item{display:flex;align-items:center;cursor:pointer;font-size:14px;color:#3d4757}.dialog-radio-item input[type=radio]{width:16px;height:16px;margin:0 6px 0 0;cursor:pointer;appearance:auto}.dialog-radio-item span{margin:0}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
const Ei = "0.6.
|
|
2
|
+
const Ei = "0.6.4";
|
|
3
3
|
var un;
|
|
4
4
|
(function(o) {
|
|
5
5
|
o.HALF = "half", o.ONE_THIRD = "one-third", o.QUARTER = "quarter";
|
|
@@ -53,10 +53,10 @@ const A = "", rs = `
|
|
|
53
53
|
SWEDISH: "A-Za-zÅåÄäÖö",
|
|
54
54
|
GREEK: "ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"
|
|
55
55
|
}, Rl = "中";
|
|
56
|
-
var
|
|
56
|
+
var Nt;
|
|
57
57
|
(function(o) {
|
|
58
58
|
o.LEFT = "left", o.CENTER = "center", o.RIGHT = "right", o.ALIGNMENT = "alignment", o.JUSTIFY = "justify";
|
|
59
|
-
})(
|
|
59
|
+
})(Nt || (Nt = {}));
|
|
60
60
|
const Ao = /[0-9.]/, ul = /[\uD800-\uDBFF][\uDC00-\uDFFF]/, hl = /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g, gl = new RegExp(`${hl.source}|${ul.source}`, "g"), fl = /[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/, Fi = new RegExp(`^[${A}
|
|
61
61
|
]`), pl = /[^0-9\+\-\.eE,]/, Tl = /\s/;
|
|
62
62
|
function ml(o, t) {
|
|
@@ -3492,7 +3492,7 @@ const na = {
|
|
|
3492
3492
|
size: 12,
|
|
3493
3493
|
font: "Microsoft YaHei",
|
|
3494
3494
|
color: "#000000",
|
|
3495
|
-
rowFlex:
|
|
3495
|
+
rowFlex: Nt.CENTER,
|
|
3496
3496
|
format: Gn.PAGE_NO,
|
|
3497
3497
|
numberType: _n.ARABIC,
|
|
3498
3498
|
disabled: !1,
|
|
@@ -4068,13 +4068,13 @@ function Kt(o, t) {
|
|
|
4068
4068
|
}), s++;
|
|
4069
4069
|
const q = ft(B.value || "");
|
|
4070
4070
|
for (let j = 0; j < q.length; j++) {
|
|
4071
|
-
const
|
|
4071
|
+
const St = q[j], Yt = j === q.length - 1;
|
|
4072
4072
|
o.splice(s, 0, {
|
|
4073
4073
|
...it,
|
|
4074
4074
|
...Y,
|
|
4075
4075
|
originControlId: S,
|
|
4076
|
-
value:
|
|
4077
|
-
` ? A :
|
|
4076
|
+
value: St === `
|
|
4077
|
+
` ? A : St,
|
|
4078
4078
|
letterSpacing: Yt ? L.gap : 0,
|
|
4079
4079
|
controlComponent: f.VALUE
|
|
4080
4080
|
}), s++;
|
|
@@ -4096,14 +4096,14 @@ function Kt(o, t) {
|
|
|
4096
4096
|
}), s++;
|
|
4097
4097
|
const B = ft(k.value || "");
|
|
4098
4098
|
for (let q = 0; q < B.length; q++) {
|
|
4099
|
-
const j = B[q],
|
|
4099
|
+
const j = B[q], St = q === B.length - 1;
|
|
4100
4100
|
o.splice(s, 0, {
|
|
4101
4101
|
...it,
|
|
4102
4102
|
...Y,
|
|
4103
4103
|
originControlId: S,
|
|
4104
4104
|
value: j === `
|
|
4105
4105
|
` ? A : j,
|
|
4106
|
-
letterSpacing:
|
|
4106
|
+
letterSpacing: St ? O.gap : 0,
|
|
4107
4107
|
controlComponent: f.VALUE
|
|
4108
4108
|
}), s++;
|
|
4109
4109
|
}
|
|
@@ -4112,43 +4112,43 @@ function Kt(o, t) {
|
|
|
4112
4112
|
for (let Z = 0; Z < x.length; Z++) {
|
|
4113
4113
|
const Q = x[Z];
|
|
4114
4114
|
if (Q.type === P.CONTROL && Q.control) {
|
|
4115
|
-
const z = Q, k = z.controlId || Rt(), B = z.control?.value || [], q = z.control?.type === U.TEXTFIELD, j = z.control?.type === U.TEXT,
|
|
4115
|
+
const z = Q, k = z.controlId || Rt(), B = z.control?.value || [], q = z.control?.type === U.TEXTFIELD, j = z.control?.type === U.TEXT, St = {
|
|
4116
4116
|
...it,
|
|
4117
4117
|
controlId: k,
|
|
4118
4118
|
control: z.control
|
|
4119
|
-
}, Yt = q ? i.control.textFixColor : j ? "#87d068" : i.control.bracketColor,
|
|
4119
|
+
}, Yt = q ? i.control.textFixColor : j ? "#87d068" : i.control.bracketColor, Xt = q ? z.control?.preTextFix || I.preTextFix : z.control?.prefix || I.prefix, Ut = ft(Xt);
|
|
4120
4120
|
for (let Pt = 0; Pt < Ut.length; Pt++)
|
|
4121
4121
|
o.splice(s, 0, {
|
|
4122
|
-
...
|
|
4122
|
+
...St,
|
|
4123
4123
|
color: Yt,
|
|
4124
4124
|
originControlId: b,
|
|
4125
4125
|
value: Ut[Pt],
|
|
4126
4126
|
controlComponent: q ? f.PRETEXTFIX : f.PREFIX
|
|
4127
4127
|
}), s++;
|
|
4128
4128
|
for (let Pt = 0; Pt < B.length; Pt++) {
|
|
4129
|
-
const
|
|
4130
|
-
if (
|
|
4131
|
-
const At =
|
|
4132
|
-
|
|
4133
|
-
const ye = z.control?.value?.find((ae) => ae.id === At || ae.type ===
|
|
4129
|
+
const Et = B[Pt];
|
|
4130
|
+
if (Et.type === P.MENSTRUAL_HISTORY || Et.type === P.FETAL_HEART_POSITION || Et.type === P.TOOTH_POSITION || Et.type === P.MACRO || Et.type === P.CUSTOM_MACRO || Et.type === P.REUSABLE_ITEM || Et.type === P.LIST || Et.type === P.SPECIAL_SYMBOLS) {
|
|
4131
|
+
const At = Et.id || Rt();
|
|
4132
|
+
Et.id || (Et.id = At);
|
|
4133
|
+
const ye = z.control?.value?.find((ae) => ae.id === At || ae.type === Et.type && ae.value === Et.value);
|
|
4134
4134
|
ye && so(At, ye), o.splice(s, 0, {
|
|
4135
|
-
...
|
|
4136
|
-
...
|
|
4135
|
+
...St,
|
|
4136
|
+
...Et,
|
|
4137
4137
|
id: At,
|
|
4138
4138
|
originControlId: b,
|
|
4139
4139
|
controlComponent: f.VALUE,
|
|
4140
4140
|
// 确保 type 属性不被覆盖,特殊元素必须保留其原始类型
|
|
4141
4141
|
// Ensure type property is not overwritten, special elements must retain their original type
|
|
4142
|
-
type:
|
|
4142
|
+
type: Et.type
|
|
4143
4143
|
});
|
|
4144
4144
|
} else
|
|
4145
4145
|
o.splice(s, 0, {
|
|
4146
|
-
...
|
|
4146
|
+
...St,
|
|
4147
4147
|
...Y,
|
|
4148
|
-
...
|
|
4148
|
+
...Et,
|
|
4149
4149
|
originControlId: b,
|
|
4150
|
-
value:
|
|
4151
|
-
` ? A :
|
|
4150
|
+
value: Et.value === `
|
|
4151
|
+
` ? A : Et.value,
|
|
4152
4152
|
controlComponent: f.VALUE
|
|
4153
4153
|
});
|
|
4154
4154
|
s++;
|
|
@@ -4156,13 +4156,13 @@ function Kt(o, t) {
|
|
|
4156
4156
|
if (B.length === 0) {
|
|
4157
4157
|
const Pt = z.control?.placeholder || "";
|
|
4158
4158
|
if (Pt) {
|
|
4159
|
-
const
|
|
4160
|
-
for (let Jt = 0; Jt <
|
|
4159
|
+
const Et = ft(Pt);
|
|
4160
|
+
for (let Jt = 0; Jt < Et.length; Jt++)
|
|
4161
4161
|
o.splice(s, 0, {
|
|
4162
|
-
...
|
|
4162
|
+
...St,
|
|
4163
4163
|
color: i.control.placeholderColor,
|
|
4164
4164
|
originControlId: b,
|
|
4165
|
-
value:
|
|
4165
|
+
value: Et[Jt],
|
|
4166
4166
|
controlComponent: f.PLACEHOLDER
|
|
4167
4167
|
}), s++;
|
|
4168
4168
|
}
|
|
@@ -4170,7 +4170,7 @@ function Kt(o, t) {
|
|
|
4170
4170
|
const Qt = q ? z.control?.postTextFix || I.postTextFix : z.control?.postfix || I.postfix, xt = ft(Qt);
|
|
4171
4171
|
for (let Pt = 0; Pt < xt.length; Pt++)
|
|
4172
4172
|
o.splice(s, 0, {
|
|
4173
|
-
...
|
|
4173
|
+
...St,
|
|
4174
4174
|
color: Yt,
|
|
4175
4175
|
originControlId: b,
|
|
4176
4176
|
value: xt[Pt],
|
|
@@ -4225,14 +4225,14 @@ function Kt(o, t) {
|
|
|
4225
4225
|
controlComponent: f.PLACEHOLDER
|
|
4226
4226
|
}), s++;
|
|
4227
4227
|
}
|
|
4228
|
-
const
|
|
4229
|
-
for (let Z = 0; Z <
|
|
4228
|
+
const H = v ? M.control?.postTextFix || I.postTextFix : M.control?.postfix || I.postfix, K = ft(H);
|
|
4229
|
+
for (let Z = 0; Z < K.length; Z++)
|
|
4230
4230
|
o.splice(s, 0, {
|
|
4231
4231
|
...it,
|
|
4232
4232
|
color: pt,
|
|
4233
4233
|
highlight: ot,
|
|
4234
4234
|
originControlId: S,
|
|
4235
|
-
value:
|
|
4235
|
+
value: K[Z],
|
|
4236
4236
|
controlComponent: st
|
|
4237
4237
|
}), s++;
|
|
4238
4238
|
} else if (
|
|
@@ -4485,17 +4485,17 @@ function Kt(o, t) {
|
|
|
4485
4485
|
type: P.CONTROL,
|
|
4486
4486
|
control: X.control
|
|
4487
4487
|
}, it = w ? i.control.textFixColor : v ? "#87d068" : et ? "transparent" : i.control.bracketColor, pt = et ? "#1677FF" : void 0, ot = w ? X.control?.preTextFix || T.preTextFix : X.control?.prefix || T.prefix, Lt = ft(ot);
|
|
4488
|
-
for (let
|
|
4488
|
+
for (let K = 0; K < Lt.length; K++)
|
|
4489
4489
|
o.splice(s, 0, {
|
|
4490
4490
|
...st,
|
|
4491
4491
|
color: it,
|
|
4492
4492
|
highlight: pt,
|
|
4493
4493
|
originControlId: O,
|
|
4494
|
-
value: Lt[
|
|
4494
|
+
value: Lt[K],
|
|
4495
4495
|
controlComponent: ct
|
|
4496
4496
|
}), s++;
|
|
4497
4497
|
if (et) {
|
|
4498
|
-
const
|
|
4498
|
+
const K = X.control.buttonLabel || X.control.label || "按钮", Z = ft(K);
|
|
4499
4499
|
for (let Q = 0; Q < Z.length; Q++) {
|
|
4500
4500
|
const z = Z[Q];
|
|
4501
4501
|
o.splice(s, 0, {
|
|
@@ -4509,9 +4509,9 @@ function Kt(o, t) {
|
|
|
4509
4509
|
}), s++;
|
|
4510
4510
|
}
|
|
4511
4511
|
} else if (J) {
|
|
4512
|
-
const
|
|
4513
|
-
for (let z = 0; z <
|
|
4514
|
-
const k =
|
|
4512
|
+
const K = X.control?.valueSets || [], Z = X.control?.code || "", Q = Z ? Z.split(",") : [];
|
|
4513
|
+
for (let z = 0; z < K.length; z++) {
|
|
4514
|
+
const k = K[z];
|
|
4515
4515
|
o.splice(s, 0, {
|
|
4516
4516
|
...st,
|
|
4517
4517
|
...E,
|
|
@@ -4525,22 +4525,22 @@ function Kt(o, t) {
|
|
|
4525
4525
|
}), s++;
|
|
4526
4526
|
const B = ft(k.value || "");
|
|
4527
4527
|
for (let q = 0; q < B.length; q++) {
|
|
4528
|
-
const j = B[q],
|
|
4528
|
+
const j = B[q], St = q === B.length - 1;
|
|
4529
4529
|
o.splice(s, 0, {
|
|
4530
4530
|
...st,
|
|
4531
4531
|
...C,
|
|
4532
4532
|
originControlId: O,
|
|
4533
4533
|
value: j === `
|
|
4534
4534
|
` ? A : j,
|
|
4535
|
-
letterSpacing:
|
|
4535
|
+
letterSpacing: St ? I.gap : 0,
|
|
4536
4536
|
controlComponent: f.VALUE
|
|
4537
4537
|
}), s++;
|
|
4538
4538
|
}
|
|
4539
4539
|
}
|
|
4540
4540
|
} else if (G) {
|
|
4541
|
-
const
|
|
4542
|
-
for (let Q = 0; Q <
|
|
4543
|
-
const z =
|
|
4541
|
+
const K = X.control?.valueSets || [], Z = X.control?.code || "";
|
|
4542
|
+
for (let Q = 0; Q < K.length; Q++) {
|
|
4543
|
+
const z = K[Q];
|
|
4544
4544
|
o.splice(s, 0, {
|
|
4545
4545
|
...st,
|
|
4546
4546
|
...E,
|
|
@@ -4567,20 +4567,20 @@ function Kt(o, t) {
|
|
|
4567
4567
|
}
|
|
4568
4568
|
}
|
|
4569
4569
|
} else if (b.length > 0)
|
|
4570
|
-
for (let
|
|
4571
|
-
const Z = b[
|
|
4570
|
+
for (let K = 0; K < b.length; K++) {
|
|
4571
|
+
const Z = b[K];
|
|
4572
4572
|
if (Z.type === P.CONTROL && Z.control) {
|
|
4573
4573
|
const Q = Z, z = Q.controlId || Rt(), k = Q.control?.value || [], B = Q.control?.type === U.TEXTFIELD, q = Q.control?.type === U.TEXT, j = {
|
|
4574
4574
|
...st,
|
|
4575
4575
|
controlId: z,
|
|
4576
4576
|
control: Q.control
|
|
4577
|
-
},
|
|
4578
|
-
for (let xt = 0; xt <
|
|
4577
|
+
}, St = B ? i.control.textFixColor : q ? "#87d068" : i.control.bracketColor, Yt = B ? Q.control?.preTextFix || T.preTextFix : Q.control?.prefix || T.prefix, Xt = ft(Yt);
|
|
4578
|
+
for (let xt = 0; xt < Xt.length; xt++)
|
|
4579
4579
|
o.splice(s, 0, {
|
|
4580
4580
|
...j,
|
|
4581
|
-
color:
|
|
4581
|
+
color: St,
|
|
4582
4582
|
originControlId: M,
|
|
4583
|
-
value:
|
|
4583
|
+
value: Xt[xt],
|
|
4584
4584
|
controlComponent: B ? f.PRETEXTFIX : f.PREFIX
|
|
4585
4585
|
}), s++;
|
|
4586
4586
|
for (let xt = 0; xt < k.length; xt++) {
|
|
@@ -4599,12 +4599,12 @@ function Kt(o, t) {
|
|
|
4599
4599
|
const xt = Q.control?.placeholder || "";
|
|
4600
4600
|
if (xt) {
|
|
4601
4601
|
const Pt = ft(xt);
|
|
4602
|
-
for (let
|
|
4602
|
+
for (let Et = 0; Et < Pt.length; Et++)
|
|
4603
4603
|
o.splice(s, 0, {
|
|
4604
4604
|
...j,
|
|
4605
4605
|
color: i.control.placeholderColor,
|
|
4606
4606
|
originControlId: M,
|
|
4607
|
-
value: Pt[
|
|
4607
|
+
value: Pt[Et],
|
|
4608
4608
|
controlComponent: f.PLACEHOLDER
|
|
4609
4609
|
}), s++;
|
|
4610
4610
|
}
|
|
@@ -4613,7 +4613,7 @@ function Kt(o, t) {
|
|
|
4613
4613
|
for (let xt = 0; xt < Qt.length; xt++)
|
|
4614
4614
|
o.splice(s, 0, {
|
|
4615
4615
|
...j,
|
|
4616
|
-
color:
|
|
4616
|
+
color: St,
|
|
4617
4617
|
originControlId: M,
|
|
4618
4618
|
value: Qt[xt],
|
|
4619
4619
|
controlComponent: B ? f.POSTTEXTFIX : f.POSTFIX
|
|
@@ -4630,13 +4630,13 @@ function Kt(o, t) {
|
|
|
4630
4630
|
}), s++;
|
|
4631
4631
|
}
|
|
4632
4632
|
else if (x) {
|
|
4633
|
-
const
|
|
4634
|
-
for (let Z = 0; Z <
|
|
4633
|
+
const K = ft(x);
|
|
4634
|
+
for (let Z = 0; Z < K.length; Z++)
|
|
4635
4635
|
o.splice(s, 0, {
|
|
4636
4636
|
...st,
|
|
4637
4637
|
color: i.control.placeholderColor,
|
|
4638
4638
|
originControlId: O,
|
|
4639
|
-
value:
|
|
4639
|
+
value: K[Z],
|
|
4640
4640
|
controlComponent: f.PLACEHOLDER
|
|
4641
4641
|
}), s++;
|
|
4642
4642
|
} else if ((y === U.SELECT || y === U.DATE || y === U.NUMBER) && !X.control?.code && x) {
|
|
@@ -4650,14 +4650,14 @@ function Kt(o, t) {
|
|
|
4650
4650
|
controlComponent: f.PLACEHOLDER
|
|
4651
4651
|
}), s++;
|
|
4652
4652
|
}
|
|
4653
|
-
const Tt = w ? X.control?.postTextFix || T.postTextFix : X.control?.postfix || T.postfix,
|
|
4654
|
-
for (let
|
|
4653
|
+
const Tt = w ? X.control?.postTextFix || T.postTextFix : X.control?.postfix || T.postfix, H = ft(Tt);
|
|
4654
|
+
for (let K = 0; K < H.length; K++)
|
|
4655
4655
|
o.splice(s, 0, {
|
|
4656
4656
|
...st,
|
|
4657
4657
|
color: it,
|
|
4658
4658
|
highlight: pt,
|
|
4659
4659
|
originControlId: O,
|
|
4660
|
-
value: K
|
|
4660
|
+
value: H[K],
|
|
4661
4661
|
controlComponent: lt
|
|
4662
4662
|
}), s++;
|
|
4663
4663
|
} else if (
|
|
@@ -5168,33 +5168,33 @@ function er(o) {
|
|
|
5168
5168
|
switch (window.getComputedStyle(o).textAlign) {
|
|
5169
5169
|
case "left":
|
|
5170
5170
|
case "start":
|
|
5171
|
-
return
|
|
5171
|
+
return Nt.LEFT;
|
|
5172
5172
|
case "center":
|
|
5173
|
-
return
|
|
5173
|
+
return Nt.CENTER;
|
|
5174
5174
|
case "right":
|
|
5175
5175
|
case "end":
|
|
5176
|
-
return
|
|
5176
|
+
return Nt.RIGHT;
|
|
5177
5177
|
case "justify":
|
|
5178
|
-
return
|
|
5178
|
+
return Nt.ALIGNMENT;
|
|
5179
5179
|
case "justify-all":
|
|
5180
|
-
return
|
|
5180
|
+
return Nt.JUSTIFY;
|
|
5181
5181
|
default:
|
|
5182
|
-
return
|
|
5182
|
+
return Nt.LEFT;
|
|
5183
5183
|
}
|
|
5184
5184
|
}
|
|
5185
5185
|
function nr(o) {
|
|
5186
|
-
return o ===
|
|
5186
|
+
return o === Nt.ALIGNMENT ? "justify" : o;
|
|
5187
5187
|
}
|
|
5188
5188
|
function Ma(o) {
|
|
5189
5189
|
switch (o) {
|
|
5190
|
-
case
|
|
5190
|
+
case Nt.LEFT:
|
|
5191
5191
|
return "flex-start";
|
|
5192
|
-
case
|
|
5192
|
+
case Nt.CENTER:
|
|
5193
5193
|
return "center";
|
|
5194
|
-
case
|
|
5194
|
+
case Nt.RIGHT:
|
|
5195
5195
|
return "flex-end";
|
|
5196
|
-
case
|
|
5197
|
-
case
|
|
5196
|
+
case Nt.ALIGNMENT:
|
|
5197
|
+
case Nt.JUSTIFY:
|
|
5198
5198
|
return "space-between";
|
|
5199
5199
|
default:
|
|
5200
5200
|
return "flex-start";
|
|
@@ -5392,7 +5392,7 @@ function Qn(o, t) {
|
|
|
5392
5392
|
}
|
|
5393
5393
|
const i = document.createElement("div"), r = Ea(o);
|
|
5394
5394
|
for (let s = 0; s < r.length; s++) {
|
|
5395
|
-
const l = r[s], a = !l.rowFlex || l.rowFlex ===
|
|
5395
|
+
const l = r[s], a = !l.rowFlex || l.rowFlex === Nt.LEFT, c = document.createElement("div");
|
|
5396
5396
|
if (!a) {
|
|
5397
5397
|
const d = l.data[0];
|
|
5398
5398
|
Fn(d) ? (c.style.display = "flex", c.style.justifyContent = Ma(d.rowFlex)) : (c.style.textAlign = nr(l.rowFlex), l.rowFlex === "justify" && (c.style.textAlignLast = "justify"));
|
|
@@ -5416,7 +5416,7 @@ function Na(o) {
|
|
|
5416
5416
|
italic: r.fontStyle.includes("italic"),
|
|
5417
5417
|
size: Math.floor(parseFloat(r.fontSize))
|
|
5418
5418
|
};
|
|
5419
|
-
return e.nodeName === "SUB" || r.verticalAlign === "sub" ? s.type = P.SUBSCRIPT : (e.nodeName === "SUP" || r.verticalAlign === "super") && (s.type = P.SUPERSCRIPT), n !==
|
|
5419
|
+
return e.nodeName === "SUB" || r.verticalAlign === "sub" ? s.type = P.SUBSCRIPT : (e.nodeName === "SUP" || r.verticalAlign === "super") && (s.type = P.SUPERSCRIPT), n !== Nt.LEFT && (s.rowFlex = n), r.backgroundColor !== "rgba(0, 0, 0, 0)" && (s.highlight = r.backgroundColor), r.textDecorationLine.includes("underline") && (s.underline = !0), r.textDecorationLine.includes("line-through") && (s.strikeout = !0), s;
|
|
5420
5420
|
}
|
|
5421
5421
|
function vn(o, t) {
|
|
5422
5422
|
const e = [];
|
|
@@ -5884,11 +5884,21 @@ async function Ua(o, t) {
|
|
|
5884
5884
|
}
|
|
5885
5885
|
}
|
|
5886
5886
|
class ya {
|
|
5887
|
+
/** Draw实例,用于获取渲染上下文和状态 */
|
|
5887
5888
|
draw;
|
|
5889
|
+
/** 编辑器容器元素 */
|
|
5888
5890
|
container;
|
|
5891
|
+
/** 代理输入框DOM元素 */
|
|
5889
5892
|
agentCursorDom;
|
|
5893
|
+
/** Canvas事件处理器 */
|
|
5890
5894
|
canvasEvent;
|
|
5895
|
+
/** 事件总线,用于发布/订阅事件 */
|
|
5891
5896
|
eventBus;
|
|
5897
|
+
/**
|
|
5898
|
+
* 创建光标代理实例
|
|
5899
|
+
* @param draw - Draw实例,用于获取渲染上下文
|
|
5900
|
+
* @param canvasEvent - CanvasEvent实例,用于处理事件
|
|
5901
|
+
*/
|
|
5892
5902
|
constructor(t, e) {
|
|
5893
5903
|
this.draw = t, this.container = t.getContainer(), this.canvasEvent = e, this.eventBus = t.getEventBus();
|
|
5894
5904
|
const n = document.createElement("textarea");
|
|
@@ -5896,24 +5906,67 @@ class ya {
|
|
|
5896
5906
|
this.agentCursorDom.style.fontSize = Math.max(i.size, 18) + "px";
|
|
5897
5907
|
});
|
|
5898
5908
|
}
|
|
5909
|
+
/**
|
|
5910
|
+
* 获取代理输入框DOM元素
|
|
5911
|
+
* @returns 代理输入框的textarea元素
|
|
5912
|
+
*/
|
|
5899
5913
|
getAgentCursorDom() {
|
|
5900
5914
|
return this.agentCursorDom;
|
|
5901
5915
|
}
|
|
5916
|
+
/**
|
|
5917
|
+
* 处理键盘按下事件
|
|
5918
|
+
* @param evt - 键盘事件对象
|
|
5919
|
+
* @private
|
|
5920
|
+
*/
|
|
5902
5921
|
_keyDown(t) {
|
|
5903
5922
|
this.draw.isInteractionSuspended() || this.canvasEvent.keydown(t);
|
|
5904
5923
|
}
|
|
5924
|
+
/**
|
|
5925
|
+
* 处理输入事件
|
|
5926
|
+
*
|
|
5927
|
+
* 当用户输入文本时触发,将输入数据传递给CanvasEvent处理。
|
|
5928
|
+
* 同时发布input事件到事件总线。
|
|
5929
|
+
*
|
|
5930
|
+
* @param evt - 输入事件对象
|
|
5931
|
+
* @private
|
|
5932
|
+
*/
|
|
5905
5933
|
_input(t) {
|
|
5906
5934
|
if (this.draw.isInteractionSuspended())
|
|
5907
5935
|
return;
|
|
5908
5936
|
const e = t.data;
|
|
5909
5937
|
e && this.canvasEvent.input(e), this.eventBus.isSubscribe("input") && this.eventBus.emit("input", t);
|
|
5910
5938
|
}
|
|
5939
|
+
/**
|
|
5940
|
+
* 处理粘贴事件
|
|
5941
|
+
*
|
|
5942
|
+
* 当用户粘贴内容时触发,将粘贴操作委托给pasteByEvent处理函数。
|
|
5943
|
+
* 在只读模式下忽略粘贴操作。
|
|
5944
|
+
*
|
|
5945
|
+
* @param evt - 剪贴板事件对象
|
|
5946
|
+
* @private
|
|
5947
|
+
*/
|
|
5911
5948
|
_paste(t) {
|
|
5912
5949
|
this.draw.isInteractionSuspended() || this.draw.isReadonly() || !t.clipboardData || (Da(this.canvasEvent, t), t.preventDefault());
|
|
5913
5950
|
}
|
|
5951
|
+
/**
|
|
5952
|
+
* 处理输入法组合开始事件
|
|
5953
|
+
*
|
|
5954
|
+
* 当用户开始使用输入法(如中文输入法)时触发。
|
|
5955
|
+
* 此时会调整代理输入框的样式以显示输入法候选词。
|
|
5956
|
+
*
|
|
5957
|
+
* @private
|
|
5958
|
+
*/
|
|
5914
5959
|
_compositionstart() {
|
|
5915
5960
|
this.draw.isInteractionSuspended() || (this.agentCursorDom.style.zIndex = "1000", this.agentCursorDom.style.width = "0px", this.agentCursorDom.style.color = "#000", this.agentCursorDom.style.background = "#fff", this.canvasEvent.compositionstart());
|
|
5916
5961
|
}
|
|
5962
|
+
/**
|
|
5963
|
+
* 处理输入法组合更新事件
|
|
5964
|
+
*
|
|
5965
|
+
* 当输入法组合内容发生变化时触发。
|
|
5966
|
+
* 动态调整代理输入框宽度以适应输入内容。
|
|
5967
|
+
*
|
|
5968
|
+
* @private
|
|
5969
|
+
*/
|
|
5917
5970
|
_compositionupdate() {
|
|
5918
5971
|
if (this.draw.isInteractionSuspended())
|
|
5919
5972
|
return;
|
|
@@ -5922,64 +5975,148 @@ class ya {
|
|
|
5922
5975
|
const e = this.container.clientWidth, n = Math.max(e - this.agentCursorDom.offsetLeft, 100);
|
|
5923
5976
|
t > n && (t = n), this.agentCursorDom.style.width = t + "px";
|
|
5924
5977
|
}
|
|
5978
|
+
/**
|
|
5979
|
+
* 处理输入法组合结束事件
|
|
5980
|
+
*
|
|
5981
|
+
* 当输入法组合完成时触发,将最终文本插入到文档中。
|
|
5982
|
+
* 恢复代理输入框的样式。
|
|
5983
|
+
*
|
|
5984
|
+
* @param evt - 组合事件对象
|
|
5985
|
+
* @private
|
|
5986
|
+
*/
|
|
5925
5987
|
_compositionend(t) {
|
|
5926
5988
|
this.draw.isInteractionSuspended() || (this.agentCursorDom.style.zIndex = "-1", this.agentCursorDom.style.width = "0px", this.agentCursorDom.style.color = "", this.agentCursorDom.style.background = "", this.canvasEvent.compositionend(t));
|
|
5927
5989
|
}
|
|
5990
|
+
/**
|
|
5991
|
+
* 处理键盘按下事件(用于取消输入法组合)
|
|
5992
|
+
*
|
|
5993
|
+
* 当用户按下Escape键时,取消当前的输入法组合。
|
|
5994
|
+
*
|
|
5995
|
+
* @param evt - 键盘事件对象
|
|
5996
|
+
* @private
|
|
5997
|
+
*/
|
|
5928
5998
|
_keydown(t) {
|
|
5929
5999
|
this.draw.isInteractionSuspended() || this.canvasEvent.isComposing && t.code === "Escape" && this.canvasEvent.compositionCancel();
|
|
5930
6000
|
}
|
|
5931
6001
|
}
|
|
5932
6002
|
class wa {
|
|
6003
|
+
/** 光标闪烁动画的CSS类名 */
|
|
5933
6004
|
ANIMATION_CLASS = `${tt}-cursor--animation`;
|
|
6005
|
+
/** Draw实例,用于获取渲染上下文和状态 */
|
|
5934
6006
|
draw;
|
|
6007
|
+
/** 编辑器容器元素 */
|
|
5935
6008
|
container;
|
|
6009
|
+
/** 编辑器配置选项 */
|
|
5936
6010
|
options;
|
|
6011
|
+
/** 位置管理器,用于获取光标位置 */
|
|
5937
6012
|
position;
|
|
6013
|
+
/** 光标DOM元素 */
|
|
5938
6014
|
cursorDom;
|
|
6015
|
+
/** 光标代理,用于处理输入事件 */
|
|
5939
6016
|
cursorAgent;
|
|
6017
|
+
/** 闪烁定时器ID */
|
|
5940
6018
|
blinkTimeout;
|
|
6019
|
+
/** 点击行首时的起始索引 */
|
|
5941
6020
|
hitLineStartIndex;
|
|
6021
|
+
/**
|
|
6022
|
+
* 创建光标管理器实例
|
|
6023
|
+
* @param draw - Draw实例,用于获取渲染上下文
|
|
6024
|
+
* @param canvasEvent - CanvasEvent实例,用于处理事件
|
|
6025
|
+
*/
|
|
5942
6026
|
constructor(t, e) {
|
|
5943
6027
|
this.draw = t, this.container = t.getContainer(), this.position = t.getPosition(), this.options = t.getOptions(), this.cursorDom = document.createElement("div"), this.cursorDom.classList.add(`${tt}-cursor`), this.container.append(this.cursorDom), this.cursorAgent = new ya(t, e), this.blinkTimeout = null;
|
|
5944
6028
|
}
|
|
6029
|
+
/**
|
|
6030
|
+
* 获取光标DOM元素
|
|
6031
|
+
* @returns 光标的DOM元素
|
|
6032
|
+
*/
|
|
5945
6033
|
getCursorDom() {
|
|
5946
6034
|
return this.cursorDom;
|
|
5947
6035
|
}
|
|
6036
|
+
/**
|
|
6037
|
+
* 获取代理输入框DOM元素
|
|
6038
|
+
* @returns 代理输入框的textarea元素
|
|
6039
|
+
*/
|
|
5948
6040
|
getAgentDom() {
|
|
5949
6041
|
return this.cursorAgent.getAgentCursorDom();
|
|
5950
6042
|
}
|
|
6043
|
+
/**
|
|
6044
|
+
* 检查代理输入框是否处于激活状态
|
|
6045
|
+
* @returns 如果代理输入框是当前激活元素则返回true
|
|
6046
|
+
*/
|
|
5951
6047
|
getAgentIsActive() {
|
|
5952
6048
|
return this.getAgentDom() === document.activeElement;
|
|
5953
6049
|
}
|
|
6050
|
+
/**
|
|
6051
|
+
* 获取代理输入框的值
|
|
6052
|
+
* @returns 代理输入框中的文本内容
|
|
6053
|
+
*/
|
|
5954
6054
|
getAgentDomValue() {
|
|
5955
6055
|
return this.getAgentDom().value;
|
|
5956
6056
|
}
|
|
6057
|
+
/**
|
|
6058
|
+
* 清空代理输入框的值
|
|
6059
|
+
*/
|
|
5957
6060
|
clearAgentDomValue() {
|
|
5958
6061
|
this.getAgentDom().value = "";
|
|
5959
6062
|
}
|
|
6063
|
+
/**
|
|
6064
|
+
* 获取点击行首时的起始索引
|
|
6065
|
+
* @returns 行首索引,如果未设置则返回undefined
|
|
6066
|
+
*/
|
|
5960
6067
|
getHitLineStartIndex() {
|
|
5961
6068
|
return this.hitLineStartIndex;
|
|
5962
6069
|
}
|
|
6070
|
+
/**
|
|
6071
|
+
* 开始光标闪烁动画
|
|
6072
|
+
* @private
|
|
6073
|
+
*/
|
|
5963
6074
|
_blinkStart() {
|
|
5964
6075
|
this.cursorDom.classList.add(this.ANIMATION_CLASS);
|
|
5965
6076
|
}
|
|
6077
|
+
/**
|
|
6078
|
+
* 停止光标闪烁动画
|
|
6079
|
+
* @private
|
|
6080
|
+
*/
|
|
5966
6081
|
_blinkStop() {
|
|
5967
6082
|
this.cursorDom.classList.remove(this.ANIMATION_CLASS);
|
|
5968
6083
|
}
|
|
6084
|
+
/**
|
|
6085
|
+
* 设置闪烁定时器
|
|
6086
|
+
* @private
|
|
6087
|
+
*/
|
|
5969
6088
|
_setBlinkTimeout() {
|
|
5970
6089
|
this._clearBlinkTimeout(), this.blinkTimeout = window.setTimeout(() => {
|
|
5971
6090
|
this._blinkStart();
|
|
5972
6091
|
}, 500);
|
|
5973
6092
|
}
|
|
6093
|
+
/**
|
|
6094
|
+
* 清除闪烁定时器
|
|
6095
|
+
* @private
|
|
6096
|
+
*/
|
|
5974
6097
|
_clearBlinkTimeout() {
|
|
5975
6098
|
this.blinkTimeout && (this._blinkStop(), window.clearTimeout(this.blinkTimeout), this.blinkTimeout = null);
|
|
5976
6099
|
}
|
|
6100
|
+
/**
|
|
6101
|
+
* 聚焦到代理输入框
|
|
6102
|
+
*
|
|
6103
|
+
* 在移动端只读模式下禁用聚焦以避免唤起输入法,
|
|
6104
|
+
* 在web端允许聚焦以确保键盘事件能够被捕获。
|
|
6105
|
+
*/
|
|
5977
6106
|
focus() {
|
|
5978
6107
|
if (xl && this.draw.isReadonly())
|
|
5979
6108
|
return;
|
|
5980
6109
|
const t = this.cursorAgent.getAgentCursorDom();
|
|
5981
6110
|
document.activeElement !== t && (t.focus(), t.setSelectionRange(0, 0));
|
|
5982
6111
|
}
|
|
6112
|
+
/**
|
|
6113
|
+
* 绘制光标
|
|
6114
|
+
*
|
|
6115
|
+
* 根据当前光标位置绘制光标,支持自定义光标样式和动画。
|
|
6116
|
+
* 光标会自动调整位置和大小以适应当前字体。
|
|
6117
|
+
*
|
|
6118
|
+
* @param payload - 绘制光标的配置选项
|
|
6119
|
+
*/
|
|
5983
6120
|
drawCursor(t) {
|
|
5984
6121
|
let e = this.position.getCursorPosition();
|
|
5985
6122
|
if (!e)
|
|
@@ -6003,9 +6140,22 @@ class wa {
|
|
|
6003
6140
|
});
|
|
6004
6141
|
});
|
|
6005
6142
|
}
|
|
6143
|
+
/**
|
|
6144
|
+
* 隐藏光标
|
|
6145
|
+
*
|
|
6146
|
+
* 将光标从视图中移除并停止闪烁动画
|
|
6147
|
+
*/
|
|
6006
6148
|
recoveryCursor() {
|
|
6007
6149
|
this.cursorDom.style.display = "none", this._clearBlinkTimeout();
|
|
6008
6150
|
}
|
|
6151
|
+
/**
|
|
6152
|
+
* 将光标移动到可视区域
|
|
6153
|
+
*
|
|
6154
|
+
* 当光标位置超出当前可视区域时,自动滚动页面以确保光标可见。
|
|
6155
|
+
* 支持向上和向下两种滚动方向。
|
|
6156
|
+
*
|
|
6157
|
+
* @param payload - 移动配置选项
|
|
6158
|
+
*/
|
|
6009
6159
|
moveCursorToVisible(t) {
|
|
6010
6160
|
const { cursorPosition: e, direction: n } = t;
|
|
6011
6161
|
if (!e || !n)
|
|
@@ -6225,12 +6375,12 @@ function Za(o, t) {
|
|
|
6225
6375
|
let ot;
|
|
6226
6376
|
const Lt = C.originControlId || C.controlId;
|
|
6227
6377
|
for (let Tt = W; Tt >= 0; Tt--) {
|
|
6228
|
-
const
|
|
6229
|
-
if (
|
|
6230
|
-
ot =
|
|
6378
|
+
const H = S[Tt];
|
|
6379
|
+
if (H.controlId === Lt && !H.originControlId && H.control?.type) {
|
|
6380
|
+
ot = H.control.type;
|
|
6231
6381
|
break;
|
|
6232
6382
|
}
|
|
6233
|
-
if (
|
|
6383
|
+
if (H.controlId !== C.controlId && H.controlId !== Lt)
|
|
6234
6384
|
break;
|
|
6235
6385
|
}
|
|
6236
6386
|
if (ot === U.TEXT && M(C))
|
|
@@ -6241,15 +6391,15 @@ function Za(o, t) {
|
|
|
6241
6391
|
if (!(W > 0 && b(S[W - 1]))) {
|
|
6242
6392
|
if (!(C.controlComponent === f.VALUE && X(C))) {
|
|
6243
6393
|
if (Tt === f.PRETEXTFIX || Tt === f.PRETEXTFIX_TEXT || Tt === f.POSTTEXTFIX || Tt === f.POSTTEXTFIX_TEXT || Tt === f.TEXTFIXLABEL || Tt === f.PREFIX || Tt === f.POSTFIX || Tt === f.PRE_TEXT || Tt === f.POST_TEXT || Tt === f.PLACEHOLDER)
|
|
6244
|
-
for (let
|
|
6245
|
-
const
|
|
6246
|
-
if (
|
|
6394
|
+
for (let H = W + 1; H < S.length; H++) {
|
|
6395
|
+
const K = S[H];
|
|
6396
|
+
if (K.controlId !== Lt && K.originControlId !== Lt)
|
|
6247
6397
|
break;
|
|
6248
|
-
if (
|
|
6249
|
-
w =
|
|
6398
|
+
if (K.controlComponent === f.VALUE && !X(K)) {
|
|
6399
|
+
w = H;
|
|
6250
6400
|
break;
|
|
6251
6401
|
}
|
|
6252
|
-
if (
|
|
6402
|
+
if (K.controlComponent === f.POSTTEXTFIX || K.controlComponent === f.POSTFIX) {
|
|
6253
6403
|
for (let Z = W - 1; Z >= 0; Z--) {
|
|
6254
6404
|
const Q = S[Z];
|
|
6255
6405
|
if (Q.controlId !== Lt && Q.originControlId !== Lt)
|
|
@@ -6263,25 +6413,25 @@ function Za(o, t) {
|
|
|
6263
6413
|
}
|
|
6264
6414
|
}
|
|
6265
6415
|
else if (Tt === f.VALUE && W > 0) {
|
|
6266
|
-
const
|
|
6267
|
-
if (
|
|
6268
|
-
let
|
|
6416
|
+
const H = S[W - 1];
|
|
6417
|
+
if (H && (H.controlId === Lt || H.originControlId === Lt) && H.controlComponent === f.VALUE && X(H)) {
|
|
6418
|
+
let K = !1;
|
|
6269
6419
|
for (let Z = W - 2; Z >= 0; Z--) {
|
|
6270
6420
|
const Q = S[Z];
|
|
6271
6421
|
if (Q.controlId !== Lt && Q.originControlId !== Lt || Q.controlComponent !== f.VALUE && !Q.originControlId && Q.controlId === Lt)
|
|
6272
6422
|
break;
|
|
6273
6423
|
if (!X(Q)) {
|
|
6274
|
-
w = Z + 1,
|
|
6424
|
+
w = Z + 1, K = !0;
|
|
6275
6425
|
break;
|
|
6276
6426
|
}
|
|
6277
6427
|
}
|
|
6278
|
-
if (!
|
|
6428
|
+
if (!K)
|
|
6279
6429
|
for (let Z = W; Z < S.length; Z++) {
|
|
6280
6430
|
const Q = S[Z];
|
|
6281
6431
|
if (Q.controlId !== Lt && Q.originControlId !== Lt || (Q.controlComponent === f.POSTTEXTFIX || Q.controlComponent === f.POSTFIX) && !Q.originControlId && Q.controlId === Lt)
|
|
6282
6432
|
break;
|
|
6283
6433
|
if (!X(Q)) {
|
|
6284
|
-
w = Z,
|
|
6434
|
+
w = Z, K = !0;
|
|
6285
6435
|
break;
|
|
6286
6436
|
}
|
|
6287
6437
|
}
|
|
@@ -6306,35 +6456,35 @@ function Za(o, t) {
|
|
|
6306
6456
|
else if (C.controlComponent === f.VALUE && (C.control?.type === U.CHECKBOX || C.control?.type === U.RADIO)) {
|
|
6307
6457
|
let Tt = W;
|
|
6308
6458
|
for (; Tt > 0; ) {
|
|
6309
|
-
const
|
|
6310
|
-
if (
|
|
6311
|
-
fs(
|
|
6459
|
+
const H = S[Tt];
|
|
6460
|
+
if (H.controlComponent === f.CHECKBOX) {
|
|
6461
|
+
fs(H, e);
|
|
6312
6462
|
break;
|
|
6313
|
-
} else if (
|
|
6314
|
-
ps(
|
|
6463
|
+
} else if (H.controlComponent === f.RADIO) {
|
|
6464
|
+
ps(H, e);
|
|
6315
6465
|
break;
|
|
6316
6466
|
}
|
|
6317
6467
|
Tt--;
|
|
6318
6468
|
}
|
|
6319
6469
|
} else {
|
|
6320
|
-
const Tt = C?.control?.type === U.BUTTON && !C.control?.buttonText,
|
|
6321
|
-
let
|
|
6470
|
+
const Tt = C?.control?.type === U.BUTTON && !C.control?.buttonText, H = u && Tt;
|
|
6471
|
+
let K = !1;
|
|
6322
6472
|
if (x && C?.controlId && C?.controlComponent === f.VALUE && !C.originControlId)
|
|
6323
6473
|
for (let k = W; k >= 0; k--) {
|
|
6324
6474
|
const B = S[k];
|
|
6325
6475
|
if (B.controlId !== C.controlId)
|
|
6326
6476
|
break;
|
|
6327
6477
|
if (B.control?.type === U.TEXTFIELD) {
|
|
6328
|
-
|
|
6478
|
+
K = !0;
|
|
6329
6479
|
break;
|
|
6330
6480
|
}
|
|
6331
6481
|
}
|
|
6332
|
-
const Z =
|
|
6482
|
+
const Z = K && X(C), Q = N && !Z ? w + 1 : void 0;
|
|
6333
6483
|
e.render({
|
|
6334
6484
|
curIndex: N && !Z ? Q : w,
|
|
6335
6485
|
isCompute: !1,
|
|
6336
6486
|
isSubmitHistory: !1,
|
|
6337
|
-
isSetCursor: !Y && !D && !F && !(
|
|
6487
|
+
isSetCursor: !Y && !D && !F && !(H && x) && !Z
|
|
6338
6488
|
});
|
|
6339
6489
|
const z = S[w];
|
|
6340
6490
|
if (!n && u && z?.controlId && o.button === Xo.LEFT) {
|
|
@@ -7595,13 +7745,13 @@ function Ti(o, t, e = "input") {
|
|
|
7595
7745
|
if (T?.type === P.SUB_TEMPLATE && I?.type === P.SUB_TEMPLATE)
|
|
7596
7746
|
return;
|
|
7597
7747
|
if (i.getMode() === _.FORM) {
|
|
7598
|
-
const
|
|
7748
|
+
const H = r.getActiveTextControlLimit();
|
|
7599
7749
|
if (!r.getActiveControl() || !r.getIsRangeWithinControl() && !r.getIsRangeInPostfix())
|
|
7600
7750
|
return;
|
|
7601
|
-
if (
|
|
7751
|
+
if (H) {
|
|
7602
7752
|
const k = g.getRange();
|
|
7603
|
-
if (k.startIndex <
|
|
7604
|
-
const B = Math.min(Math.max(k.endIndex,
|
|
7753
|
+
if (k.startIndex < H.startIndex || k.endIndex > H.endIndex) {
|
|
7754
|
+
const B = Math.min(Math.max(k.endIndex, H.startIndex), H.endIndex);
|
|
7605
7755
|
g.setRange(B, B), i.render({
|
|
7606
7756
|
curIndex: B,
|
|
7607
7757
|
isSubmitHistory: !1
|
|
@@ -7640,9 +7790,9 @@ function Ti(o, t, e = "input") {
|
|
|
7640
7790
|
// 使用默认颜色而不是继承控件的颜色
|
|
7641
7791
|
color: s.defaultColor,
|
|
7642
7792
|
highlight: void 0
|
|
7643
|
-
} : b, it = lt || y ? st : v, pt = ft(N).map((
|
|
7644
|
-
const
|
|
7645
|
-
value:
|
|
7793
|
+
} : b, it = lt || y ? st : v, pt = ft(N).map((H) => {
|
|
7794
|
+
const K = {
|
|
7795
|
+
value: H
|
|
7646
7796
|
};
|
|
7647
7797
|
if (J || !it.title?.disabled && !it.control?.disabled) {
|
|
7648
7798
|
const Z = E[M + 1];
|
|
@@ -7650,15 +7800,15 @@ function Ti(o, t, e = "input") {
|
|
|
7650
7800
|
if (Q === "groupIds" && !Z?.groupIds)
|
|
7651
7801
|
return;
|
|
7652
7802
|
const z = it[Q];
|
|
7653
|
-
z !== void 0 && (
|
|
7803
|
+
z !== void 0 && (K[Q] = z);
|
|
7654
7804
|
}), (O || it.type === V) && be.forEach((Q) => {
|
|
7655
7805
|
const z = O?.[Q] || it[Q];
|
|
7656
|
-
z !== void 0 && (
|
|
7657
|
-
}), h && (
|
|
7806
|
+
z !== void 0 && (K[Q] = z);
|
|
7807
|
+
}), h && (K.underline = !0);
|
|
7658
7808
|
}
|
|
7659
7809
|
if (!lt) {
|
|
7660
7810
|
const Z = b.originControlId && (b.controlComponent === f.POSTFIX || b.controlComponent === f.POSTTEXTFIX || b.controlComponent === f.POSTTEXTFIX_TEXT || b.controlComponent === f.POST_TEXT), Q = !b.originControlId && b.controlId && (b.controlComponent === f.POSTFIX || b.controlComponent === f.POSTTEXTFIX || b.controlComponent === f.POSTTEXTFIX_TEXT || b.controlComponent === f.POST_TEXT) && G?.controlId && G.controlId !== b.controlId, z = b.controlId && b.originControlId && (b.controlComponent === f.VALUE || b.controlComponent === f.PLACEHOLDER);
|
|
7661
|
-
if (Z && !
|
|
7811
|
+
if (Z && !K.controlId) {
|
|
7662
7812
|
const k = b.originControlId;
|
|
7663
7813
|
let B = null;
|
|
7664
7814
|
for (let q = X; q >= 0; q--) {
|
|
@@ -7668,8 +7818,8 @@ function Ti(o, t, e = "input") {
|
|
|
7668
7818
|
break;
|
|
7669
7819
|
}
|
|
7670
7820
|
}
|
|
7671
|
-
|
|
7672
|
-
} else if (Q && !
|
|
7821
|
+
K.controlId = k, K.controlComponent = f.VALUE, B && (K.control = B);
|
|
7822
|
+
} else if (Q && !K.controlId) {
|
|
7673
7823
|
if (G?.controlId && G.controlId !== b.controlId)
|
|
7674
7824
|
if (G.controlComponent === f.PREFIX || G.controlComponent === f.PRETEXTFIX)
|
|
7675
7825
|
for (let k = X; k >= 0; k--) {
|
|
@@ -7678,7 +7828,7 @@ function Ti(o, t, e = "input") {
|
|
|
7678
7828
|
for (let q = k - 1; q >= 0; q--) {
|
|
7679
7829
|
const j = E[q];
|
|
7680
7830
|
if (j.controlId && j.controlId !== b.controlId && (j.controlComponent === f.PRETEXTFIX || j.controlComponent === f.PRETEXTFIX_TEXT || j.controlComponent === f.PREFIX || j.controlComponent === f.PRE_TEXT)) {
|
|
7681
|
-
|
|
7831
|
+
K.controlId = j.controlId, K.controlComponent = f.VALUE, j.control && (K.control = j.control);
|
|
7682
7832
|
break;
|
|
7683
7833
|
}
|
|
7684
7834
|
if (j.controlId && j.controlId !== b.controlId && (j.controlComponent === f.POSTFIX || j.controlComponent === f.POSTTEXTFIX))
|
|
@@ -7687,15 +7837,15 @@ function Ti(o, t, e = "input") {
|
|
|
7687
7837
|
break;
|
|
7688
7838
|
}
|
|
7689
7839
|
}
|
|
7690
|
-
else (G.controlComponent === f.POSTFIX || G.controlComponent === f.POSTTEXTFIX) && (
|
|
7691
|
-
if (!
|
|
7840
|
+
else (G.controlComponent === f.POSTFIX || G.controlComponent === f.POSTTEXTFIX) && (K.controlId = G.controlId, K.controlComponent = f.VALUE, G.control && (K.control = G.control));
|
|
7841
|
+
if (!K.controlId)
|
|
7692
7842
|
for (let k = X; k >= 0; k--) {
|
|
7693
7843
|
const B = E[k];
|
|
7694
7844
|
if (B.controlId === b.controlId && (B.controlComponent === f.PREFIX || B.controlComponent === f.PRETEXTFIX)) {
|
|
7695
7845
|
for (let q = k - 1; q >= 0; q--) {
|
|
7696
7846
|
const j = E[q];
|
|
7697
7847
|
if (j.controlId && j.controlId !== b.controlId && (j.controlComponent === f.PRETEXTFIX || j.controlComponent === f.PRETEXTFIX_TEXT || j.controlComponent === f.PREFIX || j.controlComponent === f.PRE_TEXT)) {
|
|
7698
|
-
|
|
7848
|
+
K.controlId = j.controlId, K.controlComponent = f.VALUE, j.control && (K.control = j.control);
|
|
7699
7849
|
break;
|
|
7700
7850
|
}
|
|
7701
7851
|
if (j.controlId && j.controlId !== b.controlId && (j.controlComponent === f.POSTFIX || j.controlComponent === f.POSTTEXTFIX))
|
|
@@ -7704,7 +7854,7 @@ function Ti(o, t, e = "input") {
|
|
|
7704
7854
|
break;
|
|
7705
7855
|
}
|
|
7706
7856
|
}
|
|
7707
|
-
} else if (z && !
|
|
7857
|
+
} else if (z && !K.controlId) {
|
|
7708
7858
|
const k = b.controlId;
|
|
7709
7859
|
let B = b.control;
|
|
7710
7860
|
if (!B)
|
|
@@ -7713,7 +7863,7 @@ function Ti(o, t, e = "input") {
|
|
|
7713
7863
|
if (j.controlId === k && j.control && (B = j.control, j.controlComponent === f.PREFIX || j.controlComponent === f.PRETEXTFIX))
|
|
7714
7864
|
break;
|
|
7715
7865
|
}
|
|
7716
|
-
|
|
7866
|
+
K.controlId = k, K.originControlId = b.originControlId, K.controlComponent = f.VALUE, B && (K.control = B);
|
|
7717
7867
|
} else if (b.controlId && !b.originControlId) {
|
|
7718
7868
|
let k = b.control;
|
|
7719
7869
|
if (!k)
|
|
@@ -7724,8 +7874,8 @@ function Ti(o, t, e = "input") {
|
|
|
7724
7874
|
break;
|
|
7725
7875
|
}
|
|
7726
7876
|
}
|
|
7727
|
-
|
|
7728
|
-
} else if (!
|
|
7877
|
+
K.controlId || (K.controlId = b.controlId), k && !K.control && (K.control = k), K.controlComponent || (K.controlComponent = f.VALUE);
|
|
7878
|
+
} else if (!K.controlId && !K.control && G?.originControlId && (G.controlComponent === f.PREFIX || G.controlComponent === f.PRETEXTFIX)) {
|
|
7729
7879
|
const k = G.originControlId;
|
|
7730
7880
|
let B = null;
|
|
7731
7881
|
for (let q = M; q >= 0; q--) {
|
|
@@ -7735,42 +7885,42 @@ function Ti(o, t, e = "input") {
|
|
|
7735
7885
|
break;
|
|
7736
7886
|
}
|
|
7737
7887
|
}
|
|
7738
|
-
|
|
7888
|
+
K.controlId = k, K.controlComponent = f.VALUE, B && (K.control = B);
|
|
7739
7889
|
}
|
|
7740
7890
|
}
|
|
7741
|
-
if (
|
|
7742
|
-
const Z = nc(
|
|
7743
|
-
|
|
7891
|
+
if (H && H !== A) {
|
|
7892
|
+
const Z = nc(H, s.defaultFont);
|
|
7893
|
+
K.font = Z;
|
|
7744
7894
|
}
|
|
7745
|
-
return
|
|
7895
|
+
return K;
|
|
7746
7896
|
});
|
|
7747
7897
|
let ot;
|
|
7748
7898
|
const Lt = l[d], Tt = l[d + 1];
|
|
7749
7899
|
if (h)
|
|
7750
7900
|
ot = X;
|
|
7751
7901
|
else {
|
|
7752
|
-
const
|
|
7902
|
+
const H = (Z) => {
|
|
7753
7903
|
if (pt?.length)
|
|
7754
7904
|
for (let Q = 0; Q < pt.length; Q++)
|
|
7755
7905
|
E.splice(Z + Q, 0, pt[Q]);
|
|
7756
7906
|
return X + pt.length;
|
|
7757
|
-
},
|
|
7758
|
-
if (X !== M && (i.removeSplitTdOtherRangeElements(), i.spliceElementList(E,
|
|
7759
|
-
ot = K
|
|
7907
|
+
}, K = X + 1;
|
|
7908
|
+
if (X !== M && (i.removeSplitTdOtherRangeElements(), i.spliceElementList(E, K, M - X)), lt)
|
|
7909
|
+
ot = H(K);
|
|
7760
7910
|
else if (Lt?.originControlId && (Lt?.controlComponent === "postfix" || Lt?.controlComponent === "postTextFix"))
|
|
7761
|
-
ot = K
|
|
7911
|
+
ot = H(K);
|
|
7762
7912
|
else if ((Lt?.control?.type === U.NUMBER || Tt?.control?.type === U.NUMBER) && r.getActiveControl()?.getElement()?.control?.type === U.NUMBER && r.getIsRangeWithinControl()) {
|
|
7763
7913
|
const Z = r.getActiveControl();
|
|
7764
7914
|
Z && typeof Z.awake == "function" && Z.awake(), ot = X;
|
|
7765
7915
|
} else if ((Lt?.control?.type === U.SELECT || Tt?.control?.type === U.SELECT) && r.getActiveControl()?.getElement()?.control?.type === U.SELECT && r.getIsRangeWithinControl()) {
|
|
7766
7916
|
const Z = r.getActiveControl();
|
|
7767
7917
|
Z && typeof Z.awake == "function" && Z.awake(), ot = X;
|
|
7768
|
-
} else Lt?.control?.type === "button" || Tt?.control?.type === "button" ? (Lt?.control || Tt?.control)?.buttonText ? ot = X : r.getActiveControl() && r.getIsRangeWithinControl() ? (r.removePlaceholder(X, { elementList: E }), ot = r.setValue(pt), r.emitControlContentChange()) : ot = X : r.getActiveControl() && r.getIsRangeWithinControl() ? (r.removePlaceholder(X, { elementList: E }), ot = r.setValue(pt), r.emitControlContentChange()) : (Lt?.type === "control" || Tt?.type === "control") && !lt ? ot = K
|
|
7918
|
+
} else Lt?.control?.type === "button" || Tt?.control?.type === "button" ? (Lt?.control || Tt?.control)?.buttonText ? ot = X : r.getActiveControl() && r.getIsRangeWithinControl() ? (r.removePlaceholder(X, { elementList: E }), ot = r.setValue(pt), r.emitControlContentChange()) : ot = X : r.getActiveControl() && r.getIsRangeWithinControl() ? (r.removePlaceholder(X, { elementList: E }), ot = r.setValue(pt), r.emitControlContentChange()) : (Lt?.type === "control" || Tt?.type === "control") && !lt ? ot = H(K) : (Gt(E, pt, X, {
|
|
7769
7919
|
editorOptions: s
|
|
7770
|
-
}), i.spliceElementList(E,
|
|
7920
|
+
}), i.spliceElementList(E, K, 0, pt), ot = X + pt.length);
|
|
7771
7921
|
}
|
|
7772
7922
|
if (~ot && !h) {
|
|
7773
|
-
const
|
|
7923
|
+
const H = vt() - n, K = vt();
|
|
7774
7924
|
g.setRange(ot, ot), i.render({
|
|
7775
7925
|
curIndex: ot,
|
|
7776
7926
|
isSubmitHistory: !h,
|
|
@@ -7778,11 +7928,11 @@ function Ti(o, t, e = "input") {
|
|
|
7778
7928
|
}), Wi(s, `input:${e}`, vt() - n, [
|
|
7779
7929
|
{
|
|
7780
7930
|
label: "mutate",
|
|
7781
|
-
duration:
|
|
7931
|
+
duration: H
|
|
7782
7932
|
},
|
|
7783
7933
|
{
|
|
7784
7934
|
label: "renderCall",
|
|
7785
|
-
duration: vt() -
|
|
7935
|
+
duration: vt() - K
|
|
7786
7936
|
}
|
|
7787
7937
|
], {
|
|
7788
7938
|
isComposing: h,
|
|
@@ -8080,42 +8230,87 @@ const Tc = {
|
|
|
8080
8230
|
dragover: pc
|
|
8081
8231
|
};
|
|
8082
8232
|
class mc {
|
|
8233
|
+
/** 是否允许选区操作 */
|
|
8083
8234
|
isAllowSelection;
|
|
8235
|
+
/** 是否正在进行输入法组合 */
|
|
8084
8236
|
isComposing;
|
|
8237
|
+
/** 输入法组合信息 */
|
|
8085
8238
|
compositionInfo;
|
|
8239
|
+
/** 是否允许拖拽 */
|
|
8086
8240
|
isAllowDrag;
|
|
8241
|
+
/** 是否允许放置 */
|
|
8087
8242
|
isAllowDrop;
|
|
8243
|
+
/** 缓存的选区信息 */
|
|
8088
8244
|
cacheRange;
|
|
8245
|
+
/** 缓存的元素列表 */
|
|
8089
8246
|
cacheElementList;
|
|
8247
|
+
/** 缓存的位置列表 */
|
|
8090
8248
|
cachePositionList;
|
|
8249
|
+
/** 缓存的位置上下文 */
|
|
8091
8250
|
cachePositionContext;
|
|
8092
|
-
|
|
8251
|
+
/** 鼠标按下时的起始位置 */
|
|
8093
8252
|
mouseDownStartPosition;
|
|
8253
|
+
/** Draw实例 */
|
|
8094
8254
|
draw;
|
|
8255
|
+
/** 页面容器元素 */
|
|
8095
8256
|
pageContainer;
|
|
8257
|
+
/** Canvas页面列表 */
|
|
8096
8258
|
pageList;
|
|
8259
|
+
/** 选区管理器 */
|
|
8097
8260
|
range;
|
|
8261
|
+
/** 位置管理器 */
|
|
8098
8262
|
position;
|
|
8263
|
+
/**
|
|
8264
|
+
* 创建Canvas事件处理器
|
|
8265
|
+
* @param draw - Draw实例
|
|
8266
|
+
*/
|
|
8099
8267
|
constructor(t) {
|
|
8100
8268
|
this.draw = t, this.pageContainer = t.getPageContainer(), this.pageList = t.getPageList(), this.range = this.draw.getRange(), this.position = this.draw.getPosition(), this.isAllowSelection = !1, this.isComposing = !1, this.compositionInfo = null, this.isAllowDrag = !1, this.isAllowDrop = !1, this.cacheRange = null, this.cacheElementList = null, this.cachePositionList = null, this.cachePositionContext = null, this.mouseDownStartPosition = null;
|
|
8101
8269
|
}
|
|
8270
|
+
/**
|
|
8271
|
+
* 获取Draw实例
|
|
8272
|
+
* @returns Draw实例
|
|
8273
|
+
*/
|
|
8102
8274
|
getDraw() {
|
|
8103
8275
|
return this.draw;
|
|
8104
8276
|
}
|
|
8277
|
+
/**
|
|
8278
|
+
* 注册事件监听器
|
|
8279
|
+
*
|
|
8280
|
+
* 为页面容器绑定所有必要的事件监听器。
|
|
8281
|
+
*/
|
|
8105
8282
|
register() {
|
|
8106
8283
|
this.pageContainer.addEventListener("click", this.click.bind(this)), this.pageContainer.addEventListener("mousedown", this.mousedown.bind(this)), this.pageContainer.addEventListener("mouseup", this.mouseup.bind(this)), this.pageContainer.addEventListener("mouseleave", this.mouseleave.bind(this)), this.pageContainer.addEventListener("mousemove", this.mousemove.bind(this)), this.pageContainer.addEventListener("dblclick", this.dblclick.bind(this)), this.pageContainer.addEventListener("dragover", this.dragover.bind(this)), this.pageContainer.addEventListener("drop", this.drop.bind(this)), Il(this.pageContainer, this.threeClick.bind(this));
|
|
8107
8284
|
}
|
|
8285
|
+
/**
|
|
8286
|
+
* 设置是否允许选区操作
|
|
8287
|
+
* @param payload - 是否允许
|
|
8288
|
+
*/
|
|
8108
8289
|
setIsAllowSelection(t) {
|
|
8109
8290
|
this.isAllowSelection = t, t || this.applyPainterStyle();
|
|
8110
8291
|
}
|
|
8292
|
+
/**
|
|
8293
|
+
* 设置是否允许拖拽
|
|
8294
|
+
* @param payload - 是否允许
|
|
8295
|
+
*/
|
|
8111
8296
|
setIsAllowDrag(t) {
|
|
8112
8297
|
this.isAllowDrag = t, this.isAllowDrop = t;
|
|
8113
8298
|
}
|
|
8299
|
+
/**
|
|
8300
|
+
* 清除格式刷样式
|
|
8301
|
+
*
|
|
8302
|
+
* 重置光标样式并清除格式刷状态。
|
|
8303
|
+
*/
|
|
8114
8304
|
clearPainterStyle() {
|
|
8115
8305
|
this.pageList.forEach((t) => {
|
|
8116
8306
|
t.style.cursor = "text";
|
|
8117
8307
|
}), this.draw.setPainterStyle(null);
|
|
8118
8308
|
}
|
|
8309
|
+
/**
|
|
8310
|
+
* 应用格式刷样式
|
|
8311
|
+
*
|
|
8312
|
+
* 将格式刷样式应用到当前选区或光标所在的词组。
|
|
8313
|
+
*/
|
|
8119
8314
|
applyPainterStyle() {
|
|
8120
8315
|
const t = this.draw.getPainterStyle();
|
|
8121
8316
|
if (!t || this.draw.isReadonly() || this.draw.isDisabled())
|
|
@@ -8137,6 +8332,11 @@ class mc {
|
|
|
8137
8332
|
const r = this.draw.getPainterOptions();
|
|
8138
8333
|
(!r || !r.isDblclick) && this.clearPainterStyle();
|
|
8139
8334
|
}
|
|
8335
|
+
/**
|
|
8336
|
+
* 全选操作
|
|
8337
|
+
*
|
|
8338
|
+
* 选中所有内容。在表格内时选中整个表格。
|
|
8339
|
+
*/
|
|
8140
8340
|
selectAll() {
|
|
8141
8341
|
if (this.position.getPositionContext().isTable)
|
|
8142
8342
|
this.draw.getTableOperate().tableSelectAll();
|
|
@@ -8149,51 +8349,115 @@ class mc {
|
|
|
8149
8349
|
});
|
|
8150
8350
|
}
|
|
8151
8351
|
}
|
|
8352
|
+
/**
|
|
8353
|
+
* 处理鼠标移动事件
|
|
8354
|
+
* @param evt - 鼠标事件对象
|
|
8355
|
+
*/
|
|
8152
8356
|
mousemove(t) {
|
|
8153
8357
|
this.draw.isInteractionSuspended() || Ka(t, this);
|
|
8154
8358
|
}
|
|
8359
|
+
/**
|
|
8360
|
+
* 处理鼠标按下事件
|
|
8361
|
+
* @param evt - 鼠标事件对象
|
|
8362
|
+
*/
|
|
8155
8363
|
mousedown(t) {
|
|
8156
8364
|
this.draw.isInteractionSuspended() || Za(t, this);
|
|
8157
8365
|
}
|
|
8366
|
+
/**
|
|
8367
|
+
* 处理点击事件
|
|
8368
|
+
*
|
|
8369
|
+
* 在iOS系统上,需要用户主动触发才能弹出键盘。
|
|
8370
|
+
*/
|
|
8158
8371
|
click() {
|
|
8159
8372
|
this.draw.isInteractionSuspended() || bl && !this.draw.isReadonly() && this.draw.getCursor().getAgentDom().focus();
|
|
8160
8373
|
}
|
|
8374
|
+
/**
|
|
8375
|
+
* 处理鼠标释放事件
|
|
8376
|
+
* @param evt - 鼠标事件对象
|
|
8377
|
+
*/
|
|
8161
8378
|
mouseup(t) {
|
|
8162
8379
|
this.draw.isInteractionSuspended() || Qa(t, this);
|
|
8163
8380
|
}
|
|
8381
|
+
/**
|
|
8382
|
+
* 处理鼠标离开事件
|
|
8383
|
+
* @param evt - 鼠标事件对象
|
|
8384
|
+
*/
|
|
8164
8385
|
mouseleave(t) {
|
|
8165
8386
|
this.draw.isInteractionSuspended() || va(t, this);
|
|
8166
8387
|
}
|
|
8388
|
+
/**
|
|
8389
|
+
* 处理键盘按下事件
|
|
8390
|
+
* @param evt - 键盘事件对象
|
|
8391
|
+
*/
|
|
8167
8392
|
keydown(t) {
|
|
8168
8393
|
this.draw.isInteractionSuspended() || qa(t, this);
|
|
8169
8394
|
}
|
|
8395
|
+
/**
|
|
8396
|
+
* 处理双击事件
|
|
8397
|
+
* @param evt - 鼠标事件对象
|
|
8398
|
+
*/
|
|
8170
8399
|
dblclick(t) {
|
|
8171
8400
|
this.draw.isInteractionSuspended() || Is.dblclick(this, t);
|
|
8172
8401
|
}
|
|
8402
|
+
/**
|
|
8403
|
+
* 处理三击事件
|
|
8404
|
+
*
|
|
8405
|
+
* 三击选中整个段落。
|
|
8406
|
+
*/
|
|
8173
8407
|
threeClick() {
|
|
8174
8408
|
this.draw.isInteractionSuspended() || Is.threeClick(this);
|
|
8175
8409
|
}
|
|
8410
|
+
/**
|
|
8411
|
+
* 处理文本输入事件
|
|
8412
|
+
* @param data - 输入的文本数据
|
|
8413
|
+
* @param source - 输入来源
|
|
8414
|
+
*/
|
|
8176
8415
|
input(t, e = "input") {
|
|
8177
8416
|
this.draw.isInteractionSuspended() || Ti(t, this, e);
|
|
8178
8417
|
}
|
|
8418
|
+
/**
|
|
8419
|
+
* 处理剪切操作
|
|
8420
|
+
*/
|
|
8179
8421
|
async cut() {
|
|
8180
8422
|
this.draw.isInteractionSuspended() || await lc(this);
|
|
8181
8423
|
}
|
|
8424
|
+
/**
|
|
8425
|
+
* 处理复制操作
|
|
8426
|
+
* @param options - 复制选项
|
|
8427
|
+
*/
|
|
8182
8428
|
async copy(t) {
|
|
8183
8429
|
this.draw.isInteractionSuspended() || await ac(this, t);
|
|
8184
8430
|
}
|
|
8431
|
+
/**
|
|
8432
|
+
* 处理输入法组合开始事件
|
|
8433
|
+
*/
|
|
8185
8434
|
compositionstart() {
|
|
8186
8435
|
this.draw.isInteractionSuspended() || zo.compositionstart(this);
|
|
8187
8436
|
}
|
|
8437
|
+
/**
|
|
8438
|
+
* 处理输入法组合结束事件
|
|
8439
|
+
* @param evt - 组合事件对象
|
|
8440
|
+
*/
|
|
8188
8441
|
compositionend(t) {
|
|
8189
8442
|
this.draw.isInteractionSuspended() || zo.compositionend(this, t);
|
|
8190
8443
|
}
|
|
8444
|
+
/**
|
|
8445
|
+
* 取消输入法组合
|
|
8446
|
+
*/
|
|
8191
8447
|
compositionCancel() {
|
|
8192
8448
|
this.draw.isInteractionSuspended() || zo.compositionCancel(this);
|
|
8193
8449
|
}
|
|
8450
|
+
/**
|
|
8451
|
+
* 处理拖放事件
|
|
8452
|
+
* @param evt - 拖放事件对象
|
|
8453
|
+
*/
|
|
8194
8454
|
drop(t) {
|
|
8195
8455
|
this.draw.isInteractionSuspended() || cc(t, this);
|
|
8196
8456
|
}
|
|
8457
|
+
/**
|
|
8458
|
+
* 处理拖拽悬停事件
|
|
8459
|
+
* @param evt - 拖拽事件对象
|
|
8460
|
+
*/
|
|
8197
8461
|
dragover(t) {
|
|
8198
8462
|
this.draw.isInteractionSuspended() || Tc.dragover(t, this);
|
|
8199
8463
|
}
|
|
@@ -8322,49 +8586,107 @@ class Pc {
|
|
|
8322
8586
|
}
|
|
8323
8587
|
}
|
|
8324
8588
|
class Oc {
|
|
8589
|
+
/** 当前光标位置信息 */
|
|
8325
8590
|
cursorPosition;
|
|
8591
|
+
/** 位置上下文(是否在表格、控件内等) */
|
|
8326
8592
|
positionContext;
|
|
8593
|
+
/** 元素位置列表 */
|
|
8327
8594
|
positionList;
|
|
8595
|
+
/** 浮动元素位置列表 */
|
|
8328
8596
|
floatPositionList;
|
|
8597
|
+
/** Draw实例 */
|
|
8329
8598
|
draw;
|
|
8599
|
+
/** 事件总线 */
|
|
8330
8600
|
eventBus;
|
|
8601
|
+
/** 编辑器配置选项 */
|
|
8331
8602
|
options;
|
|
8603
|
+
/**
|
|
8604
|
+
* 创建位置管理器实例
|
|
8605
|
+
* @param draw - Draw实例
|
|
8606
|
+
*/
|
|
8332
8607
|
constructor(t) {
|
|
8333
8608
|
this.positionList = [], this.floatPositionList = [], this.cursorPosition = null, this.positionContext = {
|
|
8334
8609
|
isTable: !1,
|
|
8335
8610
|
isControl: !1
|
|
8336
8611
|
}, this.draw = t, this.eventBus = t.getEventBus(), this.options = t.getOptions();
|
|
8337
8612
|
}
|
|
8613
|
+
/**
|
|
8614
|
+
* 获取浮动元素位置列表
|
|
8615
|
+
* @returns 浮动元素位置数组
|
|
8616
|
+
*/
|
|
8338
8617
|
getFloatPositionList() {
|
|
8339
8618
|
return this.floatPositionList;
|
|
8340
8619
|
}
|
|
8620
|
+
/**
|
|
8621
|
+
* 获取表格内元素位置列表
|
|
8622
|
+
* @param sourceElementList - 源元素列表
|
|
8623
|
+
* @returns 表格内元素位置数组
|
|
8624
|
+
*/
|
|
8341
8625
|
getTablePositionList(t) {
|
|
8342
8626
|
const { index: e, trIndex: n, tdIndex: i } = this.positionContext;
|
|
8343
8627
|
return t[e].trList[n].tdList[i].positionList || [];
|
|
8344
8628
|
}
|
|
8629
|
+
/**
|
|
8630
|
+
* 获取元素位置列表
|
|
8631
|
+
* 根据当前位置上下文返回对应的位置列表
|
|
8632
|
+
* @returns 元素位置数组
|
|
8633
|
+
*/
|
|
8345
8634
|
getPositionList() {
|
|
8346
8635
|
return this.positionContext.isTable ? this.getTablePositionList(this.draw.getOriginalElementList()) : this.getOriginalPositionList();
|
|
8347
8636
|
}
|
|
8637
|
+
/**
|
|
8638
|
+
* 获取主区域元素位置列表
|
|
8639
|
+
* @returns 主区域元素位置数组
|
|
8640
|
+
*/
|
|
8348
8641
|
getMainPositionList() {
|
|
8349
8642
|
return this.positionContext.isTable ? this.getTablePositionList(this.draw.getOriginalMainElementList()) : this.positionList;
|
|
8350
8643
|
}
|
|
8644
|
+
/**
|
|
8645
|
+
* 获取原始位置列表
|
|
8646
|
+
* 根据当前激活的区域返回对应的位置列表
|
|
8647
|
+
* @returns 原始元素位置数组
|
|
8648
|
+
*/
|
|
8351
8649
|
getOriginalPositionList() {
|
|
8352
8650
|
const t = this.draw.getZone();
|
|
8353
8651
|
return t.isHeaderActive() ? this.draw.getHeader().getPositionList() : t.isFooterActive() ? this.draw.getFooter().getPositionList() : this.positionList;
|
|
8354
8652
|
}
|
|
8653
|
+
/**
|
|
8654
|
+
* 获取原始主区域位置列表
|
|
8655
|
+
* @returns 主区域位置数组
|
|
8656
|
+
*/
|
|
8355
8657
|
getOriginalMainPositionList() {
|
|
8356
8658
|
return this.positionList;
|
|
8357
8659
|
}
|
|
8660
|
+
/**
|
|
8661
|
+
* 获取选区内的位置列表
|
|
8662
|
+
* @returns 选区位置数组,如果没有选区则返回null
|
|
8663
|
+
*/
|
|
8358
8664
|
getSelectionPositionList() {
|
|
8359
8665
|
const { startIndex: t, endIndex: e } = this.draw.getRange().getRange();
|
|
8360
8666
|
return t === e ? null : this.getPositionList().slice(t + 1, e + 1);
|
|
8361
8667
|
}
|
|
8668
|
+
/**
|
|
8669
|
+
* 设置元素位置列表
|
|
8670
|
+
* @param payload - 元素位置数组
|
|
8671
|
+
*/
|
|
8362
8672
|
setPositionList(t) {
|
|
8363
8673
|
this.positionList = t;
|
|
8364
8674
|
}
|
|
8675
|
+
/**
|
|
8676
|
+
* 设置浮动元素位置列表
|
|
8677
|
+
* @param payload - 浮动元素位置数组
|
|
8678
|
+
*/
|
|
8365
8679
|
setFloatPositionList(t) {
|
|
8366
8680
|
this.floatPositionList = t;
|
|
8367
8681
|
}
|
|
8682
|
+
/**
|
|
8683
|
+
* 计算页面行位置
|
|
8684
|
+
*
|
|
8685
|
+
* 遍历行列表,计算每个元素的坐标位置,处理行对齐、浮动元素等
|
|
8686
|
+
*
|
|
8687
|
+
* @param payload - 计算参数
|
|
8688
|
+
* @returns 计算结果,包含最终的x、y坐标和元素索引
|
|
8689
|
+
*/
|
|
8368
8690
|
computePageRowPosition(t) {
|
|
8369
8691
|
const { positionList: e, rowList: n, pageNo: i, startX: r, startY: s, startRowIndex: l, startIndex: a, innerWidth: c, zone: d } = t, { scale: R, table: { tdPadding: u } } = this.options;
|
|
8370
8692
|
let h = r, g = s, p = a;
|
|
@@ -8372,7 +8694,7 @@ class Oc {
|
|
|
8372
8694
|
const T = n[m];
|
|
8373
8695
|
if (!T.isSurround) {
|
|
8374
8696
|
const O = T.width + (T.offsetX || 0);
|
|
8375
|
-
T.rowFlex ===
|
|
8697
|
+
T.rowFlex === Nt.CENTER ? h += (c - O) / 2 : T.rowFlex === Nt.RIGHT && (h += c - O);
|
|
8376
8698
|
}
|
|
8377
8699
|
h += T.offsetX || 0, g += T.offsetY || 0;
|
|
8378
8700
|
const I = h, L = g;
|
|
@@ -8455,6 +8777,11 @@ class Oc {
|
|
|
8455
8777
|
}
|
|
8456
8778
|
return { x: h, y: g, index: p };
|
|
8457
8779
|
}
|
|
8780
|
+
/**
|
|
8781
|
+
* 计算位置列表
|
|
8782
|
+
*
|
|
8783
|
+
* 清空原有位置信息,遍历每页行计算所有元素的位置坐标
|
|
8784
|
+
*/
|
|
8458
8785
|
computePositionList() {
|
|
8459
8786
|
this.positionList = [];
|
|
8460
8787
|
const t = this.draw.getInnerWidth(), e = this.draw.getPageRowList(), n = this.draw.getMargins(), i = n[3], s = this.draw.getHeader().getExtraHeight(), l = n[0] + s;
|
|
@@ -8476,6 +8803,11 @@ class Oc {
|
|
|
8476
8803
|
}), a += d.length;
|
|
8477
8804
|
}
|
|
8478
8805
|
}
|
|
8806
|
+
/**
|
|
8807
|
+
* 计算单行位置
|
|
8808
|
+
* @param payload - 计算参数,包含行信息和内部宽度
|
|
8809
|
+
* @returns 元素位置数组
|
|
8810
|
+
*/
|
|
8479
8811
|
computeRowPosition(t) {
|
|
8480
8812
|
const { row: e, innerWidth: n } = t, i = [];
|
|
8481
8813
|
return this.computePageRowPosition({
|
|
@@ -8489,21 +8821,49 @@ class Oc {
|
|
|
8489
8821
|
startRowIndex: 0
|
|
8490
8822
|
}), i;
|
|
8491
8823
|
}
|
|
8824
|
+
/**
|
|
8825
|
+
* 设置光标位置
|
|
8826
|
+
* @param position - 光标位置信息
|
|
8827
|
+
*/
|
|
8492
8828
|
setCursorPosition(t) {
|
|
8493
8829
|
this.cursorPosition = t;
|
|
8494
8830
|
}
|
|
8831
|
+
/**
|
|
8832
|
+
* 获取光标位置
|
|
8833
|
+
* @returns 当前光标位置信息
|
|
8834
|
+
*/
|
|
8495
8835
|
getCursorPosition() {
|
|
8496
8836
|
return this.cursorPosition;
|
|
8497
8837
|
}
|
|
8838
|
+
/**
|
|
8839
|
+
* 获取位置上下文
|
|
8840
|
+
* @returns 当前位置上下文信息
|
|
8841
|
+
*/
|
|
8498
8842
|
getPositionContext() {
|
|
8499
8843
|
return this.positionContext;
|
|
8500
8844
|
}
|
|
8845
|
+
/**
|
|
8846
|
+
* 设置位置上下文
|
|
8847
|
+
*
|
|
8848
|
+
* 同时会触发positionContextChange事件
|
|
8849
|
+
*
|
|
8850
|
+
* @param payload - 新的位置上下文
|
|
8851
|
+
*/
|
|
8501
8852
|
setPositionContext(t) {
|
|
8502
8853
|
this.eventBus.emit("positionContextChange", {
|
|
8503
8854
|
value: t,
|
|
8504
8855
|
oldValue: this.positionContext
|
|
8505
8856
|
}), this.positionContext = t;
|
|
8506
8857
|
}
|
|
8858
|
+
/**
|
|
8859
|
+
* 根据XY坐标获取位置
|
|
8860
|
+
*
|
|
8861
|
+
* 遍历位置列表,找到鼠标坐标所在的元素位置
|
|
8862
|
+
* 支持表格内元素、浮动元素、控件等特殊处理
|
|
8863
|
+
*
|
|
8864
|
+
* @param payload - 坐标参数
|
|
8865
|
+
* @returns 当前位置信息
|
|
8866
|
+
*/
|
|
8507
8867
|
getPositionByXY(t) {
|
|
8508
8868
|
const { x: e, y: n, isTable: i } = t;
|
|
8509
8869
|
let { elementList: r, positionList: s } = t;
|
|
@@ -8736,6 +9096,14 @@ class Oc {
|
|
|
8736
9096
|
isControl: !!r[u]?.controlId
|
|
8737
9097
|
};
|
|
8738
9098
|
}
|
|
9099
|
+
/**
|
|
9100
|
+
* 根据XY坐标获取浮动元素位置
|
|
9101
|
+
*
|
|
9102
|
+
* 检查给定坐标是否在浮动元素范围内
|
|
9103
|
+
*
|
|
9104
|
+
* @param payload - 坐标参数,包含要检查的图片显示类型
|
|
9105
|
+
* @returns 如果命中浮动元素则返回位置信息
|
|
9106
|
+
*/
|
|
8739
9107
|
getFloatPositionByXY(t) {
|
|
8740
9108
|
const { x: e, y: n } = t, i = t.pageNo ?? this.draw.getPageNo(), r = this.draw.getZone().getZone(), { scale: s } = this.options;
|
|
8741
9109
|
for (let l = 0; l < this.floatPositionList.length; l++) {
|
|
@@ -8762,6 +9130,15 @@ class Oc {
|
|
|
8762
9130
|
}
|
|
8763
9131
|
}
|
|
8764
9132
|
}
|
|
9133
|
+
/**
|
|
9134
|
+
* 调整位置上下文
|
|
9135
|
+
*
|
|
9136
|
+
* 根据鼠标位置调整光标位置和位置上下文
|
|
9137
|
+
* 处理控件内光标移动等特殊情况
|
|
9138
|
+
*
|
|
9139
|
+
* @param payload - 坐标参数
|
|
9140
|
+
* @returns 调整后的位置信息
|
|
9141
|
+
*/
|
|
8765
9142
|
adjustPositionContext(t) {
|
|
8766
9143
|
const e = this.getPositionByXY(t);
|
|
8767
9144
|
if (!~e.index)
|
|
@@ -8793,6 +9170,15 @@ class Oc {
|
|
|
8793
9170
|
tableId: p
|
|
8794
9171
|
}), e;
|
|
8795
9172
|
}
|
|
9173
|
+
/**
|
|
9174
|
+
* 设置环绕元素位置
|
|
9175
|
+
*
|
|
9176
|
+
* 计算环绕文字的浮动元素对当前行元素的影响
|
|
9177
|
+
* 调整元素位置以避免与浮动元素重叠
|
|
9178
|
+
*
|
|
9179
|
+
* @param payload - 设置参数
|
|
9180
|
+
* @returns 调整后的X坐标和增加的行宽
|
|
9181
|
+
*/
|
|
8796
9182
|
setSurroundPosition(t) {
|
|
8797
9183
|
const { scale: e } = this.options, { pageNo: n, row: i, rowElement: r, rowElementRect: s, surroundElementList: l, availableWidth: a } = t;
|
|
8798
9184
|
let c = s.x, d = 0;
|
|
@@ -8821,21 +9207,44 @@ class Oc {
|
|
|
8821
9207
|
}
|
|
8822
9208
|
}
|
|
8823
9209
|
class Mc {
|
|
9210
|
+
/** Draw实例,用于获取渲染上下文和状态 */
|
|
8824
9211
|
draw;
|
|
9212
|
+
/** 编辑器配置选项 */
|
|
8825
9213
|
options;
|
|
9214
|
+
/** 当前选区信息 */
|
|
8826
9215
|
range;
|
|
9216
|
+
/** 事件监听器,用于触发回调 */
|
|
8827
9217
|
listener;
|
|
9218
|
+
/** 事件总线,用于发布/订阅事件 */
|
|
8828
9219
|
eventBus;
|
|
9220
|
+
/** 位置管理器,用于获取元素位置 */
|
|
8829
9221
|
position;
|
|
9222
|
+
/** 历史管理器,用于撤销/重做功能 */
|
|
8830
9223
|
historyManager;
|
|
9224
|
+
/** 默认样式,用于新输入的文本 */
|
|
8831
9225
|
defaultStyle;
|
|
9226
|
+
/** 上次发射的选区样式,用于优化事件触发 */
|
|
8832
9227
|
lastRangeStyle;
|
|
9228
|
+
/**
|
|
9229
|
+
* 创建选区管理器实例
|
|
9230
|
+
* @param draw - Draw实例,用于获取渲染上下文
|
|
9231
|
+
*/
|
|
8833
9232
|
constructor(t) {
|
|
8834
9233
|
this.draw = t, this.options = t.getOptions(), this.listener = t.getListener(), this.eventBus = t.getEventBus(), this.position = t.getPosition(), this.historyManager = t.getHistoryManager(), this.range = {
|
|
8835
9234
|
startIndex: -1,
|
|
8836
9235
|
endIndex: -1
|
|
8837
9236
|
}, this.defaultStyle = null, this.lastRangeStyle = null;
|
|
8838
9237
|
}
|
|
9238
|
+
/**
|
|
9239
|
+
* 比较两个选区样式是否相同
|
|
9240
|
+
*
|
|
9241
|
+
* 用于优化选区样式变化事件的触发,避免重复发射相同样式。
|
|
9242
|
+
*
|
|
9243
|
+
* @param source - 源样式对象
|
|
9244
|
+
* @param target - 目标样式对象
|
|
9245
|
+
* @returns 如果两个样式完全相同则返回true
|
|
9246
|
+
* @private
|
|
9247
|
+
*/
|
|
8839
9248
|
_isSameRangeStyle(t, e) {
|
|
8840
9249
|
if (!t || ![
|
|
8841
9250
|
"type",
|
|
@@ -8864,6 +9273,15 @@ class Mc {
|
|
|
8864
9273
|
const s = t.groupIds || [], l = e.groupIds || [];
|
|
8865
9274
|
return s.length === l.length && s.every((a, c) => a === l[c]);
|
|
8866
9275
|
}
|
|
9276
|
+
/**
|
|
9277
|
+
* 发射选区样式变化事件
|
|
9278
|
+
*
|
|
9279
|
+
* 当选区样式发生变化时,通知监听器和事件总线。
|
|
9280
|
+
* 使用缓存机制避免重复发射相同的样式。
|
|
9281
|
+
*
|
|
9282
|
+
* @param rangeStyle - 当前的选区样式
|
|
9283
|
+
* @private
|
|
9284
|
+
*/
|
|
8867
9285
|
_emitRangeStyle(t) {
|
|
8868
9286
|
this._isSameRangeStyle(this.lastRangeStyle, t) || (this.lastRangeStyle = {
|
|
8869
9287
|
...t,
|
|
@@ -8871,21 +9289,50 @@ class Mc {
|
|
|
8871
9289
|
groupIds: t.groupIds ? [...t.groupIds] : null
|
|
8872
9290
|
}, this.listener.rangeStyleChange?.(t), this.eventBus.isSubscribe("rangeStyleChange") && this.eventBus.emit("rangeStyleChange", t));
|
|
8873
9291
|
}
|
|
9292
|
+
/**
|
|
9293
|
+
* 获取当前选区信息
|
|
9294
|
+
* @returns 当前选区对象,包含起始和结束索引
|
|
9295
|
+
*/
|
|
8874
9296
|
getRange() {
|
|
8875
9297
|
return this.range;
|
|
8876
9298
|
}
|
|
9299
|
+
/**
|
|
9300
|
+
* 清除当前选区
|
|
9301
|
+
*
|
|
9302
|
+
* 将选区重置为无效状态(startIndex和endIndex都设为-1)
|
|
9303
|
+
*/
|
|
8877
9304
|
clearRange() {
|
|
8878
9305
|
this.setRange(-1, -1);
|
|
8879
9306
|
}
|
|
9307
|
+
/**
|
|
9308
|
+
* 设置默认样式
|
|
9309
|
+
*
|
|
9310
|
+
* 用于设置新输入文本的默认样式,如字体、大小等。
|
|
9311
|
+
*
|
|
9312
|
+
* @param style - 要设置的样式对象,传入null则清除默认样式
|
|
9313
|
+
*/
|
|
8880
9314
|
setDefaultStyle(t) {
|
|
8881
9315
|
t ? this.defaultStyle = {
|
|
8882
9316
|
...this.defaultStyle,
|
|
8883
9317
|
...t
|
|
8884
9318
|
} : this.defaultStyle = null;
|
|
8885
9319
|
}
|
|
9320
|
+
/**
|
|
9321
|
+
* 获取默认样式
|
|
9322
|
+
* @returns 当前的默认样式对象,如果没有设置则返回null
|
|
9323
|
+
*/
|
|
8886
9324
|
getDefaultStyle() {
|
|
8887
9325
|
return this.defaultStyle;
|
|
8888
9326
|
}
|
|
9327
|
+
/**
|
|
9328
|
+
* 获取选区锚点元素的样式
|
|
9329
|
+
*
|
|
9330
|
+
* 锚点元素是选区起始位置的元素,用于确定当前样式状态。
|
|
9331
|
+
*
|
|
9332
|
+
* @param elementList - 元素列表
|
|
9333
|
+
* @param anchorIndex - 锚点索引
|
|
9334
|
+
* @returns 合并了默认样式的锚点元素,如果不存在则返回null
|
|
9335
|
+
*/
|
|
8889
9336
|
getRangeAnchorStyle(t, e) {
|
|
8890
9337
|
const n = On(t, e);
|
|
8891
9338
|
return n ? {
|
|
@@ -8893,17 +9340,53 @@ class Mc {
|
|
|
8893
9340
|
...this.defaultStyle
|
|
8894
9341
|
} : null;
|
|
8895
9342
|
}
|
|
9343
|
+
/**
|
|
9344
|
+
* 判断选区是否发生变化
|
|
9345
|
+
*
|
|
9346
|
+
* 比较新选区与当前选区的所有属性,包括表格相关属性。
|
|
9347
|
+
*
|
|
9348
|
+
* @param startIndex - 起始索引
|
|
9349
|
+
* @param endIndex - 结束索引
|
|
9350
|
+
* @param tableId - 表格ID(可选)
|
|
9351
|
+
* @param startTdIndex - 起始单元格索引(可选)
|
|
9352
|
+
* @param endTdIndex - 结束单元格索引(可选)
|
|
9353
|
+
* @param startTrIndex - 起始行索引(可选)
|
|
9354
|
+
* @param endTrIndex - 结束行索引(可选)
|
|
9355
|
+
* @returns 如果选区发生变化则返回true
|
|
9356
|
+
*/
|
|
8896
9357
|
getIsRangeChange(t, e, n, i, r, s, l) {
|
|
8897
9358
|
return this.range.startIndex !== t || this.range.endIndex !== e || this.range.tableId !== n || this.range.startTdIndex !== i || this.range.endTdIndex !== r || this.range.startTrIndex !== s || this.range.endTrIndex !== l;
|
|
8898
9359
|
}
|
|
9360
|
+
/**
|
|
9361
|
+
* 判断选区是否折叠
|
|
9362
|
+
*
|
|
9363
|
+
* 折叠选区表示光标位置(起始和结束位置相同),
|
|
9364
|
+
* 未折叠选区表示用户选择了文本范围。
|
|
9365
|
+
*
|
|
9366
|
+
* @returns 如果选区是折叠的(起始等于结束)则返回true
|
|
9367
|
+
*/
|
|
8899
9368
|
getIsCollapsed() {
|
|
8900
9369
|
const { startIndex: t, endIndex: e } = this.range;
|
|
8901
9370
|
return t === e;
|
|
8902
9371
|
}
|
|
9372
|
+
/**
|
|
9373
|
+
* 判断是否存在有效选区
|
|
9374
|
+
*
|
|
9375
|
+
* 检查当前是否有文本被选中(选区非空且起始不等于结束)。
|
|
9376
|
+
*
|
|
9377
|
+
* @returns 如果存在有效选区则返回true
|
|
9378
|
+
*/
|
|
8903
9379
|
getIsSelection() {
|
|
8904
9380
|
const { startIndex: t, endIndex: e } = this.range;
|
|
8905
9381
|
return !~t && !~e ? !1 : t !== e;
|
|
8906
9382
|
}
|
|
9383
|
+
/**
|
|
9384
|
+
* 获取选区内的元素列表
|
|
9385
|
+
*
|
|
9386
|
+
* 返回当前选区范围内的所有元素,支持跨页单元格选区。
|
|
9387
|
+
*
|
|
9388
|
+
* @returns 选区内的元素数组,如果没有选区则返回null
|
|
9389
|
+
*/
|
|
8907
9390
|
getSelection() {
|
|
8908
9391
|
const { startIndex: t, endIndex: e, splitTdRange: n } = this.range;
|
|
8909
9392
|
if (t === e)
|
|
@@ -8913,6 +9396,13 @@ class Mc {
|
|
|
8913
9396
|
const i = this.draw.getElementList();
|
|
8914
9397
|
return i.slice(i[t]?.value === A ? t : t + 1, e + 1);
|
|
8915
9398
|
}
|
|
9399
|
+
/**
|
|
9400
|
+
* 获取选区元素列表(支持跨行跨列选区)
|
|
9401
|
+
*
|
|
9402
|
+
* 当选区跨越表格的多行多列时,返回所有涉及的单元格内容。
|
|
9403
|
+
*
|
|
9404
|
+
* @returns 选区内的所有元素数组,如果跨行跨列选区则包含多个单元格的内容
|
|
9405
|
+
*/
|
|
8916
9406
|
getSelectionElementList() {
|
|
8917
9407
|
if (this.range.isCrossRowCol) {
|
|
8918
9408
|
const t = this.draw.getTableParticle().getRangeRowCol();
|
|
@@ -8930,15 +9420,35 @@ class Mc {
|
|
|
8930
9420
|
}
|
|
8931
9421
|
return this.getSelection();
|
|
8932
9422
|
}
|
|
9423
|
+
/**
|
|
9424
|
+
* 获取选区内的文本类元素
|
|
9425
|
+
*
|
|
9426
|
+
* 过滤选区内非文本类型的元素,只返回文本、超链接等文本类元素。
|
|
9427
|
+
*
|
|
9428
|
+
* @returns 文本类元素数组,如果没有则返回null
|
|
9429
|
+
*/
|
|
8933
9430
|
getTextLikeSelection() {
|
|
8934
9431
|
const t = this.getSelection();
|
|
8935
9432
|
return t ? t.filter((e) => !e.type || de.includes(e.type)) : null;
|
|
8936
9433
|
}
|
|
9434
|
+
/**
|
|
9435
|
+
* 获取选区元素列表中的文本类元素
|
|
9436
|
+
*
|
|
9437
|
+
* 过滤选区元素列表中的非文本类型元素,支持跨行跨列选区。
|
|
9438
|
+
*
|
|
9439
|
+
* @returns 文本类元素数组,如果没有则返回null
|
|
9440
|
+
*/
|
|
8937
9441
|
getTextLikeSelectionElementList() {
|
|
8938
9442
|
const t = this.getSelectionElementList();
|
|
8939
9443
|
return t ? t.filter((e) => !e.type || de.includes(e.type)) : null;
|
|
8940
9444
|
}
|
|
8941
|
-
|
|
9445
|
+
/**
|
|
9446
|
+
* 获取光标所选位置的行信息
|
|
9447
|
+
*
|
|
9448
|
+
* 返回一个Map,键为页码,值为该页中选区涉及的行号集合。
|
|
9449
|
+
*
|
|
9450
|
+
* @returns 行信息的Map结构,如果没有选区则返回null
|
|
9451
|
+
*/
|
|
8942
9452
|
getRangeRow() {
|
|
8943
9453
|
const { startIndex: t, endIndex: e } = this.range;
|
|
8944
9454
|
if (!~t && !~e)
|
|
@@ -8950,7 +9460,13 @@ class Mc {
|
|
|
8950
9460
|
}
|
|
8951
9461
|
return i;
|
|
8952
9462
|
}
|
|
8953
|
-
|
|
9463
|
+
/**
|
|
9464
|
+
* 获取光标所选位置的元素列表
|
|
9465
|
+
*
|
|
9466
|
+
* 返回选区所在行的所有元素,支持跨行跨列选区。
|
|
9467
|
+
*
|
|
9468
|
+
* @returns 选区所在行的元素数组,如果没有选区则返回null
|
|
9469
|
+
*/
|
|
8954
9470
|
getRangeRowElementList() {
|
|
8955
9471
|
const { startIndex: t, endIndex: e, isCrossRowCol: n } = this.range;
|
|
8956
9472
|
if (!~t && !~e)
|
|
@@ -8967,7 +9483,14 @@ class Mc {
|
|
|
8967
9483
|
}
|
|
8968
9484
|
return l;
|
|
8969
9485
|
}
|
|
8970
|
-
|
|
9486
|
+
/**
|
|
9487
|
+
* 获取选区段落信息
|
|
9488
|
+
*
|
|
9489
|
+
* 返回当前光标或选区所在段落的行信息。
|
|
9490
|
+
* 会向上和向下查找,直到找到段落边界(换行符或不同列表/标题)。
|
|
9491
|
+
*
|
|
9492
|
+
* @returns 段落行信息的Map结构,键为页码,值为行号数组
|
|
9493
|
+
*/
|
|
8971
9494
|
getRangeParagraph() {
|
|
8972
9495
|
const { startIndex: t, endIndex: e } = this.range;
|
|
8973
9496
|
if (!~t && !~e)
|
|
@@ -9003,7 +9526,14 @@ class Mc {
|
|
|
9003
9526
|
}
|
|
9004
9527
|
return r;
|
|
9005
9528
|
}
|
|
9006
|
-
|
|
9529
|
+
/**
|
|
9530
|
+
* 获取选区段落信息
|
|
9531
|
+
*
|
|
9532
|
+
* 返回段落内的所有元素及其起始位置索引,
|
|
9533
|
+
* 用于段落级别的格式操作。
|
|
9534
|
+
*
|
|
9535
|
+
* @returns 段落信息对象,包含元素列表和起始索引
|
|
9536
|
+
*/
|
|
9007
9537
|
getRangeParagraphInfo() {
|
|
9008
9538
|
const { startIndex: t, endIndex: e } = this.range;
|
|
9009
9539
|
if (!~t && !~e)
|
|
@@ -9022,19 +9552,48 @@ class Mc {
|
|
|
9022
9552
|
startIndex: n
|
|
9023
9553
|
} : null;
|
|
9024
9554
|
}
|
|
9025
|
-
|
|
9555
|
+
/**
|
|
9556
|
+
* 获取选区段落元素列表
|
|
9557
|
+
*
|
|
9558
|
+
* 便捷方法,直接返回段落内的所有元素。
|
|
9559
|
+
*
|
|
9560
|
+
* @returns 段落元素数组,如果没有则返回null
|
|
9561
|
+
*/
|
|
9026
9562
|
getRangeParagraphElementList() {
|
|
9027
9563
|
return this.getRangeParagraphInfo()?.elementList || null;
|
|
9028
9564
|
}
|
|
9029
|
-
|
|
9565
|
+
/**
|
|
9566
|
+
* 获取选区所在的表格元素
|
|
9567
|
+
*
|
|
9568
|
+
* 当光标在表格内时,返回对应的表格元素。
|
|
9569
|
+
*
|
|
9570
|
+
* @returns 表格元素,如果不在表格内则返回null
|
|
9571
|
+
*/
|
|
9030
9572
|
getRangeTableElement() {
|
|
9031
9573
|
const t = this.position.getPositionContext();
|
|
9032
9574
|
return t.isTable ? this.draw.getOriginalElementList()[t.index] : null;
|
|
9033
9575
|
}
|
|
9576
|
+
/**
|
|
9577
|
+
* 判断是否全选
|
|
9578
|
+
*
|
|
9579
|
+
* 检查当前选区是否覆盖了整个文档内容(非表格内)。
|
|
9580
|
+
*
|
|
9581
|
+
* @returns 如果是全选状态则返回true
|
|
9582
|
+
*/
|
|
9034
9583
|
getIsSelectAll() {
|
|
9035
9584
|
const t = this.draw.getElementList(), { startIndex: e, endIndex: n } = this.range;
|
|
9036
9585
|
return e === 0 && t.length - 1 === n && !this.position.getPositionContext().isTable;
|
|
9037
9586
|
}
|
|
9587
|
+
/**
|
|
9588
|
+
* 判断指定点是否在选区范围内
|
|
9589
|
+
*
|
|
9590
|
+
* 用于检测鼠标位置是否在当前选区内。
|
|
9591
|
+
*
|
|
9592
|
+
* @param x - X坐标
|
|
9593
|
+
* @param y - Y坐标
|
|
9594
|
+
* @param curPageNo - 当前页码
|
|
9595
|
+
* @returns 如果点在选区范围内则返回true
|
|
9596
|
+
*/
|
|
9038
9597
|
getIsPointInRange(t, e, n) {
|
|
9039
9598
|
const { startIndex: i, endIndex: r } = this.range, s = this.position.getPositionList();
|
|
9040
9599
|
for (let l = i + 1; l <= r && s[l]; l++) {
|
|
@@ -9048,6 +9607,14 @@ class Mc {
|
|
|
9048
9607
|
}
|
|
9049
9608
|
return !1;
|
|
9050
9609
|
}
|
|
9610
|
+
/**
|
|
9611
|
+
* 获取关键词的选区列表
|
|
9612
|
+
*
|
|
9613
|
+
* 在文档中搜索指定关键词,返回所有匹配位置的选区信息。
|
|
9614
|
+
*
|
|
9615
|
+
* @param payload - 要搜索的关键词
|
|
9616
|
+
* @returns 匹配的选区数组
|
|
9617
|
+
*/
|
|
9051
9618
|
getKeywordRangeList(t) {
|
|
9052
9619
|
const e = this.draw.getSearch().getMatchList(t, this.draw.getOriginalElementList()), n = /* @__PURE__ */ new Map();
|
|
9053
9620
|
for (const r of e) {
|
|
@@ -9067,6 +9634,14 @@ class Mc {
|
|
|
9067
9634
|
i.push(r);
|
|
9068
9635
|
}), i;
|
|
9069
9636
|
}
|
|
9637
|
+
/**
|
|
9638
|
+
* 判断当前位置是否可以输入
|
|
9639
|
+
*
|
|
9640
|
+
* 检查当前选区位置是否允许用户输入文本,
|
|
9641
|
+
* 会考虑控件(如日期选择器)的限制。
|
|
9642
|
+
*
|
|
9643
|
+
* @returns 如果可以输入则返回true
|
|
9644
|
+
*/
|
|
9070
9645
|
getIsCanInput() {
|
|
9071
9646
|
const { range: { startIndex: t, endIndex: e }, elementList: n } = this.getRangeElement(), i = n[t];
|
|
9072
9647
|
if (!i)
|
|
@@ -9076,6 +9651,21 @@ class Mc {
|
|
|
9076
9651
|
const r = n[e];
|
|
9077
9652
|
return r ? !i.controlId && !r.controlId || (!i.controlId || i.controlComponent === f.POSTFIX) && (!r.controlId || r.controlComponent === f.POSTFIX) || !!i.controlId && r.controlId === i.controlId && r.controlComponent !== f.PRE_TEXT && r.controlComponent !== f.POST_TEXT && r.controlComponent !== f.POSTFIX : !1;
|
|
9078
9653
|
}
|
|
9654
|
+
/**
|
|
9655
|
+
* 设置选区
|
|
9656
|
+
*
|
|
9657
|
+
* 设置新的选区范围,支持普通文本选区和表格单元格选区。
|
|
9658
|
+
* 当选区发生变化时,会重置默认样式并处理控件激活状态。
|
|
9659
|
+
*
|
|
9660
|
+
* @param startIndex - 起始索引
|
|
9661
|
+
* @param endIndex - 结束索引
|
|
9662
|
+
* @param tableId - 表格ID(可选)
|
|
9663
|
+
* @param startTdIndex - 起始单元格索引(可选)
|
|
9664
|
+
* @param endTdIndex - 结束单元格索引(可选)
|
|
9665
|
+
* @param startTrIndex - 起始行索引(可选)
|
|
9666
|
+
* @param endTrIndex - 结束行索引(可选)
|
|
9667
|
+
* @param splitTdRange - 跨页单元格选区信息(可选)
|
|
9668
|
+
*/
|
|
9079
9669
|
setRange(t, e, n, i, r, s, l, a) {
|
|
9080
9670
|
this.getIsRangeChange(t, e, n, i, r, s, l) && (this.range.startIndex = t, this.range.endIndex = e, this.range.tableId = n, this.range.startTdIndex = i, this.range.endTdIndex = r, this.range.startTrIndex = s, this.range.endTrIndex = l, this.range.isCrossRowCol = !!(i || r || s || l), this.range.splitTdRange = a, this.setDefaultStyle(null)), this.range.zone = this.draw.getZone().getZone();
|
|
9081
9671
|
const d = this.draw.getControl();
|
|
@@ -9085,9 +9675,22 @@ class Mc {
|
|
|
9085
9675
|
}
|
|
9086
9676
|
d.destroyControl();
|
|
9087
9677
|
}
|
|
9678
|
+
/**
|
|
9679
|
+
* 替换选区
|
|
9680
|
+
*
|
|
9681
|
+
* 使用新的选区对象完全替换当前选区。
|
|
9682
|
+
*
|
|
9683
|
+
* @param range - 新的选区对象
|
|
9684
|
+
*/
|
|
9088
9685
|
replaceRange(t) {
|
|
9089
9686
|
this.setRange(t.startIndex, t.endIndex, t.tableId, t.startTdIndex, t.endTdIndex, t.startTrIndex, t.endTrIndex);
|
|
9090
9687
|
}
|
|
9688
|
+
/**
|
|
9689
|
+
* 收缩选区
|
|
9690
|
+
*
|
|
9691
|
+
* 将选区收缩到结束位置(变成折叠状态)。
|
|
9692
|
+
* 用于在删除操作后将光标移动到正确位置。
|
|
9693
|
+
*/
|
|
9091
9694
|
shrinkRange() {
|
|
9092
9695
|
const { startIndex: t, endIndex: e } = this.range;
|
|
9093
9696
|
t === e || !~t && !~e || this.replaceRange({
|
|
@@ -9095,6 +9698,12 @@ class Mc {
|
|
|
9095
9698
|
startIndex: e
|
|
9096
9699
|
});
|
|
9097
9700
|
}
|
|
9701
|
+
/**
|
|
9702
|
+
* 设置并发射选区样式
|
|
9703
|
+
*
|
|
9704
|
+
* 根据当前选区计算样式信息,并通过监听器和事件总线通知外部。
|
|
9705
|
+
* 用于更新工具栏按钮状态等场景。
|
|
9706
|
+
*/
|
|
9098
9707
|
setRangeStyle() {
|
|
9099
9708
|
const t = this.listener.rangeStyleChange, e = this.eventBus.isSubscribe("rangeStyleChange");
|
|
9100
9709
|
if (!t && !e)
|
|
@@ -9139,6 +9748,12 @@ class Mc {
|
|
|
9139
9748
|
};
|
|
9140
9749
|
this._emitRangeStyle(M);
|
|
9141
9750
|
}
|
|
9751
|
+
/**
|
|
9752
|
+
* 恢复选区样式到默认值
|
|
9753
|
+
*
|
|
9754
|
+
* 将选区样式重置为编辑器默认值,
|
|
9755
|
+
* 用于清除选区或文档为空时的样式状态。
|
|
9756
|
+
*/
|
|
9142
9757
|
recoveryRangeStyle() {
|
|
9143
9758
|
const t = this.listener.rangeStyleChange, e = this.eventBus.isSubscribe("rangeStyleChange");
|
|
9144
9759
|
if (!t && !e)
|
|
@@ -9170,6 +9785,15 @@ class Mc {
|
|
|
9170
9785
|
};
|
|
9171
9786
|
this._emitRangeStyle(d);
|
|
9172
9787
|
}
|
|
9788
|
+
/**
|
|
9789
|
+
* 收缩选区边界
|
|
9790
|
+
*
|
|
9791
|
+
* 调整选区边界以处理控件元素的特殊情况。
|
|
9792
|
+
* 当选区落在控件的占位符、前缀等位置时,
|
|
9793
|
+
* 自动调整到合适的输入位置。
|
|
9794
|
+
*
|
|
9795
|
+
* @param context - 控件上下文,包含元素列表和选区信息
|
|
9796
|
+
*/
|
|
9173
9797
|
shrinkBoundary(t = {}) {
|
|
9174
9798
|
const { elementList: e, range: n } = this.getRangeElement(t), { startIndex: i, endIndex: r } = n;
|
|
9175
9799
|
if (!~i && !~r)
|
|
@@ -9242,13 +9866,40 @@ class Mc {
|
|
|
9242
9866
|
}
|
|
9243
9867
|
}
|
|
9244
9868
|
}
|
|
9869
|
+
/**
|
|
9870
|
+
* 渲染选区
|
|
9871
|
+
*
|
|
9872
|
+
* 在Canvas上绘制选区高亮矩形。
|
|
9873
|
+
*
|
|
9874
|
+
* @param ctx - Canvas 2D渲染上下文
|
|
9875
|
+
* @param x - 矩形左上角X坐标
|
|
9876
|
+
* @param y - 矩形左上角Y坐标
|
|
9877
|
+
* @param width - 矩形宽度
|
|
9878
|
+
* @param height - 矩形高度
|
|
9879
|
+
*/
|
|
9245
9880
|
render(t, e, n, i, r) {
|
|
9246
9881
|
t.save(), t.globalAlpha = this.options.rangeAlpha, t.fillStyle = this.options.rangeColor, t.fillRect(e, n, i, r), t.restore();
|
|
9247
9882
|
}
|
|
9883
|
+
/**
|
|
9884
|
+
* 将选区内容转换为字符串
|
|
9885
|
+
*
|
|
9886
|
+
* 提取选区内的文本内容,移除零宽字符。
|
|
9887
|
+
*
|
|
9888
|
+
* @returns 选区内的纯文本内容
|
|
9889
|
+
*/
|
|
9248
9890
|
toString() {
|
|
9249
9891
|
const t = this.getTextLikeSelection();
|
|
9250
9892
|
return t ? t.map((e) => e.value).join("").replace(new RegExp(A, "g"), "") : "";
|
|
9251
9893
|
}
|
|
9894
|
+
/**
|
|
9895
|
+
* 获取选区元素信息
|
|
9896
|
+
*
|
|
9897
|
+
* 根据上下文返回正确的元素列表和选区信息,
|
|
9898
|
+
* 支持跨页单元格选区的特殊处理。
|
|
9899
|
+
*
|
|
9900
|
+
* @param context - 控件上下文,可指定元素列表和选区
|
|
9901
|
+
* @returns 包含元素列表和选区信息的对象
|
|
9902
|
+
*/
|
|
9252
9903
|
getRangeElement(t = {}) {
|
|
9253
9904
|
const e = t.elementList || this.draw.getElementList(), n = t.range || this.getRange(), { splitTdRange: i } = n, r = {
|
|
9254
9905
|
elementList: e,
|
|
@@ -9850,7 +10501,7 @@ class Cn {
|
|
|
9850
10501
|
t.save(), t.fillStyle = s, t.font = `${i * n}px ${r}`;
|
|
9851
10502
|
let L = 0;
|
|
9852
10503
|
const O = this.draw.getMargins(), { width: S } = t.measureText(u);
|
|
9853
|
-
l ===
|
|
10504
|
+
l === Nt.CENTER ? L = (p - S) / 2 : l === Nt.RIGHT ? L = p - S - O[1] : L = O[3], t.fillText(u, L, I), t.restore();
|
|
9854
10505
|
}
|
|
9855
10506
|
}
|
|
9856
10507
|
class bc {
|
|
@@ -10563,7 +11214,7 @@ class yc {
|
|
|
10563
11214
|
}
|
|
10564
11215
|
if (e.type === "subTemplate") {
|
|
10565
11216
|
const a = e.label || "子模板";
|
|
10566
|
-
r === _.FORM ? e.subTemplateExpanded || this.
|
|
11217
|
+
r === _.FORM ? e.subTemplateExpanded || this._renderEditMode(t, e, n, i, a) : this._renderPlainText(t, e, n, i, a);
|
|
10567
11218
|
return;
|
|
10568
11219
|
}
|
|
10569
11220
|
const l = e.value || e.label || "";
|
|
@@ -10576,16 +11227,6 @@ class yc {
|
|
|
10576
11227
|
_renderPlainText(t, e, n, i, r) {
|
|
10577
11228
|
t.save(), t.font = e.style, t.fillStyle = e.color || "#000000", t.textBaseline = "alphabetic", t.fillText(r, n, i), t.restore();
|
|
10578
11229
|
}
|
|
10579
|
-
/**
|
|
10580
|
-
* 表单模式下渲染子模板标签
|
|
10581
|
-
* Render sub template tag in form mode
|
|
10582
|
-
*/
|
|
10583
|
-
_renderSubTemplateTag(t, e, n, i, r) {
|
|
10584
|
-
const { scale: s } = this.options, l = "#722ed1", a = "#f9f0ff";
|
|
10585
|
-
t.save(), t.font = e.style;
|
|
10586
|
-
const c = t.measureText(r), d = c.actualBoundingBoxAscent + c.actualBoundingBoxDescent, R = 8 * s, u = 4 * s, h = 4 * s, g = c.width + R * 2, p = d + u * 2, m = e.metrics, T = n, I = i - m.boundingBoxAscent + (m.boundingBoxAscent + m.boundingBoxDescent - p) / 2;
|
|
10587
|
-
t.fillStyle = a, this._drawRoundedRect(t, T, I, g, p, h), t.fill(), t.strokeStyle = l, t.lineWidth = 1 * s, t.setLineDash([4 * s, 2 * s]), this._drawRoundedRect(t, T, I, g, p, h), t.stroke(), t.fillStyle = l, t.textBaseline = "middle", t.fillText(r, n + R, I + p / 2), t.restore();
|
|
10588
|
-
}
|
|
10589
11230
|
/**
|
|
10590
11231
|
* 编辑模式下渲染宏元素
|
|
10591
11232
|
* Render macro element in edit mode
|
|
@@ -13674,44 +14315,44 @@ function Ho() {
|
|
|
13674
14315
|
var o = ei(this._milliseconds) / 1e3, t = ei(this._days), e = ei(this._months), n, i, r, s, l = this.asSeconds(), a, c, d, R;
|
|
13675
14316
|
return l ? (n = ge(o / 60), i = ge(n / 60), o %= 60, n %= 60, r = ge(e / 12), e %= 12, s = o ? o.toFixed(3).replace(/\.?0+$/, "") : "", a = l < 0 ? "-" : "", c = pn(this._months) !== pn(l) ? "-" : "", d = pn(this._days) !== pn(l) ? "-" : "", R = pn(this._milliseconds) !== pn(l) ? "-" : "", a + "P" + (r ? c + r + "Y" : "") + (e ? c + e + "M" : "") + (t ? d + t + "D" : "") + (i || n || o ? "T" : "") + (i ? R + i + "H" : "") + (n ? R + n + "M" : "") + (o ? R + s + "S" : "")) : "P0D";
|
|
13676
14317
|
}
|
|
13677
|
-
var
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
|
|
13704
|
-
|
|
13705
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
14318
|
+
var Ft = vo.prototype;
|
|
14319
|
+
Ft.isValid = wR;
|
|
14320
|
+
Ft.abs = Th;
|
|
14321
|
+
Ft.add = mh;
|
|
14322
|
+
Ft.subtract = Lh;
|
|
14323
|
+
Ft.as = Ph;
|
|
14324
|
+
Ft.asMilliseconds = el;
|
|
14325
|
+
Ft.asSeconds = Oh;
|
|
14326
|
+
Ft.asMinutes = Mh;
|
|
14327
|
+
Ft.asHours = Sh;
|
|
14328
|
+
Ft.asDays = Xh;
|
|
14329
|
+
Ft.asWeeks = Eh;
|
|
14330
|
+
Ft.asMonths = Nh;
|
|
14331
|
+
Ft.asQuarters = Fh;
|
|
14332
|
+
Ft.asYears = Ch;
|
|
14333
|
+
Ft.valueOf = Wh;
|
|
14334
|
+
Ft._bubble = Ih;
|
|
14335
|
+
Ft.clone = bh;
|
|
14336
|
+
Ft.get = xh;
|
|
14337
|
+
Ft.milliseconds = Vh;
|
|
14338
|
+
Ft.seconds = Yh;
|
|
14339
|
+
Ft.minutes = Dh;
|
|
14340
|
+
Ft.hours = Uh;
|
|
14341
|
+
Ft.days = yh;
|
|
14342
|
+
Ft.weeks = Qh;
|
|
14343
|
+
Ft.months = wh;
|
|
14344
|
+
Ft.years = Zh;
|
|
14345
|
+
Ft.humanize = Gh;
|
|
14346
|
+
Ft.toISOString = Ho;
|
|
14347
|
+
Ft.toString = Ho;
|
|
14348
|
+
Ft.toJSON = Ho;
|
|
14349
|
+
Ft.locale = Kr;
|
|
14350
|
+
Ft.localeData = _r;
|
|
14351
|
+
Ft.toIsoString = fe(
|
|
13711
14352
|
"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
|
|
13712
14353
|
Ho
|
|
13713
14354
|
);
|
|
13714
|
-
|
|
14355
|
+
Ft.lang = Hr;
|
|
13715
14356
|
dt("X", 0, 0, "unix");
|
|
13716
14357
|
dt("x", 0, 0, "valueOf");
|
|
13717
14358
|
rt("x", yo);
|
|
@@ -17203,7 +17844,7 @@ class Bh {
|
|
|
17203
17844
|
return;
|
|
17204
17845
|
const { scale: s } = this.options, l = n.control.minWidth * s;
|
|
17205
17846
|
let a = null;
|
|
17206
|
-
if (n.control?.minWidth && (n.control?.rowFlex ===
|
|
17847
|
+
if (n.control?.minWidth && (n.control?.rowFlex === Nt.CENTER || n.control?.rowFlex === Nt.RIGHT)) {
|
|
17207
17848
|
let d = n.metrics.width, R = e.elementList.length - 1;
|
|
17208
17849
|
for (; R >= 0; ) {
|
|
17209
17850
|
const u = e.elementList[R];
|
|
@@ -17213,7 +17854,7 @@ class Bh {
|
|
|
17213
17854
|
}
|
|
17214
17855
|
R--;
|
|
17215
17856
|
}
|
|
17216
|
-
a && d < l && (n.control.rowFlex ===
|
|
17857
|
+
a && d < l && (n.control.rowFlex === Nt.CENTER ? a.left = (l - d) / 2 : n.control.rowFlex === Nt.RIGHT && (a.left = l - d - n.metrics.width));
|
|
17217
17858
|
}
|
|
17218
17859
|
const c = l - i;
|
|
17219
17860
|
if (c > 0) {
|
|
@@ -20911,90 +21552,182 @@ function ys(o, t, e) {
|
|
|
20911
21552
|
}
|
|
20912
21553
|
}
|
|
20913
21554
|
class Qg {
|
|
21555
|
+
/** 编辑器容器元素 */
|
|
20914
21556
|
container;
|
|
21557
|
+
/** 页面容器元素 */
|
|
20915
21558
|
pageContainer;
|
|
21559
|
+
/** Canvas页面列表 */
|
|
20916
21560
|
pageList;
|
|
21561
|
+
/** Canvas 2D渲染上下文列表 */
|
|
20917
21562
|
ctxList;
|
|
21563
|
+
/** 当前页码(从0开始) */
|
|
20918
21564
|
pageNo;
|
|
21565
|
+
/** 渲染计数器 */
|
|
20919
21566
|
renderCount;
|
|
21567
|
+
/** 页面像素比(用于高清屏适配) */
|
|
20920
21568
|
pagePixelRatio;
|
|
21569
|
+
/** 编辑器模式 */
|
|
20921
21570
|
mode;
|
|
21571
|
+
/** 编辑器配置选项 */
|
|
20922
21572
|
options;
|
|
21573
|
+
/** 位置管理器 */
|
|
20923
21574
|
position;
|
|
21575
|
+
/** 区域管理器 */
|
|
20924
21576
|
zone;
|
|
21577
|
+
/** 当前元素列表 */
|
|
20925
21578
|
elementList;
|
|
21579
|
+
/** 事件监听器 */
|
|
20926
21580
|
listener;
|
|
21581
|
+
/** 事件总线 */
|
|
20927
21582
|
eventBus;
|
|
21583
|
+
/** 覆盖器(用于自定义行为) */
|
|
20928
21584
|
override;
|
|
21585
|
+
/** 国际化管理器 */
|
|
20929
21586
|
i18n;
|
|
21587
|
+
/** Canvas事件处理器 */
|
|
20930
21588
|
canvasEvent;
|
|
21589
|
+
/** 全局事件处理器 */
|
|
20931
21590
|
globalEvent;
|
|
21591
|
+
/** 光标管理器 */
|
|
20932
21592
|
cursor;
|
|
21593
|
+
/** 选区管理器 */
|
|
20933
21594
|
range;
|
|
21595
|
+
/** 页边距渲染器 */
|
|
20934
21596
|
margin;
|
|
21597
|
+
/** 背景渲染器 */
|
|
20935
21598
|
background;
|
|
21599
|
+
/** 徽章渲染器 */
|
|
20936
21600
|
badge;
|
|
21601
|
+
/** 搜索管理器 */
|
|
20937
21602
|
search;
|
|
21603
|
+
/** 分组管理器 */
|
|
20938
21604
|
group;
|
|
21605
|
+
/** 区域选择器 */
|
|
20939
21606
|
area;
|
|
21607
|
+
/** 下划线渲染器 */
|
|
20940
21608
|
underline;
|
|
21609
|
+
/** 删除线渲染器 */
|
|
20941
21610
|
strikeout;
|
|
21611
|
+
/** 高亮渲染器 */
|
|
20942
21612
|
highlight;
|
|
21613
|
+
/** 历史管理器(撤销/重做) */
|
|
20943
21614
|
historyManager;
|
|
21615
|
+
/** 预览器 */
|
|
20944
21616
|
previewer;
|
|
21617
|
+
/** 图片粒子渲染器 */
|
|
20945
21618
|
imageParticle;
|
|
21619
|
+
/** LaTeX公式渲染器 */
|
|
20946
21620
|
laTexParticle;
|
|
21621
|
+
/** 文本粒子渲染器 */
|
|
20947
21622
|
textParticle;
|
|
21623
|
+
/** 表格粒子渲染器 */
|
|
20948
21624
|
tableParticle;
|
|
21625
|
+
/** 表格工具 */
|
|
20949
21626
|
tableTool;
|
|
21627
|
+
/** 表格操作器 */
|
|
20950
21628
|
tableOperate;
|
|
21629
|
+
/** 页码渲染器 */
|
|
20951
21630
|
pageNumber;
|
|
21631
|
+
/** 行号渲染器 */
|
|
20952
21632
|
lineNumber;
|
|
21633
|
+
/** 水印渲染器 */
|
|
20953
21634
|
waterMark;
|
|
21635
|
+
/** 占位符渲染器 */
|
|
20954
21636
|
placeholder;
|
|
21637
|
+
/** 页眉渲染器 */
|
|
20955
21638
|
header;
|
|
21639
|
+
/** 页脚渲染器 */
|
|
20956
21640
|
footer;
|
|
21641
|
+
/** 超链接粒子渲染器 */
|
|
20957
21642
|
hyperlinkParticle;
|
|
21643
|
+
/** 标签粒子渲染器 */
|
|
20958
21644
|
labelParticle;
|
|
21645
|
+
/** 宏粒子渲染器 */
|
|
20959
21646
|
macroParticle;
|
|
21647
|
+
/** 日期粒子渲染器 */
|
|
20960
21648
|
dateParticle;
|
|
21649
|
+
/** 分隔符粒子渲染器 */
|
|
20961
21650
|
separatorParticle;
|
|
21651
|
+
/** 分页符粒子渲染器 */
|
|
20962
21652
|
pageBreakParticle;
|
|
21653
|
+
/** 上标粒子渲染器 */
|
|
20963
21654
|
superscriptParticle;
|
|
21655
|
+
/** 下标粒子渲染器 */
|
|
20964
21656
|
subscriptParticle;
|
|
21657
|
+
/** 复选框粒子渲染器 */
|
|
20965
21658
|
checkboxParticle;
|
|
21659
|
+
/** 单选框粒子渲染器 */
|
|
20966
21660
|
radioParticle;
|
|
21661
|
+
/** 月经史粒子渲染器 */
|
|
20967
21662
|
menstrualHistoryParticle;
|
|
21663
|
+
/** 胎心位置粒子渲染器 */
|
|
20968
21664
|
fetalHeartPositionParticle;
|
|
21665
|
+
/** 牙位粒子渲染器 */
|
|
20969
21666
|
toothPositionParticle;
|
|
21667
|
+
/** 块级元素渲染器 */
|
|
20970
21668
|
blockParticle;
|
|
21669
|
+
/** 列表粒子渲染器 */
|
|
20971
21670
|
listParticle;
|
|
21671
|
+
/** 换行符粒子渲染器 */
|
|
20972
21672
|
lineBreakParticle;
|
|
21673
|
+
/** 空白字符粒子渲染器 */
|
|
20973
21674
|
whiteSpaceParticle;
|
|
21675
|
+
/** 控件管理器 */
|
|
20974
21676
|
control;
|
|
21677
|
+
/** 页面边框渲染器 */
|
|
20975
21678
|
pageBorder;
|
|
21679
|
+
/** Web Worker管理器 */
|
|
20976
21680
|
workerManager;
|
|
21681
|
+
/** 滚动观察器 */
|
|
20977
21682
|
scrollObserver;
|
|
21683
|
+
/** 选区观察器 */
|
|
20978
21684
|
selectionObserver;
|
|
21685
|
+
/** 图片观察器 */
|
|
20979
21686
|
imageObserver;
|
|
21687
|
+
/** 涂鸦管理器 */
|
|
20980
21688
|
graffiti;
|
|
21689
|
+
/** 命令实例 */
|
|
20981
21690
|
command;
|
|
21691
|
+
/** 交互是否暂停 */
|
|
20982
21692
|
interactionPaused;
|
|
21693
|
+
/** 覆盖层激活计数 */
|
|
20983
21694
|
overlayActiveCount;
|
|
21695
|
+
/** 全局快捷键是否暂停 */
|
|
20984
21696
|
globalShortcutSuspended;
|
|
21697
|
+
/** 字母正则表达式 */
|
|
20985
21698
|
LETTER_REG;
|
|
21699
|
+
/** 单词正则表达式 */
|
|
20986
21700
|
WORD_LIKE_REG;
|
|
21701
|
+
/** 行列表 */
|
|
20987
21702
|
rowList;
|
|
21703
|
+
/** 按页分组的行列表 */
|
|
20988
21704
|
pageRowList;
|
|
21705
|
+
/** 格式刷样式 */
|
|
20989
21706
|
painterStyle;
|
|
21707
|
+
/** 格式刷选项 */
|
|
20990
21708
|
painterOptions;
|
|
21709
|
+
/** 可见页码列表 */
|
|
20991
21710
|
visiblePageNoList;
|
|
21711
|
+
/** 交叉观察的页码 */
|
|
20992
21712
|
intersectionPageNo;
|
|
21713
|
+
/** 懒渲染交叉观察器 */
|
|
20993
21714
|
lazyRenderIntersectionObserver;
|
|
21715
|
+
/** 打印模式数据 */
|
|
20994
21716
|
printModeData;
|
|
21717
|
+
/** 拆分单元格值缓存 */
|
|
20995
21718
|
splitTdValueMap = /* @__PURE__ */ new Map();
|
|
20996
|
-
|
|
21719
|
+
/** 单元格映射 */
|
|
20997
21720
|
tdMap = /* @__PURE__ */ new Map();
|
|
21721
|
+
/**
|
|
21722
|
+
* 创建Draw实例
|
|
21723
|
+
*
|
|
21724
|
+
* @param rootContainer - 根容器元素
|
|
21725
|
+
* @param options - 编辑器配置选项
|
|
21726
|
+
* @param data - 编辑器数据(包含header、main、footer)
|
|
21727
|
+
* @param listener - 事件监听器
|
|
21728
|
+
* @param eventBus - 事件总线
|
|
21729
|
+
* @param override - 覆盖器
|
|
21730
|
+
*/
|
|
20998
21731
|
constructor(t, e, n, i, r, s) {
|
|
20999
21732
|
this.container = this._wrapContainer(t), this.pageList = [], this.ctxList = [], this.pageNo = 0, this.renderCount = 0, this.pagePixelRatio = null, this.mode = e.mode, this.options = e, this.elementList = n.main, this.listener = i, this.eventBus = r, this.override = s, this._formatContainer(), this.pageContainer = this._createPageContainer(), this._createPage(0), this.i18n = new Og(e.locale), this.historyManager = new Pc(this), this.position = new Oc(this), this.zone = new Xg(this), this.range = new Mc(this), this.margin = new Ec(this), this.background = new Sc(this), this.badge = new yg(this), this.search = new Nc(this), this.group = new Fg(this), this.area = new Ug(this), this.underline = new Cc(this), this.strikeout = new Fc(this), this.highlight = new Xc(this), this.previewer = new lg(this), this.imageParticle = new Js(this), this.laTexParticle = new zs(this), this.textParticle = new Wc(this), this.tableParticle = new Vc(this), this.tableTool = new Yc(this), this.tableOperate = new Dg(this), this.pageNumber = new Cn(this), this.lineNumber = new bg(this), this.waterMark = new Hc(this), this.placeholder = new ll(this), this.header = new wc(this, n.header), this.footer = new Eg(this, n.footer), this.hyperlinkParticle = new Dc(this), this.labelParticle = new Uc(this), this.macroParticle = new yc(this), this.dateParticle = new ag(this), this.separatorParticle = new vc(this), this.pageBreakParticle = new Kc(this), this.superscriptParticle = new Zc(), this.subscriptParticle = new Qc(), this.checkboxParticle = new zh(this), this.radioParticle = new jh(this), this.menstrualHistoryParticle = new qh(this), this.fetalHeartPositionParticle = new tg(this), this.toothPositionParticle = new eg(this), this.blockParticle = new dg(this), this.listParticle = new Ng(this), this.lineBreakParticle = new jn(this), this.whiteSpaceParticle = new Cg(this), this.control = new Bh(this), this.pageBorder = new xg(this), this.graffiti = new wg(this, n.graffiti), this.scrollObserver = new bc(this), this.selectionObserver = new xc(this), this.imageObserver = new Mg(), new Wg(this), this.canvasEvent = new mc(this), this.cursor = new wa(this, this.canvasEvent), this.canvasEvent.register(), this.globalEvent = new Ic(this, this.canvasEvent), this.globalEvent.register(), this.workerManager = new rg(this), new Yg(this);
|
|
21000
21733
|
const { letterClass: l } = e;
|
|
@@ -21004,7 +21737,13 @@ class Qg {
|
|
|
21004
21737
|
isFirstRender: !0
|
|
21005
21738
|
});
|
|
21006
21739
|
}
|
|
21007
|
-
|
|
21740
|
+
/**
|
|
21741
|
+
* 设置打印数据
|
|
21742
|
+
*
|
|
21743
|
+
* 在打印模式下,保存原始数据并进行过滤处理:
|
|
21744
|
+
* - 过滤控件辅助元素
|
|
21745
|
+
* - 移除被删除的文字
|
|
21746
|
+
*/
|
|
21008
21747
|
setPrintData() {
|
|
21009
21748
|
this.printModeData = {
|
|
21010
21749
|
header: this.header.getElementList(),
|
|
@@ -21022,7 +21761,14 @@ class Qg {
|
|
|
21022
21761
|
const n = t, i = this.removeStrikeout(n);
|
|
21023
21762
|
t.main = i.main.filter((r) => !r.strikeout), this.setEditorData(i);
|
|
21024
21763
|
}
|
|
21025
|
-
|
|
21764
|
+
/**
|
|
21765
|
+
* 递归移除被删除的文字
|
|
21766
|
+
*
|
|
21767
|
+
* 深度遍历对象,过滤掉strikeout为true的元素。
|
|
21768
|
+
*
|
|
21769
|
+
* @param obj - 要处理的对象
|
|
21770
|
+
* @returns 处理后的对象
|
|
21771
|
+
*/
|
|
21026
21772
|
removeStrikeout(t) {
|
|
21027
21773
|
if (Array.isArray(t))
|
|
21028
21774
|
return t.map((e) => this.removeStrikeout(e)).filter((e) => !(e && typeof e == "object" && "strikeout" in e && e.strikeout === !0));
|
|
@@ -21034,16 +21780,38 @@ class Qg {
|
|
|
21034
21780
|
}
|
|
21035
21781
|
return t;
|
|
21036
21782
|
}
|
|
21037
|
-
|
|
21783
|
+
/**
|
|
21784
|
+
* 清除打印数据
|
|
21785
|
+
*
|
|
21786
|
+
* 还原打印前保存的原始数据。
|
|
21787
|
+
*/
|
|
21038
21788
|
clearPrintData() {
|
|
21039
21789
|
this.printModeData && (this.setEditorData(this.printModeData), this.printModeData = null);
|
|
21040
21790
|
}
|
|
21791
|
+
/**
|
|
21792
|
+
* 获取字母正则表达式
|
|
21793
|
+
* @returns 字母匹配的正则表达式
|
|
21794
|
+
*/
|
|
21041
21795
|
getLetterReg() {
|
|
21042
21796
|
return this.LETTER_REG;
|
|
21043
21797
|
}
|
|
21798
|
+
/**
|
|
21799
|
+
* 获取当前编辑器模式
|
|
21800
|
+
* @returns 当前编辑器模式
|
|
21801
|
+
*/
|
|
21044
21802
|
getMode() {
|
|
21045
21803
|
return this.mode;
|
|
21046
21804
|
}
|
|
21805
|
+
/**
|
|
21806
|
+
* 设置编辑器模式
|
|
21807
|
+
*
|
|
21808
|
+
* 切换编辑器模式时会自动处理:
|
|
21809
|
+
* - 控件元素的显示/隐藏
|
|
21810
|
+
* - 前后缀的显示状态
|
|
21811
|
+
* - 打印数据的设置/清除
|
|
21812
|
+
*
|
|
21813
|
+
* @param payload - 目标编辑器模式
|
|
21814
|
+
*/
|
|
21047
21815
|
setMode(t) {
|
|
21048
21816
|
if (this.mode === t)
|
|
21049
21817
|
return;
|
|
@@ -21091,7 +21859,15 @@ class Qg {
|
|
|
21091
21859
|
isSubmitHistory: !1
|
|
21092
21860
|
});
|
|
21093
21861
|
}
|
|
21094
|
-
|
|
21862
|
+
/**
|
|
21863
|
+
* 隐藏/显示TextField中的空白字符
|
|
21864
|
+
*
|
|
21865
|
+
* 在表单模式下隐藏纯空白字符,编辑模式下显示。
|
|
21866
|
+
*
|
|
21867
|
+
* @param elementList - 元素列表
|
|
21868
|
+
* @param hide - 是否隐藏空白字符
|
|
21869
|
+
* @private
|
|
21870
|
+
*/
|
|
21095
21871
|
hideTextFieldWhitespace(t, e) {
|
|
21096
21872
|
const n = (r) => r ? /^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(r) : !1;
|
|
21097
21873
|
((r) => {
|
|
@@ -21105,9 +21881,16 @@ class Qg {
|
|
|
21105
21881
|
}
|
|
21106
21882
|
})(t);
|
|
21107
21883
|
}
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21884
|
+
/**
|
|
21885
|
+
* 更新TextField占位符和前后缀的可见性
|
|
21886
|
+
*
|
|
21887
|
+
* 根据控件是否有值和当前模式,控制placeholder、prefix、postfix的显示状态。
|
|
21888
|
+
*
|
|
21889
|
+
* @param elementList - 元素列表
|
|
21890
|
+
* @param showPlaceholder - 是否显示placeholder
|
|
21891
|
+
* @param hidePrefixPostfix - 是否隐藏前后缀(有值时)
|
|
21892
|
+
* @private
|
|
21893
|
+
*/
|
|
21111
21894
|
updateTextFieldPlaceholderVisibility(t, e, n) {
|
|
21112
21895
|
const i = [
|
|
21113
21896
|
U.TEXT,
|
|
@@ -21208,50 +21991,119 @@ class Qg {
|
|
|
21208
21991
|
}
|
|
21209
21992
|
return n.slice(t + 1, e + 1).some((r) => r.title?.disabled || r.control?.disabled);
|
|
21210
21993
|
}
|
|
21994
|
+
/**
|
|
21995
|
+
* 判断是否为设计模式
|
|
21996
|
+
* @returns 如果是设计模式则返回true
|
|
21997
|
+
*/
|
|
21211
21998
|
isDesignMode() {
|
|
21212
21999
|
return this.mode === _.DESIGN;
|
|
21213
22000
|
}
|
|
22001
|
+
/**
|
|
22002
|
+
* 判断是否为打印模式
|
|
22003
|
+
* @returns 如果是打印模式则返回true
|
|
22004
|
+
*/
|
|
21214
22005
|
isPrintMode() {
|
|
21215
22006
|
return this.mode === _.PRINT;
|
|
21216
22007
|
}
|
|
22008
|
+
/**
|
|
22009
|
+
* 判断是否为涂鸦模式
|
|
22010
|
+
* @returns 如果是涂鸦模式则返回true
|
|
22011
|
+
*/
|
|
21217
22012
|
isGraffitiMode() {
|
|
21218
22013
|
return this.mode === _.GRAFFITI;
|
|
21219
22014
|
}
|
|
22015
|
+
/**
|
|
22016
|
+
* 获取原始纸张宽度(未缩放)
|
|
22017
|
+
* @returns 原始宽度值
|
|
22018
|
+
*/
|
|
21220
22019
|
getOriginalWidth() {
|
|
21221
22020
|
const { paperDirection: t, width: e, height: n } = this.options;
|
|
21222
22021
|
return t === We.VERTICAL ? e : n;
|
|
21223
22022
|
}
|
|
22023
|
+
/**
|
|
22024
|
+
* 获取原始纸张高度(未缩放)
|
|
22025
|
+
* @returns 原始高度值
|
|
22026
|
+
*/
|
|
21224
22027
|
getOriginalHeight() {
|
|
21225
22028
|
const { paperDirection: t, width: e, height: n } = this.options;
|
|
21226
22029
|
return t === We.VERTICAL ? n : e;
|
|
21227
22030
|
}
|
|
22031
|
+
/**
|
|
22032
|
+
* 获取缩放后的页面宽度
|
|
22033
|
+
* @returns 缩放后的宽度值
|
|
22034
|
+
*/
|
|
21228
22035
|
getWidth() {
|
|
21229
22036
|
return Math.floor(this.getOriginalWidth() * this.options.scale);
|
|
21230
22037
|
}
|
|
22038
|
+
/**
|
|
22039
|
+
* 获取缩放后的页面高度
|
|
22040
|
+
* @returns 缩放后的高度值
|
|
22041
|
+
*/
|
|
21231
22042
|
getHeight() {
|
|
21232
22043
|
return Math.floor(this.getOriginalHeight() * this.options.scale);
|
|
21233
22044
|
}
|
|
22045
|
+
/**
|
|
22046
|
+
* 获取主内容区域高度
|
|
22047
|
+
*
|
|
22048
|
+
* 主内容区域高度 = 页面高度 - 页眉页脚额外高度 - 页边距
|
|
22049
|
+
*
|
|
22050
|
+
* @returns 主内容区域高度
|
|
22051
|
+
*/
|
|
21234
22052
|
getMainHeight() {
|
|
21235
22053
|
return this.getHeight() - this.getMainOuterHeight();
|
|
21236
22054
|
}
|
|
22055
|
+
/**
|
|
22056
|
+
* 获取主内容区域外部高度
|
|
22057
|
+
*
|
|
22058
|
+
* 包括上下页边距和页眉页脚的额外高度。
|
|
22059
|
+
*
|
|
22060
|
+
* @returns 外部高度值
|
|
22061
|
+
*/
|
|
21237
22062
|
getMainOuterHeight() {
|
|
21238
22063
|
const t = this.getMargins(), e = this.header.getExtraHeight(), n = this.footer.getExtraHeight();
|
|
21239
22064
|
return t[0] + t[2] + e + n;
|
|
21240
22065
|
}
|
|
22066
|
+
/**
|
|
22067
|
+
* 获取Canvas宽度
|
|
22068
|
+
* @param pageNo - 页码,-1表示当前页
|
|
22069
|
+
* @returns Canvas宽度
|
|
22070
|
+
*/
|
|
21241
22071
|
getCanvasWidth(t = -1) {
|
|
21242
22072
|
return this.getPage(t).width;
|
|
21243
22073
|
}
|
|
22074
|
+
/**
|
|
22075
|
+
* 获取Canvas高度
|
|
22076
|
+
* @param pageNo - 页码,-1表示当前页
|
|
22077
|
+
* @returns Canvas高度
|
|
22078
|
+
*/
|
|
21244
22079
|
getCanvasHeight(t = -1) {
|
|
21245
22080
|
return this.getPage(t).height;
|
|
21246
22081
|
}
|
|
22082
|
+
/**
|
|
22083
|
+
* 获取内容区域宽度(减去左右页边距)
|
|
22084
|
+
* @returns 内容区域宽度
|
|
22085
|
+
*/
|
|
21247
22086
|
getInnerWidth() {
|
|
21248
22087
|
const t = this.getWidth(), e = this.getMargins();
|
|
21249
22088
|
return t - e[1] - e[3];
|
|
21250
22089
|
}
|
|
22090
|
+
/**
|
|
22091
|
+
* 获取原始内容区域宽度(未缩放)
|
|
22092
|
+
* @returns 原始内容区域宽度
|
|
22093
|
+
*/
|
|
21251
22094
|
getOriginalInnerWidth() {
|
|
21252
22095
|
const t = this.getOriginalWidth(), e = this.getOriginalMargins();
|
|
21253
22096
|
return t - e[1] - e[3];
|
|
21254
22097
|
}
|
|
22098
|
+
/**
|
|
22099
|
+
* 获取上下文内容宽度
|
|
22100
|
+
*
|
|
22101
|
+
* 根据当前位置上下文返回宽度:
|
|
22102
|
+
* - 表格内:返回单元格宽度减去内边距
|
|
22103
|
+
* - 非表格:返回原始内容区域宽度
|
|
22104
|
+
*
|
|
22105
|
+
* @returns 上下文内容宽度
|
|
22106
|
+
*/
|
|
21255
22107
|
getContextInnerWidth() {
|
|
21256
22108
|
const t = this.position.getPositionContext();
|
|
21257
22109
|
if (t.isTable) {
|
|
@@ -21260,184 +22112,460 @@ class Qg {
|
|
|
21260
22112
|
}
|
|
21261
22113
|
return this.getOriginalInnerWidth();
|
|
21262
22114
|
}
|
|
22115
|
+
/**
|
|
22116
|
+
* 获取缩放后的页边距
|
|
22117
|
+
* @returns 页边距数组 [上, 右, 下, 左]
|
|
22118
|
+
*/
|
|
21263
22119
|
getMargins() {
|
|
21264
22120
|
return this.getOriginalMargins().map((t) => t * this.options.scale);
|
|
21265
22121
|
}
|
|
22122
|
+
/**
|
|
22123
|
+
* 获取原始页边距(未缩放)
|
|
22124
|
+
* @returns 原始页边距数组 [上, 右, 下, 左]
|
|
22125
|
+
*/
|
|
21266
22126
|
getOriginalMargins() {
|
|
21267
22127
|
const { margins: t, paperDirection: e } = this.options;
|
|
21268
22128
|
return e === We.VERTICAL ? t : [t[1], t[2], t[3], t[0]];
|
|
21269
22129
|
}
|
|
22130
|
+
/**
|
|
22131
|
+
* 获取页面间距
|
|
22132
|
+
* @returns 缩放后的页面间距
|
|
22133
|
+
*/
|
|
21270
22134
|
getPageGap() {
|
|
21271
22135
|
return this.options.pageGap * this.options.scale;
|
|
21272
22136
|
}
|
|
22137
|
+
/**
|
|
22138
|
+
* 获取原始页面间距(未缩放)
|
|
22139
|
+
* @returns 原始页面间距
|
|
22140
|
+
*/
|
|
21273
22141
|
getOriginalPageGap() {
|
|
21274
22142
|
return this.options.pageGap;
|
|
21275
22143
|
}
|
|
22144
|
+
/**
|
|
22145
|
+
* 获取页码底部距离
|
|
22146
|
+
* @returns 缩放后的页码底部距离
|
|
22147
|
+
*/
|
|
21276
22148
|
getPageNumberBottom() {
|
|
21277
22149
|
const { pageNumber: { bottom: t }, scale: e } = this.options;
|
|
21278
22150
|
return t * e;
|
|
21279
22151
|
}
|
|
22152
|
+
/**
|
|
22153
|
+
* 获取页边距指示器大小
|
|
22154
|
+
* @returns 缩放后的指示器大小
|
|
22155
|
+
*/
|
|
21280
22156
|
getMarginIndicatorSize() {
|
|
21281
22157
|
return this.options.marginIndicatorSize * this.options.scale;
|
|
21282
22158
|
}
|
|
22159
|
+
/**
|
|
22160
|
+
* 获取默认基础行边距高度
|
|
22161
|
+
* @returns 缩放后的基础行边距高度
|
|
22162
|
+
*/
|
|
21283
22163
|
getDefaultBasicRowMarginHeight() {
|
|
21284
22164
|
return this.options.defaultBasicRowMarginHeight * this.options.scale;
|
|
21285
22165
|
}
|
|
22166
|
+
/**
|
|
22167
|
+
* 获取高亮边距高度
|
|
22168
|
+
* @returns 缩放后的高亮边距高度
|
|
22169
|
+
*/
|
|
21286
22170
|
getHighlightMarginHeight() {
|
|
21287
22171
|
return this.options.highlightMarginHeight * this.options.scale;
|
|
21288
22172
|
}
|
|
22173
|
+
/**
|
|
22174
|
+
* 获取表格单元格内边距
|
|
22175
|
+
* @param tableElement - 表格元素,可选
|
|
22176
|
+
* @returns 单元格内边距 [上, 右, 下, 左]
|
|
22177
|
+
*/
|
|
21289
22178
|
getTdPadding(t) {
|
|
21290
22179
|
const { table: { tdPadding: e }, scale: n } = this.options;
|
|
21291
22180
|
return (t?.tdPadding || e).map((r) => r * n);
|
|
21292
22181
|
}
|
|
22182
|
+
/**
|
|
22183
|
+
* 获取编辑器容器元素
|
|
22184
|
+
* @returns 容器元素
|
|
22185
|
+
*/
|
|
21293
22186
|
getContainer() {
|
|
21294
22187
|
return this.container;
|
|
21295
22188
|
}
|
|
22189
|
+
/**
|
|
22190
|
+
* 获取页面容器元素
|
|
22191
|
+
* @returns 页面容器元素
|
|
22192
|
+
*/
|
|
21296
22193
|
getPageContainer() {
|
|
21297
22194
|
return this.pageContainer;
|
|
21298
22195
|
}
|
|
22196
|
+
/**
|
|
22197
|
+
* 获取事件目标元素
|
|
22198
|
+
* @param target - 事件目标
|
|
22199
|
+
* @returns Element元素或null
|
|
22200
|
+
*/
|
|
21299
22201
|
getEventTarget(t) {
|
|
21300
22202
|
return t instanceof Element ? t : t instanceof Node ? t.parentElement : null;
|
|
21301
22203
|
}
|
|
22204
|
+
/**
|
|
22205
|
+
* 判断目标是否在编辑器内部
|
|
22206
|
+
* @param target - 事件目标
|
|
22207
|
+
* @returns 如果在编辑器内部则返回true
|
|
22208
|
+
*/
|
|
21302
22209
|
isTargetInsideEditor(t) {
|
|
21303
22210
|
const e = this.getEventTarget(t);
|
|
21304
22211
|
return e ? this.container.contains(e) ? !0 : !!Ks(e, (n) => !!n && n.nodeType === 1 && !!n.getAttribute(ke)) : !1;
|
|
21305
22212
|
}
|
|
22213
|
+
/**
|
|
22214
|
+
* 判断目标是否在外部覆盖层内
|
|
22215
|
+
* @param target - 事件目标
|
|
22216
|
+
* @returns 如果在外部覆盖层内则返回true
|
|
22217
|
+
*/
|
|
21306
22218
|
isTargetInsideExternalOverlay(t) {
|
|
21307
22219
|
const e = this.getEventTarget(t);
|
|
21308
22220
|
return !e || this.isTargetInsideEditor(e) ? !1 : !!e.closest(Zg);
|
|
21309
22221
|
}
|
|
22222
|
+
/**
|
|
22223
|
+
* 暂停交互
|
|
22224
|
+
*
|
|
22225
|
+
* 暂停用户交互,失焦代理输入框,重置副作用。
|
|
22226
|
+
*/
|
|
21310
22227
|
pauseInteraction() {
|
|
21311
22228
|
this.interactionPaused = !0, this.cursor?.getAgentDom().blur(), this.globalEvent?.resetSideEffect();
|
|
21312
22229
|
}
|
|
22230
|
+
/**
|
|
22231
|
+
* 恢复交互
|
|
22232
|
+
*
|
|
22233
|
+
* 恢复用户交互功能。
|
|
22234
|
+
*/
|
|
21313
22235
|
resumeInteraction() {
|
|
21314
22236
|
this.interactionPaused = !1;
|
|
21315
22237
|
}
|
|
22238
|
+
/**
|
|
22239
|
+
* 设置覆盖层激活状态
|
|
22240
|
+
*
|
|
22241
|
+
* 当外部覆盖层(如模态框)激活时调用。
|
|
22242
|
+
*
|
|
22243
|
+
* @param payload - 是否激活
|
|
22244
|
+
*/
|
|
21316
22245
|
setOverlayActive(t) {
|
|
21317
22246
|
this.overlayActiveCount = t ? 1 : 0, t && (this.cursor?.getAgentDom().blur(), this.globalEvent?.resetSideEffect());
|
|
21318
22247
|
}
|
|
22248
|
+
/**
|
|
22249
|
+
* 暂停/恢复全局快捷键
|
|
22250
|
+
* @param payload - true暂停,false恢复
|
|
22251
|
+
*/
|
|
21319
22252
|
suspendGlobalShortcut(t) {
|
|
21320
22253
|
this.globalShortcutSuspended = t;
|
|
21321
22254
|
}
|
|
22255
|
+
/**
|
|
22256
|
+
* 判断交互是否已暂停
|
|
22257
|
+
* @returns 如果交互已暂停则返回true
|
|
22258
|
+
*/
|
|
21322
22259
|
isInteractionSuspended() {
|
|
21323
22260
|
return this.interactionPaused || this.overlayActiveCount > 0;
|
|
21324
22261
|
}
|
|
22262
|
+
/**
|
|
22263
|
+
* 判断全局快捷键是否激活
|
|
22264
|
+
* @returns 如果全局快捷键激活则返回true
|
|
22265
|
+
*/
|
|
21325
22266
|
isGlobalShortcutActive() {
|
|
21326
22267
|
return !this.globalShortcutSuspended && !this.isInteractionSuspended();
|
|
21327
22268
|
}
|
|
22269
|
+
/**
|
|
22270
|
+
* 获取可见页码列表
|
|
22271
|
+
* @returns 可见页码数组
|
|
22272
|
+
*/
|
|
21328
22273
|
getVisiblePageNoList() {
|
|
21329
22274
|
return this.visiblePageNoList;
|
|
21330
22275
|
}
|
|
22276
|
+
/**
|
|
22277
|
+
* 设置可见页码列表
|
|
22278
|
+
*
|
|
22279
|
+
* 当滚动导致可见页面变化时调用,触发相应事件。
|
|
22280
|
+
*
|
|
22281
|
+
* @param payload - 新的可见页码数组
|
|
22282
|
+
*/
|
|
21331
22283
|
setVisiblePageNoList(t) {
|
|
21332
22284
|
this.visiblePageNoList = t, this.listener.visiblePageNoListChange && this.listener.visiblePageNoListChange(this.visiblePageNoList), this.eventBus.isSubscribe("visiblePageNoListChange") && this.eventBus.emit("visiblePageNoListChange", this.visiblePageNoList);
|
|
21333
22285
|
}
|
|
22286
|
+
/**
|
|
22287
|
+
* 获取交叉观察页码
|
|
22288
|
+
* @returns 当前交叉观察的页码
|
|
22289
|
+
*/
|
|
21334
22290
|
getIntersectionPageNo() {
|
|
21335
22291
|
return this.intersectionPageNo;
|
|
21336
22292
|
}
|
|
22293
|
+
/**
|
|
22294
|
+
* 设置交叉观察页码
|
|
22295
|
+
*
|
|
22296
|
+
* 当页面与视口交叉时调用,触发相应事件。
|
|
22297
|
+
*
|
|
22298
|
+
* @param payload - 交叉的页码
|
|
22299
|
+
*/
|
|
21337
22300
|
setIntersectionPageNo(t) {
|
|
21338
22301
|
this.intersectionPageNo = t, this.listener.intersectionPageNoChange && this.listener.intersectionPageNoChange(this.intersectionPageNo), this.eventBus.isSubscribe("intersectionPageNoChange") && this.eventBus.emit("intersectionPageNoChange", this.intersectionPageNo);
|
|
21339
22302
|
}
|
|
22303
|
+
/**
|
|
22304
|
+
* 获取当前页码
|
|
22305
|
+
* @returns 当前页码(从0开始)
|
|
22306
|
+
*/
|
|
21340
22307
|
getPageNo() {
|
|
21341
22308
|
return this.pageNo;
|
|
21342
22309
|
}
|
|
22310
|
+
/**
|
|
22311
|
+
* 设置当前页码
|
|
22312
|
+
* @param payload - 新的页码
|
|
22313
|
+
*/
|
|
21343
22314
|
setPageNo(t) {
|
|
21344
22315
|
this.pageNo = t;
|
|
21345
22316
|
}
|
|
22317
|
+
/**
|
|
22318
|
+
* 获取渲染次数
|
|
22319
|
+
* @returns 渲染次数计数
|
|
22320
|
+
*/
|
|
21346
22321
|
getRenderCount() {
|
|
21347
22322
|
return this.renderCount;
|
|
21348
22323
|
}
|
|
22324
|
+
/**
|
|
22325
|
+
* 获取Canvas页面元素
|
|
22326
|
+
* @param pageNo - 页码,-1表示当前页
|
|
22327
|
+
* @returns Canvas元素
|
|
22328
|
+
*/
|
|
21349
22329
|
getPage(t = -1) {
|
|
21350
22330
|
return this.pageList[~t ? t : this.pageNo];
|
|
21351
22331
|
}
|
|
22332
|
+
/**
|
|
22333
|
+
* 获取所有Canvas页面元素
|
|
22334
|
+
* @returns Canvas元素数组
|
|
22335
|
+
*/
|
|
21352
22336
|
getPageList() {
|
|
21353
22337
|
return this.pageList;
|
|
21354
22338
|
}
|
|
22339
|
+
/**
|
|
22340
|
+
* 获取页面总数
|
|
22341
|
+
* @returns 页面总数
|
|
22342
|
+
*/
|
|
21355
22343
|
getPageCount() {
|
|
21356
22344
|
return this.pageList.length;
|
|
21357
22345
|
}
|
|
22346
|
+
/**
|
|
22347
|
+
* 获取表格内的行列表
|
|
22348
|
+
* @param sourceElementList - 源元素列表
|
|
22349
|
+
* @returns 表格单元格内的行列表
|
|
22350
|
+
*/
|
|
21358
22351
|
getTableRowList(t) {
|
|
21359
22352
|
const e = this.position.getPositionContext(), { index: n, trIndex: i, tdIndex: r } = e;
|
|
21360
22353
|
return t[n].trList[i].tdList[r].rowList;
|
|
21361
22354
|
}
|
|
22355
|
+
/**
|
|
22356
|
+
* 获取原始行列表
|
|
22357
|
+
*
|
|
22358
|
+
* 根据当前活动区域返回对应的行列表:
|
|
22359
|
+
* - 页眉区域:返回页眉行列表
|
|
22360
|
+
* - 页脚区域:返回页脚行列表
|
|
22361
|
+
* - 主区域:返回主内容行列表
|
|
22362
|
+
*
|
|
22363
|
+
* @returns 行列表
|
|
22364
|
+
*/
|
|
21362
22365
|
getOriginalRowList() {
|
|
21363
22366
|
const t = this.getZone();
|
|
21364
22367
|
return t.isHeaderActive() ? this.header.getRowList() : t.isFooterActive() ? this.footer.getRowList() : this.rowList;
|
|
21365
22368
|
}
|
|
22369
|
+
/**
|
|
22370
|
+
* 获取当前行列表
|
|
22371
|
+
*
|
|
22372
|
+
* 根据当前位置上下文返回行列表:
|
|
22373
|
+
* - 表格内:返回表格单元格的行列表
|
|
22374
|
+
* - 非表格:返回原始行列表
|
|
22375
|
+
*
|
|
22376
|
+
* @returns 当前行列表
|
|
22377
|
+
*/
|
|
21366
22378
|
getRowList() {
|
|
21367
22379
|
return this.position.getPositionContext().isTable ? this.getTableRowList(this.getOriginalElementList()) : this.getOriginalRowList();
|
|
21368
22380
|
}
|
|
22381
|
+
/**
|
|
22382
|
+
* 获取按页分组的行列表
|
|
22383
|
+
* @returns 按页分组的行列表
|
|
22384
|
+
*/
|
|
21369
22385
|
getPageRowList() {
|
|
21370
22386
|
return this.pageRowList;
|
|
21371
22387
|
}
|
|
22388
|
+
/**
|
|
22389
|
+
* 获取当前页的Canvas渲染上下文
|
|
22390
|
+
* @returns Canvas 2D渲染上下文
|
|
22391
|
+
*/
|
|
21372
22392
|
getCtx() {
|
|
21373
22393
|
return this.ctxList[this.pageNo];
|
|
21374
22394
|
}
|
|
22395
|
+
/**
|
|
22396
|
+
* 获取编辑器配置选项
|
|
22397
|
+
* @returns 编辑器配置选项
|
|
22398
|
+
*/
|
|
21375
22399
|
getOptions() {
|
|
21376
22400
|
return this.options;
|
|
21377
22401
|
}
|
|
22402
|
+
/**
|
|
22403
|
+
* 获取搜索管理器
|
|
22404
|
+
* @returns 搜索管理器实例
|
|
22405
|
+
*/
|
|
21378
22406
|
getSearch() {
|
|
21379
22407
|
return this.search;
|
|
21380
22408
|
}
|
|
22409
|
+
/**
|
|
22410
|
+
* 获取分组管理器
|
|
22411
|
+
* @returns 分组管理器实例
|
|
22412
|
+
*/
|
|
21381
22413
|
getGroup() {
|
|
21382
22414
|
return this.group;
|
|
21383
22415
|
}
|
|
22416
|
+
/**
|
|
22417
|
+
* 获取区域选择器
|
|
22418
|
+
* @returns 区域选择器实例
|
|
22419
|
+
*/
|
|
21384
22420
|
getArea() {
|
|
21385
22421
|
return this.area;
|
|
21386
22422
|
}
|
|
22423
|
+
/**
|
|
22424
|
+
* 获取徽章渲染器
|
|
22425
|
+
* @returns 徽章渲染器实例
|
|
22426
|
+
*/
|
|
21387
22427
|
getBadge() {
|
|
21388
22428
|
return this.badge;
|
|
21389
22429
|
}
|
|
22430
|
+
/**
|
|
22431
|
+
* 获取历史管理器
|
|
22432
|
+
* @returns 历史管理器实例
|
|
22433
|
+
*/
|
|
21390
22434
|
getHistoryManager() {
|
|
21391
22435
|
return this.historyManager;
|
|
21392
22436
|
}
|
|
22437
|
+
/**
|
|
22438
|
+
* 获取位置管理器
|
|
22439
|
+
* @returns 位置管理器实例
|
|
22440
|
+
*/
|
|
21393
22441
|
getPosition() {
|
|
21394
22442
|
return this.position;
|
|
21395
22443
|
}
|
|
22444
|
+
/**
|
|
22445
|
+
* 获取区域管理器
|
|
22446
|
+
* @returns 区域管理器实例
|
|
22447
|
+
*/
|
|
21396
22448
|
getZone() {
|
|
21397
22449
|
return this.zone;
|
|
21398
22450
|
}
|
|
22451
|
+
/**
|
|
22452
|
+
* 获取选区管理器
|
|
22453
|
+
* @returns 选区管理器实例
|
|
22454
|
+
*/
|
|
21399
22455
|
getRange() {
|
|
21400
22456
|
return this.range;
|
|
21401
22457
|
}
|
|
22458
|
+
/**
|
|
22459
|
+
* 获取换行符粒子渲染器
|
|
22460
|
+
* @returns 换行符粒子渲染器实例
|
|
22461
|
+
*/
|
|
21402
22462
|
getLineBreakParticle() {
|
|
21403
22463
|
return this.lineBreakParticle;
|
|
21404
22464
|
}
|
|
22465
|
+
/**
|
|
22466
|
+
* 获取文本粒子渲染器
|
|
22467
|
+
* @returns 文本粒子渲染器实例
|
|
22468
|
+
*/
|
|
21405
22469
|
getTextParticle() {
|
|
21406
22470
|
return this.textParticle;
|
|
21407
22471
|
}
|
|
22472
|
+
/**
|
|
22473
|
+
* 获取页眉元素列表
|
|
22474
|
+
* @returns 页眉元素数组
|
|
22475
|
+
*/
|
|
21408
22476
|
getHeaderElementList() {
|
|
21409
22477
|
return this.header.getElementList();
|
|
21410
22478
|
}
|
|
22479
|
+
/**
|
|
22480
|
+
* 获取表格内的元素列表
|
|
22481
|
+
* @param sourceElementList - 源元素列表
|
|
22482
|
+
* @returns 表格单元格内的元素数组
|
|
22483
|
+
*/
|
|
21411
22484
|
getTableElementList(t) {
|
|
21412
22485
|
const e = this.position.getPositionContext(), { index: n, trIndex: i, tdIndex: r } = e;
|
|
21413
22486
|
return t[n]?.trList?.[i].tdList[r].value || [];
|
|
21414
22487
|
}
|
|
22488
|
+
/**
|
|
22489
|
+
* 获取当前元素列表
|
|
22490
|
+
*
|
|
22491
|
+
* 根据当前位置上下文返回元素列表:
|
|
22492
|
+
* - 表格内:返回表格单元格的元素列表
|
|
22493
|
+
* - 非表格:返回原始元素列表
|
|
22494
|
+
*
|
|
22495
|
+
* @returns 当前元素列表
|
|
22496
|
+
*/
|
|
21415
22497
|
getElementList() {
|
|
21416
22498
|
const t = this.position.getPositionContext(), e = this.getOriginalElementList();
|
|
21417
22499
|
return t.isTable ? this.getTableElementList(e) : e;
|
|
21418
22500
|
}
|
|
22501
|
+
/**
|
|
22502
|
+
* 获取主内容元素列表
|
|
22503
|
+
*
|
|
22504
|
+
* 根据当前位置上下文返回主内容元素列表:
|
|
22505
|
+
* - 表格内:返回表格单元格的元素列表
|
|
22506
|
+
* - 非表格:返回主内容元素列表
|
|
22507
|
+
*
|
|
22508
|
+
* @returns 主内容元素列表
|
|
22509
|
+
*/
|
|
21419
22510
|
getMainElementList() {
|
|
21420
22511
|
return this.position.getPositionContext().isTable ? this.getTableElementList(this.elementList) : this.elementList;
|
|
21421
22512
|
}
|
|
22513
|
+
/**
|
|
22514
|
+
* 获取原始元素列表
|
|
22515
|
+
*
|
|
22516
|
+
* 根据当前活动区域返回对应的元素列表:
|
|
22517
|
+
* - 页眉区域:返回页眉元素列表
|
|
22518
|
+
* - 页脚区域:返回页脚元素列表
|
|
22519
|
+
* - 主区域:返回主内容元素列表
|
|
22520
|
+
*
|
|
22521
|
+
* @returns 原始元素列表
|
|
22522
|
+
*/
|
|
21422
22523
|
getOriginalElementList() {
|
|
21423
22524
|
const t = this.getZone();
|
|
21424
22525
|
return t.isHeaderActive() ? this.getHeaderElementList() : t.isFooterActive() ? this.getFooterElementList() : this.elementList;
|
|
21425
22526
|
}
|
|
22527
|
+
/**
|
|
22528
|
+
* 获取原始主内容元素列表
|
|
22529
|
+
* @returns 主内容元素列表
|
|
22530
|
+
*/
|
|
21426
22531
|
getOriginalMainElementList() {
|
|
21427
22532
|
return this.elementList;
|
|
21428
22533
|
}
|
|
22534
|
+
/**
|
|
22535
|
+
* 获取页脚元素列表
|
|
22536
|
+
* @returns 页脚元素数组
|
|
22537
|
+
*/
|
|
21429
22538
|
getFooterElementList() {
|
|
21430
22539
|
return this.footer.getElementList();
|
|
21431
22540
|
}
|
|
22541
|
+
/**
|
|
22542
|
+
* 获取当前单元格
|
|
22543
|
+
*
|
|
22544
|
+
* 根据当前位置上下文返回表格单元格。
|
|
22545
|
+
*
|
|
22546
|
+
* @returns 单元格对象,如果不在表格内则返回null
|
|
22547
|
+
*/
|
|
21432
22548
|
getTd() {
|
|
21433
22549
|
const t = this.position.getPositionContext(), { index: e, trIndex: n, tdIndex: i, isTable: r } = t;
|
|
21434
22550
|
return r ? this.getOriginalElementList()[e].trList[n].tdList[i] : null;
|
|
21435
22551
|
}
|
|
22552
|
+
/**
|
|
22553
|
+
* 根据位置上下文获取单元格
|
|
22554
|
+
* @param positionContext - 位置上下文
|
|
22555
|
+
* @returns 单元格对象,如果不在表格内则返回null
|
|
22556
|
+
*/
|
|
21436
22557
|
getTdByPosition(t) {
|
|
21437
22558
|
const { index: e, trIndex: n, tdIndex: i, isTable: r } = t;
|
|
21438
22559
|
return r ? this.getOriginalElementList()[e].trList[n].tdList[i] : null;
|
|
21439
22560
|
}
|
|
21440
|
-
|
|
22561
|
+
/**
|
|
22562
|
+
* 插入文本域元素
|
|
22563
|
+
*
|
|
22564
|
+
* 在当前光标位置插入文本域元素列表。
|
|
22565
|
+
*
|
|
22566
|
+
* @param payload - 要插入的元素列表
|
|
22567
|
+
* @param options - 插入选项
|
|
22568
|
+
*/
|
|
21441
22569
|
insertElementTextField(t, e = {}) {
|
|
21442
22570
|
if (!t.length || !this.range.getIsCanInput())
|
|
21443
22571
|
return;
|
|
@@ -21464,7 +22592,15 @@ class Qg {
|
|
|
21464
22592
|
isSubmitHistory: s
|
|
21465
22593
|
}));
|
|
21466
22594
|
}
|
|
21467
|
-
|
|
22595
|
+
/**
|
|
22596
|
+
* 插入元素列表
|
|
22597
|
+
*
|
|
22598
|
+
* 在当前光标位置插入元素列表,支持在控件内插入。
|
|
22599
|
+
* 会自动处理控件激活、占位符移除、前后缀颜色重置等逻辑。
|
|
22600
|
+
*
|
|
22601
|
+
* @param payload - 要插入的元素列表
|
|
22602
|
+
* @param options - 插入选项
|
|
22603
|
+
*/
|
|
21468
22604
|
insertElementList(t, e = {}) {
|
|
21469
22605
|
if (!t.length || !this.range.getIsCanInput())
|
|
21470
22606
|
return;
|
|
@@ -21907,38 +23043,38 @@ class Qg {
|
|
|
21907
23043
|
boundingBoxDescent: 0
|
|
21908
23044
|
}, y = X.offsetX || M.listId && O.get(M.listId) || 0, w = e - y, v = X.elementList.length === 1;
|
|
21909
23045
|
if (W += v ? y : 0, C += v && X.offsetY || 0, (M.control?.type === U.TEXTFIELD || M.control?.type === U.TEXT) && !this.isDesignMode() && (M.controlComponent === f.PRETEXTFIX || M.controlComponent === f.PRETEXTFIX_TEXT || M.controlComponent === f.POSTTEXTFIX || M.controlComponent === f.POSTTEXTFIX_TEXT || M.controlComponent === f.TEXTFIXLABEL || M.controlComponent === f.PLACEHOLDER || M.controlComponent === f.PREFIX || M.controlComponent === f.POSTFIX)) {
|
|
21910
|
-
const
|
|
21911
|
-
|
|
23046
|
+
const H = M.control?.type === U.TEXTFIELD, K = M.controlId, Z = !!K && !!E?.has(K);
|
|
23047
|
+
H ? this.mode === _.EDIT ? M.hide = !1 : M.hide = !0 : this.mode === _.EDIT ? M.hide = !1 : this.mode === _.FORM ? M.controlComponent === f.PLACEHOLDER || M.controlComponent === f.TEXTFIXLABEL ? M.hide = Z : M.hide = !1 : M.hide = !0;
|
|
21912
23048
|
}
|
|
21913
23049
|
if ((M.hide || M.control?.hide || M.area?.hide) && !this.isDesignMode()) {
|
|
21914
|
-
const
|
|
21915
|
-
x.height =
|
|
23050
|
+
const H = X.elementList[X.elementList.length - 1];
|
|
23051
|
+
x.height = H?.metrics.height || this.options.defaultSize * u, x.boundingBoxAscent = H?.metrics.boundingBoxAscent || 0, x.boundingBoxDescent = H?.metrics.boundingBoxDescent || 0;
|
|
21916
23052
|
} else if (M.type === P.IMAGE || M.type === P.LATEX)
|
|
21917
23053
|
if (M.imgDisplay === ut.SURROUND || M.imgDisplay === ut.FLOAT_TOP || M.imgDisplay === ut.FLOAT_BOTTOM)
|
|
21918
23054
|
x.width = 0, x.height = 0, x.boundingBoxDescent = 0;
|
|
21919
23055
|
else {
|
|
21920
|
-
const
|
|
21921
|
-
if (
|
|
21922
|
-
const Z =
|
|
23056
|
+
const H = M.width * u, K = M.height * u;
|
|
23057
|
+
if (H > w) {
|
|
23058
|
+
const Z = K * w / H;
|
|
21923
23059
|
M.width = w / u, M.height = Z / u, x.width = w, x.height = Z, x.boundingBoxDescent = Z;
|
|
21924
23060
|
} else
|
|
21925
|
-
x.width =
|
|
23061
|
+
x.width = H, x.height = K, x.boundingBoxDescent = K;
|
|
21926
23062
|
if (M.imgCaption?.value) {
|
|
21927
23063
|
const Z = M.imgCaption.size || h.size, Q = M.imgCaption.top ?? h.top, z = (Z + Q) * u;
|
|
21928
23064
|
x.boundingBoxAscent += z;
|
|
21929
23065
|
}
|
|
21930
23066
|
}
|
|
21931
23067
|
else if (M.type === P.TABLE) {
|
|
21932
|
-
const
|
|
23068
|
+
const H = M.tdPadding || g;
|
|
21933
23069
|
if (M.pagingId) {
|
|
21934
23070
|
let k = N + 1, B = 0;
|
|
21935
23071
|
for (; k < n.length; ) {
|
|
21936
23072
|
const q = n[k];
|
|
21937
23073
|
if (q.pagingId === M.pagingId) {
|
|
21938
|
-
const j = q.trList.filter((
|
|
23074
|
+
const j = q.trList.filter((St) => !St.pagingRepeat).filter((St) => (St.tdList = St.tdList.filter((Yt) => {
|
|
21939
23075
|
if (Yt.originalId) {
|
|
21940
|
-
for (let
|
|
21941
|
-
const Ut = M.trList[
|
|
23076
|
+
for (let Xt = 0; Xt < M.trList.length; Xt++) {
|
|
23077
|
+
const Ut = M.trList[Xt], Qt = Ut.tdList.find(({ id: xt }) => xt === Yt.originalId);
|
|
21942
23078
|
if (Qt) {
|
|
21943
23079
|
Yt.value[0]?.type === P.SPLIT_TAG && Yt.value.splice(0, 1), Qt.value.push(
|
|
21944
23080
|
...Yt.value.map((xt) => this.updateElementTableInfo(xt, M, Ut, Qt))
|
|
@@ -21949,7 +23085,7 @@ class Qg {
|
|
|
21949
23085
|
return !1;
|
|
21950
23086
|
}
|
|
21951
23087
|
return !0;
|
|
21952
|
-
}), !
|
|
23088
|
+
}), !St.originalId));
|
|
21953
23089
|
M.trList.push(...j), M.height += q.height, k++, B++;
|
|
21954
23090
|
} else
|
|
21955
23091
|
break;
|
|
@@ -21957,7 +23093,7 @@ class Qg {
|
|
|
21957
23093
|
B && n.splice(N + 1, B);
|
|
21958
23094
|
}
|
|
21959
23095
|
M.pagingIndex = M.pagingIndex ?? 0, this.tableParticle.computeTrHeight(M, (k) => this.computeRowList({
|
|
21960
|
-
innerWidth: (k.width - (
|
|
23096
|
+
innerWidth: (k.width - (H[1] + H[3])) * u,
|
|
21961
23097
|
elementList: k.value,
|
|
21962
23098
|
isFromTable: !0,
|
|
21963
23099
|
isPagingMode: i
|
|
@@ -21966,26 +23102,26 @@ class Qg {
|
|
|
21966
23102
|
this.tdMap.set(B.id, B);
|
|
21967
23103
|
});
|
|
21968
23104
|
});
|
|
21969
|
-
const
|
|
21970
|
-
M.width = Z, M.height =
|
|
21971
|
-
const Q = Z * u, z =
|
|
23105
|
+
const K = this.tableParticle.getTableHeight(M), Z = this.tableParticle.getTableWidth(M);
|
|
23106
|
+
M.width = Z, M.height = K;
|
|
23107
|
+
const Q = Z * u, z = K * u;
|
|
21972
23108
|
if (x.width = Q, x.height = z, x.boundingBoxDescent = z, x.boundingBoxAscent = -b, n[N + 1]?.type === P.TABLE && (x.boundingBoxAscent -= b), i) {
|
|
21973
23109
|
const k = this.getHeight(), B = this.getMainOuterHeight();
|
|
21974
23110
|
let q = B;
|
|
21975
|
-
for (let
|
|
21976
|
-
const Ut = S[
|
|
21977
|
-
Ut.height + q + Qt > k || S[
|
|
23111
|
+
for (let Xt = 0; Xt < S.length; Xt++) {
|
|
23112
|
+
const Ut = S[Xt], Qt = Ut.offsetY || 0;
|
|
23113
|
+
Ut.height + q + Qt > k || S[Xt - 1]?.isPageBreak ? q = B + Ut.height + Qt : q += Ut.height + Qt;
|
|
21978
23114
|
}
|
|
21979
|
-
const j = b * 2,
|
|
21980
|
-
(q +
|
|
23115
|
+
const j = b * 2, St = M.trList[0].height * u;
|
|
23116
|
+
(q + St + j > k || M.pagingIndex !== 0 && M.trList[0].pagingRepeat || n[N - 1]?.type === P.PAGE_BREAK) && (q = B);
|
|
21981
23117
|
let Yt = k - (q + j);
|
|
21982
23118
|
if (z > Yt) {
|
|
21983
|
-
const
|
|
23119
|
+
const Xt = M.trList;
|
|
21984
23120
|
let Ut = 0, Qt = 0, xt = 0;
|
|
21985
|
-
for (let Pt = 0; Pt <
|
|
21986
|
-
const
|
|
23121
|
+
for (let Pt = 0; Pt < Xt.length; Pt++) {
|
|
23122
|
+
const Et = Xt[Pt], Jt = Et.height * u;
|
|
21987
23123
|
if (q + j + xt + Jt > k) {
|
|
21988
|
-
const At =
|
|
23124
|
+
const At = Et;
|
|
21989
23125
|
let ye = 0;
|
|
21990
23126
|
const ae = {
|
|
21991
23127
|
...gt(At),
|
|
@@ -21995,7 +23131,7 @@ class Qg {
|
|
|
21995
23131
|
tdList: M.colgroup.map((Ot, ue) => {
|
|
21996
23132
|
if (ye--, ye > 0)
|
|
21997
23133
|
return;
|
|
21998
|
-
const zt = At.tdList.find((we) => we.colIndex === ue), ie = zt ?? this.tableParticle.findPreRowSpanTd(
|
|
23134
|
+
const zt = At.tdList.find((we) => we.colIndex === ue), ie = zt ?? this.tableParticle.findPreRowSpanTd(Xt, Pt, ue);
|
|
21999
23135
|
zt && (ye = zt.colspan);
|
|
22000
23136
|
const rn = Rt();
|
|
22001
23137
|
return ie.originalRowspan = ie.rowspan, zt ? {
|
|
@@ -22023,7 +23159,7 @@ class Qg {
|
|
|
22023
23159
|
const zt = [];
|
|
22024
23160
|
let ie = Yt;
|
|
22025
23161
|
if (Ot.rowspan > 1) {
|
|
22026
|
-
const we =
|
|
23162
|
+
const we = Xt.slice(Ot.trIndex, Ot.trIndex + Pt - Ot.trIndex);
|
|
22027
23163
|
ie += we.reduce((al, cl) => cl.height * u + al, 0);
|
|
22028
23164
|
}
|
|
22029
23165
|
for (; Ot.mainHeight * u > ie && Ot.rowList?.length; ) {
|
|
@@ -22042,7 +23178,7 @@ class Qg {
|
|
|
22042
23178
|
value: A,
|
|
22043
23179
|
type: P.SPLIT_TAG
|
|
22044
23180
|
});
|
|
22045
|
-
}),
|
|
23181
|
+
}), Xt.splice(Ut + 1, 0, ae), Ut += 1, Qt = Xt.length - Ut, Me = !1), qt.forEach((Ot) => {
|
|
22046
23182
|
if (Ot.rowspan > 1) {
|
|
22047
23183
|
const ue = Ot.rowspan - (Pt - Ot.trIndex);
|
|
22048
23184
|
Ot.rowspan = Pt - Ot.trIndex + (_o ? 1 : 0);
|
|
@@ -22059,14 +23195,14 @@ class Qg {
|
|
|
22059
23195
|
break;
|
|
22060
23196
|
}
|
|
22061
23197
|
}
|
|
22062
|
-
Ut = Pt + 1, Qt =
|
|
23198
|
+
Ut = Pt + 1, Qt = Xt.length - Ut, xt += Jt, Yt -= Jt;
|
|
22063
23199
|
}
|
|
22064
23200
|
if (Qt) {
|
|
22065
|
-
const Pt =
|
|
22066
|
-
M.pagingId =
|
|
23201
|
+
const Pt = Xt.splice(Ut, Qt), Et = M.pagingId || Rt();
|
|
23202
|
+
M.pagingId = Et;
|
|
22067
23203
|
const Jt = gt(M);
|
|
22068
|
-
Jt.originalId = M.originalId ?? M.id, Jt.pagingId =
|
|
22069
|
-
const At =
|
|
23204
|
+
Jt.originalId = M.originalId ?? M.id, Jt.pagingId = Et, Jt.pagingIndex = M.pagingIndex + 1;
|
|
23205
|
+
const At = Xt.filter((Te) => Te.pagingRepeat);
|
|
22070
23206
|
if (At.length) {
|
|
22071
23207
|
const Te = gt(At);
|
|
22072
23208
|
Te.forEach((qt) => qt.id = Rt()), Pt.unshift(...Te);
|
|
@@ -22088,64 +23224,64 @@ class Qg {
|
|
|
22088
23224
|
}
|
|
22089
23225
|
}
|
|
22090
23226
|
if (M.pagingId) {
|
|
22091
|
-
const
|
|
22092
|
-
if (
|
|
23227
|
+
const Xt = this.position.getPositionContext();
|
|
23228
|
+
if (Xt.isTable) {
|
|
22093
23229
|
let Ut = -1, Qt = -1, xt = N;
|
|
22094
23230
|
for (; xt < n.length; ) {
|
|
22095
23231
|
const Pt = n[xt];
|
|
22096
23232
|
if (Pt.pagingId !== M.pagingId)
|
|
22097
23233
|
break;
|
|
22098
|
-
const
|
|
22099
|
-
if (~
|
|
22100
|
-
Ut = xt, Qt =
|
|
23234
|
+
const Et = Pt.trList.findIndex((Jt) => Jt.id === Xt.trId);
|
|
23235
|
+
if (~Et) {
|
|
23236
|
+
Ut = xt, Qt = Et;
|
|
22101
23237
|
break;
|
|
22102
23238
|
}
|
|
22103
23239
|
xt++;
|
|
22104
23240
|
}
|
|
22105
|
-
~Ut && (
|
|
23241
|
+
~Ut && (Xt.index = Ut, Xt.trIndex = Qt, this.position.setPositionContext(Xt));
|
|
22106
23242
|
}
|
|
22107
23243
|
}
|
|
22108
23244
|
}
|
|
22109
23245
|
this.initTableElementIndex(M, N);
|
|
22110
23246
|
} else if (M.type === P.SEPARATOR) {
|
|
22111
|
-
const { separator: { lineWidth:
|
|
22112
|
-
M.width = w / u, x.width = w, x.height =
|
|
23247
|
+
const { separator: { lineWidth: H } } = this.options, K = M.lineWidth || H;
|
|
23248
|
+
M.width = w / u, x.width = w, x.height = K * u, x.boundingBoxAscent = -b, x.boundingBoxDescent = -b + x.height;
|
|
22113
23249
|
} else if (M.type === P.PAGE_BREAK)
|
|
22114
23250
|
M.width = w / u, x.width = w, x.height = R;
|
|
22115
23251
|
else if (M.type === P.RADIO || M.controlComponent === f.RADIO) {
|
|
22116
|
-
const { width:
|
|
22117
|
-
M.width = Q, x.width = Q * u, x.height =
|
|
23252
|
+
const { width: H, height: K, gap: Z } = this.options.radio, Q = H + Z * 2;
|
|
23253
|
+
M.width = Q, x.width = Q * u, x.height = K * u;
|
|
22118
23254
|
} else if (M.type === P.CHECKBOX || M.controlComponent === f.CHECKBOX) {
|
|
22119
|
-
const { width:
|
|
22120
|
-
M.width = Q, x.width = Q * u, x.height =
|
|
23255
|
+
const { width: H, height: K, gap: Z } = this.options.checkbox, Q = H + Z * 2;
|
|
23256
|
+
M.width = Q, x.width = Q * u, x.height = K * u;
|
|
22121
23257
|
} else if (M.type === P.MENSTRUAL_HISTORY) {
|
|
22122
|
-
const
|
|
22123
|
-
M.width =
|
|
23258
|
+
const H = this.menstrualHistoryParticle.computeSize(M);
|
|
23259
|
+
M.width = H.width / u, x.width = H.width, x.height = H.height, x.boundingBoxAscent = H.height, x.boundingBoxDescent = 0;
|
|
22124
23260
|
} else if (M.type === P.FETAL_HEART_POSITION) {
|
|
22125
|
-
const
|
|
22126
|
-
M.width =
|
|
23261
|
+
const H = this.fetalHeartPositionParticle.computeSize(M);
|
|
23262
|
+
M.width = H.width / u, x.width = H.width, x.height = H.height, x.boundingBoxAscent = H.height / 2, x.boundingBoxDescent = H.height / 2;
|
|
22127
23263
|
} else if (M.type === P.TOOTH_POSITION) {
|
|
22128
|
-
const
|
|
22129
|
-
M.width =
|
|
23264
|
+
const H = this.toothPositionParticle.computeSize(M);
|
|
23265
|
+
M.width = H.width / u, x.width = H.width, x.height = H.height, x.boundingBoxAscent = H.height / 2, x.boundingBoxDescent = H.height / 2;
|
|
22130
23266
|
} else if (M.type === P.TAB)
|
|
22131
23267
|
x.width = m * u, x.height = R * u, x.boundingBoxDescent = 0, x.boundingBoxAscent = this.textParticle.getBasisWordBoundingBoxAscent(L, L.font);
|
|
22132
23268
|
else if (M.type === P.BLOCK) {
|
|
22133
23269
|
if (!M.width)
|
|
22134
23270
|
x.width = w;
|
|
22135
23271
|
else {
|
|
22136
|
-
const
|
|
22137
|
-
x.width = Math.min(
|
|
23272
|
+
const H = M.width * u;
|
|
23273
|
+
x.width = Math.min(H, w);
|
|
22138
23274
|
}
|
|
22139
23275
|
x.height = M.height * u, x.boundingBoxDescent = x.height, x.boundingBoxAscent = 0;
|
|
22140
23276
|
} else if (M.type === P.LABEL) {
|
|
22141
|
-
const { defaultSize:
|
|
23277
|
+
const { defaultSize: H, label: { defaultPadding: K } } = this.options;
|
|
22142
23278
|
L.font = this.getElementFont(M);
|
|
22143
23279
|
const Z = this.textParticle.measureText(L, M);
|
|
22144
|
-
x.width = (Z.width +
|
|
23280
|
+
x.width = (Z.width + K[1] + K[3]) * u, x.height = (M.size || H) * u, x.boundingBoxDescent = 0, x.boundingBoxAscent = (K[0] + Z.actualBoundingBoxAscent) * u;
|
|
22145
23281
|
} else if (M.type === P.MACRO || M.type === P.CUSTOM_MACRO || M.type === P.REUSABLE_ITEM || M.type === P.SUB_TEMPLATE) {
|
|
22146
|
-
const { defaultSize:
|
|
23282
|
+
const { defaultSize: H } = this.options;
|
|
22147
23283
|
L.font = this.getElementFont(M);
|
|
22148
|
-
const
|
|
23284
|
+
const K = this.getMode(), Z = K === _.EDIT, Q = K === _.FORM;
|
|
22149
23285
|
if (Z) {
|
|
22150
23286
|
const z = M.label || M.value || "";
|
|
22151
23287
|
L.font = this.getElementFont(M);
|
|
@@ -22153,51 +23289,53 @@ class Qg {
|
|
|
22153
23289
|
x.width = k.width + B * 2;
|
|
22154
23290
|
const j = k.actualBoundingBoxAscent + k.actualBoundingBoxDescent;
|
|
22155
23291
|
x.height = j + q * 2;
|
|
22156
|
-
const
|
|
22157
|
-
x.boundingBoxAscent =
|
|
23292
|
+
const St = this.textParticle.measureBasisWord(L, this.getElementFont(M));
|
|
23293
|
+
x.boundingBoxAscent = St.actualBoundingBoxAscent * u, x.boundingBoxDescent = St.actualBoundingBoxDescent * u;
|
|
22158
23294
|
} else if (M.type === P.CUSTOM_MACRO) {
|
|
22159
23295
|
const z = M.macroConfig, k = z?.value || "";
|
|
22160
23296
|
if (Q) {
|
|
22161
23297
|
const B = z?.type || "text", q = this.textParticle.measureText(L, M), j = M.label || "";
|
|
22162
23298
|
if (B === "select") {
|
|
22163
|
-
const
|
|
22164
|
-
x.width =
|
|
23299
|
+
const St = k || `请选择${j}`, Yt = L.measureText(St), Xt = L.measureText("[").width, Ut = 6 * u + 2 * u;
|
|
23300
|
+
x.width = Xt + Yt.width + Ut + Xt;
|
|
22165
23301
|
} else {
|
|
22166
|
-
const
|
|
22167
|
-
x.width =
|
|
23302
|
+
const St = k || `请输入${j}`, Yt = L.measureText(St), Xt = L.measureText("[").width;
|
|
23303
|
+
x.width = Xt + Yt.width + Xt;
|
|
22168
23304
|
}
|
|
22169
|
-
x.height = (M.size ||
|
|
23305
|
+
x.height = (M.size || H) * u, x.boundingBoxDescent = q.actualBoundingBoxDescent * u, x.boundingBoxAscent = q.actualBoundingBoxAscent * u;
|
|
22170
23306
|
} else {
|
|
22171
23307
|
const B = M.label || "", q = k || `请输入${B}`, j = L.measureText(q);
|
|
22172
|
-
x.width = j.width, x.height = (M.size ||
|
|
23308
|
+
x.width = j.width, x.height = (M.size || H) * u, x.boundingBoxDescent = j.actualBoundingBoxDescent, x.boundingBoxAscent = j.actualBoundingBoxAscent;
|
|
22173
23309
|
}
|
|
22174
23310
|
} else if (M.type === P.REUSABLE_ITEM) {
|
|
22175
23311
|
const k = M.reusableItemConfig?.value || "", B = M.label || "";
|
|
22176
23312
|
if (Q) {
|
|
22177
|
-
const q = this.textParticle.measureText(L, M), j = k || `获取 ${B}`,
|
|
22178
|
-
x.width = Yt +
|
|
23313
|
+
const q = this.textParticle.measureText(L, M), j = k || `获取 ${B}`, St = L.measureText(j), Yt = L.measureText("[").width;
|
|
23314
|
+
x.width = Yt + St.width + Yt, x.height = (M.size || H) * u, x.boundingBoxDescent = q.actualBoundingBoxDescent * u, x.boundingBoxAscent = q.actualBoundingBoxAscent * u;
|
|
22179
23315
|
} else {
|
|
22180
23316
|
const q = k || `获取 ${B}`, j = L.measureText(q);
|
|
22181
|
-
x.width = j.width, x.height = (M.size ||
|
|
23317
|
+
x.width = j.width, x.height = (M.size || H) * u, x.boundingBoxDescent = j.actualBoundingBoxDescent, x.boundingBoxAscent = j.actualBoundingBoxAscent;
|
|
22182
23318
|
}
|
|
22183
23319
|
} else if (M.type === P.SUB_TEMPLATE) {
|
|
22184
23320
|
const z = M.label || "子模板";
|
|
22185
23321
|
if (Q) {
|
|
22186
|
-
const k =
|
|
22187
|
-
x.width =
|
|
23322
|
+
const k = L.measureText(z), B = 8 * u, q = 4 * u, j = k.actualBoundingBoxAscent + k.actualBoundingBoxDescent;
|
|
23323
|
+
x.width = k.width + B * 2, x.height = j + q * 2;
|
|
23324
|
+
const St = this.textParticle.measureBasisWord(L, this.getElementFont(M));
|
|
23325
|
+
x.boundingBoxAscent = St.actualBoundingBoxAscent * u, x.boundingBoxDescent = St.actualBoundingBoxDescent * u;
|
|
22188
23326
|
} else {
|
|
22189
23327
|
const k = L.measureText(z);
|
|
22190
|
-
x.width = k.width, x.height = (M.size ||
|
|
23328
|
+
x.width = k.width, x.height = (M.size || H) * u, x.boundingBoxDescent = k.actualBoundingBoxDescent, x.boundingBoxAscent = k.actualBoundingBoxAscent;
|
|
22191
23329
|
}
|
|
22192
23330
|
} else {
|
|
22193
23331
|
const z = M.label || "", k = M.value || `获取 ${z}`, B = L.measureText(k);
|
|
22194
|
-
x.width = B.width, x.height = (M.size ||
|
|
23332
|
+
x.width = B.width, x.height = (M.size || H) * u, x.boundingBoxDescent = B.actualBoundingBoxDescent, x.boundingBoxAscent = B.actualBoundingBoxAscent;
|
|
22195
23333
|
}
|
|
22196
23334
|
} else {
|
|
22197
|
-
const
|
|
22198
|
-
(M.type === P.SUPERSCRIPT || M.type === P.SUBSCRIPT) && (M.actualSize = Math.ceil(
|
|
22199
|
-
const
|
|
22200
|
-
x.width =
|
|
23335
|
+
const H = M.size || R;
|
|
23336
|
+
(M.type === P.SUPERSCRIPT || M.type === P.SUBSCRIPT) && (M.actualSize = Math.ceil(H * 0.6)), x.height = (M.actualSize || H) * u, L.font = this.getElementFont(M);
|
|
23337
|
+
const K = this.textParticle.measureText(L, M);
|
|
23338
|
+
x.width = K.width * u, M.letterSpacing && (x.width += M.letterSpacing * u);
|
|
22201
23339
|
const Z = this.textParticle.measureBasisWord(L, M.font);
|
|
22202
23340
|
x.boundingBoxAscent = Z.actualBoundingBoxAscent * u, x.boundingBoxDescent = Z.actualBoundingBoxDescent * u, M.type === P.SUPERSCRIPT ? x.boundingBoxAscent += x.height / 2 : M.type === P.SUBSCRIPT && (x.boundingBoxDescent += x.height / 2);
|
|
22203
23341
|
}
|
|
@@ -22215,13 +23353,13 @@ class Qg {
|
|
|
22215
23353
|
const ct = n[N - 1];
|
|
22216
23354
|
let lt = n[N + 1], st = X.width + x.width;
|
|
22217
23355
|
if (this.options.wordBreak === Io.BREAK_WORD && (!ct?.type || ct?.type === P.TEXT) && (!M.type || M.type === P.TEXT)) {
|
|
22218
|
-
const
|
|
22219
|
-
if (this.WORD_LIKE_REG.test(
|
|
23356
|
+
const H = `${ct?.value || ""}${M.value}`;
|
|
23357
|
+
if (this.WORD_LIKE_REG.test(H)) {
|
|
22220
23358
|
const { width: Z, endElement: Q } = this.textParticle.measureWord(L, n, N), z = Z * u;
|
|
22221
23359
|
Q && z <= w ? (st += z, lt = Q) : ct && (st += z);
|
|
22222
23360
|
}
|
|
22223
|
-
const
|
|
22224
|
-
st +=
|
|
23361
|
+
const K = this.textParticle.measurePunctuationWidth(L, lt);
|
|
23362
|
+
st += K * u;
|
|
22225
23363
|
}
|
|
22226
23364
|
M.listId && (M.listId !== D ? F = 0 : M.value === A && !M.listWrap && F++), D = M.listId;
|
|
22227
23365
|
const it = this.position.setSurroundPosition({
|
|
@@ -22239,13 +23377,13 @@ class Qg {
|
|
|
22239
23377
|
});
|
|
22240
23378
|
W = it.x, st += it.rowIncreaseWidth, W += x.width;
|
|
22241
23379
|
let pt = !1;
|
|
22242
|
-
if (this.mode === _.FORM && M.control?.type === U.BUTTON && M.controlComponent === f.PREFIX && X.elementList.filter((
|
|
22243
|
-
const
|
|
22244
|
-
if (n.some((Z) => Z.controlId === `${
|
|
23380
|
+
if (this.mode === _.FORM && M.control?.type === U.BUTTON && M.controlComponent === f.PREFIX && X.elementList.filter((H) => H.controlId !== M.controlId).length > 0) {
|
|
23381
|
+
const H = M.controlId;
|
|
23382
|
+
if (n.some((Z) => Z.controlId === `${H}_text` && Z.control?.type === U.BUTTON)) {
|
|
22245
23383
|
let Z = 0;
|
|
22246
23384
|
for (let Q = N; Q < n.length; Q++) {
|
|
22247
23385
|
const z = n[Q];
|
|
22248
|
-
if (z.controlId !==
|
|
23386
|
+
if (z.controlId !== H)
|
|
22249
23387
|
break;
|
|
22250
23388
|
L.font = this.getElementFont(z);
|
|
22251
23389
|
const k = this.textParticle.measureText(L, z);
|
|
@@ -22254,7 +23392,7 @@ class Qg {
|
|
|
22254
23392
|
}
|
|
22255
23393
|
for (let Q = 0; Q < n.length; Q++) {
|
|
22256
23394
|
const z = n[Q];
|
|
22257
|
-
if (z.controlId === `${
|
|
23395
|
+
if (z.controlId === `${H}_text`) {
|
|
22258
23396
|
L.font = this.getElementFont(z);
|
|
22259
23397
|
const k = this.textParticle.measureText(L, z);
|
|
22260
23398
|
Z += k.width * u;
|
|
@@ -22265,7 +23403,7 @@ class Qg {
|
|
|
22265
23403
|
}
|
|
22266
23404
|
const ot = M.type === P.SEPARATOR || M.type === P.TABLE || ct?.type === P.TABLE || ct?.type === P.BLOCK || M.type === P.BLOCK || ct?.imgDisplay === ut.INLINE || M.imgDisplay === ut.INLINE || ct?.listId !== M.listId || ct?.areaId !== M.areaId && !M.area?.hide || M.control?.flexDirection === oi.COLUMN && (M.controlComponent === f.CHECKBOX || M.controlComponent === f.RADIO) && ct?.controlComponent === f.VALUE || N !== 0 && M.value === A && !M.area?.hide || pt, Lt = st > w, Tt = ot || Lt;
|
|
22267
23405
|
if (Tt) {
|
|
22268
|
-
const
|
|
23406
|
+
const H = {
|
|
22269
23407
|
width: x.width,
|
|
22270
23408
|
height: G,
|
|
22271
23409
|
startIndex: N,
|
|
@@ -22276,33 +23414,33 @@ class Qg {
|
|
|
22276
23414
|
isPageBreak: M.type === P.PAGE_BREAK
|
|
22277
23415
|
};
|
|
22278
23416
|
if (et.controlComponent !== f.PREFIX && et.control?.indentation === hi.VALUE_START) {
|
|
22279
|
-
const
|
|
22280
|
-
if (~
|
|
23417
|
+
const K = X.elementList.findIndex((Z) => Z.controlId === et.controlId && Z.controlComponent !== f.PREFIX);
|
|
23418
|
+
if (~K) {
|
|
22281
23419
|
const Q = this.position.computeRowPosition({
|
|
22282
23420
|
row: X,
|
|
22283
23421
|
innerWidth: this.getInnerWidth()
|
|
22284
|
-
})[
|
|
22285
|
-
Q && (
|
|
23422
|
+
})[K];
|
|
23423
|
+
Q && (H.offsetX = Q.coordinate.leftTop[0]);
|
|
22286
23424
|
}
|
|
22287
23425
|
}
|
|
22288
|
-
M.listId && (
|
|
23426
|
+
M.listId && (H.isList = !0, H.offsetX = O.get(M.listId), H.listIndex = F), H.offsetY = !r && M.area?.top && M.areaId !== n[N - 1]?.areaId ? M.area.top * u : 0, S.push(H);
|
|
22289
23427
|
} else
|
|
22290
23428
|
X.width += x.width, N === 0 && (Fn(n[1]) || n[1]?.areaId) ? (X.height = T, X.ascent = T) : X.height < G && (X.height = G, X.ascent = J), X.elementList.push(et);
|
|
22291
|
-
if ((Tt || N === n.length - 1) && (X.isWidthNotEnough = Lt && !ot, !X.isSurround && (ct?.rowFlex ===
|
|
22292
|
-
const
|
|
22293
|
-
for (let Z = 0; Z <
|
|
22294
|
-
const Q =
|
|
22295
|
-
Q.metrics.width +=
|
|
23429
|
+
if ((Tt || N === n.length - 1) && (X.isWidthNotEnough = Lt && !ot, !X.isSurround && (ct?.rowFlex === Nt.JUSTIFY || ct?.rowFlex === Nt.ALIGNMENT && X.isWidthNotEnough))) {
|
|
23430
|
+
const H = X.elementList[0]?.value === A ? X.elementList.slice(1) : X.elementList, K = (w - X.width) / (H.length - 1);
|
|
23431
|
+
for (let Z = 0; Z < H.length - 1; Z++) {
|
|
23432
|
+
const Q = H[Z];
|
|
23433
|
+
Q.metrics.width += K;
|
|
22296
23434
|
}
|
|
22297
23435
|
X.width = w;
|
|
22298
23436
|
}
|
|
22299
23437
|
if (Tt) {
|
|
22300
23438
|
W = s, C += X.height, i && !r && a && (C - l + c + G > a || M.type === P.PAGE_BREAK) && (C = l, Ca(d, Y), Y += 1), et.left = 0;
|
|
22301
|
-
const
|
|
23439
|
+
const H = S[S.length - 1];
|
|
22302
23440
|
W = this.position.setSurroundPosition({
|
|
22303
23441
|
pageNo: Y,
|
|
22304
23442
|
rowElement: et,
|
|
22305
|
-
row:
|
|
23443
|
+
row: H,
|
|
22306
23444
|
rowElementRect: {
|
|
22307
23445
|
x: W,
|
|
22308
23446
|
y: C,
|
|
@@ -22459,7 +23597,7 @@ class Qg {
|
|
|
22459
23597
|
index: D,
|
|
22460
23598
|
row: W,
|
|
22461
23599
|
element: F
|
|
22462
|
-
})) : F.type === P.TAB ? this.textParticle.complete() : F.rowFlex ===
|
|
23600
|
+
})) : F.type === P.TAB ? this.textParticle.complete() : F.rowFlex === Nt.ALIGNMENT || F.rowFlex === Nt.JUSTIFY ? (this.textParticle.record(t, F, X, M + N), this.textParticle.complete()) : F.type === P.BLOCK ? (this.textParticle.complete(), this.blockParticle.render(t, c, F, X, M + N)) : (F.left && this.textParticle.complete(), this.textParticle.record(t, F, X, M + N), (F.width || F.letterSpacing || fl.test(F.value)) && this.textParticle.complete());
|
|
22463
23601
|
if (g && !T && this.mode !== _.CLEAN && !W.isWidthNotEnough && D === W.elementList.length - 1 && this.lineBreakParticle.render(t, F, X, M + W.height / 2), m && Tl.test(F.value) && this.whiteSpaceParticle.render(t, F, X, M + W.height / 2), F.control?.border) {
|
|
22464
23602
|
b?.control?.border && b.controlId !== F.controlId && this.control.drawBorder(t);
|
|
22465
23603
|
const G = this.getElementRowMargin(F);
|
|
@@ -22598,6 +23736,23 @@ class Qg {
|
|
|
22598
23736
|
pageNo: n
|
|
22599
23737
|
});
|
|
22600
23738
|
}
|
|
23739
|
+
/**
|
|
23740
|
+
* 渲染编辑器
|
|
23741
|
+
*
|
|
23742
|
+
* 这是编辑器的核心渲染方法,执行以下操作:
|
|
23743
|
+
* 1. 计算文档结构(行列表、页面列表、位置列表)
|
|
23744
|
+
* 2. 创建/更新Canvas页面
|
|
23745
|
+
* 3. 绘制所有元素(文本、图片、表格等)
|
|
23746
|
+
* 4. 更新光标和选区状态
|
|
23747
|
+
* 5. 提交历史记录
|
|
23748
|
+
*
|
|
23749
|
+
* @param payload - 渲染选项
|
|
23750
|
+
* @param payload.isSubmitHistory - 是否提交到历史记录
|
|
23751
|
+
* @param payload.isSetCursor - 是否设置光标
|
|
23752
|
+
* @param payload.isCompute - 是否重新计算文档结构
|
|
23753
|
+
* @param payload.isLazy - 是否使用懒加载渲染
|
|
23754
|
+
* @param payload.curIndex - 当前光标索引
|
|
23755
|
+
*/
|
|
22601
23756
|
render(t) {
|
|
22602
23757
|
const e = vt(), n = [], i = (V, N) => {
|
|
22603
23758
|
n.push({
|
|
@@ -26290,28 +27445,28 @@ const zf = [
|
|
|
26290
27445
|
key: at.L,
|
|
26291
27446
|
mod: !0,
|
|
26292
27447
|
callback: (o) => {
|
|
26293
|
-
o.executeRowFlex(
|
|
27448
|
+
o.executeRowFlex(Nt.LEFT);
|
|
26294
27449
|
}
|
|
26295
27450
|
},
|
|
26296
27451
|
{
|
|
26297
27452
|
key: at.E,
|
|
26298
27453
|
mod: !0,
|
|
26299
27454
|
callback: (o) => {
|
|
26300
|
-
o.executeRowFlex(
|
|
27455
|
+
o.executeRowFlex(Nt.CENTER);
|
|
26301
27456
|
}
|
|
26302
27457
|
},
|
|
26303
27458
|
{
|
|
26304
27459
|
key: at.R,
|
|
26305
27460
|
mod: !0,
|
|
26306
27461
|
callback: (o) => {
|
|
26307
|
-
o.executeRowFlex(
|
|
27462
|
+
o.executeRowFlex(Nt.RIGHT);
|
|
26308
27463
|
}
|
|
26309
27464
|
},
|
|
26310
27465
|
{
|
|
26311
27466
|
key: at.J,
|
|
26312
27467
|
mod: !0,
|
|
26313
27468
|
callback: (o) => {
|
|
26314
|
-
o.executeRowFlex(
|
|
27469
|
+
o.executeRowFlex(Nt.ALIGNMENT);
|
|
26315
27470
|
}
|
|
26316
27471
|
},
|
|
26317
27472
|
{
|
|
@@ -26319,7 +27474,7 @@ const zf = [
|
|
|
26319
27474
|
mod: !0,
|
|
26320
27475
|
shift: !0,
|
|
26321
27476
|
callback: (o) => {
|
|
26322
|
-
o.executeRowFlex(
|
|
27477
|
+
o.executeRowFlex(Nt.JUSTIFY);
|
|
26323
27478
|
}
|
|
26324
27479
|
}
|
|
26325
27480
|
], jf = [
|
|
@@ -26486,15 +27641,31 @@ class op {
|
|
|
26486
27641
|
drop;
|
|
26487
27642
|
}
|
|
26488
27643
|
class ip {
|
|
27644
|
+
/** 命令执行器,提供所有编辑操作的接口 */
|
|
26489
27645
|
command;
|
|
27646
|
+
/** 编辑器版本号 */
|
|
26490
27647
|
version;
|
|
27648
|
+
/** 事件监听器,用于设置各种回调函数 */
|
|
26491
27649
|
listener;
|
|
27650
|
+
/** 事件总线,用于发布/订阅编辑器事件 */
|
|
26492
27651
|
eventBus;
|
|
27652
|
+
/** 覆盖器,用于自定义内部行为 */
|
|
26493
27653
|
override;
|
|
27654
|
+
/** 注册器,用于注册自定义菜单、快捷键等 */
|
|
26494
27655
|
register;
|
|
27656
|
+
/** 销毁编辑器的方法 */
|
|
26495
27657
|
destroy;
|
|
27658
|
+
/** 插件使用方法 */
|
|
26496
27659
|
use;
|
|
27660
|
+
/** 核心渲染引擎 */
|
|
26497
27661
|
draw;
|
|
27662
|
+
/**
|
|
27663
|
+
* 创建编辑器实例
|
|
27664
|
+
*
|
|
27665
|
+
* @param container - 编辑器容器元素
|
|
27666
|
+
* @param data - 编辑器数据,可以是元素数组或包含header/main/footer的对象
|
|
27667
|
+
* @param options - 编辑器配置选项
|
|
27668
|
+
*/
|
|
26498
27669
|
constructor(t, e, n = {}) {
|
|
26499
27670
|
const i = xi(n);
|
|
26500
27671
|
e = gt(e);
|
|
@@ -26527,18 +27698,43 @@ class ip {
|
|
|
26527
27698
|
const h = new ep(this);
|
|
26528
27699
|
this.use = h.use.bind(h);
|
|
26529
27700
|
}
|
|
27701
|
+
/**
|
|
27702
|
+
* 设置表单模式追踪选项
|
|
27703
|
+
* @param payload - 表单模式追踪配置
|
|
27704
|
+
*/
|
|
26530
27705
|
setFormModeTrace(t) {
|
|
26531
27706
|
this.command.executeSetFormModeTrace(t);
|
|
26532
27707
|
}
|
|
27708
|
+
/**
|
|
27709
|
+
* 暂停用户交互
|
|
27710
|
+
*
|
|
27711
|
+
* 调用后编辑器将不响应用户输入事件。
|
|
27712
|
+
*/
|
|
26533
27713
|
pauseInteraction() {
|
|
26534
27714
|
this.draw.pauseInteraction();
|
|
26535
27715
|
}
|
|
27716
|
+
/**
|
|
27717
|
+
* 恢复用户交互
|
|
27718
|
+
*
|
|
27719
|
+
* 恢复编辑器对用户输入事件的响应。
|
|
27720
|
+
*/
|
|
26536
27721
|
resumeInteraction() {
|
|
26537
27722
|
this.draw.resumeInteraction();
|
|
26538
27723
|
}
|
|
27724
|
+
/**
|
|
27725
|
+
* 设置覆盖层激活状态
|
|
27726
|
+
*
|
|
27727
|
+
* 当外部模态框、下拉菜单等覆盖层打开时调用。
|
|
27728
|
+
*
|
|
27729
|
+
* @param payload - 是否激活
|
|
27730
|
+
*/
|
|
26539
27731
|
setOverlayActive(t) {
|
|
26540
27732
|
this.draw.setOverlayActive(t);
|
|
26541
27733
|
}
|
|
27734
|
+
/**
|
|
27735
|
+
* 暂停/恢复全局快捷键
|
|
27736
|
+
* @param payload - true暂停,false恢复
|
|
27737
|
+
*/
|
|
26542
27738
|
suspendGlobalShortcut(t) {
|
|
26543
27739
|
this.draw.suspendGlobalShortcut(t);
|
|
26544
27740
|
}
|
|
@@ -26575,7 +27771,7 @@ export {
|
|
|
26575
27771
|
tn as PageMode,
|
|
26576
27772
|
We as PaperDirection,
|
|
26577
27773
|
Po as RenderMode,
|
|
26578
|
-
|
|
27774
|
+
Nt as RowFlex,
|
|
26579
27775
|
ne as TableBorder,
|
|
26580
27776
|
le as TdBorder,
|
|
26581
27777
|
Nn as TdSlash,
|