isobit-ui 0.2.93 → 0.2.95
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 +83 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* isobit-ui v0.2.
|
|
2
|
+
* isobit-ui v0.2.94
|
|
3
3
|
* (c) Erik Alarcon Pinedo
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2047,6 +2047,22 @@ function _await$2(value, then, direct) {
|
|
|
2047
2047
|
|
|
2048
2048
|
var template = "\n\t<div :class={reflow:reflow} :key=\"'v-table-'+keyBody\" :style={width:width}\n class=\"v-datatable v-resize\">\n <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=\"|<\" :disabled=\"page<=1\" v-on:click.prevent=\"to(1)\"/><v-button value=\"<\" v-on:click.prevent=\"to(page-1)\" :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\" :max=\"pages\" v-model=\"page\"/> / {{pages}}</div>\n\t\t<v-button value=\">\" v-on:click.prevent=\"to(page+1)\" :disabled=\"page==pages\"/><v-button v-on:click.prevent=\"to(pages)\" value=\">|\" :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 :class=\"{'v-datatable-scrollable-body':scrollable0}\">\n\t\t<table class=\"v-table\" :style=\"{width:width}\" v-if=\"columns\">\n\t\t\t<thead>\n <tr>\n <th v-if=\"selectable0\" :width=\"getCheckColumnWidth\" >\n <span class=\"v-check\" v-on:click=\"rowSelect(null,-10)\" :data-icon=\"selected.length?'square-check':'square'\">\n <i class=\"fa fa-lg\" :class=\"selected.length?'fa-square-check':'fa-square'\"></i>\n </span>\n </th>\n <th :class=\"k['h-class']\" v-for=\"k in columns\" :width=\"k.width\" v-on:click=\"sortBy(k)\">\n <div v-html=\"k.header\"></div>\n </th>\n\t\t\t</tr>\n </thead>\n\t\t\t<tbody class=\"v-datatable-data\" :key=\"kc\">\n\t\t\t\t<tr v-for=\"(entry,r) in sortedData\" @row=\"rowCreated(entry)\" @click=\"_selectRow($event,entry,r)\" \n :class=\"getRowClass(r,entry)\">\n\t\t\t\t\t<td v-if=\"selectable0\" width=\"18\" class=\"center\">\n\t\t\t\t\t\t<span :data-index=\"r\" class=\"v-check\" v-on:click=\"rowSelect(entry,r)\"\n\t\t\t\t\t\t:data-icon=\"isSelected(r)?'square-check':'square'\"><i class=\"far fa-lg\" :class=\"isSelected(r)?'fa-square-check':'fa-square'\" ></i></span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<slot :row=\"entry\" :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 :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\" :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\" :width=\"getCheckColumnWidth\" ></td>\n\t\t\t<slot name=\"summary\" :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";
|
|
2049
2049
|
|
|
2050
|
+
function _catch$1(body, recover) {
|
|
2051
|
+
try {
|
|
2052
|
+
var result = body();
|
|
2053
|
+
} catch (e) {
|
|
2054
|
+
return recover(e);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
if (result && result.then) {
|
|
2058
|
+
return result.then(void 0, recover);
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
return result;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
var compiledTemplate = Vue$1.compile(template);
|
|
2065
|
+
|
|
2050
2066
|
function _invoke$2(body, then) {
|
|
2051
2067
|
var result = body();
|
|
2052
2068
|
|
|
@@ -2057,7 +2073,6 @@ function _invoke$2(body, then) {
|
|
|
2057
2073
|
return then(result);
|
|
2058
2074
|
}
|
|
2059
2075
|
|
|
2060
|
-
var compiledTemplate = Vue$1.compile(template);
|
|
2061
2076
|
var script$d = {
|
|
2062
2077
|
props: {
|
|
2063
2078
|
value: Array,
|
|
@@ -2630,7 +2645,12 @@ var script$d = {
|
|
|
2630
2645
|
}; //t.onerror = event => reject(event.target.error);
|
|
2631
2646
|
|
|
2632
2647
|
});
|
|
2633
|
-
return
|
|
2648
|
+
return _catch$1(function () {
|
|
2649
|
+
return _await$2(p); //console.log(result);
|
|
2650
|
+
}, function (e) {
|
|
2651
|
+
alert(store);
|
|
2652
|
+
throw e;
|
|
2653
|
+
});
|
|
2634
2654
|
} catch (e) {
|
|
2635
2655
|
return Promise.reject(e);
|
|
2636
2656
|
}
|
|
@@ -6212,6 +6232,41 @@ var f = {
|
|
|
6212
6232
|
if (![].contains) Object.defineProperty(Array.prototype, 'contains', f);
|
|
6213
6233
|
if (!"".contains) Object.defineProperty(String.prototype, 'contains', f);
|
|
6214
6234
|
_$1 = Object.assign(_$1, {
|
|
6235
|
+
initDB: function initDB(version, stores) {
|
|
6236
|
+
var db = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
|
6237
|
+
_$1.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
|
|
6238
|
+
_$1.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
|
|
6239
|
+
|
|
6240
|
+
if (!db) {
|
|
6241
|
+
window.alert("Your browser doesn't support a stable version of IndexedDB.");
|
|
6242
|
+
} else {
|
|
6243
|
+
_$1.indexedDB = db;
|
|
6244
|
+
|
|
6245
|
+
if (_$1.indexedDB) {
|
|
6246
|
+
_$1.stores = stores;
|
|
6247
|
+
var request = window.indexedDB.open("db", 9);
|
|
6248
|
+
|
|
6249
|
+
request.onerror = function () {
|
|
6250
|
+
alert("error al crear db :/!");
|
|
6251
|
+
};
|
|
6252
|
+
|
|
6253
|
+
request.onsuccess = function () {
|
|
6254
|
+
_$1.db = request.result;
|
|
6255
|
+
};
|
|
6256
|
+
|
|
6257
|
+
request.onupgradeneeded = function (event) {
|
|
6258
|
+
var db = event.target.result;
|
|
6259
|
+
stores.forEach(function (e) {
|
|
6260
|
+
if (!db.objectStoreNames.contains(e[0])) {
|
|
6261
|
+
db.createObjectStore(e[0], e[1]);
|
|
6262
|
+
}
|
|
6263
|
+
});
|
|
6264
|
+
};
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
return db;
|
|
6269
|
+
},
|
|
6215
6270
|
getStoredList: function getStoredList(store, params) {
|
|
6216
6271
|
try {
|
|
6217
6272
|
var _exit3 = false;
|
|
@@ -7606,9 +7661,9 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
7606
7661
|
},
|
|
7607
7662
|
getStoredList: function getStoredList(storage, tt) {
|
|
7608
7663
|
try {
|
|
7609
|
-
if (
|
|
7664
|
+
if (_$1.db) {
|
|
7610
7665
|
var p = new Promise(function (resolve) {
|
|
7611
|
-
var t = tt ?
|
|
7666
|
+
var t = tt ? _$1.db.transaction(storage, tt) : _$1.db.transaction(storage),
|
|
7612
7667
|
objectStore = t.objectStore(storage); //,d=[];
|
|
7613
7668
|
|
|
7614
7669
|
var r = objectStore.getAll();
|
|
@@ -7618,7 +7673,12 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
7618
7673
|
}; //t.onerror = event => reject(event.target.error);
|
|
7619
7674
|
|
|
7620
7675
|
});
|
|
7621
|
-
return
|
|
7676
|
+
return _catch(function () {
|
|
7677
|
+
return _await(p);
|
|
7678
|
+
}, function (e) {
|
|
7679
|
+
alert(tt);
|
|
7680
|
+
throw e;
|
|
7681
|
+
});
|
|
7622
7682
|
} else {
|
|
7623
7683
|
var vvv = localStorage.getItem(storage);
|
|
7624
7684
|
|
|
@@ -7670,20 +7730,25 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
7670
7730
|
try {
|
|
7671
7731
|
var db, objectStore;
|
|
7672
7732
|
|
|
7673
|
-
if (
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7733
|
+
if (_$1.db) {
|
|
7734
|
+
try {
|
|
7735
|
+
db = _$1.db;
|
|
7736
|
+
objectStore = db.transaction([store], "readwrite").objectStore(store);
|
|
7737
|
+
var objectStoreRequest = objectStore.clear();
|
|
7677
7738
|
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7739
|
+
objectStoreRequest.onsuccess = function () {
|
|
7740
|
+
for (var i in data) {
|
|
7741
|
+
var request = objectStore.add(data[i]);
|
|
7681
7742
|
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7743
|
+
request.onerror = function (event) {
|
|
7744
|
+
console.log(event);
|
|
7745
|
+
};
|
|
7746
|
+
}
|
|
7747
|
+
};
|
|
7748
|
+
} catch (e) {
|
|
7749
|
+
alert(store);
|
|
7750
|
+
throw e;
|
|
7751
|
+
}
|
|
7687
7752
|
} else {
|
|
7688
7753
|
localStorage.setItem(store, JSON.stringify(data));
|
|
7689
7754
|
}
|