Skip to content

Commit

Permalink
Merge branch 'feature/vue3' of https://github.com/surveyjs/survey-lib…
Browse files Browse the repository at this point in the history
…rary into feature/vue3
  • Loading branch information
dk981234 committed Jun 21, 2023
2 parents dbcd3fe + 1248e0c commit 7dfa1fa
Show file tree
Hide file tree
Showing 202 changed files with 1,388 additions and 2,055 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [1.9.93](https://github.com/surveyjs/survey-library/compare/v1.9.92...v1.9.93) (2023-06-20)

## [1.9.92](https://github.com/surveyjs/survey-library/compare/v1.9.91...v1.9.92) (2023-06-14)

## [1.9.91](https://github.com/surveyjs/survey-library/compare/v1.9.90...v1.9.91) (2023-06-08)

## [1.9.90](https://github.com/surveyjs/survey-library/compare/v1.9.89...v1.9.90) (2023-05-31)
Expand Down
5 changes: 5 additions & 0 deletions docs/survey-localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ survey.locale = "customlocale";
If any translation strings are missing in your custom locale, they will be taken from the default English locale. You can specify the `defaultLocale` property to use another locale as default:

```js
import { Model, surveyLocalization } from "survey-core";

surveyLocalization.defaultLocale = "fr";

const surveyJson = { ... };
const survey = new Model(surveyJson);
```

[View Demo](https://surveyjs.io/Examples/Library/survey-localization/ (linkStyle))
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"testcafe:ci:angular": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular",
"prepare": "husky install"
},
"version": "1.9.91",
"version": "1.9.93",
"name": "survey-library",
"private": true,
"devDependencies": {
Expand Down Expand Up @@ -182,7 +182,7 @@
}
},
"dependencies": {
"signature_pad": "^2.3.2",
"signature_pad": "^4.1.5",
"vite": "^3.1.8"
}
}
4 changes: 4 additions & 0 deletions packages/survey-angular-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [1.9.93](https://github.com/surveyjs/surveyjs/compare/v1.9.92...v1.9.93) (2023-06-20)

## [1.9.92](https://github.com/surveyjs/surveyjs/compare/v1.9.91...v1.9.92) (2023-06-14)

## [1.9.91](https://github.com/surveyjs/surveyjs/compare/v1.9.90...v1.9.91) (2023-06-08)

## [1.9.90](https://github.com/surveyjs/surveyjs/compare/v1.9.89...v1.9.90) (2023-05-31)
Expand Down
2 changes: 1 addition & 1 deletion packages/survey-angular-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "survey-angular-ui",
"version": "1.9.91",
"version": "1.9.93",
"description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
"keywords": [
"Survey",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<sv-ng-element-title [element]="element"></sv-ng-element-title>
<div *ngIf="element.hasDescriptionUnderTitle" [class]="element.cssDescription" [model]="element.locDescription" [style.display]="element.isDescriptionVisible ? '': 'none' " sv-ng-string></div>
<div *ngIf="element.hasDescriptionUnderTitle" [class]="element.cssDescription" [model]="element.locDescription" [style.display]="element.hasDescription ? '': 'none' " sv-ng-string></div>
<ng-container *ngIf="!!element.additionalTitleToolbar">
<sv-ng-action-bar [model]="element.additionalTitleToolbar"></sv-ng-action-bar>
</ng-container>
4 changes: 2 additions & 2 deletions packages/survey-vue-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ const json = {
type: "imagepicker",
name: "choosepicture",
title: "Imagepicker",
imageHeight: "150px",
imageWidth: "225px",
// imageHeight: "150px",
// imageWidth: "225px",
choices: [
{
value: "lion",
Expand Down
9 changes: 6 additions & 3 deletions src/actions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ export abstract class BaseAction extends Base implements IAction {

export class Action extends BaseAction implements IAction, ILocalizableOwner {
private locTitleValue: LocalizableString;
public updateCallback: () => void;
private raiseUpdate() {
this.updateCallback && this.updateCallback();
public updateCallback: (isResetInitialized: boolean) => void;
private raiseUpdate(isResetInitialized: boolean = false) {
this.updateCallback && this.updateCallback(isResetInitialized);
}
constructor(public innerItem: IAction) {
super();
Expand All @@ -334,6 +334,9 @@ export class Action extends BaseAction implements IAction, ILocalizableOwner {
if (!!this.locTitleName) {
this.locTitleChanged();
}
this.registerFunctionOnPropertyValueChanged("_title", () => {
this.raiseUpdate(true);
});
this.locStrChangedInPopupModel();
}
private createLocTitle(): LocalizableString {
Expand Down
11 changes: 6 additions & 5 deletions src/actions/adaptive-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { ActionContainer } from "./container";
import { surveyLocalization } from "../surveyStrings";

export class AdaptiveActionContainer<T extends Action = Action> extends ActionContainer<T> {
protected dotsItem: Action;
public dotsItem: Action;
private responsivityManager: ResponsivityManager;
public minVisibleItemsCount: number = 0;
public isResponsivenessDisabled = false;

private hideItemsGreaterN(visibleItemsCount: number) {
const actionsToHide = this.visibleActions.filter(action => !action.disableHide);
visibleItemsCount = Math.max(visibleItemsCount, this.minVisibleItemsCount) - (this.visibleActions.length - actionsToHide.length);
visibleItemsCount = Math.max(visibleItemsCount, this.minVisibleItemsCount - (this.visibleActions.length - actionsToHide.length));
const hiddenItems: IAction[] = [];
actionsToHide.forEach((item) => {
if (visibleItemsCount <= 0) {
Expand All @@ -25,7 +25,8 @@ export class AdaptiveActionContainer<T extends Action = Action> extends ActionCo
}

private getVisibleItemsCount(availableSize: number): number {
const itemsSizes: number[] = this.visibleActions.map((item) => item.minDimension);
this.visibleActions.filter((action) => action.disableHide).forEach(action => availableSize -= action.minDimension);
const itemsSizes: number[] = this.visibleActions.filter(action => !action.disableHide).map((item) => item.minDimension);
let currSize: number = 0;
for (var i = 0; i < itemsSizes.length; i++) {
currSize += itemsSizes[i];
Expand Down Expand Up @@ -87,12 +88,12 @@ export class AdaptiveActionContainer<T extends Action = Action> extends ActionCo
}

protected onSet() {
this.actions.forEach(action => action.updateCallback = () => this.raiseUpdate(false));
this.actions.forEach(action => action.updateCallback = (isResetInitialized: boolean) => this.raiseUpdate(isResetInitialized));
super.onSet();
}

protected onPush(item: T) {
item.updateCallback = () => this.raiseUpdate(false);
item.updateCallback = (isResetInitialized: boolean) => this.raiseUpdate(isResetInitialized);
super.onPush(item);
}

Expand Down
2 changes: 1 addition & 1 deletion src/actions/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class ActionContainer<T extends BaseAction = Action> extends Base impleme
}

public updateCallback: (isResetInitialized: boolean) => void;
public containerCss: string;
@property({}) containerCss: string;
public sizeMode: "default" | "small" = "default";
public locOwner: ILocalizableOwner;
@property({ defaultValue: false }) isEmpty: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/base-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export interface ISurvey extends ITextProcessor, ISurveyErrorOwner {
panelVisibilityChanged(panel: IPanel, newValue: boolean): any;
questionVisibilityChanged(question: IQuestion, newValue: boolean): any;
isEditingSurveyElement: boolean;
isClearValueOnHidden: boolean;
isClearValueOnHiddenContainer: boolean;
getQuestionClearIfInvisible(questionClearIf: string): string;
questionsOrder: string;
matrixDragHandleArea: string;
keepIncorrectValues: boolean;
Expand Down
5 changes: 3 additions & 2 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ export class Base {
* @param propName A property name.
*/
public getPropertyByName(propName: string): JsonObjectProperty {
if(!this.classMetaData) {
this.classMetaData = Serializer.findClass(this.getType());
const type = this.getType();
if(!this.classMetaData || this.classMetaData.name !== type) {
this.classMetaData = Serializer.findClass(type);
}
return !!this.classMetaData ? this.classMetaData.findProperty(propName) : null;
}
Expand Down
26 changes: 19 additions & 7 deletions src/defaultCss/defaultV2Css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,18 @@ export var defaultV2Css = {
panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row",
progressBtnIcon: "icon-progressbuttonv2",
noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder",
compact: "sd-element--with-frame sd-element--compact"
compact: "sd-element--with-frame sd-element--compact",
tabsRoot: "sd-tabs-toolbar",
tabsLeft: "sd-tabs-toolbar--left",
tabsRight: "sd-tabs-toolbar--right",
tabsCenter: "sd-tabs-toolbar--center",
tabs: {
item: "sd-tab-item",
itemPressed: "sd-tab-item--pressed",
itemAsIcon: "sd-tab-item--icon",
itemIcon: "sd-tab-item__icon",
itemTitle: "sd-tab-item__title"
}
},
progress: "sd-progress sd-body__progress",
progressTop: "sd-body__progress--top",
Expand Down Expand Up @@ -625,12 +636,13 @@ export var defaultV2Css = {
other: "sd-input sd-comment sd-selectbase__other",
onError: "sd-input--error",
label: "sd-selectbase__label",
item: "sd-item sd-radio sd-selectbase__item",
itemDisabled: "sd-item--disabled sd-radio--disabled",
itemChecked: "sd-item--checked sd-radio--checked",
itemHover: "sd-item--allowhover sd-radio--allowhover",
itemControl: "sd-visuallyhidden sd-item__control sd-radio__control",
itemDecorator: "sd-item__svg sd-radio__svg",
itemSvgIconId: "#icon-v2check",
item: "sd-item sd-checkbox sd-selectbase__item",
itemDisabled: "sd-item--disabled sd-checkbox--disabled",
itemChecked: "sd-item--checked sd-checkbox--checked",
itemHover: "sd-item--allowhover sd-checkbox--allowhover",
itemControl: "sd-visuallyhidden sd-item__control sd-checkbox__control",
itemDecorator: "sd-item__svg sd-checkbox__svg",
cleanButton: "sd-tagbox_clean-button sd-dropdown_clean-button",
cleanButtonSvg: "sd-tagbox_clean-button-svg sd-dropdown_clean-button-svg",
cleanButtonIconId: "icon-clear",
Expand Down
8 changes: 4 additions & 4 deletions src/defaultV2-theme/blocks/sd-element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
font-size: 0;
line-height: 0;
position: static;
font-weight: 600;
font-family: $font-questiontitle-family;
font-weight: $font-questiontitle-weight;
color: $font-questiontitle-color;
margin: 0;

.sd-element__num {
font-size: calcFontSize(0.75);
line-height: calcSize(2);
color: $foreground-light;
}

span {
font-family: $font-questiontitle-family;
font-weight: $font-questiontitle-weight;
font-size: $font-questiontitle-size;
color: $font-questiontitle-color;
line-height: calcSize(3);
}

Expand Down
Loading

0 comments on commit 7dfa1fa

Please sign in to comment.