@xuda.io/runtime-bundle 1.0.994 → 1.0.995

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.
@@ -32130,6 +32130,135 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32130
32130
  return {};
32131
32131
  },
32132
32132
  'xu-render': async function ($elm, val, from_panel) {
32133
+ var value = await func.common.get_cast_val(SESSION_ID, 'common fx', 'xu-render', 'bool', val.value);
32134
+ const init_render = function () {
32135
+ if (!value) {
32136
+ var cloned_$div = $elm.clone(true);
32137
+
32138
+ let $xurender = $('<xurender>').attr('xu-ui-id', $elm.attr('xu-ui-id')).attr('hidden', true).appendTo($container).hide();
32139
+ let original_data_obj = {
32140
+ $container: cloned_$div,
32141
+ nodeP: _.cloneDeep(nodeP),
32142
+ parent_infoP,
32143
+ paramsP,
32144
+ keyP,
32145
+ parent_nodeP,
32146
+ $root_container,
32147
+ };
32148
+ $xurender.data('xuData', cloned_$div.data().xuData);
32149
+ $xurender.data().xuData.original_data_obj = original_data_obj;
32150
+ $xurender.data().xuData.xurender_node = cloned_$div;
32151
+ $xurender.data().xuAttributes = nodeP.attributes || {};
32152
+ $xurender.hide();
32153
+
32154
+ $elm.remove();
32155
+ return { abort: true };
32156
+ }
32157
+ return {};
32158
+ };
32159
+
32160
+ const post_render = async function () {
32161
+ if (value) {
32162
+ try {
32163
+ // abort if already rended
32164
+ if ($elm[0].tagName !== 'XURENDER' && $elm?.length) {
32165
+ return func.events.delete_job(SESSION_ID, jobNoP);
32166
+ }
32167
+
32168
+ let original_data_obj = $elm.data().xuData.original_data_obj;
32169
+
32170
+ if (!original_data_obj) {
32171
+ func.events.delete_job(SESSION_ID, jobNoP);
32172
+ return { delete_job: jobNoP };
32173
+ }
32174
+
32175
+ const new_$div = await func.UI.screen.render_ui_tree(
32176
+ SESSION_ID,
32177
+ $elm, //original_data_obj.$container,
32178
+ _.cloneDeep(original_data_obj.nodeP),
32179
+ original_data_obj.parent_infoP,
32180
+ original_data_obj.paramsP,
32181
+ jobNoP,
32182
+ null,
32183
+ original_data_obj.keyP,
32184
+ null,
32185
+ original_data_obj.parent_nodeP,
32186
+ null,
32187
+ original_data_obj.$root_container,
32188
+ );
32189
+
32190
+ new_$div.data().xuData.original_data_obj = original_data_obj;
32191
+ new_$div.data().xuData.xurender_node = $elm.clone(true);
32192
+ new_$div.data().xuAttributes = $elm.data().xuAttributes || {};
32193
+
32194
+ const replace = async function () {
32195
+ $elm.replaceWith(new_$div);
32196
+ if (from_panel) {
32197
+ const xuPanelWrapper = _.clone(new_$div.data().xuPanelWrapper);
32198
+ $elm.parent().data().xuPanelWrapper = xuPanelWrapper;
32199
+ $elm.replaceWith(new_$div.children());
32200
+ }
32201
+
32202
+ if (val.fields_arr) {
32203
+ return await func.UI.screen.refresh_xu_attributes(SESSION_ID, val.fields_arr, val.jobNoP, new_$div);
32204
+ }
32205
+ func.events.delete_job(SESSION_ID, jobNoP);
32206
+ };
32207
+
32208
+ if ($elm && func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', $elm.data().xuData.xu_id).length) {
32209
+ if (new_$div.data().xuData.paramsP) {
32210
+ return await replace();
32211
+ }
32212
+
32213
+ func.events.delete_job(SESSION_ID, jobNoP);
32214
+ }
32215
+ } catch (error) {
32216
+ func.events.delete_job(SESSION_ID, jobNoP);
32217
+ }
32218
+ return;
32219
+ }
32220
+ // if (!value) {
32221
+ if ($elm.prop('tagName') === 'XURENDER') {
32222
+ func.events.delete_job(SESSION_ID, jobNoP);
32223
+ return;
32224
+ }
32225
+
32226
+ let tmp_$div = $('<div>');
32227
+
32228
+ let $xurender = $('<xurender>').attr('xu-ui-id', $elm.attr('xu-ui-id')).appendTo(tmp_$div).hide();
32229
+ // was true before
32230
+ if ($elm.data().xuData.xurender_node) {
32231
+ $xurender.data({
32232
+ xuAttributes: $elm.data().xuData.xurender_node.data().xuAttributes || {},
32233
+ xuData: $elm.data().xuData.xurender_node.data().xuData || {},
32234
+ });
32235
+ } else {
32236
+ // default new state
32237
+
32238
+ $xurender.data({
32239
+ xuAttributes: $elm.data().xuAttributes || {},
32240
+ xuData: $elm.data().xuData || {},
32241
+ });
32242
+ const original_data_obj = {
32243
+ nodeP: _.cloneDeep($elm.data().xuData.node_org),
32244
+ paramsP: $elm.data().xuData.paramsP,
32245
+ $container: $elm.clone(true),
32246
+ parent_infoP: parent_infoP,
32247
+ };
32248
+
32249
+ $xurender.data().xuData.original_data_obj = original_data_obj;
32250
+ }
32251
+
32252
+ $elm.replaceWith(tmp_$div.children());
32253
+ func.events.delete_job(SESSION_ID, jobNoP);
32254
+ // }
32255
+ };
32256
+ if (is_init) {
32257
+ return init_render();
32258
+ }
32259
+ return await post_render();
32260
+ },
32261
+ 'xu-render-new': async function ($elm, val, from_panel) {
32133
32262
  var value = await func.common.get_cast_val(SESSION_ID, 'common fx', 'xu-render', 'bool', val.value);
32134
32263
  const init_render = function () {
32135
32264
  if (!value) {
@@ -32142,7 +32271,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32142
32271
  .appendTo($container)
32143
32272
  .hide();
32144
32273
  let original_data_obj = {
32145
- not_rendered: true,
32274
+ force_render: true,
32146
32275
  $container: cloned_$div,
32147
32276
  nodeP: _.cloneDeep(nodeP),
32148
32277
  parent_infoP,
@@ -32180,7 +32309,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32180
32309
 
32181
32310
  let new_$div = original_data_obj.$container.clone(true);
32182
32311
 
32183
- if (original_data_obj.not_rendered) {
32312
+ if (original_data_obj.force_render) {
32184
32313
  new_$div = await func.UI.screen.render_ui_tree(
32185
32314
  SESSION_ID,
32186
32315
  $elm, //original_data_obj.$container,