@redneckz/wildless-cms-uni-blocks 0.14.93 → 0.14.95

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.
Files changed (183) hide show
  1. package/bundle/bundle.umd.js +27 -32
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Calculator/CalculatorValueBlock.d.ts +4 -2
  4. package/bundle/components/Calculator/Rate.d.ts +2 -2
  5. package/bundle/components/Calculator/getDefaultValues.d.ts +0 -1
  6. package/bundle/components/Calculator/rangeHelpers.d.ts +0 -1
  7. package/bundle/components/Calculator/renderRate.d.ts +4 -9
  8. package/bundle/utils/toLocalNumberFormat.d.ts +3 -1
  9. package/dist/components/Calculator/CalculatorValueBlock.d.ts +4 -2
  10. package/dist/components/Calculator/CalculatorValueBlock.js +3 -1
  11. package/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
  12. package/dist/components/Calculator/Rate.d.ts +2 -2
  13. package/dist/components/Calculator/Rate.js +2 -1
  14. package/dist/components/Calculator/Rate.js.map +1 -1
  15. package/dist/components/Calculator/getDefaultValues.d.ts +0 -1
  16. package/dist/components/Calculator/getDefaultValues.js +1 -7
  17. package/dist/components/Calculator/getDefaultValues.js.map +1 -1
  18. package/dist/components/Calculator/rangeHelpers.d.ts +0 -1
  19. package/dist/components/Calculator/rangeHelpers.js +1 -4
  20. package/dist/components/Calculator/rangeHelpers.js.map +1 -1
  21. package/dist/components/Calculator/renderRate.d.ts +4 -9
  22. package/dist/components/Calculator/renderRate.js +1 -8
  23. package/dist/components/Calculator/renderRate.js.map +1 -1
  24. package/dist/components/ExchangeRateTile/renderInput.js +1 -1
  25. package/dist/ui-kit/Select/Select.js +1 -1
  26. package/dist/ui-kit/Select/Select.js.map +1 -1
  27. package/dist/utils/toLocalNumberFormat.d.ts +3 -1
  28. package/dist/utils/toLocalNumberFormat.js +2 -2
  29. package/dist/utils/toLocalNumberFormat.js.map +1 -1
  30. package/lib/common.css +1 -1
  31. package/lib/components/Calculator/CalculatorValueBlock.d.ts +4 -2
  32. package/lib/components/Calculator/CalculatorValueBlock.js +3 -1
  33. package/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
  34. package/lib/components/Calculator/Rate.d.ts +2 -2
  35. package/lib/components/Calculator/Rate.js +2 -1
  36. package/lib/components/Calculator/Rate.js.map +1 -1
  37. package/lib/components/Calculator/getDefaultValues.d.ts +0 -1
  38. package/lib/components/Calculator/getDefaultValues.js +1 -6
  39. package/lib/components/Calculator/getDefaultValues.js.map +1 -1
  40. package/lib/components/Calculator/rangeHelpers.d.ts +0 -1
  41. package/lib/components/Calculator/rangeHelpers.js +0 -2
  42. package/lib/components/Calculator/rangeHelpers.js.map +1 -1
  43. package/lib/components/Calculator/renderRate.d.ts +4 -9
  44. package/lib/components/Calculator/renderRate.js +1 -8
  45. package/lib/components/Calculator/renderRate.js.map +1 -1
  46. package/lib/components/ExchangeRateTile/renderInput.js +1 -1
  47. package/lib/ui-kit/Select/Select.js +1 -1
  48. package/lib/ui-kit/Select/Select.js.map +1 -1
  49. package/lib/utils/toLocalNumberFormat.d.ts +3 -1
  50. package/lib/utils/toLocalNumberFormat.js +2 -2
  51. package/lib/utils/toLocalNumberFormat.js.map +1 -1
  52. package/mobile/bundle/bundle.umd.js +27 -32
  53. package/mobile/bundle/bundle.umd.min.js +1 -1
  54. package/mobile/bundle/components/Calculator/CalculatorValueBlock.d.ts +4 -2
  55. package/mobile/bundle/components/Calculator/Rate.d.ts +2 -2
  56. package/mobile/bundle/components/Calculator/getDefaultValues.d.ts +0 -1
  57. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +0 -1
  58. package/mobile/bundle/components/Calculator/renderRate.d.ts +4 -9
  59. package/mobile/bundle/utils/toLocalNumberFormat.d.ts +3 -1
  60. package/mobile/dist/components/Calculator/CalculatorValueBlock.d.ts +4 -2
  61. package/mobile/dist/components/Calculator/CalculatorValueBlock.js +3 -1
  62. package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
  63. package/mobile/dist/components/Calculator/Rate.d.ts +2 -2
  64. package/mobile/dist/components/Calculator/Rate.js +2 -1
  65. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  66. package/mobile/dist/components/Calculator/getDefaultValues.d.ts +0 -1
  67. package/mobile/dist/components/Calculator/getDefaultValues.js +1 -7
  68. package/mobile/dist/components/Calculator/getDefaultValues.js.map +1 -1
  69. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +0 -1
  70. package/mobile/dist/components/Calculator/rangeHelpers.js +1 -4
  71. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
  72. package/mobile/dist/components/Calculator/renderRate.d.ts +4 -9
  73. package/mobile/dist/components/Calculator/renderRate.js +1 -8
  74. package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
  75. package/mobile/dist/components/ExchangeRateTile/renderInput.js +1 -1
  76. package/mobile/dist/ui-kit/Select/Select.js +1 -1
  77. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  78. package/mobile/dist/utils/toLocalNumberFormat.d.ts +3 -1
  79. package/mobile/dist/utils/toLocalNumberFormat.js +2 -2
  80. package/mobile/dist/utils/toLocalNumberFormat.js.map +1 -1
  81. package/mobile/lib/common.css +1 -1
  82. package/mobile/lib/components/Calculator/CalculatorValueBlock.d.ts +4 -2
  83. package/mobile/lib/components/Calculator/CalculatorValueBlock.js +3 -1
  84. package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
  85. package/mobile/lib/components/Calculator/Rate.d.ts +2 -2
  86. package/mobile/lib/components/Calculator/Rate.js +2 -1
  87. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  88. package/mobile/lib/components/Calculator/getDefaultValues.d.ts +0 -1
  89. package/mobile/lib/components/Calculator/getDefaultValues.js +1 -6
  90. package/mobile/lib/components/Calculator/getDefaultValues.js.map +1 -1
  91. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +0 -1
  92. package/mobile/lib/components/Calculator/rangeHelpers.js +0 -2
  93. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
  94. package/mobile/lib/components/Calculator/renderRate.d.ts +4 -9
  95. package/mobile/lib/components/Calculator/renderRate.js +1 -8
  96. package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
  97. package/mobile/lib/components/ExchangeRateTile/renderInput.js +1 -1
  98. package/mobile/lib/ui-kit/Select/Select.js +1 -1
  99. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  100. package/mobile/lib/utils/toLocalNumberFormat.d.ts +3 -1
  101. package/mobile/lib/utils/toLocalNumberFormat.js +2 -2
  102. package/mobile/lib/utils/toLocalNumberFormat.js.map +1 -1
  103. package/mobile/src/components/Calculator/CalculatorValueBlock.tsx +8 -4
  104. package/mobile/src/components/Calculator/Rate.tsx +5 -4
  105. package/mobile/src/components/Calculator/getDefaultValues.ts +0 -9
  106. package/mobile/src/components/Calculator/rangeHelpers.ts +0 -10
  107. package/mobile/src/components/Calculator/renderRate.tsx +23 -44
  108. package/mobile/src/components/ExchangeRateTile/renderInput.tsx +1 -1
  109. package/mobile/src/ui-kit/Select/Select.tsx +1 -1
  110. package/mobile/src/utils/toLocalNumberFormat.ts +2 -2
  111. package/package.json +1 -1
  112. package/src/components/Calculator/CalculatorValueBlock.tsx +8 -4
  113. package/src/components/Calculator/Rate.tsx +5 -4
  114. package/src/components/Calculator/getDefaultValues.ts +0 -9
  115. package/src/components/Calculator/rangeHelpers.ts +0 -10
  116. package/src/components/Calculator/renderRate.tsx +23 -44
  117. package/src/components/ExchangeRateTile/renderInput.tsx +1 -1
  118. package/src/ui-kit/Select/Select.tsx +1 -1
  119. package/src/utils/toLocalNumberFormat.ts +2 -2
  120. package/bundle/components/Calculator/getCreditRate.d.ts +0 -7
  121. package/bundle/components/Calculator/getDefaultMonths.d.ts +0 -1
  122. package/bundle/components/Calculator/renderInitialFeeInput.d.ts +0 -6
  123. package/bundle/components/Calculator/renderRealEstateValue.d.ts +0 -6
  124. package/dist/components/Calculator/getCreditRate.d.ts +0 -7
  125. package/dist/components/Calculator/getCreditRate.js +0 -14
  126. package/dist/components/Calculator/getCreditRate.js.map +0 -1
  127. package/dist/components/Calculator/getDefaultMonths.d.ts +0 -1
  128. package/dist/components/Calculator/getDefaultMonths.js +0 -5
  129. package/dist/components/Calculator/getDefaultMonths.js.map +0 -1
  130. package/dist/components/Calculator/renderInitialFeeInput.d.ts +0 -6
  131. package/dist/components/Calculator/renderInitialFeeInput.js +0 -19
  132. package/dist/components/Calculator/renderInitialFeeInput.js.map +0 -1
  133. package/dist/components/Calculator/renderRealEstateValue.d.ts +0 -6
  134. package/dist/components/Calculator/renderRealEstateValue.js +0 -16
  135. package/dist/components/Calculator/renderRealEstateValue.js.map +0 -1
  136. package/lib/components/Calculator/getCreditRate.d.ts +0 -7
  137. package/lib/components/Calculator/getCreditRate.js +0 -11
  138. package/lib/components/Calculator/getCreditRate.js.map +0 -1
  139. package/lib/components/Calculator/getDefaultMonths.d.ts +0 -1
  140. package/lib/components/Calculator/getDefaultMonths.js +0 -2
  141. package/lib/components/Calculator/getDefaultMonths.js.map +0 -1
  142. package/lib/components/Calculator/renderInitialFeeInput.d.ts +0 -6
  143. package/lib/components/Calculator/renderInitialFeeInput.js +0 -16
  144. package/lib/components/Calculator/renderInitialFeeInput.js.map +0 -1
  145. package/lib/components/Calculator/renderRealEstateValue.d.ts +0 -6
  146. package/lib/components/Calculator/renderRealEstateValue.js +0 -13
  147. package/lib/components/Calculator/renderRealEstateValue.js.map +0 -1
  148. package/mobile/bundle/components/Calculator/getCreditRate.d.ts +0 -7
  149. package/mobile/bundle/components/Calculator/getDefaultMonths.d.ts +0 -1
  150. package/mobile/bundle/components/Calculator/renderInitialFeeInput.d.ts +0 -6
  151. package/mobile/bundle/components/Calculator/renderRealEstateValue.d.ts +0 -6
  152. package/mobile/dist/components/Calculator/getCreditRate.d.ts +0 -7
  153. package/mobile/dist/components/Calculator/getCreditRate.js +0 -14
  154. package/mobile/dist/components/Calculator/getCreditRate.js.map +0 -1
  155. package/mobile/dist/components/Calculator/getDefaultMonths.d.ts +0 -1
  156. package/mobile/dist/components/Calculator/getDefaultMonths.js +0 -5
  157. package/mobile/dist/components/Calculator/getDefaultMonths.js.map +0 -1
  158. package/mobile/dist/components/Calculator/renderInitialFeeInput.d.ts +0 -6
  159. package/mobile/dist/components/Calculator/renderInitialFeeInput.js +0 -19
  160. package/mobile/dist/components/Calculator/renderInitialFeeInput.js.map +0 -1
  161. package/mobile/dist/components/Calculator/renderRealEstateValue.d.ts +0 -6
  162. package/mobile/dist/components/Calculator/renderRealEstateValue.js +0 -16
  163. package/mobile/dist/components/Calculator/renderRealEstateValue.js.map +0 -1
  164. package/mobile/lib/components/Calculator/getCreditRate.d.ts +0 -7
  165. package/mobile/lib/components/Calculator/getCreditRate.js +0 -11
  166. package/mobile/lib/components/Calculator/getCreditRate.js.map +0 -1
  167. package/mobile/lib/components/Calculator/getDefaultMonths.d.ts +0 -1
  168. package/mobile/lib/components/Calculator/getDefaultMonths.js +0 -2
  169. package/mobile/lib/components/Calculator/getDefaultMonths.js.map +0 -1
  170. package/mobile/lib/components/Calculator/renderInitialFeeInput.d.ts +0 -6
  171. package/mobile/lib/components/Calculator/renderInitialFeeInput.js +0 -16
  172. package/mobile/lib/components/Calculator/renderInitialFeeInput.js.map +0 -1
  173. package/mobile/lib/components/Calculator/renderRealEstateValue.d.ts +0 -6
  174. package/mobile/lib/components/Calculator/renderRealEstateValue.js +0 -13
  175. package/mobile/lib/components/Calculator/renderRealEstateValue.js.map +0 -1
  176. package/mobile/src/components/Calculator/getCreditRate.ts +0 -20
  177. package/mobile/src/components/Calculator/getDefaultMonths.ts +0 -2
  178. package/mobile/src/components/Calculator/renderInitialFeeInput.tsx +0 -36
  179. package/mobile/src/components/Calculator/renderRealEstateValue.tsx +0 -33
  180. package/src/components/Calculator/getCreditRate.ts +0 -20
  181. package/src/components/Calculator/getDefaultMonths.ts +0 -2
  182. package/src/components/Calculator/renderInitialFeeInput.tsx +0 -36
  183. package/src/components/Calculator/renderRealEstateValue.tsx +0 -33
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { Text } from '../../ui-kit/Text/Text.js';
4
- export const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, fractionDigits = 2 }) => (_jsxs("div", { children: [_jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex justify-start gradient-color-text", children: [_jsx("span", { className: "font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]", children: String(rate.toFixed(fractionDigits)).replace('.', ',') }), unit ? _jsx("span", { className: "text-7xl", children: unit }) : null] }), depositeName && isShowDepositeName ? (_jsx("div", { className: "absolute bottom-2 w-full text-left whitespace-nowrap", children: depositeName })) : null] })] })));
4
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat.js';
5
+ export const Rate = JSX(({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName }) => (_jsxs("div", { children: [_jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex justify-start gradient-color-text", children: [_jsx("span", { className: "font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]", children: toLocalNumberFormat(fractionDigits, { fixed: true })(rate) }), unit ? _jsx("span", { className: "text-7xl", children: unit }) : null] }), depositeName && isShowDepositeName ? (_jsx("div", { className: "absolute bottom-2 w-full text-left whitespace-nowrap", children: depositeName })) : null] })] })));
5
6
  //# sourceMappingURL=Rate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Rate.js","sourceRoot":"","sources":["../../../src/components/Calculator/Rate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IA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AAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,YAAY,EAAC,KAAK,EAAC,qBAAqB,YAC9D,KAAK,GACD,EACP,eAAK,SAAS,EAAC,UAAU,aACvB,eAAK,SAAS,EAAC,wCAAwC,aACrD,eAAM,SAAS,EAAC,0DAA0D,YACvE,mBAAmB,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GACtD,EACN,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,UAAU,YAAE,IAAI,GAAQ,CAAC,CAAC,CAAC,IAAI,IACnD,EACL,YAAY,IAAI,kBAAkB,CAAC,CAAC,CAAC,CACpC,cAAK,SAAS,EAAC,sDAAsD,YAAE,YAAY,GAAO,CAC3F,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,CACP,CACF,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import type { CommonDefaultParams } from './CalculatorContent';
2
2
  export declare const getMoneyDefaultValue: (defaultParams?: CommonDefaultParams, defaultMoney?: number) => number;
3
3
  export declare const getMonthsDefaultValue: (defaultParams?: CommonDefaultParams, defaultMonth?: number) => number;
4
- export declare const getDaysDefaultValue: (defaultParams?: CommonDefaultParams, defaultDays?: number) => number;
@@ -1,4 +1,4 @@
1
- import { BUSINESS_MAX_DAYS, BUSINESS_MIN_DAYS, DEFAULT_MAX_MONTHS, DEFAULT_MAX_SUM, DEFAULT_MIN_MONTHS, DEFAULT_MIN_SUM, } from './constants.js';
1
+ import { DEFAULT_MAX_MONTHS, DEFAULT_MAX_SUM, DEFAULT_MIN_MONTHS, DEFAULT_MIN_SUM, } from './constants.js';
2
2
  export const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum && defaultParams.sum >= DEFAULT_MIN_SUM && defaultParams.sum <= DEFAULT_MAX_SUM
3
3
  ? defaultParams.sum
4
4
  : defaultMoney;
@@ -7,9 +7,4 @@ export const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaul
7
7
  defaultParams.period <= DEFAULT_MAX_MONTHS
8
8
  ? defaultParams.period
9
9
  : defaultMonth;
10
- export const getDaysDefaultValue = (defaultParams, defaultDays = 0) => defaultParams?.period &&
11
- defaultParams.period >= BUSINESS_MIN_DAYS &&
12
- defaultParams.period <= BUSINESS_MAX_DAYS
13
- ? defaultParams.period
14
- : defaultDays;
15
10
  //# sourceMappingURL=getDefaultValues.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultValues.js","sourceRoot":"","sources":["../../../src/components/Calculator/getDefaultValues.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,aAAmC,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,CAC5F,aAAa,EAAE,GAAG,IAAI,aAAa,CAAC,GAAG,IAAI,eAAe,IAAI,aAAa,CAAC,GAAG,IAAI,eAAe;IAChG,CAAC,CAAC,aAAa,CAAC,GAAG;IACnB,CAAC,CAAC,YAAY,CAAC;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,aAAmC,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,CAC7F,aAAa,EAAE,MAAM;IACrB,aAAa,CAAC,MAAM,IAAI,kBAAkB;IAC1C,aAAa,CAAC,MAAM,IAAI,kBAAkB;IACxC,CAAC,CAAC,aAAa,CAAC,MAAM;IACtB,CAAC,CAAC,YAAY,CAAC;AAEnB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,aAAmC,EAAE,WAAW,GAAG,CAAC,EAAE,EAAE,CAC1F,aAAa,EAAE,MAAM;IACrB,aAAa,CAAC,MAAM,IAAI,iBAAiB;IACzC,aAAa,CAAC,MAAM,IAAI,iBAAiB;IACvC,CAAC,CAAC,aAAa,CAAC,MAAM;IACtB,CAAC,CAAC,WAAW,CAAC"}
1
+ {"version":3,"file":"getDefaultValues.js","sourceRoot":"","sources":["../../../src/components/Calculator/getDefaultValues.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,aAAmC,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,CAC5F,aAAa,EAAE,GAAG,IAAI,aAAa,CAAC,GAAG,IAAI,eAAe,IAAI,aAAa,CAAC,GAAG,IAAI,eAAe;IAChG,CAAC,CAAC,aAAa,CAAC,GAAG;IACnB,CAAC,CAAC,YAAY,CAAC;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,aAAmC,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,CAC7F,aAAa,EAAE,MAAM;IACrB,aAAa,CAAC,MAAM,IAAI,kBAAkB;IAC1C,aAAa,CAAC,MAAM,IAAI,kBAAkB;IACxC,CAAC,CAAC,aAAa,CAAC,MAAM;IACtB,CAAC,CAAC,YAAY,CAAC"}
@@ -4,5 +4,4 @@ export declare const getLimitRangeByKeys: <MinKey extends string, MaxKey extends
4
4
  export declare const getRangeByKeys: <MinKey extends string, MaxKey extends string, T extends Record<MinKey | MaxKey, number>>([minKey, maxKey]: [MinKey, MaxKey], rows?: T[]) => {
5
5
  [x: string]: number;
6
6
  };
7
- export declare const getMergeRangesByKeys: <MinKey extends string, MaxKey extends string, T extends Record<MinKey | MaxKey, number>>([minKey, maxKey]: [MinKey, MaxKey], rows?: T[]) => number[][];
8
7
  export declare const checkRangeByKeys: <MinKey extends string, MaxKey extends string, T extends Record<MinKey | MaxKey, number>>(value: number, [minKey, maxKey]: [MinKey, MaxKey], sourceBookRow: T) => boolean;
@@ -1,5 +1,4 @@
1
1
  import { max } from '../../utils/maxBy.js';
2
- import { mergeIntervals } from '../../utils/mergeIntervals.js';
3
2
  import { min } from '../../utils/minBy.js';
4
3
  export const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
5
4
  ? {
@@ -15,6 +14,5 @@ export const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
15
14
  ? max(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[maxKey]))
16
15
  : 0,
17
16
  });
18
- export const getMergeRangesByKeys = ([minKey, maxKey], rows = []) => mergeIntervals(rows.map((row) => [row[minKey], row[maxKey]]));
19
17
  export const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
20
18
  //# sourceMappingURL=rangeHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rangeHelpers.js","sourceRoot":"","sources":["../../../src/components/Calculator/rangeHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAKjC,CAAC,MAAM,EAAE,MAAM,CAAmB,EAClC,WAAe,EACf,WAAgB,EAAE,EAClB,EAAE,CACF,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC;IACvD,CAAC,CAAC;QACE,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;QAC7B,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;KAC9B;IACH,CAAC,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAK5B,CAAC,MAAM,EAAE,MAAM,CAAmB,EAClC,OAAY,EAAE,EACd,EAAE,CAAC,CAAC;IACJ,CAAC,M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EAAE,CAAC,KAAK,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC"}
@@ -1,13 +1,8 @@
1
1
  /// <reference types="react" />
2
- interface RenderRateProps {
3
- rate: number;
4
- depositeName?: string;
5
- isUnavailableByTerm?: boolean;
6
- isShowDepositeName?: boolean;
7
- fractionDigits?: number;
2
+ import { type RateProps } from './Rate';
3
+ import { type UnknownRateProps } from './UnknownRate';
4
+ interface RenderRateProps extends RateProps, UnknownRateProps {
8
5
  isUnknownRateShown?: boolean;
9
- title?: string;
10
- unit?: string;
11
6
  }
12
- export declare const renderRate: ({ isUnknownRateShown, isUnavailableByTerm, title, unit, rate, ...rest }: RenderRateProps) => JSX.Element;
7
+ export declare const renderRate: ({ title, rate, unit, fractionDigits, isUnknownRateShown, ...rest }: RenderRateProps) => JSX.Element;
13
8
  export {};
@@ -2,12 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { CalculatorValueBlock } from './CalculatorValueBlock.js';
3
3
  import { Rate } from './Rate.js';
4
4
  import { UnknownRate } from './UnknownRate.js';
5
- const renderDesktopRate = ({ rate, depositeName, fractionDigits, isShowDepositeName, title, unit, }) => (_jsx(Rate, { rate: rate, depositeName: depositeName, fractionDigits: fractionDigits, isShowDepositeName: isShowDepositeName, unit: unit, title: title }));
6
- const renderMobileRate = ({ rate, title, unit }) => (_jsx(CalculatorValueBlock, { title: title, value: rate, postfix: unit }));
7
- export const renderRate = ({ isUnknownRateShown = true, isUnavailableByTerm = false, title = 'Ставка', unit = '%', rate = 0, ...rest }) => {
8
- if (isUnknownRateShown && rate === 0) {
9
- return _jsx(UnknownRate, { isUnavailableByTerm: isUnavailableByTerm, title: title });
10
- }
11
- return (_jsxs("div", { children: [_jsx("div", { className: "hidden @xl:block", children: renderDesktopRate({ title, unit, rate, ...rest }) }), _jsx("div", { className: "@xl:hidden", children: renderMobileRate({ title, unit, rate, ...rest }) })] }));
12
- };
5
+ export const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, isUnknownRateShown = true, ...rest }) => isUnknownRateShown && rate === 0 ? (_jsx(UnknownRate, { title: title, ...rest })) : (_jsxs("div", { children: [_jsx("div", { className: "hidden @xl:block", children: _jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, ...rest }) }), _jsx("div", { className: "@xl:hidden", children: _jsx(CalculatorValueBlock, { title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, ...rest }) })] }));
13
6
  //# sourceMappingURL=renderRate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderRate.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderRate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAa5C,MAAM,iBAAiB,GAAG,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,IAAI,GACY,EAAE,EAAE,CAAC,CACrB,KAAC,IAAI,IACH,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAmB,EAAE,EAAE,CAAC,CACnE,KAAC,oBAAoB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAI,CACnE,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,kBAAkB,GAAG,IAAI,EACzB,mBAAmB,G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I,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,KAAM,IAAI,GAAI,GACpF,EACN,cAAK,SAAS,EAAC,YAAY,YACzB,KAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,IAAI,EACb,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,IAAI,KACP,IAAI,GACR,GACE,IACF,CACP,CAAC"}
@@ -8,6 +8,6 @@ export function renderInput(props) {
8
8
  text: _?.currency?.currency ?? '',
9
9
  }));
10
10
  const selectedValue = { key: selected, text: selected };
11
- return (_jsxs("div", { className: "relative flex", children: [_jsx(Input, { className: "shrink-0 text-l w-full appearance-none -mr-24", placeholder: placeholder, type: "text", value: value, onChange: setValue }), ratesOptions.length ? (_jsx(Select, { isBorder: false, onChange: (_) => setSelected(_.key), options: ratesOptions, value: selectedValue })) : null] }));
11
+ return (_jsxs("div", { className: "relative flex", children: [_jsx(Input, { className: "shrink-0 text-l w-full appearance-none -mr-20", placeholder: placeholder, type: "text", value: value, onChange: setValue }), ratesOptions.length ? (_jsx(Select, { isBorder: false, onChange: (_) => setSelected(_.key), options: ratesOptions, value: selectedValue })) : null] }));
12
12
  }
