@danielgindi/selectbox 1.0.101 → 1.0.103

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.
package/dist/lib.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.101
2
+ * @danielgindi/selectbox 1.0.103
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  (function (global, factory) {
@@ -492,12 +492,204 @@
492
492
  function _applyDecs2203(targetClass, memberDecs, classDecs) {
493
493
  return (applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory())(targetClass, memberDecs, classDecs);
494
494
  }
495
+ function applyDecs2203RFactory() {
496
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
497
+ return function (initializer) {
498
+ !function (decoratorFinishedRef, fnName) {
499
+ if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
500
+ }(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
501
+ };
502
+ }
503
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
504
+ var kindStr;
505
+ switch (kind) {
506
+ case 1:
507
+ kindStr = "accessor";
508
+ break;
509
+ case 2:
510
+ kindStr = "method";
511
+ break;
512
+ case 3:
513
+ kindStr = "getter";
514
+ break;
515
+ case 4:
516
+ kindStr = "setter";
517
+ break;
518
+ default:
519
+ kindStr = "field";
520
+ }
521
+ var get,
522
+ set,
523
+ ctx = {
524
+ kind: kindStr,
525
+ name: isPrivate ? "#" + name : name,
526
+ static: isStatic,
527
+ private: isPrivate
528
+ },
529
+ decoratorFinishedRef = {
530
+ v: !1
531
+ };
532
+ 0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function () {
533
+ return this[name];
534
+ }, set = function (v) {
535
+ this[name] = v;
536
+ }) : 2 === kind ? get = function () {
537
+ return desc.value;
538
+ } : (1 !== kind && 3 !== kind || (get = function () {
539
+ return desc.get.call(this);
540
+ }), 1 !== kind && 4 !== kind || (set = function (v) {
541
+ desc.set.call(this, v);
542
+ })), ctx.access = get && set ? {
543
+ get: get,
544
+ set: set
545
+ } : get ? {
546
+ get: get
547
+ } : {
548
+ set: set
549
+ };
550
+ try {
551
+ return dec(value, ctx);
552
+ } finally {
553
+ decoratorFinishedRef.v = !0;
554
+ }
555
+ }
556
+ function assertCallable(fn, hint) {
557
+ if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
558
+ }
559
+ function assertValidReturnValue(kind, value) {
560
+ var type = typeof value;
561
+ if (1 === kind) {
562
+ if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
563
+ void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
564
+ } else if ("function" !== type) {
565
+ var hint;
566
+ throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
567
+ }
568
+ }
569
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
570
+ var desc,
571
+ init,
572
+ value,
573
+ newValue,
574
+ get,
575
+ set,
576
+ decs = decInfo[0];
577
+ if (isPrivate ? desc = 0 === kind || 1 === kind ? {
578
+ get: decInfo[3],
579
+ set: decInfo[4]
580
+ } : 3 === kind ? {
581
+ get: decInfo[3]
582
+ } : 4 === kind ? {
583
+ set: decInfo[3]
584
+ } : {
585
+ value: decInfo[3]
586
+ } : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
587
+ get: desc.get,
588
+ set: desc.set
589
+ } : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
590
+ get: get,
591
+ set: set
592
+ }) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
593
+ var newInit;
594
+ if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
595
+ get: get,
596
+ set: set
597
+ }) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
598
+ }
599
+ if (0 === kind || 1 === kind) {
600
+ if (void 0 === init) init = function (instance, init) {
601
+ return init;
602
+ };else if ("function" != typeof init) {
603
+ var ownInitializers = init;
604
+ init = function (instance, init) {
605
+ for (var value = init, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
606
+ return value;
607
+ };
608
+ } else {
609
+ var originalInitializer = init;
610
+ init = function (instance, init) {
611
+ return originalInitializer.call(instance, init);
612
+ };
613
+ }
614
+ ret.push(init);
615
+ }
616
+ 0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
617
+ return value.get.call(instance, args);
618
+ }), ret.push(function (instance, args) {
619
+ return value.set.call(instance, args);
620
+ })) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
621
+ return value.call(instance, args);
622
+ }) : Object.defineProperty(base, name, desc));
623
+ }
624
+ function applyMemberDecs(Class, decInfos) {
625
+ for (var protoInitializers, staticInitializers, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
626
+ var decInfo = decInfos[i];
627
+ if (Array.isArray(decInfo)) {
628
+ var base,
629
+ initializers,
630
+ kind = decInfo[1],
631
+ name = decInfo[2],
632
+ isPrivate = decInfo.length > 3,
633
+ isStatic = kind >= 5;
634
+ if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
635
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
636
+ existingKind = existingNonFields.get(name) || 0;
637
+ if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
638
+ !existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
639
+ }
640
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
641
+ }
642
+ }
643
+ return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
644
+ }
645
+ function pushInitializers(ret, initializers) {
646
+ initializers && ret.push(function (instance) {
647
+ for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
648
+ return instance;
649
+ });
650
+ }
651
+ return function (targetClass, memberDecs, classDecs) {
652
+ return {
653
+ e: applyMemberDecs(targetClass, memberDecs),
654
+ get c() {
655
+ return function (targetClass, classDecs) {
656
+ if (classDecs.length > 0) {
657
+ for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
658
+ var decoratorFinishedRef = {
659
+ v: !1
660
+ };
661
+ try {
662
+ var nextNewClass = classDecs[i](newClass, {
663
+ kind: "class",
664
+ name: name,
665
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
666
+ });
667
+ } finally {
668
+ decoratorFinishedRef.v = !0;
669
+ }
670
+ void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
671
+ }
672
+ return [newClass, function () {
673
+ for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
674
+ }];
675
+ }
676
+ }(targetClass, classDecs);
677
+ }
678
+ };
679
+ };
680
+ }
681
+ function _applyDecs2203R(targetClass, memberDecs, classDecs) {
682
+ return (_applyDecs2203R = applyDecs2203RFactory())(targetClass, memberDecs, classDecs);
683
+ }
495
684
  function createAddInitializerMethod(initializers, decoratorFinishedRef) {
496
685
  return function (initializer) {
497
686
  assertNotFinished(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
498
687
  };
499
688
  }
500
- function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
689
+ function assertInstanceIfPrivate(has, target) {
690
+ if (!has(target)) throw new TypeError("Attempted to access private element on non-instance");
691
+ }
692
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand) {
501
693
  var kindStr;
502
694
  switch (kind) {
503
695
  case 1:
@@ -526,23 +718,39 @@
526
718
  decoratorFinishedRef = {
527
719
  v: !1
528
720
  };
529
- 0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function () {
530
- return this[name];
531
- }, set = function (v) {
532
- this[name] = v;
533
- }) : 2 === kind ? get = function () {
534
- return desc.value;
535
- } : (1 !== kind && 3 !== kind || (get = function () {
536
- return desc.get.call(this);
537
- }), 1 !== kind && 4 !== kind || (set = function (v) {
538
- desc.set.call(this, v);
539
- })), ctx.access = get && set ? {
721
+ if (0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), isPrivate || 0 !== kind && 2 !== kind) {
722
+ if (2 === kind) get = function (target) {
723
+ return assertInstanceIfPrivate(hasPrivateBrand, target), desc.value;
724
+ };else {
725
+ var t = 0 === kind || 1 === kind;
726
+ (t || 3 === kind) && (get = isPrivate ? function (target) {
727
+ return assertInstanceIfPrivate(hasPrivateBrand, target), desc.get.call(target);
728
+ } : function (target) {
729
+ return desc.get.call(target);
730
+ }), (t || 4 === kind) && (set = isPrivate ? function (target, value) {
731
+ assertInstanceIfPrivate(hasPrivateBrand, target), desc.set.call(target, value);
732
+ } : function (target, value) {
733
+ desc.set.call(target, value);
734
+ });
735
+ }
736
+ } else get = function (target) {
737
+ return target[name];
738
+ }, 0 === kind && (set = function (target, v) {
739
+ target[name] = v;
740
+ });
741
+ var has = isPrivate ? hasPrivateBrand.bind() : function (target) {
742
+ return name in target;
743
+ };
744
+ ctx.access = get && set ? {
540
745
  get: get,
541
- set: set
746
+ set: set,
747
+ has: has
542
748
  } : get ? {
543
- get: get
749
+ get: get,
750
+ has: has
544
751
  } : {
545
- set: set
752
+ set: set,
753
+ has: has
546
754
  };
547
755
  try {
548
756
  return dec(value, ctx);
@@ -566,7 +774,17 @@
566
774
  throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
567
775
  }
568
776
  }
