@king-design/vue 3.8.0-beta.0 → 3.8.0-beta.1
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/__tests__/__snapshots__/Vue Next Demos.md +74 -74
- package/components/bubble/bubble.d.ts +1 -0
- package/components/bubble/bubble.vdt.js +6 -2
- package/components/bubble/index.spec.js +58 -5
- package/components/bubble/styles.js +1 -1
- package/components/bubble/useBubbleDisplay.d.ts +1 -0
- package/components/bubble/useBubbleDisplay.js +8 -0
- package/components/bubbleList/bubbleList.vdt.js +3 -1
- package/components/bubbleList/index.spec.js +301 -237
- package/components/bubbleList/styles.js +2 -2
- package/components/bubbleList/useBubbleList.js +7 -0
- package/components/fileCard/fileCard.vdt.js +4 -4
- package/components/fileCard/index.spec.js +179 -107
- package/components/fileCard/list.d.ts +2 -1
- package/components/fileCard/list.vdt.js +7 -5
- package/components/fileCard/styles.js +10 -8
- package/components/fileCard/useFileCard.d.ts +1 -1
- package/components/fileCard/useFileCard.js +6 -35
- package/components/media/index.spec.js +774 -585
- package/components/media/media.vdt.js +17 -6
- package/components/media/mediaAssets.d.ts +2 -0
- package/components/media/mediaAssets.js +4 -0
- package/components/media/styles.js +5 -3
- package/components/media/useMedia.d.ts +6 -2
- package/components/media/useMedia.js +28 -6
- package/components/sender/index.spec.js +1039 -435
- package/components/sender/sender.d.ts +27 -4
- package/components/sender/sender.js +16 -5
- package/components/sender/sender.vdt.js +121 -49
- package/components/sender/styles.js +18 -9
- package/components/sender/useAutoResize.js +6 -6
- package/components/sender/useSenderDrag.js +12 -3
- package/components/sender/useSenderInput.d.ts +3 -0
- package/components/sender/useSenderInput.js +20 -3
- package/components/sender/useSenderPaste.js +1 -1
- package/components/sender/useSenderUpload.js +38 -29
- package/components/xmarkdown/index.spec.js +370 -239
- package/components/xmarkdown/markdown/streaming.js +41 -8
- package/components/xmarkdown/styles.js +2 -2
- package/components/xmarkdown/useXMarkdownDisplay.d.ts +1 -0
- package/components/xmarkdown/useXMarkdownDisplay.js +9 -1
- package/components/xmarkdown/xmarkdown.d.ts +1 -0
- package/components/xmarkdown/xmarkdown.vdt.js +6 -2
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.js.map +1 -1
- package/dist/i18n/en-US.min.js +1 -1
- package/dist/index.js +400 -193
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/i18n/en-US.d.ts +1 -0
- package/i18n/en-US.js +1 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -513,8 +513,8 @@ describe('BubbleList', function () {
|
|
|
513
513
|
}
|
|
514
514
|
}, _callee8);
|
|
515
515
|
})));
|
|
516
|
-
it('should scroll
|
|
517
|
-
var Demo, _mount9, instance, element, scrollBox,
|
|
516
|
+
it('should keep scroll content flush and add gap only when scrollbar appears', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
517
|
+
var Demo, _mount9, instance, element, scrollBox, scrollContent, contentStyle;
|
|
518
518
|
return _regeneratorRuntime.wrap(function _callee9$(_context30) {
|
|
519
519
|
while (1) switch (_context30.prev = _context30.next) {
|
|
520
520
|
case 0:
|
|
@@ -527,7 +527,6 @@ describe('BubbleList', function () {
|
|
|
527
527
|
args[_key9] = arguments[_key9];
|
|
528
528
|
}
|
|
529
529
|
_this9 = _Component9.call.apply(_Component9, _concatInstanceProperty(_context28 = [this]).call(_context28, args)) || this;
|
|
530
|
-
_this9.listRef = null;
|
|
531
530
|
_this9.BubbleList = BubbleList;
|
|
532
531
|
return _this9;
|
|
533
532
|
}
|
|
@@ -535,38 +534,50 @@ describe('BubbleList', function () {
|
|
|
535
534
|
var _context29;
|
|
536
535
|
return {
|
|
537
536
|
items: _mapInstanceProperty(_context29 = _Array$from({
|
|
538
|
-
length:
|
|
537
|
+
length: 6
|
|
539
538
|
})).call(_context29, function (_, index) {
|
|
540
539
|
return {
|
|
541
|
-
key: index
|
|
542
|
-
content: "row-" +
|
|
540
|
+
key: index,
|
|
541
|
+
content: "row-" + index
|
|
543
542
|
};
|
|
544
543
|
})
|
|
545
544
|
};
|
|
546
545
|
};
|
|
547
546
|
return Demo;
|
|
548
547
|
}(Component);
|
|
549
|
-
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n
|
|
548
|
+
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n style=\"height: 120px;\"\n items={this.get('items')}\n >\n <b:item args=\"scope\">\n <div class=\"scrollbar-gap-row\" style=\"height: 48px;\">{scope.item.content}</div>\n </b:item>\n </BubbleList>\n ";
|
|
550
549
|
_mount9 = mount(Demo), instance = _mount9[0], element = _mount9[1];
|
|
551
550
|
_context30.next = 5;
|
|
552
551
|
return wait(80);
|
|
553
552
|
case 5:
|
|
554
|
-
instance.listRef.scrollToKey(6, 'auto');
|
|
555
|
-
_context30.next = 8;
|
|
556
|
-
return wait(30);
|
|
557
|
-
case 8:
|
|
558
553
|
scrollBox = element.querySelector('.k-bubble-list-scroll');
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
expect(
|
|
563
|
-
|
|
554
|
+
scrollContent = element.querySelector('.k-bubble-list-scroll-content');
|
|
555
|
+
contentStyle = getComputedStyle(scrollContent);
|
|
556
|
+
expect(scrollBox.scrollHeight).to.be.greaterThan(scrollBox.clientHeight);
|
|
557
|
+
expect(scrollBox.classList.contains('k-bubble-list-scroll-has-scrollbar')).to.be.true;
|
|
558
|
+
expect(getComputedStyle(scrollBox).paddingInlineEnd).to.eql('6px');
|
|
559
|
+
expect(contentStyle.paddingInlineStart).to.eql('0px');
|
|
560
|
+
expect(contentStyle.paddingInlineEnd).to.eql('0px');
|
|
561
|
+
instance.set('items', [{
|
|
562
|
+
key: 'short',
|
|
563
|
+
content: 'short'
|
|
564
|
+
}]);
|
|
565
|
+
_context30.next = 16;
|
|
566
|
+
return wait(120);
|
|
567
|
+
case 16:
|
|
568
|
+
contentStyle = getComputedStyle(scrollContent);
|
|
569
|
+
expect(scrollBox.scrollHeight - scrollBox.clientHeight).to.be.lessThan(2);
|
|
570
|
+
expect(scrollBox.classList.contains('k-bubble-list-scroll-has-scrollbar')).to.be.false;
|
|
571
|
+
expect(getComputedStyle(scrollBox).paddingInlineEnd).to.eql('0px');
|
|
572
|
+
expect(contentStyle.paddingInlineStart).to.eql('0px');
|
|
573
|
+
expect(contentStyle.paddingInlineEnd).to.eql('0px');
|
|
574
|
+
case 22:
|
|
564
575
|
case "end":
|
|
565
576
|
return _context30.stop();
|
|
566
577
|
}
|
|
567
578
|
}, _callee9);
|
|
568
579
|
})));
|
|
569
|
-
it('should scroll
|
|
580
|
+
it('should scroll correctly when using a custom item slot', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
570
581
|
var Demo, _mount10, instance, element, scrollBox, targetRow, scrollBoxRect, targetRect;
|
|
571
582
|
return _regeneratorRuntime.wrap(function _callee10$(_context33) {
|
|
572
583
|
while (1) switch (_context33.prev = _context33.next) {
|
|
@@ -587,25 +598,11 @@ describe('BubbleList', function () {
|
|
|
587
598
|
Demo.defaults = function defaults() {
|
|
588
599
|
var _context32;
|
|
589
600
|
return {
|
|
590
|
-
roles: {
|
|
591
|
-
ai: {
|
|
592
|
-
placement: 'start',
|
|
593
|
-
avatar: true,
|
|
594
|
-
roleName: 'AI'
|
|
595
|
-
},
|
|
596
|
-
user: {
|
|
597
|
-
placement: 'end',
|
|
598
|
-
avatar: true,
|
|
599
|
-
roleName: 'Me',
|
|
600
|
-
variant: 'outlined'
|
|
601
|
-
}
|
|
602
|
-
},
|
|
603
601
|
items: _mapInstanceProperty(_context32 = _Array$from({
|
|
604
602
|
length: 12
|
|
605
603
|
})).call(_context32, function (_, index) {
|
|
606
604
|
return {
|
|
607
605
|
key: index + 1,
|
|
608
|
-
role: index % 2 ? 'user' : 'ai',
|
|
609
606
|
content: "row-" + (index + 1)
|
|
610
607
|
};
|
|
611
608
|
})
|
|
@@ -613,7 +610,7 @@ describe('BubbleList', function () {
|
|
|
613
610
|
};
|
|
614
611
|
return Demo;
|
|
615
612
|
}(Component);
|
|
616
|
-
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n ref={(i) => this.listRef = i}\n style=\"height: 180px;\"\n items={this.get('items')}\n
|
|
613
|
+
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n ref={(i) => this.listRef = i}\n style=\"height: 180px;\"\n items={this.get('items')}\n >\n <b:item args=\"scope\">\n <div class=\"custom-item-shell\" style=\"height: 48px;\">{scope.item.content}</div>\n </b:item>\n </BubbleList>\n ";
|
|
617
614
|
_mount10 = mount(Demo), instance = _mount10[0], element = _mount10[1];
|
|
618
615
|
_context33.next = 5;
|
|
619
616
|
return wait(80);
|
|
@@ -623,7 +620,7 @@ describe('BubbleList', function () {
|
|
|
623
620
|
return wait(30);
|
|
624
621
|
case 8:
|
|
625
622
|
scrollBox = element.querySelector('.k-bubble-list-scroll');
|
|
626
|
-
targetRow = element.querySelectorAll('.
|
|
623
|
+
targetRow = element.querySelectorAll('.custom-item-shell')[5];
|
|
627
624
|
scrollBoxRect = scrollBox.getBoundingClientRect();
|
|
628
625
|
targetRect = targetRow.getBoundingClientRect();
|
|
629
626
|
expect(Math.abs(targetRect.top - scrollBoxRect.top)).to.be.lessThan(4);
|
|
@@ -633,7 +630,7 @@ describe('BubbleList', function () {
|
|
|
633
630
|
}
|
|
634
631
|
}, _callee10);
|
|
635
632
|
})));
|
|
636
|
-
it('should
|
|
633
|
+
it('should scroll the target item near the top when calling scrollToKey', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
637
634
|
var Demo, _mount11, instance, element, scrollBox, targetRow, scrollBoxRect, targetRect;
|
|
638
635
|
return _regeneratorRuntime.wrap(function _callee11$(_context36) {
|
|
639
636
|
while (1) switch (_context36.prev = _context36.next) {
|
|
@@ -671,7 +668,7 @@ describe('BubbleList', function () {
|
|
|
671
668
|
length: 12
|
|
672
669
|
})).call(_context35, function (_, index) {
|
|
673
670
|
return {
|
|
674
|
-
|
|
671
|
+
key: index + 1,
|
|
675
672
|
role: index % 2 ? 'user' : 'ai',
|
|
676
673
|
content: "row-" + (index + 1)
|
|
677
674
|
};
|
|
@@ -680,12 +677,12 @@ describe('BubbleList', function () {
|
|
|
680
677
|
};
|
|
681
678
|
return Demo;
|
|
682
679
|
}(Component);
|
|
683
|
-
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n ref={(i) => this.listRef = i}\n style=\"height: 180px;\"\n items={this.get('items')}\n
|
|
680
|
+
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n ref={(i) => this.listRef = i}\n style=\"height: 180px;\"\n items={this.get('items')}\n roles={this.get('roles')}\n />\n ";
|
|
684
681
|
_mount11 = mount(Demo), instance = _mount11[0], element = _mount11[1];
|
|
685
682
|
_context36.next = 5;
|
|
686
683
|
return wait(80);
|
|
687
684
|
case 5:
|
|
688
|
-
instance.listRef.scrollToKey(
|
|
685
|
+
instance.listRef.scrollToKey(6, 'auto');
|
|
689
686
|
_context36.next = 8;
|
|
690
687
|
return wait(30);
|
|
691
688
|
case 8:
|
|
@@ -700,11 +697,10 @@ describe('BubbleList', function () {
|
|
|
700
697
|
}
|
|
701
698
|
}, _callee11);
|
|
702
699
|
})));
|
|
703
|
-
it('should
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
while (1) switch (_context41.prev = _context41.next) {
|
|
700
|
+
it('should support resolving keys from itemKey function when scrolling to a message', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
701
|
+
var Demo, _mount12, instance, element, scrollBox, targetRow, scrollBoxRect, targetRect;
|
|
702
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context39) {
|
|
703
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
708
704
|
case 0:
|
|
709
705
|
Demo = /*#__PURE__*/function (_Component12) {
|
|
710
706
|
_inheritsLoose(Demo, _Component12);
|
|
@@ -715,9 +711,77 @@ describe('BubbleList', function () {
|
|
|
715
711
|
args[_key12] = arguments[_key12];
|
|
716
712
|
}
|
|
717
713
|
_this12 = _Component12.call.apply(_Component12, _concatInstanceProperty(_context37 = [this]).call(_context37, args)) || this;
|
|
714
|
+
_this12.listRef = null;
|
|
718
715
|
_this12.BubbleList = BubbleList;
|
|
719
716
|
return _this12;
|
|
720
717
|
}
|
|
718
|
+
Demo.defaults = function defaults() {
|
|
719
|
+
var _context38;
|
|
720
|
+
return {
|
|
721
|
+
roles: {
|
|
722
|
+
ai: {
|
|
723
|
+
placement: 'start',
|
|
724
|
+
avatar: true,
|
|
725
|
+
roleName: 'AI'
|
|
726
|
+
},
|
|
727
|
+
user: {
|
|
728
|
+
placement: 'end',
|
|
729
|
+
avatar: true,
|
|
730
|
+
roleName: 'Me',
|
|
731
|
+
variant: 'outlined'
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
items: _mapInstanceProperty(_context38 = _Array$from({
|
|
735
|
+
length: 12
|
|
736
|
+
})).call(_context38, function (_, index) {
|
|
737
|
+
return {
|
|
738
|
+
id: "msg-" + (index + 1),
|
|
739
|
+
role: index % 2 ? 'user' : 'ai',
|
|
740
|
+
content: "row-" + (index + 1)
|
|
741
|
+
};
|
|
742
|
+
})
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
return Demo;
|
|
746
|
+
}(Component);
|
|
747
|
+
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n ref={(i) => this.listRef = i}\n style=\"height: 180px;\"\n items={this.get('items')}\n itemKey={(item) => item.id}\n roles={this.get('roles')}\n />\n ";
|
|
748
|
+
_mount12 = mount(Demo), instance = _mount12[0], element = _mount12[1];
|
|
749
|
+
_context39.next = 5;
|
|
750
|
+
return wait(80);
|
|
751
|
+
case 5:
|
|
752
|
+
instance.listRef.scrollToKey('msg-6', 'auto');
|
|
753
|
+
_context39.next = 8;
|
|
754
|
+
return wait(30);
|
|
755
|
+
case 8:
|
|
756
|
+
scrollBox = element.querySelector('.k-bubble-list-scroll');
|
|
757
|
+
targetRow = element.querySelectorAll('.k-bubble-list-item')[5];
|
|
758
|
+
scrollBoxRect = scrollBox.getBoundingClientRect();
|
|
759
|
+
targetRect = targetRow.getBoundingClientRect();
|
|
760
|
+
expect(Math.abs(targetRect.top - scrollBoxRect.top)).to.be.lessThan(4);
|
|
761
|
+
case 13:
|
|
762
|
+
case "end":
|
|
763
|
+
return _context39.stop();
|
|
764
|
+
}
|
|
765
|
+
}, _callee12);
|
|
766
|
+
})));
|
|
767
|
+
it('should keep per-item slot updates working when list boundaries change', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
768
|
+
var _context41, _context42, _context43;
|
|
769
|
+
var Demo, _mount13, instance, element;
|
|
770
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context44) {
|
|
771
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
772
|
+
case 0:
|
|
773
|
+
Demo = /*#__PURE__*/function (_Component13) {
|
|
774
|
+
_inheritsLoose(Demo, _Component13);
|
|
775
|
+
function Demo() {
|
|
776
|
+
var _context40;
|
|
777
|
+
var _this13;
|
|
778
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
779
|
+
args[_key13] = arguments[_key13];
|
|
780
|
+
}
|
|
781
|
+
_this13 = _Component13.call.apply(_Component13, _concatInstanceProperty(_context40 = [this]).call(_context40, args)) || this;
|
|
782
|
+
_this13.BubbleList = BubbleList;
|
|
783
|
+
return _this13;
|
|
784
|
+
}
|
|
721
785
|
Demo.defaults = function defaults() {
|
|
722
786
|
return {
|
|
723
787
|
items: [{
|
|
@@ -732,54 +796,54 @@ describe('BubbleList', function () {
|
|
|
732
796
|
return Demo;
|
|
733
797
|
}(Component);
|
|
734
798
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList items={this.get('items')}>\n <b:footer args=\"scope\">\n <span class=\"last-flag\">{scope.item.key}:{scope.isLast ? 'last' : 'normal'}</span>\n </b:footer>\n </BubbleList>\n ";
|
|
735
|
-
|
|
736
|
-
|
|
799
|
+
_mount13 = mount(Demo), instance = _mount13[0], element = _mount13[1];
|
|
800
|
+
_context44.next = 5;
|
|
737
801
|
return wait(50);
|
|
738
802
|
case 5:
|
|
739
|
-
expect(_mapInstanceProperty(
|
|
803
|
+
expect(_mapInstanceProperty(_context41 = _Array$from(element.querySelectorAll('.last-flag'))).call(_context41, function (item) {
|
|
740
804
|
return item.textContent;
|
|
741
805
|
})).to.eql(['1:normal', '2:last']);
|
|
742
|
-
instance.set('items', _concatInstanceProperty(
|
|
806
|
+
instance.set('items', _concatInstanceProperty(_context42 = []).call(_context42, instance.get('items'), [{
|
|
743
807
|
key: 3,
|
|
744
808
|
content: 'third'
|
|
745
809
|
}]));
|
|
746
|
-
|
|
810
|
+
_context44.next = 9;
|
|
747
811
|
return wait(50);
|
|
748
812
|
case 9:
|
|
749
|
-
expect(_mapInstanceProperty(
|
|
813
|
+
expect(_mapInstanceProperty(_context43 = _Array$from(element.querySelectorAll('.last-flag'))).call(_context43, function (item) {
|
|
750
814
|
return item.textContent;
|
|
751
815
|
})).to.eql(['1:normal', '2:normal', '3:last']);
|
|
752
816
|
case 10:
|
|
753
817
|
case "end":
|
|
754
|
-
return
|
|
818
|
+
return _context44.stop();
|
|
755
819
|
}
|
|
756
|
-
},
|
|
820
|
+
}, _callee13);
|
|
757
821
|
})));
|
|
758
|
-
it('should trigger loadHistory once when scrolling near the top', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
759
|
-
var Demo,
|
|
760
|
-
return _regeneratorRuntime.wrap(function
|
|
761
|
-
while (1) switch (
|
|
822
|
+
it('should trigger loadHistory once when scrolling near the top', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
823
|
+
var Demo, _mount14, instance, element, scrollBox;
|
|
824
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context47) {
|
|
825
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
762
826
|
case 0:
|
|
763
|
-
Demo = /*#__PURE__*/function (
|
|
764
|
-
_inheritsLoose(Demo,
|
|
827
|
+
Demo = /*#__PURE__*/function (_Component14) {
|
|
828
|
+
_inheritsLoose(Demo, _Component14);
|
|
765
829
|
function Demo() {
|
|
766
|
-
var
|
|
767
|
-
var
|
|
768
|
-
for (var
|
|
769
|
-
args[
|
|
830
|
+
var _context45;
|
|
831
|
+
var _this14;
|
|
832
|
+
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
|
833
|
+
args[_key14] = arguments[_key14];
|
|
770
834
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
return
|
|
835
|
+
_this14 = _Component14.call.apply(_Component14, _concatInstanceProperty(_context45 = [this]).call(_context45, args)) || this;
|
|
836
|
+
_this14.BubbleList = BubbleList;
|
|
837
|
+
return _this14;
|
|
774
838
|
}
|
|
775
839
|
Demo.defaults = function defaults() {
|
|
776
|
-
var
|
|
840
|
+
var _context46;
|
|
777
841
|
return {
|
|
778
842
|
count: 0,
|
|
779
843
|
loadingHistory: false,
|
|
780
|
-
items: _mapInstanceProperty(
|
|
844
|
+
items: _mapInstanceProperty(_context46 = _Array$from({
|
|
781
845
|
length: 10
|
|
782
|
-
})).call(
|
|
846
|
+
})).call(_context46, function (_, index) {
|
|
783
847
|
return {
|
|
784
848
|
key: index,
|
|
785
849
|
content: "history-" + index
|
|
@@ -790,40 +854,40 @@ describe('BubbleList', function () {
|
|
|
790
854
|
return Demo;
|
|
791
855
|
}(Component);
|
|
792
856
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n style=\"height: 180px;\"\n items={this.get('items')}\n hasMoreHistory={true}\n loadingHistory={this.get('loadingHistory')}\n ev-loadHistory={() => this.set({count: this.get('count') + 1, loadingHistory: true})}\n >\n <b:item args=\"scope\">\n <div style=\"height: 44px;\">{scope.item.content}</div>\n </b:item>\n </BubbleList>\n ";
|
|
793
|
-
|
|
794
|
-
|
|
857
|
+
_mount14 = mount(Demo), instance = _mount14[0], element = _mount14[1];
|
|
858
|
+
_context47.next = 5;
|
|
795
859
|
return wait(80);
|
|
796
860
|
case 5:
|
|
797
861
|
scrollBox = element.querySelector('.k-bubble-list-scroll');
|
|
798
862
|
scrollBox.scrollTop = 0;
|
|
799
863
|
dispatchEvent(scrollBox, 'scroll');
|
|
800
864
|
dispatchEvent(scrollBox, 'scroll');
|
|
801
|
-
|
|
865
|
+
_context47.next = 11;
|
|
802
866
|
return wait(40);
|
|
803
867
|
case 11:
|
|
804
868
|
expect(instance.get('count')).to.eql(1);
|
|
805
869
|
case 12:
|
|
806
870
|
case "end":
|
|
807
|
-
return
|
|
871
|
+
return _context47.stop();
|
|
808
872
|
}
|
|
809
|
-
},
|
|
873
|
+
}, _callee14);
|
|
810
874
|
})));
|
|
811
|
-
it('should show the default history loading text only while loadingHistory is true', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
812
|
-
var Demo,
|
|
813
|
-
return _regeneratorRuntime.wrap(function
|
|
814
|
-
while (1) switch (
|
|
875
|
+
it('should show the default history loading text only while loadingHistory is true', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
876
|
+
var Demo, _mount15, instance, element;
|
|
877
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context49) {
|
|
878
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
815
879
|
case 0:
|
|
816
|
-
Demo = /*#__PURE__*/function (
|
|
817
|
-
_inheritsLoose(Demo,
|
|
880
|
+
Demo = /*#__PURE__*/function (_Component15) {
|
|
881
|
+
_inheritsLoose(Demo, _Component15);
|
|
818
882
|
function Demo() {
|
|
819
|
-
var
|
|
820
|
-
var
|
|
821
|
-
for (var
|
|
822
|
-
args[
|
|
883
|
+
var _context48;
|
|
884
|
+
var _this15;
|
|
885
|
+
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
|
886
|
+
args[_key15] = arguments[_key15];
|
|
823
887
|
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
return
|
|
888
|
+
_this15 = _Component15.call.apply(_Component15, _concatInstanceProperty(_context48 = [this]).call(_context48, args)) || this;
|
|
889
|
+
_this15.BubbleList = BubbleList;
|
|
890
|
+
return _this15;
|
|
827
891
|
}
|
|
828
892
|
Demo.defaults = function defaults() {
|
|
829
893
|
return {
|
|
@@ -837,46 +901,46 @@ describe('BubbleList', function () {
|
|
|
837
901
|
return Demo;
|
|
838
902
|
}(Component);
|
|
839
903
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n style=\"height: 180px;\"\n items={this.get('items')}\n loadingHistory={this.get('loadingHistory')}\n />\n ";
|
|
840
|
-
|
|
841
|
-
|
|
904
|
+
_mount15 = mount(Demo), instance = _mount15[0], element = _mount15[1];
|
|
905
|
+
_context49.next = 5;
|
|
842
906
|
return wait(50);
|
|
843
907
|
case 5:
|
|
844
908
|
expect(element.querySelector('.k-bubble-list-history')).to.be.null;
|
|
845
909
|
instance.set('loadingHistory', true);
|
|
846
|
-
|
|
910
|
+
_context49.next = 9;
|
|
847
911
|
return wait(50);
|
|
848
912
|
case 9:
|
|
849
913
|
expect(element.querySelector('.k-bubble-list-history span').textContent).to.eql('加载历史中...');
|
|
850
914
|
instance.set('loadingHistory', false);
|
|
851
|
-
|
|
915
|
+
_context49.next = 13;
|
|
852
916
|
return wait(50);
|
|
853
917
|
case 13:
|
|
854
918
|
expect(element.querySelector('.k-bubble-list-history')).to.be.null;
|
|
855
919
|
case 14:
|
|
856
920
|
case "end":
|
|
857
|
-
return
|
|
921
|
+
return _context49.stop();
|
|
858
922
|
}
|
|
859
|
-
},
|
|
923
|
+
}, _callee15);
|
|
860
924
|
})));
|
|
861
|
-
it('should warn only once when items are missing stable keys', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
925
|
+
it('should warn only once when items are missing stable keys', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
862
926
|
var warn, spy, Demo;
|
|
863
|
-
return _regeneratorRuntime.wrap(function
|
|
864
|
-
while (1) switch (
|
|
927
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context51) {
|
|
928
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
865
929
|
case 0:
|
|
866
930
|
warn = console.warn;
|
|
867
931
|
spy = sinon.spy();
|
|
868
932
|
console.warn = spy;
|
|
869
|
-
Demo = /*#__PURE__*/function (
|
|
870
|
-
_inheritsLoose(Demo,
|
|
933
|
+
Demo = /*#__PURE__*/function (_Component16) {
|
|
934
|
+
_inheritsLoose(Demo, _Component16);
|
|
871
935
|
function Demo() {
|
|
872
|
-
var
|
|
873
|
-
var
|
|
874
|
-
for (var
|
|
875
|
-
args[
|
|
936
|
+
var _context50;
|
|
937
|
+
var _this16;
|
|
938
|
+
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
|
939
|
+
args[_key16] = arguments[_key16];
|
|
876
940
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
return
|
|
941
|
+
_this16 = _Component16.call.apply(_Component16, _concatInstanceProperty(_context50 = [this]).call(_context50, args)) || this;
|
|
942
|
+
_this16.BubbleList = BubbleList;
|
|
943
|
+
return _this16;
|
|
880
944
|
}
|
|
881
945
|
Demo.defaults = function defaults() {
|
|
882
946
|
return {
|
|
@@ -890,39 +954,39 @@ describe('BubbleList', function () {
|
|
|
890
954
|
return Demo;
|
|
891
955
|
}(Component);
|
|
892
956
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList items={this.get('items')}>\n <b:item args=\"scope\">\n <div style=\"height: 40px;\">{scope.item.content}</div>\n </b:item>\n </BubbleList>\n ";
|
|
893
|
-
|
|
957
|
+
_context51.prev = 5;
|
|
894
958
|
mount(Demo);
|
|
895
|
-
|
|
959
|
+
_context51.next = 9;
|
|
896
960
|
return wait(50);
|
|
897
961
|
case 9:
|
|
898
962
|
expect(spy.callCount).to.eql(1);
|
|
899
963
|
expect(spy.args[0][0]).to.contain('stable `key`');
|
|
900
964
|
case 11:
|
|
901
|
-
|
|
965
|
+
_context51.prev = 11;
|
|
902
966
|
console.warn = warn;
|
|
903
|
-
return
|
|
967
|
+
return _context51.finish(11);
|
|
904
968
|
case 14:
|
|
905
969
|
case "end":
|
|
906
|
-
return
|
|
970
|
+
return _context51.stop();
|
|
907
971
|
}
|
|
908
|
-
},
|
|
972
|
+
}, _callee16, null, [[5,, 11, 14]]);
|
|
909
973
|
})));
|
|
910
|
-
it('should render empty slot only when there are no items', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
911
|
-
var Demo,
|
|
912
|
-
return _regeneratorRuntime.wrap(function
|
|
913
|
-
while (1) switch (
|
|
974
|
+
it('should render empty slot only when there are no items', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
975
|
+
var Demo, _mount16, instance, element;
|
|
976
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context53) {
|
|
977
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
914
978
|
case 0:
|
|
915
|
-
Demo = /*#__PURE__*/function (
|
|
916
|
-
_inheritsLoose(Demo,
|
|
979
|
+
Demo = /*#__PURE__*/function (_Component17) {
|
|
980
|
+
_inheritsLoose(Demo, _Component17);
|
|
917
981
|
function Demo() {
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
for (var
|
|
921
|
-
args[
|
|
982
|
+
var _context52;
|
|
983
|
+
var _this17;
|
|
984
|
+
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
|
985
|
+
args[_key17] = arguments[_key17];
|
|
922
986
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
return
|
|
987
|
+
_this17 = _Component17.call.apply(_Component17, _concatInstanceProperty(_context52 = [this]).call(_context52, args)) || this;
|
|
988
|
+
_this17.BubbleList = BubbleList;
|
|
989
|
+
return _this17;
|
|
926
990
|
}
|
|
927
991
|
Demo.defaults = function defaults() {
|
|
928
992
|
return {
|
|
@@ -932,8 +996,8 @@ describe('BubbleList', function () {
|
|
|
932
996
|
return Demo;
|
|
933
997
|
}(Component);
|
|
934
998
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n items={this.get('items')}\n >\n <b:empty>\n <div class=\"custom-empty\">empty</div>\n </b:empty>\n </BubbleList>\n ";
|
|
935
|
-
|
|
936
|
-
|
|
999
|
+
_mount16 = mount(Demo), instance = _mount16[0], element = _mount16[1];
|
|
1000
|
+
_context53.next = 5;
|
|
937
1001
|
return wait(50);
|
|
938
1002
|
case 5:
|
|
939
1003
|
expect(element.querySelector('.custom-empty').textContent).to.eql('empty');
|
|
@@ -941,32 +1005,32 @@ describe('BubbleList', function () {
|
|
|
941
1005
|
key: 1,
|
|
942
1006
|
content: 'hello'
|
|
943
1007
|
}]);
|
|
944
|
-
|
|
1008
|
+
_context53.next = 9;
|
|
945
1009
|
return wait(50);
|
|
946
1010
|
case 9:
|
|
947
1011
|
expect(element.querySelector('.custom-empty')).to.be.null;
|
|
948
1012
|
case 10:
|
|
949
1013
|
case "end":
|
|
950
|
-
return
|
|
1014
|
+
return _context53.stop();
|
|
951
1015
|
}
|
|
952
|
-
},
|
|
1016
|
+
}, _callee17);
|
|
953
1017
|
})));
|
|
954
|
-
it('should keep custom historyLoading slot visible for final no-more-history text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
955
|
-
var Demo,
|
|
956
|
-
return _regeneratorRuntime.wrap(function
|
|
957
|
-
while (1) switch (
|
|
1018
|
+
it('should keep custom historyLoading slot visible for final no-more-history text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
1019
|
+
var Demo, _mount17, element;
|
|
1020
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context55) {
|
|
1021
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
958
1022
|
case 0:
|
|
959
|
-
Demo = /*#__PURE__*/function (
|
|
960
|
-
_inheritsLoose(Demo,
|
|
1023
|
+
Demo = /*#__PURE__*/function (_Component18) {
|
|
1024
|
+
_inheritsLoose(Demo, _Component18);
|
|
961
1025
|
function Demo() {
|
|
962
|
-
var
|
|
963
|
-
var
|
|
964
|
-
for (var
|
|
965
|
-
args[
|
|
1026
|
+
var _context54;
|
|
1027
|
+
var _this18;
|
|
1028
|
+
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
|
1029
|
+
args[_key18] = arguments[_key18];
|
|
966
1030
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
return
|
|
1031
|
+
_this18 = _Component18.call.apply(_Component18, _concatInstanceProperty(_context54 = [this]).call(_context54, args)) || this;
|
|
1032
|
+
_this18.BubbleList = BubbleList;
|
|
1033
|
+
return _this18;
|
|
970
1034
|
}
|
|
971
1035
|
Demo.defaults = function defaults() {
|
|
972
1036
|
return {
|
|
@@ -979,33 +1043,33 @@ describe('BubbleList', function () {
|
|
|
979
1043
|
return Demo;
|
|
980
1044
|
}(Component);
|
|
981
1045
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n style=\"height: 180px;\"\n items={this.get('items')}\n hasMoreHistory={false}\n loadingHistory={false}\n >\n <b:historyLoading args=\"scope\">\n <div class=\"history-status\">\n {scope.loadingHistory ? 'loading' : scope.hasMoreHistory ? 'more' : 'done'}\n </div>\n </b:historyLoading>\n </BubbleList>\n ";
|
|
982
|
-
|
|
983
|
-
|
|
1046
|
+
_mount17 = mount(Demo), element = _mount17[1];
|
|
1047
|
+
_context55.next = 5;
|
|
984
1048
|
return wait(50);
|
|
985
1049
|
case 5:
|
|
986
1050
|
expect(element.querySelector('.history-status').textContent).to.eql('done');
|
|
987
1051
|
case 6:
|
|
988
1052
|
case "end":
|
|
989
|
-
return
|
|
1053
|
+
return _context55.stop();
|
|
990
1054
|
}
|
|
991
|
-
},
|
|
1055
|
+
}, _callee18);
|
|
992
1056
|
})));
|
|
993
|
-
it('should not render bubble wrappers for empty scoped slots', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
994
|
-
var Demo,
|
|
995
|
-
return _regeneratorRuntime.wrap(function
|
|
996
|
-
while (1) switch (
|
|
1057
|
+
it('should not render bubble wrappers for empty scoped slots', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
|
|
1058
|
+
var Demo, _mount18, element;
|
|
1059
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context57) {
|
|
1060
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
997
1061
|
case 0:
|
|
998
|
-
Demo = /*#__PURE__*/function (
|
|
999
|
-
_inheritsLoose(Demo,
|
|
1062
|
+
Demo = /*#__PURE__*/function (_Component19) {
|
|
1063
|
+
_inheritsLoose(Demo, _Component19);
|
|
1000
1064
|
function Demo() {
|
|
1001
|
-
var
|
|
1002
|
-
var
|
|
1003
|
-
for (var
|
|
1004
|
-
args[
|
|
1065
|
+
var _context56;
|
|
1066
|
+
var _this19;
|
|
1067
|
+
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
|
1068
|
+
args[_key19] = arguments[_key19];
|
|
1005
1069
|
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
return
|
|
1070
|
+
_this19 = _Component19.call.apply(_Component19, _concatInstanceProperty(_context56 = [this]).call(_context56, args)) || this;
|
|
1071
|
+
_this19.BubbleList = BubbleList;
|
|
1072
|
+
return _this19;
|
|
1009
1073
|
}
|
|
1010
1074
|
Demo.defaults = function defaults() {
|
|
1011
1075
|
return {
|
|
@@ -1030,34 +1094,34 @@ describe('BubbleList', function () {
|
|
|
1030
1094
|
return Demo;
|
|
1031
1095
|
}(Component);
|
|
1032
1096
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n items={this.get('items')}\n roles={this.get('roles')}\n >\n <b:extra args=\"scope\">\n <span v-if={scope.item.completed} class=\"scoped-extra\">\u5DF2\u5B8C\u6210</span>\n </b:extra>\n </BubbleList>\n ";
|
|
1033
|
-
|
|
1034
|
-
|
|
1097
|
+
_mount18 = mount(Demo), element = _mount18[1];
|
|
1098
|
+
_context57.next = 5;
|
|
1035
1099
|
return wait(50);
|
|
1036
1100
|
case 5:
|
|
1037
1101
|
expect(element.querySelectorAll('.k-bubble-extra').length).to.eql(1);
|
|
1038
1102
|
expect(element.querySelector('.scoped-extra').textContent).to.eql('已完成');
|
|
1039
1103
|
case 7:
|
|
1040
1104
|
case "end":
|
|
1041
|
-
return
|
|
1105
|
+
return _context57.stop();
|
|
1042
1106
|
}
|
|
1043
|
-
},
|
|
1107
|
+
}, _callee19);
|
|
1044
1108
|
})));
|
|
1045
|
-
it('should not render wrappers for empty outer slots', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1046
|
-
var Demo,
|
|
1047
|
-
return _regeneratorRuntime.wrap(function
|
|
1048
|
-
while (1) switch (
|
|
1109
|
+
it('should not render wrappers for empty outer slots', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
1110
|
+
var Demo, _mount19, element;
|
|
1111
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context59) {
|
|
1112
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
1049
1113
|
case 0:
|
|
1050
|
-
Demo = /*#__PURE__*/function (
|
|
1051
|
-
_inheritsLoose(Demo,
|
|
1114
|
+
Demo = /*#__PURE__*/function (_Component20) {
|
|
1115
|
+
_inheritsLoose(Demo, _Component20);
|
|
1052
1116
|
function Demo() {
|
|
1053
|
-
var
|
|
1054
|
-
var
|
|
1055
|
-
for (var
|
|
1056
|
-
args[
|
|
1117
|
+
var _context58;
|
|
1118
|
+
var _this20;
|
|
1119
|
+
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
|
1120
|
+
args[_key20] = arguments[_key20];
|
|
1057
1121
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
return
|
|
1122
|
+
_this20 = _Component20.call.apply(_Component20, _concatInstanceProperty(_context58 = [this]).call(_context58, args)) || this;
|
|
1123
|
+
_this20.BubbleList = BubbleList;
|
|
1124
|
+
return _this20;
|
|
1061
1125
|
}
|
|
1062
1126
|
Demo.defaults = function defaults() {
|
|
1063
1127
|
return {
|
|
@@ -1070,8 +1134,8 @@ describe('BubbleList', function () {
|
|
|
1070
1134
|
return Demo;
|
|
1071
1135
|
}(Component);
|
|
1072
1136
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n items={this.get('items')}\n loadingHistory={true}\n >\n <b:header>\n <span v-if={false} class=\"empty-header\">header</span>\n </b:header>\n <b:historyLoading>\n <span v-if={false} class=\"empty-history\">history</span>\n </b:historyLoading>\n <b:listFooter>\n <span v-if={false} class=\"empty-footer\">footer</span>\n </b:listFooter>\n </BubbleList>\n ";
|
|
1073
|
-
|
|
1074
|
-
|
|
1137
|
+
_mount19 = mount(Demo), element = _mount19[1];
|
|
1138
|
+
_context59.next = 5;
|
|
1075
1139
|
return wait(50);
|
|
1076
1140
|
case 5:
|
|
1077
1141
|
expect(element.querySelector('.k-bubble-list-header')).to.eql(null);
|
|
@@ -1080,70 +1144,70 @@ describe('BubbleList', function () {
|
|
|
1080
1144
|
expect(element.querySelector('.k-bubble')).not.to.eql(null);
|
|
1081
1145
|
case 9:
|
|
1082
1146
|
case "end":
|
|
1083
|
-
return
|
|
1147
|
+
return _context59.stop();
|
|
1084
1148
|
}
|
|
1085
|
-
},
|
|
1149
|
+
}, _callee20);
|
|
1086
1150
|
})));
|
|
1087
|
-
it('should not render empty wrapper when empty slot is empty', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1088
|
-
var Demo,
|
|
1089
|
-
return _regeneratorRuntime.wrap(function
|
|
1090
|
-
while (1) switch (
|
|
1151
|
+
it('should not render empty wrapper when empty slot is empty', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
1152
|
+
var Demo, _mount20, element;
|
|
1153
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context61) {
|
|
1154
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
1091
1155
|
case 0:
|
|
1092
|
-
Demo = /*#__PURE__*/function (
|
|
1093
|
-
_inheritsLoose(Demo,
|
|
1156
|
+
Demo = /*#__PURE__*/function (_Component21) {
|
|
1157
|
+
_inheritsLoose(Demo, _Component21);
|
|
1094
1158
|
function Demo() {
|
|
1095
|
-
var
|
|
1096
|
-
var
|
|
1097
|
-
for (var
|
|
1098
|
-
args[
|
|
1159
|
+
var _context60;
|
|
1160
|
+
var _this21;
|
|
1161
|
+
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
|
1162
|
+
args[_key21] = arguments[_key21];
|
|
1099
1163
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
return
|
|
1164
|
+
_this21 = _Component21.call.apply(_Component21, _concatInstanceProperty(_context60 = [this]).call(_context60, args)) || this;
|
|
1165
|
+
_this21.BubbleList = BubbleList;
|
|
1166
|
+
return _this21;
|
|
1103
1167
|
}
|
|
1104
1168
|
return Demo;
|
|
1105
1169
|
}(Component);
|
|
1106
1170
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList items={[]}>\n <b:empty>\n <span v-if={false} class=\"empty-content\">empty</span>\n </b:empty>\n </BubbleList>\n ";
|
|
1107
|
-
|
|
1108
|
-
|
|
1171
|
+
_mount20 = mount(Demo), element = _mount20[1];
|
|
1172
|
+
_context61.next = 5;
|
|
1109
1173
|
return wait(50);
|
|
1110
1174
|
case 5:
|
|
1111
1175
|
expect(element.querySelector('.k-bubble-list-empty')).to.eql(null);
|
|
1112
1176
|
expect(element.querySelector('.k-bubble-list-items')).not.to.eql(null);
|
|
1113
1177
|
case 7:
|
|
1114
1178
|
case "end":
|
|
1115
|
-
return
|
|
1179
|
+
return _context61.stop();
|
|
1116
1180
|
}
|
|
1117
|
-
},
|
|
1181
|
+
}, _callee21);
|
|
1118
1182
|
})));
|
|
1119
|
-
it('should emit scroll state events and honor showScrollToBottom=false', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1120
|
-
var
|
|
1121
|
-
var Demo,
|
|
1122
|
-
return _regeneratorRuntime.wrap(function
|
|
1123
|
-
while (1) switch (
|
|
1183
|
+
it('should emit scroll state events and honor showScrollToBottom=false', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
1184
|
+
var _context64, _context65;
|
|
1185
|
+
var Demo, _mount21, instance, element, scrollBox;
|
|
1186
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context66) {
|
|
1187
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
1124
1188
|
case 0:
|
|
1125
|
-
Demo = /*#__PURE__*/function (
|
|
1126
|
-
_inheritsLoose(Demo,
|
|
1189
|
+
Demo = /*#__PURE__*/function (_Component22) {
|
|
1190
|
+
_inheritsLoose(Demo, _Component22);
|
|
1127
1191
|
function Demo() {
|
|
1128
|
-
var
|
|
1129
|
-
var
|
|
1130
|
-
for (var
|
|
1131
|
-
args[
|
|
1192
|
+
var _context62;
|
|
1193
|
+
var _this22;
|
|
1194
|
+
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
|
1195
|
+
args[_key22] = arguments[_key22];
|
|
1132
1196
|
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
return
|
|
1197
|
+
_this22 = _Component22.call.apply(_Component22, _concatInstanceProperty(_context62 = [this]).call(_context62, args)) || this;
|
|
1198
|
+
_this22.listRef = null;
|
|
1199
|
+
_this22.BubbleList = BubbleList;
|
|
1200
|
+
return _this22;
|
|
1137
1201
|
}
|
|
1138
1202
|
Demo.defaults = function defaults() {
|
|
1139
|
-
var
|
|
1203
|
+
var _context63;
|
|
1140
1204
|
return {
|
|
1141
1205
|
scrollCount: 0,
|
|
1142
1206
|
bottomStates: [],
|
|
1143
1207
|
autoStates: [],
|
|
1144
|
-
items: _mapInstanceProperty(
|
|
1208
|
+
items: _mapInstanceProperty(_context63 = _Array$from({
|
|
1145
1209
|
length: 12
|
|
1146
|
-
})).call(
|
|
1210
|
+
})).call(_context63, function (_, index) {
|
|
1147
1211
|
return {
|
|
1148
1212
|
key: index,
|
|
1149
1213
|
content: "row-" + index
|
|
@@ -1154,8 +1218,8 @@ describe('BubbleList', function () {
|
|
|
1154
1218
|
return Demo;
|
|
1155
1219
|
}(Component);
|
|
1156
1220
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n ref={(i) => this.listRef = i}\n style=\"height: 180px;\"\n items={this.get('items')}\n showScrollToBottom={false}\n ev-scroll={() => this.set('scrollCount', this.get('scrollCount') + 1)}\n ev-scrollBottomChange={(value) => this.set('bottomStates', [...this.get('bottomStates'), value])}\n ev-autoScrollChange={(value) => this.set('autoStates', [...this.get('autoStates'), value])}\n >\n <b:item args=\"scope\">\n <div style=\"height: 44px;\">{scope.item.content}</div>\n </b:item>\n </BubbleList>\n ";
|
|
1157
|
-
|
|
1158
|
-
|
|
1221
|
+
_mount21 = mount(Demo), instance = _mount21[0], element = _mount21[1];
|
|
1222
|
+
_context66.next = 5;
|
|
1159
1223
|
return wait(80);
|
|
1160
1224
|
case 5:
|
|
1161
1225
|
instance.set({
|
|
@@ -1167,7 +1231,7 @@ describe('BubbleList', function () {
|
|
|
1167
1231
|
scrollBox.scrollTop = 40;
|
|
1168
1232
|
dispatchEvent(scrollBox, 'scroll');
|
|
1169
1233
|
dispatchEvent(scrollBox, 'scroll');
|
|
1170
|
-
|
|
1234
|
+
_context66.next = 12;
|
|
1171
1235
|
return wait(40);
|
|
1172
1236
|
case 12:
|
|
1173
1237
|
_atInstanceProperty(expect(instance.get('scrollCount')).to.be).least(2);
|
|
@@ -1175,37 +1239,37 @@ describe('BubbleList', function () {
|
|
|
1175
1239
|
expect(instance.get('autoStates')).to.eql([false]);
|
|
1176
1240
|
expect(element.querySelector('.k-bubble-list-scroll-to-bottom')).to.be.null;
|
|
1177
1241
|
instance.listRef.scrollToBottom('auto');
|
|
1178
|
-
|
|
1242
|
+
_context66.next = 19;
|
|
1179
1243
|
return wait(50);
|
|
1180
1244
|
case 19:
|
|
1181
|
-
expect(_sliceInstanceProperty(
|
|
1182
|
-
expect(_sliceInstanceProperty(
|
|
1245
|
+
expect(_sliceInstanceProperty(_context64 = instance.get('bottomStates')).call(_context64, -1)[0]).to.eql(true);
|
|
1246
|
+
expect(_sliceInstanceProperty(_context65 = instance.get('autoStates')).call(_context65, -1)[0]).to.eql(true);
|
|
1183
1247
|
expect(instance.listRef.isAtBottom()).to.be.true;
|
|
1184
1248
|
expect(element.querySelector('.k-bubble-list-scroll-to-bottom')).to.be.null;
|
|
1185
1249
|
case 23:
|
|
1186
1250
|
case "end":
|
|
1187
|
-
return
|
|
1251
|
+
return _context66.stop();
|
|
1188
1252
|
}
|
|
1189
|
-
},
|
|
1253
|
+
}, _callee22);
|
|
1190
1254
|
})));
|
|
1191
|
-
it('should forward typing events to role handlers and component events', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1192
|
-
var roleTypingPayload, roleTypingCompletePayload, Demo,
|
|
1193
|
-
return _regeneratorRuntime.wrap(function
|
|
1194
|
-
while (1) switch (
|
|
1255
|
+
it('should forward typing events to role handlers and component events', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1256
|
+
var roleTypingPayload, roleTypingCompletePayload, Demo, _mount22, instance;
|
|
1257
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context68) {
|
|
1258
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
1195
1259
|
case 0:
|
|
1196
1260
|
roleTypingPayload = null;
|
|
1197
1261
|
roleTypingCompletePayload = null;
|
|
1198
|
-
Demo = /*#__PURE__*/function (
|
|
1199
|
-
_inheritsLoose(Demo,
|
|
1262
|
+
Demo = /*#__PURE__*/function (_Component23) {
|
|
1263
|
+
_inheritsLoose(Demo, _Component23);
|
|
1200
1264
|
function Demo() {
|
|
1201
|
-
var
|
|
1202
|
-
var
|
|
1203
|
-
for (var
|
|
1204
|
-
args[
|
|
1265
|
+
var _context67;
|
|
1266
|
+
var _this23;
|
|
1267
|
+
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
|
1268
|
+
args[_key23] = arguments[_key23];
|
|
1205
1269
|
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
return
|
|
1270
|
+
_this23 = _Component23.call.apply(_Component23, _concatInstanceProperty(_context67 = [this]).call(_context67, args)) || this;
|
|
1271
|
+
_this23.BubbleList = BubbleList;
|
|
1272
|
+
return _this23;
|
|
1209
1273
|
}
|
|
1210
1274
|
Demo.defaults = function defaults() {
|
|
1211
1275
|
return {
|
|
@@ -1246,8 +1310,8 @@ describe('BubbleList', function () {
|
|
|
1246
1310
|
return Demo;
|
|
1247
1311
|
}(Component);
|
|
1248
1312
|
Demo.template = "\n const { BubbleList } = this;\n <BubbleList\n items={this.get('items')}\n roles={this.get('roles')}\n ev-typing={() => this.set('typingCount', this.get('typingCount') + 1)}\n ev-typingComplete={(item, content) => this.set({\n completeCount: this.get('completeCount') + 1,\n completedContent: item.key + ':' + content,\n })}\n />\n ";
|
|
1249
|
-
|
|
1250
|
-
|
|
1313
|
+
_mount22 = mount(Demo), instance = _mount22[0];
|
|
1314
|
+
_context68.next = 7;
|
|
1251
1315
|
return wait(120);
|
|
1252
1316
|
case 7:
|
|
1253
1317
|
expect(instance.get('typingCount')).to.be.greaterThan(0);
|
|
@@ -1261,8 +1325,8 @@ describe('BubbleList', function () {
|
|
|
1261
1325
|
expect(roleTypingCompletePayload.index).to.eql(0);
|
|
1262
1326
|
case 16:
|
|
1263
1327
|
case "end":
|
|
1264
|
-
return
|
|
1328
|
+
return _context68.stop();
|
|
1265
1329
|
}
|
|
1266
|
-
},
|
|
1330
|
+
}, _callee23);
|
|
1267
1331
|
})));
|
|
1268
1332
|
});
|