isobit-ui 0.0.344 → 0.0.348

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 +76 -34
  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.348
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,15 +2860,28 @@ 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
- filter: null
2883
+ filter: null,
2884
+ mode: null
2872
2885
  },
2873
2886
  watch: {
2874
2887
  data: function data(v, ov) {
@@ -2952,38 +2965,48 @@ var script$8 = {
2952
2965
  return me.filterList[p.selectedIndex - 1];
2953
2966
  },
2954
2967
  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));
2968
+ try {
2969
+ var _this2 = this;
2957
2970
 
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));
2971
+ var me = _this2;
2972
+ var pa = me.$el.parentElement;
2973
+ console.log(p);
2974
+ me.data2 = window._.getStoredList(me.store); //console.log(pa.name+'.antes de preguntar disabled options.load '+JSON.stringify(p));
2961
2975
 
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
2976
+ if (me.url && !pa.disabled) {
2977
+ if (!me.data2) me.data2 = [];
2978
+ if (me.filters) p = Vue.mergeDeep(p ? p : {}, me.filters); //console.log(pa.name+'.options.load '+JSON.stringify(p));
2979
+
2980
+ axios.get(me.url, {
2981
+ params: p
2982
+ }).then(function (r) {
2983
+ var data = r.data.data ? r.data.data : r.data;
2984
+ me.$emit('loaded', {
2985
+ target: me,
2986
+ data: data
2987
+ });
2988
+ me.data2 = data;
2989
+ if (me.store) localstore.setItem(me.store, JSON.stringify(data));
2990
+ me.$parent.$forceUpdate();
2991
+ if (nou) nou();
2992
+ })["catch"](function () {//r = r.response;
2993
+ //var e = me.$parent.$el;
2994
+ //var error = document.createElement("div");
2995
+
2996
+ /*error.innerHTML = r.config.method + ' ' + r.config.url + ' ' + r.status + ' (' + r.statusText + ')';
2997
+ error.classList.add("v-error");
2998
+ e.parentNode.insertBefore(error, e);*/
2969
2999
  });
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
- }*/
3000
+ }
3001
+ /*else{
3002
+ console.log('no se cargara aun '+pa.name);
3003
+ }*/
3004
+
2986
3005
 
3006
+ return _await$1();
3007
+ } catch (e) {
3008
+ return Promise.reject(e);
3009
+ }
2987
3010
  }
2988
3011
  }
2989
3012
  };
@@ -5015,6 +5038,25 @@ var f = {
5015
5038
  if (![].contains) Object.defineProperty(Array.prototype, 'contains', f);
5016
5039
  if (!"".contains) Object.defineProperty(String.prototype, 'contains', f);
5017
5040
  _$1 = Object.assign(_$1, {
5041
+ getStoredList: function getStoredList(store) {
5042
+ try {
5043
+ var p = new Promise(function (resolve) {
5044
+ var t = _$1.db.transaction(store),
5045
+ objectStore = t.objectStore(store); //,d=[];
5046
+
5047
+
5048
+ var r = objectStore.getAll();
5049
+
5050
+ r.onsuccess = function () {
5051
+ resolve(r.result);
5052
+ }; //t.onerror = event => reject(event.target.error);
5053
+
5054
+ });
5055
+ return _await(p); //console.log(result);
5056
+ } catch (e) {
5057
+ return Promise.reject(e);
5058
+ }
5059
+ },
5018
5060
  remoteServer: '',
5019
5061
  _id: 0,
5020
5062
  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.348",
4
4
  "description": "Vue component to play videos",
5
5
  "keywords": [
6
6
  "ui",