Skip to content

Commit

Permalink
[update] version 8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Helga committed Mar 3, 2021
1 parent ec87d6f commit 2f6e359
Show file tree
Hide file tree
Showing 70 changed files with 1,158 additions and 1,076 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Webix UI v.8.1.0
Webix UI v.8.2.0
================

[![npm version](https://badge.fury.io/js/webix.svg)](https://badge.fury.io/js/webix)
Expand Down Expand Up @@ -46,4 +46,4 @@ you can get help at https://forum.webix.com



(c) XB Software Ltd. 2020
(c) XB Software Ltd. 2021
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webix",
"productTag": "webix",
"version": "8.1.0",
"version": "8.2.0",
"description": "Javascript UI for Web",
"scripts": {
"lint": "yarn eslint \"sources/**/*.js\"",
Expand Down
4 changes: 2 additions & 2 deletions sources/core/atomdataloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const AtomDataLoader={
parsed = record?driver.getDetails(record):{};

if (this.setValues)
this.setValues(parsed);
this.setValues(parsed, "auto");
else
this.data = parsed;
},
Expand Down Expand Up @@ -210,7 +210,7 @@ const AtomDataLoader={
var driver = DataDriver.json;
var data = driver.toObject(text, xml);
if (data)
this.setValues(driver.getDetails(driver.getRecords(data)[0]));
this.setValues(driver.getDetails(driver.getRecords(data)[0]), "auto");
else
this._onLoadError(loader);
this._ignore_feed = false;
Expand Down
4 changes: 2 additions & 2 deletions sources/core/autotooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const AutoTooltip = {
},
$tooltipMove:function(t,e,c){
const tooltip = this._settings.tooltip;
const overflow = isUndefined(tooltip.overflow) ? TooltipControl.overflow : tooltip.overflow;
const time = isUndefined(tooltip.delay) ? TooltipControl.delay : tooltip.delay;
const overflow = !tooltip || isUndefined(tooltip.overflow) ? TooltipControl.overflow : tooltip.overflow;
const time = !tooltip || isUndefined(tooltip.delay) ? TooltipControl.delay : tooltip.delay;
const text = overflow ? c.overflow : c.first;

if (time > 0)
Expand Down
10 changes: 5 additions & 5 deletions sources/core/bindsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const BindSource = {
this._ignore_binds[key] = true;

if (this.setValue)
this.setValue(data);
this.setValue(data, "auto");
else if (this.setValues)
this.setValues(data);
this.setValues(data, "auto");
else {
var id = this.getCursor();
if (id)
Expand Down Expand Up @@ -87,13 +87,13 @@ const BindSource = {
//copy data from source to the target
_bind_update_common:function(target, rule, data){
if (target.setValue)
target.setValue((data&&rule)?data[rule]:data);
target.setValue((data&&rule)?data[rule]:data,"auto");
else if (!target.filter){
if (!data && target.clear)
target.clear();
target.clear("auto");
else {
if (target._check_data_feed(data))
target.setValues(clone(data));
target.setValues(clone(data),"auto");
}
} else {
target.data.silent(function(){
Expand Down
4 changes: 2 additions & 2 deletions sources/core/datarecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const DataRecord = proto({
getValues:function(){
return this.data;
},
setValues:function(data, update){
setValues:function(data, update, config){
this.data = update?extend(this.data, data, true):data;
this.callEvent("onChange", [data]);
this.callEvent("onChange", [data, config]);
},
refresh:function(){ this.callEvent("onBindRequest"); }
}, EventSystem, BaseBind, AtomDataLoader, Settings);
Expand Down
7 changes: 4 additions & 3 deletions sources/core/datastate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {isArray} from "../webix/helpers";
import {isArray, _to_array} from "../webix/helpers";

const DataState = {
getState:function(){
Expand Down Expand Up @@ -58,8 +58,9 @@ const DataState = {
this.blockEvent();

if (obj.order && obj.order.length){
this._hidden_column_order = [].concat(obj.order);
this._hidden_split = [ this._settings.leftSplit, obj.order.length - this._settings.rightSplit ];
this._hidden_column_order = _to_array([].concat(obj.order));
const rs = obj.order.length - this._settings.rightSplit;
this._hidden_split = [this._settings.leftSplit, rs, this._settings.rightSplit];
}

if (obj.hidden){
Expand Down
4 changes: 2 additions & 2 deletions sources/core/datavalue.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const DataValue = proto({
this._settings = { id:id };
ui.views[id] = this;
},
setValue:function(value){
setValue:function(value,config){
this.data = value;
this.callEvent("onChange", [value]);
this.callEvent("onChange", [value,config]);
},
getValue:function(){
return this.data;
Expand Down
3 changes: 1 addition & 2 deletions sources/core/editability.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ const EditAbility ={

form = $$(form);
var realform = form.setValues?form:form.getChildViews()[0];


realform.setValues(this.getItem(id.row || id));
realform.setValues(this.getItem(id.row || id), "auto");
form.config.master = this.config.id;
form.show( this.getItemNode(id) );

Expand Down
10 changes: 5 additions & 5 deletions sources/core/htmloptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const HTMLOptions = {
if (!inp[i].getAttribute("webix_disabled")){
const id = inp[i].getAttribute(/*@attr*/"button_id");

this.setValue(id);
this.setValue(id, "user");
inp[i].focus();
i = "success";
}
Expand Down Expand Up @@ -112,7 +112,7 @@ const HTMLOptions = {
}

if (show)
this.setValue(id);
this.setValue(id, "auto");
},
removeOption: function(id){
const index = this.optionIndex(id);
Expand All @@ -138,15 +138,15 @@ const HTMLOptions = {
//forward search
for (let i=index; i<size; i++)
if (!options[i].hidden)
return this.setValue(options[i].id);
return this.setValue(options[i].id,"auto");
//backward search
for (let i=index; i>=0; i--)
if (!options[i].hidden)
return this.setValue(options[i].id);
return this.setValue(options[i].id,"auto");
}

//nothing found
this.setValue("");
this.setValue("","auto");
},
_getFirstActive(first){
const options = this._settings.options;
Expand Down
2 changes: 1 addition & 1 deletion sources/core/keysnavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const KeysNavigation = {

if (view && view.moveSelection && view.config.navigation && !view._in_edit_mode){
preventEvent(e);
return view.moveSelection(mode, {shift:e.shiftKey, ctrl:e.ctrlKey});
return view.moveSelection(mode, {shift:e.shiftKey, ctrl:e.ctrlKey, e});
}
};
},
Expand Down
16 changes: 5 additions & 11 deletions sources/core/mapcollection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {uid, isArray} from "../webix/helpers";
import {isArray} from "../webix/helpers";
import {$$} from "../ui/core";

import i18n from "../webix/i18n";
Expand Down Expand Up @@ -70,16 +70,10 @@ const MapCollection = {
}
},
_build_data_map:function(columns){ //for datatable
for (var i=0; i<columns.length; i++){
var map = columns[i].map;
var id = columns[i].id;
if (!id) {
id = columns[i].id = "i"+uid();
if (!columns[i].header)
columns[i].header = "";
}
if (map)
this._scheme_init_order.push(this._process_single_map(id, map, columns[i]));
for (let i=0; i<columns.length; i++){
const col = columns[i];
if (col.map)
this._scheme_init_order.push(this._process_single_map(col.id, col.map, columns[i]));

this._map_options(columns[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion sources/core/uimanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const UIManager = {
if (!node) continue;

if (!isUndefined(state.collapsed)) node.define("collapsed", state.collapsed);
if (!isUndefined(state.activeCell)) node.setValue(state.activeCell);
if (!isUndefined(state.activeCell)) node.setValue(state.activeCell, "auto");

node.define("width", state.width);
node.define("height", state.height);
Expand Down
2 changes: 1 addition & 1 deletion sources/core/validatecollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import rules from "../webix/rules";
const ValidateCollection = {
_validate_init_once:function(){
this.data.attachEvent("onStoreUpdated",bind(function(id, data, mode){
if (id && (mode == "add" || mode == "update"))
if (id && (mode == "add" || mode == "update" || mode =="save"))
this.validate(id);
}, this));
this.data.attachEvent("onClearAll",bind(this.clearValidation, this));
Expand Down
4 changes: 2 additions & 2 deletions sources/core/valuebind.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const ValueBind={
if (format) data = format(data);

if (target.setValue)
target.setValue(data);
target.setValue(data,"auto");
else if (!target.filter){
var pod = {}; pod[rule] = data;
if (target._check_data_feed(data))
target.setValues(pod);
target.setValues(pod,"auto");
} else{
target.data.silent(function(){
this.filter(rule,data);
Expand Down
16 changes: 8 additions & 8 deletions sources/core/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const Values = {
}
return false;
},
setValues:function(data, update){
setValues:function(data, update, config){
if (this._settings.complexData)
data = CodeParser.collapseNames(data, "", {}, (v) => !this.elements[v]);
this._inner_setValues(data, update);
this._inner_setValues(data, update, config);
},
_inner_setValues:function(data, update){
_inner_setValues:function(data, update, config){
this._is_form_dirty = update;
//prevent onChange calls from separate controls
this.blockEvent();
Expand All @@ -47,12 +47,12 @@ const Values = {
this._values[name] = data[name];

for (let name in this.elements){
var input = this.elements[name];
const input = this.elements[name];
if (input){
if (!isUndefined(data[name]))
input.setValue(data[name]);
input.setValue(data[name], config);
else if (!update && input.$allowsClear)
input.setValue("");
input.setValue("", config);
this._values[name] = input.getValue();
}
}
Expand Down Expand Up @@ -123,14 +123,14 @@ const Values = {
}
return data;
},
clear:function(){
clear:function(config){
this._is_form_dirty = false;
var data = {};
for (var name in this.elements)
if (this.elements[name].$allowsClear)
data[name] = "";

this._inner_setValues(data);
this._inner_setValues(data, false, config);
},
markInvalid: function(name, state){
// remove 'invalid' mark
Expand Down
Loading

0 comments on commit 2f6e359

Please sign in to comment.