@quicktvui/web-renderer 1.0.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/package.json +24 -0
- package/src/adapters/es3-video-player.js +828 -0
- package/src/components/Modal.js +119 -0
- package/src/components/QtAnimationView.js +678 -0
- package/src/components/QtBaseComponent.js +165 -0
- package/src/components/QtFastListView.js +1920 -0
- package/src/components/QtFlexView.js +799 -0
- package/src/components/QtImage.js +203 -0
- package/src/components/QtItemFrame.js +239 -0
- package/src/components/QtItemStoreView.js +93 -0
- package/src/components/QtItemView.js +125 -0
- package/src/components/QtListView.js +331 -0
- package/src/components/QtLoadingView.js +55 -0
- package/src/components/QtPageRootView.js +19 -0
- package/src/components/QtPlayMark.js +168 -0
- package/src/components/QtProgressBar.js +199 -0
- package/src/components/QtQRCode.js +78 -0
- package/src/components/QtReplaceChild.js +149 -0
- package/src/components/QtRippleView.js +166 -0
- package/src/components/QtSeekBar.js +409 -0
- package/src/components/QtText.js +679 -0
- package/src/components/QtTransitionImage.js +170 -0
- package/src/components/QtView.js +706 -0
- package/src/components/QtWebView.js +613 -0
- package/src/components/TabsView.js +420 -0
- package/src/components/ViewPager.js +206 -0
- package/src/components/index.js +24 -0
- package/src/components/plugins/TextV2Component.js +70 -0
- package/src/components/plugins/index.js +7 -0
- package/src/core/SceneBuilder.js +58 -0
- package/src/core/TVFocusManager.js +2014 -0
- package/src/core/asyncLocalStorage.js +175 -0
- package/src/core/autoProxy.js +165 -0
- package/src/core/componentRegistry.js +84 -0
- package/src/core/constants.js +6 -0
- package/src/core/index.js +8 -0
- package/src/core/moduleUtils.js +36 -0
- package/src/core/patches.js +958 -0
- package/src/core/templateBinding.js +666 -0
- package/src/index.js +246 -0
- package/src/modules/AndroidDevelopModule.js +101 -0
- package/src/modules/AndroidDeviceModule.js +341 -0
- package/src/modules/AndroidNetworkModule.js +178 -0
- package/src/modules/AndroidSharedPreferencesModule.js +100 -0
- package/src/modules/ESDeviceInfoModule.js +450 -0
- package/src/modules/ESGroupDataModule.js +195 -0
- package/src/modules/ESIJKAudioPlayerModule.js +477 -0
- package/src/modules/ESLocalStorageModule.js +100 -0
- package/src/modules/ESLogModule.js +65 -0
- package/src/modules/ESModule.js +106 -0
- package/src/modules/ESNetworkSpeedModule.js +117 -0
- package/src/modules/ESToastModule.js +172 -0
- package/src/modules/EsNativeModule.js +117 -0
- package/src/modules/FastListModule.js +101 -0
- package/src/modules/FocusModule.js +145 -0
- package/src/modules/RuntimeDeviceModule.js +176 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Modal component - Native modal container for qt-dialog
|
|
2
|
+
// In web, this renders as a full-screen overlay
|
|
3
|
+
import { QtBaseComponent } from './QtBaseComponent'
|
|
4
|
+
import { registerComponent } from '../core/componentRegistry'
|
|
5
|
+
|
|
6
|
+
export class Modal extends QtBaseComponent {
|
|
7
|
+
constructor(context, id, pId) {
|
|
8
|
+
super(context, id, pId)
|
|
9
|
+
this.tagName = 'Modal'
|
|
10
|
+
this.dom = document.createElement('div')
|
|
11
|
+
this.dom.setAttribute('data-component-name', 'Modal')
|
|
12
|
+
|
|
13
|
+
// Default styles for modal overlay
|
|
14
|
+
this.dom.style.cssText = `
|
|
15
|
+
position: fixed;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
z-index: 9999;
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
// Register by id for findComponentById
|
|
27
|
+
registerComponent(id, this)
|
|
28
|
+
|
|
29
|
+
// Track visibility state
|
|
30
|
+
this._visible = true
|
|
31
|
+
this._transparent = true
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
defaultStyle() {
|
|
35
|
+
return {
|
|
36
|
+
position: 'fixed',
|
|
37
|
+
top: 0,
|
|
38
|
+
left: 0,
|
|
39
|
+
width: '100%',
|
|
40
|
+
height: '100%',
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
zIndex: 9999,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
updateProperty(key, value) {
|
|
49
|
+
switch (key) {
|
|
50
|
+
case 'transparent':
|
|
51
|
+
this._transparent = value
|
|
52
|
+
if (value) {
|
|
53
|
+
this.dom.style.backgroundColor = 'transparent'
|
|
54
|
+
} else {
|
|
55
|
+
this.dom.style.backgroundColor = 'rgba(0, 0, 0, 0.5)'
|
|
56
|
+
}
|
|
57
|
+
break
|
|
58
|
+
|
|
59
|
+
case 'immersionStatusBar':
|
|
60
|
+
// In web, this doesn't apply but we store it
|
|
61
|
+
this._immersionStatusBar = value
|
|
62
|
+
break
|
|
63
|
+
|
|
64
|
+
case 'visible':
|
|
65
|
+
case 'visibility':
|
|
66
|
+
this._setVisible(value)
|
|
67
|
+
break
|
|
68
|
+
|
|
69
|
+
default:
|
|
70
|
+
super.updateProperty(key, value)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
_setVisible(visible) {
|
|
75
|
+
this._visible = visible
|
|
76
|
+
if (visible) {
|
|
77
|
+
this.dom.style.display = 'flex'
|
|
78
|
+
// Dispatch show event
|
|
79
|
+
this.dispatchEvent('show', {})
|
|
80
|
+
} else {
|
|
81
|
+
this.dom.style.display = 'none'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Called when the modal is mounted
|
|
86
|
+
mounted() {
|
|
87
|
+
super.mounted?.()
|
|
88
|
+
// Dispatch show event when mounted
|
|
89
|
+
if (this._visible !== false) {
|
|
90
|
+
// Delay to ensure event listeners are registered
|
|
91
|
+
requestAnimationFrame(() => {
|
|
92
|
+
this.dispatchEvent('show', {})
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Handle click outside to close
|
|
98
|
+
_handleClickOutside(e) {
|
|
99
|
+
// Only close if clicking the backdrop (not children)
|
|
100
|
+
if (e.target === this.dom) {
|
|
101
|
+
this.dispatchEvent('requestclose', {})
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Show the modal
|
|
106
|
+
show() {
|
|
107
|
+
this._setVisible(true)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Hide the modal
|
|
111
|
+
hide() {
|
|
112
|
+
this._setVisible(false)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Close the modal (dispatches requestClose event)
|
|
116
|
+
close() {
|
|
117
|
+
this.dispatchEvent('requestclose', {})
|
|
118
|
+
}
|
|
119
|
+
}
|