isobit-ui 0.1.46 → 0.1.49
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/dist/index.js +313 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* isobit-ui v0.1.
|
|
2
|
+
* isobit-ui v0.1.49
|
|
3
3
|
* (c) Erik Alarcon Pinedo
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -3985,20 +3985,20 @@ var script$6 = {
|
|
|
3985
3985
|
|
|
3986
3986
|
el = el.children[1].children[0];
|
|
3987
3987
|
el.style.height = h + 'px';
|
|
3988
|
-
console.log(el);
|
|
3989
3988
|
var el2; //,style2;
|
|
3990
3989
|
|
|
3991
3990
|
el.children.forEach(function (ee) {
|
|
3992
3991
|
if (!el2) {
|
|
3993
3992
|
//style2 = window.getComputedStyle(ee);
|
|
3994
|
-
if (!ee.classList.contains('v-scrollable') && ee.classList.contains('v-resize')) {
|
|
3993
|
+
if (!ee.classList.contains('v-scrollable') && !ee.classList.contains('v-resize')) {
|
|
3995
3994
|
h -= ee.offsetHeight + 2;
|
|
3996
3995
|
} else {
|
|
3997
3996
|
el2 = ee;
|
|
3998
3997
|
}
|
|
3999
3998
|
}
|
|
4000
3999
|
});
|
|
4001
|
-
el = el2; //
|
|
4000
|
+
el = el2; // console.log(el);
|
|
4001
|
+
//Se espera el sea una tabla
|
|
4002
4002
|
} else {
|
|
4003
4003
|
el = el.children[0];
|
|
4004
4004
|
el.style.height = h + 'px';
|
|
@@ -5667,8 +5667,8 @@ var resize = function resize() {
|
|
|
5667
5667
|
h = h - ph.offsetHeight - 0;
|
|
5668
5668
|
p.style.height = h + 'px';
|
|
5669
5669
|
p.style.overflowY = 'auto';
|
|
5670
|
-
if (!p.classList.contains('ui-panel')) p = p.children[0];
|
|
5671
|
-
|
|
5670
|
+
if (!p.classList.contains('ui-panel')) p = p.children[0]; //console.log(p);
|
|
5671
|
+
|
|
5672
5672
|
var event = new Event("parentResize", {
|
|
5673
5673
|
bubbles: true
|
|
5674
5674
|
});
|
|
@@ -6717,7 +6717,7 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6717
6717
|
return str.replace(_$1.contextPath, _$1.contextPath + '/api');
|
|
6718
6718
|
},
|
|
6719
6719
|
open: function open(response, path, o) {
|
|
6720
|
-
{
|
|
6720
|
+
if (!(response instanceof HTMLElement)) {
|
|
6721
6721
|
var e = response;
|
|
6722
6722
|
var t = e.target;
|
|
6723
6723
|
var me = this;
|
|
@@ -6742,17 +6742,320 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6742
6742
|
|
|
6743
6743
|
return;
|
|
6744
6744
|
}
|
|
6745
|
-
var me = this;
|
|
6746
6745
|
|
|
6747
|
-
var
|
|
6746
|
+
var me = this,
|
|
6747
|
+
el;
|
|
6748
|
+
|
|
6749
|
+
if (response.$el) {
|
|
6750
|
+
response = response.$el;
|
|
6751
|
+
path = {};
|
|
6752
|
+
} else if (response instanceof HTMLElement) {
|
|
6753
|
+
path = {};
|
|
6754
|
+
} else if (response.target) {
|
|
6755
|
+
el = response.target;
|
|
6756
|
+
return me.open(el.pathname ? el.pathname : el.href);
|
|
6757
|
+
} else if (response === 'GET') {
|
|
6758
|
+
if (typeof path == 'string') {
|
|
6759
|
+
var cfg = {
|
|
6760
|
+
path: _$1.currentPath = path + (typeof o == 'string' ? '/' + o : '')
|
|
6761
|
+
};
|
|
6762
|
+
|
|
6763
|
+
if (typeof o == 'function') {
|
|
6764
|
+
cfg.result = o;
|
|
6765
|
+
} else if (_typeof(o) == 'object') {
|
|
6766
|
+
cfg = Vue$1.mergeDeep(cfg, o);
|
|
6767
|
+
}
|
|
6768
|
+
|
|
6769
|
+
return me.open(response, cfg);
|
|
6770
|
+
} else if (!path.data) {
|
|
6771
|
+
//Tiene q buscarse el elemt si existe
|
|
6772
|
+
//console.log('path='+path.path);
|
|
6773
|
+
el = document.querySelector('[path=\'' + path.path + '\']'); //console.log(el);
|
|
6774
|
+
|
|
6775
|
+
if (el) {
|
|
6776
|
+
var dd = document.querySelector('#layoutUnit-center > .ui-layout-unit-content,#page-content'); //console.log(dd);
|
|
6777
|
+
|
|
6778
|
+
for (var i = 0; i < dd.children.length; i++) {
|
|
6779
|
+
//Se ocultan todas las demas paginas
|
|
6780
|
+
if (dd.children[i].style) {
|
|
6781
|
+
if (dd.children[i].className == 'ui-panel' && dd.children[i].style.display != 'none') {
|
|
6782
|
+
backPanel = dd.children[i];
|
|
6783
|
+
}
|
|
6784
|
+
|
|
6785
|
+
dd.children[i].style.display = 'none';
|
|
6786
|
+
}
|
|
6787
|
+
}
|
|
6788
|
+
|
|
6789
|
+
el.style.removeProperty('display');
|
|
6790
|
+
return el;
|
|
6791
|
+
} else {
|
|
6792
|
+
return axios$1.get((path.path + '/?modal').replace(/([^:]\/)\/+/g, "$1")).then(function (r) {
|
|
6793
|
+
r["class"] = path["class"] ? path["class"] : '';
|
|
6794
|
+
r.path = path.path;
|
|
6795
|
+
r.result = path.callback;
|
|
6796
|
+
r = Object.assign(r, path);
|
|
6797
|
+
me.open(response, r);
|
|
6798
|
+
})["catch"](me.error);
|
|
6799
|
+
}
|
|
6800
|
+
}
|
|
6801
|
+
} else if (!response.data) {
|
|
6802
|
+
return me.open('GET', response, path);
|
|
6803
|
+
} else if (response.data) {
|
|
6804
|
+
path = response;
|
|
6805
|
+
}
|
|
6806
|
+
|
|
6807
|
+
var dialog,
|
|
6808
|
+
nid = Vue$1.id(),
|
|
6809
|
+
scriptDom = [],
|
|
6810
|
+
for_,
|
|
6811
|
+
ifor = 0;
|
|
6812
|
+
|
|
6813
|
+
if (response instanceof HTMLElement) {
|
|
6814
|
+
dialog = response;
|
|
6815
|
+
dialog.classList.add("v-dialog");
|
|
6816
|
+
} else {
|
|
6817
|
+
dialog = document.createElement("div");
|
|
6818
|
+
dialog.classList.add("v-dialog");
|
|
6819
|
+
dialog.innerHTML = path.data;
|
|
6820
|
+
var s = dialog.getElementsByTagName('script'); //console.log('patttt=' + _.currentPath);
|
|
6821
|
+
|
|
6822
|
+
dialog.setAttribute("path", _$1.currentPath);
|
|
6823
|
+
var ld = dialog.children; //console.log(s);
|
|
6824
|
+
|
|
6825
|
+
for (var k = 0; k < s.length; k++) {
|
|
6826
|
+
scriptDom.push(s[k]);
|
|
6827
|
+
}
|
|
6828
|
+
|
|
6829
|
+
for (k = 0; k < ld.length; k++) {
|
|
6830
|
+
//console.log(ld[k].tagName);
|
|
6831
|
+
if (ld[k].tagName == 'V-FORM' || ld[k].tagName == 'V-PANEL') {
|
|
6832
|
+
for_ = ld[k];
|
|
6833
|
+
ifor = k;
|
|
6834
|
+
}
|
|
6835
|
+
}
|
|
6836
|
+
}
|
|
6837
|
+
|
|
6838
|
+
var backPanel;
|
|
6839
|
+
|
|
6840
|
+
var close = function close() {
|
|
6841
|
+
dialog.style.display = "none";
|
|
6842
|
+
overlay = dialog.parentNode;
|
|
6843
|
+
|
|
6844
|
+
if (overlay.classList.contains('v-overlay')) {
|
|
6845
|
+
//para los dialog
|
|
6846
|
+
overlay.style.display = "none";
|
|
6847
|
+
dialog.parentNode.removeChild(dialog);
|
|
6848
|
+
overlay.parentNode.removeChild(overlay);
|
|
6849
|
+
}
|
|
6850
|
+
|
|
6851
|
+
if (backPanel) {
|
|
6852
|
+
dialog.parentNode.removeChild(dialog);
|
|
6853
|
+
backPanel.style.display = 'block';
|
|
6854
|
+
}
|
|
6855
|
+
|
|
6856
|
+
Vue$1.resize();
|
|
6857
|
+
};
|
|
6858
|
+
|
|
6859
|
+
if (for_ && for_.classList.contains('panel')) {
|
|
6860
|
+
//Si elemto tiene declarado el id se debe considerar que es
|
|
6861
|
+
if (for_.id) {
|
|
6862
|
+
window.currentEl = '#' + for_.id;
|
|
6863
|
+
} else {
|
|
6864
|
+
var clsId = 'cls-id-' + Vue$1.id();
|
|
6865
|
+
for_.classList.add(clsId);
|
|
6866
|
+
window.currentEl = '.' + clsId;
|
|
6867
|
+
}
|
|
6868
|
+
|
|
6869
|
+
dd = document.querySelector('#layoutUnit-center > .ui-layout-unit-content,#page-content');
|
|
6870
|
+
|
|
6871
|
+
for (i = 0; i < dd.children.length; i++) {
|
|
6872
|
+
//Se ocultan todas las demas paginas
|
|
6873
|
+
if (dd.children[i].style) {
|
|
6874
|
+
if (dd.children[i].className == 'ui-panel' && dd.children[i].style.display != 'none') {
|
|
6875
|
+
backPanel = dd.children[i];
|
|
6876
|
+
}
|
|
6877
|
+
|
|
6878
|
+
dd.children[i].style.display = 'none';
|
|
6879
|
+
}
|
|
6880
|
+
} //se agrega el dialog recuperado y se genera
|
|
6881
|
+
|
|
6882
|
+
|
|
6883
|
+
dd.appendChild(dialog); //console.log(scriptDom);
|
|
6884
|
+
|
|
6885
|
+
for (var l2 = 0; scriptDom.length > l2; l2++) {
|
|
6886
|
+
//console.log(s[l2]);
|
|
6887
|
+
try {
|
|
6888
|
+
eval(scriptDom[l2].innerHTML);
|
|
6889
|
+
} catch (e) {
|
|
6890
|
+
console.error(e);
|
|
6891
|
+
}
|
|
6892
|
+
}
|
|
6893
|
+
|
|
6894
|
+
dialog.style.display = 'none';
|
|
6895
|
+
var td;
|
|
6896
|
+
var aux = dialog.children[ifor]; //todo los elementos del dialog son agregados al panel
|
|
6897
|
+
|
|
6898
|
+
while (dialog.children.length > 0) {
|
|
6899
|
+
if (!td) td = dialog.children[0];
|
|
6900
|
+
dd.appendChild(dialog.children[0]);
|
|
6901
|
+
}
|
|
6902
|
+
|
|
6903
|
+
dialog.parentNode.removeChild(dialog);
|
|
6904
|
+
dialog = aux; //console.log(path);
|
|
6905
|
+
|
|
6906
|
+
dialog.setAttribute("path", path.path);
|
|
6907
|
+
} else {
|
|
6908
|
+
var overlay = document.createElement("div"); //console.log('create overlay');
|
|
6909
|
+
|
|
6910
|
+
overlay.classList.add("v-overlay");
|
|
6911
|
+
overlay.style.padding = "40px";
|
|
6912
|
+
document.body.appendChild(overlay);
|
|
6913
|
+
overlay.appendChild(dialog);
|
|
6914
|
+
|
|
6915
|
+
if (!(response instanceof HTMLElement)) {
|
|
6916
|
+
for (l2 = 0; s.length > l2; l2++) {
|
|
6917
|
+
//console.log(s[l2]);
|
|
6918
|
+
try {
|
|
6919
|
+
eval(s[l2].innerHTML);
|
|
6920
|
+
} catch (e) {
|
|
6921
|
+
console.error(e);
|
|
6922
|
+
}
|
|
6923
|
+
}
|
|
6924
|
+
}
|
|
6925
|
+
|
|
6926
|
+
overlay.style.visibility = "unset";
|
|
6927
|
+
overlay.style.opacity = "unset";
|
|
6928
|
+
overlay.style.overflow = "auto";
|
|
6929
|
+
dialog.style.margin = "0 auto";
|
|
6930
|
+
dialog.style.position = "unset"; //console.log(dialog);
|
|
6931
|
+
|
|
6932
|
+
var resize = function resize(e) {
|
|
6933
|
+
dialog.style.left = (window.innerWidth - dialog.offsetWidth) / 2 + 'px';
|
|
6748
6934
|
|
|
6749
|
-
|
|
6935
|
+
if (window.innerWidth < 600) {
|
|
6936
|
+
//console.log(333333);
|
|
6937
|
+
var dc = dialog.querySelector('.v-dialog-content'); //console.log(dc);
|
|
6938
|
+
|
|
6939
|
+
var h = dialog.querySelector('.v-panel-titlebar'); //console.log(h.clientHeight);
|
|
6940
|
+
|
|
6941
|
+
var ih = window.innerHeight - 94 - h.clientHeight;
|
|
6942
|
+
dc.style.height = ih + "px";
|
|
6943
|
+
}
|
|
6944
|
+
};
|
|
6945
|
+
|
|
6946
|
+
window.addEventListener('resize', resize);
|
|
6750
6947
|
|
|
6751
6948
|
if (path["class"] === 'v-search') {
|
|
6752
6949
|
var d = dialog;
|
|
6950
|
+
d.className = d.className + ' ' + path["class"];
|
|
6951
|
+
d.style.width = "100%";
|
|
6952
|
+
d.style.height = "calc(100% - 2px)";
|
|
6953
|
+
var children = d.querySelector('div');
|
|
6954
|
+
var f = d.querySelector('form');
|
|
6753
6955
|
var t = d.querySelector('.v-datatable');
|
|
6956
|
+
var tb = d.querySelector('.v-datatable-scrollable-body');
|
|
6957
|
+
children.style.height = 'calc(100% - 2px)';
|
|
6958
|
+
children.style.overflowY = 'auto';
|
|
6959
|
+
children.children[1].style.padding = '0px';
|
|
6960
|
+
children.children[1].style.height = 'calc(100% - 33px)';
|
|
6961
|
+
f.style.height = '100%';
|
|
6962
|
+
f.style.overflowY = 'auto';
|
|
6963
|
+
t.style.height = 'calc(100% - 52px)';
|
|
6964
|
+
tb.style.height = 'calc(100% - 72px)';
|
|
6965
|
+
tb.style.overflowY = 'auto';
|
|
6966
|
+
var pag = d.querySelector('.v-paginator');
|
|
6967
|
+
pag.style.display = 'inline-block';
|
|
6968
|
+
f.appendChild(pag);
|
|
6969
|
+
tb = document.createElement("button");
|
|
6970
|
+
tb.innerHTML = 'Recuperar';
|
|
6971
|
+
tb.style.padding = '4px 16px';
|
|
6972
|
+
tb.className = "_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only";
|
|
6973
|
+
|
|
6974
|
+
var vue = _$1.varMap[children.getAttribute("vueid")];
|
|
6975
|
+
|
|
6976
|
+
tb.onclick = function (e) {
|
|
6977
|
+
e.preventDefault();
|
|
6978
|
+
vue.refresh();
|
|
6979
|
+
};
|
|
6980
|
+
|
|
6981
|
+
f.appendChild(tb);
|
|
6982
|
+
tb = document.createElement("button");
|
|
6983
|
+
tb.innerHTML = 'Seleccionar';
|
|
6984
|
+
tb.style.padding = '4px 16px';
|
|
6985
|
+
tb.className = "_ ui-widget v-state-default ui-corner-all v-button ui-button-text-only";
|
|
6986
|
+
vue = _$1.varMap[children.getAttribute("vueid")];
|
|
6987
|
+
|
|
6988
|
+
tb.onclick = function (e) {
|
|
6989
|
+
e.preventDefault();
|
|
6990
|
+
var d = [];
|
|
6991
|
+
var t = vue.$children[0].$children[0];
|
|
6992
|
+
|
|
6993
|
+
for (i = 0; i < t.selected.length; i++) {
|
|
6994
|
+
d.push(t.filteredData[t.selected[i]]);
|
|
6995
|
+
}
|
|
6996
|
+
|
|
6997
|
+
path.result(d);
|
|
6998
|
+
delete path.result;
|
|
6999
|
+
vue.close(e);
|
|
7000
|
+
};
|
|
7001
|
+
|
|
7002
|
+
f.appendChild(tb);
|
|
6754
7003
|
}
|
|
7004
|
+
|
|
7005
|
+
resize();
|
|
6755
7006
|
}
|
|
7007
|
+
|
|
7008
|
+
_$1.storeFunction['PROPS=' + nid] = path;
|
|
7009
|
+
|
|
7010
|
+
_$1.storeFunction[nid] = function (o) {
|
|
7011
|
+
if (path.result) {
|
|
7012
|
+
path.result(o);
|
|
7013
|
+
}
|
|
7014
|
+
|
|
7015
|
+
if (o === true) me.refresh();
|
|
7016
|
+
};
|
|
7017
|
+
|
|
7018
|
+
var _vue_ = dialog.querySelector('[vueid]');
|
|
7019
|
+
|
|
7020
|
+
if (_vue_) {
|
|
7021
|
+
path.__vue__ = _vue_.__vue__;
|
|
7022
|
+
|
|
7023
|
+
_vue_.__vue__.$emit('opened', path);
|
|
7024
|
+
}
|
|
7025
|
+
|
|
7026
|
+
dialog.setAttribute("callback", nid);
|
|
7027
|
+
var h = dialog.querySelector('.v-panel-titlebar');
|
|
7028
|
+
|
|
7029
|
+
if (h) {
|
|
7030
|
+
var acl = h.querySelector('.ui-js-close');
|
|
7031
|
+
|
|
7032
|
+
window.onkeyup = function (event) {
|
|
7033
|
+
if (event.keyCode == 27) {
|
|
7034
|
+
close();
|
|
7035
|
+
}
|
|
7036
|
+
};
|
|
7037
|
+
|
|
7038
|
+
if (!acl) {
|
|
7039
|
+
var span = document.createElement("i");
|
|
7040
|
+
span.style.top = "6px";
|
|
7041
|
+
span.style.right = "6px";
|
|
7042
|
+
h.style.position = "relative";
|
|
7043
|
+
span.style.position = "absolute";
|
|
7044
|
+
span.style.color = "white";
|
|
7045
|
+
span.className = "fa fa-window-close v-dialog-close";
|
|
7046
|
+
acl = document.createElement("a");
|
|
7047
|
+
acl.className = "ui-js-close v-dialog-titlebar-icon v-dialog-titlebar-close ui-corner-all";
|
|
7048
|
+
acl.appendChild(span);
|
|
7049
|
+
h.appendChild(acl);
|
|
7050
|
+
acl.addEventListener("click", close);
|
|
7051
|
+
}
|
|
7052
|
+
}
|
|
7053
|
+
|
|
7054
|
+
dialog.style.display = 'block';
|
|
7055
|
+
Vue$1.resize();
|
|
7056
|
+
document.documentElement.style.overflow = 'hidden'; // firefox, chrome
|
|
7057
|
+
|
|
7058
|
+
document.body.scroll = "no"; // ie only
|
|
6756
7059
|
},
|
|
6757
7060
|
close: function close(ok) {
|
|
6758
7061
|
if (ok.$el) ok = ok.$el;
|