@acorex/components 16.18.11 → 16.18.12

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ElementRef, Component, Inject, Optional, Input, Injectable, EventEmitter, Output, Directive, ViewChild, ContentChild, TemplateRef, ViewEncapsulation, HostListener, NgModule, ChangeDetectionStrategy, Attribute, ContentChildren, ViewChildren, NO_ERRORS_SCHEMA, ViewContainerRef, HostBinding } from '@angular/core';
2
+ import { ElementRef, Component, Inject, Optional, Input, Injectable, EventEmitter, Output, Directive, ViewChild, ContentChild, TemplateRef, ViewEncapsulation, HostListener, NgModule, ChangeDetectionStrategy, Attribute, ContentChildren, ViewChildren, NO_ERRORS_SCHEMA, ViewContainerRef, HostBinding, input } from '@angular/core';
3
3
  import * as i1$2 from '@acorex/core';
4
4
  import { AXTranslator, AXHtmlUtil, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXTranslatorModule, AXObjectUtil, AXScrollModule, setPropByPath, AXColorUtil } from '@acorex/core';
5
5
  import * as i1 from '@angular/cdk/overlay';
@@ -7584,7 +7584,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7584
7584
  cdr;
7585
7585
  min = null;
7586
7586
  max = null;
7587
- showSeparator = false;
7587
+ showSeparator = input(false);
7588
7588
  showCurrency = false;
7589
7589
  showCounter = true;
7590
7590
  scrollWeel = true;
@@ -7614,7 +7614,9 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7614
7614
  this._values = '-';
7615
7615
  }
