fantasy-ngzorro 2.1.8 → 2.1.9

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.
@@ -3854,21 +3854,27 @@
3854
3854
  }
3855
3855
  /** @type {?} */
3856
3856
  var debounceMs = onSearchEventDebounceTime != null ? onSearchEventDebounceTime : 0;
3857
- this.debounceTimeout = debounceMs;
3858
- if (this.searchSubscription) {
3859
- this.searchSubscription.unsubscribe();
3857
+ // 未配置或为 0:同步触发,不走 debounceTime(避免异步)
3858
+ if (!debounceMs) {
3859
+ this.triggerEvent(fn, event, line);
3860
+ }
3861
+ else {
3862
+ this.debounceTimeout = debounceMs;
3863
+ if (this.searchSubscription) {
3864
+ this.searchSubscription.unsubscribe();
3865
+ }
3866
+ this.searchSubscription = this.searchSubject
3867
+ .pipe(operators.debounceTime(this.debounceTimeout))
3868
+ .subscribe((/**
3869
+ * @param {?} __0
3870
+ * @return {?}
3871
+ */
3872
+ function (_a) {
3873
+ var fn = _a.fn, event = _a.event, line = _a.line;
3874
+ return _this.triggerEvent(fn, event, line);
3875
+ }));
3876
+ this.searchSubject.next({ fn: fn, event: event, line: line });
3860
3877
  }
3861
- this.searchSubscription = this.searchSubject
3862
- .pipe(operators.debounceTime(this.debounceTimeout))
3863
- .subscribe((/**
3864
- * @param {?} __0
3865
- * @return {?}
3866
- */
3867
- function (_a) {
3868
- var fn = _a.fn, event = _a.event, line = _a.line;
3869
- return _this.triggerEvent(fn, event, line);
3870
- }));
3871
- this.searchSubject.next({ fn: fn, event: event, line: line });
3872
3878
  setTimeout((/**
3873
3879
  * @return {?}
3874
3880
  */
@@ -3899,6 +3905,13 @@
3899
3905
  var debounceMs = onOpenChangeEventDebounceTime != null
3900
3906
  ? onOpenChangeEventDebounceTime
3901
3907
  : 0;
3908
+ // 未配置或为 0:同步触发,不走 debounceTime(避免异步)
3909
+ if (!debounceMs) {
3910
+ if (open) {
3911
+ this.triggerEvent(fn, open, line);
3912
+ }
3913
+ return;
3914
+ }
3902
3915
  this.openChangeDebounceTimeout = debounceMs;
3903
3916
  if (this.openChangeSubscription) {
3904
3917
  this.openChangeSubscription.unsubscribe();
@@ -3990,16 +4003,29 @@
3990
4003
  var debounceMs = item.onChangeEventDebounceTime != null
3991
4004
  ? item.onChangeEventDebounceTime
3992
4005
  : 0;
3993
- formGroupTmp
3994
- .get(item.name)
3995
- .valueChanges.pipe(operators.debounceTime(debounceMs))
3996
- .subscribe((/**
3997
- * @param {?} value
3998
- * @return {?}
3999
- */
4000
- function (value) {
4001
- _this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
4002
- }));
4006
+ /** @type {?} */
4007
+ var control = formGroupTmp.get(item.name);
4008
+ // 未配置或为 0:同步订阅,不走 debounceTime
4009
+ if (debounceMs > 0) {
4010
+ control.valueChanges
4011
+ .pipe(operators.debounceTime(debounceMs))
4012
+ .subscribe((/**
4013
+ * @param {?} value
4014
+ * @return {?}
4015
+ */
4016
+ function (value) {
4017
+ _this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
4018
+ }));
4019
+ }
4020
+ else {
4021
+ control.valueChanges.subscribe((/**
4022
+ * @param {?} value
4023
+ * @return {?}
4024
+ */
4025
+ function (value) {
4026
+ _this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
4027
+ }));
4028
+ }
4003
4029
  }
4004
4030
  }));
4005
4031
  ((/** @type {?} */ (tmpValidateHdFormLines.get("lines")))).insert(((/** @type {?} */ (tmpValidateHdFormLines.get("lines")))).controls.length, formGroupTmp);
