Skip to content

Commit

Permalink
#6336 SurveyCreator: Rename maximum... properties
Browse files Browse the repository at this point in the history
Fixes #6336
  • Loading branch information
novikov82 committed Dec 27, 2024
1 parent 4455417 commit 658a5d8
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 22 deletions.
52 changes: 39 additions & 13 deletions packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,36 +887,62 @@ export class SurveyCreatorModel extends Base
/**
* Limits the number of columns that users can add to [Matrix](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel), [Matrix Dynamic](https://surveyjs.io/Documentation/Library?id=questionmatrixdynamicmodel), and [Matrix Dropdown](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumColumnsCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxColumns`)
*/
public maximumColumnsCount: number =
settings.propertyGrid.maximumColumnsCount;
public maxColumns: number =
settings.propertyGrid.maximumColumnsCount || settings.propertyGrid.maxColumns;
/**
* Obsolete. Use `maxColumns` instead.
*/
public get maximumColumnsCount() { return this.maxColumns; }
public set maximumColumnsCount(val) { this.maxColumns = val; }
/**
* Limits the number of choices that users can add to [Checkbox](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel), [Dropdown](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel), and [Radiogroup](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumChoicesCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxChoices`)
*/
public maxChoices: number =
settings.propertyGrid.maximumChoicesCount || settings.propertyGrid.maxChoices;
/**
* Obsolete. Use `maxChoices` instead.
*/
public maximumChoicesCount: number =
settings.propertyGrid.maximumChoicesCount;
public get maximumChoicesCount() { return this.maxChoices; }
public set maximumChoicesCount(val) { this.maxChoices = val; }

/**
* Limits the minimum number of choices in [Checkbox](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel), [Dropdown](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel), and [Radiogroup](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) questions. Set this property if users should not delete choices below the specified limit.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.minimumChoicesCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.minChoices`)
*/
public minimumChoicesCount: number =
settings.propertyGrid.minimumChoicesCount;
public minChoices: number =
settings.propertyGrid.minimumChoicesCount || settings.propertyGrid.minChoices;
/**
* Obsolete. Use `minChoices` instead.
*/
public get minimumChoicesCount() { return this.minChoices; }
public set minimumChoicesCount(val) { this.minChoices = val; }
/**
* Limits the number of rows that users can add to [Matrix](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel) and [Matrix Dropdown](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumRowsCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxRows`)
*/
public maxRows: number = settings.propertyGrid.maximumRowsCount || settings.propertyGrid.maxRows;
/**
* Obsolete. Use `maxRows` instead.
*/
public maximumRowsCount: number = settings.propertyGrid.maximumRowsCount;
public get maximumRowsCount() { return this.maxRows; }
public set maximumRowsCount(val) { this.maxRows = val; }
/**
* Limits the number of rate values that users can add to [Rating](https://surveyjs.io/Documentation/Library?id=questionratingmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumRateValues`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxRateValues`)
*/
public maxRateValues: number = settings.propertyGrid.maximumRateValues || settings.propertyGrid.maxRateValues;
/**
* Obsolete. Use `maxRateValues` instead.
*/
public maximumRateValues: number = settings.propertyGrid.maximumRateValues;
public get maximumRateValues() { return this.maxRateValues; }
public set maximumRateValues(val) { this.maxRateValues = val; }

/**
* Limits the number of nested panels within a [Panel](https://surveyjs.io/form-library/documentation/api-reference/panel-model) element.
Expand Down
39 changes: 30 additions & 9 deletions packages/survey-creator-core/src/creator-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,33 +182,54 @@ export interface ICreatorOptions {
/**
* Limits the number of columns that users can add to [Matrix](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel), [Matrix Dynamic](https://surveyjs.io/Documentation/Library?id=questionmatrixdynamicmodel), and [Matrix Dropdown](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumColumnsCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxColumns`)
*/
maximumColumnsCount?: number;
maxColumns?: number;
/**
* Limits the minimum number of choices in [Checkbox](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel), [Dropdown](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel), and [Radiogroup](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) questions. Set this property if users should not delete choices below the specified limit.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.minimumChoicesCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.minChoices`)
*/
minimumChoicesCount?: number;
minChoices?: number;
/**
* Limits the number of choices that users can add to [Checkbox](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel), [Dropdown](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel), and [Radiogroup](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumChoicesCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxChoices`)
*/
maximumChoicesCount?: number;
maxChoices?: number;
/**
* Limits the number of rows that users can add to [Matrix](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel) and [Matrix Dropdown](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumRowsCount`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxRows`)
*/
maximumRowsCount?: number;
maxRows?: number;
/**
* Limits the number of rate values that users can add to [Rating](https://surveyjs.io/Documentation/Library?id=questionratingmodel) questions.
*
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumRateValues`)
* Default value: 0 (unlimited, taken from `settings.propertyGrid.maxRateValues`)
*/
maxRateValues?: number;
/**
* Obsolete. Use `maxColumns` instead.
*/
maximumColumnsCount?: number;
/**
* Obsolete. Use `minChoices` instead.
*/
minimumChoicesCount?: number;
/**
* Obsolete. Use `maxChoices` instead.
*/
maximumChoicesCount?: number;
/**
* Obsolete. Use `maxRows` instead.
*/
maximumRowsCount?: number;
/**
* Obsolete. Use `maxRateValues` instead.
*/
maximumRateValues?: number;

/**
* Limits the number of items in a logical expression.
*
Expand Down
5 changes: 5 additions & 0 deletions packages/survey-creator-core/src/creator-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export var settings = {
maxCharsInButtonGroup: 25,
showNavigationButtons: false,
enableSearch: true,
maxColumns: 0,
minChoices: 0,
maxChoices: 0,
maxRows: 0,
maxRateValues: 0,
maximumColumnsCount: 0,
minimumChoicesCount: 0,
maximumChoicesCount: 0,
Expand Down

0 comments on commit 658a5d8

Please sign in to comment.