fantasy-ngzorro 1.3.5 → 1.3.7

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.
@@ -1350,7 +1350,7 @@ class HdFormLinesComponent {
1350
1350
  return;
1351
1351
  }
1352
1352
  // 如果是最后一个可输入元素,新增行
1353
- if (x === this.collectDomList.length - 1 && y === this.collectDomList[0].length - 1) {
1353
+ if (!(this.activeDom instanceof NzSelectComponent) && x === this.collectDomList.length - 1 && y === this.collectDomList[0].length - 1) {
1354
1354
  this.addNewLineAndFocus();
1355
1355
  }
1356
1356
  else {
@@ -1602,91 +1602,97 @@ class HdFormLinesComponent {
1602
1602
  if (this.activeDomX === null || this.activeDomY === null) {
1603
1603
  return;
1604
1604
  }
1605
- switch (event.key) {
1606
- case 'ArrowUp':
1607
- if (this.activeDom instanceof NzSelectComponent && this.activeSelectedComponentOpen) {
1608
- return;
1609
- }
1610
- if (this.activeDomX !== 0) {
1611
- console.log('执行过程8');
1612
- this.focusDom(this.activeDomX - 1, this.activeDomY);
1613
- }
1614
- break;
1615
- case 'ArrowDown':
1616
- // 判断是否在最后一行,如果在最后一行,直接+行翻页
1617
- if (this.activeDom instanceof NzSelectComponent && this.activeSelectedComponentOpen) {
1618
- return;
1619
- }
1620
- if (this.activeDomX !== this.collectDomList.length - 1) {
1621
- console.log('执行过程9');
1622
- this.focusDom(this.activeDomX + 1, this.activeDomY);
1623
- }
1624
- break;
1625
- case 'ArrowLeft':
1626
- this.jumpToPrevInput(this.activeDomX, this.activeDomY);
1627
- break;
1628
- case 'ArrowRight':
1629
- this.jumpToNextInput(this.activeDomX, this.activeDomY);
1630
- break;
1631
- case 'Enter':
1632
- console.log('this.activeDom', this.activeDom);
1633
- // if (this.activeDom instanceof NzSelectComponent) {
1634
- // this.activeSelectedComponentOpen = this.activeDom.open;
1635
- // if (this.activeSelectedComponentOpen === false) {
1636
- // console.log('执行过程10');
1637
- // this.focusDom(this.activeDomX, this.activeDomY);
1638
- // }
1639
- // } else if (this.activeDomX === this.collectDomList.length - 1) {
1640
- // console.log('执行过程qqq');
1641
- // this.addNewLineAndFocus();
1642
- // }
1643
- break;
1644
- case 'Escape':
1645
- if (this.activeDom instanceof NzSelectComponent) {
1646
- /** @type {?} */
1647
- const nowActiveDom = (/** @type {?} */ (this.activeDom));
1648
- setTimeout((/**
1649
- * @return {?}
1650
- */
1651
- () => {
1652
- this.activeSelectedComponentOpen = nowActiveDom.open;
1605
+ setTimeout((/**
1606
+ * @return {?}
1607
+ */
1608
+ () => {
1609
+ switch (event.key) {
1610
+ case 'ArrowUp':
1611
+ if (this.activeDom instanceof NzSelectComponent && this.activeSelectedComponentOpen) {
1612
+ return;
1613
+ }
1614
+ if (this.activeDomX !== 0) {
1615
+ console.log('执行过程8');
1616
+ this.focusDom(this.activeDomX - 1, this.activeDomY);
1617
+ }
1618
+ break;
1619
+ case 'ArrowDown':
1620
+ // 判断是否在最后一行,如果在最后一行,直接+行翻页
1621
+ if (this.activeDom instanceof NzSelectComponent && this.activeSelectedComponentOpen) {
1622
+ return;
1623
+ }
1624
+ if (this.activeDomX !== this.collectDomList.length - 1) {
1625
+ console.log('执行过程9');
1626
+ this.focusDom(this.activeDomX + 1, this.activeDomY);
1627
+ }
1628
+ break;
1629
+ case 'ArrowLeft':
1630
+ this.jumpToPrevInput(this.activeDomX, this.activeDomY);
1631
+ break;
1632
+ case 'ArrowRight':
1633
+ this.jumpToNextInput(this.activeDomX, this.activeDomY);
1634
+ break;
1635
+ case 'Enter':
1636
+ console.log('this.activeDom', this.activeDom);
1637
+ if (this.activeDom instanceof NzSelectComponent) {
1638
+ this.activeSelectedComponentOpen = this.activeDom.open;
1653
1639
  if (this.activeSelectedComponentOpen === false) {
1654
- if (nowActiveDom.nzSelectService.mode === 'multiple') {
1655
- setTimeout((/**
1656
- * @return {?}
1657
- */
1658
- () => {
1659
- console.log('执行过程11');
1640
+ console.log('执行过程10');
1641
+ this.focusDom(this.activeDomX, this.activeDomY);
1642
+ }
1643
+ }
1644
+ else if (this.activeDomX === this.collectDomList.length - 1) {
1645
+ console.log('执行过程qqq');
1646
+ this.addNewLineAndFocus();
1647
+ }
1648
+ break;
1649
+ case 'Escape':
1650
+ if (this.activeDom instanceof NzSelectComponent) {
1651
+ /** @type {?} */
1652
+ const nowActiveDom = (/** @type {?} */ (this.activeDom));
1653
+ setTimeout((/**
1654
+ * @return {?}
1655
+ */
1656
+ () => {
1657
+ this.activeSelectedComponentOpen = nowActiveDom.open;
1658
+ if (this.activeSelectedComponentOpen === false) {
1659
+ if (nowActiveDom.nzSelectService.mode === 'multiple') {
1660
+ setTimeout((/**
1661
+ * @return {?}
1662
+ */
1663
+ () => {
1664
+ console.log('执行过程11');
1665
+ this.focusDom(this.activeDomX, this.activeDomY);
1666
+ }), 0);
1667
+ }
1668
+ else {
1669
+ console.log('执行过程12');
1660
1670
  this.focusDom(this.activeDomX, this.activeDomY);
1661
- }), 0);
1662
- }
1663
- else {
1664
- console.log('执行过程12');
1665
- this.focusDom(this.activeDomX, this.activeDomY);
1671
+ }
1666
1672
  }
1667
- }
1668
- }), 0);
1669
- }
1670
- break;
1671
- default:
1672
- // 如果当前聚焦的是选择框,且键入0-9a-zA-Z,则弹出
1673
- if (this.activeDom instanceof NzSelectComponent && this.activeSelectedComponentOpen === false && /^[0-9a-zA-Z]$/.test(event.key)) {
1674
- /** @type {?} */
1675
- const dom = this.activeDom;
1676
- dom.nzOpen = true;
1677
- this.activeSelectedComponentOpen = true;
1678
- // // TODO:这里暂时注释,不能直接带入键入值,这样会导致输入中文的时候带入英文字符,不符合预期
1679
- // dom.nzSelectTopControlComponent.inputValue = event.key;
1680
- // // 获取 input 元素
1681
- // const inputElement = dom.nzSelectTopControlComponent.inputElement.nativeElement;
1682
- // setTimeout(() => {
1683
- // // 触发输入事件,以确保 Angular 检测到值的变化
1684
- // const eventInput = new Event('input', { bubbles: true });
1685
- // inputElement.dispatchEvent(eventInput);
1686
- // }, 0);
1687
- }
1688
- break;
1689
- }
1673
+ }), 0);
1674
+ }
1675
+ break;
1676
+ default:
1677
+ // 如果当前聚焦的是选择框,且键入0-9a-zA-Z,则弹出
1678
+ if (this.activeDom instanceof NzSelectComponent && this.activeSelectedComponentOpen === false && /^[0-9a-zA-Z]$/.test(event.key)) {
1679
+ /** @type {?} */
1680
+ const dom = this.activeDom;
1681
+ dom.nzOpen = true;
1682
+ this.activeSelectedComponentOpen = true;
1683
+ // // TODO:这里暂时注释,不能直接带入键入值,这样会导致输入中文的时候带入英文字符,不符合预期
1684
+ // dom.nzSelectTopControlComponent.inputValue = event.key;
1685
+ // // 获取 input 元素
1686
+ // const inputElement = dom.nzSelectTopControlComponent.inputElement.nativeElement;
1687
+ // setTimeout(() => {
1688
+ // // 触发输入事件,以确保 Angular 检测到值的变化
1689
+ // const eventInput = new Event('input', { bubbles: true });
1690
+ // inputElement.dispatchEvent(eventInput);
1691
+ // }, 0);
1692
+ }
1693
+ break;
1694
+ }
1695
+ }), 0);
1690
1696
  }
1691
1697
  /**
1692
1698
  * 根据在初始dom下标和数据集 获取在collectDomList中的下标