7616
7616
  else {
7617
- if (v === '' || v == null || v === undefined ? true : isNaN(Number(v.toString().replace(/,/g, ''))) === false) {
7617
+ if (v === '' || v == null || v === undefined
7618
+ ? true
7619
+ : isNaN(Number(v.toString().replace(/,/g, ''))) === false) {
7618
7620
  if (v === '' || v == null || v === undefined) {
7619
7621
  this.textValue = '';
7620
7622
  const old = this._values;
@@ -7625,7 +7627,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7625
7627
  isUserChange: this.userEdite,
7626
7628
  component: this,
7627
7629
  value: null,
7628
- oldValue: this.showSeparator && old
7630
+ oldValue: this.showSeparator() && old
7629
7631
  ? old === '-'
7630
7632
  ? null
7631
7633
  : Number(old.replace(/,/g, ''))
@@ -7634,7 +7636,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7634
7636
  : old === '-'
7635
7637
  ? null
7636
7638
  : Number(old),
7637
- htmlElement: this.ref.nativeElement
7639
+ htmlElement: this.ref.nativeElement,
7638
7640
  });
7639
7641
  this.userEdite = false;
7640
7642
  this.cdr.detectChanges();
@@ -7644,7 +7646,8 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7644
7646
  else {
7645
7647
  v = v.toString();
7646
7648
  // this.addCommas(v.toString());
7647
- this.textValue = this.showSeparator && v ? this.addCommas(v.toString()) : v;
7649
+ this.textValue =
7650
+ this.showSeparator() && v ? this.addCommas(v.toString()) : v;
7648
7651
  // if (this.textValue.indexOf('.') !== -1) {
7649
7652
  // // const dottt= (this.textValue.length-1) - this.textValue.indexOf('.')
7650
7653
  // if (this.textValue.length - 1 - this.textValue.indexOf('.') < this.decimalNumber) {
@@ -7667,12 +7670,16 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7667
7670
  if (v !== this._values) {
7668
7671
  const old = this._values;
7669
7672
  this._values = v;
7670
- this.valueChange.emit(this.showSeparator && v ? Number(v.replace(/,/g, '')) : Number(v));
7673
+ this.valueChange.emit(this.showSeparator() && v
7674
+ ? Number(v.replace(/,/g, ''))
7675
+ : Number(v));
7671
7676
  this.onValueChanged.emit({
7672
7677
  isUserChange: this.userEdite,
7673
7678
  component: this,
7674
- value: this.showSeparator && v ? Number(v.replace(/,/g, '')) : Number(v),
7675
- oldValue: this.showSeparator && old
7679
+ value: this.showSeparator() && v
7680
+ ? Number(v.replace(/,/g, ''))
7681
+ : Number(v),
7682
+ oldValue: this.showSeparator() && old
7676
7683
  ? old === '-'
7677
7684
  ? null
7678
7685
  : Number(old.replace(/,/g, ''))
@@ -7681,7 +7688,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7681
7688
  : old === '-'
7682
7689
  ? null
7683
7690
  : Number(old),
7684
- htmlElement: this.ref.nativeElement
7691
+ htmlElement: this.ref.nativeElement,
7685
7692
  });
7686
7693
  this.userEdite = false;
7687
7694
  this.cdr.detectChanges();
@@ -7700,7 +7707,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7700
7707
  isUserChange: this.userEdite,
7701
7708
  component: this,
7702
7709
  value: null,
7703
- oldValue: this.showSeparator && old
7710
+ oldValue: this.showSeparator() && old
7704
7711
  ? old === '-'
7705
7712
  ? null
7706
7713
  : Number(old.replace(/,/g, ''))
@@ -7709,7 +7716,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7709
7716
  : old === '-'
7710
7717
  ? null
7711
7718
  : Number(old),
7712
- htmlElement: this.ref.nativeElement
7719
+ htmlElement: this.ref.nativeElement,
7713
7720
  });
7714
7721
  this.userEdite = false;
7715
7722
  this.cdr.detectChanges();
@@ -7724,7 +7731,7 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7724
7731
  this.textAlign = 'left';
7725
7732
  }
7726
7733
  calcSeparator(num) {
7727
- if (this.showSeparator) {
7734
+ if (this.showSeparator()) {
7728
7735
  return num + +(num / 3);
7729
7736
  }
7730
7737
  else {
@@ -7793,7 +7800,8 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7793
7800
  this.findMinus = false;
7794
7801
  }
7795
7802
  // get cursur position when key press
7796
- if (this.input.nativeElement.selectionStart || this.input.nativeElement.selectionStart === 0) {
7803
+ if (this.input.nativeElement.selectionStart ||
7804
+ this.input.nativeElement.selectionStart === 0) {
7797
7805
  this.cursorPosition = this.input.nativeElement.selectionStart;
7798
7806
  this.cursorPosition += 1;
7799
7807
  }
@@ -7822,7 +7830,9 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7822
7830
  if (this.value && this.value.toString().match(/\./g)) {
7823
7831
  const figureAfterDot = this.value.length - this.value.indexOf('.');
7824
7832
  const dotIndex = this.value.indexOf('.');
7825
- if (dotIndex - 1 + dotIndex + figureAfterDot > dotIndex - 1 + dotIndex + this.decimalNumber && this.cursorPosition - 1 > dotIndex) {
7833
+ if (dotIndex - 1 + dotIndex + figureAfterDot >
7834
+ dotIndex - 1 + dotIndex + this.decimalNumber &&
7835
+ this.cursorPosition - 1 > dotIndex) {
7826
7836
  event.preventDefault();
7827
7837
  }
7828
7838
  }
@@ -7858,7 +7868,8 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7858
7868
  }
7859
7869
  // left & right Button
7860
7870
  if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
7861
- if (this.input.nativeElement.selectionStart || this.input.nativeElement.selectionStart === 0) {
7871
+ if (this.input.nativeElement.selectionStart ||
7872
+ this.input.nativeElement.selectionStart === 0) {
7862
7873
  this.cursorPosition = this.input.nativeElement.selectionStart;
7863
7874
  }
7864
7875
  }
@@ -7890,9 +7901,13 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7890
7901
  }
7891
7902
  if (this.readonly === false) {
7892
7903
  const countAfterDot = this.value !== null && this.value !== '' && this.value !== undefined
7893
- ? this.value.toString().length - 1 - this.value.toString().indexOf('.')
7904
+ ? this.value.toString().length -
7905
+ 1 -
7906
+ this.value.toString().indexOf('.')
7894
7907
  : 0;
7895
- const defaultStep = countAfterDot > this.decimalNumber ? Math.pow(this.decimalConstant, this.decimalNumber) : Math.pow(this.decimalConstant, countAfterDot);
7908
+ const defaultStep = countAfterDot > this.decimalNumber
7909
+ ? Math.pow(this.decimalConstant, this.decimalNumber)
7910
+ : Math.pow(this.decimalConstant, countAfterDot);
7896
7911
  // step and +- with up key and down key
7897
7912
  if (this.value && this.value.toString().match(/\./g)) {
7898
7913
  this.dotPosition = this.value.indexOf('.');
@@ -7902,14 +7917,18 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7902
7917
  this.count = this.tmp - +this.intStep;
7903
7918
  if (this.min === null || Number(this.count) >= Number(this.min)) {
7904
7919
  // this.value = this.count.toFixed(this.decimalNumber);
7905
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
7920
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
7921
+ ? this.decimalNumber
7922
+ : countAfterDot);
7906
7923
  }
7907
7924
  }
7908
7925
  if (event.key === 'ArrowUp') {
7909
7926
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
7910
7927
  this.count = this.tmp + +this.intStep;
7911
7928
  if (this.max === null || Number(this.count) <= Number(this.max)) {
7912
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
7929
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
7930
+ ? this.decimalNumber
7931
+ : countAfterDot);
7913
7932
  }
7914
7933
  }
7915
7934
  }
@@ -7919,16 +7938,26 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7919
7938
  if (this.customStep !== null) {
7920
7939
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
7921
7940
  this.lastStep =
7922
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) +
7923
- parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) -
7924
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot));
7941
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
7942
+ ? this.decimalNumber
7943
+ : countAfterDot)) +
7944
+ parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber
7945
+ ? this.decimalNumber
7946
+ : countAfterDot)) -
7947
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
7948
+ ? this.decimalNumber
7949
+ : countAfterDot));
7925
7950
  this.count = parseFloat(this.tmp) - this.lastStep;
