Skip to content

Commit

Permalink
Merge branch 'master' into bug/C4484-memory-leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Aug 29, 2023
2 parents 9417dba + ae4c84f commit 6ad2314
Show file tree
Hide file tree
Showing 66 changed files with 5,560 additions and 309 deletions.
29 changes: 29 additions & 0 deletions devops-visual-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
steps:
- checkout: self

- task: PowerShell@2
displayName: 'update Google Chrome to latest'
inputs:
targetType: 'inline'
script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -76,6 +81,12 @@ jobs:
steps:
- checkout: self

- task: PowerShell@2
displayName: 'update Google Chrome to latest'
inputs:
targetType: 'inline'
script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer'

- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -132,6 +143,12 @@ jobs:
steps:
- checkout: self

- task: PowerShell@2
displayName: 'update Google Chrome to latest'
inputs:
targetType: 'inline'
script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer'

- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -189,6 +206,12 @@ jobs:
persistCredentials: true
clean: true

- task: PowerShell@2
displayName: 'update Google Chrome to latest'
inputs:
targetType: 'inline'
script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer'

- task: NodeTool@0
inputs:
versionSpec: "14.x"
Expand Down Expand Up @@ -269,6 +292,12 @@ jobs:
persistCredentials: true
clean: true

- task: PowerShell@2
displayName: 'update Google Chrome to latest'
inputs:
targetType: 'inline'
script: '$Path = $env:TEMP; $Installer = ''chrome_installer.exe''; Invoke-WebRequest -Uri ''http://dl.google.com/chrome/install/375.126/chrome_installer.exe'' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args ''/silent /install'' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer'

- task: NodeTool@0
inputs:
versionSpec: "16.x"
Expand Down
8 changes: 8 additions & 0 deletions src/base-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,11 @@ export interface ISurveyLayoutElement {
template?: string;
data?: any;
}
export interface IPlainDataOptions {
includeEmpty?: boolean;
includeQuestionTypes?: boolean;
includeValues?: boolean;
calculations?: Array<{
propertyName: string,
}>;
}
68 changes: 67 additions & 1 deletion src/defaultV2-theme/blocks/sd-completedpage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,74 @@
text-align: center;
height: auto;

// h3 {
// font-size: calcFontSize(1.5);
// }

h1 {
@include articleXXLargeFont;
}

h2 {
@include articleXLargeFont;
}

h3 {
font-size: calcFontSize(1.5);
@include articleLargeFont;
}

h4 {
@include articleMediumFont;
}

h5,
h6 {
color: $foreground;
}

span,
div,
p {
@include articleDefaultFont;
}

a {
color: $primary;
}

button {
display: flex;
align-items: center;
padding: calcSize(1.5) calcSize(4);
vertical-align: baseline;
text-align: center;
background-color: $background;
box-shadow: $shadow-small;
border: none;
border-radius: calcSize(0.5);
cursor: pointer;
user-select: none;
outline: solid calcSize(0.25) transparent;

&:hover {
background-color: $background-dark;
}
&:focus {
box-shadow: 0 0 0 2px $primary;
}

span {
display: flex;
align-items: center;
flex-grow: 1;
justify-content: center;
color: $primary;
font-weight: 600;
font-style: normal;
font-family: var(--font-family, $font-family);
font-size: $font-questiontitle-size;
line-height: multiply(1.5, $font-questiontitle-size);
}
}
}

Expand Down
68 changes: 68 additions & 0 deletions src/defaultV2-theme/blocks/sd-html.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
.sd-html {
white-space: initial;
}

