clickgo 3.7.0 → 3.8.0
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/README.md +13 -2
- package/dist/app/demo/config.json +9 -1
- package/dist/app/demo/form/control/arteditor/arteditor.js +65 -0
- package/dist/app/demo/form/control/arteditor/arteditor.xml +12 -0
- package/dist/app/demo/form/control/arteditor/img.js +51 -0
- package/dist/app/demo/form/control/arteditor/img.xml +6 -0
- package/dist/app/demo/form/control/iconview/iconview.js +5 -0
- package/dist/app/demo/form/control/iconview/iconview.xml +14 -13
- package/dist/app/demo/form/control/text/text.js +2 -0
- package/dist/app/demo/form/control/text/text.xml +8 -4
- package/dist/app/demo/form/control/tuieditor/tuieditor.js +39 -0
- package/dist/app/demo/form/control/tuieditor/tuieditor.xml +13 -0
- package/dist/app/demo/form/main.js +10 -0
- package/dist/app/demo/form/main.xml +2 -0
- package/dist/app/demo/form/method/core/core.js +5 -0
- package/dist/app/demo/form/method/core/core.xml +2 -1
- package/dist/app/demo/res/marker.svg +0 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/arteditor.cgc +0 -0
- package/dist/control/box.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/echarts.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/html.cgc +0 -0
- package/dist/control/iconview.cgc +0 -0
- package/dist/control/map.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/page.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/control/tuieditor.cgc +0 -0
- package/dist/control/xterm.cgc +0 -0
- package/dist/ext/toastui-editor-all.min.js +24 -0
- package/dist/global.css +1 -1
- package/dist/lib/control.js +5 -14
- package/dist/lib/control.ts +7 -10
- package/dist/lib/core.js +48 -8
- package/dist/lib/core.ts +48 -7
- package/dist/lib/dom.js +20 -2
- package/dist/lib/dom.ts +34 -11
- package/dist/lib/form.js +1 -7
- package/dist/lib/form.ts +5 -1
- package/dist/lib/fs.js +1 -1
- package/dist/lib/fs.ts +1 -1
- package/dist/lib/task.js +6 -0
- package/dist/lib/task.ts +9 -3
- package/dist/theme/byterun.cgt +0 -0
- package/dist/theme/familiar.cgt +0 -0
- package/dist/theme/light.cgt +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
package/dist/global.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
#cg-wrap{position:fixed;left:0;top:0;--g-padding:7px;--g-margin:2px;--g-radius:0;--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .35);--system-control-background:hsla(0, 0%, 100%, .03);--system-background-hover:hsla(0, 0%, 100%, .06);--system-background-active:hsla(0, 0%, 100%, .1);--system-border-color:hsla(0, 0%, 100%, .03);--system-border-color-hover:hsla(0, 0%, 100%, .06);--system-placeholder-color: hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-focusbox-border-color:var(--g-plain-border-color);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:absolute;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-gesture.ani{transition:all .1s ease-out;transition-property:left,top,transform}#cg-drag{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;pointer-events:none;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);opacity:0;display:flex;justify-content:center;align-items:center}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(50px) saturate(1.5);backdrop-filter:blur(50px) saturate(1.5);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .1s linear;transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;appearance:none;padding:15px;border:solid 1px rgba(0,0,0,0);background:var(--system-control-background);width:60%;border-radius:5px;color:var(--system-color);transition:all .1s ease-out}.cg-launcher-sinput::placeholder{color:var(--system-placeholder-color)}.cg-launcher-sinput::selection{background-color:var(--system-background-hover)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-border-color-hover)}.cg-launcher-foldername{-webkit-appearance:none;appearance:none;height:50px;font-size:28px !important;border:none;background:rgba(0,0,0,0);width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-background-hover)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .1s linear;transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .1s linear;transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .1s linear}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:absolute;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.1s ease-out;transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-notify{z-index:20020005}.cg-notify-wrap{background:var(--system-background);position:fixed;padding:15px;border-radius:5px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.1s ease-out;transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(50px) saturate(1.5);backdrop-filter:blur(50px) saturate(1.5)}.cg-notify-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-notify-icon.cg-primary{background:var(--success)}.cg-notify-icon.cg-info{background:var(--info)}.cg-notify-icon.cg-warning{background:var(--warning)}.cg-notify-icon.cg-danger{background:var(--danger)}.cg-notify-icon.cg-progress{background:var(--cg)}.cg-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-notify-content{line-height:1.5;word-break:break-word}.cg-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(50px) saturate(1.5);backdrop-filter:blur(50px) saturate(1.5);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .1s ease-out;overflow-x:auto;position:fixed}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}#cg-confirm{z-index:20020006;position:fixed;left:0;top:0;width:100%;height:100%;background:var(--system-background);-webkit-backdrop-filter:blur(150px) saturate(1.5);backdrop-filter:blur(150px) saturate(1.5);justify-content:center;align-items:center}#cg-confirm .cg-confirm-box{background:var(--system-background);width:60%;box-shadow:0 5px 20px rgba(0,0,0,.25);font-size:14px;border-radius:3px;overflow:hidden;color:var(--system-color)}#cg-confirm .cg-confirm-box #cg-confirm-content{padding:25px;line-height:1.5}#cg-confirm .cg-confirm-box .cg-confirm-controls{border-top:solid .5px var(--system-border-color);display:flex}#cg-confirm .cg-confirm-box .cg-confirm-controls>div{padding:20px;flex:1;text-align:center}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:last-child{border-left:solid .5px var(--system-border-color)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:hover{background:var(--system-background-hover)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:active{background:var(--system-background-active)}
|
|
1
|
+
#cg-wrap{position:fixed;left:0;top:0;--g-padding:7px;--g-margin:2px;--g-radius:0;--g-size:12px;--g-family:"Lucida Sans Unicode", "Helvetica Neue","Helvetica","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Noto Sans CJK","Source Han Sans","WenQuanYi Micro Hei","Microsoft YaHei",sans-serif;--g-line:1;--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .35);--system-control-background:hsla(0, 0%, 100%, .03);--system-background-hover:hsla(0, 0%, 100%, .06);--system-background-active:hsla(0, 0%, 100%, .1);--system-border-color:hsla(0, 0%, 100%, .03);--system-border-color-hover:hsla(0, 0%, 100%, .06);--system-placeholder-color: hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-focusbox-border-color:var(--g-plain-border-color);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%);--g-block-background:hsl(0, 0%, 85%);--g-block-background-hover:hsl(0, 0%, 75%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:absolute;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-gesture.ani{transition:all .15s ease;transition-property:left,top,transform}#cg-drag{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;pointer-events:none;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);opacity:0;display:flex;justify-content:center;align-items:center}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .1s linear;transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;appearance:none;padding:15px;border:solid 1px rgba(0,0,0,0);background:var(--system-control-background);width:60%;border-radius:5px;color:var(--system-color);transition:all .15s ease}.cg-launcher-sinput::placeholder{color:var(--system-placeholder-color)}.cg-launcher-sinput::selection{background-color:var(--system-background-hover)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-border-color-hover)}.cg-launcher-foldername{-webkit-appearance:none;appearance:none;height:50px;font-size:28px !important;border:none;background:rgba(0,0,0,0);width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-background-hover)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .1s linear;transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .1s linear;transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .1s linear}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:absolute;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.15s ease;transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-notify{z-index:20020005}.cg-notify-wrap{background:var(--system-background);position:fixed;padding:15px;border-radius:5px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.15s ease;transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5)}.cg-notify-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-notify-icon.cg-primary{background:var(--success)}.cg-notify-icon.cg-info{background:var(--info)}.cg-notify-icon.cg-warning{background:var(--warning)}.cg-notify-icon.cg-danger{background:var(--danger)}.cg-notify-icon.cg-progress{background:var(--cg)}.cg-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-notify-content{line-height:1.5;word-break:break-word}.cg-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .15s ease;overflow-x:auto;position:fixed}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}#cg-confirm{z-index:20020006;position:fixed;left:0;top:0;width:100%;height:100%;background:var(--system-background);-webkit-backdrop-filter:blur(150px) saturate(1.5);backdrop-filter:blur(150px) saturate(1.5);justify-content:center;align-items:center}#cg-confirm .cg-confirm-box{background:var(--system-background);width:60%;box-shadow:0 5px 20px rgba(0,0,0,.25);font-size:14px;border-radius:3px;overflow:hidden;color:var(--system-color)}#cg-confirm .cg-confirm-box #cg-confirm-content{padding:25px;line-height:1.5}#cg-confirm .cg-confirm-box .cg-confirm-controls{border-top:solid .5px var(--system-border-color);display:flex}#cg-confirm .cg-confirm-box .cg-confirm-controls>div{padding:20px;flex:1;text-align:center}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:last-child{border-left:solid .5px var(--system-border-color)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:hover{background:var(--system-background-hover)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:active{background:var(--system-background-active)}
|
package/dist/lib/control.js
CHANGED
|
@@ -59,7 +59,7 @@ class AbstractControl {
|
|
|
59
59
|
return 0;
|
|
60
60
|
}
|
|
61
61
|
get formFocus() {
|
|
62
|
-
return this.
|
|
62
|
+
return this.parentByName('root').formFocus;
|
|
63
63
|
}
|
|
64
64
|
get path() {
|
|
65
65
|
return '';
|
|
@@ -74,13 +74,13 @@ class AbstractControl {
|
|
|
74
74
|
return (key, data) => {
|
|
75
75
|
var _a, _b, _c, _d, _e, _f;
|
|
76
76
|
if (data) {
|
|
77
|
-
return (_c = (_b = (_a = data[this.locale]) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : data['en'][key]) !== null && _c !== void 0 ? _c : 'LocaleError';
|
|
77
|
+
return (_c = (_b = (_a = data[this.locale]) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : data['en'][key]) !== null && _c !== void 0 ? _c : '[LocaleError]' + key;
|
|
78
78
|
}
|
|
79
79
|
else if (this.localeData) {
|
|
80
|
-
return (_f = (_e = (_d = this.localeData[this.locale]) === null || _d === void 0 ? void 0 : _d[key]) !== null && _e !== void 0 ? _e : this.localeData['en'][key]) !== null && _f !== void 0 ? _f : 'LocaleError';
|
|
80
|
+
return (_f = (_e = (_d = this.localeData[this.locale]) === null || _d === void 0 ? void 0 : _d[key]) !== null && _e !== void 0 ? _e : this.localeData['en'][key]) !== null && _f !== void 0 ? _f : '[LocaleError]' + key;
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
return 'LocaleError';
|
|
83
|
+
return '[LocaleError]' + key;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -271,11 +271,7 @@ function init(taskId, invoke) {
|
|
|
271
271
|
t.controls[name] = {
|
|
272
272
|
'layout': '',
|
|
273
273
|
'files': item.files,
|
|
274
|
-
'props': {
|
|
275
|
-
'formFocus': {
|
|
276
|
-
'default': false
|
|
277
|
-
}
|
|
278
|
-
},
|
|
274
|
+
'props': {},
|
|
279
275
|
'data': {},
|
|
280
276
|
'access': {},
|
|
281
277
|
'methods': {},
|
|
@@ -300,11 +296,6 @@ function init(taskId, invoke) {
|
|
|
300
296
|
}
|
|
301
297
|
t.controls[name].layout = tool.layoutAddTagClassAndReTagName(t.controls[name].layout, false);
|
|
302
298
|
t.controls[name].layout = tool.layoutClassPrepend(t.controls[name].layout, prepList);
|
|
303
|
-
if (t.controls[name].layout.includes('<cg-')) {
|
|
304
|
-
t.controls[name].layout = tool.layoutInsertAttr(t.controls[name].layout, ':form-focus=\'formFocus\'', {
|
|
305
|
-
'include': [/^cg-.+/]
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
299
|
t.controls[name].layout = tool.eventsAttrWrap(t.controls[name].layout);
|
|
309
300
|
if (t.controls[name].layout.includes('<teleport')) {
|
|
310
301
|
t.controls[name].layout = tool.teleportGlue(t.controls[name].layout, '{{{formId}}}');
|
package/dist/lib/control.ts
CHANGED
|
@@ -53,8 +53,7 @@ export abstract class AbstractControl {
|
|
|
53
53
|
* --- 当前窗体是否有焦点 ---
|
|
54
54
|
*/
|
|
55
55
|
public get formFocus(): boolean {
|
|
56
|
-
|
|
57
|
-
return (this as any).props.formFocus;
|
|
56
|
+
return this.parentByName('root')!.formFocus;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
/** --- 当前控件所在运行窗体的包内路径不以 / 结尾 --- */
|
|
@@ -83,13 +82,13 @@ export abstract class AbstractControl {
|
|
|
83
82
|
) => string {
|
|
84
83
|
return (key: string, data?: Record<string, Record<string, string>>): string => {
|
|
85
84
|
if (data) {
|
|
86
|
-
return data[this.locale]?.[key] ?? data['en'][key] ?? 'LocaleError';
|
|
85
|
+
return data[this.locale]?.[key] ?? data['en'][key] ?? '[LocaleError]' + key;
|
|
87
86
|
}
|
|
88
87
|
else if ((this as any).localeData) {
|
|
89
|
-
return (this as any).localeData[this.locale]?.[key] ?? (this as any).localeData['en'][key] ?? 'LocaleError';
|
|
88
|
+
return (this as any).localeData[this.locale]?.[key] ?? (this as any).localeData['en'][key] ?? '[LocaleError]' + key;
|
|
90
89
|
}
|
|
91
90
|
else {
|
|
92
|
-
return 'LocaleError';
|
|
91
|
+
return '[LocaleError]' + key;
|
|
93
92
|
}
|
|
94
93
|
};
|
|
95
94
|
}
|
|
@@ -390,11 +389,7 @@ export async function init(
|
|
|
390
389
|
'layout': '',
|
|
391
390
|
|
|
392
391
|
'files': item.files,
|
|
393
|
-
'props': {
|
|
394
|
-
'formFocus': {
|
|
395
|
-
'default': false
|
|
396
|
-
}
|
|
397
|
-
},
|
|
392
|
+
'props': {},
|
|
398
393
|
'data': {},
|
|
399
394
|
'access': {},
|
|
400
395
|
'methods': {},
|
|
@@ -428,11 +423,13 @@ export async function init(
|
|
|
428
423
|
// --- 给 layout 的 class 增加前置 ---
|
|
429
424
|
t.controls[name].layout = tool.layoutClassPrepend(t.controls[name].layout, prepList);
|
|
430
425
|
// --- 给 cg 对象增加 :form-focus 传递 ---
|
|
426
|
+
/*
|
|
431
427
|
if (t.controls[name].layout.includes('<cg-')) {
|
|
432
428
|
t.controls[name].layout = tool.layoutInsertAttr(t.controls[name].layout, ':form-focus=\'formFocus\'', {
|
|
433
429
|
'include': [/^cg-.+/]
|
|
434
430
|
});
|
|
435
431
|
}
|
|
432
|
+
*/
|
|
436
433
|
// --- 给 event 增加包裹 ---
|
|
437
434
|
t.controls[name].layout = tool.eventsAttrWrap(t.controls[name].layout);
|
|
438
435
|
// --- 给 teleport 做处理 ---
|
package/dist/lib/core.js
CHANGED
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.back = exports.getLocation = exports.location = exports.getHash = exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
35
|
+
exports.back = exports.getLocation = exports.location = exports.getHost = exports.getHash = exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
36
36
|
const clickgo = __importStar(require("../clickgo"));
|
|
37
37
|
const fs = __importStar(require("./fs"));
|
|
38
38
|
const form = __importStar(require("./form"));
|
|
@@ -212,17 +212,17 @@ const modules = {
|
|
|
212
212
|
func: function () {
|
|
213
213
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
214
|
yield loader.loadScripts([
|
|
215
|
-
loader.cdn + '/npm/xterm@5.
|
|
216
|
-
loader.cdn + '/npm/xterm-addon-fit@0.
|
|
217
|
-
loader.cdn + '/npm/xterm-addon-webgl@0.
|
|
215
|
+
loader.cdn + '/npm/xterm@5.3.0/lib/xterm.js',
|
|
216
|
+
loader.cdn + '/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.js',
|
|
217
|
+
loader.cdn + '/npm/xterm-addon-webgl@0.16.0/lib/xterm-addon-webgl.js'
|
|
218
218
|
]);
|
|
219
|
-
yield loader.loadLinks([
|
|
220
|
-
loader.cdn + '/npm/xterm@5.1.0/css/xterm.min.css'
|
|
221
|
-
]);
|
|
222
|
-
loader.loadStyle('.xterm-viewport::-webkit-scrollbar{display:none;}');
|
|
223
219
|
if (!window.Terminal) {
|
|
224
220
|
throw Error('Xterm load failed.');
|
|
225
221
|
}
|
|
222
|
+
yield loader.loadLinks([
|
|
223
|
+
loader.cdn + '/npm/xterm@5.3.0/css/xterm.min.css'
|
|
224
|
+
]);
|
|
225
|
+
loader.loadStyle('.xterm-viewport::-webkit-scrollbar{display:none;}');
|
|
226
226
|
return [window.Terminal, window.FitAddon.FitAddon, window.WebglAddon.WebglAddon];
|
|
227
227
|
});
|
|
228
228
|
},
|
|
@@ -243,6 +243,38 @@ const modules = {
|
|
|
243
243
|
'obj': null,
|
|
244
244
|
'loading': false,
|
|
245
245
|
'resolve': []
|
|
246
|
+
},
|
|
247
|
+
'tuieditor': {
|
|
248
|
+
func: function () {
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
yield loader.loadScripts([
|
|
251
|
+
__dirname + '/../ext/toastui-editor-all.min.js'
|
|
252
|
+
]);
|
|
253
|
+
if (!window.toastui.Editor) {
|
|
254
|
+
throw Error('Tuieditor load failed.');
|
|
255
|
+
}
|
|
256
|
+
yield loader.loadScripts([
|
|
257
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/zh-cn.min.js',
|
|
258
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/zh-tw.min.js',
|
|
259
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/ja-jp.min.js',
|
|
260
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/ko-kr.min.js',
|
|
261
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/es-es.min.js',
|
|
262
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/de-de.min.js',
|
|
263
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/fr-fr.min.js',
|
|
264
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/pt-br.min.js',
|
|
265
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/ru-ru.min.js'
|
|
266
|
+
]);
|
|
267
|
+
yield loader.loadLinks([
|
|
268
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/toastui-editor.min.css',
|
|
269
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/theme/toastui-editor-dark.css'
|
|
270
|
+
]);
|
|
271
|
+
loader.loadStyle('.toastui-editor-defaultUI-toolbar,.ProseMirror{box-sizing:initial !important}.toastui-editor-main{background:var(--g-plain-background);border-radius:0 0 3px 3px}.ProseMirror{cursor:text}');
|
|
272
|
+
return window.toastui.Editor;
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
'obj': null,
|
|
276
|
+
'loading': false,
|
|
277
|
+
'resolve': []
|
|
246
278
|
}
|
|
247
279
|
};
|
|
248
280
|
function regModule(name, func) {
|
|
@@ -775,6 +807,14 @@ function getHash() {
|
|
|
775
807
|
return window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '';
|
|
776
808
|
}
|
|
777
809
|
exports.getHash = getHash;
|
|
810
|
+
function getHost() {
|
|
811
|
+
const match = /https?:\/\/([-a-zA-Z0-9:.]+)/.exec(window.location.href);
|
|
812
|
+
if (!match) {
|
|
813
|
+
return '';
|
|
814
|
+
}
|
|
815
|
+
return match[1];
|
|
816
|
+
}
|
|
817
|
+
exports.getHost = getHost;
|
|
778
818
|
function location(url, taskId) {
|
|
779
819
|
if (!taskId) {
|
|
780
820
|
return false;
|
package/dist/lib/core.ts
CHANGED
|
@@ -283,17 +283,17 @@ const modules: Record<string, {
|
|
|
283
283
|
'xterm': {
|
|
284
284
|
func: async function() {
|
|
285
285
|
await loader.loadScripts([
|
|
286
|
-
loader.cdn + '/npm/xterm@5.
|
|
287
|
-
loader.cdn + '/npm/xterm-addon-fit@0.
|
|
288
|
-
loader.cdn + '/npm/xterm-addon-webgl@0.
|
|
286
|
+
loader.cdn + '/npm/xterm@5.3.0/lib/xterm.js',
|
|
287
|
+
loader.cdn + '/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.js',
|
|
288
|
+
loader.cdn + '/npm/xterm-addon-webgl@0.16.0/lib/xterm-addon-webgl.js'
|
|
289
289
|
]);
|
|
290
|
-
await loader.loadLinks([
|
|
291
|
-
loader.cdn + '/npm/xterm@5.1.0/css/xterm.min.css'
|
|
292
|
-
]);
|
|
293
|
-
loader.loadStyle('.xterm-viewport::-webkit-scrollbar{display:none;}');
|
|
294
290
|
if (!(window as any).Terminal) {
|
|
295
291
|
throw Error('Xterm load failed.');
|
|
296
292
|
}
|
|
293
|
+
await loader.loadLinks([
|
|
294
|
+
loader.cdn + '/npm/xterm@5.3.0/css/xterm.min.css'
|
|
295
|
+
]);
|
|
296
|
+
loader.loadStyle('.xterm-viewport::-webkit-scrollbar{display:none;}');
|
|
297
297
|
return [(window as any).Terminal, (window as any).FitAddon.FitAddon, (window as any).WebglAddon.WebglAddon];
|
|
298
298
|
},
|
|
299
299
|
'obj': null,
|
|
@@ -311,6 +311,36 @@ const modules: Record<string, {
|
|
|
311
311
|
'obj': null,
|
|
312
312
|
'loading': false,
|
|
313
313
|
'resolve': []
|
|
314
|
+
},
|
|
315
|
+
'tuieditor': {
|
|
316
|
+
func: async function() {
|
|
317
|
+
await loader.loadScripts([
|
|
318
|
+
__dirname + '/../ext/toastui-editor-all.min.js'
|
|
319
|
+
]);
|
|
320
|
+
if (!(window as any).toastui.Editor) {
|
|
321
|
+
throw Error('Tuieditor load failed.');
|
|
322
|
+
}
|
|
323
|
+
await loader.loadScripts([
|
|
324
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/zh-cn.min.js',
|
|
325
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/zh-tw.min.js',
|
|
326
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/ja-jp.min.js',
|
|
327
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/ko-kr.min.js',
|
|
328
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/es-es.min.js',
|
|
329
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/de-de.min.js',
|
|
330
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/fr-fr.min.js',
|
|
331
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/pt-br.min.js',
|
|
332
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/i18n/ru-ru.min.js'
|
|
333
|
+
]);
|
|
334
|
+
await loader.loadLinks([
|
|
335
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/toastui-editor.min.css',
|
|
336
|
+
loader.cdn + '/npm/@toast-ui/editor@3.2.2/dist/theme/toastui-editor-dark.css'
|
|
337
|
+
]);
|
|
338
|
+
loader.loadStyle('.toastui-editor-defaultUI-toolbar,.ProseMirror{box-sizing:initial !important}.toastui-editor-main{background:var(--g-plain-background);border-radius:0 0 3px 3px}.ProseMirror{cursor:text}');
|
|
339
|
+
return (window as any).toastui.Editor;
|
|
340
|
+
},
|
|
341
|
+
'obj': null,
|
|
342
|
+
'loading': false,
|
|
343
|
+
'resolve': []
|
|
314
344
|
}
|
|
315
345
|
};
|
|
316
346
|
|
|
@@ -890,6 +920,17 @@ export function getHash(): string {
|
|
|
890
920
|
return window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '';
|
|
891
921
|
}
|
|
892
922
|
|
|
923
|
+
/**
|
|
924
|
+
* --- 获取当前浏览器的 host ---
|
|
925
|
+
*/
|
|
926
|
+
export function getHost(): string {
|
|
927
|
+
const match = /https?:\/\/([-a-zA-Z0-9:.]+)/.exec(window.location.href);
|
|
928
|
+
if (!match) {
|
|
929
|
+
return '';
|
|
930
|
+
}
|
|
931
|
+
return match[1];
|
|
932
|
+
}
|
|
933
|
+
|
|
893
934
|
/**
|
|
894
935
|
* --- 对浏览器做跳转操作 ---
|
|
895
936
|
* @param url 要跳转的新 URL
|
package/dist/lib/dom.js
CHANGED
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.fullscreen = exports.siblingsData = exports.siblings = exports.findParentByClass = exports.findParentByData = exports.bindResize = exports.bindMove = exports.is = exports.bindDrag = exports.setDragData = exports.bindLong = exports.allowEvent = exports.bindGesture = exports.bindDown = exports.bindDblClick = exports.bindClick = exports.getWatchInfo = exports.clearWatchProperty = exports.isWatchProperty = exports.watchProperty = exports.clearWatchStyle = exports.isWatchStyle = exports.watchStyle = exports.clearWatch = exports.isWatch = exports.unwatch = exports.watch = exports.getWatchCount = exports.clearWatchSize = exports.isWatchSize = exports.unwatchSize = exports.watchSize = exports.getWatchSizeCount = exports.getStyleCount = exports.removeStyle = exports.pushStyle = exports.removeFromStyleList = exports.createToStyleList = exports.hasTouchButMouse = exports.setGlobalCursor = exports.inPage = void 0;
|
|
35
|
+
exports.fullscreen = exports.siblingsData = exports.siblings = exports.findParentByTag = exports.findParentByClass = exports.findParentByData = exports.bindResize = exports.bindMove = exports.is = exports.bindDrag = exports.setDragData = exports.bindLong = exports.allowEvent = exports.bindGesture = exports.bindDown = exports.bindDblClick = exports.bindClick = exports.getWatchInfo = exports.clearWatchProperty = exports.isWatchProperty = exports.watchProperty = exports.clearWatchStyle = exports.isWatchStyle = exports.watchStyle = exports.clearWatch = exports.isWatch = exports.unwatch = exports.watch = exports.getWatchCount = exports.clearWatchSize = exports.isWatchSize = exports.unwatchSize = exports.watchSize = exports.getWatchSizeCount = exports.getStyleCount = exports.removeStyle = exports.pushStyle = exports.removeFromStyleList = exports.createToStyleList = exports.hasTouchButMouse = exports.setGlobalCursor = exports.inPage = void 0;
|
|
36
36
|
const clickgo = __importStar(require("../clickgo"));
|
|
37
37
|
const form = __importStar(require("./form"));
|
|
38
38
|
const core = __importStar(require("./core"));
|
|
@@ -58,7 +58,7 @@ ${topClass.slice(0, 3).join(', ')} {left: 0; top: 0; width: 0; height: 0; positi
|
|
|
58
58
|
${classUnfold('img')} {vertical-align: bottom;}
|
|
59
59
|
${classUnfold('::selection', ['#cg-launcher'])} {background-color: rgba(0, 0, 0, .1);}
|
|
60
60
|
${classUnfold('*')}, ${classUnfold('*::after')}, ${classUnfold('*::before')} {box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); flex-shrink: 0;}
|
|
61
|
-
${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-family:
|
|
61
|
+
${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-family: var(--g-family); font-size: var(--g-size); line-height: var(--g-line); -webkit-font-smoothing: antialiased;}
|
|
62
62
|
</style>`);
|
|
63
63
|
function inPage(el) {
|
|
64
64
|
return document.body.contains(el);
|
|
@@ -1795,6 +1795,24 @@ function findParentByClass(el, name) {
|
|
|
1795
1795
|
return null;
|
|
1796
1796
|
}
|
|
1797
1797
|
exports.findParentByClass = findParentByClass;
|
|
1798
|
+
function findParentByTag(el, name) {
|
|
1799
|
+
let parent = el.parentNode;
|
|
1800
|
+
while (parent) {
|
|
1801
|
+
if (!parent.tagName) {
|
|
1802
|
+
continue;
|
|
1803
|
+
}
|
|
1804
|
+
const tag = parent.tagName.toLowerCase();
|
|
1805
|
+
if (tag === 'body') {
|
|
1806
|
+
break;
|
|
1807
|
+
}
|
|
1808
|
+
if (tag === name) {
|
|
1809
|
+
return parent;
|
|
1810
|
+
}
|
|
1811
|
+
parent = parent.parentNode;
|
|
1812
|
+
}
|
|
1813
|
+
return null;
|
|
1814
|
+
}
|
|
1815
|
+
exports.findParentByTag = findParentByTag;
|
|
1798
1816
|
function siblings(el) {
|
|
1799
1817
|
if (!el.parentNode) {
|
|
1800
1818
|
return [];
|
package/dist/lib/dom.ts
CHANGED
|
@@ -42,7 +42,7 @@ ${topClass.slice(0, 3).join(', ')} {left: 0; top: 0; width: 0; height: 0; positi
|
|
|
42
42
|
${classUnfold('img')} {vertical-align: bottom;}
|
|
43
43
|
${classUnfold('::selection', ['#cg-launcher'])} {background-color: rgba(0, 0, 0, .1);}
|
|
44
44
|
${classUnfold('*')}, ${classUnfold('*::after')}, ${classUnfold('*::before')} {box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); flex-shrink: 0;}
|
|
45
|
-
${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-family:
|
|
45
|
+
${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-family: var(--g-family); font-size: var(--g-size); line-height: var(--g-line); -webkit-font-smoothing: antialiased;}
|
|
46
46
|
</style>`);
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -543,7 +543,7 @@ interface IWatchStyleItem {
|
|
|
543
543
|
'sd': CSSStyleDeclaration;
|
|
544
544
|
'names': Record<string, {
|
|
545
545
|
'val': string;
|
|
546
|
-
'cb': Array<(name: string, value: string, old: string) => void
|
|
546
|
+
'cb': Array<(name: string, value: string, old: string) => void | Promise<void>>;
|
|
547
547
|
}>;
|
|
548
548
|
}
|
|
549
549
|
|
|
@@ -574,7 +574,7 @@ let watchStyleIndex: number = 0;
|
|
|
574
574
|
export function watchStyle(
|
|
575
575
|
el: HTMLElement,
|
|
576
576
|
name: string | string[],
|
|
577
|
-
cb: (name: string, value: string, old: string) => void
|
|
577
|
+
cb: (name: string, value: string, old: string) => void | Promise<void>,
|
|
578
578
|
immediate: boolean = false
|
|
579
579
|
): void {
|
|
580
580
|
if (typeof name === 'string') {
|
|
@@ -605,7 +605,7 @@ export function watchStyle(
|
|
|
605
605
|
item.names[n].cb.push(cb);
|
|
606
606
|
}
|
|
607
607
|
if (immediate) {
|
|
608
|
-
cb(n, (item.sd as any)[n], '');
|
|
608
|
+
cb(n, (item.sd as any)[n], '') as any;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
return;
|
|
@@ -631,7 +631,7 @@ export function watchStyle(
|
|
|
631
631
|
'cb': [cb]
|
|
632
632
|
};
|
|
633
633
|
if (immediate) {
|
|
634
|
-
cb(n, (item.sd as any)[n], '');
|
|
634
|
+
cb(n, (item.sd as any)[n], '') as any;
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
el.dataset.cgStyleindex = watchStyleIndex.toString();
|
|
@@ -681,7 +681,7 @@ interface IWatchPropertyItem {
|
|
|
681
681
|
'el': HTMLElement;
|
|
682
682
|
'names': Record<string, {
|
|
683
683
|
'val': string;
|
|
684
|
-
'cb': Array<(name: string, value: string) => void
|
|
684
|
+
'cb': Array<(name: string, value: string) => void | Promise<void>>;
|
|
685
685
|
}>;
|
|
686
686
|
}
|
|
687
687
|
|
|
@@ -715,7 +715,7 @@ let watchPropertyIndex: number = 0;
|
|
|
715
715
|
export function watchProperty(
|
|
716
716
|
el: HTMLElement,
|
|
717
717
|
name: string | string[],
|
|
718
|
-
cb: (name: string, value: string) => void
|
|
718
|
+
cb: (name: string, value: string) => void | Promise<void>,
|
|
719
719
|
immediate: boolean = false
|
|
720
720
|
): void {
|
|
721
721
|
if (typeof name === 'string') {
|
|
@@ -746,7 +746,7 @@ export function watchProperty(
|
|
|
746
746
|
item.names[n].cb.push(cb);
|
|
747
747
|
}
|
|
748
748
|
if (immediate) {
|
|
749
|
-
cb(n, (item.el as any)[n]);
|
|
749
|
+
cb(n, (item.el as any)[n]) as any;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
return;
|
|
@@ -770,7 +770,7 @@ export function watchProperty(
|
|
|
770
770
|
'cb': [cb]
|
|
771
771
|
};
|
|
772
772
|
if (immediate) {
|
|
773
|
-
cb(n, (item.el as any)[n]);
|
|
773
|
+
cb(n, (item.el as any)[n]) as any;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
el.dataset.cgPropertyindex = watchPropertyIndex.toString();
|
|
@@ -926,7 +926,7 @@ const watchTimerHandler = function(): void {
|
|
|
926
926
|
const old = item.names[name].val;
|
|
927
927
|
item.names[name].val = (item.sd as any)[name];
|
|
928
928
|
for (const cb of item.names[name].cb) {
|
|
929
|
-
cb(name, (item.sd as any)[name], old);
|
|
929
|
+
cb(name, (item.sd as any)[name], old) as any;
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
};
|
|
@@ -965,7 +965,7 @@ const watchTimerHandler = function(): void {
|
|
|
965
965
|
}
|
|
966
966
|
item.names[name].val = (item.el as any)[name];
|
|
967
967
|
for (const cb of item.names[name].cb) {
|
|
968
|
-
cb(name, (item.el as any)[name]);
|
|
968
|
+
cb(name, (item.el as any)[name]) as any;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
};
|
|
@@ -2246,6 +2246,29 @@ export function findParentByClass(el: HTMLElement, name: string): HTMLElement |
|
|
|
2246
2246
|
return null;
|
|
2247
2247
|
}
|
|
2248
2248
|
|
|
2249
|
+
/**
|
|
2250
|
+
* --- 通过 tagname 查找上层所有标签是否存在 ---
|
|
2251
|
+
* @param el 当前标签
|
|
2252
|
+
* @param name 要查找的 tagname 名,小写,如 table
|
|
2253
|
+
*/
|
|
2254
|
+
export function findParentByTag(el: HTMLElement, name: string): HTMLElement | null {
|
|
2255
|
+
let parent = el.parentNode as HTMLElement;
|
|
2256
|
+
while (parent) {
|
|
2257
|
+
if (!parent.tagName) {
|
|
2258
|
+
continue;
|
|
2259
|
+
}
|
|
2260
|
+
const tag = parent.tagName.toLowerCase();
|
|
2261
|
+
if (tag === 'body') {
|
|
2262
|
+
break;
|
|
2263
|
+
}
|
|
2264
|
+
if (tag === name) {
|
|
2265
|
+
return parent;
|
|
2266
|
+
}
|
|
2267
|
+
parent = parent.parentNode as HTMLElement;
|
|
2268
|
+
}
|
|
2269
|
+
return null;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2249
2272
|
/**
|
|
2250
2273
|
* --- 查找指定 el 的同级所有元素 ---
|
|
2251
2274
|
* @param el 基准
|
package/dist/lib/form.js
CHANGED
|
@@ -176,7 +176,7 @@ class AbstractCommon {
|
|
|
176
176
|
get l() {
|
|
177
177
|
return (key, data) => {
|
|
178
178
|
var _a, _b, _c, _d;
|
|
179
|
-
const loc = (_d = (_b = (_a = task.list[this.taskId].locale.data[this.locale]) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : (_c = task.list[this.taskId].locale.data['en']) === null || _c === void 0 ? void 0 : _c[key]) !== null && _d !== void 0 ? _d : 'LocaleError';
|
|
179
|
+
const loc = (_d = (_b = (_a = task.list[this.taskId].locale.data[this.locale]) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : (_c = task.list[this.taskId].locale.data['en']) === null || _c === void 0 ? void 0 : _c[key]) !== null && _d !== void 0 ? _d : '[LocaleError]' + key;
|
|
180
180
|
if (!data) {
|
|
181
181
|
return loc;
|
|
182
182
|
}
|
|
@@ -1761,9 +1761,6 @@ function createPanel(cls, el, formId, taskId) {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
layout = tool.purify(layout);
|
|
1763
1763
|
layout = tool.layoutAddTagClassAndReTagName(layout, true);
|
|
1764
|
-
layout = tool.layoutInsertAttr(layout, ':form-focus=\'formFocus\'', {
|
|
1765
|
-
'include': [/^cg-.+/]
|
|
1766
|
-
});
|
|
1767
1764
|
const prepList = ['cg-task' + t.id.toString() + '_'];
|
|
1768
1765
|
if (prep !== '') {
|
|
1769
1766
|
prepList.push(prep);
|
|
@@ -2042,9 +2039,6 @@ function create(cls, data, opt = {}, taskId) {
|
|
|
2042
2039
|
}
|
|
2043
2040
|
layout = tool.purify(layout);
|
|
2044
2041
|
layout = tool.layoutAddTagClassAndReTagName(layout, true);
|
|
2045
|
-
layout = tool.layoutInsertAttr(layout, ':form-focus=\'formFocus\'', {
|
|
2046
|
-
'include': [/^cg-.+/]
|
|
2047
|
-
});
|
|
2048
2042
|
const prepList = ['cg-task' + t.id.toString() + '_'];
|
|
2049
2043
|
if (prep !== '') {
|
|
2050
2044
|
prepList.push(prep);
|
package/dist/lib/form.ts
CHANGED
|
@@ -205,7 +205,7 @@ abstract class AbstractCommon {
|
|
|
205
205
|
*/
|
|
206
206
|
public get l(): (key: string, data?: string[]) => string {
|
|
207
207
|
return (key: string, data?: string[]): string => {
|
|
208
|
-
const loc = task.list[this.taskId].locale.data[this.locale]?.[key] ?? task.list[this.taskId].locale.data['en']?.[key] ?? 'LocaleError';
|
|
208
|
+
const loc = task.list[this.taskId].locale.data[this.locale]?.[key] ?? task.list[this.taskId].locale.data['en']?.[key] ?? '[LocaleError]' + key;
|
|
209
209
|
if (!data) {
|
|
210
210
|
return loc;
|
|
211
211
|
}
|
|
@@ -2305,9 +2305,11 @@ export async function createPanel<T extends AbstractPanel>(
|
|
|
2305
2305
|
// --- 标签增加 cg- 前缀,增加 class 为 tag-xxx ---
|
|
2306
2306
|
layout = tool.layoutAddTagClassAndReTagName(layout, true);
|
|
2307
2307
|
// --- 给所有控件传递窗体的 focus 信息 ---
|
|
2308
|
+
/*
|
|
2308
2309
|
layout = tool.layoutInsertAttr(layout, ':form-focus=\'formFocus\'', {
|
|
2309
2310
|
'include': [/^cg-.+/]
|
|
2310
2311
|
});
|
|
2312
|
+
*/
|
|
2311
2313
|
// --- 给 layout 的 class 增加前置 ---
|
|
2312
2314
|
const prepList = ['cg-task' + t.id.toString() + '_'];
|
|
2313
2315
|
if (prep !== '') {
|
|
@@ -2633,9 +2635,11 @@ export async function create<T extends AbstractForm>(
|
|
|
2633
2635
|
// --- 标签增加 cg- 前缀,增加 class 为 tag-xxx ---
|
|
2634
2636
|
layout = tool.layoutAddTagClassAndReTagName(layout, true);
|
|
2635
2637
|
// --- 给所有控件传递窗体的 focus 信息 ---
|
|
2638
|
+
/*
|
|
2636
2639
|
layout = tool.layoutInsertAttr(layout, ':form-focus=\'formFocus\'', {
|
|
2637
2640
|
'include': [/^cg-.+/]
|
|
2638
2641
|
});
|
|
2642
|
+
*/
|
|
2639
2643
|
// --- 给 layout 的 class 增加前置 ---
|
|
2640
2644
|
const prepList = ['cg-task' + t.id.toString() + '_'];
|
|
2641
2645
|
if (prep !== '') {
|