@shjjs/visual-ui 1.0.33 → 1.0.34

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 (196) hide show
  1. package/es/commons/core/useChart.mjs +1 -1
  2. package/es/commons/plugins/datasource/index.d.ts +73 -73
  3. package/es/commons/plugins/datasource/index.mjs +214 -214
  4. package/es/commons/plugins/datasource/sources/api.d.ts +1 -1
  5. package/es/commons/plugins/datasource/sources/api.mjs +32 -32
  6. package/es/commons/plugins/datasource/sources/static.d.ts +1 -1
  7. package/es/commons/plugins/datasource/sources/static.mjs +17 -17
  8. package/es/commons/plugins/datasource/sources/storage.d.ts +1 -1
  9. package/es/commons/plugins/datasource/sources/storage.mjs +28 -28
  10. package/es/commons/plugins/datasource/sources/url.d.ts +1 -1
  11. package/es/commons/plugins/datasource/sources/url.mjs +17 -17
  12. package/es/commons/plugins/datasource/sources/variable.d.ts +1 -1
  13. package/es/commons/plugins/datasource/sources/variable.mjs +17 -17
  14. package/es/commons/plugins/datasource/sources/ws.d.ts +32 -32
  15. package/es/commons/plugins/datasource/sources/ws.mjs +139 -139
  16. package/es/commons/plugins/datasource/utils/axios.d.ts +70 -70
  17. package/es/commons/plugins/datasource/utils/axios.mjs +134 -134
  18. package/es/commons/plugins/datasource/utils/request.d.ts +3 -3
  19. package/es/commons/plugins/datasource/utils/request.mjs +5 -5
  20. package/es/commons/plugins/datasource/utils/utils.d.ts +115 -115
  21. package/es/commons/plugins/datasource/utils/utils.mjs +229 -229
  22. package/es/commons/plugins/datasource/utils/wsManager.d.ts +16 -16
  23. package/es/commons/plugins/datasource/utils/wsManager.mjs +78 -78
  24. package/es/commons/plugins/event/actions/fullScreenAction.d.ts +8 -8
  25. package/es/commons/plugins/event/actions/fullScreenAction.mjs +8 -8
  26. package/es/commons/plugins/event/actions/invokeAction.d.ts +8 -8
  27. package/es/commons/plugins/event/actions/invokeAction.mjs +11 -11
  28. package/es/commons/plugins/event/actions/linkAction.d.ts +8 -8
  29. package/es/commons/plugins/event/actions/linkAction.mjs +8 -8
  30. package/es/commons/plugins/event/actions/moveAction.d.ts +8 -8
  31. package/es/commons/plugins/event/actions/moveAction.mjs +15 -15
  32. package/es/commons/plugins/event/actions/refreshVariableAction.d.ts +7 -7
  33. package/es/commons/plugins/event/actions/refreshVariableAction.mjs +18 -18
  34. package/es/commons/plugins/event/actions/rotateAction.d.ts +8 -8
  35. package/es/commons/plugins/event/actions/rotateAction.mjs +19 -19
  36. package/es/commons/plugins/event/actions/scaleAction.d.ts +8 -8
  37. package/es/commons/plugins/event/actions/scaleAction.mjs +24 -24
  38. package/es/commons/plugins/event/actions/sendApiAction.d.ts +8 -8
  39. package/es/commons/plugins/event/actions/sendApiAction.mjs +16 -16
  40. package/es/commons/plugins/event/actions/ueCommonsWebscoketAction.d.ts +7 -7
  41. package/es/commons/plugins/event/actions/ueCommonsWebscoketAction.mjs +31 -31
  42. package/es/commons/plugins/event/actions/ueShjExecMethodAction.d.ts +7 -7
  43. package/es/commons/plugins/event/actions/ueShjExecMethodAction.mjs +31 -31
  44. package/es/commons/plugins/event/actions/unityIframeExecMethodAction.d.ts +7 -7
  45. package/es/commons/plugins/event/actions/unityIframeExecMethodAction.mjs +28 -28
  46. package/es/commons/plugins/event/actions/unityWebglExecMethodAction.d.ts +7 -7
  47. package/es/commons/plugins/event/actions/unityWebglExecMethodAction.mjs +28 -28
  48. package/es/commons/plugins/event/actions/updatePageAction.d.ts +8 -8
  49. package/es/commons/plugins/event/actions/updatePageAction.mjs +6 -6
  50. package/es/commons/plugins/event/actions/updateVariableAction.d.ts +7 -7
  51. package/es/commons/plugins/event/actions/updateVariableAction.mjs +25 -25
  52. package/es/commons/plugins/event/actions/updateWidgetAction.d.ts +7 -7
  53. package/es/commons/plugins/event/actions/updateWidgetAction.mjs +14 -14
  54. package/es/commons/plugins/event/actions/vrSceneMethodAction.d.ts +7 -7
  55. package/es/commons/plugins/event/actions/vrSceneMethodAction.mjs +12 -12
  56. package/es/commons/plugins/event/index.d.ts +206 -206
  57. package/es/commons/plugins/event/index.mjs +161 -161
  58. package/es/commons/plugins/event/utils/utils.d.ts +22 -22
  59. package/es/commons/plugins/event/utils/utils.mjs +50 -50
  60. package/es/commons/utils/componentRefs.d.ts +28 -28
  61. package/es/commons/utils/componentRefs.mjs +37 -37
  62. package/es/commons/utils/getNextElement.d.ts +7 -7
  63. package/es/commons/utils/getNextElement.mjs +12 -12
  64. package/es/components/chart/commons/components/common-chart/index.vue.mjs +10 -11
  65. package/es/components/chart/commons/components/common-chart-map/index.vue.mjs +6 -7
  66. package/es/components/chart/commons/hooks/useChart.mjs +1 -1
  67. package/es/components/chart-other-candlestick-basic/index.vue.mjs +7 -8
  68. package/es/components/chart-other-candlestick-demo/index.vue.mjs +16 -17
  69. package/es/components/chart-other-candlestick-shanghai/index.vue.mjs +14 -15
  70. package/es/components/chart-other-circular-graph/index.vue.mjs +16 -17
  71. package/es/components/chart-other-force/index.vue.mjs +19 -20
  72. package/es/components/chart-other-force2/index.vue.mjs +19 -20
  73. package/es/components/chart-other-funnel/index.vue.mjs +16 -17
  74. package/es/components/chart-other-funnel-contrast/index.vue.mjs +16 -17
  75. package/es/components/chart-other-funnel-split/index.vue.mjs +16 -17
  76. package/es/components/chart-other-funnel2/index.vue.mjs +16 -17
  77. package/es/components/chart-other-gauge/index.vue.mjs +21 -22
  78. package/es/components/chart-other-gauge-grade/index.vue.mjs +20 -21
  79. package/es/components/chart-other-gauge-stage/index.vue.mjs +21 -22
  80. package/es/components/chart-other-graph-basic/index.vue.mjs +8 -9
  81. package/es/components/chart-other-graph-basic2/index.vue.mjs +8 -9
  82. package/es/components/chart-other-graph-calendar/index.vue.mjs +7 -8
  83. package/es/components/chart-other-grid-percentage/index.vue.mjs +3 -4
  84. package/es/components/chart-other-heatmap/index.vue.mjs +19 -20
  85. package/es/components/chart-other-label-gauge/index.vue.mjs +9 -10
  86. package/es/components/chart-other-liquidfill/index.vue.mjs +11 -12
  87. package/es/components/chart-other-parallel-basic/index.vue.mjs +15 -16
  88. package/es/components/chart-other-parallel-mul/index.vue.mjs +6 -7
  89. package/es/components/chart-other-radar/index.vue.mjs +20 -21
  90. package/es/components/chart-other-radar-stack/index.vue.mjs +6 -7
  91. package/es/components/chart-other-sunburst-basic/index.vue.mjs +12 -13
  92. package/es/components/chart-other-sunburst-basic2/index.vue.mjs +12 -13
  93. package/es/components/chart-other-sunburst-basic3/index.vue.mjs +12 -13
  94. package/es/components/chart-other-sunburst-basic4/index.vue.mjs +12 -13
  95. package/es/components/chart-other-sunburst-book/index.vue.mjs +7 -8
  96. package/es/components/chart-other-sunburst-flavors/index.vue.mjs +16 -17
  97. package/es/components/chart-other-sunburst-radius/index.vue.mjs +18 -19
  98. package/es/components/chart-other-theme-river/index.vue.mjs +3 -4
  99. package/es/components/chart-other-tree/index.vue.mjs +8 -9
  100. package/es/components/chart-other-tree-line/index.vue.mjs +7 -8
  101. package/es/components/chart-other-treemap/index.vue.mjs +9 -10
  102. package/es/components/chart-other-treemap-basic/index.vue.mjs +14 -15
  103. package/es/components/chart-other-word-cloud/index.vue.mjs +11 -12
  104. package/es/components/commons-echarts/compileAndRunEcharts.mjs +8 -9
  105. package/es/components/commons-loop-iterator/index.vue.mjs +2 -2
  106. package/es/components/commons-loop-iterator/index.vue2.mjs +3 -4
  107. package/es/components/commons-product-model/index.vue.mjs +2 -2
  108. package/es/components/commons-product-model/index.vue2.mjs +1 -1
  109. package/es/components/commons-three-loader/index.vue.mjs +1 -1
  110. package/es/components/commons-three-loader/index.vue2.mjs +1 -1
  111. package/es/components/commons-three-loader3/index.vue.mjs +1 -1
  112. package/es/components/commons-three-loader3/index.vue2.mjs +1 -1
  113. package/es/components/commons-weather/index.vue.mjs +2 -2
  114. package/es/components/commons-weather/index.vue2.mjs +1 -1
  115. package/es/components/commons-weather-dynamic/index.vue.mjs +1 -1
  116. package/es/components/commons-weather-dynamic/index.vue2.mjs +3 -4
  117. package/es/components/interaction/button/index.vue.mjs +2 -2
  118. package/es/components/interaction/button/index.vue2.mjs +65 -65
  119. package/es/components/interaction/date-picker/components/common-date-picker/index.vue.mjs +2 -2
  120. package/es/components/interaction/date-picker/components/common-date-picker/index.vue2.mjs +64 -65
  121. package/es/components/interaction/tabs/index.vue.mjs +11 -12
  122. package/es/components/interaction/tabs-icon/index.vue.mjs +6 -7
  123. package/es/components/interaction-input/index.vue.mjs +1 -1
  124. package/es/components/interaction-input/index.vue2.mjs +3 -4
  125. package/es/components/interaction-select/index.vue.mjs +1 -1
  126. package/es/components/interaction-select/index.vue2.mjs +6 -7
  127. package/es/components/interaction-slider/index.vue.mjs +2 -2
  128. package/es/components/interaction-slider/index.vue2.mjs +34 -35
  129. package/es/components/interaction-switch/index.vue.mjs +2 -2
  130. package/es/components/interaction-switch/index.vue2.mjs +20 -20
  131. package/es/components/interaction-tabs/index.vue.mjs +2 -2
  132. package/es/components/interaction-tabs/index.vue2.mjs +1 -1
  133. package/es/components/interaction-tabs2/index.vue.mjs +2 -2
  134. package/es/components/interaction-tabs2/index.vue2.mjs +1 -1
  135. package/es/components/map-earth-basic/index.vue.d.ts +0 -2
  136. package/es/components/map-earth-basic/index.vue.mjs +14 -15
  137. package/es/components/map-earth-cool-tech/index.vue.mjs +14 -15
  138. package/es/components/map-earth-fly-line/index.vue.d.ts +0 -4
  139. package/es/components/map-earth-fly-line/index.vue.mjs +8 -9
  140. package/es/components/map-earth-hacker/index.vue.d.ts +2 -4
  141. package/es/components/map-earth-hacker/index.vue.mjs +19 -20
  142. package/es/components/map-earth-particle/index.vue.d.ts +0 -4
  143. package/es/components/map-earth-particle/index.vue.mjs +14 -15
  144. package/es/components/media-audio/index.vue.mjs +2 -2
  145. package/es/components/media-audio/index.vue2.mjs +5 -5
  146. package/es/components/media-audio-dynamic/index.vue.mjs +1 -1
  147. package/es/components/media-audio-dynamic/index.vue2.mjs +4 -5
  148. package/es/components/media-flv/index.vue.mjs +1 -1
  149. package/es/components/media-iframe/index.vue.mjs +2 -2
  150. package/es/components/media-iframe/index.vue2.mjs +1 -1
  151. package/es/components/media-image-dynamic/index.vue.mjs +2 -2
  152. package/es/components/media-image-dynamic/index.vue2.mjs +6 -7
  153. package/es/components/media-m3u8/index.vue.mjs +1 -1
  154. package/es/components/media-m3u8-dynamic/index.vue.mjs +3 -4
  155. package/es/components/media-video/index.vue.mjs +2 -2
  156. package/es/components/media-video/index.vue2.mjs +1 -1
  157. package/es/components/media-video-dynamic/index.vue.mjs +2 -2
  158. package/es/components/media-video-dynamic/index.vue2.mjs +3 -4
  159. package/es/components/scene-amap2d/index.vue.mjs +1 -1
  160. package/es/components/scene-amap2d/index.vue2.mjs +13 -14
  161. package/es/components/scene-amap3d/index.vue.mjs +2 -2
  162. package/es/components/scene-amap3d/index.vue2.mjs +4 -5
  163. package/es/components/scene-default/index.vue.mjs +2 -2
  164. package/es/components/scene-default/index.vue2.mjs +1 -1
  165. package/es/components/scene-map3d/index.vue.mjs +2 -2
  166. package/es/components/scene-map3d/index.vue2.mjs +19 -20
  167. package/es/components/scene-ue-iframe/index.vue.mjs +2 -2
  168. package/es/components/scene-ue-iframe/index.vue2.mjs +1 -1
  169. package/es/components/scene-ue-shj/index.vue.mjs +2 -2
  170. package/es/components/scene-ue-shj/index.vue2.mjs +1 -1
  171. package/es/components/scene-unity-iframe/index.vue.mjs +2 -2
  172. package/es/components/scene-unity-iframe/index.vue2.mjs +1 -1
  173. package/es/components/scene-unity-webgl/index.vue.mjs +1 -1
  174. package/es/components/scene-unity-webgl/index.vue2.mjs +1 -1
  175. package/es/components/scene-vr/index.vue.mjs +2 -2
  176. package/es/components/scene-vr/index.vue2.mjs +3 -3
  177. package/es/components/text/list/index.vue.mjs +10 -11
  178. package/es/components/text-count-down/index.vue.mjs +1 -1
  179. package/es/components/text-count-down/index.vue2.mjs +1 -1
  180. package/es/components/text-over-number/index.vue.mjs +1 -1
  181. package/es/components/text-over-number/index.vue2.mjs +15 -16
  182. package/es/components/text-real-time/index.vue.mjs +1 -1
  183. package/es/components/text-real-time/index.vue2.mjs +2 -2
  184. package/es/components/text-row-scroll/index.vue.mjs +2 -2
  185. package/es/components/text-row-scroll/index.vue2.mjs +30 -31
  186. package/es/components/text-table-basic/index.vue.mjs +1 -1
  187. package/es/components/text-table-basic/index.vue2.mjs +43 -44
  188. package/es/components/text-table-scroll/index.vue.mjs +2 -2
  189. package/es/components/text-table-scroll/index.vue2.mjs +58 -59
  190. package/es/components/text-text-dynamic/index.vue.mjs +1 -1
  191. package/es/components/text-text-dynamic/index.vue2.mjs +16 -17
  192. package/es/env.d.ts +0 -1
  193. package/es/index.d.ts +0 -7
  194. package/es/index.mjs +359 -373
  195. package/es/widgets.css +1 -1
  196. package/package.json +1 -1