.sd-html {
h1 {
@include articleXXLargeFont;
}

h2 {
@include articleXLargeFont;
}

h3 {
@include articleLargeFont;
}

h4 {
@include articleMediumFont;
}

h5,
h6 {
color: $foreground;
}

span,
div,
p {
@include articleDefaultFont;
}

a {
color: $primary;
}

button {
display: flex;
align-items: center;
padding: calcSize(1.5) calcSize(4);
vertical-align: baseline;
text-align: center;
background-color: $background;
box-shadow: $shadow-small;
border: none;
border-radius: calcSize(0.5);
cursor: pointer;
user-select: none;
outline: solid calcSize(0.25) transparent;

&:hover {
background-color: $background-dark;
}
&:focus {
box-shadow: 0 0 0 2px $primary;
}

span {
display: flex;
align-items: center;
flex-grow: 1;
justify-content: center;
color: $primary;
font-weight: 600;
font-style: normal;
font-family: var(--font-family, $font-family);
font-size: $font-questiontitle-size;
line-height: multiply(1.5, $font-questiontitle-size);
}
}
}
72 changes: 71 additions & 1 deletion src/defaultV2-theme/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,74 @@ $base-unit: var(--sjs-base-unit, var(--base-unit, 8px));
@mixin borderLight {
border: calcSize(0.25) solid $border-light;
border-radius: calcCornerRadius(1);
}
}

@mixin articleXXLargeFont {
color: $foreground;
font-size: var(--sjs-article-font-xx-large-fontSize, 64px);
text-decoration: var(--sjs-article-font-xx-large-textDecoration, "none");
font-family: $font-family;
font-weight: var(--sjs-article-font-xx-large-fontWeight, 700);
font-style: var(--sjs-article-font-xx-large-fontStyle, "normal");
font-stretch: var(--sjs-article-font-xx-large-fontStretch, "normal");
letter-spacing: var(--sjs-article-font-xx-large-letterSpacing, 0);
line-height: var(--sjs-article-font-xx-large-lineHeight, 64px);
text-indent: var(--sjs-article-font-xx-large-paragraphIndent, 0px);
text-transform: var(--sjs-article-font-xx-large-textCase, "none");
}

@mixin articleXLargeFont {
color: $foreground;
font-size: var(--sjs-article-font-x-large-fontSize, 48px);
text-decoration: var(--sjs-article-font-x-large-textDecoration, "none");
font-family: $font-family;
font-weight: var(--sjs-article-font-x-large-fontWeight, 700);
font-style: var(--sjs-article-font-x-large-fontStyle, "normal");
font-stretch: var(--sjs-article-font-x-large-fontStretch, "normal");
letter-spacing: var(--sjs-article-font-x-large-letterSpacing, 0);
line-height: var(--sjs-article-font-x-large-lineHeight, 56px);
text-indent: var(--sjs-article-font-x-large-paragraphIndent, 0px);
text-transform: var(--sjs-article-font-x-large-textCase, "none");
}

@mixin articleLargeFont {
color: $foreground;
font-size: var(--sjs-article-font-large-fontSize, 32px);
text-decoration: var(--sjs-article-font-large-textDecoration, "none");
font-family: $font-family;
font-weight: var(--sjs-article-font-large-fontWeight, 700);
font-style: var(--sjs-article-font-large-fontStyle, "normal");
font-stretch: var(--sjs-article-font-large-fontStretch, "normal");
letter-spacing: var(--sjs-article-font-large-letterSpacing, 0);
line-height: var(--sjs-article-font-large-lineHeight, 40px);
text-indent: var(--sjs-article-font-large-paragraphIndent, 0px);
text-transform: var(--sjs-article-font-large-textCase, "none");
}

@mixin articleMediumFont {
color: $foreground;
font-size: var(--sjs-article-font-medium-fontSize, 24px);
text-decoration: var(--sjs-article-font-medium-textDecoration, "none");
font-family: $font-family;
font-weight: var(--sjs-article-font-medium-fontWeight, 700);
font-style: var(--sjs-article-font-medium-fontStyle, "normal");
font-stretch: var(--sjs-article-font-medium-fontStretch, "normal");
letter-spacing: var(--sjs-article-font-medium-letterSpacing, 0);
line-height: var(--sjs-article-font-medium-lineHeight, 32px);
text-indent: var(--sjs-article-font-medium-paragraphIndent, 0px);
text-transform: var(--sjs-article-font-medium-textCase, "none");
}