7926
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
7951
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
7952
+ ? this.decimalNumber
7953
+ : countAfterDot);
7927
7954
  }
7928
7955
  else {
7929
7956
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
7930
7957
  this.count = parseFloat(this.tmp) - defaultStep;
7931
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
7958
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
7959
+ ? this.decimalNumber
7960
+ : countAfterDot);
7932
7961
  }
7933
7962
  }
7934
7963
  }
@@ -7937,16 +7966,26 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7937
7966
  if (this.customStep !== null) {
7938
7967
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
7939
7968
  this.lastStep =
7940
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) +
7941
- parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) -
7942
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot));
7969
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
7970
+ ? this.decimalNumber
7971
+ : countAfterDot)) +
7972
+ parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber
7973
+ ? this.decimalNumber
7974
+ : countAfterDot)) -
7975
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
7976
+ ? this.decimalNumber
7977
+ : countAfterDot));
7943
7978
  this.count = parseFloat(this.tmp) + this.lastStep;
7944
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
7979
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
7980
+ ? this.decimalNumber
7981
+ : countAfterDot);
7945
7982
  }
7946
7983
  else {
7947
7984
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
7948
7985
  this.count = parseFloat(this.tmp) + defaultStep;
7949
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
7986
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
7987
+ ? this.decimalNumber
7988
+ : countAfterDot);
7950
7989
  }
7951
7990
  }
7952
7991
  }
@@ -7958,7 +7997,8 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7958
7997
  this.value = this.min.toString();
7959
7998
  }
