isobit-ui 0.0.212 → 0.0.216
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 +27 -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.216
|
|
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,20 +1287,34 @@ 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
|
+
console.log(me.$slots);
|
|
1335
1293
|
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1294
|
+
if (me.$slots["default"]) {
|
|
1295
|
+
me.$slots["default"].forEach(function (e, i) {
|
|
1338
1296
|
console.log(e);
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1297
|
+
var column = e.data.attrs;
|
|
1298
|
+
|
|
1299
|
+
if (e.children) {
|
|
1300
|
+
e.children.filter(function (e) {
|
|
1301
|
+
return e.tag == 'v-filter';
|
|
1302
|
+
}).forEach(function (e2) {
|
|
1303
|
+
column.filter = e2;
|
|
1304
|
+
e.children.shift();
|
|
1305
|
+
});
|
|
1306
|
+
e.children.filter(function (e) {
|
|
1307
|
+
return e.tag == 'v-footer';
|
|
1308
|
+
}).forEach(function (e2) {
|
|
1309
|
+
column.footer = e2;
|
|
1310
|
+
e.children.shift();
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
columns.push(column);
|
|
1345
1315
|
});
|
|
1346
|
-
console.log(
|
|
1316
|
+
console.log(columns);
|
|
1317
|
+
me.columns = columns;
|
|
1347
1318
|
}
|
|
1348
1319
|
/*return createElement(
|
|
1349
1320
|
'h' + this.level, // nombre de etiqueta
|
|
@@ -1679,6 +1650,7 @@ var script$d = {
|
|
|
1679
1650
|
}
|
|
1680
1651
|
},
|
|
1681
1652
|
methods: {
|
|
1653
|
+
buildColumns: function buildColumns() {},
|
|
1682
1654
|
getRowClass: function getRowClass(r, row) {
|
|
1683
1655
|
var cls = [];
|
|
1684
1656
|
var me = this;
|
|
@@ -1748,30 +1720,6 @@ var script$d = {
|
|
|
1748
1720
|
console.log(this.$parent.$parent.row);
|
|
1749
1721
|
this.$emit('row',r);*/
|
|
1750
1722
|
},
|
|
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
1723
|
hasSlot: function hasSlot(s) {
|
|
1776
1724
|
return !!this.$slots[s];
|
|
1777
1725
|
},
|
|
@@ -5864,82 +5812,6 @@ window.ui = _.ui = function (cfg) {
|
|
|
5864
5812
|
}
|
|
5865
5813
|
}
|
|
5866
5814
|
|
|
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
5815
|
cfg.el = el;
|
|
5944
5816
|
}
|
|
5945
5817
|
|