@shijiu/jsview-vue 0.9.359-alpha.0 → 0.9.422

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.
Files changed (47) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/target_core_revision.js +3 -3
  4. package/loader/jsview.config.default.js +1 -1
  5. package/loader/jsview.default.config.js +1 -1
  6. package/loader/loader.js +2 -1
  7. package/package.json +1 -1
  8. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +1 -1
  9. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +20 -7
  10. package/samples/Basic/App.vue +37 -29
  11. package/samples/Basic/components/ContentBlock.vue +1 -1
  12. package/samples/Basic/components/FontStyle.css +6 -0
  13. package/samples/Basic/components/div/DivBackground.vue +1 -1
  14. package/samples/Basic/components/div/DivCssScoped.vue +6 -13
  15. package/samples/Basic/components/div/DivCssVar.vue +3 -7
  16. package/samples/Basic/components/div/DivGroup2.vue +7 -2
  17. package/samples/Basic/components/div/DivLayout.vue +3 -3
  18. package/samples/Basic/components/div/DivTransform.vue +27 -0
  19. package/samples/Basic/components/img/ImageGroup.vue +31 -0
  20. package/samples/Basic/components/img/ImgLayout.vue +41 -0
  21. package/samples/Basic/components/panel/Panel1.vue +53 -0
  22. package/samples/Basic/components/panel/Panel2.vue +35 -0
  23. package/samples/Basic/components/panel/TitleBar.vue +29 -0
  24. package/samples/Basic/components/text/TextEmoji.vue +30 -0
  25. package/samples/Basic/components/text/{TextGroup.vue → TextGroup1.vue} +0 -0
  26. package/samples/Basic/components/text/TextGroup2.vue +31 -0
  27. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +13 -0
  28. package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +63 -0
  29. package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.js +19 -0
  30. package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +51 -0
  31. package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +220 -0
  32. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1860 -0
  33. package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +153 -0
  34. package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +137 -118
  35. package/utils/JsViewEngineWidget/TemplateParser.js +212 -158
  36. package/utils/JsViewEngineWidget/index.js +3 -2
  37. package/utils/JsViewPlugin/BrowserPluginLoader.js +14 -0
  38. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +502 -108
  39. package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +101 -0
  40. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +262 -92
  41. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +40 -0
  42. package/utils/JsViewPlugin/JsvPlayer/index.js +27 -0
  43. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +1 -2
  44. package/utils/JsViewVueWidget/JsvMarquee.vue +18 -10
  45. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -3
  46. package/utils/JsViewVueWidget/JsvNinePatch.vue +28 -10
  47. package/samples/Basic/components/TitleBar.vue +0 -27
@@ -1,9 +1,11 @@
1
1
  <template>
2
- <div>
3
- <div :class="jsvclass" v-bind="containerDataV">
4
- Scoped CSS穿透, 此处的属性是Container设进来的.
5
- </div>
2
+ <div>
3
+ <div>
4
+ <div :class="jsvclass" jsv-inherit-class="2">
5
+ Scoped CSS穿透, 此处的属性是Container设进来的.
6
6
  </div>
7
+ </div>
8
+ </div>
7
9
  </template>
8
10
 
9
11
  <script>
@@ -11,15 +13,6 @@ export default {
11
13
  props: {
12
14
  jsvclass: String,
13
15
  },
14
-
15
- data() {
16
- return { containerDataV: undefined }
17
- },
18
-
19
- mounted () {
20
- this.containerDataV = Object.keys(this.$el).filter(p => p.startsWith('data-v-')) // 过滤'data-v-xxx属性'
21
- .reduce((acc,curr)=> (acc[curr]='',acc),{}); // 数组转Object
22
- },
23
16
  }
24
17
  </script>
25
18
 
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div class="block">
3
- CSS class中的变量
3
+ 顶级元素的CSS class中包含变量 (不推荐)
4
4
  </div>
5
5
 
6
6
  <div :style="{left: 70, width: 65, height: 65,
7
7
  color: state.foreColor,
8
8
  backgroundColor: state.backColor}">
9
- CSS style中的变量
9
+ 子级元素CSS class中包含变量
10
10
  </div>
11
11
  </template>
12
12
 
@@ -14,11 +14,6 @@
14
14
  import { reactive } from "vue";
