@cloud-ru/ds-uikit-product-price-summary 1.0.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/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +408 -0
- package/dist/cjs/components/ContentBlock/ContentBlock.d.ts +7 -0
- package/dist/cjs/components/ContentBlock/ContentBlock.js +24 -0
- package/dist/cjs/components/ContentBlock/index.d.ts +1 -0
- package/dist/cjs/components/ContentBlock/index.js +17 -0
- package/dist/cjs/components/ContentBlock/styles.module.css +12 -0
- package/dist/cjs/components/PriceSummary/PriceSummary.d.ts +22 -0
- package/dist/cjs/components/PriceSummary/PriceSummary.js +23 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js +16 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/styles.module.css +6 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +17 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +16 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
- package/dist/cjs/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/Divider/Divider.js +11 -0
- package/dist/cjs/components/PriceSummary/components/Divider/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/Divider/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/Divider/styles.module.css +6 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +8 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +17 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/constants.d.ts +4 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/constants.js +7 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/types.d.ts +3 -0
- package/dist/cjs/components/PriceSummary/components/HeaderBlock/types.js +2 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +6 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +18 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceBlock/styles.module.css +13 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +23 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +27 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +36 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +5 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +19 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +7 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +26 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +17 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +22 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/index.js +17 -0
- package/dist/cjs/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
- package/dist/cjs/components/PriceSummary/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummary/index.js +17 -0
- package/dist/cjs/components/PriceSummary/styles.module.css +227 -0
- package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.d.ts +18 -0
- package/dist/cjs/components/PriceSummarySmall/PriceSummarySmall.js +23 -0
- package/dist/cjs/components/PriceSummarySmall/index.d.ts +1 -0
- package/dist/cjs/components/PriceSummarySmall/index.js +17 -0
- package/dist/cjs/components/PriceSummarySmall/styles.module.css +242 -0
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.js +18 -0
- package/dist/cjs/constants.d.ts +34 -0
- package/dist/cjs/constants.js +37 -0
- package/dist/cjs/helpers/formatters.d.ts +2 -0
- package/dist/cjs/helpers/formatters.js +14 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +17 -0
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +17 -0
- package/dist/cjs/hooks/usePeriodFormat.d.ts +5 -0
- package/dist/cjs/hooks/usePeriodFormat.js +21 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/locale/index.d.ts +107 -0
- package/dist/cjs/locale/index.js +58 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +673 -0
- package/dist/cjs/types.d.ts +79 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils/getAppearanceIcon.d.ts +2 -0
- package/dist/cjs/utils/getAppearanceIcon.js +25 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +17 -0
- package/dist/esm/components/ContentBlock/ContentBlock.d.ts +7 -0
- package/dist/esm/components/ContentBlock/ContentBlock.js +18 -0
- package/dist/esm/components/ContentBlock/index.d.ts +1 -0
- package/dist/esm/components/ContentBlock/index.js +1 -0
- package/dist/esm/components/ContentBlock/styles.module.css +12 -0
- package/dist/esm/components/PriceSummary/PriceSummary.d.ts +22 -0
- package/dist/esm/components/PriceSummary/PriceSummary.js +17 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js +10 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/CoveredByGrantLabel/styles.module.css +6 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/DiscountBlock.js +11 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountBlock/styles.module.css +16 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js +10 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/DiscountPercentCell/styles.module.css +5 -0
- package/dist/esm/components/PriceSummary/components/Divider/Divider.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/Divider/Divider.js +5 -0
- package/dist/esm/components/PriceSummary/components/Divider/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/Divider/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/Divider/styles.module.css +6 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.d.ts +8 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/HeaderBlock.js +11 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/constants.d.ts +4 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/constants.js +4 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/styles.module.css +14 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/types.d.ts +3 -0
- package/dist/esm/components/PriceSummary/components/HeaderBlock/types.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.d.ts +6 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.js +12 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceBlock/styles.module.css +13 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js +17 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.css +16 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.d.ts +7 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.js +21 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemBlock/styles.module.css +36 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.d.ts +5 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.js +13 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.css +14 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.d.ts +7 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.js +20 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/PeriodDropdown/styles.module.css +15 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.d.ts +17 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.js +16 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/index.js +1 -0
- package/dist/esm/components/PriceSummary/components/TotalValueBlock/styles.module.css +51 -0
- package/dist/esm/components/PriceSummary/index.d.ts +1 -0
- package/dist/esm/components/PriceSummary/index.js +1 -0
- package/dist/esm/components/PriceSummary/styles.module.css +227 -0
- package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.d.ts +18 -0
- package/dist/esm/components/PriceSummarySmall/PriceSummarySmall.js +17 -0
- package/dist/esm/components/PriceSummarySmall/index.d.ts +1 -0
- package/dist/esm/components/PriceSummarySmall/index.js +1 -0
- package/dist/esm/components/PriceSummarySmall/styles.module.css +242 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/constants.d.ts +34 -0
- package/dist/esm/constants.js +34 -0
- package/dist/esm/helpers/formatters.d.ts +2 -0
- package/dist/esm/helpers/formatters.js +10 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/usePeriodFormat.d.ts +5 -0
- package/dist/esm/hooks/usePeriodFormat.js +17 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/locale/index.d.ts +107 -0
- package/dist/esm/locale/index.js +55 -0
- package/dist/esm/style.css +673 -0
- package/dist/esm/types.d.ts +79 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils/getAppearanceIcon.d.ts +2 -0
- package/dist/esm/utils/getAppearanceIcon.js +22 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +61 -0
- package/src/components/ContentBlock/ContentBlock.tsx +41 -0
- package/src/components/ContentBlock/index.ts +1 -0
- package/src/components/ContentBlock/styles.module.scss +14 -0
- package/src/components/PriceSummary/PriceSummary.tsx +107 -0
- package/src/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.tsx +32 -0
- package/src/components/PriceSummary/components/CoveredByGrantLabel/index.ts +1 -0
- package/src/components/PriceSummary/components/CoveredByGrantLabel/styles.module.scss +8 -0
- package/src/components/PriceSummary/components/DiscountBlock/DiscountBlock.tsx +42 -0
- package/src/components/PriceSummary/components/DiscountBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/DiscountBlock/styles.module.scss +17 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.tsx +30 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/index.ts +1 -0
- package/src/components/PriceSummary/components/DiscountPercentCell/styles.module.scss +7 -0
- package/src/components/PriceSummary/components/Divider/Divider.tsx +5 -0
- package/src/components/PriceSummary/components/Divider/index.ts +1 -0
- package/src/components/PriceSummary/components/Divider/styles.module.scss +8 -0
- package/src/components/PriceSummary/components/HeaderBlock/HeaderBlock.tsx +41 -0
- package/src/components/PriceSummary/components/HeaderBlock/constants.ts +4 -0
- package/src/components/PriceSummary/components/HeaderBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/HeaderBlock/styles.module.scss +16 -0
- package/src/components/PriceSummary/components/HeaderBlock/types.ts +5 -0
- package/src/components/PriceSummary/components/InvoiceBlock/InvoiceBlock.tsx +37 -0
- package/src/components/PriceSummary/components/InvoiceBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceBlock/styles.module.scss +15 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.tsx +63 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceDetailsBlock/styles.module.scss +18 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/InvoiceItemBlock.tsx +82 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceItemBlock/styles.module.scss +42 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/InvoiceItemLabelCell.tsx +37 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/index.ts +1 -0
- package/src/components/PriceSummary/components/InvoiceItemLabelCell/styles.module.scss +16 -0
- package/src/components/PriceSummary/components/PeriodDropdown/PeriodDropdown.tsx +54 -0
- package/src/components/PriceSummary/components/PeriodDropdown/index.ts +1 -0
- package/src/components/PriceSummary/components/PeriodDropdown/styles.module.scss +18 -0
- package/src/components/PriceSummary/components/TotalValueBlock/TotalValueBlock.tsx +82 -0
- package/src/components/PriceSummary/components/TotalValueBlock/index.ts +1 -0
- package/src/components/PriceSummary/components/TotalValueBlock/styles.module.scss +54 -0
- package/src/components/PriceSummary/index.ts +1 -0
- package/src/components/PriceSummary/styles.module.scss +27 -0
- package/src/components/PriceSummarySmall/PriceSummarySmall.tsx +89 -0
- package/src/components/PriceSummarySmall/index.ts +1 -0
- package/src/components/PriceSummarySmall/styles.module.scss +42 -0
- package/src/components/index.ts +2 -0
- package/src/constants.ts +37 -0
- package/src/helpers/formatters.ts +12 -0
- package/src/helpers/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/usePeriodFormat.ts +30 -0
- package/src/index.ts +5 -0
- package/src/locale/index.ts +59 -0
- package/src/types.ts +93 -0
- package/src/utils/getAppearanceIcon.tsx +26 -0
- package/src/utils/index.ts +1 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { QuestionTooltipProps } from '@cloud-ru/ds-tooltip';
|
|
2
|
+
import { ValueOf } from '@cloud-ru/ds-utils';
|
|
3
|
+
|
|
4
|
+
import { APPEARANCE_STATE, PRICE_PERIOD } from './constants';
|
|
5
|
+
|
|
6
|
+
export type PricePeriod = ValueOf<typeof PRICE_PERIOD>;
|
|
7
|
+
|
|
8
|
+
/** Префикс перед итоговой суммой: без префикса (`equal`) или «от» (`from`). */
|
|
9
|
+
export type TotalSumType = 'equal' | 'from';
|
|
10
|
+
|
|
11
|
+
/** Визуальное состояние подсказки и дельты общей суммы. */
|
|
12
|
+
export type AppearanceState = ValueOf<typeof APPEARANCE_STATE>;
|
|
13
|
+
|
|
14
|
+
export type DiscountItem = {
|
|
15
|
+
/** Сумма скидки в валюте (в UI выводится со знаком «−»). */
|
|
16
|
+
value: number;
|
|
17
|
+
/** Процент скидки для бейджа `−N%`. */
|
|
18
|
+
percent?: number;
|
|
19
|
+
/** Контент тултипа-пояснения к скидке. */
|
|
20
|
+
tooltip?: QuestionTooltipProps['tip'];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type DiscountDetails = {
|
|
24
|
+
/** Базовая цена до применения скидок. */
|
|
25
|
+
price: number;
|
|
26
|
+
/** Список применённых скидок. */
|
|
27
|
+
discounts: DiscountItem[];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type PriceInvoiceItem = {
|
|
31
|
+
/** Подпись строки детализации. */
|
|
32
|
+
label: string;
|
|
33
|
+
/** Скидка для строки с ценой. */
|
|
34
|
+
discount?: DiscountItem;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type DiscountInvoiceItem = {
|
|
38
|
+
/** Скидка без собственной цены. */
|
|
39
|
+
discount: DiscountItem;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type BaseInvoiceItem = (PriceInvoiceItem | DiscountInvoiceItem) & {
|
|
43
|
+
/** Тултип для label строки детализации. */
|
|
44
|
+
labelTooltip?: QuestionTooltipProps['tip'];
|
|
45
|
+
/** Цена строки в валюте. */
|
|
46
|
+
price?: number;
|
|
47
|
+
/** Цвет цены: обычный или акцент изменения. */
|
|
48
|
+
priceColor?: 'default' | 'changed';
|
|
49
|
+
/** Скрыть колонку цены вне зависимости от значения `price`. */
|
|
50
|
+
hidePrice?: boolean;
|
|
51
|
+
/** Ограничение количества строк в label. */
|
|
52
|
+
labelMaxLines?: number;
|
|
53
|
+
/** Количество рядом с title/label (например, `×2`). */
|
|
54
|
+
quantity?: string | number;
|
|
55
|
+
/** Показать верхний разделитель перед строкой. */
|
|
56
|
+
topDivider?: boolean;
|
|
57
|
+
/** Показать нижний разделитель после строки. */
|
|
58
|
+
bottomDivider?: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type PrimaryInvoiceItem = BaseInvoiceItem & {
|
|
62
|
+
/** Явная отметка основной строки. */
|
|
63
|
+
primary: true;
|
|
64
|
+
/** Флаг покрытия позиции грантом (только для primary-строк). */
|
|
65
|
+
coveredByGrant?: boolean;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type SecondaryInvoiceItem = BaseInvoiceItem & {
|
|
69
|
+
/** Secondary-строка (по умолчанию, если `primary` не задан). */
|
|
70
|
+
primary?: false;
|
|
71
|
+
coveredByGrant?: never;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Строка детализации заказа. */
|
|
75
|
+
export type InvoiceItem = PrimaryInvoiceItem | SecondaryInvoiceItem;
|
|
76
|
+
|
|
77
|
+
export type InvoiceDetails = {
|
|
78
|
+
/** Заголовок секции детализации. */
|
|
79
|
+
title?: string;
|
|
80
|
+
/** Количество рядом с заголовком секции. */
|
|
81
|
+
quantity?: string | number;
|
|
82
|
+
/** Цена секции детализации. */
|
|
83
|
+
price?: number;
|
|
84
|
+
/** Строки секции детализации. */
|
|
85
|
+
items: InvoiceItem[];
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type PriceDeltaDetails = {
|
|
89
|
+
/** Величина изменения цены. */
|
|
90
|
+
value: number;
|
|
91
|
+
/** Тип изменения: повышение или снижение. */
|
|
92
|
+
type: 'increased' | 'decreased';
|
|
93
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CrossSVG, NotifierInfoFilledSVG, NotifierWarningFilledSVG, QuestionSVG } from '@cloud-ru/ds-icons/interface/system';
|
|
2
|
+
|
|
3
|
+
import { APPEARANCE_STATE } from '../constants';
|
|
4
|
+
import { AppearanceState } from '../types';
|
|
5
|
+
|
|
6
|
+
export function getAppearanceIcon(appearance: AppearanceState, className?: string) {
|
|
7
|
+
let Component: typeof NotifierInfoFilledSVG;
|
|
8
|
+
|
|
9
|
+
switch (appearance) {
|
|
10
|
+
case APPEARANCE_STATE.Warning:
|
|
11
|
+
Component = NotifierWarningFilledSVG;
|
|
12
|
+
break;
|
|
13
|
+
case APPEARANCE_STATE.UserError:
|
|
14
|
+
Component = CrossSVG;
|
|
15
|
+
break;
|
|
16
|
+
case APPEARANCE_STATE.SystemError:
|
|
17
|
+
Component = QuestionSVG;
|
|
18
|
+
break;
|
|
19
|
+
case APPEARANCE_STATE.Default:
|
|
20
|
+
default:
|
|
21
|
+
Component = NotifierInfoFilledSVG;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return <Component size={16} data-appearance={appearance} className={className} />;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getAppearanceIcon';
|