Skip to content

Commit

Permalink
Merge branch 'master' into a11y/6058-better-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed May 16, 2023
2 parents a66cf31 + 003c619 commit 2c0daa8
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 71 deletions.
2 changes: 1 addition & 1 deletion docs/design-survey-pre-populate-form-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const subscribedQuestion = survey.getQuestionByName("subscribed");
subscribedQuestion.value = true;
```

Alternatively, you can call the Survey's [`setValue(questionName, newValue)`]() method:
Alternatively, you can call the Survey's [`setValue(questionName, newValue)`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#setValue) method:

```js
import { Model } from "survey-core";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AngularComponentFactory } from "../component-factory";
})
export class PanelDynamicQuestionComponent extends QuestionAngular<QuestionPanelDynamicModel | any> implements OnInit {
get renderedPanels(): PanelModel[] {
if (this.model.isRenderModeList) return this.model.panels;
if (this.model.isRenderModeList) return this.model.visiblePanels;
const panels = [];
if (this.model.currentPanel) {
panels.push(this.model.currentPanel);
Expand Down
30 changes: 26 additions & 4 deletions src/actions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ export type actionModeType = "large" | "small" | "popup" | "removed";

/**
* An action item.
*
* Action items are used in the Toolbar, matrix rows, titles of pages, panels, questions, and other survey elements.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
export interface IAction {
/**
* A unique action item identifier.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
id?: string;
/**
Expand All @@ -27,6 +31,8 @@ export interface IAction {
visible?: boolean;
/**
* The action item's title.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see showTitle
* @see disableShrink
*/
Expand All @@ -52,19 +58,29 @@ export interface IAction {
showTitle?: boolean;
/**
* A function that is executed when users click the action item.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
action?: (context?: any) => void;
/**
* One or several CSS classes that you want to apply to the outer `<div>` element.
*
* In the markup, an action item is rendered as an `<input>` wrapped in a `<div>`. The `css` property applies classes to the `<div>`.
* To apply several classes, separate them with a space character: "myclass1 myclass2".
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see innerCss
*/
css?: string;
/**
* One or several CSS classes that you want to apply to the inner `<input>` element.
*
* In the markup, an action item is rendered as an `<input>` wrapped in a `<div>`. The `innerCss` property applies classes to the `<input>`.
* To apply several classes, separate them with a space character: "myclass1 myclass2".
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see css
*/
innerCss?: string;
Expand All @@ -76,7 +92,8 @@ export interface IAction {
needSeparator?: boolean; //TODO: temp
/**
* Specifies whether the action item is active.
* Use it as a flag to specify different action item appearances in different states.
*
* Use this property as a flag to specify different action item appearances in different states.
* @see enabled
* @see visible
*/
Expand Down Expand Up @@ -124,6 +141,11 @@ export interface IAction {
disableShrink?: boolean;
disableHide?: boolean;
mode?: actionModeType;
/**
* A number that specifies the action's position relative to other actions.
*
* [View Demo](/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
visibleIndex?: number;
needSpace?: boolean;
ariaChecked?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_paneldynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class QuestionPanelDynamicImplementor extends QuestionImplementor {
"koRangeMax",
ko.pureComputed(() => {
this.koRecalc();
return this.question.panelCount - 1;
return this.question.visiblePanelCount - 1;
})
);

Expand Down

0 comments on commit 2c0daa8

Please sign in to comment.