13
13
  //# sourceMappingURL=renderInput.js.map
@@ -24,7 +24,7 @@ export const Select = JSX(({ className, label, options = [], value, valid = true
24
24
  onClose: handleClose,
25
25
  iconVersion,
26
26
  });
27
- return (_jsxs("div", { className: className, children: [renderLabel(label), _jsxs("div", { className: style('relative', isOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [_jsxs("div", { className: style('h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10', getBorderStyle(isBorder, valid)), onClick: isOpen ? handleClose : open, children: [_jsx("p", { className: "p-m pr-3xl flex items-center overflow-hidden text-ellipsis whitespace-nowrap", children: formatOption(value) || placeholder }), renderIcon(isOpen, iconVersion)] }), isSearch && isOpen ? (_jsx("div", { className: style('absolute top-0 w-full z-20'), children: _jsx(Input, { type: "text", autoFocus: true, value: query, onChange: setQuery }) })) : null] })] }));
27
+ return (_jsxs("div", { className: className, children: [renderLabel(label), _jsxs("div", { className: style('relative', isOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [_jsxs("div", { className: style('h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10', getBorderStyle(isBorder, valid)), onClick: isOpen ? handleClose : open, children: [_jsx("p", { className: "p-m pr-8 flex items-center overflow-hidden text-ellipsis whitespace-nowrap", children: formatOption(value) || placeholder }), renderIcon(isOpen, iconVersion)] }), isSearch && isOpen ? (_jsx("div", { className: style('absolute top-0 w-full z-20'), children: _jsx(Input, { type: "text", autoFocus: true, value: query, onChange: setQuery }) })) : null] })] }));
28
28
  });
29
29
  const renderLabel = (label) => label ? (_jsx("div", { className: "mb-xs", children: _jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null;
30
30
  const renderIcon = (isOpen, iconVersion) => (_jsx(Icon, { className: style('absolute right-3', isOpen ? '' : 'rotate-180'), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,E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H,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAiB,EAAE,KAAc,EAAE,EAAE,CAC3D,KAAK,CACH,QAAQ,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,EAAE,EAC9D,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CACxC,CAAC"}
@@ -1 +1,3 @@
1
- export declare const toLocalNumberFormat: (fractionDigits?: number) => (_?: string | number | undefined) => string;
1
+ export declare const toLocalNumberFormat: (fractionDigits?: number, { fixed }?: {
2
+ fixed?: boolean | undefined;
3
+ }) => (_?: string | number | undefined) => string;
@@ -1,5 +1,5 @@
1
- export const toLocalNumberFormat = (fractionDigits = 0) => (_ = 0) => new Intl.NumberFormat('ru-RU', {
2
- minimumFractionDigits: 0,
1
+ export const toLocalNumberFormat = (fractionDigits = 0, { fixed } = {}) => (_ = 0) => new Intl.NumberFormat('ru-RU', {
2
+ minimumFractionDigits: fixed ? fractionDigits : 0,
3
3
  maximumFractionDigits: fractionDigits,
4
4
  }).format(Number(_) || 0);
5
5
  //# sourceMappingURL=toLocalNumberFormat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toLocalNumberFormat.js","sourceRoot":"","sources":["../../src/utils/toLocalNumberFormat.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAC9B,CAAC,cAAc,GAAG,CAAC,EAAE,EAAE,CACvB,CAAC,IAAiC,CAAC,EAAU,EAAE,CAC7C,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC7B,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,cAAc;CACtC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"toLocalNumberFormat.js","sourceRoot":"","sources":["../../src/utils/toLocalNumberFormat.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAC9B,CAAC,cAAc,GAAG,CAAC,EAAE,EAAE,KAAK,KAA0B,EAAE,EAAE,EAAE,CAC5D,CAAC,IAAiC,CAAC,EAAU,EAAE,CAC7C,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC7B,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACjD,qBAAqB,EAAE,cAAc;CACtC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC"}
@@ -6,15 +6,17 @@ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
6
6
  const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
7
7
 
8
8
  export interface CalculatorValueBlockProps {
9
+ className?: string;
9
10
  title?: string;
10
11
  value?: number;
11
- postfix?: string;
12
+ fractionDigits?: number;
13
+ fixed?: boolean;
12
14
  prefix?: string;
13
- className?: string;
15
+ postfix?: string;
14
16
  }
15
17
 
16
18
  export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
17
- ({ title, value, postfix = '', prefix, className = '' }) => (
19
+ ({ className, title, value, fractionDigits, fixed, prefix, postfix }) => (
18
20
  <div className={style(calculatorValueBlockStyle, className)}>
19
21
  {title ? (
20
22
  <Text size="text-l" font="font-light" color="text-secondary-text">
@@ -24,7 +26,9 @@ export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
24
26
  {value ? (
25
27
  <div>
26
28
  <Text size="text-h3">
27
- {prefix} {toLocalNumberFormat(2)(Math.round(value))} {postfix}
29
+ {[prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
30
+ .filter(Boolean)
31
+ .join(' ')}
28
32
  </Text>
29
33
  </div>
30
34
  ) : (
@@ -1,17 +1,18 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { Text } from '../../ui-kit/Text/Text';
3
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
3
4
 
4
5
  export interface RateProps {
5
- rate: number;
6
+ rate: number | undefined;
6
7
  title?: string;
7
8
  unit?: string;
9
+ fractionDigits?: number;
8
10
  depositeName?: string;
9
11
  isShowDepositeName?: boolean;
10
- fractionDigits?: number;
11
12
  }
12
13
 
13
14
  export const Rate = JSX<RateProps>(
14
- ({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, fractionDigits = 2 }) => (
15
+ ({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName }) => (
15
16
  <div>
16
17
  <Text size="text-l" font="font-light" color="text-secondary-text">
17
18
  {title}
@@ -19,7 +20,7 @@ export const Rate = JSX<RateProps>(
19
20
  <div className="relative">
20
21
  <div className="flex justify-start gradient-color-text">
21
22
  <span className="font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]">
22
- {String(rate.toFixed(fractionDigits)).replace('.', ',')}
23
+ {toLocalNumberFormat(fractionDigits, { fixed: true })(rate)}
23
24
  </span>
24
25
  {unit ? <span className="text-7xl">{unit}</span> : null}
25
26
  </div>
@@ -1,7 +1,5 @@
1
1
  import type { CommonDefaultParams } from './CalculatorContent';
2
2
  import {
3
- BUSINESS_MAX_DAYS,
4
- BUSINESS_MIN_DAYS,
5
3
  DEFAULT_MAX_MONTHS,
6
4
  DEFAULT_MAX_SUM,
7
5
  DEFAULT_MIN_MONTHS,
@@ -19,10 +17,3 @@ export const getMonthsDefaultValue = (defaultParams?: CommonDefaultParams, defau
19
17
  defaultParams.period <= DEFAULT_MAX_MONTHS
20
18
  ? defaultParams.period
21
19
  : defaultMonth;
22
-
23
- export const getDaysDefaultValue = (defaultParams?: CommonDefaultParams, defaultDays = 0) =>
24
- defaultParams?.period &&
25
- defaultParams.period >= BUSINESS_MIN_DAYS &&
26
- defaultParams.period <= BUSINESS_MAX_DAYS
27
- ? defaultParams.period
28
- : defaultDays;
@@ -1,5 +1,4 @@
1
1
  import { max } from '../../utils/maxBy';
2
- import { mergeIntervals } from '../../utils/mergeIntervals';
3
2
  import { min } from '../../utils/minBy';
4
3
 
5
4
  export const getLimitRangeByKeys = <
@@ -34,15 +33,6 @@ export const getRangeByKeys = <
34
33
  : 0,
35
34
  });
36
35
 
37
- export const getMergeRangesByKeys = <
38
- MinKey extends string,
39
- MaxKey extends string,
40
- T extends Record<MinKey | MaxKey, number>,
41
- >(
42
- [minKey, maxKey]: [MinKey, MaxKey],
43
- rows: T[] = [],
44
- ) => mergeIntervals(rows.map((row) => [row[minKey], row[maxKey]]));
45
-
46
36
  export const checkRangeByKeys = <
47
37
  MinKey extends string,
48
38
  MaxKey extends string,
@@ -1,56 +1,35 @@
1
1
  import { CalculatorValueBlock } from './CalculatorValueBlock';
2
- import { Rate } from './Rate';
3
- import { UnknownRate } from './UnknownRate';
2
+ import { Rate, type RateProps } from './Rate';
3
+ import { UnknownRate, type UnknownRateProps } from './UnknownRate';
4
4
 
5
- interface RenderRateProps {
6
- rate: number;
7
- depositeName?: string;
8
- isUnavailableByTerm?: boolean;
9
- isShowDepositeName?: boolean;
10
- fractionDigits?: number;
5
+ interface RenderRateProps extends RateProps, UnknownRateProps {
11
6
  isUnknownRateShown?: boolean;
12
- title?: string;
13
- unit?: string;
14
7
  }
15
8
 
16
- const renderDesktopRate = ({
17
- rate,
18
- depositeName,
19
- fractionDigits,
20
- isShowDepositeName,
21
- title,
22
- unit,
23
- }: RenderRateProps) => (
24
- <Rate
25
- rate={rate}
26
- depositeName={depositeName}
27
- fractionDigits={fractionDigits}
28
- isShowDepositeName={isShowDepositeName}
29
- unit={unit}
30
- title={title}
31
- />
32
- );
33
-
34
- const renderMobileRate = ({ rate, title, unit }: RenderRateProps) => (
35
- <CalculatorValueBlock title={title} value={rate} postfix={unit} />
36
- );
37
-
38
9
  export const renderRate = ({
39
- isUnknownRateShown = true,
40
- isUnavailableByTerm = false,
41
10
  title = 'Ставка',
42
- unit = '%',
43
11
  rate = 0,
12
+ unit = '%',
13
+ fractionDigits = 2,
14
+ isUnknownRateShown = true,
44
15
  ...rest
45
- }: RenderRateProps) => {
46
- if (isUnknownRateShown && rate === 0) {
47
- return <UnknownRate isUnavailableByTerm={isUnavailableByTerm} title={title} />;
48
- }
49
-
50
- return (
16
+ }: RenderRateProps) =>
17
+ isUnknownRateShown && rate === 0 ? (
18
+ <UnknownRate title={title} {...rest} />
19
+ ) : (
51
20
  <div>
52
- <div className="hidden @xl:block">{renderDesktopRate({ title, unit, rate, ...rest })}</div>
53
- <div className="@xl:hidden">{renderMobileRate({ title, unit, rate, ...rest })}</div>
21
+ <div className="hidden @xl:block">
22
+ <Rate title={title} rate={rate} unit={unit} fractionDigits={fractionDigits} {...rest} />
23
+ </div>
24
+ <div className="@xl:hidden">
25
+ <CalculatorValueBlock
26
+ title={title}
27
+ value={rate}
28
+ postfix={unit}
29
+ fractionDigits={fractionDigits}
30
+ fixed={true}
31
+ {...rest}
32
+ />
33
+ </div>
54
34
  </div>
55
35
  );
56
- };
@@ -24,7 +24,7 @@ export function renderInput(props: InputProps) {
24
24
  return (
25
25
  <div className="relative flex">
26
26
  <Input
27
- className="shrink-0 text-l w-full appearance-none -mr-24"
27
+ className="shrink-0 text-l w-full appearance-none -mr-20"
28
28
  placeholder={placeholder}
29
29
  type="text"
30
30
  value={value}
@@ -65,7 +65,7 @@ export const Select = JSX<SelectProps>(
65
65
  )}
66
66
  onClick={isOpen ? handleClose : open}
67
67
  >
68
- <p className="p-m pr-3xl flex items-center overflow-hidden text-ellipsis whitespace-nowrap">
68
+ <p className="p-m pr-8 flex items-center overflow-hidden text-ellipsis whitespace-nowrap">
69
69
  {formatOption(value) || placeholder}
70
70
  </p>
71
71
  {renderIcon(isOpen, iconVersion)}
@@ -1,7 +1,7 @@
1
1
  export const toLocalNumberFormat =
2
- (fractionDigits = 0) =>
2
+ (fractionDigits = 0, { fixed }: { fixed?: boolean } = {}) =>
3
3
  (_: string | number | undefined = 0): string =>
4
4
  new Intl.NumberFormat('ru-RU', {
5
- minimumFractionDigits: 0,
5
+ minimumFractionDigits: fixed ? fractionDigits : 0,
6
6
  maximumFractionDigits: fractionDigits,
7
7
  }).format(Number(_) || 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.93",
3
+ "version": "0.14.95",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -6,15 +6,17 @@ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
6
6
  const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
7
7
 
8
8
  export interface CalculatorValueBlockProps {
9
+ className?: string;
9
10
  title?: string;
10
11
  value?: number;
11
- postfix?: string;
12
+ fractionDigits?: number;
13
+ fixed?: boolean;
12
14
  prefix?: string;
13
- className?: string;
15
+ postfix?: string;
14
16
  }
15
17
 
16
18
  export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
17
- ({ title, value, postfix = '', prefix, className = '' }) => (
19
+ ({ className, title, value, fractionDigits, fixed, prefix, postfix }) => (
18
20
  <div className={style(calculatorValueBlockStyle, className)}>
19
21
  {title ? (
20
22
  <Text size="text-l" font="font-light" color="text-secondary-text">
@@ -24,7 +26,9 @@ export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
24
26
  {value ? (
25
27
  <div>
26
28
  <Text size="text-h3">
27
- {prefix} {toLocalNumberFormat(2)(Math.round(value))} {postfix}
29
+ {[prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
30
+ .filter(Boolean)
31
+ .join(' ')}
28
32
  </Text>
29
33
  </div>
30
34
  ) : (
@@ -1,17 +1,18 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { Text } from '../../ui-kit/Text/Text';
3
+ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
3
4
 
4
5
  export interface RateProps {
5
- rate: number;
6
+ rate: number | undefined;
6
7
  title?: string;
7
8
  unit?: string;
9
+ fractionDigits?: number;
8
10
  depositeName?: string;
9
11
  isShowDepositeName?: boolean;
10
- fractionDigits?: number;
11
12
  }
12
13
 
13
14
  export const Rate = JSX<RateProps>(
14
- ({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, fractionDigits = 2 }) => (
15
+ ({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName }) => (
15
16
  <div>
16
17
  <Text size="text-l" font="font-light" color="text-secondary-text">
17
18
  {title}
@@ -19,7 +20,7 @@ export const Rate = JSX<RateProps>(
19
20
  <div className="relative">
20
21
  <div className="flex justify-start gradient-color-text">
21
22
  <span className="font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]">
22
- {String(rate.toFixed(fractionDigits)).replace('.', ',')}
23
+ {toLocalNumberFormat(fractionDigits, { fixed: true })(rate)}
23
24
  </span>
24
25
  {unit ? <span className="text-7xl">{unit}</span> : null}
25
26
  </div>
@@ -1,7 +1,5 @@
1
1
  import type { CommonDefaultParams } from './CalculatorContent';
2
2
  import {
3
- BUSINESS_MAX_DAYS,
4
- BUSINESS_MIN_DAYS,
5
3
  DEFAULT_MAX_MONTHS,
6
4
  DEFAULT_MAX_SUM,
7
5
  DEFAULT_MIN_MONTHS,
@@ -19,10 +17,3 @@ export const getMonthsDefaultValue = (defaultParams?: CommonDefaultParams, defau
19
17
  defaultParams.period <= DEFAULT_MAX_MONTHS
20
18
  ? defaultParams.period
21
19
  : defaultMonth;
22
-
23
- export const getDaysDefaultValue = (defaultParams?: CommonDefaultParams, defaultDays = 0) =>
24
- defaultParams?.period &&
25
- defaultParams.period >= BUSINESS_MIN_DAYS &&
26
- defaultParams.period <= BUSINESS_MAX_DAYS
27
- ? defaultParams.period
28
- : defaultDays;
@@ -1,5 +1,4 @@
1
1
  import { max } from '../../utils/maxBy';
2
- import { mergeIntervals } from '../../utils/mergeIntervals';
3
2
  import { min } from '../../utils/minBy';
4
3
 
5
4
  export const getLimitRangeByKeys = <
@@ -34,15 +33,6 @@ export const getRangeByKeys = <
34
33
  : 0,
35
34
  });
36
35
 
37
- export const getMergeRangesByKeys = <
38
- MinKey extends string,
39
- MaxKey extends string,
40
- T extends Record<MinKey | MaxKey, number>,
41
- >(
42
- [minKey, maxKey]: [MinKey, MaxKey],
43
- rows: T[] = [],
44
- ) => mergeIntervals(rows.map((row) => [row[minKey], row[maxKey]]));
45
-
46
36
  export const checkRangeByKeys = <
47
37
  MinKey extends string,
48
38
  MaxKey extends string,
@@ -1,56 +1,35 @@
1
1
  import { CalculatorValueBlock } from './CalculatorValueBlock';
2
- import { Rate } from './Rate';
3
- import { UnknownRate } from './UnknownRate';
2
+ import { Rate, type RateProps } from './Rate';
3
+ import { UnknownRate, type UnknownRateProps } from './UnknownRate';
4
4
 
5
- interface RenderRateProps {
6
- rate: number;
7
- depositeName?: string;
8
- isUnavailableByTerm?: boolean;
9
- isShowDepositeName?: boolean;
10
- fractionDigits?: number;
5
+ interface RenderRateProps extends RateProps, UnknownRateProps {
11
6
  isUnknownRateShown?: boolean;
12
- title?: string;
13
- unit?: string;
14
7
  }
15
8
 
16
- const renderDesktopRate = ({
17
- rate,
18
- depositeName,
19
- fractionDigits,
20
- isShowDepositeName,
21
- title,
22
- unit,
23
- }: RenderRateProps) => (
24
- <Rate
25
- rate={rate}
26
- depositeName={depositeName}
27
- fractionDigits={fractionDigits}
28
- isShowDepositeName={isShowDepositeName}
29
- unit={unit}
30
- title={title}
31
- />
32
- );
33
-
34
- const renderMobileRate = ({ rate, title, unit }: RenderRateProps) => (
35
- <CalculatorValueBlock title={title} value={rate} postfix={unit} />
36
- );
37
-
38
9
  export const renderRate = ({
39
- isUnknownRateShown = true,
40
- isUnavailableByTerm = false,
41
10
  title = 'Ставка',
42
- unit = '%',
43
11
  rate = 0,
12
+ unit = '%',
13
+ fractionDigits = 2,
14
+ isUnknownRateShown = true,
44
15
  ...rest
45
- }: RenderRateProps) => {
46
- if (isUnknownRateShown && rate === 0) {
47
- return <UnknownRate isUnavailableByTerm={isUnavailableByTerm} title={title} />;
48
- }
49
-
50
- return (
16
+ }: RenderRateProps) =>
17
+ isUnknownRateShown && rate === 0 ? (
18
+ <UnknownRate title={title} {...rest} />
19
+ ) : (
51
20
  <div>
52
- <div className="hidden @xl:block">{renderDesktopRate({ title, unit, rate, ...rest })}</div>
53
- <div className="@xl:hidden">{renderMobileRate({ title, unit, rate, ...rest })}</div>
21
+ <div className="hidden @xl:block">
22
+ <Rate title={title} rate={rate} unit={unit} fractionDigits={fractionDigits} {...rest} />
23
+ </div>
24
+ <div className="@xl:hidden">
25
+ <CalculatorValueBlock
26
+ title={title}
27
+ value={rate}
28
+ postfix={unit}
29
+ fractionDigits={fractionDigits}
30
+ fixed={true}
31
+ {...rest}
32
+ />
33
+ </div>
54
34
  </div>
55
35
  );
56
- };
@@ -24,7 +24,7 @@ export function renderInput(props: InputProps) {
24
24
  return (
25
25
  <div className="relative flex">
26
26
  <Input
27
- className="shrink-0 text-l w-full appearance-none -mr-24"
27
+ className="shrink-0 text-l w-full appearance-none -mr-20"
28
28
  placeholder={placeholder}
29
29
  type="text"
30
30
  value={value}
@@ -65,7 +65,7 @@ export const Select = JSX<SelectProps>(
65
65
  )}
66
66
  onClick={isOpen ? handleClose : open}
67
67
  >
68
- <p className="p-m pr-3xl flex items-center overflow-hidden text-ellipsis whitespace-nowrap">
68
+ <p className="p-m pr-8 flex items-center overflow-hidden text-ellipsis whitespace-nowrap">
69
69
  {formatOption(value) || placeholder}
70
70
  </p>
71
71
  {renderIcon(isOpen, iconVersion)}