@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.
- package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/target_core_revision.js +3 -3
- package/loader/jsview.config.default.js +1 -1
- package/loader/jsview.default.config.js +1 -1
- package/loader/loader.js +2 -1
- package/package.json +1 -1
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +1 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +20 -7
- package/samples/Basic/App.vue +37 -29
- package/samples/Basic/components/ContentBlock.vue +1 -1
- package/samples/Basic/components/FontStyle.css +6 -0
- package/samples/Basic/components/div/DivBackground.vue +1 -1
- package/samples/Basic/components/div/DivCssScoped.vue +6 -13
- package/samples/Basic/components/div/DivCssVar.vue +3 -7
- package/samples/Basic/components/div/DivGroup2.vue +7 -2
- package/samples/Basic/components/div/DivLayout.vue +3 -3
- package/samples/Basic/components/div/DivTransform.vue +27 -0
- package/samples/Basic/components/img/ImageGroup.vue +31 -0
- package/samples/Basic/components/img/ImgLayout.vue +41 -0
- package/samples/Basic/components/panel/Panel1.vue +53 -0
- package/samples/Basic/components/panel/Panel2.vue +35 -0
- package/samples/Basic/components/panel/TitleBar.vue +29 -0
- package/samples/Basic/components/text/TextEmoji.vue +30 -0
- package/samples/Basic/components/text/{TextGroup.vue → TextGroup1.vue} +0 -0
- package/samples/Basic/components/text/TextGroup2.vue +31 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +13 -0
- package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +63 -0
- package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.js +19 -0
- package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +51 -0
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +220 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1860 -0
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +153 -0
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +137 -118
- package/utils/JsViewEngineWidget/TemplateParser.js +212 -158
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/BrowserPluginLoader.js +14 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +502 -108
- package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +101 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +262 -92
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +40 -0
- package/utils/JsViewPlugin/JsvPlayer/index.js +27 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +1 -2
- package/utils/JsViewVueWidget/JsvMarquee.vue +18 -10
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -3
- package/utils/JsViewVueWidget/JsvNinePatch.vue +28 -10
- package/samples/Basic/components/TitleBar.vue +0 -27
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2021-09-18 14:34:20
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-03-25 14:30:24
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import Forge from "../ForgeDefine";
|
|
10
|
+
import DivWrapper from "./DivWrapper.vue";
|
|
11
|
+
import { EdgeDirection } from "../WidgetCommon";
|
|
12
|
+
|
|
13
|
+
import { ref } from "vue";
|
|
14
|
+
const DirectionMap = (direction) => {
|
|
15
|
+
switch (direction) {
|
|
16
|
+
case EdgeDirection.left:
|
|
17
|
+
return "left";
|
|
18
|
+
case EdgeDirection.right:
|
|
19
|
+
return "right";
|
|
20
|
+
case EdgeDirection.top:
|
|
21
|
+
return "top";
|
|
22
|
+
case EdgeDirection.bottom:
|
|
23
|
+
return "bottom";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export default {
|
|
27
|
+
components: { DivWrapper },
|
|
28
|
+
props: {
|
|
29
|
+
data: Object,
|
|
30
|
+
loadAll: Boolean,
|
|
31
|
+
enableTouch: Boolean,
|
|
32
|
+
controlObj: Object,
|
|
33
|
+
onEdge: Function,
|
|
34
|
+
widgetHandler: Object,
|
|
35
|
+
index: Number,
|
|
36
|
+
enableItemRenderBreak: Boolean,
|
|
37
|
+
placeHolderSetting: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default() {
|
|
40
|
+
return {
|
|
41
|
+
backgroundColor: "rgba(255,255,255,0.5)",
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
setup() {
|
|
47
|
+
let onAction = {
|
|
48
|
+
register(name, func) {
|
|
49
|
+
this[name] = func;
|
|
50
|
+
},
|
|
51
|
+
unregister(name) {
|
|
52
|
+
delete this[name];
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
let mounted = ref(false);
|
|
56
|
+
return {
|
|
57
|
+
onAction,
|
|
58
|
+
queryObj: null,
|
|
59
|
+
touchTested: false,
|
|
60
|
+
mounted,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
placeHolderGap() {
|
|
65
|
+
return this.placeHolderSetting.gap ? this.placeHolderSetting.gap : 0;
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
onFocus(preEdge) {
|
|
70
|
+
this.widgetHandler.onFocusChange(this.data.id);
|
|
71
|
+
if (this.onAction.onFocus) {
|
|
72
|
+
this.onAction.onFocus(preEdge);
|
|
73
|
+
}
|
|
74
|
+
let event = {
|
|
75
|
+
type: "focusRect",
|
|
76
|
+
direction: DirectionMap(preEdge?.direction),
|
|
77
|
+
element: this.getDivElement(),
|
|
78
|
+
};
|
|
79
|
+
this.widgetHandler.sendCustomerEvent(event);
|
|
80
|
+
},
|
|
81
|
+
onBlur() {
|
|
82
|
+
if (this.onAction.onBlur) {
|
|
83
|
+
this.onAction.onBlur();
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
onClick() {
|
|
87
|
+
if (this.onAction.onClick) {
|
|
88
|
+
return this.onAction.onClick();
|
|
89
|
+
} else {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
reachEdge(edgeInfo) {
|
|
94
|
+
if (this.onAction.onWidgetEdge) {
|
|
95
|
+
this.onAction.onWidgetEdge(edgeInfo);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
getDivElement() {
|
|
99
|
+
return this.$refs.itemDiv;
|
|
100
|
+
},
|
|
101
|
+
testTouchEnable() {
|
|
102
|
+
if (this.enableTouch) {
|
|
103
|
+
if (this.$refs.element) {
|
|
104
|
+
if (!this.touchTested) {
|
|
105
|
+
// 为view添加触控处理
|
|
106
|
+
let view = this.$refs.element.jsvMaskView;
|
|
107
|
+
var dragSetting = new Forge.DragSetting(
|
|
108
|
+
Forge.DragSetting.DIRECTION_DISABLE,
|
|
109
|
+
20,
|
|
110
|
+
false,
|
|
111
|
+
new Forge.RectArea(0, 0, 0, 0),
|
|
112
|
+
-1,
|
|
113
|
+
3 / 4
|
|
114
|
+
);
|
|
115
|
+
let callback = {
|
|
116
|
+
OnTap: (msg) => {
|
|
117
|
+
console.log("Item View Container OnTap:", msg);
|
|
118
|
+
return this.onClick(this.data.id);
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
view.EnableDrag(dragSetting, callback, "translateMat(dx,dy,0)");
|
|
122
|
+
this.touchTested = true;
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
// 元素消失后要重新设置Touch处理
|
|
126
|
+
this.touchTested = false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
onDivMounted() {
|
|
131
|
+
this.mounted = true;
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
created() {
|
|
135
|
+
this.queryObj = {
|
|
136
|
+
id: this.data.id,
|
|
137
|
+
index: this.index,
|
|
138
|
+
position: this.widgetHandler.getPosition,
|
|
139
|
+
templatePosition: this.widgetHandler.getTemplatePosition,
|
|
140
|
+
absolutePosition: this.widgetHandler.getAbsolutePosition,
|
|
141
|
+
getCurrentFocusId: this.widgetHandler.getCurrentFocusId,
|
|
142
|
+
slideTo: this.widgetHandler.customerSlide,
|
|
143
|
+
};
|
|
144
|
+
this.widgetHandler.registerItemRef(this.index, this);
|
|
145
|
+
//export handlers
|
|
146
|
+
this.widgetHandler.registerItemFunc(this.index, {
|
|
147
|
+
onFocus: this.onFocus,
|
|
148
|
+
onBlur: this.onBlur,
|
|
149
|
+
onClick: this.onClick,
|
|
150
|
+
reachEdge: this.reachEdge,
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
mounted() {
|
|
154
|
+
this.widgetHandler.updateMounted(this.index, true);
|
|
155
|
+
//TODO 触控的处理有待添加
|
|
156
|
+
// this.testTouchEnable();
|
|
157
|
+
// this.widgetHandler.updateMounted(this.index, true);
|
|
158
|
+
// const curFocus = this.widgetHandler.getCurrentFocusId();
|
|
159
|
+
// if (this.widgetHandler.isFocus() && curFocus.index === this.index) {
|
|
160
|
+
// //unmount 后导致的onFocus 在 mount 前,onFocus 为生效的问题
|
|
161
|
+
// this.onFocus();
|
|
162
|
+
// }
|
|
163
|
+
},
|
|
164
|
+
updated() {
|
|
165
|
+
//TODO 触控的处理有待添加
|
|
166
|
+
// this.testTouchEnable();
|
|
167
|
+
},
|
|
168
|
+
beforeUnmount() {
|
|
169
|
+
this.widgetHandler.updateMounted(this.index, false);
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
</script>
|
|
173
|
+
|
|
174
|
+
<template>
|
|
175
|
+
<div
|
|
176
|
+
:style="{
|
|
177
|
+
zIndex: controlObj.zIndex,
|
|
178
|
+
}"
|
|
179
|
+
>
|
|
180
|
+
<div
|
|
181
|
+
ref="itemDiv"
|
|
182
|
+
:style="{
|
|
183
|
+
left: data.xPos,
|
|
184
|
+
top: data.yPos,
|
|
185
|
+
width: data.width,
|
|
186
|
+
height: data.height,
|
|
187
|
+
}"
|
|
188
|
+
>
|
|
189
|
+
<div
|
|
190
|
+
v-if="enableItemRenderBreak && placeHolderSetting && !mounted"
|
|
191
|
+
:style="{
|
|
192
|
+
width: data.width - placeHolderGap,
|
|
193
|
+
height: data.height - placeHolderGap,
|
|
194
|
+
backgroundColor: placeHolderSetting.backgroundColor,
|
|
195
|
+
borderRadius: placeHolderSetting.borderRadius,
|
|
196
|
+
}"
|
|
197
|
+
></div>
|
|
198
|
+
<div-wrapper
|
|
199
|
+
v-if="
|
|
200
|
+
!enableItemRenderBreak || mounted || widgetHandler.handler.itemRender
|
|
201
|
+
"
|
|
202
|
+
ref="divWrapper"
|
|
203
|
+
:key="data.index"
|
|
204
|
+
:data="data"
|
|
205
|
+
:onEdge="onEdge"
|
|
206
|
+
:onAction="onAction"
|
|
207
|
+
:queryObj="queryObj"
|
|
208
|
+
:widgetHandler="widgetHandler"
|
|
209
|
+
:index="index"
|
|
210
|
+
:onFocus="onFocus"
|
|
211
|
+
:allowRenderBreak="enableItemRenderBreak"
|
|
212
|
+
:onmounted="onDivMounted"
|
|
213
|
+
>
|
|
214
|
+
<template v-slot:renderItem="slotProps">
|
|
215
|
+
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
216
|
+
</template>
|
|
217
|
+
</div-wrapper>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
</template>
|