@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.loadingBlock{
|
|
2
|
+
display:flex;
|
|
3
|
+
justify-content:center;
|
|
4
|
+
padding:var(--sn-primitive-dimension-4, 4px);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dataErrorBlock{
|
|
8
|
+
display:flex;
|
|
9
|
+
flex-direction:column;
|
|
10
|
+
align-items:center;
|
|
11
|
+
color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LinkProps } from '@cloud-ru/ds-link';
|
|
2
|
+
import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
3
|
+
import { DiscountDetails, InvoiceDetails } from '../../types';
|
|
4
|
+
import { ContentBlockProps } from '../ContentBlock';
|
|
5
|
+
import { HeaderBlockProps } from './components/HeaderBlock';
|
|
6
|
+
import { TotalValueBlockProps } from './components/TotalValueBlock';
|
|
7
|
+
export type PriceSummaryProps = WithSupportProps<TotalValueBlockProps & HeaderBlockProps & ContentBlockProps & {
|
|
8
|
+
/** Блок базовой цены и скидок. */
|
|
9
|
+
discount?: DiscountDetails;
|
|
10
|
+
/** Секции детализации заказа в аккордеоне. */
|
|
11
|
+
invoice?: InvoiceDetails[];
|
|
12
|
+
/** Начальное состояние раскрытия аккордеона invoice. */
|
|
13
|
+
invoiceExpandedDefault?: boolean;
|
|
14
|
+
/** Ссылка «Подробнее о расчёте». */
|
|
15
|
+
docsLink?: {
|
|
16
|
+
href?: LinkProps['href'];
|
|
17
|
+
label?: LinkProps['label'];
|
|
18
|
+
};
|
|
19
|
+
/** Дополнительный класс корневого контейнера. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function PriceSummary({ value, totalSumType, hint, period, onPeriodChanged, periodOptions, promoBadge, loading, dataError, onRetry, discount, invoice, invoiceExpandedDefault, docsLink, className, hintAppearance, showHintTooltip, hintTooltipText, hintLink, showHintLink, valueDelta, vatType, ...rest }: PriceSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PriceSummary = PriceSummary;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const link_1 = require("@cloud-ru/ds-link");
|
|
9
|
+
const materials_1 = require("@cloud-ru/ds-materials");
|
|
10
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const locale_1 = require("../../locale");
|
|
13
|
+
const ContentBlock_1 = require("../ContentBlock");
|
|
14
|
+
const DiscountBlock_1 = require("./components/DiscountBlock");
|
|
15
|
+
const HeaderBlock_1 = require("./components/HeaderBlock");
|
|
16
|
+
const InvoiceBlock_1 = require("./components/InvoiceBlock");
|
|
17
|
+
const TotalValueBlock_1 = require("./components/TotalValueBlock");
|
|
18
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
19
|
+
function PriceSummary({ value, totalSumType, hint, period, onPeriodChanged, periodOptions, promoBadge, loading, dataError, onRetry, discount, invoice, invoiceExpandedDefault = true, docsLink, className, hintAppearance, showHintTooltip = false, hintTooltipText, hintLink, showHintLink, valueDelta, vatType, ...rest }) {
|
|
20
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
21
|
+
const { appearance, level } = (0, materials_1.backgroundPredefinedFillToAcrylic)(materials_1.BACKGROUND_PREDEFINED_FILL.NeutralBackground1Level);
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.priceSummary, className), "data-acrylic-appearance": appearance, "data-acrylic-level": level, ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.acrylic, "aria-hidden": true, "data-acrylic-background": true }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsx)(HeaderBlock_1.HeaderBlock, { period: period, onPeriodChanged: onPeriodChanged, periodOptions: periodOptions, promoBadge: promoBadge, vatType: vatType }), (0, jsx_runtime_1.jsxs)(ContentBlock_1.ContentBlock, { loading: loading, dataError: dataError, onRetry: onRetry, children: [discount && (0, jsx_runtime_1.jsx)(DiscountBlock_1.DiscountBlock, { value: discount }), (0, jsx_runtime_1.jsx)(TotalValueBlock_1.TotalValueBlock, { value: value, totalSumType: totalSumType, hint: hint, hintAppearance: hintAppearance, showHintTooltip: showHintTooltip, hintTooltipText: hintTooltipText, hintLink: hintLink, showHintLink: showHintLink, valueDelta: valueDelta }), invoice && invoice.length > 0 && ((0, jsx_runtime_1.jsx)(InvoiceBlock_1.InvoiceBlock, { invoice: invoice, invoiceExpandedDefault: invoiceExpandedDefault })), docsLink?.href && (0, jsx_runtime_1.jsx)(link_1.Link, { label: docsLink.label || t('docsLink'), href: docsLink.href, target: '_blank' })] })] })] }));
|
|
23
|
+
}
|
package/dist/cjs/components/PriceSummary/components/CoveredByGrantLabel/CoveredByGrantLabel.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CoveredByGrantLabel = CoveredByGrantLabel;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const promo_tag_1 = require("@cloud-ru/ds-promo-tag");
|
|
9
|
+
const tooltip_1 = require("@cloud-ru/ds-tooltip");
|
|
10
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
11
|
+
const locale_1 = require("../../../../locale");
|
|
12
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
|
+
function CoveredByGrantLabel({ covered, className }) {
|
|
14
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.coveredByGrant, className), children: [(0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, { appearance: covered ? 'green' : 'neutral', roleAppearance: promo_tag_1.ROLE_APPEARANCE.Decor, label: covered ? t('coveredByGrant') : t('notCoveredByGrant') }), (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { tip: covered ? t('coveredByGrantTooltip') : t('notCoveredByGrantTooltip'), size: 'xs', placement: 'top', trigger: 'hover', tabIndex: -1 })] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CoveredByGrantLabel';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CoveredByGrantLabel"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DiscountBlock = DiscountBlock;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const helpers_1 = require("../../../../helpers");
|
|
11
|
+
const locale_1 = require("../../../../locale");
|
|
12
|
+
const DiscountPercentCell_1 = require("../DiscountPercentCell");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
|
+
function DiscountBlock({ value }) {
|
|
15
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.discountGrid, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.body, size: typography_1.SIZE.s, as: 'div', children: t('basePrice') }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.label, size: typography_1.SIZE.m, as: 'div', className: styles_module_scss_1.default.priceCell, children: (0, helpers_1.formatCurrency)(value.price) })] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.discountGrid, children: value.discounts.map((discount, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DiscountPercentCell_1.DiscountPercentCell, { discount: discount }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.label, size: typography_1.SIZE.m, as: 'div', className: styles_module_scss_1.default.discountCell, children: (0, helpers_1.formatCurrency)(-Math.abs(discount.value)) })] }, index))) })] }));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DiscountBlock';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DiscountBlock"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.discountGrid{
|
|
2
|
+
display:grid;
|
|
3
|
+
grid-template-columns:1fr 1fr;
|
|
4
|
+
-moz-column-gap:var(--sn-primitive-dimension-8, 8px);
|
|
5
|
+
column-gap:var(--sn-primitive-dimension-8, 8px);
|
|
6
|
+
color:var(--sn-theme-color-available-version-textSecondary, var(--sn-brand-color-text-version-secondary, rgba(65, 66, 78, 0.8)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.priceCell{
|
|
10
|
+
justify-self:end;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.discountCell{
|
|
14
|
+
justify-self:end;
|
|
15
|
+
color:var(--sn-theme-color-red-text, var(--sn-primitive-color-red-45, #a93533));
|
|
16
|
+
}
|
package/dist/cjs/components/PriceSummary/components/DiscountPercentCell/DiscountPercentCell.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DiscountPercentCell = DiscountPercentCell;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const tooltip_1 = require("@cloud-ru/ds-tooltip");
|
|
9
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
10
|
+
const ft_formatters_1 = require("@cloud-ru/ft-formatters");
|
|
11
|
+
const locale_1 = require("../../../../locale");
|
|
12
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
|
+
function DiscountPercentCell({ discount }) {
|
|
14
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.percentCell, children: discount.percent && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(typography_1.Typography, { variant: typography_1.VARIANT.body, size: typography_1.SIZE.s, children: [t('discount'), " ", (0, ft_formatters_1.formatNumber)(-Math.abs(discount.percent)), "%"] }), discount.tooltip && (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { tip: discount.tooltip })] })) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DiscountPercentCell';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DiscountPercentCell"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Divider(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Divider = Divider;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
9
|
+
function Divider() {
|
|
10
|
+
return (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.divider });
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Divider';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Divider"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
.divider{
|
|
2
|
+
width:100%;
|
|
3
|
+
height:0;
|
|
4
|
+
margin:var(--sn-primitive-dimension-4, 4px) 0;
|
|
5
|
+
border-top:var(--sn-primitive-strokeWeight-strokeRegular, 1px) dashed var(--sn-theme-color-neutral-decor, var(--sn-brand-color-neutral-80, var(--sn-primitive-color-gray-80, #e3e5ed)));
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PromoTagProps } from '@cloud-ru/ds-promo-tag';
|
|
2
|
+
import { PeriodDropdownProps } from '../PeriodDropdown';
|
|
3
|
+
import { VatType } from './types';
|
|
4
|
+
export type HeaderBlockProps = PeriodDropdownProps & {
|
|
5
|
+
vatType?: VatType;
|
|
6
|
+
promoBadge?: Pick<PromoTagProps, 'label' | 'appearance'> | string;
|
|
7
|
+
};
|
|
8
|
+
export declare function HeaderBlock({ period, onPeriodChanged, periodOptions, promoBadge, vatType, }: HeaderBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HeaderBlock = HeaderBlock;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const promo_tag_1 = require("@cloud-ru/ds-promo-tag");
|
|
9
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
10
|
+
const locale_1 = require("../../../../locale");
|
|
11
|
+
const PeriodDropdown_1 = require("../PeriodDropdown");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
|
+
function HeaderBlock({ period, onPeriodChanged, periodOptions, promoBadge, vatType = constants_1.VAT_TYPE.Including, }) {
|
|
15
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [promoBadge && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.promoBadge, children: (0, jsx_runtime_1.jsx)(promo_tag_1.PromoTag, { ...(typeof promoBadge === 'string' ? { label: promoBadge } : promoBadge) }) })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.headline, children: [(0, jsx_runtime_1.jsx)(PeriodDropdown_1.PeriodDropdown, { period: period, onPeriodChanged: onPeriodChanged, periodOptions: periodOptions }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.body, size: typography_1.SIZE.m, className: styles_module_scss_1.default.vat, children: t(vatType === constants_1.VAT_TYPE.Including ? 'vat' : 'vatExcluded') })] })] }));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HeaderBlock';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./HeaderBlock"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.headline{
|
|
2
|
+
display:flex;
|
|
3
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
4
|
+
align-items:center;
|
|
5
|
+
justify-content:space-between;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.vat{
|
|
9
|
+
color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.promoBadge{
|
|
13
|
+
display:flex;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InvoiceDetails } from '../../../../types';
|
|
2
|
+
export type InvoiceBlockProps = {
|
|
3
|
+
invoice: InvoiceDetails[];
|
|
4
|
+
invoiceExpandedDefault?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function InvoiceBlock({ invoice, invoiceExpandedDefault }: InvoiceBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvoiceBlock = InvoiceBlock;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const accordion_1 = require("@cloud-ru/ds-accordion");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const constants_1 = require("../../../../constants");
|
|
11
|
+
const locale_1 = require("../../../../locale");
|
|
12
|
+
const InvoiceDetailsBlock_1 = require("../InvoiceDetailsBlock");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
|
+
function InvoiceBlock({ invoice, invoiceExpandedDefault }) {
|
|
15
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
16
|
+
const invoiceBlockId = (0, react_1.useId)();
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.accordion, children: (0, jsx_runtime_1.jsx)(accordion_1.Accordion, { expandedDefault: invoiceExpandedDefault ? invoiceBlockId : undefined, children: (0, jsx_runtime_1.jsx)(accordion_1.Accordion.CollapseBlockTertiary, { id: invoiceBlockId, title: t('orderDetails'), "data-test-id": constants_1.TEST_IDS.orderDetails, children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.accordionContent, "data-test-id": constants_1.TEST_IDS.orderDetailsContent, children: invoice.map((invoice, index) => ((0, jsx_runtime_1.jsx)(InvoiceDetailsBlock_1.InvoiceDetailsBlock, { invoice: invoice }, index))) }) }) }) }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InvoiceBlock';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./InvoiceBlock"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.accordion{
|
|
2
|
+
--space-accordion-collapse-block-secondary-horizontal-padding:0;
|
|
3
|
+
--space-accordion-collapse-block-secondary-vertical-padding:var(--sn-primitive-dimension-8, 8px);
|
|
4
|
+
--space-accordion-collapse-block-secondary-gap:var(--sn-primitive-dimension-8, 8px);
|
|
5
|
+
--border-width-accordion-collapse-block-secondary:0;
|
|
6
|
+
--accordion-header-padding-vertical:0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.accordionContent{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
13
|
+
}
|
package/dist/cjs/components/PriceSummary/components/InvoiceDetailsBlock/InvoiceDetailsBlock.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvoiceDetailsBlock = InvoiceDetailsBlock;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
9
|
+
const helpers_1 = require("../../../../helpers");
|
|
10
|
+
const locale_1 = require("../../../../locale");
|
|
11
|
+
const CoveredByGrantLabel_1 = require("../CoveredByGrantLabel");
|
|
12
|
+
const Divider_1 = require("../Divider");
|
|
13
|
+
const InvoiceItemBlock_1 = require("../InvoiceItemBlock");
|
|
14
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
15
|
+
function InvoiceDetailsBlock({ invoice }) {
|
|
16
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
17
|
+
const primaryItems = invoice.items.filter(item => item.primary);
|
|
18
|
+
const firstValue = primaryItems[0]?.coveredByGrant;
|
|
19
|
+
const allSameValue = primaryItems.length > 0 && primaryItems.every(item => item.coveredByGrant === firstValue);
|
|
20
|
+
const showBlockLabel = allSameValue && firstValue !== undefined;
|
|
21
|
+
const showItemLabels = !showBlockLabel;
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.main, children: [showBlockLabel && (0, jsx_runtime_1.jsx)(CoveredByGrantLabel_1.CoveredByGrantLabel, { covered: firstValue }), invoice.title && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.label, size: typography_1.SIZE.m, children: invoice.title }), invoice.quantity && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.label, size: typography_1.SIZE.m, children: (0, helpers_1.formatQuantity)(invoice.quantity) }))] }), (0, jsx_runtime_1.jsx)(Divider_1.Divider, {})] })), invoice.items.map((item, index) => ((0, jsx_runtime_1.jsx)(InvoiceItemBlock_1.InvoiceItemBlock, { item: item, index: index, showCoveredByGrantLabel: showItemLabels }, index))), invoice.price !== undefined && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Divider_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footer, children: (0, jsx_runtime_1.jsxs)(typography_1.Typography, { variant: typography_1.VARIANT.label, size: typography_1.SIZE.m, children: [t('price'), ": ", (0, helpers_1.formatCurrency)(invoice.price)] }) })] }))] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InvoiceDetailsBlock';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./InvoiceDetailsBlock"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.main{
|
|
2
|
+
padding:var(--sn-primitive-dimension-4, 4px) var(--sn-primitive-dimension-8, 8px);
|
|
3
|
+
border:var(--sn-primitive-strokeWeight-strokeRegular, 1px) dashed var(--sn-theme-color-neutral-decor, var(--sn-brand-color-neutral-80, var(--sn-primitive-color-gray-80, #e3e5ed)));
|
|
4
|
+
border-radius:var(--sn-brand-anatomy-radius-block-m, var(--sn-primitive-dimension-4, 4px));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.header{
|
|
8
|
+
display:flex;
|
|
9
|
+
justify-content:space-between;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.footer{
|
|
13
|
+
display:flex;
|
|
14
|
+
align-items:center;
|
|
15
|
+
justify-content:flex-end;
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InvoiceItem } from '../../../../types';
|
|
2
|
+
export type InvoiceItemBlockProps = {
|
|
3
|
+
item: InvoiceItem;
|
|
4
|
+
index: number;
|
|
5
|
+
showCoveredByGrantLabel?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function InvoiceItemBlock({ item, index, showCoveredByGrantLabel }: InvoiceItemBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvoiceItemBlock = InvoiceItemBlock;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const typography_1 = require("@cloud-ru/ds-typography");
|
|
9
|
+
const helpers_1 = require("../../../../helpers");
|
|
10
|
+
const locale_1 = require("../../../../locale");
|
|
11
|
+
const CoveredByGrantLabel_1 = require("../CoveredByGrantLabel");
|
|
12
|
+
const DiscountPercentCell_1 = require("../DiscountPercentCell");
|
|
13
|
+
const Divider_1 = require("../Divider");
|
|
14
|
+
const InvoiceItemLabelCell_1 = require("../InvoiceItemLabelCell");
|
|
15
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
16
|
+
function InvoiceItemBlock({ item, index, showCoveredByGrantLabel }) {
|
|
17
|
+
const { t } = locale_1.priceSummaryLocale.useTranslations();
|
|
18
|
+
const isEven = (index + 1) % 2 === 0;
|
|
19
|
+
const isSecondary = item.primary === undefined ? isEven : !item.primary;
|
|
20
|
+
const getPriceItem = () => {
|
|
21
|
+
if (item.hidePrice) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return item.price !== undefined ? (0, helpers_1.formatCurrency)(item.price) : t('notAvailable');
|
|
25
|
+
};
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [item.topDivider && (0, jsx_runtime_1.jsx)(Divider_1.Divider, {}), item.coveredByGrant !== undefined && showCoveredByGrantLabel && ((0, jsx_runtime_1.jsx)(CoveredByGrantLabel_1.CoveredByGrantLabel, { covered: item.coveredByGrant })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.itemGrid, "data-discount": Boolean(item.discount), children: ['label' in item && item.label !== undefined && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.labelCell, "data-secondary": isSecondary, children: (0, jsx_runtime_1.jsx)(InvoiceItemLabelCell_1.InvoiceItemLabelCell, { item: item }) }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.body, size: typography_1.SIZE.s, as: 'div', className: styles_module_scss_1.default.priceCell, "data-secondary": isSecondary, "data-price-color": item.priceColor ?? 'default', children: getPriceItem() })] })), item.discount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.percentCell, "data-secondary": isSecondary, children: (0, jsx_runtime_1.jsx)(DiscountPercentCell_1.DiscountPercentCell, { discount: item.discount }) }), (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: typography_1.VARIANT.body, size: typography_1.SIZE.s, as: 'div', className: styles_module_scss_1.default.discountCell, "data-secondary": isSecondary, children: (0, helpers_1.formatCurrency)(-Math.abs(item.discount.value)) })] }))] }), item.bottomDivider && (0, jsx_runtime_1.jsx)(Divider_1.Divider, {})] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InvoiceItemBlock';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./InvoiceItemBlock"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.itemGrid{
|
|
2
|
+
display:grid;
|
|
3
|
+
grid-template-columns:1fr auto;
|
|
4
|
+
-moz-column-gap:var(--sn-primitive-dimension-8, 8px);
|
|
5
|
+
column-gap:var(--sn-primitive-dimension-8, 8px);
|
|
6
|
+
}
|
|
7
|
+
.itemGrid[data-discount=true]{
|
|
8
|
+
margin-bottom:var(--sn-primitive-dimension-4, 4px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.labelCell{
|
|
12
|
+
overflow:hidden;
|
|
13
|
+
display:flex;
|
|
14
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.priceCell{
|
|
18
|
+
justify-self:end;
|
|
19
|
+
}
|
|
20
|
+
.priceCell[data-price-color=changed]{
|
|
21
|
+
color:var(--sn-theme-color-green-accent, var(--sn-primitive-color-green-55, #41b954));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.labelCell[data-secondary=true],
|
|
25
|
+
.priceCell[data-secondary=true],
|
|
26
|
+
.percentCell[data-secondary=true]{
|
|
27
|
+
color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.discountCell{
|
|
31
|
+
justify-self:end;
|
|
32
|
+
color:var(--sn-theme-color-red-accent, var(--sn-primitive-color-red-55, #d52e33));
|
|
33
|
+
}
|
|
34
|
+
.discountCell[data-secondary=true]{
|
|
35
|
+
color:var(--sn-theme-color-available-version-textDisabled, var(--sn-brand-color-text-version-disabled, rgba(65, 66, 78, 0.3490196078)));
|
|
36
|
+
}
|