fantasy-ngzorro 1.3.7 → 1.3.8

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.
@@ -2076,97 +2076,92 @@
2076
2076
  if (this.activeDomX === null || this.activeDomY === null) {
2077
2077
  return;
2078
2078
  }
2079
- setTimeout((/**
2080
- * @return {?}
2081
- */
2082
- function () {
2083
- switch (event.key) {
2084
- case 'ArrowUp':
2085
- if (_this.activeDom instanceof ngZorroAntd.NzSelectComponent && _this.activeSelectedComponentOpen) {
2086
- return;
2087
- }
2088
- if (_this.activeDomX !== 0) {
2089
- console.log('执行过程8');
2090
- _this.focusDom(_this.activeDomX - 1, _this.activeDomY);
2091
- }
2092
- break;
2093
- case 'ArrowDown':
2094
- // 判断是否在最后一行,如果在最后一行,直接+行翻页
2095
- if (_this.activeDom instanceof ngZorroAntd.NzSelectComponent && _this.activeSelectedComponentOpen) {
2096
- return;
2097
- }
2098
- if (_this.activeDomX !== _this.collectDomList.length - 1) {
2099
- console.log('执行过程9');
2100
- _this.focusDom(_this.activeDomX + 1, _this.activeDomY);
2079
+ switch (event.key) {
2080
+ case 'ArrowUp':
2081
+ if (this.activeDom instanceof ngZorroAntd.NzSelectComponent && this.activeSelectedComponentOpen) {
2082
+ return;
2083
+ }
2084
+ if (this.activeDomX !== 0) {
2085
+ console.log('执行过程8');
2086
+ this.focusDom(this.activeDomX - 1, this.activeDomY);
2087
+ }
2088
+ break;
2089
+ case 'ArrowDown':
2090
+ // 判断是否在最后一行,如果在最后一行,直接+行翻页
2091
+ if (this.activeDom instanceof ngZorroAntd.NzSelectComponent && this.activeSelectedComponentOpen) {
2092
+ return;
2093
+ }
2094
+ if (this.activeDomX !== this.collectDomList.length - 1) {
2095
+ console.log('执行过程9');
2096
+ this.focusDom(this.activeDomX + 1, this.activeDomY);
2097
+ }
2098
+ break;
2099
+ case 'ArrowLeft':
2100
+ this.jumpToPrevInput(this.activeDomX, this.activeDomY);
2101
+ break;
2102
+ case 'ArrowRight':
2103
+ this.jumpToNextInput(this.activeDomX, this.activeDomY);
2104
+ break;
2105
+ case 'Enter':
2106
+ console.log('this.activeDom', this.activeDom);
2107
+ if (this.activeDom instanceof ngZorroAntd.NzSelectComponent) {
2108
+ this.activeSelectedComponentOpen = this.activeDom.open;
2109
+ if (this.activeSelectedComponentOpen === false) {
2110
+ console.log('执行过程10');
2111
+ this.focusDom(this.activeDomX, this.activeDomY);
2101
2112
  }
2102
- break;
2103
- case 'ArrowLeft':
2104
- _this.jumpToPrevInput(_this.activeDomX, _this.activeDomY);
2105
- break;
2106
- case 'ArrowRight':
2107
- _this.jumpToNextInput(_this.activeDomX, _this.activeDomY);
2108
- break;
2109
- case 'Enter':
2110
- console.log('this.activeDom', _this.activeDom);
2111
- if (_this.activeDom instanceof ngZorroAntd.NzSelectComponent) {
2112
- _this.activeSelectedComponentOpen = _this.activeDom.open;
2113
+ }
2114
+ else if (this.activeDomX === this.collectDomList.length - 1) {
2115
+ console.log('执行过程qqq');
2116
+ this.addNewLineAndFocus();
2117
+ }
2118
+ break;
2119
+ case 'Escape':
2120
+ if (this.activeDom instanceof ngZorroAntd.NzSelectComponent) {
2121
+ /** @type {?} */
2122
+ var nowActiveDom_1 = (/** @type {?} */ (this.activeDom));
2123
+ setTimeout((/**
2124
+ * @return {?}
2125
+ */
2126
+ function () {
2127
+ _this.activeSelectedComponentOpen = nowActiveDom_1.open;
2113
2128
  if (_this.activeSelectedComponentOpen === false) {
2114
- console.log('执行过程10');
2115
- _this.focusDom(_this.activeDomX, _this.activeDomY);
2116
- }
2117
- }
2118
- else if (_this.activeDomX === _this.collectDomList.length - 1) {
2119
- console.log('执行过程qqq');
2120
- _this.addNewLineAndFocus();
2121
- }
2122
- break;
2123
- case 'Escape':
2124
- if (_this.activeDom instanceof ngZorroAntd.NzSelectComponent) {
2125
- /** @type {?} */
2126
- var nowActiveDom_1 = (/** @type {?} */ (_this.activeDom));
2127
- setTimeout((/**
2128
- * @return {?}
2129
- */
2130
- function () {
2131
- _this.activeSelectedComponentOpen = nowActiveDom_1.open;
2132
- if (_this.activeSelectedComponentOpen === false) {
2133
- if (nowActiveDom_1.nzSelectService.mode === 'multiple') {
2134
- setTimeout((/**
2135
- * @return {?}
2136
- */
2137
- function () {
2138
- console.log('执行过程11');
2139
- _this.focusDom(_this.activeDomX, _this.activeDomY);
2140
- }), 0);
2141
- }
2142
- else {
2143
- console.log('执行过程12');
2129
+ if (nowActiveDom_1.nzSelectService.mode === 'multiple') {
2130
+ setTimeout((/**
2131
+ * @return {?}
2132
+ */
2133
+ function () {
2134
+ console.log('执行过程11');
2144
2135
  _this.focusDom(_this.activeDomX, _this.activeDomY);
2145
- }
2136
+ }), 0);
2146
2137
  }
2147
- }), 0);
2148
- }
2149
- break;
2150
- default:
2151
- // 如果当前聚焦的是选择框,且键入0-9a-zA-Z,则弹出
2152
- if (_this.activeDom instanceof ngZorroAntd.NzSelectComponent && _this.activeSelectedComponentOpen === false && /^[0-9a-zA-Z]$/.test(event.key)) {
2153
- /** @type {?} */
2154
- var dom = _this.activeDom;
2155
- dom.nzOpen = true;
2156
- _this.activeSelectedComponentOpen = true;
2157
- // // TODO:这里暂时注释,不能直接带入键入值,这样会导致输入中文的时候带入英文字符,不符合预期
2158
- // dom.nzSelectTopControlComponent.inputValue = event.key;
2159
- // // 获取 input 元素
2160
- // const inputElement = dom.nzSelectTopControlComponent.inputElement.nativeElement;
2161
- // setTimeout(() => {
2162
- // // 触发输入事件,以确保 Angular 检测到值的变化
2163
- // const eventInput = new Event('input', { bubbles: true });
2164
- // inputElement.dispatchEvent(eventInput);
2165
- // }, 0);
2166
- }
2167
- break;
2168
- }
2169
- }), 0);
2138
+ else {
2139
+ console.log('执行过程12');
2140
+ _this.focusDom(_this.activeDomX, _this.activeDomY);
2141
+ }
2142
+ }
2143
+ }), 0);
2144
+ }
2145
+ break;
2146
+ default:
2147
+ // 如果当前聚焦的是选择框,且键入0-9a-zA-Z,则弹出
2148
+ if (this.activeDom instanceof ngZorroAntd.NzSelectComponent && this.activeSelectedComponentOpen === false && /^[0-9a-zA-Z]$/.test(event.key)) {
2149
+ /** @type {?} */
2150
+ var dom = this.activeDom;
2151
+ dom.nzOpen = true;
2152
+ this.activeSelectedComponentOpen = true;
2153
+ // // TODO:这里暂时注释,不能直接带入键入值,这样会导致输入中文的时候带入英文字符,不符合预期
2154
+ // dom.nzSelectTopControlComponent.inputValue = event.key;
2155
+ // // 获取 input 元素
2156
+ // const inputElement = dom.nzSelectTopControlComponent.inputElement.nativeElement;
2157
+ // setTimeout(() => {
2158
+ // // 触发输入事件,以确保 Angular 检测到值的变化
2159
+ // const eventInput = new Event('input', { bubbles: true });
2160
+ // inputElement.dispatchEvent(eventInput);
2161
+ // }, 0);
2162
+ }
2163
+ break;
2164
+ }
2170
2165
  };
