cronapp-framework-js 2.8.53 → 2.8.56

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/js/directives.js CHANGED
@@ -3943,24 +3943,38 @@
3943
3943
  await combobox.value(value);
3944
3944
 
3945
3945
  if (select.changeCursor) {
3946
- if (value == null || value == undefined) {
3947
- dataSourceScreen.active = {};
3948
- dataSourceScreen.cursor = -1;
3949
- modelSetter(_scope, null);
3950
- }
3946
+ scope.safeApply(() => {
3947
+ if (value == null || value == undefined) {
3948
+ dataSourceScreen.active = {};
3949
+ dataSourceScreen.cursor = -1;
3950
+ modelSetter(_scope, null);
3951
+ }
3952
+ else {
3953
+ _goTo(_scope, combobox, combobox.dataItem());
3954
+ }
3955
+ });
3951
3956
  }
3952
3957
  }
3953
3958
 
3959
+ let returnTypedValue = (value) => {
3960
+ if (dataSourceScreen.schema) {
3961
+ let fieldInfo = dataSourceScreen.schema.find(s=> s.name === options.dataValueField);
3962
+ if (fieldInfo && fieldInfo.type !== 'String') {
3963
+ value = parseFloat(value) || value;
3964
+ }
3965
+ }
3966
+ return value;
3967
+ };
3968
+
3954
3969
  /**
3955
3970
  * Observa o read do datasource para setar o primeiro valor ou valor inicial.
3956
3971
  */
3957
-
3958
3972
  var defineInitialValue = function() {
3959
3973
  if (combobox.definingInitialValue) {
3960
3974
  return;
3961
3975
  }
3962
3976
  if (!combobox.isEvaluating) {
3963
- var currentValue = combobox.value();
3977
+ var currentValue = returnTypedValue(combobox.value());
3964
3978
  var nextValue = null;
3965
3979
 
3966
3980
  var found = dataSourceScreen.goTo(currentValue);
@@ -4897,7 +4911,7 @@
4897
4911
  } catch (e) {
4898
4912
  console.log('CronDynamicMenu: Invalid configuration!')
4899
4913
  }
4900
- let baseId = options && options.subMenuOptions ? options.subMenuOptions[0].id : "first";
4914
+ let baseId = options && options.subMenuOptions && options.subMenuOptions.length ? options.subMenuOptions[0].id : "first";
4901
4915
  var TEMPLATE_MAIN = `<ul id="menu-tag-ul-base-${baseId}" class="nav navbar-nav ${(isVertical ? 'col-md-12 padding-0' : '')}" style="float:left"></ul>`;
4902
4916
  var main = $(TEMPLATE_MAIN);
4903
4917
  main.attr('id', attrs.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cronapp-framework-js",
3
- "version": "2.8.53",
3
+ "version": "2.8.56",
4
4
  "description": "Javascript library for CronApp's projects",
5
5
  "main": "cronapp.framework.js",
6
6
  "scripts": {