@xuda.io/runtime-bundle 1.0.1427 → 1.0.1429

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.
@@ -11650,6 +11650,18 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
11650
11650
  'xu-on': true,
11651
11651
  'xu-for-key': true,
11652
11652
  'xu-for-val': true,
11653
+ 'xu-click': true,
11654
+ 'xu-change': true,
11655
+ 'xu-blur': true,
11656
+ 'xu-focus': true,
11657
+ 'xu-init': true,
11658
+ 'xu-attrs': true,
11659
+ 'xu-cdn': true,
11660
+ 'xu-style': true,
11661
+ 'xu-style-global': true,
11662
+ 'xu-script': true,
11663
+ 'xu-viewport': true,
11664
+ 'xu-ui-plugin': true,
11653
11665
  };
11654
11666
 
11655
11667
  const execution_plan = [];
@@ -11661,12 +11673,13 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
11661
11673
 
11662
11674
  const attr_new = attr.split('xu-exp:')[1];
11663
11675
  const xu_func = attr_new || attr;
11676
+ const is_raw_value_attribute = !!raw_value_attributes[attr] || attr.substr(0, 6) === 'xu-on:';
11664
11677
  execution_plan.push({
11665
11678
  attr,
11666
11679
  attr_new,
11667
11680
  xu_func,
11668
11681
  is_regular_attribute: !!(attr_new && attr_new.substr(0, 2) !== 'xu'),
11669
- requires_expression: !raw_value_attributes[attr] && attr !== 'xu-class' && attr !== 'xu-ui-plugin',
11682
+ requires_expression: !is_raw_value_attribute && attr !== 'xu-class' && attr !== 'xu-ui-plugin',
11670
11683
  regular_attr_name: attr_new ? (attr_new !== 'viewBox' ? attr_new.toLowerCase() : attr_new) : null,
11671
11684
  });
11672
11685
  }
@@ -19707,6 +19720,29 @@ func.events.execute = async function (
19707
19720
  return result;
19708
19721
  },
