@shijiu/jsview-vue 0.9.684 → 0.9.783
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/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/bin/jsview-engine-js-browser.min.js +1 -1
- package/dom/bin/jsview-forge-define.min.js +1 -1
- package/dom/jsv-engine-js-browser.js +6 -0
- package/dom/target_core_revision.js +4 -4
- package/loader/loader.js +4 -0
- package/package.json +1 -1
- package/patches/node_modules/@vue/cli-service/lib/config/base.js +1 -1
- package/samples/AnimPicture/App.vue +5 -5
- package/samples/Basic/components/div/DivLayout.vue +1 -1
- package/samples/Basic/components/img/ImageGroup.vue +2 -2
- package/samples/Basic/components/img/ImgLayout.vue +79 -15
- package/samples/Basic/components/text/TextDirection.vue +104 -0
- package/samples/Basic/components/text/TextEmoji.vue +1 -1
- package/samples/Basic/components/text/TextGroup1.vue +1 -1
- package/samples/Basic/components/text/TextGroup2.vue +11 -1
- package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +11 -11
- package/samples/DemoHomepage/App.vue +67 -8
- package/samples/DemoHomepage/components/TabFrame.vue +7 -0
- package/samples/DemoHomepage/router.js +27 -26
- package/samples/DemoHomepage/views/Homepage.vue +89 -98
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +3 -3
- package/samples/FocusBlockDemos/AutoFocus/App.vue +51 -0
- package/samples/FocusBlockDemos/AutoFocus/BaseBlock.vue +82 -0
- package/samples/FocusBlockDemos/AutoFocus/DialogBlock.vue +89 -0
- package/samples/FocusBlockDemos/AutoFocus/DialogContorls.js +42 -0
- package/samples/FocusBlockDemos/AutoFocus/FocusNamesDefine.js +9 -0
- package/samples/FocusBlockDemos/AutoFocus/PlaneBlock.vue +71 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/App.vue +78 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/BaseBlock.vue +77 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/DownPlaneBlock.vue +83 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/FocusNamesDefine.js +12 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/UpPlaneBlock.vue +83 -0
- package/samples/GridDemo/App.vue +3 -3
- package/samples/GridDemo/ButtonBlock.vue +2 -2
- package/samples/GridDemo/FocusItem.vue +2 -2
- package/samples/GridDemo/Item.vue +1 -1
- package/samples/HashHistory/App.vue +10 -3
- package/samples/HashHistory/components/Item.vue +1 -1
- package/samples/ImpactStop/App.vue +15 -11
- package/samples/Input/InputPanel.vue +1 -1
- package/samples/LongImage/Button.vue +1 -1
- package/samples/LongImage/ButtonItem.vue +1 -1
- package/samples/LongImage/LongImageScroll.vue +2 -2
- package/samples/LongText/App.vue +1 -1
- package/samples/LongText/Button.vue +1 -1
- package/samples/LongText/ButtonItem.vue +1 -1
- package/samples/LongText/LongTextScroll.vue +3 -3
- package/samples/Marquee/App.vue +34 -3
- package/samples/Marquee/longText.js +2 -2
- package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
- package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
- package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/App.vue +22 -11
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +5 -5
- package/samples/MetroWidgetDemos/{Item.vue → PingPong/Item.vue} +3 -21
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +5 -5
- package/samples/MetroWidgetDemos/{WidgetItem.vue → PingPong/WidgetItem.vue} +8 -4
- package/samples/MetroWidgetDemos/basic/App.vue +162 -0
- package/samples/MetroWidgetDemos/basic/Item.vue +43 -0
- package/samples/MetroWidgetDemos/direction/App.vue +158 -0
- package/samples/MetroWidgetDemos/direction/Item.vue +45 -0
- package/samples/MetroWidgetDemos/focusableItemBasic/App.vue +67 -0
- package/samples/MetroWidgetDemos/{Advanced → focusableItemBasic}/ButtonItem.vue +17 -21
- package/samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue +74 -0
- package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/Item.vue +13 -32
- package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/WidgetItem.vue +12 -12
- package/samples/MetroWidgetDemos/focusableItemMix/App.vue +88 -0
- package/samples/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +86 -0
- package/samples/MetroWidgetDemos/focusableItemMix/Item.vue +43 -0
- package/samples/MetroWidgetDemos/index.js +6 -0
- package/samples/MetroWidgetDemos/layoutType/App.vue +180 -0
- package/samples/MetroWidgetDemos/layoutType/Item.vue +45 -0
- package/samples/MetroWidgetDemos/padding/App.vue +222 -0
- package/samples/MetroWidgetDemos/padding/Item.vue +64 -0
- package/samples/MetroWidgetDemos/routeList.js +64 -0
- package/samples/MetroWidgetDemos/slideSetting/App.vue +225 -0
- package/samples/MetroWidgetDemos/slideSetting/Item.vue +45 -0
- package/samples/NinePatchDemo/App.vue +78 -122
- package/samples/NinePatchDemo/Item.vue +29 -27
- package/samples/Preload/App.vue +1 -1
- package/samples/Preload/Item.vue +1 -1
- package/samples/QrcodeDemo/App.vue +1 -1
- package/samples/SoundPool/App.vue +3 -3
- package/samples/SpriteImage/App.vue +5 -0
- package/samples/Swiper/App.vue +148 -0
- package/samples/TextBox/App.vue +2 -1
- package/samples/TextureAnimation/App2.vue +1 -1
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
- package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TransitPage/App.vue +1 -1
- package/samples/VideoDemo/App.vue +8 -8
- package/samples/VideoDemo/components/Button.vue +1 -1
- package/samples/VideoDemo/components/Controllor.vue +1 -1
- package/samples/VisibleSensorDemo/App.vue +3 -3
- package/scripts/jsview-run-android.js +5 -4
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +4 -4
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +79 -50
- package/utils/JsViewEngineWidget/TemplateParser.js +144 -147
- package/utils/JsViewEngineWidget/WidgetCommon.js +12 -3
- package/utils/JsViewPlugin/BrowserPluginLoader.js +4 -2
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +302 -0
- package/utils/JsViewPlugin/JsvAudio/CheckType.js +68 -0
- package/utils/JsViewPlugin/JsvAudio/Events.js +17 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +176 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +40 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBrowser.vue +46 -0
- package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +140 -0
- package/utils/JsViewPlugin/JsvAudio/index.js +26 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +24 -0
- package/utils/JsViewPlugin/JsvPlayer/index.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvHashHistory.js +34 -8
- package/utils/JsViewVueTools/JsvImpactTracer.js +2 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +46 -8
- package/utils/JsViewVueTools/JsvStyleClass.js +9 -0
- package/utils/{JsViewVueWidget/utils/text.js → JsViewVueTools/JsvTextTools.js} +24 -4
- package/utils/JsViewVueTools/TypeCheckAndSet.js +3 -3
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +5 -7
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +20 -22
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +4 -4
- package/utils/JsViewVueWidget/JsvGrid.vue +1 -9
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +1 -1
- package/utils/JsViewVueWidget/JsvMarquee.vue +91 -20
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -53
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +116 -80
- package/utils/JsViewVueWidget/JsvSwiper/index.js +3 -2
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
- package/utils/JsViewVueWidget/JsvTextBox.vue +11 -31
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +2 -2
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
- package/utils/JsViewVueWidget/index.js +8 -8
- package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
- package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
- package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
- package/samples/MetroWidgetDemos/data.js +0 -205
- package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +0 -35
- package/utils/JsViewVueWidget/utils/index.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
/* eslint-disable */ var
|
|
1
|
+
/* eslint-disable */ void 0===window.Forge&&(window.Forge={});var e=window.Forge;class t{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){let t=e.indexOf("(")+1,i=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,i).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:"))return void(this.href=e);let i=e.indexOf("://");if(!(i<0||i>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=document.location.origin+e;else if((!0===e.startsWith("./")||!0===e.startsWith("../"))&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.__MainPath||"undefined"===window.JsView.Dom.__MainPathRef||window.JsView.Dom.__MainPathRef!==document.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.__MainPathRef=document.location.href;let e=document.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.__MainPath=document.location.origin+document.location.pathname.substring(0,e)+"/"}let t=window.JsView.Dom.__MainPath;e=e.startsWith("./")?t+e.substring(2):t+e}if(this.href=e,!t)return;let n=this.href,r=n.indexOf("#");r>0&&(this.hash=n.substring(r),n=n.substring(0,r));let s=n.indexOf("?");s>1&&(this.search=n.substring(s),n=n.substring(0,s));let o=n,a=o.indexOf("://");this.protocol=a>0?o.substring(0,a+1):"";let u=a>1?o.substring(a+3):"";if(a=u.indexOf("/"),this.host=a>0?u.substring(0,a):"",this.pathname=a>1?u.substring(a):"",this.origin=a>0?this.protocol+"//"+this.host:"",this.host.startsWith("[")){let e=this.host.indexOf("]");this.hostname=this.host.substring(0,e+1),e=this.host.substring(e+1).indexOf(":"),this.port=e>1?this.host.substring(e+1):""}else{let e=this.host.indexOf(":");this.hostname=e>0?this.host.substring(0,e):this.host,this.port=e>1?this.host.substring(e+1):""}}replace(e){this.href=e}}window.JsView&&window.JsView.registerUriConverter?.((e=>new t(e,!1).href));class i{static SetBackgroundColor(t,n,r){const s=i.TextureManager.GetColorTextureCached(n);let o;r&&(o=new e.ViewRoundCornerMask(r.topLeft,r.topRight,r.bottomLeft,r.bottomRight));const a=new e.ExternalTextureSetting(s,o);t.ResetTexture(a)}static SetBackgroundImage(n,r,s,o,a,u,h){let l,d={};if("string"==typeof r){const e=new t(r);if(e instanceof t==!1)throw Error("Bad Argument.",e);d.url=e.href}else"linear-gradient"==r?.type&&(d.gradient=r);if(d.gradient)if(d.gradient.colors?.length>2){const e=d.gradient.colors,t=[e[0],e[e.length-1]],n=e.slice(1,e.length-1);l=i.TextureManager.CreateLinearGradientTexture(t,n)}else 2==d.gradient.colors?.length?l=i.TextureManager.CreateMiniGradientTexture(!0,d.gradient.colors[0],d.gradient.colors[1],d.gradient.rawValue):console.warn("Failed to create backgroundImage gradient, bad colors.",d.gradient.colors);else d.url&&(l=d.url.includes(".gif")||d.url.includes(".webp")?i.TextureManager.GetGifImage(d.url,!1,null,h):i.TextureManager.GetImage2(d.url,!1,a,u||e.ColorSpace.RGBA_8888));if(l){let t;s&&(t=new e.ViewRoundCornerMask(s.topLeft,s.topRight,s.bottomLeft,s.bottomRight));const i=new e.ExternalTextureSetting(l,t);if(n.ResetTexture(i),o){let e=l.RegisterLoadImageCallback(null,(function(){o({width:l.Width,height:l.Height})}));n.RegisterDetachCallback((()=>{l.UnregisterLoadImageCallback(e)}))}}}static SetMaskedBackgroundImage(n,r,s,o){if("string"==typeof r&&(r=new t(r)),r instanceof t==!1)throw Error("Bad Argument.",r);if("string"==typeof s&&(s=new t(s)),s instanceof t==!1)throw Error("Bad Argument(MaskURL).",s);const a=i.TextureManager.GetImage2(r.href,!1,null,o||e.ColorSpace.RGBA_8888);if(a){const t=i.TextureManager.GetImage2(s.href,!1,null,e.ColorSpace.RGBA_8888),r=new e.ExternalTextureSetting(a,new e.ViewTextureMask(t));n.ResetTexture(r)}}static SetVideoTexture(t,n,r){const s=i.TextureManager.GetColorTexture(n);let o;r&&(o=new e.ViewRoundCornerMask(r.topLeft,r.topRight,r.bottomLeft,r.bottomRight));const a=new e.TextureSetting(s,o);t.ResetTexture(a)}static GetTextWidth(t){return t.str||(t.str=""),t.font||(t.font=e.TextUtils._sDefaultFont),t.size||(t.size=e.TextUtils._sDefaultFontSize),"italic"!==t.italic&&(t.italic=""),"bold"!==t.bold&&(t.bold=""),window.PlatformUtils.GetTextWidth(t)}static RequestSwap(){e.sRenderBridge.RequestSwap()}static SetImgTexSize(e,t){let n={size:t,refNum:0};i.TextureInfo.Cache[e.Source]=n}static RefImgTexSize(e,t){let n=i.TextureInfo.Cache[e.Source];n?(n.refNum>0?n.refNum++:n.refNum=1,t(n.size)):e.RegisterLoadImageCallback(null,(function(){const n={width:e.Width,height:e.Height};t(n);let r=i.TextureInfo.Cache[e.Source];if(r)r.refNum>0?r.refNum++:r.refNum=1;else{let t={size:n,refNum:1};i.TextureInfo.Cache[e.Source]=t}}))}static UnrefImgTexSize(e){if(!e)return;let t=i.TextureInfo.Cache[e.Source];t&&(t.refNum--,t.refNum<=0&&i.TextureInfo.Unused.add(e.Source))}static ClearUnusedTexSize(){for(let e of i.TextureInfo.Unused){let t=i.TextureInfo.Cache[e];t.refNum<-2?(delete i.TextureInfo.Cache[e],i.TextureInfo.Unused.delete(e)):t.refNum<=0?t.refNum--:i.TextureInfo.Unused.delete(e)}}}i.TextureInfo={Cache:{},Unused:new Set},i.TextureManager=null,i.RootView=null,i.RootActivity=null,i.HaltKeyEvent=!1,window.JsView&&(window.JsView.ForgeExtension||(window.JsView.ForgeExtension=i),i=window.JsView.ForgeExtension);var n=i;export{e as Forge,n as ForgeExtension};
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const TargetRevision = {
|
|
6
|
-
"CoreRevision":
|
|
7
|
-
"CoreRevisionAndBranch": "
|
|
8
|
-
"JseRevision": "1.0.
|
|
6
|
+
"CoreRevision": 1021277,
|
|
7
|
+
"CoreRevisionAndBranch": "1021277",
|
|
8
|
+
"JseRevision": "1.0.830",
|
|
9
9
|
"JseUrl":
|
|
10
|
-
"http://cdn.release.qcast.cn/forge_js/master/
|
|
10
|
+
"http://cdn.release.qcast.cn/forge_js/master/JsViewES6_react_r830.jsv.9e271859.js"
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// 不要用export default,update-env脚本不能解析
|
package/loader/loader.js
CHANGED
|
@@ -52,6 +52,10 @@ async function selectJsViewRuntime(js_sub_path, input_designed_map, app_name) {
|
|
|
52
52
|
window.JsView.ForgeExt = app_define.ForgeExtension;
|
|
53
53
|
window.JsView.Dom.JsSubPath = js_sub_path;
|
|
54
54
|
} else {
|
|
55
|
+
// 在PC环境下没有处理加载EngineJs, 所以在此加载一下
|
|
56
|
+
await import("../dom/jsv-engine-js-browser.js");
|
|
57
|
+
|
|
58
|
+
// 加载jsv-dom的调试版本
|
|
55
59
|
await import("../dom/jsv-browser-debug-dom.js");
|
|
56
60
|
}
|
|
57
61
|
}
|
package/package.json
CHANGED
|
@@ -129,7 +129,7 @@ module.exports = (api, options) => {
|
|
|
129
129
|
.loader(require.resolve('vue-loader'))
|
|
130
130
|
.options({
|
|
131
131
|
...vueLoaderCacheConfig,
|
|
132
|
-
compilerOptions: { isCustomElement: tag => tag === 'fdiv' }, // QCode Added
|
|
132
|
+
compilerOptions: { isCustomElement: tag => (tag === 'fdiv' || tag === 'audiotrack') }, // QCode Added
|
|
133
133
|
babelParserPlugins: ['jsx', 'classProperties', 'decorators-legacy']
|
|
134
134
|
})
|
|
135
135
|
.end()
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script setup>
|
|
9
|
-
import { ref } from "vue";
|
|
9
|
+
import { ref, shallowRef } from "vue";
|
|
10
10
|
import { useRouter, useRoute } from "vue-router";
|
|
11
11
|
import { LoopType, JsvApic } from "jsview";
|
|
12
12
|
import catRun from "./assets/animated_webp.webp";
|
|
@@ -53,10 +53,10 @@ const ballCallback = {
|
|
|
53
53
|
ballPlay.value = false;
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
|
-
let catRunRef =
|
|
57
|
-
let girlRunRef =
|
|
58
|
-
let quanRef =
|
|
59
|
-
let ballRef =
|
|
56
|
+
let catRunRef = shallowRef(null);
|
|
57
|
+
let girlRunRef = shallowRef(null);
|
|
58
|
+
let quanRef = shallowRef(null);
|
|
59
|
+
let ballRef = shallowRef(null);
|
|
60
60
|
|
|
61
61
|
const onKeyDown = (ev) => {
|
|
62
62
|
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id='item-root'>
|
|
3
|
-
<ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="
|
|
3
|
+
<ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="img标签ObjectFit">
|
|
4
4
|
<ImgLayout/>
|
|
5
5
|
</ContentBlock>
|
|
6
6
|
</div>
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
contentBlockProps() {
|
|
24
24
|
return {
|
|
25
25
|
colIndex: 0,
|
|
26
|
-
itemSides: this.itemSides
|
|
26
|
+
itemSides:{...this.itemSides, height: this.itemSides.height * 2}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,13 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id='layout-root'>
|
|
3
3
|
<div style="{top: 0}">
|
|
4
|
-
<div
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
<div id="0列0行" :style="{left: coloumWidth * 0, top: tabLineHeight * 0}">
|
|
5
|
+
<div class="content-font titleStyle"> fill(缩放变形)</div>
|
|
6
|
+
<div class="frameStyle">
|
|
7
|
+
<img class="imageStyle" :style="{ objectFit: 'fill' }"
|
|
8
|
+
:src="testImgPath"/>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div id="1列0行" :style="{left: coloumWidth * 1, top: tabLineHeight * 0}">
|
|
12
|
+
<div class="content-font titleStyle">contain</div>
|
|
13
|
+
<div class="frameStyle">
|
|
14
|
+
<img class="imageStyle" :style="{ objectFit: 'contain' }"
|
|
15
|
+
:src="testImgPath"/>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div id="0列1行" :style="{left: coloumWidth * 0, top: tabLineHeight * 1}">
|
|
19
|
+
<div class="content-font titleStyle">none</div>
|
|
20
|
+
<div class="frameStyle">
|
|
21
|
+
<img class="imageStyle" :style="{ objectFit: 'none' }"
|
|
22
|
+
:src="testImgPath"/>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div id="1列1行" :style="{left: coloumWidth * 1, top: tabLineHeight * 1}">
|
|
26
|
+
<div class="content-font titleStyle">scale-down</div>
|
|
27
|
+
<div class="frameStyle">
|
|
28
|
+
<img class="imageStyle" :style="{ objectFit: 'scale-down' }"
|
|
29
|
+
:src="testImgPath"/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div id="0列2行" :style="{left: coloumWidth * 0, top: tabLineHeight * 2}">
|
|
33
|
+
<div class="content-font titleStyle">cover</div>
|
|
34
|
+
<div class="frameStyle">
|
|
35
|
+
<img class="imageStyle" :style="{ objectFit: 'cover' }"
|
|
36
|
+
:src="testImgPath"/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div id="1列2行" :style="{left: coloumWidth * 1, top: tabLineHeight * 2}">
|
|
40
|
+
<div class="content-font titleStyle">none(小图)</div>
|
|
41
|
+
<div class="frameStyle">
|
|
42
|
+
<img class="imageStyle" :style="{ objectFit: 'none' }"
|
|
43
|
+
:src="tinyImgPath"/>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div id="0列3行" :style="{left: coloumWidth * 0, top: tabLineHeight * 3}">
|
|
47
|
+
<div class="content-font titleStyle">scale-down(小图)</div>
|
|
48
|
+
<div class="frameStyle">
|
|
49
|
+
<img class="imageStyle" :style="{ objectFit: 'scale-down' }"
|
|
50
|
+
:src="tinyImgPath"/>
|
|
51
|
+
</div>
|
|
11
52
|
</div>
|
|
12
53
|
</div>
|
|
13
54
|
</div>
|
|
@@ -15,27 +56,50 @@
|
|
|
15
56
|
|
|
16
57
|
<script>
|
|
17
58
|
import testImgPath from '../../assets/test.jpg';
|
|
59
|
+
import tinyImgPath from '../../assets/icon.png';
|
|
18
60
|
|
|
19
61
|
export default {
|
|
20
62
|
computed: {
|
|
21
63
|
testImgPath() {
|
|
22
64
|
return testImgPath;
|
|
23
65
|
},
|
|
24
|
-
|
|
25
|
-
return
|
|
66
|
+
tinyImgPath() {
|
|
67
|
+
return tinyImgPath;
|
|
26
68
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
width: 80,
|
|
30
|
-
height: 64,
|
|
31
|
-
}
|
|
69
|
+
coloumWidth() {
|
|
70
|
+
return 120;
|
|
32
71
|
},
|
|
72
|
+
tabLineHeight() {
|
|
73
|
+
return 76; // imageSize.height + 26
|
|
74
|
+
}
|
|
33
75
|
}
|
|
34
76
|
}
|
|
35
77
|
|
|
36
78
|
</script>
|
|
37
79
|
|
|
38
80
|
|
|
39
|
-
<style>
|
|
81
|
+
<style scoped>
|
|
40
82
|
@import "../FontStyle.css";
|
|
83
|
+
</style>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.titleStyle {
|
|
87
|
+
width: 100;
|
|
88
|
+
height: 16;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.imageStyle {
|
|
92
|
+
top: 2;
|
|
93
|
+
left: 2;
|
|
94
|
+
width: 100;
|
|
95
|
+
height: 50;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.frameStyle {
|
|
99
|
+
top: 16; /* titleHeight */
|
|
100
|
+
width: 104; /* imageSize.width+4 */
|
|
101
|
+
height: 54; /* imageSize.height+4 */
|
|
102
|
+
background-color: rgba(0, 255, 0, 1)
|
|
103
|
+
}
|
|
104
|
+
|
|
41
105
|
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const gap = 5;
|
|
3
|
+
const blockSize = {
|
|
4
|
+
width: 180,
|
|
5
|
+
height: 30,
|
|
6
|
+
};
|
|
7
|
+
const unitHeight = 20 + 35;
|
|
8
|
+
|
|
9
|
+
const ltrText = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
10
|
+
const rtlText = "شلؤيثبلاهتنمةىخحضقسفعررصءغئا";
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div id="layout-root">
|
|
15
|
+
<div
|
|
16
|
+
:style="{
|
|
17
|
+
top: unitHeight * 0,
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<div class="explain">ltr文字省略尾部</div>
|
|
21
|
+
<div
|
|
22
|
+
class="content-font base"
|
|
23
|
+
:style="{
|
|
24
|
+
direction: 'ltr',
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
{{ ltrText }}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
:style="{
|
|
33
|
+
top: unitHeight * 1,
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
36
|
+
<div class="explain">ltr文字省略头部</div>
|
|
37
|
+
<div
|
|
38
|
+
class="content-font base"
|
|
39
|
+
:style="{
|
|
40
|
+
direction: 'rtl',
|
|
41
|
+
}"
|
|
42
|
+
>
|
|
43
|
+
{{ ltrText }}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div
|
|
48
|
+
:style="{
|
|
49
|
+
top: unitHeight * 2,
|
|
50
|
+
}"
|
|
51
|
+
>
|
|
52
|
+
<div class="explain">rtl文字省略尾部</div>
|
|
53
|
+
<div
|
|
54
|
+
class="content-font base"
|
|
55
|
+
:style="{
|
|
56
|
+
direction: 'rtl',
|
|
57
|
+
}"
|
|
58
|
+
>
|
|
59
|
+
{{ rtlText }}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div
|
|
64
|
+
:style="{
|
|
65
|
+
top: unitHeight * 3,
|
|
66
|
+
}"
|
|
67
|
+
>
|
|
68
|
+
<div class="explain">rtl文字省略头部</div>
|
|
69
|
+
<div
|
|
70
|
+
class="content-font base"
|
|
71
|
+
:style="{
|
|
72
|
+
direction: 'ltr',
|
|
73
|
+
}"
|
|
74
|
+
>
|
|
75
|
+
{{ rtlText }}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
@import "../FontStyle.css";
|
|
83
|
+
|
|
84
|
+
.base {
|
|
85
|
+
top: 25px;
|
|
86
|
+
width: 180px;
|
|
87
|
+
height: 30px;
|
|
88
|
+
line-height: 30px;
|
|
89
|
+
background-color: rgba(255, 255, 0, 0.5);
|
|
90
|
+
color: #ff0000;
|
|
91
|
+
font-size: 25px;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.explain {
|
|
98
|
+
width: 180px;
|
|
99
|
+
height: 20px;
|
|
100
|
+
line-height: 20px;
|
|
101
|
+
font-size: 15px;
|
|
102
|
+
color: #000000;
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
@@ -38,7 +38,7 @@ const contentBlockProps = {
|
|
|
38
38
|
<ContentBlock
|
|
39
39
|
:class="contentClass"
|
|
40
40
|
:style="{ top: itemSides.height * 2 }"
|
|
41
|
-
:="{ ...contentBlockProps, itemSides: { ...itemSides, height:
|
|
41
|
+
:="{ ...contentBlockProps, itemSides: { ...itemSides, height: 320 } }"
|
|
42
42
|
:index="2"
|
|
43
43
|
title="文字折行"
|
|
44
44
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ContentBlock from "../ContentBlock";
|
|
3
3
|
import TextEmoji from "./TextEmoji";
|
|
4
|
+
import TextDirection from "./TextDirection.vue";
|
|
4
5
|
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
contentClass: String,
|
|
@@ -19,10 +20,19 @@ const contentBlockProps = {
|
|
|
19
20
|
:style="{ top: itemSides.height * 0 }"
|
|
20
21
|
:="contentBlockProps"
|
|
21
22
|
:index="0"
|
|
22
|
-
title="
|
|
23
|
+
title="emoji"
|
|
23
24
|
>
|
|
24
25
|
<TextEmoji />
|
|
25
26
|
</ContentBlock>
|
|
27
|
+
<ContentBlock
|
|
28
|
+
:class="contentClass"
|
|
29
|
+
:style="{ top: itemSides.height * 1 }"
|
|
30
|
+
:="{ ...contentBlockProps, itemSides: { ...itemSides, height: 250 } }"
|
|
31
|
+
:index="0"
|
|
32
|
+
title="不同方向文字省略"
|
|
33
|
+
>
|
|
34
|
+
<text-direction />
|
|
35
|
+
</ContentBlock>
|
|
26
36
|
</div>
|
|
27
37
|
</template>
|
|
28
38
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, onMounted } from "vue";
|
|
2
|
+
import { ref, shallowRef, onMounted } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
name: String,
|
|
5
5
|
style: {
|
|
@@ -12,7 +12,7 @@ const props = defineProps({
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
const fullName = ref("");
|
|
15
|
-
const blockRef =
|
|
15
|
+
const blockRef = shallowRef(null);
|
|
16
16
|
const hasFocused = ref(false);
|
|
17
17
|
|
|
18
18
|
onMounted(() => {
|
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
-->
|
|
8
8
|
<script setup>
|
|
9
9
|
import { createImpactTracer, createImpactCallback } from "jsview";
|
|
10
|
-
import { ref, onMounted, onBeforeUnmount } from "vue";
|
|
10
|
+
import { ref, shallowRef, onMounted, onBeforeUnmount } from "vue";
|
|
11
11
|
import { useRouter } from "vue-router";
|
|
12
12
|
|
|
13
13
|
const router = useRouter();
|
|
14
14
|
|
|
15
|
-
const transEle1 =
|
|
16
|
-
transEle2 =
|
|
17
|
-
rotateEle1 =
|
|
18
|
-
rotateEle2 =
|
|
19
|
-
rotateEle3 =
|
|
20
|
-
rotateEle4 =
|
|
21
|
-
scaleEle1 =
|
|
22
|
-
scaleEle2 =
|
|
23
|
-
skewEle1 =
|
|
24
|
-
skewEle2 =
|
|
15
|
+
const transEle1 = shallowRef(null),
|
|
16
|
+
transEle2 = shallowRef(null),
|
|
17
|
+
rotateEle1 = shallowRef(null),
|
|
18
|
+
rotateEle2 = shallowRef(null),
|
|
19
|
+
rotateEle3 = shallowRef(null),
|
|
20
|
+
rotateEle4 = shallowRef(null),
|
|
21
|
+
scaleEle1 = shallowRef(null),
|
|
22
|
+
scaleEle2 = shallowRef(null),
|
|
23
|
+
skewEle1 = shallowRef(null),
|
|
24
|
+
skewEle2 = shallowRef(null);
|
|
25
25
|
|
|
26
26
|
let sensors = [];
|
|
27
27
|
|
|
@@ -5,23 +5,82 @@
|
|
|
5
5
|
* @LastEditTime: 2022-07-12 13:40:15
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import { shallowRef, onMounted, defineExpose } from "vue";
|
|
10
|
+
import { JsvPreload, buildPreloadInfo, jJsvRuntimeBridge } from "jsview";
|
|
11
|
+
import { useRouter, useRoute } from "vue-router";
|
|
12
|
+
|
|
13
|
+
let backgroundImageUrl = shallowRef(null);
|
|
14
|
+
|
|
15
|
+
let preloadInfo = shallowRef([]);
|
|
16
|
+
|
|
17
|
+
let globalRoute = useRoute();
|
|
18
|
+
let globalRouter = useRouter();
|
|
19
|
+
|
|
20
|
+
let _onPreloadDone = () => {
|
|
21
|
+
console.log("background load done");
|
|
22
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onKeyDown = (ev)=>{
|
|
26
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
27
|
+
if (globalRoute.fullPath != "/") {
|
|
28
|
+
// 回调一级路由
|
|
29
|
+
globalRouter.go(-1);
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onMounted(() => {
|
|
37
|
+
console.log("simulate async get background url");
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
console.log("simulate background url got");
|
|
40
|
+
backgroundImageUrl.value =
|
|
41
|
+
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg";
|
|
42
|
+
preloadInfo.value = [buildPreloadInfo(backgroundImageUrl.value)];
|
|
43
|
+
}, 0);
|
|
44
|
+
|
|
45
|
+
// window.myJsvRouter = useRouter();
|
|
46
|
+
// window.myJsvRoute = useRoute();
|
|
47
|
+
});
|
|
48
|
+
</script>
|
|
49
|
+
|
|
8
50
|
<script>
|
|
9
51
|
import { router } from "./router.js";
|
|
10
|
-
import { jJsvRuntimeBridge } from "jsview";
|
|
11
|
-
|
|
12
52
|
export default {
|
|
13
53
|
Router: router,
|
|
14
|
-
mounted() {
|
|
15
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
16
|
-
},
|
|
17
54
|
};
|
|
18
55
|
</script>
|
|
19
56
|
|
|
20
57
|
<template>
|
|
21
58
|
<div>
|
|
22
|
-
<
|
|
59
|
+
<jsv-preload
|
|
60
|
+
:key="backgroundImageUrl"
|
|
61
|
+
:preloadList="preloadInfo"
|
|
62
|
+
:onPreloadDone="_onPreloadDone"
|
|
63
|
+
/>
|
|
64
|
+
<div
|
|
65
|
+
:style="{
|
|
66
|
+
width: 1280,
|
|
67
|
+
height: 720,
|
|
68
|
+
backgroundImage: backgroundImageUrl,
|
|
69
|
+
}"
|
|
70
|
+
/>
|
|
71
|
+
<jsv-focus-block
|
|
72
|
+
:onAction="{
|
|
73
|
+
onKeyDown,
|
|
74
|
+
}"
|
|
75
|
+
>
|
|
76
|
+
<router-view v-slot="{ Component, route }">
|
|
77
|
+
<keep-alive>
|
|
78
|
+
<component v-if="route.meta.keepAlive" :is="Component" />
|
|
79
|
+
</keep-alive>
|
|
80
|
+
<component v-if="!route.meta.keepAlive" :is="Component" />
|
|
81
|
+
</router-view>
|
|
82
|
+
</jsv-focus-block>
|
|
23
83
|
</div>
|
|
24
84
|
</template>
|
|
25
85
|
|
|
26
|
-
<style scoped>
|
|
27
|
-
</style>
|
|
86
|
+
<style scoped></style>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { createRouter } from "vue-router";
|
|
2
2
|
import { createJsvHashHistory } from "jsview";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { metroWidgetRouteList } from "../MetroWidgetDemos"
|
|
4
|
+
let routeList = [
|
|
5
5
|
// 功能实例
|
|
6
6
|
{
|
|
7
7
|
name: "Home",
|
|
8
8
|
path: "/",
|
|
9
9
|
component: () => import("./views/Homepage"),
|
|
10
|
+
meta: {
|
|
11
|
+
keepAlive: true // 需要被缓存(测试Router keep alive机制)
|
|
12
|
+
}
|
|
10
13
|
},
|
|
11
14
|
{
|
|
12
15
|
name: "基础示例合集",
|
|
@@ -28,11 +31,11 @@ const routeList = [
|
|
|
28
31
|
path: "/feature/NinePatchDemo",
|
|
29
32
|
component: () => import("jsview/samples/NinePatchDemo/App"),
|
|
30
33
|
},
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
34
|
+
// {
|
|
35
|
+
// name: "视频",
|
|
36
|
+
// path: "/feature/VideoDemo",
|
|
37
|
+
// component: () => import("jsview/samples/VideoDemo/App"),
|
|
38
|
+
// },
|
|
36
39
|
{
|
|
37
40
|
name: "焦点切换demo",
|
|
38
41
|
path: "/feature/BasicFocusControl",
|
|
@@ -154,37 +157,35 @@ const routeList = [
|
|
|
154
157
|
// path: "/feature/Collision",
|
|
155
158
|
// component: () => import("jsview/samples/Collision/App"),
|
|
156
159
|
// },
|
|
157
|
-
// {
|
|
158
|
-
// name: "碰撞即停",
|
|
159
|
-
// path: "/feature/ImpactStop",
|
|
160
|
-
// component: () => import("jsview/samples/ImpactStop/App"),
|
|
161
|
-
// },
|
|
162
|
-
|
|
163
|
-
// MetroWidget示例
|
|
164
160
|
{
|
|
165
|
-
name: "
|
|
166
|
-
path: "/
|
|
167
|
-
component: () => import("jsview/samples/
|
|
161
|
+
name: "碰撞即停",
|
|
162
|
+
path: "/feature/ImpactStop",
|
|
163
|
+
component: () => import("jsview/samples/ImpactStop/App"),
|
|
168
164
|
},
|
|
169
165
|
{
|
|
170
|
-
name: "
|
|
171
|
-
path: "/
|
|
172
|
-
component: () => import("jsview/samples/
|
|
166
|
+
name: "轮播",
|
|
167
|
+
path: "/feature/JsvSwiper",
|
|
168
|
+
component: () => import("jsview/samples/Swiper/App"),
|
|
173
169
|
},
|
|
170
|
+
|
|
171
|
+
// Focus示例
|
|
174
172
|
{
|
|
175
|
-
name: "
|
|
176
|
-
path: "/
|
|
173
|
+
name: "渐进式焦点处理",
|
|
174
|
+
path: "/focusBlock/ProgressiveFocusControl",
|
|
177
175
|
component: () =>
|
|
178
|
-
import("jsview/samples/
|
|
176
|
+
import("jsview/samples/FocusBlockDemos/ProgressiveFocusControl/App"),
|
|
179
177
|
},
|
|
180
178
|
{
|
|
181
|
-
name: "
|
|
182
|
-
path: "/
|
|
179
|
+
name: "autoFocus对话框",
|
|
180
|
+
path: "/focusBlock/AutoFocusDialog",
|
|
183
181
|
component: () =>
|
|
184
|
-
import("jsview/samples/
|
|
182
|
+
import("jsview/samples/FocusBlockDemos/AutoFocus/App"),
|
|
185
183
|
},
|
|
186
184
|
];
|
|
187
185
|
|
|
186
|
+
//添加MetroWidget demo
|
|
187
|
+
routeList = routeList.concat(metroWidgetRouteList);
|
|
188
|
+
|
|
188
189
|
const router = createRouter({
|
|
189
190
|
// 浏览器调试和盒子上都可以使用类WebHashHistory的createJsvHashHistory(推荐)
|
|
190
191
|
// 或 createMemoryHistory;
|