@@ -4375,10 +4401,10 @@
4375
4401
  var debounceMs = item.onChangeEventDebounceTime != null
4376
4402
  ? item.onChangeEventDebounceTime
4377
4403
  : 0;
4378
- formGroupSubmit
4379
- .get(item.name)
4380
- .valueChanges.pipe(operators.debounceTime(debounceMs))
4381
- .subscribe((/**
4404
+ /** @type {?} */
4405
+ var control = formGroupSubmit.get(item.name);
4406
+ /** @type {?} */
4407
+ var handleChange = (/**
4382
4408
  * @param {?} value
4383
4409
  * @return {?}
4384
4410
  */
@@ -4387,7 +4413,16 @@
4387
4413
  _this.delayJumpToNextInput();
4388
4414
  }
4389
4415
  _this.triggerEvent(item.onChangeEvent, value, formGroupSubmit);
4390
- }));
4416
+ });
4417
+ // 未配置或为 0:同步订阅,不走 debounceTime
4418
+ if (debounceMs > 0) {
4419
+ control.valueChanges
4420
+ .pipe(operators.debounceTime(debounceMs))
4421
+ .subscribe(handleChange);
4422
+ }
4423
+ else {
4424
+ control.valueChanges.subscribe(handleChange);
4425
+ }
4391
4426
  }
4392
4427
  }));
4393
4428
  return formGroupSubmit;
@@ -5441,6 +5476,11 @@
5441
5476
  }
5442
5477
  /** @type {?} */
5443
5478
  var debounceMs = onSearchEventDebounceTime != null ? onSearchEventDebounceTime : 0;
5479
+ // 未配置或为 0:同步触发,不走 debounceTime(避免异步)
5480
+ if (!debounceMs) {
5481
+ this.triggerEvent(fn, event);
5482
+ return;
5483
+ }
5444
5484
  this.debounceTimeout = debounceMs;
5445
5485
  if (this.searchSubscription) {
5446
5486
  this.searchSubscription.unsubscribe();
@@ -5478,6 +5518,13 @@
5478
5518
  var debounceMs = onOpenChangeEventDebounceTime != null
5479
5519
  ? onOpenChangeEventDebounceTime
5480
5520
  : 0;
5521
+ // 未配置或为 0:同步触发,不走 debounceTime(避免异步)
5522
+ if (!debounceMs) {
5523
+ if (open) {
5524
+ this.triggerEvent(fn, open);
5525
+ }
5526
+ return;
5527
+ }
5481
5528
  this.openChangeDebounceTimeout = debounceMs;
5482
5529
  if (this.openChangeSubscription) {
5483
5530
  this.openChangeSubscription.unsubscribe();
@@ -5648,14 +5695,29 @@
5648
5695
  var debounceMs = item.onChangeEventDebounceTime != null
5649
5696
  ? item.onChangeEventDebounceTime
5650
5697
  : 0;
5651
- _this.validateHdForm
5652
- .get(item.name)
5653
- .valueChanges.pipe(operators.debounceTime(debounceMs))
5654
- .subscribe((/**
5655
- * @param {?} value
5656
- * @return {?}
5657
- */
5658
- function (value) { return _this.triggerEvent(item.onChangeEvent, value); }));
5698
+ /** @type {?} */
5699
+ var control = _this.validateHdForm.get(item.name);
5700
+ // 未配置或为 0:同步订阅,不走 debounceTime(避免异步破坏 patchValue 联动回显)
5701
+ if (debounceMs > 0) {
5702
+ control.valueChanges
5703
+ .pipe(operators.debounceTime(debounceMs))
5704
+ .subscribe((/**
5705
+ * @param {?} value
5706
+ * @return {?}
5707
+ */
5708
+ function (value) {
5709
+ return _this.triggerEvent(item.onChangeEvent, value);
5710
+ }));
5711
+ }
5712
+ else {
5713
+ control.valueChanges.subscribe((/**
5714
+ * @param {?} value
5715
+ * @return {?}
5716
+ */
5717
+ function (value) {
5718
+ return _this.triggerEvent(item.onChangeEvent, value);
5719
+ }));
5720
+ }
5659
5721
  }
5660
5722
  }));
5661
5723
  this.validateHdForm.valueChanges.subscribe((/**