19709
19722
  update: async function () {
19723
+ const resolve_update_field_id = async function (field_expr, iterate_info) {
19724
+ let trimmed = field_expr?.trim?.() || '';
19725
+ if (!trimmed) {
19726
+ return trimmed;
19727
+ }
19728
+
19729
+ const first = trimmed.substring(0, 1);
19730
+ const last = trimmed.substring(trimmed.length - 1);
19731
+ if ((first === "'" || first === '"' || first === '`') && last === first) {
19732
+ trimmed = trimmed.substring(1, trimmed.length - 1).trim();
19733
+ }
19734
+
19735
+ if (/^@?[A-Za-z_][\w\-\:\.]*$/.test(trimmed)) {
19736
+ return trimmed.substring(0, 1) === '@' ? trimmed.substring(1) : trimmed;
19737
+ }
19738
+
19739
+ let ret_field_id = await func.expression.get(SESSION_ID, trimmed, dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
19740
+ if (typeof ret_field_id?.result === 'string' && ret_field_id.result.substring(0, 1) === '@') {
19741
+ return ret_field_id.result.substring(1);
19742
+ }
19743
+ return ret_field_id?.result;
19744
+ };
19745
+
19710
19746
  const obj_values_to_update = func.datasource.get_viewFields_for_update_function(SESSION_ID, calling_trigger_prop, null, dsSessionP);
19711
19747
  if (!obj_values_to_update || xu_isEmpty(obj_values_to_update)) {
19712
19748
  func.utils.debug_report(SESSION_ID, 'Update values object is empty', '', 'W');
@@ -19724,9 +19760,8 @@ func.events.execute = async function (
19724
19760
  iterate_info = element_meta?.iterate_info || null;
19725
19761
  }
19726
19762
 
19727
- let ret_field_id = await func.expression.get(SESSION_ID, val.id.trim(), dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
19728
19763
  let ret_value = await func.expression.get(SESSION_ID, val.val.trim(), dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
19729
- let _field_id = ret_field_id.result;
19764
+ let _field_id = await resolve_update_field_id(val.id, iterate_info);
19730
19765
  let _value = ret_value.result;
19731
19766
 
19732
19767
  updates.push({ _field_id, _value });
@@ -11576,6 +11576,18 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
11576
11576
  'xu-on': true,
11577
11577
  'xu-for-key': true,
11578
11578
  'xu-for-val': true,
11579
+ 'xu-click': true,
11580
+ 'xu-change': true,
11581
+ 'xu-blur': true,
11582
+ 'xu-focus': true,
11583
+ 'xu-init': true,
11584
+ 'xu-attrs': true,
11585
+ 'xu-cdn': true,
11586
+ 'xu-style': true,
11587
+ 'xu-style-global': true,
11588
+ 'xu-script': true,
11589
+ 'xu-viewport': true,
11590
+ 'xu-ui-plugin': true,
11579
11591
  };
11580
11592
 
11581
11593
  const execution_plan = [];
@@ -11587,12 +11599,13 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
11587
11599
 
11588
11600
  const attr_new = attr.split('xu-exp:')[1];
11589
11601
  const xu_func = attr_new || attr;
11602
+ const is_raw_value_attribute = !!raw_value_attributes[attr] || attr.substr(0, 6) === 'xu-on:';
11590
11603
  execution_plan.push({
11591
11604
  attr,
11592
11605
  attr_new,
11593
11606
  xu_func,
11594
11607
  is_regular_attribute: !!(attr_new && attr_new.substr(0, 2) !== 'xu'),
11595
- requires_expression: !raw_value_attributes[attr] && attr !== 'xu-class' && attr !== 'xu-ui-plugin',
11608
+ requires_expression: !is_raw_value_attribute && attr !== 'xu-class' && attr !== 'xu-ui-plugin',
11596
11609
  regular_attr_name: attr_new ? (attr_new !== 'viewBox' ? attr_new.toLowerCase() : attr_new) : null,
11597
11610
  });
11598
11611
  }
@@ -20398,6 +20411,29 @@ func.events.execute = async function (
20398
20411
  return result;
20399
20412
  },
20400
20413
  update: async function () {
20414
+ const resolve_update_field_id = async function (field_expr, iterate_info) {
20415
+ let trimmed = field_expr?.trim?.() || '';
20416
+ if (!trimmed) {
20417
+ return trimmed;
20418
+ }
20419
+
20420
+ const first = trimmed.substring(0, 1);
20421
+ const last = trimmed.substring(trimmed.length - 1);
20422
+ if ((first === "'" || first === '"' || first === '`') && last === first) {
20423
+ trimmed = trimmed.substring(1, trimmed.length - 1).trim();
20424
+ }
20425
+
20426
+ if (/^@?[A-Za-z_][\w\-\:\.]*$/.test(trimmed)) {
20427
+ return trimmed.substring(0, 1) === '@' ? trimmed.substring(1) : trimmed;
20428
+ }
20429
+
20430
+ let ret_field_id = await func.expression.get(SESSION_ID, trimmed, dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
20431
+ if (typeof ret_field_id?.result === 'string' && ret_field_id.result.substring(0, 1) === '@') {
20432
+ return ret_field_id.result.substring(1);
20433
+ }
20434
+ return ret_field_id?.result;
20435
+ };
20436
+
20401
20437
  const obj_values_to_update = func.datasource.get_viewFields_for_update_function(SESSION_ID, calling_trigger_prop, null, dsSessionP);
20402
20438
  if (!obj_values_to_update || xu_isEmpty(obj_values_to_update)) {
20403
20439
  func.utils.debug_report(SESSION_ID, 'Update values object is empty', '', 'W');
@@ -20415,9 +20451,8 @@ func.events.execute = async function (
20415
20451
  iterate_info = element_meta?.iterate_info || null;
20416
20452
  }
20417
20453
 
20418
- let ret_field_id = await func.expression.get(SESSION_ID, val.id.trim(), dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
20419
20454
  let ret_value = await func.expression.get(SESSION_ID, val.val.trim(), dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
20420
- let _field_id = ret_field_id.result;
20455
+ let _field_id = await resolve_update_field_id(val.id, iterate_info);
20421
20456
  let _value = ret_value.result;
20422
20457
 
20423
20458
  updates.push({ _field_id, _value });