Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One inputPerPage feature (infinite loop) #9197

Draft
wants to merge 82 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
bdcbc12
Implement the basic functionality for inputPerPage
andrewtelnov Dec 23, 2024
ed4a450
Support dynamic panel templateTitle
andrewtelnov Dec 23, 2024
2a1eb04
Finish support single input for panel dynamic
andrewtelnov Dec 24, 2024
2e16375
Fix compilation error
andrewtelnov Dec 24, 2024
ca2236b
Remove wrapper panel
andrewtelnov Dec 25, 2024
9017aa5
Remove wrapper panel in panel dynamic
andrewtelnov Dec 26, 2024
71a1d97
Add wrapper div vs styles
andrewtelnov Dec 26, 2024
616be0a
Remove question.singleInputElement
andrewtelnov Dec 27, 2024
8147024
Add support single input for matrix dynamic
andrewtelnov Dec 27, 2024
863febb
Do not show row title for matrix dropdown
andrewtelnov Dec 27, 2024
5e92ed5
Add visibleIndex into matrix row
andrewtelnov Dec 27, 2024
063a402
Implement single input for single matrix
andrewtelnov Dec 27, 2024
5bf9d51
Add choice into questionsOnPageMode property
andrewtelnov Dec 27, 2024
2b5cf3a
Update navigation bar on question value changed
andrewtelnov Dec 27, 2024
396e359
Do not show add button on editing empty object
andrewtelnov Dec 27, 2024
5f45ff9
Fix compilation
andrewtelnov Dec 27, 2024
40c3f28
Do not use ReactElementFactory
andrewtelnov Dec 31, 2024
6f2d043
Change single input root styles
andrewtelnov Dec 31, 2024
cdcef6c
Fix border issue with single matrix
andrewtelnov Jan 2, 2025
e909da0
Refactor getting singleInputLocTitle property
andrewtelnov Jan 2, 2025
00df072
Show correct title for questions cells
andrewtelnov Jan 2, 2025
bb2a07b
FIx the issue with frame styles for cells questions
andrewtelnov Jan 2, 2025
10ab08d
Support isAllRowRequired for single matrix
andrewtelnov Jan 2, 2025
3b66eb9
Add unit test for nested case
andrewtelnov Jan 2, 2025
d4a36c9
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 4, 2025
6369e20
Implement basic functionality for nested elements
andrewtelnov Jan 7, 2025
a88b25a
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 7, 2025
67227e0
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 10, 2025
db094c4
show the matrix dynamic before going to another question
andrewtelnov Jan 12, 2025
70a914b
Show summary for panel dynamic
andrewtelnov Jan 12, 2025
4720701
Create singleInputSummary model
andrewtelnov Jan 13, 2025
190dd43
Support edit item in single summary model
andrewtelnov Jan 13, 2025
0f49a5b
Refactor add/remove button visibility
andrewtelnov Jan 13, 2025
8cf7fce
Refactor code related to navigation
andrewtelnov Jan 13, 2025
3a631d1
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 14, 2025
b068194
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 15, 2025
553354b
Create new unit test on nested scenario
andrewtelnov Jan 16, 2025
1c0bccf
Fix callstack error
andrewtelnov Jan 16, 2025
4fe61f2
Correct next question
andrewtelnov Jan 16, 2025
b99e4fa
Fix infinitive loop issue
andrewtelnov Jan 16, 2025
42953b4
Make the nested unit test works
andrewtelnov Jan 16, 2025
b1b914f
Fix all unit tests
andrewtelnov Jan 16, 2025
dd81fe5
Fix backward navigation in nested
andrewtelnov Jan 16, 2025
1422dd5
Fix func name
andrewtelnov Jan 16, 2025
036d5fb
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 16, 2025
053c5b7
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Jan 20, 2025
270d973
Improve delete buttons behavior in summary
andrewtelnov Jan 20, 2025
4734fd1
Do not show tabs in panel dynamic
andrewtelnov Jan 20, 2025
9f5bb78
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 4, 2025
0fac09b
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 6, 2025
7547768
Remove code for "Remove" button in the navigation bar
andrewtelnov Feb 6, 2025
150ff07
Fix navigation for nested questions
andrewtelnov Feb 7, 2025
bf3e88e
Add singile input navigation actions
andrewtelnov Feb 7, 2025
039d988
Implement navigation doAction
andrewtelnov Feb 7, 2025
b5fa667
Change the way we work with question.locTitle
andrewtelnov Feb 10, 2025
9a5575a
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 11, 2025
efd72d8
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 12, 2025
a419489
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 19, 2025
60a1b3e
Add styled components, #9195
novikov82 Feb 24, 2025
eb2daea
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 25, 2025
44b9060
Remove add button from the summary placeholder
andrewtelnov Feb 25, 2025
583b2bc
Use question placeholder in summary table
andrewtelnov Feb 25, 2025
a506afe
fixed survey widthMode, 9195
novikov82 Feb 25, 2025
e46680e
fixed items styles, #9195
novikov82 Feb 25, 2025
fc818d6
Merge branch 'features/9195-input-per-page' of https://github.com/sur…
novikov82 Feb 25, 2025
c9b332a
fix breadcrumbs styles, #9195
novikov82 Feb 25, 2025
1d8d5a4
fix question title style, #9195
novikov82 Feb 25, 2025
3912c54
Fix vrt test
andrewtelnov Feb 25, 2025
dde9bb3
Merge branch 'features/9195-input-per-page' of https://github.com/sur…
novikov82 Feb 25, 2025
ed065e9
FIx bug with text in summary for panel dynamic
andrewtelnov Feb 25, 2025
30f38e7
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Feb 26, 2025
8a62733
Change the navigation for matrix/panel dynamic
andrewtelnov Feb 27, 2025
abdd75e
Refactor fillSingleInputQuestionsInContainer function
andrewtelnov Feb 27, 2025
266c09a
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Mar 3, 2025
add5553
Change single input action behavior
andrewtelnov Mar 3, 2025
ec10372
Add element.locRenderedTitle
andrewtelnov Mar 3, 2025
5caf185
Focus question with the error
andrewtelnov Mar 3, 2025
f31d629
Fix issues with validation
andrewtelnov Mar 4, 2025
8204139
Call resetNavigationButton
andrewtelnov Mar 4, 2025
9f4b49c
Introduce rowText property
andrewtelnov Mar 4, 2025
da61877
Merge branch 'master' into features/9195-input-per-page
andrewtelnov Mar 13, 2025
dd37b63
Fix unit tests
andrewtelnov Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/survey-core/entries/chunks/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export { PageModel } from "../../src/page";
export * from "../../src/template-renderer";
export { DefaultTitleModel } from "../../src/defaultTitle";
export { Question } from "../../src/question";
export { QuestionSingleInputSummary, QuestionSingleInputSummaryItem } from "../../src/questionSingleInputSummary";
export { QuestionNonValue } from "../../src/questionnonvalue";
export { QuestionEmptyModel } from "../../src/question_empty";
export {
Expand Down
4 changes: 4 additions & 0 deletions packages/survey-core/src/base-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ export interface ISurvey extends ITextProcessor, ISurveyErrorOwner {
isDisplayMode: boolean;
isDesignMode: boolean;
areInvisibleElementsShowing: boolean;
currentSingleQuestion: IQuestion;
isSingleVisibleInput: boolean;
updateNavigationElements(): void;
currentSingleElement: IElement;
areEmptyElementsHidden: boolean;
isLoadingFromJson: boolean;
Expand Down Expand Up @@ -378,6 +381,7 @@ export interface ITitleOwner {
isRequireTextBeforeTitle: boolean;
isRequireTextAfterTitle: boolean;
locTitle: LocalizableString;
locRenderedTitle: LocalizableString;
}
export interface IProgressInfo {
questionCount: number;
Expand Down
45 changes: 45 additions & 0 deletions packages/survey-core/src/default-theme/blocks/sd-breadcrumbs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@use "../variables.scss" as *;
@use "../mixins.scss" as mixins;

.sd-breadcrumbs {
display: flex;
align-items: center;
align-content: center;
gap: var(--lbr-breadcrumbs-gap, calcSize(1));
align-self: stretch;
flex-wrap: wrap;
padding-bottom: var(--lbr-page-header-breadcrumbs-margin-bottom, 20px);
}

.sd-breadcrumbs-item {
color: var(--lbr-breadcrumbs-item-text-color, $foreground-dim-light);
@include mixins.defaultFont;
}

.sd-breadcrumbs-item__button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
display: flex;
padding: 0;
box-sizing: border-box;
border: none;
background-color: transparent;
cursor: pointer;
color: unset;
font-size: unset;
font-family: unset;
overflow-x: hidden;
white-space: nowrap;
}

.sd-breadcrumbs-separator {
display: flex;
width: var(--lbr-breadcrumbs-item-separator-icon-width, calcSize(1.5));
height: var(--lbr-breadcrumbs-item-separator-icon-height, calcSize(1.5));
justify-content: center;
align-items: center;
use {
fill: var(--lbr-breadcrumbs-item-separator-color, $foreground-dim-light);
}
}
7 changes: 7 additions & 0 deletions packages/survey-core/src/default-theme/blocks/sd-element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
}
}

