Skip to content

Commit

Permalink
Merge branch 'master' into features/5215-presets
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed May 21, 2024
2 parents 6f6f026 + 9db9dad commit c980561
Show file tree
Hide file tree
Showing 45 changed files with 366 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="svc-toolbox__category" [class.svc-toolbox__category--collapsed]="category.collapsed">
<div class="svc-toolbox__category-header"
(click)="category.toggleState()" [key2click] [class.svc-toolbox__category-header--collapsed]="toolbox.canCollapseCategories">
<span class="svc-toolbox__category-title">{{category.name}}</span>
<span class="svc-toolbox__category-title">{{category.title}}</span>
<div *ngIf="toolbox.canCollapseCategories" class="svc-toolbox__category-header__controls">
<svg [iconName]="'icon-arrow-down'" class="svc-toolbox__category-header__button svc-string-editor__button--expand" [size]="24" sv-ng-svg-icon [visible]="category.collapsed"></svg>
<svg [iconName]="'icon-arrow-up'" class="svc-toolbox__category-header__button svc-string-editor__button--collapse" [size]="24" sv-ng-svg-icon [visible]="!category.collapsed"></svg>
Expand All @@ -12,4 +12,4 @@
<svc-toolbox-tool [item]="item" [creator]="toolbox.creator" [isCompact]="false" ></svc-toolbox-tool>
</ng-container>
</div>
</ng-template>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class TabJsonEditorAcePlugin
creator.addPluginTab(
"editor",
this,
getLocString("ed.jsonEditor"),
"ed.jsonEditor",
"svc-tab-json-editor-ace"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class TextareaJsonEditorModel extends JsonEditorBaseModel {
textareaElement.value = textareaElement.value.substring(0, start) +
"\t" + textareaElement.value.substring(end);
textareaElement.selectionStart =
textareaElement.selectionEnd = start + 1;
textareaElement.selectionEnd = start + 1;
e.stopPropagation();
}
return true;
Expand All @@ -45,7 +45,7 @@ export class TextareaJsonEditorModel extends JsonEditorBaseModel {
this.isProcessingImmediately = false;
}
protected gotoError(at: number, row: number, column: number): void {
if(!this.textElement) return;
if (!this.textElement) return;
const el = this.textElement;
el.selectionStart = at;
el.selectionEnd = at;
Expand Down Expand Up @@ -86,14 +86,13 @@ export class TextareaJsonEditorModel extends JsonEditorBaseModel {

export class TabJsonEditorTextareaPlugin
extends TabJsonEditorBasePlugin
implements ICreatorPlugin
{
implements ICreatorPlugin {
constructor(creator: SurveyCreatorModel) {
super(creator);
creator.addPluginTab(
"editor",
this,
getLocString("ed.jsonEditor"),
"ed.jsonEditor",
"svc-tab-json-editor-textarea"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ export class LogicActionTriggerModel extends LogicActionModelBase {
const newQuestion = tempPanel.getQuestionByName(name);
if (!!newQuestion) {
let index = triggerEditorPanel.elements.indexOf(oldQuestion);
triggerEditorPanel.blockAnimations();
triggerEditorPanel.addElement(newQuestion, index);
oldQuestion.delete();
triggerEditorPanel.releaseAnimations();
}
if (newQuestion.name === "setValue") {
this.updateSetValueQuestion(newQuestion);
Expand Down
14 changes: 12 additions & 2 deletions packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,21 @@ export class SurveyCreatorModel extends Base

protected plugins: { [name: string]: ICreatorPlugin } = {};

/**
* Adds a custom tab to Survey Creator.
*
* [View Demo](https://surveyjs.io/survey-creator/examples/modify-tab-bar/ (linkStyle))
* @param name A unique tab ID.
* @param plugin An object that allows you to handle user interactions with the tab.
* @param title A tab caption. If `title` is undefined, the `name` argument value is displayed instead. To localize the caption, add its translations to the `ed` object within [localization dictionaries](https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-core/src/localization) and pass `ed.propertyName` as the `title` argument.
* @param componentName The name of the component that renders tab markup. Default value: `"svc-tab-" + name`.
* @param index A zero-based index that specifies the tab's position relative to other tabs.
*/
public addPluginTab(
name: string,
plugin: ICreatorPlugin,
title?: string,
componentContent?: string,
componentName?: string,
index?: number
): void {
const locStrName = !title ? "ed." + name : (title.indexOf("ed.") == 0 ? title : "");
Expand All @@ -361,7 +371,7 @@ export class SurveyCreatorModel extends Base
id: name,
locTitleName: locStrName,
title: title,
componentContent: componentContent ? componentContent : "svc-tab-" + name,
componentContent: componentName ? componentName : "svc-tab-" + name,
data: plugin,
action: () => { this.makeNewViewActive(name); },
active: this.viewType === name,
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/arabic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var arStrings = {
signaturepad: "لوحة توقيع",
buttongroup: "Button group"
},
toolbox_categories: {
feneral: "قائمة العام",
choice: "أسئلة الاختيار",
text: "أسئلة إدخال النص",
containers: "حاويات",
matrix: "أسئلة المصفوفة",
misc: "متفرقات",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "إفتراضي ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var arStrings = {
"property-grid": "Properties",
propertyGridFilteredTextPlaceholder: "Type to search...",
propertyGridNoResultsFound: "لم يتم العثور على نتائج",
toolboxGeneralCategory: "قائمة العام",
toolboxChoiceCategory: "أسئلة الاختيار",
toolboxTextCategory: "أسئلة إدخال النص",
toolboxContainersCategory: "حاويات",
toolboxMatrixCategory: "أسئلة المصفوفة",
toolboxMiscCategory: "متفرقات",
correctJSON: "Please correct JSON.",
surveyResults: "Survey Results ",
surveyResultsTable: "As Table",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/bulgarian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var bgStrings = {
signaturepad: "Подпис",
buttongroup: "Група бутони"
},
toolbox_categories: {
general: "Общ",
choice: "Въпроси за избор",
text: "Въпроси с въвеждане на текст",
containers: "Контейнери",
matrix: "Матрица с въпроси",
misc: "Разни",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "По подразбиране ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var bgStrings = {
"property-grid": "Свойства",
propertyGridFilteredTextPlaceholder: "Въведи за търсене...",
propertyGridNoResultsFound: "Няма намерени резултати",
toolboxGeneralCategory: "Общ",
toolboxChoiceCategory: "Въпроси за избор",
toolboxTextCategory: "Въпроси с въвеждане на текст",
toolboxContainersCategory: "Контейнери",
toolboxMatrixCategory: "Матрица с въпроси",
toolboxMiscCategory: "Разни",
correctJSON: "Моля, коригирай JSON.",
surveyResults: "Резултати от анкетата ",
surveyResultsTable: "Като таблица",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/croatian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var hrStrings = {
signaturepad: "Jastučić za potpis",
buttongroup: "Grupa gumba"
},
toolbox_categories: {
general: "Općenito",
choice: "Pitanja o izboru",
text: "Pitanja o unosu teksta",
containers: "Kontejnere",
matrix: "Matrična pitanja",
misc: "Ostalo",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Zadani ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var hrStrings = {
"property-grid": "Svojstva",
propertyGridFilteredTextPlaceholder: "Upišite za pretraživanje...",
propertyGridNoResultsFound: "Nisu pronađeni rezultati",
toolboxGeneralCategory: "Općenito",
toolboxChoiceCategory: "Pitanja o izboru",
toolboxTextCategory: "Pitanja o unosu teksta",
toolboxContainersCategory: "Kontejnere",
toolboxMatrixCategory: "Matrična pitanja",
toolboxMiscCategory: "Ostalo",
correctJSON: "Ispravite JSON.",
surveyResults: "Rezultat ankete: ",
surveyResultsTable: "Kao tablica",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/czech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var czStrings = {
signaturepad: "Podpisová podložka",
buttongroup: "Skupina tlačítek"
},
toolbox_categories: {
general: "Obecné",
choice: "Výběrové otázky",
text: "Textové otázky",
containers: "Kontejnery",
matrix: "Maticové otázky",
misc: "Ostatní",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Výchozí ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var czStrings = {
"property-grid": "Vlastnosti",
propertyGridFilteredTextPlaceholder: "Zadejte hledaný text...",
propertyGridNoResultsFound: "Nebyly nalezeny žádné výsledky",
toolboxGeneralCategory: "Obecné",
toolboxChoiceCategory: "Výběrové otázky",
toolboxTextCategory: "Textové otázky",
toolboxContainersCategory: "Kontejnery",
toolboxMatrixCategory: "Maticové otázky",
toolboxMiscCategory: "Ostatní",
correctJSON: "Opravte JSON.",
surveyResults: "Výsledek průzkumu: ",
surveyResultsTable: "Jako tabulka",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/danish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var danishStrings = {
signaturepad: "Underskrift",
buttongroup: "Knap gruppe"
},
toolbox_categories: {
general: "Generelt",
choice: "Spørgsmål om valg",
text: "Spørgsmål om tekstinput",
containers: "Containere",
matrix: "Matrix spørgsmål",
misc: "Misc",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Standard ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var danishStrings = {
"property-grid": "Egenskaber",
propertyGridFilteredTextPlaceholder: "Skriv for at søge...",
propertyGridNoResultsFound: "Ingen resultater fundet",
toolboxGeneralCategory: "Generelt",
toolboxChoiceCategory: "Spørgsmål om valg",
toolboxTextCategory: "Spørgsmål om tekstinput",
toolboxContainersCategory: "Containere",
toolboxMatrixCategory: "Matrix spørgsmål",
toolboxMiscCategory: "Misc",
correctJSON: "Ret venligst JSON.",
surveyResults: "Undersøgelsesresultat: ",
surveyResultsTable: "Som tabel",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/dutch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var nlStrings = {
signaturepad: "Handtekening",
buttongroup: "Knoppengroep"
},
toolbox_categories: {
general: "Algemeen",
choice: "Keuzevragen",
text: "Vragen over tekstinvoer",
containers: "Containers",
matrix: "Matrix vragen",
misc: "MISC",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Standaard ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var nlStrings = {
"property-grid": "Eigenschappen",
propertyGridFilteredTextPlaceholder: "Typ om te zoeken...",
propertyGridNoResultsFound: "Geen resultaten gevonden",
toolboxGeneralCategory: "Algemeen",
toolboxChoiceCategory: "Keuzevragen",
toolboxTextCategory: "Vragen over tekstinvoer",
toolboxContainersCategory: "Containers",
toolboxMatrixCategory: "Matrix vragen",
toolboxMiscCategory: "MISC",
correctJSON: "Corrigeer JSON.",
surveyResults: "Enquêteresultaat: ",
surveyResultsTable: "Als tabel",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export var enStrings = {
signaturepad: "Signature",
buttongroup: "Button Group"
},
toolbox_categories: {
general: "General",
choice: "Choice Questions",
text: "Text Input Questions",
containers: "Containers",
matrix: "Matrix Questions",
misc: "Misc",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Default ({0})",
Expand Down Expand Up @@ -113,12 +121,6 @@ export var enStrings = {
"property-grid": "Properties",
propertyGridFilteredTextPlaceholder: "Type to search...",
propertyGridNoResultsFound: "No results found",
toolboxGeneralCategory: "General",
toolboxChoiceCategory: "Choice Questions",
toolboxTextCategory: "Text Input Questions",
toolboxContainersCategory: "Containers",
toolboxMatrixCategory: "Matrix Questions",
toolboxMiscCategory: "Misc",
correctJSON: "Please correct JSON.",
surveyResults: "Survey Results ",
surveyResultsTable: "As Table",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/finnish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export var fiStrings = {
signaturepad: "Allekirjoitusalusta",
buttongroup: "Painike-ryhmä"
},
toolbox_categories: {
general: "Yleinen",
choice: "Valintaa koskevat kysymykset",
text: "Tekstinsyöttökysymykset",
containers: "Säiliöt",
matrix: "Matriisin kysymykset",
misc: "Muut",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Vakio ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ export var fiStrings = {
"property-grid": "Properties",
propertyGridFilteredTextPlaceholder: "Kirjoita etsiäksesi...",
propertyGridNoResultsFound: "Tuloksia ei löytynyt",
toolboxGeneralCategory: "Yleinen",
toolboxChoiceCategory: "Valintaa koskevat kysymykset",
toolboxTextCategory: "Tekstinsyöttökysymykset",
toolboxContainersCategory: "Säiliöt",
toolboxMatrixCategory: "Matriisin kysymykset",
toolboxMiscCategory: "Muut",
correctJSON: "Korjaa JSON.",
surveyResults: "Kyselyn tulos:",
surveyResultsTable: "Taulukossa",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ var frenchTranslation = {
signaturepad: "Signature",
buttongroup: "Groupe de boutons"
},
toolbox_categories: {
general: "Général",
choice: "Questions à choix",
text: "Questions de saisie libre",
containers: "Conteneurs",
matrix: "Questions matricielles",
misc: "Divers",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Valeur par défaut ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ var frenchTranslation = {
"property-grid": "Propriétés",
propertyGridFilteredTextPlaceholder: "Tapez pour rechercher...",
propertyGridNoResultsFound: "Aucun résultat trouvé",
toolboxGeneralCategory: "Général",
toolboxChoiceCategory: "Questions à choix",
toolboxTextCategory: "Questions de saisie libre",
toolboxContainersCategory: "Conteneurs",
toolboxMatrixCategory: "Questions matricielles",
toolboxMiscCategory: "Divers",
correctJSON: "Merci de corriger le JSON",
surveyResults: "Résultat du sondage : ",
surveyResultsTable: "Format tableau",
Expand Down
14 changes: 8 additions & 6 deletions packages/survey-creator-core/src/localization/german.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ var germanTranslation = {
signaturepad: "Unterschrift",
buttongroup: "Schaltfläche-Gruppe"
},
toolbox_categories: {
general: "Allgemein",
choice: "Auswahl-Fragen",
text: "Text-Eingabe-Fragen",
containers: "Kontainer",
matrix: "Matrix-Fragen",
misc: "Verschiedenes",
},
// Strings in SurveyJS Creator
ed: {
defaultLocale: "Standard ({0})",
Expand Down Expand Up @@ -111,12 +119,6 @@ var germanTranslation = {
"property-grid": "Eigenschaften",
propertyGridFilteredTextPlaceholder: "Tippen, um zu suchen ...",
propertyGridNoResultsFound: "Keine Ergebnisse gefunden",
toolboxGeneralCategory: "Allgemein",
toolboxChoiceCategory: "Auswahl-Fragen",
toolboxTextCategory: "Text-Eingabe-Fragen",
toolboxContainersCategory: "Kontainer",
toolboxMatrixCategory: "Matrix-Fragen",
toolboxMiscCategory: "Verschiedenes",
correctJSON: "Bitte JSON korrigieren.",
surveyResults: "Umfrageergebnis: ",
surveyResultsTable: "Als Tabelle",
Expand Down
Loading

0 comments on commit c980561

Please sign in to comment.