@mixin articleDefaultFont {
color: $foreground;
font-size: var(--sjs-article-font-default-fontSize, 16px);
text-decoration: var(--sjs-article-font-default-textDecoration, "none");
font-family: $font-family;
font-weight: var(--sjs-article-font-default-fontWeight, 400);
font-style: var(--sjs-article-font-default-fontStyle, "normal");
font-stretch: var(--sjs-article-font-default-fontStretch, "normal");
letter-spacing: var(--sjs-article-font-default-letterSpacing, 0);
line-height: var(--sjs-article-font-default-lineHeight, 28px);
text-indent: var(--sjs-article-font-default-paragraphIndent, 0px);
text-transform: var(--sjs-article-font-default-textCase, "none");
}
3 changes: 3 additions & 0 deletions src/dropdownListModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ export class DropdownListModel extends Base {
if (options.name == "value") {
this.showInputFieldComponent = this.question.showInputFieldComponent;
}
if(options.name == "choicesLazyLoadEnabled" && options.newValue) {
this.listModel.setOnFilterStringChangedCallback(this.listModelFilterStringChanged);
}
}
protected focusItemOnClickAndPopup() {
if (this._popupModel.isVisible && this.question.value)
Expand Down
2 changes: 2 additions & 0 deletions src/entries/chunks/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export {
ISurveyData,
ITitleOwner,
ISurveyLayoutElement,
IPlainDataOptions as IPlainData,
IShortcutText
} from "../../base-interfaces";
export { SurveyError } from "../../survey-error";
Expand Down Expand Up @@ -199,6 +200,7 @@ export {
SurveyTriggerVisible,
SurveyTriggerCopyValue,
SurveyTriggerRunExpression,
SurveyTriggerSkip,
Trigger
} from "../../trigger";
export { PopupSurveyModel, SurveyWindowModel } from "../../popup-survey";
Expand Down
3 changes: 3 additions & 0 deletions src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export class ListModel<T extends BaseAction = Action> extends ActionContainer<T>
this.selectedItem = selectedItem;
}

public setOnFilterStringChangedCallback(callback: (text: string) => void) {
this.onFilterStringChangedCallback = callback;
}
public setItems(items: Array<IAction>, sortByVisibleIndex = true): void {
super.setItems(items, sortByVisibleIndex);
if(this.elementId) {
Expand Down
19 changes: 6 additions & 13 deletions src/question.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HashTable, Helpers } from "./helpers";
import { JsonObject, Serializer, property } from "./jsonobject";
import { Base, EventBase } from "./base";
import { IElement, IQuestion, IPanel, IConditionRunner, ISurveyImpl, IPage, ITitleOwner, IProgressInfo, ISurvey } from "./base-interfaces";
import { IElement, IQuestion, IPanel, IConditionRunner, ISurveyImpl, IPage, ITitleOwner, IProgressInfo, ISurvey, IPlainDataOptions } from "./base-interfaces";
import { SurveyElement } from "./survey-element";
import { surveyLocalization } from "./surveyStrings";
import { AnswerRequiredError, CustomError } from "./error";
Expand Down Expand Up @@ -1528,15 +1528,7 @@ export class Question extends SurveyElement<Question>
*
* Pass an object with the `includeEmpty` property set to `false` if you want to skip empty answers.
*/
public getPlainData(
options?: {
includeEmpty?: boolean,
includeQuestionTypes?: boolean,
calculations?: Array<{
propertyName: string,
}>,
}
): IQuestionPlainData {
public getPlainData(options?: IPlainDataOptions): IQuestionPlainData {
if (!options) {
options = { includeEmpty: true, includeQuestionTypes: false };
}
Expand All @@ -1554,9 +1546,7 @@ export class Question extends SurveyElement<Question>
questionPlainData.questionType = this.getType();
}
(options.calculations || []).forEach((calculation) => {
questionPlainData[calculation.propertyName] = this[
calculation.propertyName
];
questionPlainData[calculation.propertyName] = this.getPlainDataCalculatedValue(calculation.propertyName);
});
if (this.hasComment) {
questionPlainData.isNode = true;
Expand All @@ -1577,6 +1567,9 @@ export class Question extends SurveyElement<Question>
}
return undefined;
}
protected getPlainDataCalculatedValue(propName: string): any {
return this[propName];
}
/**
* A correct answer to this question. Specify this property if you want to [create a quiz](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
* @see SurveyModel.getCorrectAnswerCount
Expand Down
Loading

0 comments on commit 6ad2314

Please sign in to comment.