isobit-ui 0.0.212 → 0.0.214
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 +22 -155
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* isobit-ui v0.0.
|
|
2
|
+
* isobit-ui v0.0.214
|
|
3
3
|
* (c) Erik Alarcon Pinedo
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1210,49 +1210,6 @@ function _await$1(value, then, direct) {
|
|
|
1210
1210
|
return then ? value.then(then) : value;
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
|
-
//
|
|
1214
|
-
//
|
|
1215
|
-
//
|
|
1216
|
-
//
|
|
1217
|
-
//
|
|
1218
|
-
//
|
|
1219
|
-
//
|
|
1220
|
-
//
|
|
1221
|
-
//
|
|
1222
|
-
//
|
|
1223
|
-
//
|
|
1224
|
-
//
|
|
1225
|
-
//
|
|
1226
|
-
//
|
|
1227
|
-
//
|
|
1228
|
-
//
|
|
1229
|
-
//
|
|
1230
|
-
//
|
|
1231
|
-
//
|
|
1232
|
-
//
|
|
1233
|
-
//
|
|
1234
|
-
//
|
|
1235
|
-
//
|
|
1236
|
-
//
|
|
1237
|
-
//
|
|
1238
|
-
//
|
|
1239
|
-
//
|
|
1240
|
-
//
|
|
1241
|
-
//
|
|
1242
|
-
//
|
|
1243
|
-
//
|
|
1244
|
-
//
|
|
1245
|
-
//
|
|
1246
|
-
//
|
|
1247
|
-
//
|
|
1248
|
-
//
|
|
1249
|
-
//
|
|
1250
|
-
//
|
|
1251
|
-
//
|
|
1252
|
-
//
|
|
1253
|
-
//
|
|
1254
|
-
//
|
|
1255
|
-
//
|
|
1256
1213
|
var template = "\n\t<div v-bind:class={reflow:reflow} v-bind:key=\"'v-table-'+keyBody\" class=\"v-datatable v-resize\" style=\"background-color:#dbdbdb\"><template v-if=\"active\">\n\t\t<div v-if=\"hasSlot('header')\" class=\"v-datatable-header v-widget-header ui-corner-top\"><slot name=\"header\"></slot>\n\t\t</div>\n\t\t<div v-if=\"pagination\" class=\"v-paginator v-paginator-top v-widget-header v-paginator-pages center\">\n\t\t\n\t\t<v-button value=\"|<\" v-bind:disabled=\"page<=1\" v-on:click.prevent=\"to(1)\"/><v-button value=\"<\" v-on:click.prevent=\"to(page-1)\" v-bind:disabled=\"page<=1\"/><div style=\"padding:3px 8px;display:inline-block\">\n\t\t<input type=\"number\" v-on:change=\"to(page,true)\" style=\"width:60px\" min=\"1\" v-bind:max=\"pages\" v-model=\"page\"/> / {{pages}}</div>\n\t\t<v-button value=\">\" v-on:click.prevent=\"to(page+1)\" v-bind:disabled=\"page==pages\"/><v-button v-on:click.prevent=\"to(pages)\" value=\">|\" v-bind:disabled=\"page==pages\"/>\n\t\t\t</div>\n\t\t<div v-if=\"scrollable0\" class=\"v-widget-header v-datatable-scrollable-header\" style=\"position:relative\">\n\t\t<div class=\"v-datatable-scrollable-header-box\" style=\"\"></div></div>\n\t\t<div v-bind:class=\"{'v-datatable-scrollable-body':scrollable0}\">\n\t\t<table class=\"v-table\" v-bind:style=\"{width:width}\" v-if=\"columns\">\n\t\t\t<thead><tr>\n\t\t\t<th v-if=\"selectable0\" v-bind:width=\"getCheckColumnWidth\" >\n\t\t\t<span class=\"v-check\" v-on:click=\"rowSelect(null,-10)\" v-bind:data-icon=\"selected.length?'check-square':'square'\"><i class=\"fa fa-lg\" v-bind:class=\"selected.length?'fa-check-square':'fa-square'\"></i></span></th>\n\t\t\t<th v-bind:class=\"k['h-class']\" v-for=\"k in columns\" v-bind:width=\"k.width\" v-on:click=\"sortBy(k)\">\n\t\t\t<div v-html=\"k.header\"></div>\n\t\t\t</th>\n\t\t\t</tr></thead>\n\t\t\t<tbody class=\"v-datatable-data\" v-bind:key=\"kc\">\n\t\t\t\t<tr v-for=\"(entry,r) in sortedData\" @row=\"rowCreated(entry)\" @click=\"_selectRow($event,entry,r)\" v-bind:class=\"getRowClass(r,entry)\">\n\t\t\t\t\t<td v-if=\"selectable0\" width=\"18\" >\n\t\t\t\t\t\t<span v-bind:data-index=\"r\" class=\"v-check\" v-on:click=\"rowSelect(entry,r)\"\n\t\t\t\t\t\tv-bind:data-icon=\"isSelected(r)?'check-square':'square'\"><i class=\"far fa-lg\" v-bind:class=\"isSelected(r)?'fa-check-square':'fa-square'\" ></i></span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<slot v-bind:row=\"entry\" v-bind:index=\"r+(page-1)*paginatio_\"></slot>\n\t\t\t\t</tr>\n\t\t\t\t<tr v-if=\"!sortedData||sortedData.length==0\">\n\t\t\t\t\t<td v-bind:colspan=\"columns.length+(selectable0?1:0)\">{{emptyMessage}}</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>\n\t\t<div v-if=\"summary||hasSlot('summary')\" class=\"v-table-summary\" v-bind:class=\"{'v-datatable-scrollable-body':scrollable}\">\n\t\t\t<table class=\"v-table v-table-summary\"><tr>\n\t\t\t<td v-if=\"selectable0\" v-bind:width=\"getCheckColumnWidth\" ></td>\n\t\t\t<slot name=\"summary\" v-bind:data=\"sortedData\"></slot>\n\t\t\t</tr></table>\n\t\t</div>\n\t\t<div class=\"hide filters\"><slot name=\"filters\"></slot><slot name=\"columns\"></slot></div></template></div>\n";
|
|
1257
1214
|
|
|
1258
1215
|
function _invoke$1(body, then) {
|
|
@@ -1330,27 +1287,36 @@ var script$d = {
|
|
|
1330
1287
|
},
|
|
1331
1288
|
render: function render(createElement) {
|
|
1332
1289
|
console.log('RENDER TABLE');
|
|
1333
|
-
var
|
|
1334
|
-
|
|
1290
|
+
var me = this,
|
|
1291
|
+
columns = [];
|
|
1292
|
+
me.$slots["default"].forEach(function (e, i) {
|
|
1293
|
+
console.log(e);
|
|
1294
|
+
var column = e.data.attrs;
|
|
1335
1295
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
console.log(e);
|
|
1339
|
-
if (e.children) e.children.filter(function (e) {
|
|
1296
|
+
if (e.children) {
|
|
1297
|
+
e.children.filter(function (e) {
|
|
1340
1298
|
return e.tag == 'v-filter';
|
|
1341
1299
|
}).forEach(function (e2) {
|
|
1342
|
-
|
|
1300
|
+
column.filter = e2;
|
|
1343
1301
|
e.children.shift();
|
|
1344
1302
|
});
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1303
|
+
e.children.filter(function (e) {
|
|
1304
|
+
return e.tag == 'v-footer';
|
|
1305
|
+
}).forEach(function (e2) {
|
|
1306
|
+
column.footer = e2;
|
|
1307
|
+
e.children.shift();
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
columns.push(column);
|
|
1312
|
+
});
|
|
1313
|
+
console.log(columns);
|
|
1314
|
+
me.columns = columns;
|
|
1348
1315
|
/*return createElement(
|
|
1349
1316
|
'h' + this.level, // nombre de etiqueta
|
|
1350
1317
|
this.$slots.default // arreglo de hijos
|
|
1351
1318
|
)*/
|
|
1352
1319
|
|
|
1353
|
-
|
|
1354
1320
|
var el = new DOMParser().parseFromString(template, "text/xml");
|
|
1355
1321
|
/*
|
|
1356
1322
|
|
|
@@ -1679,6 +1645,7 @@ var script$d = {
|
|
|
1679
1645
|
}
|
|
1680
1646
|
},
|
|
1681
1647
|
methods: {
|
|
1648
|
+
buildColumns: function buildColumns() {},
|
|
1682
1649
|
getRowClass: function getRowClass(r, row) {
|
|
1683
1650
|
var cls = [];
|
|
1684
1651
|
var me = this;
|
|
@@ -1748,30 +1715,6 @@ var script$d = {
|
|
|
1748
1715
|
console.log(this.$parent.$parent.row);
|
|
1749
1716
|
this.$emit('row',r);*/
|
|
1750
1717
|
},
|
|
1751
|
-
buildColumns: function buildColumns(c) {
|
|
1752
|
-
var me = this;
|
|
1753
|
-
|
|
1754
|
-
if (!me.columns) {
|
|
1755
|
-
//console.log(_.vtable);
|
|
1756
|
-
//console.log('columns='+me.$el.getAttribute("columns"));
|
|
1757
|
-
if (!c) {
|
|
1758
|
-
if (_.vtable) {
|
|
1759
|
-
c = _.vtable[me.$el.getAttribute("columns")];
|
|
1760
|
-
} else {
|
|
1761
|
-
var cc = me.$slots.columns;
|
|
1762
|
-
c = [];
|
|
1763
|
-
if (!cc) console.log('No columns in table!');
|
|
1764
|
-
|
|
1765
|
-
for (var k = 0; k < cc.length; k++) {
|
|
1766
|
-
c.push(cc[k].data.attrs);
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
} //console.log(c);
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
me.columns = c;
|
|
1773
|
-
}
|
|
1774
|
-
},
|
|
1775
1718
|
hasSlot: function hasSlot(s) {
|
|
1776
1719
|
return !!this.$slots[s];
|
|
1777
1720
|
},
|
|
@@ -5864,82 +5807,6 @@ window.ui = _.ui = function (cfg) {
|
|
|
5864
5807
|
}
|
|
5865
5808
|
}
|
|
5866
5809
|
|
|
5867
|
-
_.vtable = {}; //esto es util si se tienen listados
|
|
5868
|
-
|
|
5869
|
-
var ta = el.querySelectorAll("v-table");
|
|
5870
|
-
|
|
5871
|
-
for (i = 0; i < ta.length; i++) {
|
|
5872
|
-
var te = ta[i].querySelectorAll("template");
|
|
5873
|
-
|
|
5874
|
-
for (j = 0; j < te.length; j++) {
|
|
5875
|
-
var att = te[j].attributes,
|
|
5876
|
-
k,
|
|
5877
|
-
atts;
|
|
5878
|
-
|
|
5879
|
-
if ('v-slot:default' in att || 'v-slot' in att) {
|
|
5880
|
-
var columns = [],
|
|
5881
|
-
n;
|
|
5882
|
-
var filterTemplate = document.createElement("template");
|
|
5883
|
-
filterTemplate.setAttribute("v-slot:filters", ""); //var selectable=ta[i].getAttribute("v-bind:selectable");
|
|
5884
|
-
|
|
5885
|
-
ta[i].appendChild(filterTemplate);
|
|
5886
|
-
var td = te[j].content.children;
|
|
5887
|
-
var summary = []; //var hassumary=0;
|
|
5888
|
-
|
|
5889
|
-
for (var l = 0; l < td.length; l++) {
|
|
5890
|
-
var m = {};
|
|
5891
|
-
var su = td[l].querySelector("v-footer");
|
|
5892
|
-
if (su) summary[l] = su;
|
|
5893
|
-
var f = td[l].querySelector("v-filter");
|
|
5894
|
-
|
|
5895
|
-
if (f) {
|
|
5896
|
-
td[l].removeChild(f);
|
|
5897
|
-
|
|
5898
|
-
for (k = 0; k < f.children.length; k++) {
|
|
5899
|
-
f.children[k].setAttribute("index", l);
|
|
5900
|
-
filterTemplate.content.appendChild(f.children[k]);
|
|
5901
|
-
}
|
|
5902
|
-
|
|
5903
|
-
m['filter'] = f;
|
|
5904
|
-
}
|
|
5905
|
-
|
|
5906
|
-
for (k = 0, atts = td[l].attributes, n = atts.length; k < n; k++) {
|
|
5907
|
-
att = atts[k];
|
|
5908
|
-
m[att.nodeName] = att.nodeValue;
|
|
5909
|
-
}
|
|
5910
|
-
|
|
5911
|
-
columns.push(m);
|
|
5912
|
-
}
|
|
5913
|
-
|
|
5914
|
-
if (summary.length) {
|
|
5915
|
-
filterTemplate = document.createElement("template");
|
|
5916
|
-
filterTemplate.setAttribute("v-slot:summary", "");
|
|
5917
|
-
ta[i].appendChild(filterTemplate);
|
|
5918
|
-
td = te[j].content.children;
|
|
5919
|
-
|
|
5920
|
-
for (l = 0; l < td.length; l++) {
|
|
5921
|
-
var ell = summary[l];
|
|
5922
|
-
var t = document.createElement("td");
|
|
5923
|
-
|
|
5924
|
-
if (ell) {
|
|
5925
|
-
t.innerHTML = ell.innerHTML;
|
|
5926
|
-
ell.parentNode.removeChild(ell);
|
|
5927
|
-
} else t.innerHTML = ' ';
|
|
5928
|
-
|
|
5929
|
-
filterTemplate.content.appendChild(t);
|
|
5930
|
-
}
|
|
5931
|
-
}
|
|
5932
|
-
|
|
5933
|
-
var cid = _.id();
|
|
5934
|
-
|
|
5935
|
-
_.vtable[cid] = columns;
|
|
5936
|
-
ta[i].setAttribute("columns", cid);
|
|
5937
|
-
}
|
|
5938
|
-
|
|
5939
|
-
ta[i].setAttribute("v-bind:filters", "filters");
|
|
5940
|
-
}
|
|
5941
|
-
}
|
|
5942
|
-
|
|
5943
5810
|
cfg.el = el;
|
|
5944
5811
|
}
|
|
5945
5812
|
|