7960
7999
  else {
7961
- if (this.min === null || Number(this.value) > parseInt(this.min.toString())) {
8000
+ if (this.min === null ||
8001
+ Number(this.value) > parseInt(this.min.toString())) {
7962
8002
  if (this.value == null) {
7963
8003
  this.value = '0';
7964
8004
  }
@@ -7975,7 +8015,8 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7975
8015
  this.value = this.min.toString();
7976
8016
  }
7977
8017
  else {
7978
- if (this.max === null || Number(this.value) < parseInt(this.max.toString())) {
8018
+ if (this.max === null ||
8019
+ Number(this.value) < parseInt(this.max.toString())) {
7979
8020
  if (this.value == null) {
7980
8021
  this.value = '0';
7981
8022
  }
@@ -7998,7 +8039,8 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
7998
8039
  }
7999
8040
  }
8000
8041
  handleClick() {
8001
- if (this.input.nativeElement.selectionStart || this.input.nativeElement.selectionStart === 0) {
8042
+ if (this.input.nativeElement.selectionStart ||
8043
+ this.input.nativeElement.selectionStart === 0) {
8002
8044
  this.cursorPosition = this.input.nativeElement.selectionStart;
8003
8045
  }
8004
8046
  }
@@ -8006,7 +8048,9 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
8006
8048
  Observable.create((observer) => {
8007
8049
  this.userQuestionUpdate = observer;
8008
8050
  });
8009
- this.userQuestionUpdate.pipe(debounceTime(1000), distinctUntilChanged()).subscribe((text) => this.checkMinMax(text));
8051
+ this.userQuestionUpdate
8052
+ .pipe(debounceTime(1000), distinctUntilChanged())
8053
+ .subscribe((text) => this.checkMinMax(text));
8010
8054
  // this.userQuestionUpdate.next((e.target as any).value);
8011
8055
  setTimeout(() => {
8012
8056
  this.userQuestionUpdate.next(this.input.nativeElement.value);
@@ -8062,20 +8106,26 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
8062
8106
  else {
8063
8107
  if (this.readonly === false) {
8064
8108
  const countAfterDot = this.value !== null && this.value !== '' && this.value !== undefined
8065
- ? this.value.toString().length - 1 - this.value.toString().indexOf('.')
8109
+ ? this.value.toString().length -
8110
+ 1 -
8111
+ this.value.toString().indexOf('.')
8066
8112
  : 0;
8067
8113
  if (this.value == null) {
8068
8114
  this.value = '0';
8069
8115
  }
8070
8116
  else {
8071
- const defaultStep = countAfterDot > this.decimalNumber ? Math.pow(this.decimalConstant, this.decimalNumber) : Math.pow(this.decimalConstant, countAfterDot);
8117
+ const defaultStep = countAfterDot > this.decimalNumber
8118
+ ? Math.pow(this.decimalConstant, this.decimalNumber)
8119
+ : Math.pow(this.decimalConstant, countAfterDot);
8072
8120
  this.dotPosition = this.value.toString().indexOf('.') + 1;
8073
8121
  if (this.value && this.value.toString().match(/\./g)) {
8074
8122
  if (this.dotPosition > this.cursorPosition) {
8075
8123
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
8076
8124
  this.count = this.tmp + +this.intStep;
8077
8125
  if (this.max === null || Number(this.count) <= this.max) {
8078
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
8126
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
8127
+ ? this.decimalNumber
8128
+ : countAfterDot);
8079
8129
  }
8080
8130
  }
8081
8131
  else {
@@ -8083,22 +8133,37 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
8083
8133
  if (this.customStep !== null) {
8084
8134
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
8085
8135
  this.lastStep =
8086
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) +
8087
- parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) -
8088
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot));
8136
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
8137
+ ? this.decimalNumber
8138
+ : countAfterDot)) +
8139
+ parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber
8140
+ ? this.decimalNumber
8141
+ : countAfterDot)) -
8142
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
8143
+ ? this.decimalNumber
8144
+ : countAfterDot));
8089
8145
  this.count = parseFloat(this.tmp) + this.lastStep;
8090
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot).replace(/,/g, '');
8146
+ this.value = this.count
8147
+ .toFixed(countAfterDot > this.decimalNumber
8148
+ ? this.decimalNumber
8149
+ : countAfterDot)
8150
+ .replace(/,/g, '');
8091
8151
  }
8092
8152
  else {
8093
8153
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
8094
8154
  this.count = parseFloat(this.tmp) + defaultStep;
8095
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot).replace(/,/g, '');
8155
+ this.value = this.count
8156
+ .toFixed(countAfterDot > this.decimalNumber
8157
+ ? this.decimalNumber
8158
+ : countAfterDot)
8159
+ .replace(/,/g, '');
8096
8160
  }
8097
8161
  }