569
- function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
777
+ function curryThis1(fn) {
778
+ return function () {
779
+ return fn(this);
780
+ };
781
+ }
782
+ function curryThis2(fn) {
783
+ return function (value) {
784
+ fn(this, value);
785
+ };
786
+ }
787
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand) {
570
788
  var desc,
571
789
  init,
572
790
  value,
@@ -575,8 +793,8 @@
575
793
  set,
576
794
  decs = decInfo[0];
577
795
  if (isPrivate ? desc = 0 === kind || 1 === kind ? {
578
- get: decInfo[3],
579
- set: decInfo[4]
796
+ get: curryThis1(decInfo[3]),
797
+ set: curryThis2(decInfo[4])
580
798
  } : 3 === kind ? {
581
799
  get: decInfo[3]
582
800
  } : 4 === kind ? {
@@ -586,12 +804,12 @@
586
804
  } : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
587
805
  get: desc.get,
588
806
  set: desc.set
589
- } : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
807
+ } : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
590
808
  get: get,
591
809
  set: set
592
810
  }) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
593
811
  var newInit;
594
- if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
812
+ if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
595
813
  get: get,
596
814
  set: set
597
815
  }) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
@@ -621,8 +839,8 @@
621
839
  return value.call(instance, args);
622
840
  }) : Object.defineProperty(base, name, desc));