2171
2166
  /**
2172
2167
  * 根据在初始dom下标和数据集 获取在collectDomList中的下标
@@ -2596,6 +2591,21 @@
2596
2591
  });
2597
2592
  this.newLine = this.newLineItem();
2598
2593
  };
2594
+ /**
2595
+ * @return {?}
2596
+ */
2597
+ HdFormLinesComponent.prototype.delayJumpToNextInput = /**
2598
+ * @return {?}
2599
+ */
2600
+ function () {
2601
+ var _this = this;
2602
+ setTimeout((/**
2603
+ * @return {?}
2604
+ */
2605
+ function () {
2606
+ _this.jumpToNextInput(_this.activeDomX, _this.activeDomY);
2607
+ }), 0);
2608
+ };
2599
2609
  /**
2600
2610
  * 定义空的newLineItem 结构
2601
2611
  */
@@ -2641,7 +2651,7 @@
2641
2651
  */
2642
2652
  function (value) {
2643
2653
  if (item.type === FormLineType.Select && value !== null) {
2644
- _this.jumpToNextInput(_this.activeDomX, _this.activeDomY);
2654
+ _this.delayJumpToNextInput();
2645
2655
  }
2646
2656
  _this.triggerEvent(item.onChangeEvent, value, formGroupSubmit);
2647
2657
  }));
@@ -2653,7 +2663,7 @@
2653
2663
  */
2654
2664
  function (value) {
2655
2665
  if (item.type === FormLineType.Select && value !== null) {
2656
- _this.jumpToNextInput(_this.activeDomX, _this.activeDomY);
2666
+ _this.delayJumpToNextInput();
2657
2667
  }
2658
2668
  _this.triggerEvent(item.onChangeEvent, value, formGroupSubmit);
2659
2669
  }));
@@ -2730,7 +2740,7 @@
2730
2740
  */
2731
2741
  function (value) {
2732
2742
  if (item.type === FormLineType.Select && value !== null) {
2733
- _this.jumpToNextInput(_this.activeDomX, _this.activeDomY);
2743
+ _this.delayJumpToNextInput();
2734
2744
  }
2735
2745
  _this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
2736
2746
  }));
@@ -2742,7 +2752,7 @@
2742
2752
  */
2743
2753
  function (value) {
2744
2754
  if (item.type === FormLineType.Select && value !== null) {
2745
- _this.jumpToNextInput(_this.activeDomX, _this.activeDomY);
2755
+ _this.delayJumpToNextInput();
2746
2756
  }
2747
2757
  _this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
2748
2758
  }));