.sd-element__title.sd-element__title--singleinput {
span {
@include mixins.page_title();
}
}


.sd-element__num {
float: left;
padding-top: calcSize(0.625);
Expand Down
41 changes: 26 additions & 15 deletions packages/survey-core/src/default-theme/blocks/sd-question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@
container-type: inline-size;
}

.sd-question--title-top > .sd-question__erbox--above-question {
.sd-question--title-top>.sd-question__erbox--above-question {
margin-bottom: calc(0.5 * var(--sd-base-vertical-padding));
}

.sd-question--description-under-input > .sd-question__erbox--below-question,
.sd-question--title-bottom > .sd-question__erbox--below-question {
.sd-question--description-under-input>.sd-question__erbox--below-question,
.sd-question--title-bottom>.sd-question__erbox--below-question {
margin-top: calc(0.25 * var(--sd-base-vertical-padding) + 0.5 * #{$base-unit});
}

.sd-element--with-frame > .sd-element__erbox--above-element {
.sd-element--with-frame>.sd-element__erbox--above-element {
margin-bottom: var(--sd-base-padding);
border-radius: calcCornerRadius(1) calcCornerRadius(1) 0 0;
}

.sd-question--left > .sd-element__erbox--above-element {
.sd-question--left>.sd-element__erbox--above-element {
margin-bottom: 0;
}

.sd-element--with-frame.sd-question--left > .sd-element__erbox--above-element {
.sd-element--with-frame.sd-question--left>.sd-element__erbox--above-element {
margin-bottom: calc(1 * var(--sd-base-vertical-padding));
}

.sd-element--with-frame > .sd-question__erbox--below-question {
.sd-element--with-frame>.sd-question__erbox--below-question {
margin-top: auto;
border-radius: 0 0 calcCornerRadius(1) calcCornerRadius(1);
}

.sd-element--with-frame.sd-question--title-top > .sd-question__erbox--above-question {
.sd-element--with-frame.sd-question--title-top>.sd-question__erbox--above-question {
margin-bottom: calc(0.5 * var(--sd-base-vertical-padding) + #{$base-unit});
}

.sd-element--with-frame.sd-question--description-under-input > .sd-question__erbox--below-question,
.sd-element--with-frame.sd-question--title-bottom > .sd-question__erbox--below-question {
.sd-element--with-frame.sd-question--description-under-input>.sd-question__erbox--below-question,
.sd-element--with-frame.sd-question--title-bottom>.sd-question__erbox--below-question {
margin-top: calc(0.5 * var(--sd-base-vertical-padding) + #{$base-unit});
}

Expand Down Expand Up @@ -88,12 +88,12 @@
display: flex;
flex-direction: column;

& > .sd-question__content {
&>.sd-question__content {
margin-bottom: var(--sd-base-padding);
}
}

& > .sd-element__erbox {
&>.sd-element__erbox {
margin-left: calc(-1 * var(--sd-base-padding));
margin-right: calc(-1 * var(--sd-base-padding));
width: calc(100% + 2 * var(--sd-base-padding));
Expand Down Expand Up @@ -127,7 +127,7 @@
max-width: 100%;
}

.sd-element--with-frame > .sd-question__content--left {
.sd-element--with-frame>.sd-question__content--left {
margin: 0;
}

Expand Down Expand Up @@ -159,8 +159,8 @@
line-height: multiply(1.5, $font-editorfont-size);
color: $font-questionplaceholder-color;

& > div,
& > span {
&>div,
&>span {
.sv-string-viewer {
white-space: pre-line;
}
Expand All @@ -179,6 +179,17 @@
height: multiply(1.5, $font-questiontitle-size);
}
}

.sd-question__content {
box-sizing: border-box;
}

.sd-singleinput__title {
font-family: $font-pagetitle-family;
font-weight: $font-pagetitle-weight;
font-size: var(--page-title-font-size);
color: $font-pagetitle-color;
position: static;
line-height: multiply(1.33, var(--page-title-font-size));
margin: 0 0 calcSize(0.5) 0px;
}
118 changes: 118 additions & 0 deletions packages/survey-core/src/default-theme/blocks/sd-summary.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
@use "../variables.scss" as *;
@use "../mixins.scss" as mixins;

.sd-summary {
border-radius: var(--lbr-data-table-corner-radius, calcSize(0.5));
background: var(--lbr-data-table-background-color, $background);
box-shadow: var(--lbr-data-table-shadow-offset-x, 0px) var(--lbr-data-table-shadow-offset-y, 1px)
var(--lbr-data-table-shadow-blur, 2px) var(--lbr-data-table-shadow-spread, 0px)
var(--lbr-data-table-shadow-color, rgba(0, 0, 0, 0.15));
overflow: hidden;
}

.sd-summary-row {
display: flex;
padding: var(--lbr-data-table-row-padding-top, calcSize(1)) var(--lbr-data-table-row-padding-right, calcSize(2))
var(--lbr-data-table-row-padding-bottom, calcSize(1)) var(--lbr-data-table-row-padding-left, calcSize(2));
align-items: flex-start;
gap: var(--lbr-data-table-row-gap, calcSize(4));
flex: 1 0 0;
align-self: stretch;

border-bottom: var(--lbr-data-table-row-border-width-bottom, 1px) solid
var(--lbr-data-table-row-border-color, $border-light);
background: var(--lbr-data-table-row-background-color, $background);
}

.sd-summary-row__content {
display: flex;
padding: var(--lbr-data-table-row-text-margin-top, calcSize(0.5)) 0px
var(--lbr-data-table-row-text-margin-bottom, calcSize(0.5)) 0px;
align-items: flex-start;
gap: var(--lbr-data-table-row-gap, calcSize(4));
flex: 1 0 0;

color: var(--lbr-data-table-row-text-color-title, $foreground);
@include mixins.defaultFont;
}

.sd-summary-row__actions {
display: flex;
align-items: flex-start;
gap: var(--lbr-data-table-actions-gap, calcSize(1));
opacity: 0;
transition: opacity $transition-duration;
}

.sd-summary-row:hover,
.sd-question--mobile {
.sd-summary-row__actions {
opacity: 1;
}
}

.sd-summary-row-action {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
display: flex;
padding: 0;
box-sizing: border-box;
border: none;
background-color: transparent;
cursor: pointer;
color: unset;

font-family: $font-family;
overflow-x: hidden;
white-space: nowrap;

display: flex;
padding: var(--lbr-action-button-padding-top, calcSize(1))
var(--lbr-action-button-padding-right-icon-only, calcSize(1)) var(--lbr-action-button-padding-bottom, calcSize(1))
var(--lbr-action-button-padding-left-icon-only, calcSize(1));
justify-content: center;
align-items: center;
gap: var(--lbr-action-button-gap, calcSize(1));

border-radius: var(--lbr-action-button-corner-radius, 1024px);
transition: background-color $transition-duration;
&:hover,
&:focus {
outline: none;
background-color: var(--lbr-action-button-background-color-hovered-positive, $primary-light);
}

//pressed state
&:active,
&.svc-toolbar__item--pressed {
opacity: 0.5;
}

//checked state
&.svc-toolbar__item--active {
outline: none;
}

//disabled state
&:disabled {
opacity: 0.25;
cursor: default;
}
}

.sd-summary-row-action--edit {
use {
fill: var(--lbr-action-button-icon-color-positive, $primary);
}
}
.sd-summary-row-action--delete {
&:hover,
&:focus {
outline: none;
background-color: var(--lbr-action-button-background-color-hovered-negative, $red-light);
}
use {
fill: var(--lbr-action-button-icon-color-negative, $red);
}
}
2 changes: 2 additions & 0 deletions packages/survey-core/src/default-theme/default.fontless.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
@use "blocks/header.scss";
@use "blocks/sd-loading-indicator.scss";
@use "blocks/sd-components-container.scss";
@use "blocks/sd-breadcrumbs.scss";
@use "blocks/sd-summary.scss";
@use "./default.m600.scss";

body {
Expand Down
15 changes: 14 additions & 1 deletion packages/survey-core/src/defaultCss/defaultCss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,20 @@ export var defaultCss = {
errorsContainer: "sd-element__erbox sd-question__erbox",
errorsContainerTop: "sd-element__erbox--above-element sd-question__erbox--above-question",
errorsContainerBottom: "sd-question__erbox--below-question",
confirmDialog: "sd-popup--confirm sv-popup--confirm"
confirmDialog: "sd-popup--confirm sv-popup--confirm",
singleInputTitle: "sd-element__title--singleinput",
singleInputWrapper: "sd-question__singleinput-wrapper",
breadcrumbsRoot: "sd-breadcrumbs",
breadcrumbsItem: "sd-breadcrumbs-item",
breadcrumbsItemButton: "sd-breadcrumbs-item__button",
breadcrumbsSeparator: "sd-breadcrumbs-separator",
summary: "sd-summary",
summaryRow: "sd-summary-row",
summaryRowContent: "sd-summary-row__content",
summaryRowActions: "sd-summary-row__actions",
summaryRowAction: "sd-summary-row-action",
summaryRowActionEdit: "sd-summary-row-action sd-summary-row-action--edit",
summaryRowActionDelete: "sd-summary-row-action sd-summary-row-action--delete",
},
image: {
mainRoot: "sd-element sd-question sd-question--image",
Expand Down
3 changes: 3 additions & 0 deletions packages/survey-core/src/images-v1/delete-16x16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/survey-core/src/images-v1/editsmall-16x16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/survey-core/src/images-v2/delete-16x16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/survey-core/src/images-v2/editsmall-16x16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/survey-core/src/localization/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export var englishStrings = {
addRow: "Add Row",
removeRow: "Remove",
noRowsText: "There are no rows.",
rowIndexTemplateTitle: "Row {rowIndex}",
rowNameTemplateTitle: "{rowText}",
addPanel: "Add new",
removePanel: "Remove",
showDetails: "Show Details",
Expand Down
Loading