carbon-components-angular 5.47.2 → 5.48.0
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/docs/documentation/classes/NumberChange.html +34 -0
- package/docs/documentation/components/NumberComponent.html +48 -14
- package/docs/documentation/components/PaginationNav.html +262 -33
- package/docs/documentation/components/ProgressIndicator.html +2 -2
- package/docs/documentation/coverage.html +3 -3
- package/docs/documentation/interfaces/PaginationNavTranslations.html +20 -2
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/TagModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TagModule.html +4 -4
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TilesModule/dependencies.svg +98 -98
- package/docs/documentation/modules/TilesModule.html +98 -98
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +44 -40
- package/docs/documentation/modules/TimePickerModule.html +44 -40
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +38 -42
- package/docs/documentation/modules/TimePickerSelectModule.html +38 -42
- package/docs/documentation/modules/ToggleModule/dependencies.svg +17 -17
- package/docs/documentation/modules/ToggleModule.html +17 -17
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +37 -37
- package/docs/documentation/modules/ToggletipModule.html +37 -37
- package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TooltipModule.html +28 -28
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +36 -36
- package/docs/documentation/modules/TreeviewModule.html +36 -36
- package/docs/documentation.json +150 -78
- package/docs/storybook/{8341.2bf88948.iframe.bundle.js → 8341.d095fdee.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.css +3007 -2790
- package/docs/storybook/main.e6ee5d76.iframe.bundle.js +1 -0
- package/docs/storybook/{number-input-number-stories.6aba5a3d.iframe.bundle.js → number-input-number-stories.8d02c22f.iframe.bundle.js} +1 -1
- package/docs/storybook/pagination-pagination-nav-stories.7b305bf2.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.14d57f59.iframe.bundle.js → runtime~main.90978505.iframe.bundle.js} +1 -1
- package/esm2020/number-input/number.component.mjs +31 -1
- package/esm2020/pagination/pagination-nav/pagination-nav.component.mjs +32 -5
- package/esm2020/progress-indicator/progress-indicator.component.mjs +2 -2
- package/fesm2015/carbon-components-angular-number-input.mjs +30 -0
- package/fesm2015/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-pagination.mjs +31 -4
- package/fesm2015/carbon-components-angular-pagination.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-progress-indicator.mjs +1 -1
- package/fesm2015/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-number-input.mjs +30 -0
- package/fesm2020/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-pagination.mjs +31 -4
- package/fesm2020/carbon-components-angular-pagination.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-progress-indicator.mjs +1 -1
- package/fesm2020/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination/pagination-nav/pagination-nav.component.d.ts +8 -1
- package/progress-indicator/progress-indicator.component.d.ts +1 -1
- package/docs/storybook/main.ca52fea9.iframe.bundle.js +0 -1
- package/docs/storybook/pagination-pagination-nav-stories.ace8938b.iframe.bundle.js +0 -1
|
@@ -601,6 +601,23 @@ export class NumberComponent implements ControlValueAccessor {
|
|
|
601
601
|
* Adds `step` to the current `value`.
|
|
602
602
|
*/
|
|
603
603
|
onIncrement(): void {
|
|
604
|
+
// if max is set and value + step is greater than max, set value to max
|
|
605
|
+
// example: max = 100, step = 10, value = 95 , value + step = 105, value will be set to 100 (max) instead of 105
|
|
606
|
+
if (this.max !== null && this.value + this.step > this.max) {
|
|
607
|
+
this.value = this.max;
|
|
608
|
+
this.emitChangeEvent();
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// if min is set and value + step is less than min, set value to min
|
|
613
|
+
// example: min = 5, step = 2, value = 0, value + step = 2, value will be set to 5 (min) instead of 2
|
|
614
|
+
if (this.min !== null && this.value + this.step < this.min) {
|
|
615
|
+
this.value = this.min;
|
|
616
|
+
this.emitChangeEvent();
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// if max is not set or value + step is less than max, increment value by step
|
|
604
621
|
if (this.max === null || this.value + this.step <= this.max) {
|
|
605
622
|
this.value += this.step;
|
|
606
623
|
this.value = parseFloat(this.value.toPrecision(this.precision));
|
|
@@ -612,6 +629,23 @@ export class NumberComponent implements ControlValueAccessor {
|
|
|
612
629
|
* Subtracts `step` to the current `value`.
|
|
613
630
|
*/
|
|
614
631
|
onDecrement(): void {
|
|
632
|
+
// if max is set and value - step is greater than max, set value to max
|
|
633
|
+
// example: max = 15, step = 2, value = 20, value - step = 18, value will be set to 15 (max) instead of 18
|
|
634
|
+
if (this.max !== null && this.value - this.step > this.max) {
|
|
635
|
+
this.value = this.max;
|
|
636
|
+
this.emitChangeEvent();
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// if min is set and value - step is less than min, set value to min
|
|
641
|
+
// example: min = 5, step = 2, value = 6, value - step = 4, value will be set to 5 (min) instead of 4
|
|
642
|
+
if (this.min !== null && this.value - this.step < this.min) {
|
|
643
|
+
this.value = this.min;
|
|
644
|
+
this.emitChangeEvent();
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// if min is not set or value - step is greater than min, decrement value by step
|
|
615
649
|
if (this.min === null || this.value - this.step >= this.min) {
|
|
616
650
|
this.value -= this.step;
|
|
617
651
|
this.value = parseFloat(this.value.toPrecision(this.precision));
|
|
@@ -1504,8 +1504,8 @@
|
|
|
1504
1504
|
|
|
1505
1505
|
<tr>
|
|
1506
1506
|
<td class="col-md-4">
|
|
1507
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1508
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1507
|
+
<div class="io-line">Defined in <a href="" data-line="418"
|
|
1508
|
+
class="link-to-prism">src/number-input/number.component.ts:418</a></div>
|
|
1509
1509
|
</td>
|
|
1510
1510
|
</tr>
|
|
1511
1511
|
|
|
@@ -1589,8 +1589,8 @@
|
|
|
1589
1589
|
|
|
1590
1590
|
<tr>
|
|
1591
1591
|
<td class="col-md-4">
|
|
1592
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1593
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1592
|
+
<div class="io-line">Defined in <a href="" data-line="407"
|
|
1593
|
+
class="link-to-prism">src/number-input/number.component.ts:407</a></div>
|
|
1594
1594
|
</td>
|
|
1595
1595
|
</tr>
|
|
1596
1596
|
|
|
@@ -1626,8 +1626,8 @@
|
|
|
1626
1626
|
|
|
1627
1627
|
<tr>
|
|
1628
1628
|
<td class="col-md-4">
|
|
1629
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1630
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1629
|
+
<div class="io-line">Defined in <a href="" data-line="411"
|
|
1630
|
+
class="link-to-prism">src/number-input/number.component.ts:411</a></div>
|
|
1631
1631
|
</td>
|
|
1632
1632
|
</tr>
|
|
1633
1633
|
|
|
@@ -1663,8 +1663,8 @@
|
|
|
1663
1663
|
|
|
1664
1664
|
<tr>
|
|
1665
1665
|
<td class="col-md-4">
|
|
1666
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1667
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1666
|
+
<div class="io-line">Defined in <a href="" data-line="435"
|
|
1667
|
+
class="link-to-prism">src/number-input/number.component.ts:435</a></div>
|
|
1668
1668
|
</td>
|
|
1669
1669
|
</tr>
|
|
1670
1670
|
|
|
@@ -1732,8 +1732,8 @@
|
|
|
1732
1732
|
|
|
1733
1733
|
<tr>
|
|
1734
1734
|
<td class="col-md-4">
|
|
1735
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1736
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1735
|
+
<div class="io-line">Defined in <a href="" data-line="431"
|
|
1736
|
+
class="link-to-prism">src/number-input/number.component.ts:431</a></div>
|
|
1737
1737
|
</td>
|
|
1738
1738
|
</tr>
|
|
1739
1739
|
|
|
@@ -1795,8 +1795,8 @@
|
|
|
1795
1795
|
|
|
1796
1796
|
<tr>
|
|
1797
1797
|
<td class="col-md-4">
|
|
1798
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1799
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1798
|
+
<div class="io-line">Defined in <a href="" data-line="382"
|
|
1799
|
+
class="link-to-prism">src/number-input/number.component.ts:382</a></div>
|
|
1800
1800
|
</td>
|
|
1801
1801
|
</tr>
|
|
1802
1802
|
|
|
@@ -1873,8 +1873,8 @@
|
|
|
1873
1873
|
|
|
1874
1874
|
<tr>
|
|
1875
1875
|
<td class="col-md-4">
|
|
1876
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1877
|
-
class="link-to-prism">src/number-input/number.component.ts:
|
|
1876
|
+
<div class="io-line">Defined in <a href="" data-line="426"
|
|
1877
|
+
class="link-to-prism">src/number-input/number.component.ts:426</a></div>
|
|
1878
1878
|
</td>
|
|
1879
1879
|
</tr>
|
|
1880
1880
|
|
|
@@ -3139,6 +3139,23 @@ export class NumberComponent implements ControlValueAccessor {
|
|
|
3139
3139
|
* Adds `step` to the current `value`.
|
|
3140
3140
|
*/
|
|
3141
3141
|
onIncrement(): void {
|
|
3142
|
+
// if max is set and value + step is greater than max, set value to max
|
|
3143
|
+
// example: max = 100, step = 10, value = 95 , value + step = 105, value will be set to 100 (max) instead of 105
|
|
3144
|
+
if (this.max !== null && this.value + this.step > this.max) {
|
|
3145
|
+
this.value = this.max;
|
|
3146
|
+
this.emitChangeEvent();
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
// if min is set and value + step is less than min, set value to min
|
|
3151
|
+
// example: min = 5, step = 2, value = 0, value + step = 2, value will be set to 5 (min) instead of 2
|
|
3152
|
+
if (this.min !== null && this.value + this.step < this.min) {
|
|
3153
|
+
this.value = this.min;
|
|
3154
|
+
this.emitChangeEvent();
|
|
3155
|
+
return;
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
// if max is not set or value + step is less than max, increment value by step
|
|
3142
3159
|
if (this.max === null || this.value + this.step <= this.max) {
|
|
3143
3160
|
this.value += this.step;
|
|
3144
3161
|
this.value = parseFloat(this.value.toPrecision(this.precision));
|
|
@@ -3150,6 +3167,23 @@ export class NumberComponent implements ControlValueAccessor {
|
|
|
3150
3167
|
* Subtracts `step` to the current `value`.
|
|
3151
3168
|
*/
|
|
3152
3169
|
onDecrement(): void {
|
|
3170
|
+
// if max is set and value - step is greater than max, set value to max
|
|
3171
|
+
// example: max = 15, step = 2, value = 20, value - step = 18, value will be set to 15 (max) instead of 18
|
|
3172
|
+
if (this.max !== null && this.value - this.step > this.max) {
|
|
3173
|
+
this.value = this.max;
|
|
3174
|
+
this.emitChangeEvent();
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
// if min is set and value - step is less than min, set value to min
|
|
3179
|
+
// example: min = 5, step = 2, value = 6, value - step = 4, value will be set to 5 (min) instead of 4
|
|
3180
|
+
if (this.min !== null && this.value - this.step < this.min) {
|
|
3181
|
+
this.value = this.min;
|
|
3182
|
+
this.emitChangeEvent();
|
|
3183
|
+
return;
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
// if min is not set or value - step is greater than min, decrement value by step
|
|
3153
3187
|
if (this.min === null || this.value - this.step >= this.min) {
|
|
3154
3188
|
this.value -= this.step;
|
|
3155
3189
|
this.value = parseFloat(this.value.toPrecision(this.precision));
|