isobit-ui 0.0.419 → 0.0.423
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 +72 -99
- 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.423
|
|
3
3
|
* (c) Erik Alarcon Pinedo
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1423,7 +1423,7 @@ function _await$2(value, then, direct) {
|
|
|
1423
1423
|
|
|
1424
1424
|
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>\n <tr>\n <th v-if=\"selectable0\" v-bind:width=\"getCheckColumnWidth\" >\n <span class=\"v-check\" v-on:click=\"rowSelect(null,-10)\" v-bind:data-icon=\"selected.length?'check-square':'square'\">\n <i class=\"fa fa-lg\" v-bind:class=\"selected.length?'fa-check-square':'fa-square'\"></i>\n </span>\n </th>\n <th v-bind:class=\"k['h-class']\" v-for=\"k in columns\" v-bind: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\" 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";
|
|
1425
1425
|
|
|
1426
|
-
function _invoke$
|
|
1426
|
+
function _invoke$1(body, then) {
|
|
1427
1427
|
var result = body();
|
|
1428
1428
|
|
|
1429
1429
|
if (result && result.then) {
|
|
@@ -1967,7 +1967,7 @@ var script$d = {
|
|
|
1967
1967
|
return _invokeIgnored(function () {
|
|
1968
1968
|
if (storage != null) {
|
|
1969
1969
|
var datj;
|
|
1970
|
-
return _invoke$
|
|
1970
|
+
return _invoke$1(function () {
|
|
1971
1971
|
if (window._.db) {
|
|
1972
1972
|
return _await$2(me.getStoredList(storage), function (_me$getStoredList) {
|
|
1973
1973
|
datj = _me$getStoredList;
|
|
@@ -2904,7 +2904,7 @@ function _await$1(value, then, direct) {
|
|
|
2904
2904
|
return then ? value.then(then) : value;
|
|
2905
2905
|
}
|
|
2906
2906
|
|
|
2907
|
-
function _invoke
|
|
2907
|
+
function _invoke(body, then) {
|
|
2908
2908
|
var result = body();
|
|
2909
2909
|
|
|
2910
2910
|
if (result && result.then) {
|
|
@@ -3012,7 +3012,7 @@ var script$8 = {
|
|
|
3012
3012
|
|
|
3013
3013
|
var me = _this2;
|
|
3014
3014
|
var pa = me.$el.parentElement;
|
|
3015
|
-
return _invoke
|
|
3015
|
+
return _invoke(function () {
|
|
3016
3016
|
if (me.store) {
|
|
3017
3017
|
return _await$1(window._.getStoredList(me.store), function (dd) {
|
|
3018
3018
|
var _ref = p ? Object.keys(p) : [],
|
|
@@ -4778,16 +4778,6 @@ function _await(value, then, direct) {
|
|
|
4778
4778
|
return then ? value.then(then) : value;
|
|
4779
4779
|
}
|
|
4780
4780
|
|
|
4781
|
-
function _invoke(body, then) {
|
|
4782
|
-
var result = body();
|
|
4783
|
-
|
|
4784
|
-
if (result && result.then) {
|
|
4785
|
-
return result.then(then);
|
|
4786
|
-
}
|
|
4787
|
-
|
|
4788
|
-
return then(result);
|
|
4789
|
-
}
|
|
4790
|
-
|
|
4791
4781
|
window.isMobile = 1;
|
|
4792
4782
|
if (typeof Window._ == 'undefined') Window._ = {};
|
|
4793
4783
|
var _$1 = Window._;
|
|
@@ -6225,8 +6215,6 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6225
6215
|
},
|
|
6226
6216
|
save: function save() {
|
|
6227
6217
|
try {
|
|
6228
|
-
var _exit2 = false;
|
|
6229
|
-
|
|
6230
6218
|
var _this4 = this;
|
|
6231
6219
|
|
|
6232
6220
|
var me = _this4;
|
|
@@ -6257,19 +6245,16 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6257
6245
|
if (me.process) o = me.process(o); //console.log('o2='+o);
|
|
6258
6246
|
|
|
6259
6247
|
if (!(_typeof(o) === 'object' && !Array.isArray(o) && o !== null)) return;
|
|
6260
|
-
return
|
|
6248
|
+
return function () {
|
|
6261
6249
|
if (!action || !me.app.networkStatus.connected) {
|
|
6262
6250
|
var store = me.$children[0].store;
|
|
6263
6251
|
|
|
6264
6252
|
if (!store) {
|
|
6265
6253
|
me.MsgBox('Store in form is undefined!');
|
|
6266
|
-
_exit2 = true;
|
|
6267
6254
|
return;
|
|
6268
6255
|
}
|
|
6269
6256
|
|
|
6270
|
-
console.log(1111111);
|
|
6271
6257
|
return _await(me.getStoredList(store), function (storedList) {
|
|
6272
|
-
console.log(222222222);
|
|
6273
6258
|
if (!storedList) storedList = [];
|
|
6274
6259
|
|
|
6275
6260
|
if (o.id) {
|
|
@@ -6277,19 +6262,16 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6277
6262
|
if (storedList[k].tmpId == o.tmpId) {
|
|
6278
6263
|
delete o.tmpSynchronized;
|
|
6279
6264
|
storedList[k] = o;
|
|
6280
|
-
return;
|
|
6281
6265
|
}
|
|
6282
6266
|
}
|
|
6283
6267
|
}
|
|
6284
6268
|
|
|
6285
|
-
console.log(3333333);
|
|
6286
6269
|
var db = window._.db;
|
|
6287
6270
|
var objectStore = db.transaction([store], "readwrite").objectStore(store);
|
|
6288
|
-
console.log('!o.id=' + !o.id);
|
|
6289
6271
|
|
|
6290
6272
|
if (!o.id) {
|
|
6291
|
-
o.
|
|
6292
|
-
o.
|
|
6273
|
+
o.tmpId = 1 * new Date();
|
|
6274
|
+
o.id = -o.tmpId; //add new item to start to array
|
|
6293
6275
|
|
|
6294
6276
|
storedList.unshift(o);
|
|
6295
6277
|
objectStore.add(o);
|
|
@@ -6327,100 +6309,91 @@ window.ui = _$1.ui = function (cfg) {
|
|
|
6327
6309
|
me.MsgBox('Error getting temporal record ' + o.tmpId);
|
|
6328
6310
|
};
|
|
6329
6311
|
}
|
|
6330
|
-
|
|
6331
|
-
_exit2 = true;
|
|
6332
6312
|
});
|
|
6333
|
-
}
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
if (1 == 1) {
|
|
6338
|
-
console.log('XXXXX');
|
|
6339
|
-
return;
|
|
6340
|
-
}
|
|
6341
|
-
|
|
6342
|
-
axios$1.post(action, o).then(function (result) {
|
|
6343
|
-
var data = result.data;
|
|
6344
|
-
|
|
6345
|
-
if (o.tmpId) {
|
|
6346
|
-
var store = me.$children[0].store;
|
|
6313
|
+
} else {
|
|
6314
|
+
axios$1.post(action, o).then(function (result) {
|
|
6315
|
+
var data = result.data;
|
|
6347
6316
|
|
|
6348
|
-
|
|
6317
|
+
if (o.tmpId) {
|
|
6318
|
+
var store = me.$children[0].store;
|
|
6349
6319
|
|
|
6350
|
-
|
|
6351
|
-
o.tmpSynchronized = 1;
|
|
6320
|
+
var objectStore = window._.db.transaction([store], "readwrite").objectStore(store);
|
|
6352
6321
|
|
|
6353
|
-
|
|
6354
|
-
o.
|
|
6355
|
-
o0.id = o.id;
|
|
6356
|
-
}
|
|
6322
|
+
var item = objectStore.get(o.tmpId);
|
|
6323
|
+
o.tmpSynchronized = 1;
|
|
6357
6324
|
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
} else {
|
|
6362
|
-
objectStore.add(o);
|
|
6325
|
+
if (data.id) {
|
|
6326
|
+
o.id = data.id;
|
|
6327
|
+
o0.id = o.id;
|
|
6363
6328
|
}
|
|
6364
6329
|
|
|
6365
|
-
|
|
6366
|
-
|
|
6330
|
+
item.onsuccess = function () {
|
|
6331
|
+
if (item.result) {
|
|
6332
|
+
objectStore.put(o);
|
|
6333
|
+
} else {
|
|
6334
|
+
objectStore.add(o);
|
|
6335
|
+
}
|
|
6336
|
+
|
|
6337
|
+
me.$emit('sync', data, o);
|
|
6338
|
+
};
|
|
6367
6339
|
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6340
|
+
item.onerror = function () {
|
|
6341
|
+
me.MsgBox('Error getting temporal record ' + o.tmpId);
|
|
6342
|
+
};
|
|
6343
|
+
}
|
|
6372
6344
|
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6345
|
+
if (me.app && me.app.toast) me.app.toast('El registro fue grabado correectamente!', function () {
|
|
6346
|
+
me.close({
|
|
6347
|
+
success: true,
|
|
6348
|
+
data: data
|
|
6349
|
+
});
|
|
6350
|
+
});else me.MsgBox('El registro fue grabado exitosamente!', function () {
|
|
6351
|
+
me.close({
|
|
6352
|
+
success: true,
|
|
6353
|
+
data: data
|
|
6354
|
+
});
|
|
6382
6355
|
});
|
|
6383
|
-
})
|
|
6384
|
-
|
|
6385
|
-
console.log(r);
|
|
6356
|
+
})["catch"](function (r) {
|
|
6357
|
+
console.log(r);
|
|
6386
6358
|
|
|
6387
|
-
|
|
6388
|
-
|
|
6359
|
+
if (r.response) {
|
|
6360
|
+
var l, e;
|
|
6389
6361
|
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6362
|
+
if (typeof r.response.data === 'string') {
|
|
6363
|
+
me.MsgBox(r.response.data);
|
|
6364
|
+
} else {
|
|
6365
|
+
l = r.response.data.propertyViolations; //ec += l.length;
|
|
6394
6366
|
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6367
|
+
for (var i = 0; i < l.length; i++) {
|
|
6368
|
+
var t = l[i];
|
|
6369
|
+
e = f.querySelector('[name=' + t.path + ']');
|
|
6398
6370
|
|
|
6399
|
-
|
|
6400
|
-
|
|
6371
|
+
if (e) {
|
|
6372
|
+
me.showerror(e, t.message);
|
|
6373
|
+
}
|
|
6401
6374
|
}
|
|
6402
|
-
}
|
|
6403
6375
|
|
|
6404
|
-
|
|
6376
|
+
l = r.response.data.fieldViolations; //ec += l.length;
|
|
6405
6377
|
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6378
|
+
for (i = 0; i < l.length; i++) {
|
|
6379
|
+
t = l[i];
|
|
6380
|
+
e = f.querySelector('[name=' + t.path + ']');
|
|
6409
6381
|
|
|
6410
|
-
|
|
6411
|
-
|
|
6382
|
+
if (e) {
|
|
6383
|
+
me.showerror(e, t.message + ', valor=' + t.value);
|
|
6384
|
+
}
|
|
6412
6385
|
}
|
|
6413
|
-
}
|
|
6414
6386
|
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6387
|
+
me.MsgBox('Verifique el formulario, aun tiene campos obligatorios sin completar.');
|
|
6388
|
+
if (me.$el.parentNode.className == 'v-dialog') me.$el.parentNode.parentNode.scroll({
|
|
6389
|
+
top: 0,
|
|
6390
|
+
behavior: 'smooth'
|
|
6391
|
+
});
|
|
6392
|
+
}
|
|
6420
6393
|
}
|
|
6421
|
-
}
|
|
6422
|
-
}
|
|
6423
|
-
});
|
|
6394
|
+
});
|
|
6395
|
+
}
|
|
6396
|
+
}();
|
|
6424
6397
|
} else {
|
|
6425
6398
|
me.MsgBox('Verifique el formulario, aun tiene campos obligatorios sin completar.');
|
|
6426
6399
|
if (me.$el.parentNode.className == 'v-dialog') me.$el.parentNode.parentNode.scroll({
|