isobit-ui 0.2.110 → 0.2.113

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.
Files changed (2) hide show
  1. package/dist/index.js +111 -115
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * isobit-ui v0.2.109
2
+ * isobit-ui v0.2.112
3
3
  * (c) Erik Alarcon Pinedo
4
4
  * Released under the MIT License.
5
5
  */
@@ -1630,9 +1630,9 @@ var script$f = {
1630
1630
  },
1631
1631
  loadStore: function loadStore() {
1632
1632
  try {
1633
- var me, store;
1634
- me = this;
1635
- store = me.store;
1633
+ var _this = this;
1634
+ var me = _this,
1635
+ store = me.store;
1636
1636
  return _await$3(function () {
1637
1637
  if (store != null) {
1638
1638
  var datj;
@@ -1754,7 +1754,7 @@ var __vue_staticRenderFns__$e = [];
1754
1754
  /* style */
1755
1755
  var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
1756
1756
  if (!inject) return;
1757
- inject("data-v-e7c66bd2_0", {
1757
+ inject("data-v-5a2d2cd2_0", {
1758
1758
  source: ".v-dataview>.v-no-results{padding:15px;color:rgb(255 193 7);background:#ffffff45;padding-bottom:7px;padding-top:7px;border-radius:10px;border-style:solid;border-width:1px}.v-dataview>.v-more-results{cursor:pointer;padding:15px;color:#106e8a;background:#ffffff45;padding-bottom:7px;padding-top:7px;border-radius:10px;border-style:solid;border-width:1px}",
1759
1759
  map: undefined,
1760
1760
  media: undefined
@@ -2884,6 +2884,7 @@ var __vue_component__$b = /*#__PURE__*/__vue_normalize____default["default"]({
2884
2884
  //
2885
2885
  //
2886
2886
  //
2887
+ //
2887
2888
 
2888
2889
  var script$a = {
2889
2890
  props: {
@@ -2911,8 +2912,8 @@ var script$a = {
2911
2912
  me.autoload_ = !(me.autoload + "" == "false" || me.autoload * 1 == 0);
2912
2913
  },
2913
2914
  mounted: function mounted() {
2914
- this.lll();
2915
- this.uu();
2915
+ this.internalLoad();
2916
+ this.updateSelect();
2916
2917
  },
2917
2918
  watch: {
2918
2919
  //value: function(newVal/*, oldVal*/) {console.log('newv='+newVal)},
@@ -2954,10 +2955,13 @@ var script$a = {
2954
2955
  }
2955
2956
  },
2956
2957
  updated: function updated() {
2957
- this.uu();
2958
+ this.updateSelect();
2958
2959
  },
2959
2960
  methods: {
2960
- uu: function uu() {
2961
+ expand: function expand() {
2962
+ console.log('click');
2963
+ },
2964
+ updateSelect: function updateSelect() {
2961
2965
  var me = this;
2962
2966
  var v = me.$attrs.value;
2963
2967
  //console.log(typeof v);
@@ -3025,7 +3029,7 @@ var script$a = {
3025
3029
  });
3026
3030
  }
3027
3031
  },
3028
- lll: function lll() {
3032
+ internalLoad: function internalLoad() {
3029
3033
  var me = this;
3030
3034
  me.autoload_ = !(me.autoload + "" == "false" || me.autoload * 1 == 0);
3031
3035
  var v = me.$attrs.value;
@@ -3035,13 +3039,16 @@ var script$a = {
3035
3039
  if (!v || v === "") {
3036
3040
  select.selectedIndex = 0;
3037
3041
  }
3038
- var v = me.$attrs.value;
3042
+ v = me.$attrs.value;
3039
3043
  for (var k = 0; k < select.length; k++) {
3040
3044
  if (select[k].value == v) {
3041
3045
  select.selectedIndex = k;
3042
3046
  }
3043
3047
  }
3044
- if (this.autoload_) this.load();
3048
+ //console.log('me.autoload_='+me.autoload_);
3049
+ if (me.autoload_) {
3050
+ me.load();
3051
+ }
3045
3052
  me.$emit("mounted", me);
3046
3053
  me.$on("changed", function (m) {
3047
3054
  var op = m.querySelectorAll("option"),
@@ -3058,9 +3065,11 @@ var script$a = {
3058
3065
  },
3059
3066
  load: function load(a, b) {
3060
3067
  var me = this;
3061
- for (var i = 0; i < me.$children.length; i++) {
3062
- if (me.$children[i].load) me.$children[i].load(a, b);
3063
- }
3068
+ me.$children.forEach(function (child) {
3069
+ if (child.load) {
3070
+ child.load(a, b);
3071
+ }
3072
+ });
3064
3073
  if (!me.disabled && !me.readonly) {
3065
3074
  //console.log(this.$el.name+' loading with value='+me.$attrs.value);
3066
3075
 
@@ -3148,7 +3157,8 @@ var __vue_render__$a = function __vue_render__() {
3148
3157
  },
3149
3158
  attrs: {
3150
3159
  "required": _vm.required,
3151
- "disabled": _vm.disabled
3160
+ "disabled": _vm.disabled,
3161
+ "click": _vm.expand
3152
3162
  },
3153
3163
  on: {
3154
3164
  "change": function change($event) {
@@ -3632,7 +3642,7 @@ var script$7 = {
3632
3642
  data: function data() {
3633
3643
  // if (this.$parent.$el && this.$parent.$el.id)
3634
3644
  // console.log("data changed " + this.$parent.$el.id);
3635
- this.$parent.uu();
3645
+ this.$parent.updateSelect();
3636
3646
  } /*nv,ov*/
3637
3647
  },
3638
3648
  data: function data() {
@@ -3666,12 +3676,12 @@ var script$7 = {
3666
3676
  p.appendChild(me.$el.childNodes[0]);
3667
3677
  }
3668
3678
  me.$parent.$emit("changed", p);
3669
- me.$parent.uu();
3679
+ me.$parent.updateSelect();
3670
3680
  },
3671
3681
  mounted: function mounted() {
3672
3682
  var me = this;
3673
3683
  if (me.valueField) me.valueField_ = me.valueField.split(".");
3674
- if (me.$parent) me.$parent.uu();
3684
+ if (me.$parent) me.$parent.updateSelect();
3675
3685
  },
3676
3686
  methods: {
3677
3687
  getParentE: function getParentE() {
@@ -3728,8 +3738,9 @@ var script$7 = {
3728
3738
  if (!me.data2) me.data2 = [];
3729
3739
  return _await$1(_invoke$1(function () {
3730
3740
  if (me.store) {
3741
+ console.log(me);
3731
3742
  //console.log(JSON.stringify(me.data2));
3732
- return _await$1(_.getStoredList(me.store, p), function (storedList) {
3743
+ return _await$1(me.$root.$children[0].getStoredList(me.store, p), function (storedList) {
3733
3744
  // if(this.getParentE().name){
3734
3745
  // console.log(this.$el.parentElement.parentElement);
3735
3746
  // console.log(storedList);
@@ -5257,6 +5268,15 @@ var __vue_component__ = /*#__PURE__*/__vue_normalize____default["default"]({
5257
5268
  staticRenderFns: __vue_staticRenderFns__
5258
5269
  }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
5259
5270
 
5271
+ function _await(value, then, direct) {
5272
+ if (direct) {
5273
+ return then ? then(value) : value;
5274
+ }
5275
+ if (!value || !value.then) {
5276
+ value = Promise.resolve(value);
5277
+ }
5278
+ return then ? value.then(then) : value;
5279
+ }
5260
5280
  function _empty() {}
5261
5281
  function _awaitIgnored(value, direct) {
5262
5282
  if (!direct) {
@@ -5379,15 +5399,6 @@ function _forIn(target, body, check) {
5379
5399
  function _continue(value, then) {
5380
5400
  return value && value.then ? value.then(then) : then(value);
5381
5401
  }
5382
- function _await(value, then, direct) {
5383
- if (direct) {
5384
- return then ? then(value) : value;
5385
- }
5386
- if (!value || !value.then) {
5387
- value = Promise.resolve(value);
5388
- }
5389
- return then ? value.then(then) : value;
5390
- }
5391
5402
  function _invoke(body, then) {
5392
5403
  var result = body();
5393
5404
  if (result && result.then) {
@@ -5717,65 +5728,6 @@ _$1 = Object.assign(_$1, {
5717
5728
  }
5718
5729
  return db;
5719
5730
  },
5720
- getStoredList: function getStoredList(store, params) {
5721
- try {
5722
- var _exit = false;
5723
- var loadedStores;
5724
- try {
5725
- loadedStores = JSON.parse(sessionStorage.getItem('loadedStores'));
5726
- } catch (e) {}
5727
- if (loadedStores == null) loadedStores = {};
5728
- return _await(_invoke(function () {
5729
- if (!loadedStores[store] && _$1.networkStatus.connected) {
5730
- //await
5731
- //load info to store
5732
- var stores = _$1.stores;
5733
- var e = _$1.stores.filter(function (e) {
5734
- return e[0] == store;
5735
- })[0];
5736
- if (!e[2]) throw "store url is empty";
5737
- return _await(axios__default["default"].get(e[2]), function (data) {
5738
- var objectStore = _$1.db.transaction([e[0]], "readwrite").objectStore(e[0]);
5739
- data = data.data || data;
5740
- return _await(objectStore.clear(), function () {
5741
- var _exit2 = false;
5742
- return _continue(_forIn(data, function (i) {
5743
- return _catch(function () {
5744
- return _awaitIgnored(objectStore.add(data[i]));
5745
- }, function (exception) {
5746
- console.log(data[i]);
5747
- console.log(e[0]);
5748
- throw exception;
5749
- });
5750
- }, function () {
5751
- return _exit2;
5752
- }), function (_result3) {
5753
- if (_exit2) ;
5754
- loadedStores[store] = 1;
5755
- sessionStorage.setItem('loadedStores', JSON.stringify(loadedStores));
5756
- });
5757
- });
5758
- });
5759
- }
5760
- }, function (_result) {
5761
- if (_exit) return _result;
5762
- var p = new Promise(function (resolve, rejected) {
5763
- if (_$1.db) {
5764
- var t = _$1.db.transaction(store),
5765
- objectStore = t.objectStore(store); //,d=[];
5766
- var r = objectStore.getAll();
5767
- r.onsuccess = function () {
5768
- resolve(r.result);
5769
- };
5770
- } else rejected('db is null');
5771
- //t.onerror = event => reject(event.target.error);
5772
- });
5773
- return _await(p); //console.log(result);
5774
- }));
5775
- } catch (e) {
5776
- return Promise.reject(e);
5777
- }
5778
- },
5779
5731
  remoteServer: '',
5780
5732
  _id: 0,
5781
5733
  networkStatus: {
@@ -6501,6 +6453,9 @@ window.ui = _$1.ui = function (cfg) {
6501
6453
  var t = me.$children[0].$children[0];
6502
6454
  return t ? t.selected.length : 0;
6503
6455
  },
6456
+ rewrite: function rewrite(url) {
6457
+ return url;
6458
+ },
6504
6459
  create: function create() {
6505
6460
  var me = this;
6506
6461
  var action = me.$children[0].action;
@@ -6520,12 +6475,16 @@ window.ui = _$1.ui = function (cfg) {
6520
6475
  var t = [].filter.call(e.component.$parent.$children, function (e) {
6521
6476
  return e.$el.classList.contains('v-datatable');
6522
6477
  })[0];
6523
- if (t && t.src) action = t.src.replace("/api", "").replace("api/", "").replace("/0/0", "");
6478
+ if (!action) {
6479
+ action = window.location.pathname;
6480
+ }
6481
+ if (t && t.src) action = t.src;
6524
6482
  if (e.action) action = e.action;
6525
- if (!t) t = e.$vnode ? e : e.target && e.target.$vnode ? e : me.$children[0].$children[0];
6526
- if (!action && t.src) action = t.src.replace("/api", "").replace("/0/0", "");
6527
- if (!action) action = window.location.pathname;
6528
- if (action) action = action.replace("/api", "");
6483
+ if (!t) {
6484
+ t = e.$vnode ? e : e.target && e.target.$vnode ? e : me.$children[0].$children[0];
6485
+ if (t.src) action = t.src;
6486
+ }
6487
+ if (action) action = me.rewrite(action.replace("/api", "").replace("/0/0", ""));
6529
6488
  var selected = me.getSelected(t)[0];
6530
6489
  var id = selected[t.rowKey];
6531
6490
  if (selected.tmpId) id = -selected.tmpId;
@@ -6955,27 +6914,6 @@ window.ui = _$1.ui = function (cfg) {
6955
6914
  var t = me.$children[0].$children[0];
6956
6915
  t.load();
6957
6916
  },
6958
- getStoredList: function getStoredList(storage, tt) {
6959
- try {
6960
- var p = new Promise(function (resolve) {
6961
- var t = tt ? _$1.db.transaction(storage, tt) : _$1.db.transaction(storage),
6962
- objectStore = t.objectStore(storage); //,d=[];
6963
- var r = objectStore.getAll();
6964
- r.onsuccess = function () {
6965
- resolve(r.result, t);
6966
- };
6967
- //t.onerror = event => reject(event.target.error);
6968
- });
6969
- return _await(_catch(function () {
6970
- return _await(p);
6971
- }, function (e) {
6972
- alert(tt);
6973
- throw e;
6974
- }));
6975
- } catch (e) {
6976
- return Promise.reject(e);
6977
- }
6978
- },
6979
6917
  removeStored: function removeStored(storage) {
6980
6918
  if (window.idb) {
6981
6919
  var me = this,
@@ -7034,6 +6972,64 @@ window.ui = _$1.ui = function (cfg) {
7034
6972
  return Promise.reject(e);
7035
6973
  }
7036
6974
  },
6975
+ getStoredList: function getStoredList(store, params) {
6976
+ try {
6977
+ var _exit = false;
6978
+ var loadedStores;
6979
+ try {
6980
+ loadedStores = JSON.parse(sessionStorage.getItem('loadedStores'));
6981
+ } catch (e) {}
6982
+ if (loadedStores == null) loadedStores = {};
6983
+ //console.log(loadedStores);
6984
+ return _await(_invoke(function () {
6985
+ if (!loadedStores[store] && _$1.networkStatus.connected) {
6986
+ var e = _$1.stores.filter(function (e) {
6987
+ return e[0] == store;
6988
+ })[0];
6989
+ //console.log(e);
6990
+ if (!e[2]) throw "store url is empty";
6991
+ return _await(axios__default["default"].get(e[2]), function (data) {
6992
+ var objectStore = _$1.db.transaction([e[0]], "readwrite").objectStore(e[0]);
6993
+ return _await(objectStore.clear(), function () {
6994
+ var _exit2 = false;
6995
+ data = data.data || data;
6996
+ return _continue(_forIn(data, function (i) {
6997
+ return _catch(function () {
6998
+ return _awaitIgnored(objectStore.add(data[i]));
6999
+ }, function (exception) {
7000
+ //console.log(data[i]);
7001
+ //console.log(e[0]);
7002
+ throw exception;
7003
+ });
7004
+ }, function () {
7005
+ return _exit2;
7006
+ }), function (_result3) {
7007
+ if (_exit2) ;
7008
+ loadedStores[store] = 1;
7009
+ sessionStorage.setItem('loadedStores', JSON.stringify(loadedStores));
7010
+ });
7011
+ });
7012
+ });
7013
+ }
7014
+ }, function (_result) {
7015
+ if (_exit) return _result;
7016
+ var p = new Promise(function (resolve, rejected) {
7017
+ if (_$1.db) {
7018
+ var t = _$1.db.transaction(store),
7019
+ objectStore = t.objectStore(store); //,d=[];
7020
+ var r = objectStore.getAll();
7021
+ r.onsuccess = function () {
7022
+ resolve(r.result);
7023
+ };
7024
+ } else rejected('db is null');
7025
+ //t.onerror = event => reject(event.target.error);
7026
+ });
7027
+ return _await(p); //console.log(result);
7028
+ }));
7029
+ } catch (e) {
7030
+ return Promise.reject(e);
7031
+ }
7032
+ },
7037
7033
  getStoreObject: function getStoreObject(storage, id) {
7038
7034
  var db = window._.db,
7039
7035
  objectStore = db.transaction([storage], "readwrite").objectStore(storage);
@@ -7080,7 +7076,7 @@ window.ui = _$1.ui = function (cfg) {
7080
7076
  if (sel2.length > 0) {
7081
7077
  axios__default["default"].post(action + '/bulk' + (e.sufix ? e.sufix : ''), sel3).then(function (r) {
7082
7078
  var d = r.data;
7083
- console.log(d);
7079
+ //console.log(d);
7084
7080
  for (var k = 0; k < d.length; k++) {
7085
7081
  if (d[k].errors) {
7086
7082
  me.MsgBox(JSON.stringify(d[k].errors));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isobit-ui",
3
- "version": "0.2.110",
3
+ "version": "0.2.113",
4
4
  "type": "module",
5
5
  "description": "Vue component to play videos",
6
6
  "keywords": [