@finam/web-ui-kit-components 3.34.1 → 3.34.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
## 3.34.2
|
|
2
|
+
* В `ProductCard` (layout `common`) идентификатор SVG-градиента графика генерируется без `useId`, чтобы компонент работал на React 17
|
|
1
3
|
## 3.34.1
|
|
2
4
|
* В `DraggablePopover` ограничено число последовательных коррекций позиции: окно, размер которого зависит от собственной позиции, больше не вызывает бесконечную цепочку `onChangePosition`; при достижении лимита в консоль выводится `warning` с историей коррекций и метриками экрана
|
|
3
5
|
## 3.34.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/ProductCard/layouts/common/Content.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAcvD,MAAM,WAAW,6BAA6B;IAC5C,gCAAgC;IAChC,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/ProductCard/layouts/common/Content.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAcvD,MAAM,WAAW,6BAA6B;IAC5C,gCAAgC;IAChC,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAmDD,QAAA,MAAM,gCAAgC,kDA/CO,6BAA6B,6CA+CH,CAAC;AAGxE,eAAe,gCAAgC,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo,
|
|
2
|
+
import { memo, useState } from "react";
|
|
3
3
|
import ProductCardContent from "../../ProductCardContent/index.js";
|
|
4
4
|
import { useProductCardContext } from "../../ProductCardContext.js";
|
|
5
5
|
import { PRODUCT_CARD_CHART_VIEWBOX_HEIGHT, PRODUCT_CARD_CHART_VIEWBOX_WIDTH, buildChartPolyline, getProductCardChartColors, getProductCardChartTrend, normalizeChartPoints } from "./chartUtils.js";
|
|
6
6
|
import { ChartSvg, ChartWrap } from "./Content.styles.js";
|
|
7
|
+
let chartGradientId = 0;
|
|
7
8
|
const ProductCardCommonContent = ({ chart })=>{
|
|
8
9
|
const { view } = useProductCardContext();
|
|
9
|
-
const gradientId =
|
|
10
|
+
const [gradientId] = useState(()=>{
|
|
11
|
+
chartGradientId += 1;
|
|
12
|
+
return `product-card-chart-gradient-${chartGradientId}`;
|
|
13
|
+
});
|
|
10
14
|
const points = normalizeChartPoints(chart);
|
|
11
15
|
const hasChart = points.length >= 2;
|
|
12
16
|
if (!hasChart) return /*#__PURE__*/ jsx(ProductCardContent, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCard/layouts/common/Content.js","sources":["../../../../src/ProductCard/layouts/common/Content.tsx"],"sourcesContent":["import { memo,
|
|
1
|
+
{"version":3,"file":"ProductCard/layouts/common/Content.js","sources":["../../../../src/ProductCard/layouts/common/Content.tsx"],"sourcesContent":["import { memo, useState } from 'react';\nimport ProductCardContent from '../../ProductCardContent/index.js';\nimport { useProductCardContext } from '../../ProductCardContext.js';\nimport type { ProductCardPoint } from '../../types.js';\nimport {\n PRODUCT_CARD_CHART_VIEWBOX_HEIGHT,\n PRODUCT_CARD_CHART_VIEWBOX_WIDTH,\n buildChartPolyline,\n getProductCardChartColors,\n getProductCardChartTrend,\n normalizeChartPoints,\n} from './chartUtils.js';\nimport {\n ChartSvg,\n ChartWrap,\n} from './Content.styles.js';\n\nexport interface ProductCardCommonContentProps {\n /** Точки графика доходности. */\n chart?: ProductCardPoint[];\n}\n\nlet chartGradientId = 0;\n\nconst ProductCardCommonContent = ({ chart }: ProductCardCommonContentProps) => {\n const { view } = useProductCardContext();\n const [gradientId] = useState(() => {\n chartGradientId += 1;\n return `product-card-chart-gradient-${chartGradientId}`;\n });\n const points = normalizeChartPoints(chart);\n const hasChart = points.length >= 2;\n\n if (!hasChart) {\n return <ProductCardContent />;\n }\n\n const trend = getProductCardChartTrend(points);\n const colors = getProductCardChartColors(trend);\n const chartPolyline = buildChartPolyline(points);\n\n return (\n <ProductCardContent>\n <ChartWrap className={view}>\n <ChartSvg\n viewBox={`0 0 ${PRODUCT_CARD_CHART_VIEWBOX_WIDTH} ${PRODUCT_CARD_CHART_VIEWBOX_HEIGHT}`}\n preserveAspectRatio=\"none\"\n >\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={colors.fillStart} />\n <stop offset=\"100%\" stopColor={colors.fillEnd} />\n </linearGradient>\n </defs>\n <polygon\n points={`${chartPolyline} ${PRODUCT_CARD_CHART_VIEWBOX_WIDTH},${PRODUCT_CARD_CHART_VIEWBOX_HEIGHT} 0,${PRODUCT_CARD_CHART_VIEWBOX_HEIGHT}`}\n fill={`url(#${gradientId})`}\n />\n <polyline\n points={chartPolyline}\n fill=\"none\"\n stroke={colors.stroke}\n strokeWidth=\"0.8\"\n vectorEffect=\"non-scaling-stroke\"\n />\n </ChartSvg>\n </ChartWrap>\n </ProductCardContent>\n );\n};\n\nconst MemoizedProductCardCommonContent = memo(ProductCardCommonContent);\nMemoizedProductCardCommonContent.displayName = 'ProductCardCommonContent';\n\nexport default MemoizedProductCardCommonContent;\n"],"names":["chartGradientId","ProductCardCommonContent","chart","view","useProductCardContext","gradientId","useState","points","normalizeChartPoints","hasChart","ProductCardContent","trend","getProductCardChartTrend","colors","getProductCardChartColors","chartPolyline","buildChartPolyline","ChartWrap","ChartSvg","PRODUCT_CARD_CHART_VIEWBOX_WIDTH","PRODUCT_CARD_CHART_VIEWBOX_HEIGHT","MemoizedProductCardCommonContent","memo"],"mappings":";;;;;;AAsBA,IAAIA,kBAAkB;AAEtB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"3.34.
|
|
2
|
+
const version = "3.34.2";
|
|
3
3
|
export { default as Button } from "./Button/index.js";
|
|
4
4
|
export { default as ButtonAsync } from "./ButtonAsync/index.js";
|
|
5
5
|
export { default as MarketingButton } from "./MarketingButton/index.js";
|