@@ -1,161 +1,161 @@
1
- var d = Object.defineProperty;
2
- var f = (s, e, t) => e in s ? d(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var m = (s, e, t) => f(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { cloneDeep as y } from "lodash";
5
- import { executeLinkAction as h } from "./actions/linkAction.mjs";
6
- import { executeMoveAction as A } from "./actions/moveAction.mjs";
7
- import { executeSendApiAction as x } from "./actions/sendApiAction.mjs";
8
- import { executeScaleAction as g } from "./actions/scaleAction.mjs";
9
- import { executeRotateAction as b } from "./actions/rotateAction.mjs";
10
- import { executeUpdatePageAction as S } from "./actions/updatePageAction.mjs";
11
- import { executeInvokeAction as E } from "./actions/invokeAction.mjs";
12
- import { executeFullScreenAction as V } from "./actions/fullScreenAction.mjs";
13
- import { executeUpdateVariableAction as w } from "./actions/updateVariableAction.mjs";
14
- import { executeUpdateWidgetAction as M } from "./actions/updateWidgetAction.mjs";
15
- import { executeUeCommonsWebscoketAction as U } from "./actions/ueCommonsWebscoketAction.mjs";
16
- import { executeUeShjExecMethodAction as k } from "./actions/ueShjExecMethodAction.mjs";
17
- import { executeUnityWebglExecMethodAction as C } from "./actions/unityWebglExecMethodAction.mjs";
18
- import { executeUnityIframeExecMethodAction as D } from "./actions/unityIframeExecMethodAction.mjs";
19
- import { executeVrSceneMethodAction as N } from "./actions/vrSceneMethodAction.mjs";
20
- import { executeRefreshVariableAction as W } from "./actions/refreshVariableAction.mjs";
21
- import { DataSourceUtils as l } from "../datasource/utils/utils.mjs";
22
- class v {
23
- /**
24
- * 添加事件解析器
25
- * @param type 事件类型
26
- * @param parser 事件解析器
27
- */
28
- static addAction(e, t) {
29
- const o = Array.from(this.actions).find((r) => r.type === e);
30
- o && this.actions.delete(o), this.actions.add({ type: e, parser: t });
31
- }
32
- /**
33
- * 获取事件解析器
34
- * @param type 事件类型
35
- * @returns 事件解析器
36
- */
37
- static getAction(e) {
38
- const t = Array.from(this.actions).find((o) => o.type === e);
39
- return t == null ? void 0 : t.parser;
40
- }
41
- /**
42
- * 解析事件
43
- * @param events 事件
44
- * @param type 事件类型
45
- * @param params 参数
46
- */
47
- static parseEvents(e, t, o) {
48
- e != null && e.length && e.forEach((r, c) => {
49
- r.eventType === t && setTimeout(() => {
50
- const u = new CustomEvent("event-params-log", {
51
- detail: {
52
- eventId: r.id,
53
- params: o
54
- }
55
- });
56
- window.dispatchEvent(u);
57
- const p = this.filterEvent(r, o);
58
- if (!this.conditionLogic(r, p) || !r.actions)
59
- return;
60
- const n = this.getAction(r.actions);
61
- n && n(r, p);
62
- }, r.delay + c * 10);
63
- });
64
- }
65
- /**
66
- * 过滤事件返回值
67
- * @param event 事件
68
- * @param params 参数
69
- * @returns 过滤后的参数
70
- */
71
- static filterEvent(e, t) {
72
- let o = y(t);
73
- if (e.filterCode)
74
- try {
75
- const r = l.getVariableData();
76
- let c = `
77
- ${e.filterCode}
78
-
79
- // 在这里调用 filter 函数,并传递 data 参数
80
- return filter(data);
81
- `;
82
- c = c.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, ""), c = l.replaceStringVariables(c, r), o = new Function("data", c)(t);
83
- } catch {
84
- }
85
- return o;
86
- }
87
- /**
88
- * 条件逻辑判断
89
- * @param event 事件
90
- * @param params 参数
91
- * @returns 是否通过
92
- */
93
- static conditionLogic(e, t) {
94
- var u, p;
95
- if (!((p = (u = e.condition) == null ? void 0 : u.list) != null && p.length))
96
- return !0;
97
- const o = (n) => {
98
- if (n.type === "field") {
99
- if (!n.conditionName) return !1;
100
- const a = t[n.conditionName];
101
- if (a === void 0) return !1;
102
- const i = n.conditionValue;
103
- switch (n.conditionExpression) {
104
- case "eq":
105
- return a.toString() === (i || "").toString();
106
- case "neq":
107
- return a !== i;
108
- case "lt":
109
- return a < Number(i);
110
- case "gt":
111
- return a > Number(i);
112
- case "lte":
113
- return a <= Number(i);
114
- case "gte":
115
- return a >= Number(i);
116
- case "includes":
117
- return a.includes(i);
118
- case "noincludes":
119
- return !a.includes(i);
120
- default:
121
- return !1;
122
- }
123
- }
124
- if (n.type === "custom")
125
- try {
126
- const a = l.getVariableData();
127
- let i = `
128
- ${n.customValue}
129
- return condition(data);
130
- `;
131
- return i = i.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, ""), i = l.replaceStringVariables(i, a), new Function("data", i)(t);
132
- } catch {
133
- return !1;
134
- }
135
- return !1;
136
- }, r = e.condition.list.map(o);
137
- return e.condition.type === "and" ? r.every(Boolean) : r.some(Boolean);
138
- }
139
- }
140
- /** 事件动作 */
141
- m(v, "actions", /* @__PURE__ */ new Set([
142
- { type: "link", parser: h },
143
- { type: "sendApi", parser: x },
144
- { type: "move", parser: A },
145
- { type: "scale", parser: g },
146
- { type: "rotate", parser: b },
147
- { type: "updatePage", parser: S },
148
- { type: "invoke", parser: E },
149
- { type: "fullscreen", parser: V },
150
- { type: "updateVariable", parser: w },
151
- { type: "updateWidget", parser: M },
152
- { type: "ueCommonsWebscoket", parser: U },
153
- { type: "ueShjExecMethod", parser: k },
154
- { type: "unityWebglExecMethod", parser: C },
155
- { type: "unityIframeExecMethod", parser: D },
156
- { type: "vrSceneMethod", parser: N },
157
- { type: "refreshVariable", parser: W }
158
- ]));
159
- export {
160
- v as SHJParseEvent
161
- };
1
+ var d = Object.defineProperty;
2
+ var f = (s, e, t) => e in s ? d(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var m = (s, e, t) => f(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { cloneDeep as y } from "lodash";
5
+ import { executeLinkAction as h } from "./actions/linkAction.mjs";
6
+ import { executeMoveAction as A } from "./actions/moveAction.mjs";
7
+ import { executeSendApiAction as x } from "./actions/sendApiAction.mjs";
8
+ import { executeScaleAction as g } from "./actions/scaleAction.mjs";
9
+ import { executeRotateAction as b } from "./actions/rotateAction.mjs";
10
+ import { executeUpdatePageAction as S } from "./actions/updatePageAction.mjs";
11
+ import { executeInvokeAction as E } from "./actions/invokeAction.mjs";
12
+ import { executeFullScreenAction as V } from "./actions/fullScreenAction.mjs";
13
+ import { executeUpdateVariableAction as w } from "./actions/updateVariableAction.mjs";
14
+ import { executeUpdateWidgetAction as M } from "./actions/updateWidgetAction.mjs";
15
+ import { executeUeCommonsWebscoketAction as U } from "./actions/ueCommonsWebscoketAction.mjs";
16
+ import { executeUeShjExecMethodAction as k } from "./actions/ueShjExecMethodAction.mjs";
17
+ import { executeUnityWebglExecMethodAction as C } from "./actions/unityWebglExecMethodAction.mjs";
18
+ import { executeUnityIframeExecMethodAction as D } from "./actions/unityIframeExecMethodAction.mjs";
19
+ import { executeVrSceneMethodAction as N } from "./actions/vrSceneMethodAction.mjs";
20
+ import { executeRefreshVariableAction as W } from "./actions/refreshVariableAction.mjs";
21
+ import { DataSourceUtils as l } from "../datasource/utils/utils.mjs";
22
+ class v {
23
+ /**
24
+ * 添加事件解析器
25
+ * @param type 事件类型
26
+ * @param parser 事件解析器
27
+ */
28
+ static addAction(e, t) {
29
+ const o = Array.from(this.actions).find((r) => r.type === e);
30
+ o && this.actions.delete(o), this.actions.add({ type: e, parser: t });
31
+ }
32
+ /**
33
+ * 获取事件解析器
34
+ * @param type 事件类型
35
+ * @returns 事件解析器
36
+ */
37
+ static getAction(e) {
38
+ const t = Array.from(this.actions).find((o) => o.type === e);
39
+ return t == null ? void 0 : t.parser;
40
+ }
41
+ /**
42
+ * 解析事件
43
+ * @param events 事件
44
+ * @param type 事件类型
45
+ * @param params 参数
46
+ */
47
+ static parseEvents(e, t, o) {
48
+ e != null && e.length && e.forEach((r, c) => {
49
+ r.eventType === t && setTimeout(() => {
50
+ const u = new CustomEvent("event-params-log", {
51
+ detail: {
52
+ eventId: r.id,
53
+ params: o
54
+ }
55
+ });
56
+ window.dispatchEvent(u);
57
+ const p = this.filterEvent(r, o);
58
+ if (!this.conditionLogic(r, p) || !r.actions)
59
+ return;
60
+ const n = this.getAction(r.actions);
61
+ n && n(r, p);
62
+ }, r.delay + c * 10);
63
+ });
64
+ }
65
+ /**
66
+ * 过滤事件返回值
67
+ * @param event 事件
68
+ * @param params 参数
69
+ * @returns 过滤后的参数
70
+ */
71
+ static filterEvent(e, t) {
72
+ let o = y(t);
73
+ if (e.filterCode)
74
+ try {
75
+ const r = l.getVariableData();
76
+ let c = `
77
+ ${e.filterCode}
78
+
79
+ // 在这里调用 filter 函数,并传递 data 参数
80
+ return filter(data);
81
+ `;
82
+ c = c.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, ""), c = l.replaceStringVariables(c, r), o = new Function("data", c)(t);
83
+ } catch {
84
+ }
85
+ return o;
86
+ }
87
+ /**
88
+ * 条件逻辑判断
89
+ * @param event 事件
90
+ * @param params 参数
91
+ * @returns 是否通过
92
+ */
93
+ static conditionLogic(e, t) {
94
+ var u, p;
95
+ if (!((p = (u = e.condition) == null ? void 0 : u.list) != null && p.length))
96
+ return !0;
97
+ const o = (n) => {
98
+ if (n.type === "field") {
99
+ if (!n.conditionName) return !1;
100
+ const a = t[n.conditionName];
101
+ if (a === void 0) return !1;
102
+ const i = n.conditionValue;
103
+ switch (n.conditionExpression) {
104
+ case "eq":
105
+ return a.toString() === (i || "").toString();
106
+ case "neq":
107
+ return a !== i;
108
+ case "lt":
109
+ return a < Number(i);
110
+ case "gt":
111
+ return a > Number(i);
112
+ case "lte":
113
+ return a <= Number(i);
114
+ case "gte":
115
+ return a >= Number(i);
116
+ case "includes":
117
+ return a.includes(i);
118
+ case "noincludes":
119
+ return !a.includes(i);
120
+ default:
121
+ return !1;
122
+ }
123
+ }
124
+ if (n.type === "custom")
125
+ try {
126
+ const a = l.getVariableData();
127
+ let i = `
128
+ ${n.customValue}
129
+ return condition(data);
130
+ `;
131
+ return i = i.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, ""), i = l.replaceStringVariables(i, a), new Function("data", i)(t);
132
+ } catch {
133
+ return !1;
134
+ }
135
+ return !1;
136
+ }, r = e.condition.list.map(o);
137
+ return e.condition.type === "and" ? r.every(Boolean) : r.some(Boolean);
138
+ }
139
+ }
140
+ /** 事件动作 */
141
+ m(v, "actions", /* @__PURE__ */ new Set([
142
+ { type: "link", parser: h },
143
+ { type: "sendApi", parser: x },
144
+ { type: "move", parser: A },
145
+ { type: "scale", parser: g },
146
+ { type: "rotate", parser: b },
147
+ { type: "updatePage", parser: S },
148
+ { type: "invoke", parser: E },
149
+ { type: "fullscreen", parser: V },
150
+ { type: "updateVariable", parser: w },
151
+ { type: "updateWidget", parser: M },
152
+ { type: "ueCommonsWebscoket", parser: U },
153
+ { type: "ueShjExecMethod", parser: k },
154
+ { type: "unityWebglExecMethod", parser: C },
155
+ { type: "unityIframeExecMethod", parser: D },
156
+ { type: "vrSceneMethod", parser: N },
157
+ { type: "refreshVariable", parser: W }
158
+ ]));
159
+ export {
160
+ v as SHJParseEvent
161
+ };
@@ -1,22 +1,22 @@
1
- /**
2
- * 事件工具类
3
- */
4
- export declare class EventUtils {
5
- /**
6
- * 将URL参数转换为JSON对象
7
- * @param urlParam - 需要转换的URL参数
8
- * @returns 转换后的JSON对象
9
- */
10
- static urlParamToJson(urlParam: string): any;
11
- /**
12
- * 更新组件数据
13
- * @param variableData 变量数据
14
- */
15
- static updateWidgetVariableData(variableData: any): void;
16
- /**
17
- * 将JSON对象转换为字符串
18
- * @param json - 需要转换的JSON对象
19
- * @returns 转换后的字符串
20
- */
21
- static toStringify(json: any): string;
22
- }
1
+ /**
2
+ * 事件工具类
3
+ */
4
+ export declare class EventUtils {
5
+ /**
6
+ * 将URL参数转换为JSON对象
7
+ * @param urlParam - 需要转换的URL参数
8
+ * @returns 转换后的JSON对象
9
+ */
10
+ static urlParamToJson(urlParam: string): any;
11
+ /**
12
+ * 更新组件数据
13
+ * @param variableData 变量数据
14
+ */
15
+ static updateWidgetVariableData(variableData: any): void;
16
+ /**
17
+ * 将JSON对象转换为字符串
18
+ * @param json - 需要转换的JSON对象
19
+ * @returns 转换后的字符串
20
+ */
21
+ static toStringify(json: any): string;
22
+ }
@@ -1,50 +1,50 @@
1
- import { ComponentRefs as o } from "../../../utils/componentRefs.mjs";
2
- class f {
3
- /**
4
- * 将URL参数转换为JSON对象
5
- * @param urlParam - 需要转换的URL参数
6
- * @returns 转换后的JSON对象
7
- */
8
- static urlParamToJson(r) {
9
- if (!r) return r;
10
- const t = {};
11
- return r.trim().split("&").forEach((e) => t[e.split("=")[0]] = e.split("=")[1]), t;
12
- }
13
- /**
14
- * 更新组件数据
15
- * @param variableData 变量数据
16
- */
17
- static updateWidgetVariableData(r) {
18
- var t;
19
- (t = r.useList) != null && t.length && r.useList.forEach((e) => {
20
- const s = o.getComponentRef(e);
21
- try {
22
- s && s.ref && s.ref.refreshData();
23
- } catch {
24
- }
25
- });
26
- }
27
- /**
28
- * 将JSON对象转换为字符串
29
- * @param json - 需要转换的JSON对象
30
- * @returns 转换后的字符串
31
- */
32
- static toStringify(r) {
33
- try {
34
- let t = [];
35
- const e = JSON.stringify(r, (s, n) => {
36
- if (typeof n == "object" && n !== null) {
37
- if (t.indexOf(n) !== -1) return;
38
- t.push(n);
39
- }
40
- return n;
41
- });
42
- return t = null, e;
43
- } catch {
44
- return "";
45
- }
46
- }
47
- }
48
- export {
49
- f as EventUtils
50
- };
1
+ import { ComponentRefs as o } from "../../../utils/componentRefs.mjs";
2
+ class f {
3
+ /**
4
+ * 将URL参数转换为JSON对象
5
+ * @param urlParam - 需要转换的URL参数
6
+ * @returns 转换后的JSON对象
7
+ */
8
+ static urlParamToJson(r) {
9
+ if (!r) return r;
10
+ const t = {};
11
+ return r.trim().split("&").forEach((e) => t[e.split("=")[0]] = e.split("=")[1]), t;
12
+ }
13
+ /**
14
+ * 更新组件数据
15
+ * @param variableData 变量数据
16
+ */
17
+ static updateWidgetVariableData(r) {
18
+ var t;
19
+ (t = r.useList) != null && t.length && r.useList.forEach((e) => {
20
+ const s = o.getComponentRef(e);
21
+ try {
22
+ s && s.ref && s.ref.refreshData();
23
+ } catch {
24
+ }
25
+ });
26
+ }
27
+ /**
28
+ * 将JSON对象转换为字符串
29
+ * @param json - 需要转换的JSON对象
30
+ * @returns 转换后的字符串
31
+ */
32
+ static toStringify(r) {
33
+ try {
34
+ let t = [];
35
+ const e = JSON.stringify(r, (s, n) => {
36
+ if (typeof n == "object" && n !== null) {
37
+ if (t.indexOf(n) !== -1) return;
38
+ t.push(n);
39
+ }
40
+ return n;
41
+ });
42
+ return t = null, e;
43
+ } catch {
44
+ return "";
45
+ }
46
+ }
47
+ }
48
+ export {
49
+ f as EventUtils
50
+ };
@@ -1,28 +1,28 @@
1
- /**
2
- * 组件Ref
3
- */
4
- export declare class ComponentRefs {
5
- static componentRefs: {
6
- id: string;
7
- ref: any;
8
- }[];
9
- /**
10
- * 注册组件Ref
11
- * @param id
12
- * @returns
13
- */
14
- static registerRef(id: string): (el: any) => void;
15
- /**
16
- * 获取组件Ref
17
- * @param id
18
- * @returns
19
- */
20
- static getComponentRef(id: string): {
21
- id: string;
22
- ref: any;
23
- };
24
- /**
25
- * 清除组件Ref
26
- */
27
- static clearComponentRefs(): void;
28
- }
1
+ /**
2
+ * 组件Ref
3
+ */
4
+ export declare class ComponentRefs {
5
+ static componentRefs: {
6
+ id: string;
7
+ ref: any;
8
+ }[];
9
+ /**
10
+ * 注册组件Ref
11
+ * @param id
12
+ * @returns
13
+ */
14
+ static registerRef(id: string): (el: any) => void;
15
+ /**
16
+ * 获取组件Ref
17
+ * @param id
18
+ * @returns
19
+ */
20
+ static getComponentRef(id: string): {
21
+ id: string;
22
+ ref: any;
23
+ };
24
+ /**
25
+ * 清除组件Ref
26
+ */
27
+ static clearComponentRefs(): void;
28
+ }
@@ -1,37 +1,37 @@
1
- var f = Object.defineProperty;
2
- var r = (s, t, e) => t in s ? f(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var o = (s, t, e) => r(s, typeof t != "symbol" ? t + "" : t, e);
4
- import { isArray as c } from "lodash";
5
- class p {
6
- /**
7
- * 注册组件Ref
8
- * @param id
9
- * @returns
10
- */
11
- static registerRef(t) {
12
- return (e) => {
13
- if (c(this.componentRefs) && e && t) {
14
- const n = this.componentRefs.find((i) => i.id === t);
15
- n ? n.ref = e : this.componentRefs.push({ id: t, ref: e });
16
- }
17
- };
18
- }
19
- /**
20
- * 获取组件Ref
21
- * @param id
22
- * @returns
23
- */
24
- static getComponentRef(t) {
25
- return this.componentRefs.find((e) => e.id === t);
26
- }
27
- /**
28
- * 清除组件Ref
29
- */
30
- static clearComponentRefs() {
31
- this.componentRefs = [];
32
- }
33
- }
34
- o(p, "componentRefs", []);
35
- export {
36
- p as ComponentRefs
37
- };
1
+ var f = Object.defineProperty;
2
+ var r = (s, t, e) => t in s ? f(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var o = (s, t, e) => r(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { isArray as c } from "lodash";
5
+ class p {
6
+ /**
7
+ * 注册组件Ref
8
+ * @param id
9
+ * @returns
10
+ */
11
+ static registerRef(t) {
12
+ return (e) => {
13
+ if (c(this.componentRefs) && e && t) {
14
+ const n = this.componentRefs.find((i) => i.id === t);
15
+ n ? n.ref = e : this.componentRefs.push({ id: t, ref: e });
16
+ }
17
+ };
18
+ }
19
+ /**
20
+ * 获取组件Ref
21
+ * @param id
22
+ * @returns
23
+ */
24
+ static getComponentRef(t) {
25
+ return this.componentRefs.find((e) => e.id === t);
26
+ }
27
+ /**
28
+ * 清除组件Ref
29
+ */
30
+ static clearComponentRefs() {
31
+ this.componentRefs = [];
32
+ }
33
+ }
34
+ o(p, "componentRefs", []);
35
+ export {
36
+ p as ComponentRefs
37
+ };
@@ -1,7 +1,7 @@
1
- /**
2
- * 获取下一个元素
3
- * @param arr 数组
4
- * @param target 目标元素
5
- * @returns 下一个元素
6
- */
7
- export declare const getNextElement: (arr: string[], target: string) => string;
1
+ /**
2
+ * 获取下一个元素
3
+ * @param arr 数组
4
+ * @param target 目标元素
5
+ * @returns 下一个元素
6
+ */
7
+ export declare const getNextElement: (arr: string[], target: string) => string;
@@ -1,12 +1,12 @@
1
- const i = (n, e) => {
2
- if (!Array.isArray(n) || !n.length || typeof e != "string")
3
- return null;
4
- const t = n.indexOf(e);
5
- if (t === -1)
6
- return null;
7
- const l = (t + 1) % n.length;
8
- return n[l];
9
- };
10
- export {
11
- i as getNextElement
12
- };
1
+ const i = (n, e) => {
2
+ if (!Array.isArray(n) || !n.length || typeof e != "string")
3
+ return null;
4
+ const t = n.indexOf(e);
5
+ if (t === -1)
6
+ return null;
7
+ const l = (t + 1) % n.length;
8
+ return n[l];
9
+ };
10
+ export {
11
+ i as getNextElement
12
+ };