623
841
  }
624
- function applyMemberDecs(Class, decInfos) {
625
- for (var protoInitializers, staticInitializers, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
842
+ function applyMemberDecs(Class, decInfos, instanceBrand) {
843
+ for (var protoInitializers, staticInitializers, staticBrand, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
626
844
  var decInfo = decInfos[i];
627
845
  if (Array.isArray(decInfo)) {
628
846
  var base,
@@ -630,14 +848,17 @@
630
848
  kind = decInfo[1],
631
849
  name = decInfo[2],
632
850
  isPrivate = decInfo.length > 3,
633
- isStatic = kind >= 5;
634
- if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
851
+ isStatic = kind >= 5,
852
+ hasPrivateBrand = instanceBrand;
853
+ if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || []), isPrivate && !staticBrand && (staticBrand = function (_) {
854
+ return _checkInRHS(_) === Class;
855
+ }), hasPrivateBrand = staticBrand) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
635
856
  var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
636
857
  existingKind = existingNonFields.get(name) || 0;
637
858
  if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
638
859
  !existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
639
860
  }
640
- applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
861
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand);
641
862
  }
642
863
  }
643
864
  return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
@@ -670,9 +891,9 @@
670
891
  }];
671
892
  }
672
893
  }
673
- function _applyDecs2203R(targetClass, memberDecs, classDecs) {
894
+ function _applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) {
674
895
  return {
675
- e: applyMemberDecs(targetClass, memberDecs),
896
+ e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
676
897
  get c() {
677
898
  return applyClassDecs(targetClass, classDecs);
678
899
  }
@@ -2639,10 +2860,10 @@
2639
2860
  (shared$7.exports = function (key, value) {
2640
2861
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
2641
2862
  })('versions', []).push({
2642
- version: '3.28.0',
2863
+ version: '3.29.1',
2643
2864
  mode: IS_PURE$5 ? 'pure' : 'global',
2644
2865
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
2645
- license: 'https://github.com/zloirock/core-js/blob/v3.28.0/LICENSE',
2866
+ license: 'https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE',
2646
2867
  source: 'https://github.com/zloirock/core-js'
2647
2868
  });
2648
2869
 
@@ -7532,9 +7753,10 @@
7532
7753
  var el = p.el,scrollTop = el.scrollTop;
7533
7754
 
7534
7755
  var itemPos,previousPos = -1;
7756
+ var maxIterations = 30; // Some zoom/scroll issues can make it so that it takes almost forever
7535
7757
 
7536
7758
  // eslint-disable-next-line no-constant-condition
7537
- while (true) {
7759
+ while (maxIterations-- > 0) {
7538
7760
  itemPos = p.virtualListHelper.getItemPosition(itemIndex);
7539
7761
 
7540
7762
  if (itemPos === previousPos)
@@ -9828,7 +10050,19 @@
9828
10050
 
9829
10051
  if (window.ResizeObserver !== undefined) {
9830
10052
  p.resizeObserver = new ResizeObserver(function () {
10053
+ p.resizeObserver.unobserve(p.el); // avoid ResizeObserver infinite loop
10054
+
10055
+ if (_this[DestroyedSymbol])
10056
+ return;
10057
+
9831
10058
  _this._resizeInput();
10059
+
10060
+ // avoid ResizeObserver infinite loop - only renew the observation after the new layout has settled
10061
+ requestAnimationFrame(function () {
10062
+ if (_this[DestroyedSymbol])
10063
+ return;
10064
+ p.resizeObserver.observe(p.el);
10065
+ });
9832
10066
  });
9833
10067
  p.resizeObserver.observe(p.el);
9834
10068
  }