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