@xuda.io/xuda-worker-bundle 1.3.2626 → 1.3.2628

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 (2) hide show
  1. package/index.js +10 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -220,9 +220,9 @@ func.runtime.platform.emit = function (name, data) {
220
220
  handlers[i](data);
221
221
  }
222
222
  }
223
- // also fire on DOM if in browser (for backward compatibility with $(document).on listeners)
224
- if (func.runtime.platform.has_document() && typeof $ !== 'undefined') {
225
- $(document).trigger(name, Array.isArray(data) ? data : [data]);
223
+ // also fire on DOM if in browser (for backward compatibility with custom event listeners)
224
+ if (func.runtime.platform.has_document()) {
225
+ document.dispatchEvent(new CustomEvent(name, { detail: Array.isArray(data) ? data : [data] }));
226
226
  }
227
227
  } finally {
228
228
  func.runtime.platform._emitting[name] = false;
@@ -4376,7 +4376,8 @@ func.datasource.clean = function (SESSION_ID, screenIdP) {
4376
4376
  var arr = [];
4377
4377
  for (const [key, val] of Object.entries(SESSION_OBJ[SESSION_ID].DS_GLB)) {
4378
4378
  try {
4379
- const screen_parent_id = (typeof $ !== 'undefined' && val.screenId) ? $('#' + val.screenId).parent().attr('id') : null;
4379
+ const _screen_el = val.screenId ? document.getElementById(val.screenId) : null;
4380
+ const screen_parent_id = _screen_el?.parentElement?.id || null;
4380
4381
  if (
4381
4382
  Number(key) > 0 &&
4382
4383
  (val.screenId === screenIdP ||
@@ -4471,13 +4472,11 @@ func.datasource.del = function (SESSION_ID, dsP) {
4471
4472
  }
4472
4473
  }
4473
4474
  }
4474
- if (typeof $ !== 'undefined') {
4475
- const $xu_nav = $(SESSION_OBJ[SESSION_ID].root_element).find('xu-nav');
4476
- if ($xu_nav.length) {
4477
- var ds_obj = func.runtime.ui.get_data($xu_nav)?.xuData?.nav_params;
4478
- if (ds_obj) {
4479
- delete ds_obj[dsP];
4480
- }
4475
+ const _nav_node = func.runtime.ui.get_first_node(SESSION_OBJ[SESSION_ID].root_element)?.querySelector?.('xu-nav');
4476
+ if (_nav_node) {
4477
+ var ds_obj = func.runtime.ui.get_data(_nav_node)?.xuData?.nav_params;
4478
+ if (ds_obj) {
4479
+ delete ds_obj[dsP];
4481
4480
  }
4482
4481
  }
4483
4482
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle",
3
- "version": "1.3.2626",
3
+ "version": "1.3.2628",
4
4
  "description": "xuda framework",
5
5
  "main": "index.js",
6
6
  "scripts": {