isobit-ui 0.0.344 → 0.0.346

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 +74 -33
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * isobit-ui v0.0.344
2
+ * isobit-ui v0.0.346
3
3
  * (c) Erik Alarcon Pinedo
4
4
  * Released under the MIT License.
5
5
  */
@@ -1377,7 +1377,7 @@ var __vue_component__$e = /*#__PURE__*/__vue_normalize____default['default']({
1377
1377
  staticRenderFns: __vue_staticRenderFns__$d
1378
1378
  }, __vue_inject_styles__$e, __vue_script__$e, __vue_scope_id__$e, __vue_is_functional_template__$e, __vue_module_identifier__$e, false, undefined, undefined, undefined);
1379
1379
 
1380
- function _await$1(value, then, direct) {
1380
+ function _await$2(value, then, direct) {
1381
1381
  if (direct) {
1382
1382
  return then ? then(value) : value;
1383
1383
  }
@@ -1922,7 +1922,7 @@ var script$d = {
1922
1922
  }; //t.onerror = event => reject(event.target.error);
1923
1923
 
1924
1924
  });
1925
- return _await$1(p); //console.log(result);
1925
+ return _await$2(p); //console.log(result);
1926
1926
  } catch (e) {
1927
1927
  return Promise.reject(e);
1928
1928
  }
@@ -1937,7 +1937,7 @@ var script$d = {
1937
1937
  var datj;
1938
1938
  return _invoke$1(function () {
1939
1939
  if (window._.db) {
1940
- return _await$1(me.getStoredList(storage), function (_me$getStoredList) {
1940
+ return _await$2(me.getStoredList(storage), function (_me$getStoredList) {
1941
1941
  datj = _me$getStoredList;
1942
1942
  });
1943
1943
  } else {
@@ -2860,12 +2860,24 @@ var __vue_component__$9 = /*#__PURE__*/__vue_normalize____default['default']({
2860
2860
  //
2861
2861
  //
2862
2862
  //
2863
+ function _await$1(value, then, direct) {
2864
+ if (direct) {
2865
+ return then ? then(value) : value;
2866
+ }
2867
+
2868
+ if (!value || !value.then) {
2869
+ value = Promise.resolve(value);
2870
+ }
2871
+
2872
+ return then ? value.then(then) : value;
2873
+ }
2874
+
2863
2875
  var script$8 = {
2864
2876
  props: {
2865
2877
  url: String,
2866
2878
  displayField: String,
2867
2879
  data: Array,
2868
- storage: null,
2880
+ store: null,
2869
2881
  valueField: String,
2870
2882
  filters: null,
2871
2883
  filter: null
@@ -2952,38 +2964,48 @@ var script$8 = {
2952
2964
  return me.filterList[p.selectedIndex - 1];
2953
2965
  },
2954
2966
  load: function load(p, nou) {
2955
- var me = this;
2956
- var pa = me.$el.parentElement; //console.log(pa.name+'.antes de preguntar disabled options.load '+JSON.stringify(p));
2967
+ try {
2968
+ var _this2 = this;
2957
2969
 
2958
- if (!pa.disabled) {
2959
- if (!me.data2) me.data2 = [];
2960
- if (me.filters) p = Vue.mergeDeep(p ? p : {}, me.filters); //console.log(pa.name+'.options.load '+JSON.stringify(p));
2970
+ var me = _this2;
2971
+ var pa = me.$el.parentElement;
2972
+ console.log(p);
2973
+ me.data2 = getStoredList(me.store); //console.log(pa.name+'.antes de preguntar disabled options.load '+JSON.stringify(p));
2961
2974
 
2962
- axios.get(me.url, {
2963
- params: p
2964
- }).then(function (r) {
2965
- var data = r.data.data ? r.data.data : r.data;
2966
- me.$emit('loaded', {
2967
- target: me,
2968
- data: data
2975
+ if (!pa.disabled) {
2976
+ if (!me.data2) me.data2 = [];
2977
+ if (me.filters) p = Vue.mergeDeep(p ? p : {}, me.filters); //console.log(pa.name+'.options.load '+JSON.stringify(p));
2978
+
2979
+ axios.get(me.url, {
2980
+ params: p
2981
+ }).then(function (r) {
2982
+ var data = r.data.data ? r.data.data : r.data;
2983
+ me.$emit('loaded', {
2984
+ target: me,
2985
+ data: data
2986
+ });
2987
+ me.data2 = data;
2988
+ if (me.store) localstore.setItem(me.store, JSON.stringify(data));
2989
+ me.$parent.$forceUpdate();
2990
+ if (nou) nou();
2991
+ })["catch"](function () {//r = r.response;
2992
+ //var e = me.$parent.$el;
2993
+ //var error = document.createElement("div");
2994
+
2995
+ /*error.innerHTML = r.config.method + ' ' + r.config.url + ' ' + r.status + ' (' + r.statusText + ')';
2996
+ error.classList.add("v-error");
2997
+ e.parentNode.insertBefore(error, e);*/
2969
2998
  });
2970
- me.data2 = data;
2971
- if (me.storage) localStorage.setItem(me.storage, JSON.stringify(data));
2972
- me.$parent.$forceUpdate();
2973
- if (nou) nou();
2974
- })["catch"](function () {//r = r.response;
2975
- //var e = me.$parent.$el;
2976
- //var error = document.createElement("div");
2977
-
2978
- /*error.innerHTML = r.config.method + ' ' + r.config.url + ' ' + r.status + ' (' + r.statusText + ')';
2979
- error.classList.add("v-error");
2980
- e.parentNode.insertBefore(error, e);*/
2981
- });
2982
- }
2983
- /*else{
2984
- console.log('no se cargara aun '+pa.name);
2985
- }*/
2999
+ }
3000
+ /*else{
3001
+ console.log('no se cargara aun '+pa.name);
3002
+ }*/
3003
+
2986
3004
 
3005
+ return _await$1();
3006
+ } catch (e) {
3007
+ return Promise.reject(e);
3008
+ }
2987
3009
  }
2988
3010
  }
2989
3011
  };
@@ -5015,6 +5037,25 @@ var f = {
5015
5037
  if (![].contains) Object.defineProperty(Array.prototype, 'contains', f);
5016
5038
  if (!"".contains) Object.defineProperty(String.prototype, 'contains', f);
5017
5039
  _$1 = Object.assign(_$1, {
5040
+ getStoredList: function getStoredList(store) {
5041
+ try {
5042
+ var p = new Promise(function (resolve) {
5043
+ var t = _$1.db.transaction(store),
5044
+ objectStore = t.objectStore(store); //,d=[];
5045
+
5046
+
5047
+ var r = objectStore.getAll();
5048
+
5049
+ r.onsuccess = function () {
5050
+ resolve(r.result);
5051
+ }; //t.onerror = event => reject(event.target.error);
5052
+
5053
+ });
5054
+ return _await(p); //console.log(result);
5055
+ } catch (e) {
5056
+ return Promise.reject(e);
5057
+ }
5058
+ },
5018
5059
  remoteServer: '',
5019
5060
  _id: 0,
5020
5061
  networkStatus: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isobit-ui",
3
- "version": "0.0.344",
3
+ "version": "0.0.346",
4
4
  "description": "Vue component to play videos",
5
5
  "keywords": [
6
6
  "ui",