15
15
 
16
16
  export default {
17
- // computed: {
18
- // iconImgPath() {
19
- // return iconImgPath
20
- // }
21
- // },
22
17
  data() {
23
18
  return {
24
19
  timerId: -1,
@@ -53,6 +48,7 @@ export default {
53
48
  .block {
54
49
  width: 65;
55
50
  height: 65;
51
+ /* word-wrap: break-word; */
56
52
  color: v-bind(state.foreColor);
57
53
  background-color: v-bind(state.backColor);
58
54
  }
@@ -3,10 +3,13 @@
3
3
  <ContentBlock :class=contentClass :style="{ top: itemSides.height*0}" :=contentBlockProps :index=1 title="Radius(实现圆角)">
4
4
  <DivRadius/>
5
5
  </ContentBlock>
6
- <ContentBlock :class=contentClass :style="{ top: itemSides.height*1}" :=contentBlockProps :index=2 title="CSS Var">
6
+ <ContentBlock :class=contentClass :style="{ top: itemSides.height*1}" :=contentBlockProps :index=1 title="Transform">
7
+ <DivTransform/>
8
+ </ContentBlock>
9
+ <ContentBlock :class=contentClass :style="{ top: itemSides.height*2}" :=contentBlockProps :index=2 title="CSS Var">
7
10
  <DivCssVar/>
8
11
  </ContentBlock>
9
- <ContentBlock :class=contentClass :style="{ top: itemSides.height*2}" :=contentBlockProps :index=3 title="CSS Scoped">
12
+ <ContentBlock :class=contentClass :style="{ top: itemSides.height*3}" :=contentBlockProps :index=3 title="CSS Scoped">
10
13
  <DivCssScoped jsvclass="block"/>
11
14
  </ContentBlock>
12
15
  </div>
@@ -17,6 +20,7 @@ import ContentBlock from '../ContentBlock';
17
20
  import DivCssScoped from './DivCssScoped';
18
21
  import DivCssVar from './DivCssVar';
19
22
  import DivRadius from './DivRadius';
23
+ import DivTransform from './DivTransform';
20
24
 
21
25
  export default {
22
26
  props: {
@@ -28,6 +32,7 @@ export default {
28
32
  DivCssScoped,
29
33
  DivCssVar,
30
34
  DivRadius,
35
+ DivTransform,
31
36
  },
32
37
  computed: {
33
38
  contentBlockProps() {
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div id='layout-root'>
3
3
  <div class="content-font" :style="{ width: 70, height: 50, backgroundColor: 'rgba(0, 255, 0, 1)' }">坐标未设</div>
4
- <div class="content-font" :style="{ top: 0, left: 75, backgroundColor: 'rgba(0, 255, 0, 1)' }">宽高未设</div>
5
- <div class="content-font" :style="{ top: 55, left: 0, width: 70, height: 50, backgroundColor: 'rgba(0, 200, 0, 1)', visibility: 'hidden' }">不可视</div>
4
+ <!-- <div class="content-font" :style="{ top: 0, left: 75, backgroundColor: 'rgba(0, 255, 0, 1)' }">宽高未设</div> -->
5
+ <div class="content-font" :style="{ top: 55, left: 0, width: 70, height: 50, backgroundColor: 'rgba(0, 200, 0, 1)', visibility: 'hidden' }">(X)不可视</div>
6
6
  <div class="content-font" :style="{ top: 55, left: 75, width: 70, height: 50, backgroundColor: 'rgba(0, 200, 0, 1)', visibility: 'visible' }">可视属性</div>
7
- </div>;
7
+ </div>
8
8
  </template>
9
9
 
10
10
  <style>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div id='layout-root'>
3
+ <div class="content-font" :style="{
4
+ left: 10, top: 10,
5
+ width: blockSize.width, height: blockSize.height,
6
+ backgroundColor: 'rgba(255, 255, 0, 1)',
7
+ transform: 'rotate3d(0, 0, 1, 30deg)' }">
8
+ rotate3d
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup>
14
+ /* eslint-disable no-unused-vars */
15
+ import iconImgPath from '../../assets/icon.png';
16
+
17
+ const blockSize = {
18
+ width: 65,
19
+ height: 65,
20
+ };
21
+
22
+ const gap = 5;
23
+ </script>
24
+
25
+ <style>
26
+ @import "../FontStyle.css";
27
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div id='item-root'>
3
+ <ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="图片显示">
4
+ <ImgLayout/>
5
+ </ContentBlock>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import ContentBlock from '../ContentBlock';
11
+ import ImgLayout from './ImgLayout';
12
+
13
+ export default {
14
+ props: {
15
+ contentClass: String,
16
+ itemSides: Object
17
+ },
18
+ components: {
19
+ ContentBlock,
20
+ ImgLayout,
21
+ },
22
+ computed: {
23
+ contentBlockProps() {
24
+ return {
25
+ colIndex: 0,
26
+ itemSides: this.itemSides
27
+ }
28
+ }
29
+ }
30
+ }
31
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div id='layout-root'>
3
+ <div style="{top: 0}">
4
+ <div class="content-font" :style="{width: 50, height: titleHeight}">原图</div>
5
+ <div :style="{top: titleHeight,
6
+ width: imageSize.width+4, height: imageSize.height+4,
7
+ backgroundColor: 'rgba(0, 255, 0, 1)' }">
8
+ <img :style="{ left: 2, top: 2,
9
+ width: imageSize.width, height: imageSize.height}"
10
+ :src="testImgPath"/>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import testImgPath from '../../assets/test.jpg';
18
+
19
+ export default {
20
+ computed: {
21
+ testImgPath() {
22
+ return testImgPath;
23
+ },
24
+ titleHeight() {
25
+ return 16;
26
+ },
27
+ imageSize() {
28
+ return {
29
+ width: 80,
30
+ height: 64,
31
+ }
32
+ },
33
+ }
34
+ }
35
+
36
+ </script>
37
+
38
+
39
+ <style>
40
+ @import "../FontStyle.css";
41
+ </style>
@@ -0,0 +1,53 @@
1
+ <script>
2
+ import TitleBar from './TitleBar';
3
+ import DivGroup1 from '../div/DivGroup1';
4
+ import DivGroup2 from '../div/DivGroup2';
5
+ import TextGroup1 from '../text/TextGroup1';
6
+ import TextGroup2 from '../text/TextGroup2';
7
+ import AnimGroup from '../anim/AnimGroup';
8
+
9
+ export default {
10
+ props: {
11
+ panelClass: String,
12
+ itemSides: Object,
13
+ },
14
+ components: {
15
+ TitleBar,
16
+ DivGroup1, DivGroup2,
17
+ TextGroup1, TextGroup2,
18
+ AnimGroup
19
+ },
20
+ computed: {
21
+ titleData() {
22
+ return [
23
+ 'div标签1',
24
+ 'div标签2',
25
+ 'div文本1',
26
+ 'div文本2',
27
+ 'div动画',
28
+ ];
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <template>
35
+ <div :class="panelClass">
36
+ <TitleBar :class="panelClass" :itemSides=itemSides :titleData=titleData />
37
+ <div :class="panelClass" :style="{top:20}">
38
+ <DivGroup1 :style="{left: itemSides.width*0}"
39
+ :contentClass="panelClass" :itemSides=itemSides />
40
+ <DivGroup2 :style="{left: itemSides.width*1}"
41
+ :contentClass="panelClass" :itemSides=itemSides />
42
+ <TextGroup1 :style="{left: itemSides.width*2}"
43
+ :contentClass="panelClass" :itemSides=itemSides />
44
+ <TextGroup2 :style="{left: itemSides.width*3}"
45
+ :contentClass="panelClass" :itemSides=itemSides />
46
+ <AnimGroup :style="{left: itemSides.width*4}"
47
+ :contentClass="panelClass" :itemSides=itemSides />
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <style>
53
+ </style>
@@ -0,0 +1,35 @@
1
+ <script>
2
+ import TitleBar from './TitleBar';
3
+ import ImageGroup from '../img/ImageGroup';
4
+
5
+ export default {
6
+ props: {
7
+ panelClass: String,
8
+ itemSides: Object,
9
+ },
10
+ components: {
11
+ TitleBar,
12
+ ImageGroup
13
+ },
14
+ computed: {
15
+ titleData() {
16
+ return [
17
+ 'img标签',
18
+ ];
19
+ }
20
+ }
21
+ }
22
+ </script>
23
+
24
+ <template>
25
+ <div :class="panelClass">
26
+ <TitleBar :class="panelClass" :itemSides=itemSides :titleData=titleData />
27
+ <div :class="panelClass" :style="{top:20}">
28
+ <ImageGroup :style="{left: itemSides.width*0}"
29
+ :contentClass="panelClass" :itemSides=itemSides />
30
+ </div>
31
+ </div>
32
+ </template>
33
+
34
+ <style>
35
+ </style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div>
3
+ <template v-for="(title, index) in titleData" :key="index" >
4
+ <div class='title-font item-style' :style="{...itemSides, left: itemSides.width * index}">
5
+ {{ title }}
6
+ </div>
7
+ </template>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ props: {
14
+ itemSides: Object,
15
+ titleData: Array
16
+ }
17
+ }
18
+ </script>
19
+
20
+ <style>
21
+ @import "../FontStyle.css";
22
+ </style>
23
+
24
+ <style scoped>
25
+ .item-style {
26
+ text-align: center;
27
+ }
28
+
29
+ </style>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div id='layout-root'>
3
+ <div
4
+ :style="{
5
+ width: 300, height: 100,
6
+ fontSize: 20,
7
+ JsvTextEmoji: true
8
+ }"
9
+ >
10
+ style: 😀笑🇨🇳中国\n👨‍👩‍👧‍👦家庭
11
+ </div>
12
+ <div
13
+ class="emoji"
14
+ >
15
+ class: 😀笑🇨🇳中国\n👨‍👩‍👧‍👦家庭
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ </script>
22
+
23
+ <style>
24
+ .emoji{
25
+ top: 100;
26
+ width: 300;
27
+ height: 100;
28
+ font-size: 20;
29
+ }
30
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div id='item-root'>
3
+ <ContentBlock :class=contentClass :style="{ top: itemSides.height*0}" :=contentBlockProps :index=0 title="文字对齐">
4
+ <TextEmoji/>
5
+ </ContentBlock>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import ContentBlock from '../ContentBlock';
11
+ import TextEmoji from './TextEmoji';
12
+
13
+ export default {
14
+ props: {
15
+ contentClass: String,
16
+ itemSides: Object
17
+ },
18
+ components: {
19
+ ContentBlock,
20
+ TextEmoji,
21
+ },
22
+ computed: {
23
+ contentBlockProps() {
24
+ return {
25
+ colIndex: 0,
26
+ itemSides: this.itemSides
27
+ }
28
+ }
29
+ }
30
+ }
31
+ </script>
@@ -34,6 +34,7 @@ export default {
34
34
  onKeyDown: Function,
35
35
  onFocus: Function,
36
36
  onBlur: Function,
37
+ onCustomerEvent: Function,
37
38
  },
38
39
 
39
40
  setup(props) {
@@ -100,6 +101,10 @@ export default {
100
101
  this.$el.FocusNodeRef.requestFocus(passToChild);
101
102
  },
102
103
 
104
+ bubbleCustomerEvent(ev) {
105
+ this.$el.FocusNodeRef.bubbleCustomerEvent(ev);
106
+ },
107
+
103
108
  debugPrintFocusChain() {
104
109
  this.$el.FocusNodeRef.printFocusNodeList();
105
110
  },
@@ -147,6 +152,11 @@ export default {
147
152
  focusNode.setOnBlur(this.$_onBlur);
148
153
  }
149
154
 
155
+ this.actionCallback.onCustomerEvent =
156
+ this.$props.onCustomerEvent || this.$props.onAction?.onCustomerEvent;
157
+ if (this.actionCallback.onCustomerEvent) {
158
+ focusNode.setOnCustomerEvent(this.$_onCustomerEvent);
159
+ }
150
160
  // 建立父子关系链
151
161
  let self = this.$el;
152
162
  let parent = self.parentElement;
@@ -189,6 +199,9 @@ export default {
189
199
  $_onBlur() {
190
200
  this.actionCallback?.onBlur(this) || false;
191
201
  },
202
+ $_onCustomerEvent(ev) {
203
+ return this.actionCallback?.onCustomerEvent(ev) || false;
204
+ },
192
205
  },
193
206
  };
194
207
  </script>
@@ -0,0 +1,63 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-09-22 13:47:23
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-03-02 10:15:03
6
+ * @Description: file content
7
+ -->
8
+ <script>
9
+ import ItemView from "./ItemView.vue";
10
+
11
+ export default {
12
+ props: {
13
+ tokenForRefresh: Number,
14
+ dataUpdateToken: Number,
15
+ onItemEdge: Function,
16
+ loadAll: Boolean,
17
+ enableTouch: Boolean,
18
+ onLoad: Function,
19
+ widgetHandler: Object,
20
+ enableItemRenderBreak: Boolean,
21
+ placeHolderSetting: Object,
22
+ },
23
+ setup() {
24
+ return {
25
+ innerData: [],
26
+ };
27
+ },
28
+ methods: {
29
+ updateData(data) {
30
+ this.innerData = data;
31
+ },
32
+ },
33
+ components: {
34
+ ItemView,
35
+ },
36
+ mounted() {
37
+ this.onLoad();
38
+ },
39
+ updated() {
40
+ this.onLoad();
41
+ },
42
+ };
43
+ </script>
44
+
45
+ <template>
46
+ <item-view
47
+ v-for="item in innerData"
48
+ :key="dataUpdateToken + '_' + item.index"
49
+ :index="item.index"
50
+ :data="item.data"
51
+ :loadAll="loadAll"
52
+ :enableTouch="enableTouch"
53
+ :onEdge="onItemEdge"
54
+ :controlObj="item.controller"
55
+ :widgetHandler="widgetHandler"
56
+ :enableItemRenderBreak="enableItemRenderBreak"
57
+ :placeHolderSetting="placeHolderSetting"
58
+ >
59
+ <template v-slot:renderItem="slotProps">
60
+ <slot name="renderItem" v-bind="slotProps"></slot>
61
+ </template>
62
+ </item-view>
63
+ </template>
@@ -0,0 +1,19 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2021-09-22 16:50:09
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-01-26 10:17:47
6
+ * @Description: file content
7
+ */
8
+ import { BaseDispatcher } from "../WidgetCommon";
9
+
10
+ class Dispatcher extends BaseDispatcher {}
11
+ Dispatcher.Type = {
12
+ setFocusId: Symbol("setFocusId"),
13
+ updateItem: Symbol("updateItem"),
14
+ slideToItem: Symbol("slideTo"),
15
+ setEnterFocusId: Symbol("setEnterFocusId"),
16
+ setEnterFocusRect: Symbol("setEnterFocusRect"),
17
+ };
18
+ export { Dispatcher as SWidgetDispatcher };
19
+ export default Dispatcher;
@@ -0,0 +1,51 @@
1
+ <!--
2
+ * @Author: ChenChanghua
3
+ * @Date: 2022-01-14 18:18:00
4
+ * @LastEditors: ChenChanghua
5
+ * @LastEditTime: 2022-03-24 16:57:36
6
+ * @Description: file content
7
+ -->
8
+ <script>
9
+ export default {
10
+ props: [
11
+ "data",
12
+ "onEdge",
13
+ "onAction",
14
+ "queryObj",
15
+ "widgetHandler",
16
+ "index",
17
+ "onFocus",
18
+ "onmounted",
19
+ ],
20
+ mounted() {
21
+ // this.widgetHandler.updateMounted(this.index, true);
22
+ this.onmounted?.();
23
+ const curFocus = this.widgetHandler.getCurrentFocusId();
24
+ if (this.widgetHandler.isFocus() && curFocus.index === this.index) {
25
+ //unmount 后导致的onFocus 在 mount 前,onFocus 为生效的问题
26
+ this.onFocus(this.widgetHandler.getPreEdgeRect());
27
+ }
28
+ },
29
+ beforeUnmount() {
30
+ // this.widgetHandler.updateMounted(this.index, false);
31
+ },
32
+ };
33
+ </script>
34
+
35
+ <template>
36
+ <div
37
+ ref="element"
38
+ :style="{
39
+ width: data.width,
40
+ height: data.height,
41
+ }"
42
+ >
43
+ <slot
44
+ name="renderItem"
45
+ :data="data.data"
46
+ :onEdge="onEdge"
47
+ :onAction="onAction"
48
+ :query="queryObj"
49
+ ></slot>
50
+ </div>
51
+ </template>