isobit-ui 0.1.18 → 0.1.22

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 +45 -26
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * isobit-ui v0.1.18
2
+ * isobit-ui v0.1.22
3
3
  * (c) Erik Alarcon Pinedo
4
4
  * Released under the MIT License.
5
5
  */
@@ -3978,7 +3978,7 @@ var script$6 = {
3978
3978
  el.children[1].style.overflowY = 'auto';
3979
3979
  el = el.children[1].children[0];
3980
3980
  el.style.height = h + 'px';
3981
- el = el.children[0];
3981
+ el = el.children[0]; //Se espera el sea una tabla
3982
3982
  } else {
3983
3983
  el = el.children[0];
3984
3984
  el.style.height = h + 'px';
@@ -6809,6 +6809,22 @@ window.ui = _$1.ui = function (cfg) {
6809
6809
  localStorage.removeItem(storage);
6810
6810
  }
6811
6811
  },
6812
+ toast: function toast(msx, callback) {
6813
+ try {
6814
+ var _this2 = this;
6815
+
6816
+ return _await(_this2.$ionic.toastController.create({
6817
+ message: msx,
6818
+ duration: 2000
6819
+ }), function (toast) {
6820
+ return _await(toast.present(), function () {
6821
+ if (callback) callback();
6822
+ });
6823
+ });
6824
+ } catch (e) {
6825
+ return Promise.reject(e);
6826
+ }
6827
+ },
6812
6828
  setStoredList: function setStoredList(store, data) {
6813
6829
  try {
6814
6830
  var db, objectStore;
@@ -6843,9 +6859,9 @@ window.ui = _$1.ui = function (cfg) {
6843
6859
  },
6844
6860
  sync: function sync() {
6845
6861
  try {
6846
- var _this2 = this;
6862
+ var _this4 = this;
6847
6863
 
6848
- var me = _this2;
6864
+ var me = _this4;
6849
6865
  var p = me.$el;
6850
6866
  var f = p.querySelector("form");
6851
6867
  var action = f.getAttribute('action'); //console.log('Action='+action);
@@ -6934,15 +6950,15 @@ window.ui = _$1.ui = function (cfg) {
6934
6950
  },
6935
6951
  save: function save() {
6936
6952
  try {
6937
- var _this4 = this;
6953
+ var _this6 = this;
6938
6954
 
6939
- var me = _this4;
6955
+ var me = _this6;
6940
6956
  me.$forceUpdate();
6941
6957
  var p = me.$el; //Se debe buscar si abajo esta el form
6942
6958
 
6943
6959
  var f = p.querySelector("form");
6944
6960
 
6945
- var va = _this4.validate(f);
6961
+ var va = _this6.validate(f);
6946
6962
 
6947
6963
  return function () {
6948
6964
  if (va) {
@@ -6959,7 +6975,7 @@ window.ui = _$1.ui = function (cfg) {
6959
6975
  }
6960
6976
  }
6961
6977
 
6962
- var o0 = _this4._data.data ? _this4._data.data : _this4._data.o;
6978
+ var o0 = _this6._data.data ? _this6._data.data : _this6._data.o;
6963
6979
  var o = JSON.parse(JSON.stringify(o0));
6964
6980
  if (me.process) o = me.process(o); //console.log('o2='+o);
6965
6981
 
@@ -7021,7 +7037,7 @@ window.ui = _$1.ui = function (cfg) {
7021
7037
  }
7022
7038
 
7023
7039
  me.$emit('stored', o, storedList);
7024
- if (me.app && me.app.toast) me.app.toast('El registro fue grabado exitosamente!');
7040
+ if (me.$ionic) me.app.toast('El registro fue grabado exitosamente!');
7025
7041
  me.close({
7026
7042
  success: true,
7027
7043
  data: o
@@ -7072,17 +7088,20 @@ window.ui = _$1.ui = function (cfg) {
7072
7088
  };
7073
7089
  }
7074
7090
 
7075
- if (me.app && me.app.toast) me.app.toast('El registro fue grabado exitosamente!', function () {
7091
+ if (me.$ionic) me.app.toast('El registro fue grabado exitosamente!', function () {
7076
7092
  me.close({
7077
7093
  success: true,
7078
7094
  data: data
7079
7095
  });
7080
- });else me.MsgBox('El registro fue grabado exitosamente!', function () {
7081
- me.close({
7082
- success: true,
7083
- data: data
7096
+ });else {
7097
+ console.log(data);
7098
+ me.MsgBox('El registro fue grabado exitosamente!', function () {
7099
+ me.close({
7100
+ success: true,
7101
+ data: data
7102
+ });
7084
7103
  });
7085
- });
7104
+ }
7086
7105
  })["catch"](function (r) {
7087
7106
  console.log(r);
7088
7107
 
@@ -7145,17 +7164,9 @@ window.ui = _$1.ui = function (cfg) {
7145
7164
  } : config;
7146
7165
  if (!cfg) cfg = {};
7147
7166
  /*
7148
- str = "Hello!\nI'm text string";
7149
- var strblob = new Blob([str], {type: 'text/plain'});
7150
-
7151
- var formdata = new FormData();
7152
- formdata.append("file", strblob, "file.txt");
7153
- formdata.append("field-1", "field-1-data");
7154
-
7155
7167
  var requestOptions = {
7156
7168
  method: 'POST',
7157
- body: formdata,
7158
- redirect: 'follow'
7169
+ body: formdata
7159
7170
  };
7160
7171
 
7161
7172
  fetch("http://{url}", requestOptions)
@@ -7164,9 +7175,17 @@ window.ui = _$1.ui = function (cfg) {
7164
7175
  .catch(error => console.log('error', error))
7165
7176
  */
7166
7177
 
7167
- axios$1.post(url, o, {
7178
+ var a = "" + o ? axios$1.post(url, o, {
7168
7179
  responseType: 'blob'
7169
- }).then(function (response) {
7180
+ }) : axios$1({
7181
+ method: "post",
7182
+ url: url,
7183
+ data: o,
7184
+ headers: {
7185
+ "Content-Type": "multipart/form-data"
7186
+ }
7187
+ });
7188
+ a.then(function (response) {
7170
7189
  //console.log(response);
7171
7190
  var url = window.URL.createObjectURL(new Blob([response.data]));
7172
7191
  var link = document.createElement('a');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isobit-ui",
3
- "version": "0.1.18",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "Vue component to play videos",
6
6
  "keywords": [