8098
8162
  }
8099
8163
  }
8100
8164
  else {
8101
- if (this.max === null || Number(this.value) < parseInt(this.max.toString())) {
8165
+ if (this.max === null ||
8166
+ Number(this.value) < parseInt(this.max.toString())) {
8102
8167
  this.tmp = this.value.toString().replace(/,/g, '');
8103
8168
  this.count = +this.tmp + +this.intStep;
8104
8169
  this.value = this.count.toString().replace(/,/g, '');
@@ -8116,20 +8181,29 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
8116
8181
  else {
8117
8182
  if (this.readonly === false) {
8118
8183
  const countAfterDot = this.value !== null && this.value !== '' && this.value !== undefined
8119
- ? this.value.toString().length - 1 - this.value.toString().indexOf('.')
8184
+ ? this.value.toString().length -
8185
+ 1 -
8186
+ this.value.toString().indexOf('.')
8120
8187
  : 0;
8121
8188
  if (this.value == null) {
8122
8189
  this.value = '0';
8123
8190
  }
8124
8191
  else {
8125
- const defaultStep = countAfterDot > this.decimalNumber ? Math.pow(this.decimalConstant, this.decimalNumber) : Math.pow(this.decimalConstant, countAfterDot);
8192
+ const defaultStep = countAfterDot > this.decimalNumber
8193
+ ? Math.pow(this.decimalConstant, this.decimalNumber)
8194
+ : Math.pow(this.decimalConstant, countAfterDot);
8126
8195
  this.dotPosition = this.value.toString().indexOf('.') + 1;
8127
8196
  if (this.value && this.value.toString().match(/\./g)) {
8128
8197
  if (this.dotPosition > this.cursorPosition) {
8129
8198
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
8130
- this.count = parseFloat(this.value.replace(/,/g, '')) - +this.intStep;
8199
+ this.count =
8200
+ parseFloat(this.value.replace(/,/g, '')) - +this.intStep;
8131
8201
  if (this.min === null || Number(this.count) >= this.min) {
8132
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot).replace(/,/g, '');
8202
+ this.value = this.count
8203
+ .toFixed(countAfterDot > this.decimalNumber
8204
+ ? this.decimalNumber
8205
+ : countAfterDot)
8206
+ .replace(/,/g, '');
8133
8207
  }
8134
8208
  }
8135
8209
  else {
@@ -8137,22 +8211,33 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
8137
8211
  if (this.customStep !== null) {
8138
8212
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
8139
8213
  this.lastStep =
8140
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) +
8141
- parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot)) -
8142
- parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot));
8214
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
8215
+ ? this.decimalNumber
8216
+ : countAfterDot)) +
8217
+ parseFloat(this.customStep.toFixed(countAfterDot > this.decimalNumber
8218
+ ? this.decimalNumber
8219
+ : countAfterDot)) -
8220
+ parseFloat(defaultStep.toFixed(countAfterDot > this.decimalNumber
8221
+ ? this.decimalNumber
8222
+ : countAfterDot));
8143
8223
  this.count = parseFloat(this.tmp) - this.lastStep;
8144
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
8224
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
8225
+ ? this.decimalNumber
8226
+ : countAfterDot);
8145
8227
  }
8146
8228
  else {
8147
8229
  this.tmp = parseFloat(this.value.replace(/,/g, ''));
8148
8230
  this.count = parseFloat(this.tmp) - defaultStep;
8149
- this.value = this.count.toFixed(countAfterDot > this.decimalNumber ? this.decimalNumber : countAfterDot);
8231
+ this.value = this.count.toFixed(countAfterDot > this.decimalNumber
8232
+ ? this.decimalNumber
8233
+ : countAfterDot);
8150
8234
  }
8151
8235
  }
8152
8236
  }
8153
8237
  }
