@snabcentr/client-ui 0.2.16 → 0.2.19
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.
Potentially problematic release.
This version of @snabcentr/client-ui might be problematic. Click here for more details.
- package/esm2020/cart/cart-item-mobile/sc-cart-item-mobile.component.mjs +2 -2
- package/esm2020/catalog/price-card/sc-price-card.component.mjs +2 -2
- package/esm2020/icons/sc-client-ui-icons-name.mjs +2 -1
- package/esm2020/validators/stepValidator.mjs +4 -6
- package/fesm2015/snabcentr-client-ui.mjs +6 -7
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +6 -7
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/icons/svg-pack/scIconPlasticProfile.svg +2 -2
- package/icons/svg-pack/scIconSandwichPanels.svg +11 -0
- package/icons/svg-pack/scIconSiding.svg +1 -1
- package/icons/svg-pack/scIconSmile.svg +4 -4
- package/package.json +1 -1
- package/validators/stepValidator.d.ts +2 -2
@@ -335,14 +335,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
335
335
|
* Проверяет кратность значения.
|
336
336
|
*
|
337
337
|
* @param step Шаг кратности.
|
338
|
-
* @param
|
338
|
+
* @param precision Точность, количество чисел после запятой.
|
339
339
|
*/
|
340
|
-
function stepValidator(step,
|
340
|
+
function stepValidator(step, precision = 3) {
|
341
341
|
return ({ value }) => {
|
342
342
|
if (value) {
|
343
|
-
|
344
|
-
const closestMultiple = Math.round(controlValue / step) * step;
|
345
|
-
return Math.abs(controlValue - closestMultiple) > tolerance ? { error: `Число не кратно ${step}` } : null;
|
343
|
+
return Number((value / step).toFixed(precision)) % 1 !== 0 ? { error: `Число не кратно ${step}` } : null;
|
346
344
|
}
|
347
345
|
return null;
|
348
346
|
};
|
@@ -549,7 +547,7 @@ class ScCartItemMobileComponent {
|
|
549
547
|
/**
|
550
548
|
* {@link FormControl} поля ввода количества товара в корзине.
|
551
549
|
*/
|
552
|
-
this.quantityControl = new FormControl(0);
|
550
|
+
this.quantityControl = new FormControl(0, { updateOn: 'blur' });
|
553
551
|
/**
|
554
552
|
* {@link Observable} изменения количества товара в корзине.
|
555
553
|
*/
|
@@ -841,7 +839,7 @@ class ScPriceCardComponent {
|
|
841
839
|
/**
|
842
840
|
* {@link FormControl} поля ввода количества товара в корзине.
|
843
841
|
*/
|
844
|
-
this.quantityControl = new FormControl(null);
|
842
|
+
this.quantityControl = new FormControl(null, { updateOn: 'blur' });
|
845
843
|
/**
|
846
844
|
* {@link Observable} изменения количества товара в корзине.
|
847
845
|
*/
|
@@ -1632,6 +1630,7 @@ const scClientUiIconsName = [
|
|
1632
1630
|
'scIconWordFile',
|
1633
1631
|
'scIconWindowsill',
|
1634
1632
|
'scIconWarning',
|
1633
|
+
'scIconSandwichPanels',
|
1635
1634
|
'scIconWallet',
|
1636
1635
|
'scIconViewTree',
|
1637
1636
|
'scIconViewInline',
|