isobit-ui 0.0.567 → 0.0.568

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 +249 -33
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * isobit-ui v0.0.567
2
+ * isobit-ui v0.0.568
3
3
  * (c) Erik Alarcon Pinedo
4
4
  * Released under the MIT License.
5
5
  */
@@ -3344,6 +3344,209 @@ function _await$1(value, then, direct) {
3344
3344
  return then ? value.then(then) : value;
3345
3345
  }
3346
3346
 
3347
+ function _empty() {}
3348
+
3349
+ function _awaitIgnored(value, direct) {
3350
+ if (!direct) {
3351
+ return value && value.then ? value.then(_empty) : Promise.resolve();
3352
+ }
3353
+ }
3354
+
3355
+ function _settle(pact, state, value) {
3356
+ if (!pact.s) {
3357
+ if (value instanceof _Pact) {
3358
+ if (value.s) {
3359
+ if (state & 1) {
3360
+ state = value.s;
3361
+ }
3362
+
3363
+ value = value.v;
3364
+ } else {
3365
+ value.o = _settle.bind(null, pact, state);
3366
+ return;
3367
+ }
3368
+ }
3369
+
3370
+ if (value && value.then) {
3371
+ value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
3372
+ return;
3373
+ }
3374
+
3375
+ pact.s = state;
3376
+ pact.v = value;
3377
+ var observer = pact.o;
3378
+
3379
+ if (observer) {
3380
+ observer(pact);
3381
+ }
3382
+ }
3383
+ }
3384
+
3385
+ var _Pact = /*#__PURE__*/function () {
3386
+ function _Pact() {}
3387
+
3388
+ _Pact.prototype.then = function (onFulfilled, onRejected) {
3389
+ var result = new _Pact();
3390
+ var state = this.s;
3391
+
3392
+ if (state) {
3393
+ var callback = state & 1 ? onFulfilled : onRejected;
3394
+
3395
+ if (callback) {
3396
+ try {
3397
+ _settle(result, 1, callback(this.v));
3398
+ } catch (e) {
3399
+ _settle(result, 2, e);
3400
+ }
3401
+
3402
+ return result;
3403
+ } else {
3404
+ return this;
3405
+ }
3406
+ }
3407
+
3408
+ this.o = function (_this) {
3409
+ try {
3410
+ var value = _this.v;
3411
+
3412
+ if (_this.s & 1) {
3413
+ _settle(result, 1, onFulfilled ? onFulfilled(value) : value);
3414
+ } else if (onRejected) {
3415
+ _settle(result, 1, onRejected(value));
3416
+ } else {
3417
+ _settle(result, 2, value);
3418
+ }
3419
+ } catch (e) {
3420
+ _settle(result, 2, e);
3421
+ }
3422
+ };
3423
+
3424
+ return result;
3425
+ };
3426
+
3427
+ return _Pact;
3428
+ }();
3429
+
3430
+ function _isSettledPact(thenable) {
3431
+ return thenable instanceof _Pact && thenable.s & 1;
3432
+ }
3433
+
3434
+ function _for(test, update, body) {
3435
+ var stage;
3436
+
3437
+ for (;;) {
3438
+ var shouldContinue = test();
3439
+
3440
+ if (_isSettledPact(shouldContinue)) {
3441
+ shouldContinue = shouldContinue.v;
3442
+ }
3443
+
3444
+ if (!shouldContinue) {
3445
+ return result;
3446
+ }
3447
+
3448
+ if (shouldContinue.then) {
3449
+ stage = 0;
3450
+ break;
3451
+ }
3452
+
3453
+ var result = body();
3454
+
3455
+ if (result && result.then) {
3456
+ if (_isSettledPact(result)) {
3457
+ result = result.s;
3458
+ } else {
3459
+ stage = 1;
3460
+ break;
3461
+ }
3462
+ }
3463
+
3464
+ if (update) {
3465
+ var updateValue = update();
3466
+
3467
+ if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
3468
+ stage = 2;
3469
+ break;
3470
+ }
3471
+ }
3472
+ }
3473
+
3474
+ var pact = new _Pact();
3475
+
3476
+ var reject = _settle.bind(null, pact, 2);
3477
+
3478
+ (stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
3479
+ return pact;
3480
+
3481
+ function _resumeAfterBody(value) {
3482
+ result = value;
3483
+
3484
+ do {
3485
+ if (update) {
3486
+ updateValue = update();
3487
+
3488
+ if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
3489
+ updateValue.then(_resumeAfterUpdate).then(void 0, reject);
3490
+ return;
3491
+ }
3492
+ }
3493
+
3494
+ shouldContinue = test();
3495
+
3496
+ if (!shouldContinue || _isSettledPact(shouldContinue) && !shouldContinue.v) {
3497
+ _settle(pact, 1, result);
3498
+
3499
+ return;
3500
+ }
3501
+
3502
+ if (shouldContinue.then) {
3503
+ shouldContinue.then(_resumeAfterTest).then(void 0, reject);
3504
+ return;
3505
+ }
3506
+
3507
+ result = body();
3508
+
3509
+ if (_isSettledPact(result)) {
3510
+ result = result.v;
3511
+ }
3512
+ } while (!result || !result.then);
3513
+
3514
+ result.then(_resumeAfterBody).then(void 0, reject);
3515
+ }
3516
+
3517
+ function _resumeAfterTest(shouldContinue) {
3518
+ if (shouldContinue) {
3519
+ result = body();
3520
+
3521
+ if (result && result.then) {
3522
+ result.then(_resumeAfterBody).then(void 0, reject);
3523
+ } else {
3524
+ _resumeAfterBody(result);
3525
+ }
3526
+ } else {
3527
+ _settle(pact, 1, result);
3528
+ }
3529
+ }
3530
+
3531
+ function _resumeAfterUpdate() {
3532
+ if (shouldContinue = test()) {
3533
+ if (shouldContinue.then) {
3534
+ shouldContinue.then(_resumeAfterTest).then(void 0, reject);
3535
+ } else {
3536
+ _resumeAfterTest(shouldContinue);
3537
+ }
3538
+ } else {
3539
+ _settle(pact, 1, result);
3540
+ }
3541
+ }
3542
+ }
3543
+
3544
+ function _continueIgnored(value) {
3545
+ if (value && value.then) {
3546
+ return value.then(_empty);
3547
+ }
3548
+ }
3549
+
3347
3550
  function _invoke(body, then) {
3348
3551
  var result = body();
3349
3552
 
@@ -3374,6 +3577,7 @@ var script$8 = {
3374
3577
  },
3375
3578
  data: function data() {
3376
3579
  return {
3580
+ queue: [],
3377
3581
  data2: [],
3378
3582
  valueField_: [],
3379
3583
  lastLoad: null,
@@ -3448,11 +3652,13 @@ var script$8 = {
3448
3652
  var p = me.$el.parentElement;
3449
3653
  return me.filterList[p.selectedIndex - 1];
3450
3654
  },
3451
- load: function load(p, nou) {
3655
+ load: function load(p, nou, clearQueue) {
3452
3656
  try {
3453
3657
  var _this2 = this;
3454
3658
 
3455
3659
  var me = _this2;
3660
+ if (!clearQueue) me.queue.push([p, nou]);
3661
+ if (me.queue.length > 1) return;
3456
3662
  var pa = me.$el.parentElement;
3457
3663
  me.data2 = me.data;
3458
3664
  if (!me.data2) me.data2 = [];
@@ -3482,37 +3688,47 @@ var script$8 = {
3482
3688
  });
3483
3689
  }
3484
3690
  }, function () {
3485
- if ((me.url || me.src) && !pa.disabled) {
3486
- if (!me.data2) me.data2 = [];
3487
- if (me.filters) p = Vue.mergeDeep(p ? p : {}, me.filters); //console.log(pa.name+'.options.load '+JSON.stringify(p));
3488
-
3489
- axios.get(me.url ? me.url : me.src, {
3490
- params: p
3491
- }).then(function (r) {
3492
- var data = r.data.data ? r.data.data : r.data;
3493
- me.$emit('loaded', {
3494
- target: me,
3495
- data: data
3496
- });
3497
- me.data2 = me.data2.concat(data);
3498
- me.loaded = 1;
3499
- if (me.store) localstore.setItem(me.store, JSON.stringify(data));
3500
- me.$parent.$forceUpdate();
3501
- if (nou) nou();
3502
- })["catch"](function () {//r = r.response;
3503
- //var e = me.$parent.$el;
3504
- //var error = document.createElement("div");
3505
-
3506
- /*error.innerHTML = r.config.method + ' ' + r.config.url + ' ' + r.status + ' (' + r.statusText + ')';
3507
- error.classList.add("v-error");
3508
- e.parentNode.insertBefore(error, e);*/
3509
- });
3510
- }
3511
- }); //console.log(pa.name+'.antes de preguntar disabled options.load '+JSON.stringify(p));
3512
-
3513
- /*else{
3514
- console.log('no se cargara aun '+pa.name);
3515
- }*/
3691
+ //console.log(pa.name+'.antes de preguntar disabled options.load '+JSON.stringify(p));
3692
+ return _invoke(function () {
3693
+ if ((me.url || me.src) && !pa.disabled) {
3694
+ if (!me.data2) me.data2 = [];
3695
+ if (me.filters) p = Vue.mergeDeep(p ? p : {}, me.filters); //console.log(pa.name+'.options.load '+JSON.stringify(p));
3696
+
3697
+ return _awaitIgnored(axios.get(me.url ? me.url : me.src, {
3698
+ params: p
3699
+ }).then(function (r) {
3700
+ var data = r.data.data ? r.data.data : r.data;
3701
+ me.$emit('loaded', {
3702
+ target: me,
3703
+ data: data
3704
+ });
3705
+ me.data2 = me.data2.concat(data);
3706
+ me.loaded = 1;
3707
+ if (me.store) localstore.setItem(me.store, JSON.stringify(data));
3708
+ me.$parent.$forceUpdate();
3709
+ if (nou) nou();
3710
+ })["catch"](function () {//r = r.response;
3711
+ //var e = me.$parent.$el;
3712
+ //var error = document.createElement("div");
3713
+
3714
+ /*error.innerHTML = r.config.method + ' ' + r.config.url + ' ' + r.status + ' (' + r.statusText + ')';
3715
+ error.classList.add("v-error");
3716
+ e.parentNode.insertBefore(error, e);*/
3717
+ }));
3718
+ }
3719
+ }, function () {
3720
+ /*else{
3721
+ console.log('no se cargara aun '+pa.name);
3722
+ }*/
3723
+ if (!clearQueue) me.queue.shift();
3724
+ return _continueIgnored(_for(function () {
3725
+ return !!me.queue.length;
3726
+ }, void 0, function () {
3727
+ var d = me.queue.shift();
3728
+ return _awaitIgnored(me.load(d[0], d[1], 1));
3729
+ }));
3730
+ });
3731
+ });
3516
3732
  } catch (e) {
3517
3733
  return Promise.reject(e);
3518
3734
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isobit-ui",
3
- "version": "0.0.567",
3
+ "version": "0.0.568",
4
4
  "type": "module",
5
5
  "description": "Vue component to play videos",
6
6
  "keywords": [