8154
8238
  else {
8155
- if (this.min === null || Number(this.value) > parseInt(this.min.toString())) {
8239
+ if (this.min === null ||
8240
+ Number(this.value) > parseInt(this.min.toString())) {
8156
8241
  this.tmp = +this.value.toString().replace(/,/g, '');
8157
8242
  this.count = +this.tmp - +this.intStep;
8158
8243
  this.value = this.count.toString().replace(/,/g, '');
@@ -8167,21 +8252,23 @@ class AXNumberBoxComponent extends AXBaseTextComponent {
8167
8252
  this.onBlur.emit({
8168
8253
  component: this,
8169
8254
  htmlElement: this.ref.nativeElement,
8170
- htmlEvent: e
8255
+ htmlEvent: e,
8171
8256
  });
8172
8257
  }
8173
8258
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.7", ngImport: i0, type: AXNumberBoxComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
8174
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.7", type: AXNumberBoxComponent, selector: "ax-number-box", inputs: { min: "min", max: "max", showSeparator: "showSeparator", showCurrency: "showCurrency", showCounter: "showCounter", scrollWeel: "scrollWeel", showDoubleCounter: "showDoubleCounter", maxLength: "maxLength", intStep: "intStep", decimalNumber: "decimalNumber", customStep: "customStep" }, host: { styleAttribute: "width: 100%" }, providers: [{ provide: AXValidatableComponent, useExisting: AXNumberBoxComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax form-item\" [class.disabled]=\"disabled\" [attr.id]=\"uid\" #fc>\n <div class=\"ax items-wrapper\">\n <ng-content select=\"[start]\">\n </ng-content>\n <ax-button icon=\"far fa-plus\" type=\"success blank\" (click)=\"upStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n </div>\n <div class=\"content\" #content>\n <div class=\"ax form-control input {{size}}\" [class.disabled]=\"disabled\" [class.readonly]=\"readonly\"\n [class.icon]=\"icon\">\n <input [autocomplete]=\"autocomplete\" [name]=\"name\" #input type=\"text\" class=\"ax {{size}}\" [maxlength]=\"calcSeparator(maxLength)\" [(ngModel)]=\"textValue\" placeholder=\"{{placeholder}}\"\n [readonly]=\"readonly\" [disabled]=\"disabled\" [ngClass]=\"setTextAlign()\"\n [class.clear]=\"value && allowClear\" (focus)=\"handleInputFocus($event)\" (blur)=\"handleInputBlur($event)\"\n (keypress)=\"handleKeyPress($event)\" (ngModelChange)=\"this.userQuestionUpdate.next($event)\"\n (keydown)=\"handleKeyDown($event)\" (click)=\"handleClick()\" (keyup)=\"handleKeyUp($event)\">\n <i class=\"{{icon}}\" *ngIf=\"icon\"></i>\n </div>\n </div>\n <div class=\"ax items-wrapper\">\n <ax-button *ngIf=\"value && allowClear\" [disabled]=\"disabled\" icon=\"far fa-times\" type=\"danger blank\"\n (click)=\"clear()\"></ax-button>\n <ax-button icon=\"far fa-minus\" type=\"danger blank\" (click)=\"downStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n <ng-content select=\"[end]\">\n </ng-content>\n <div class=\"arrow-number\" *ngIf=\"showCounter && !showDoubleCounter && !readonly\" >\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-up\" [size]=\"size\"\n (mousedown)=\"upStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-down\" [size]=\"size\"\n (mousedown)=\"downStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n </div>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["type", "icon", "submitBehavior", "cancelBehavior", "block", "loading", "selected"] }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8259
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.7", type: AXNumberBoxComponent, selector: "ax-number-box", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: false, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: false, isRequired: false, transformFunction: null }, showSeparator: { classPropertyName: "showSeparator", publicName: "showSeparator", isSignal: true, isRequired: false, transformFunction: null }, showCurrency: { classPropertyName: "showCurrency", publicName: "showCurrency", isSignal: false, isRequired: false, transformFunction: null }, showCounter: { classPropertyName: "showCounter", publicName: "showCounter", isSignal: false, isRequired: false, transformFunction: null }, scrollWeel: { classPropertyName: "scrollWeel", publicName: "scrollWeel", isSignal: false, isRequired: false, transformFunction: null }, showDoubleCounter: { classPropertyName: "showDoubleCounter", publicName: "showDoubleCounter", isSignal: false, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: false, isRequired: false, transformFunction: null }, intStep: { classPropertyName: "intStep", publicName: "intStep", isSignal: false, isRequired: false, transformFunction: null }, decimalNumber: { classPropertyName: "decimalNumber", publicName: "decimalNumber", isSignal: false, isRequired: false, transformFunction: null }, customStep: { classPropertyName: "customStep", publicName: "customStep", isSignal: false, isRequired: false, transformFunction: null } }, host: { styleAttribute: "width: 100%" }, providers: [
8260
+ { provide: AXValidatableComponent, useExisting: AXNumberBoxComponent },
8261
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"ax form-item\" [class.disabled]=\"disabled\" [attr.id]=\"uid\" #fc>\n <div class=\"ax items-wrapper\">\n <ng-content select=\"[start]\">\n </ng-content>\n <ax-button icon=\"far fa-plus\" type=\"success blank\" (click)=\"upStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n </div>\n <div class=\"content\" #content>\n <div class=\"ax form-control input {{size}}\" [class.disabled]=\"disabled\" [class.readonly]=\"readonly\"\n [class.icon]=\"icon\">\n <input [autocomplete]=\"autocomplete\" [name]=\"name\" #input type=\"text\" class=\"ax {{size}}\" [maxlength]=\"calcSeparator(maxLength)\" [(ngModel)]=\"textValue\" placeholder=\"{{placeholder}}\"\n [readonly]=\"readonly\" [disabled]=\"disabled\" [ngClass]=\"setTextAlign()\"\n [class.clear]=\"value && allowClear\" (focus)=\"handleInputFocus($event)\" (blur)=\"handleInputBlur($event)\"\n (keypress)=\"handleKeyPress($event)\" (ngModelChange)=\"this.userQuestionUpdate.next($event)\"\n (keydown)=\"handleKeyDown($event)\" (click)=\"handleClick()\" (keyup)=\"handleKeyUp($event)\">\n <i class=\"{{icon}}\" *ngIf=\"icon\"></i>\n </div>\n </div>\n <div class=\"ax items-wrapper\">\n <ax-button *ngIf=\"value && allowClear\" [disabled]=\"disabled\" icon=\"far fa-times\" type=\"danger blank\"\n (click)=\"clear()\"></ax-button>\n <ax-button icon=\"far fa-minus\" type=\"danger blank\" (click)=\"downStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n <ng-content select=\"[end]\">\n </ng-content>\n <div class=\"arrow-number\" *ngIf=\"showCounter && !showDoubleCounter && !readonly\" >\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-up\" [size]=\"size\"\n (mousedown)=\"upStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-down\" [size]=\"size\"\n (mousedown)=\"downStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n </div>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["type", "icon", "submitBehavior", "cancelBehavior", "block", "loading", "selected"] }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8175
8262
  }
8176
8263
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.7", ngImport: i0, type: AXNumberBoxComponent, decorators: [{
8177
8264
  type: Component,
8178
- args: [{ selector: 'ax-number-box', changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'width: 100%' }, providers: [{ provide: AXValidatableComponent, useExisting: AXNumberBoxComponent }], template: "<div class=\"ax form-item\" [class.disabled]=\"disabled\" [attr.id]=\"uid\" #fc>\n <div class=\"ax items-wrapper\">\n <ng-content select=\"[start]\">\n </ng-content>\n <ax-button icon=\"far fa-plus\" type=\"success blank\" (click)=\"upStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n </div>\n <div class=\"content\" #content>\n <div class=\"ax form-control input {{size}}\" [class.disabled]=\"disabled\" [class.readonly]=\"readonly\"\n [class.icon]=\"icon\">\n <input [autocomplete]=\"autocomplete\" [name]=\"name\" #input type=\"text\" class=\"ax {{size}}\" [maxlength]=\"calcSeparator(maxLength)\" [(ngModel)]=\"textValue\" placeholder=\"{{placeholder}}\"\n [readonly]=\"readonly\" [disabled]=\"disabled\" [ngClass]=\"setTextAlign()\"\n [class.clear]=\"value && allowClear\" (focus)=\"handleInputFocus($event)\" (blur)=\"handleInputBlur($event)\"\n (keypress)=\"handleKeyPress($event)\" (ngModelChange)=\"this.userQuestionUpdate.next($event)\"\n (keydown)=\"handleKeyDown($event)\" (click)=\"handleClick()\" (keyup)=\"handleKeyUp($event)\">\n <i class=\"{{icon}}\" *ngIf=\"icon\"></i>\n </div>\n </div>\n <div class=\"ax items-wrapper\">\n <ax-button *ngIf=\"value && allowClear\" [disabled]=\"disabled\" icon=\"far fa-times\" type=\"danger blank\"\n (click)=\"clear()\"></ax-button>\n <ax-button icon=\"far fa-minus\" type=\"danger blank\" (click)=\"downStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n <ng-content select=\"[end]\">\n </ng-content>\n <div class=\"arrow-number\" *ngIf=\"showCounter && !showDoubleCounter && !readonly\" >\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-up\" [size]=\"size\"\n (mousedown)=\"upStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-down\" [size]=\"size\"\n (mousedown)=\"downStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n </div>\n </div>\n\n</div>\n" }]
8265
+ args: [{ selector: 'ax-number-box', changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'width: 100%' }, providers: [
8266
+ { provide: AXValidatableComponent, useExisting: AXNumberBoxComponent },
8267
+ ], template: "<div class=\"ax form-item\" [class.disabled]=\"disabled\" [attr.id]=\"uid\" #fc>\n <div class=\"ax items-wrapper\">\n <ng-content select=\"[start]\">\n </ng-content>\n <ax-button icon=\"far fa-plus\" type=\"success blank\" (click)=\"upStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n </div>\n <div class=\"content\" #content>\n <div class=\"ax form-control input {{size}}\" [class.disabled]=\"disabled\" [class.readonly]=\"readonly\"\n [class.icon]=\"icon\">\n <input [autocomplete]=\"autocomplete\" [name]=\"name\" #input type=\"text\" class=\"ax {{size}}\" [maxlength]=\"calcSeparator(maxLength)\" [(ngModel)]=\"textValue\" placeholder=\"{{placeholder}}\"\n [readonly]=\"readonly\" [disabled]=\"disabled\" [ngClass]=\"setTextAlign()\"\n [class.clear]=\"value && allowClear\" (focus)=\"handleInputFocus($event)\" (blur)=\"handleInputBlur($event)\"\n (keypress)=\"handleKeyPress($event)\" (ngModelChange)=\"this.userQuestionUpdate.next($event)\"\n (keydown)=\"handleKeyDown($event)\" (click)=\"handleClick()\" (keyup)=\"handleKeyUp($event)\">\n <i class=\"{{icon}}\" *ngIf=\"icon\"></i>\n </div>\n </div>\n <div class=\"ax items-wrapper\">\n <ax-button *ngIf=\"value && allowClear\" [disabled]=\"disabled\" icon=\"far fa-times\" type=\"danger blank\"\n (click)=\"clear()\"></ax-button>\n <ax-button icon=\"far fa-minus\" type=\"danger blank\" (click)=\"downStepHandel()\" [disabled]=\"disabled\" *ngIf=\"showDoubleCounter\"></ax-button>\n <ng-content select=\"[end]\">\n </ng-content>\n <div class=\"arrow-number\" *ngIf=\"showCounter && !showDoubleCounter && !readonly\" >\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-up\" [size]=\"size\"\n (mousedown)=\"upStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n <ax-button type=\"light blank\" [disabled]=\"disabled\" icon=\"fas fa-angle-down\" [size]=\"size\"\n (mousedown)=\"downStepHandel()\" (mouseup)=\"delaySearch()\" [tabIndex]=\"-1\"></ax-button>\n </div>\n </div>\n\n</div>\n" }]
8179
8268
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { min: [{
8180
8269
  type: Input
8181
8270
  }], max: [{
8182
8271
  type: Input
8183
- }], showSeparator: [{
8184
- type: Input
8185
8272
  }], showCurrency: [{
8186
8273
  type: Input
8187
8274
  }], showCounter: [{