From b27a9e83516ee724ddf5f625bdf19be21b5bf7ea Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Tue, 21 Nov 2023 20:25:52 +0200 Subject: [PATCH] [Knockout] Multi-Select Matrix - The totalText property doesn't work fix #7338 --- src/defaultCss/defaultV2Css.ts | 3 ++ src/defaultV2-theme/blocks/sd-table.scss | 9 ++++ .../templates/question-matrixdynamic.html | 7 ++- src/question_matrixdropdownrendered.ts | 9 ++-- .../etalons/matrixdropdown-with-totals.png | Bin 0 -> 15367 bytes .../etalons/matrixdynamic-with-totals.png | Bin 13049 -> 13048 bytes .../tests/defaultV2/matrixdynamic.ts | 49 +++++++++++++++++- 7 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-with-totals.png diff --git a/src/defaultCss/defaultV2Css.ts b/src/defaultCss/defaultV2Css.ts index 8de7085c97..ff0f9772fe 100644 --- a/src/defaultCss/defaultV2Css.ts +++ b/src/defaultCss/defaultV2Css.ts @@ -445,6 +445,8 @@ export var defaultV2Css = { rowHasEndActions: "sd-table__row--has-end-actions", headerCell: "sd-table__cell sd-table__cell--header", rowTextCell: "sd-table__cell sd-table__cell--row-text", + footerCell: "sd-table__cell sd-table__cell--footer", + footerTotalCell: "sd-table__cell sd-table__cell--footer-total", columnTitleCell: "sd-table__cell--column-title", cellRequiredText: "sd-question__required-text", detailButton: "sd-table__cell--detail-button", @@ -480,6 +482,7 @@ export var defaultV2Css = { itemCell: "sd-table__cell--item", headerCell: "sd-table__cell sd-table__cell--header", rowTextCell: "sd-table__cell sd-table__cell--row-text", + footerCell: "sd-table__cell sd-table__cell--footer", columnTitleCell: "sd-table__cell--column-title", cellRequiredText: "sd-question__required-text", button: "sd-action sd-matrixdynamic__btn", diff --git a/src/defaultV2-theme/blocks/sd-table.scss b/src/defaultV2-theme/blocks/sd-table.scss index ffa0ba83b5..df1e9fb39f 100644 --- a/src/defaultV2-theme/blocks/sd-table.scss +++ b/src/defaultV2-theme/blocks/sd-table.scss @@ -236,6 +236,15 @@ } } +.sd-table__cell--footer { + text-align: right; +} + +.sd-table__cell--footer-total { + font-weight: 600; + text-align: left; +} + .sd-table__cell--detail-panel { border-top: calcSize(1) solid transparent; padding: calcSize(3) calcSize(1) calcSize(4); diff --git a/src/knockout/templates/question-matrixdynamic.html b/src/knockout/templates/question-matrixdynamic.html index 87579b9d73..ff662df757 100644 --- a/src/knockout/templates/question-matrixdynamic.html +++ b/src/knockout/templates/question-matrixdynamic.html @@ -81,6 +81,11 @@ + + + + +