cronapp-framework-js 2.8.54 → 2.8.57

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
@@ -2989,10 +2989,7 @@
2989
2989
  },
2990
2990
  change: function(e) {
2991
2991
  var item = this.dataItem(this.select());
2992
- let manyHiddenSelect = $('[data-component="crn-enterprise-dynamic-combobox"]').length > 1 && !$('[data-component="crn-enterprise-dynamic-combobox"]').is(':visible');
2993
- if (!manyHiddenSelect) {
2994
- setToActiveInCronappDataSource.bind(this)(item);
2995
- }
2992
+ setToActiveInCronappDataSource.bind(this)(item);
2996
2993
  var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
2997
2994
  if(options.fieldType && options.fieldType === 'key'){
2998
2995
  cronappDatasource.active = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.active);
@@ -3956,16 +3953,25 @@
3956
3953
  }
3957
3954
  }
3958
3955
 
3956
+ let returnTypedValue = (value) => {
3957
+ if (dataSourceScreen.schema) {
3958
+ let fieldInfo = dataSourceScreen.schema.find(s=> s.name === options.dataValueField);
3959
+ if (fieldInfo && fieldInfo.type !== 'String') {
3960
+ value = parseFloat(value) || value;
3961
+ }
3962
+ }
3963
+ return value;
3964
+ };
3965
+
3959
3966
  /**
3960
3967
  * Observa o read do datasource para setar o primeiro valor ou valor inicial.
3961
3968
  */
3962
-
3963
3969
  var defineInitialValue = function() {
3964
3970
  if (combobox.definingInitialValue) {
3965
3971
  return;
3966
3972
  }
3967
3973
  if (!combobox.isEvaluating) {
3968
- var currentValue = combobox.value();
3974
+ var currentValue = returnTypedValue(combobox.value());
3969
3975
  var nextValue = null;
3970
3976
 
3971
3977
  var found = dataSourceScreen.goTo(currentValue);
@@ -4902,7 +4908,7 @@
4902
4908
  } catch (e) {
4903
4909
  console.log('CronDynamicMenu: Invalid configuration!')
4904
4910
  }
4905
- let baseId = options && options.subMenuOptions ? options.subMenuOptions[0].id : "first";
4911
+ let baseId = options && options.subMenuOptions && options.subMenuOptions.length ? options.subMenuOptions[0].id : "first";
4906
4912
  var TEMPLATE_MAIN = `<ul id="menu-tag-ul-base-${baseId}" class="nav navbar-nav ${(isVertical ? 'col-md-12 padding-0' : '')}" style="float:left"></ul>`;
4907
4913
  var main = $(TEMPLATE_MAIN);
4908
4914
  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.54",
3
+ "version": "2.8.57",
4
4
  "description": "Javascript library for CronApp's projects",
5
5
  "main": "cronapp.framework.js",
6
6
  "scripts": {