@roqua/quby-frontend 0.10.8 → 0.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AnswerPage.d.ts +2 -3
- package/dist/components/MainLabel.d.ts +2 -3
- package/dist/components/Paginator.d.ts +3 -4
- package/dist/components/PanelContent.d.ts +2 -3
- package/dist/components/PanelItem.d.ts +2 -3
- package/dist/components/ProgressBar.d.ts +1 -2
- package/dist/components/Quby.d.ts +2 -3
- package/dist/components/QuestionDescription.d.ts +1 -2
- package/dist/components/QuestionWrapper.d.ts +2 -3
- package/dist/components/SubQuestions.d.ts +2 -3
- package/dist/components/ValidationErrors.d.ts +2 -3
- package/dist/components/index.d.ts +2 -2
- package/dist/components/items/HtmlItem.d.ts +2 -3
- package/dist/components/items/InfoItem.d.ts +2 -3
- package/dist/components/items/QuestionItem.d.ts +1 -2
- package/dist/components/items/UnknownItem.d.ts +2 -3
- package/dist/components/questions/CheckBoxQuestion.d.ts +2 -3
- package/dist/components/questions/CountrySelectQuestion.d.ts +2 -3
- package/dist/components/questions/DatePartsQuestion.d.ts +2 -3
- package/dist/components/questions/FloatQuestion.d.ts +2 -3
- package/dist/components/questions/IntegerQuestion.d.ts +2 -3
- package/dist/components/questions/OldSliderQuestion.d.ts +2 -3
- package/dist/components/questions/RadioQuestion.d.ts +2 -3
- package/dist/components/questions/ScaleQuestion.d.ts +2 -3
- package/dist/components/questions/SelectQuestion.d.ts +2 -3
- package/dist/components/questions/SliderQuestion.d.ts +2 -3
- package/dist/components/questions/SplitToUnitsQuestion.d.ts +2 -3
- package/dist/components/questions/StringQuestion.d.ts +2 -3
- package/dist/components/questions/TextareaQuestion.d.ts +2 -3
- package/dist/core/calculations.d.ts +0 -1
- package/dist/core/curlies_interpolator.d.ts +2 -3
- package/dist/core/index.d.ts +7 -7
- package/dist/core/panel_logic.d.ts +2 -3
- package/dist/core/quby_context.d.ts +2 -3
- package/dist/core/questionnaire.d.ts +4 -3
- package/dist/core/questionnaire_json.d.ts +8 -3
- package/dist/core/response.d.ts +4 -5
- package/dist/core/response_json.d.ts +2 -3
- package/dist/core/validators.d.ts +2 -3
- package/dist/core/visibility_rules.d.ts +2 -3
- package/dist/i18n.d.ts +1 -2
- package/dist/index.d.ts +2 -3
- package/dist/logic/index.d.ts +3 -3
- package/dist/logic/map_css_vars.d.ts +0 -1
- package/dist/logic/use_might_become_valid.d.ts +1 -2
- package/dist/logic/use_question_shortkeys.d.ts +2 -3
- package/dist/quby-frontend.es.js +8879 -8907
- package/dist/quby-frontend.umd.js +76 -76
- package/dist/stories/_helpers.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IDisplayOptions, IInterpolateTextvars, Questionnaire, Response } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDisplayOptions, IInterpolateTextvars, Questionnaire, Response } from "../core";
|
|
4
3
|
export declare const InterpolateCurliesContext: React.Context<IInterpolateTextvars>;
|
|
5
4
|
interface Props {
|
|
6
5
|
questionnaire: Questionnaire;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IDisplayOptions } from
|
|
3
|
-
import { PanelLogic } from
|
|
4
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDisplayOptions } from "../core";
|
|
3
|
+
import { PanelLogic } from "../core/panel_logic";
|
|
5
4
|
export interface INavigationCallbacks {
|
|
6
5
|
done: () => void;
|
|
7
6
|
prev?: () => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Response, IDisplayOptions, IResponseJson } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Response, IDisplayOptions, IResponseJson } from "../core";
|
|
4
3
|
export interface Props {
|
|
5
4
|
questionnaireJson: any;
|
|
6
5
|
responseJson: IResponseJson;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./AnswerPage";
|
|
2
|
+
export * from "./Quby";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ICheckBoxQuestion, IFieldState, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ICheckBoxQuestion, IFieldState, SetQuestionRef } from "../../core";
|
|
4
3
|
type CheckBoxFieldState = IFieldState<Set<string>>;
|
|
5
4
|
interface Props {
|
|
6
5
|
question: ICheckBoxQuestion;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, IStringQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, IStringQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IStringQuestion;
|
|
6
5
|
fieldState: IFieldState<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DatePartsComponent, IDatePartsQuestion, IFieldState, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DatePartsComponent, IDatePartsQuestion, IFieldState, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IDatePartsQuestion;
|
|
6
5
|
fieldState: IFieldState<Map<DatePartsComponent, string>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, IFloatQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, IFloatQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IFloatQuestion;
|
|
6
5
|
fieldState: IFieldState<number>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, IIntegerQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, IIntegerQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IIntegerQuestion;
|
|
6
5
|
fieldState: IFieldState<number>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, ISliderQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, ISliderQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: ISliderQuestion;
|
|
6
5
|
fieldState: IFieldState<number>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, IRadioQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, IRadioQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IRadioQuestion;
|
|
6
5
|
fieldState: IFieldState<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, IScaleQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, IScaleQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IScaleQuestion;
|
|
6
5
|
fieldState: IFieldState<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, ISelectQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, ISelectQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: ISelectQuestion;
|
|
6
5
|
fieldState: IFieldState<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, ISliderQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, ISliderQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: ISliderQuestion;
|
|
6
5
|
fieldState: IFieldState<number>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, ISplitToUnitsQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, ISplitToUnitsQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: ISplitToUnitsQuestion;
|
|
6
5
|
fieldState: IFieldState<number>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IFieldState, IStringQuestion, SetQuestionRef } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFieldState, IStringQuestion, SetQuestionRef } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: IStringQuestion;
|
|
6
5
|
fieldState: IFieldState<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ITextareaQuestion, IFieldState } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ITextareaQuestion, IFieldState } from "../../core";
|
|
4
3
|
interface Props {
|
|
5
4
|
question: ITextareaQuestion;
|
|
6
5
|
fieldState: IFieldState<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IBooleanCalculation, ICalcBooleanReducer, ICalcComparer, ICalculation, INumberCalculation, ISexpVariables } from './questionnaire_json';
|
|
2
2
|
import { Response } from './response';
|
|
3
|
-
|
|
4
3
|
type INumberReducer = (acc: number, value: number) => number;
|
|
5
4
|
export declare class Calculations {
|
|
6
5
|
sexpVariables: ISexpVariables;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Questionnaire } from
|
|
2
|
-
import { Response } from
|
|
3
|
-
|
|
1
|
+
import { Questionnaire } from "./questionnaire";
|
|
2
|
+
import { Response } from "./response";
|
|
4
3
|
export declare class CurliesInterpolator {
|
|
5
4
|
response: Response;
|
|
6
5
|
questionnaire: Questionnaire;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from "./questionnaire_json";
|
|
2
|
+
export * from "./questionnaire";
|
|
3
|
+
export * from "./response";
|
|
4
|
+
export * from "./quby_context";
|
|
5
|
+
export * from "./validators";
|
|
6
|
+
export * from "./response_json";
|
|
7
|
+
export * from "./curlies_interpolator";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Response, Questionnaire, IDisplayOptions } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Response, Questionnaire, IDisplayOptions } from ".";
|
|
4
3
|
export type SetQuestionRef = (key: string, ref: React.RefObject<HTMLElement | null>) => void;
|
|
5
4
|
export interface IQubyContext {
|
|
6
5
|
questionnaire: Questionnaire;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IQuestionnaire, IQuestion, IPanel, ITextvar, IValidation, IQuestions, ISexpVariables } from
|
|
2
|
-
import { VisibilityRule } from
|
|
3
|
-
|
|
1
|
+
import { IQuestionnaire, IQuestion, IPanel, ITextvar, IValidation, IQuestions, ISexpVariables, ISelectOption, IRadioOption } from "./questionnaire_json";
|
|
2
|
+
import { VisibilityRule } from "./visibility_rules";
|
|
4
3
|
export declare class Questionnaire {
|
|
4
|
+
#private;
|
|
5
5
|
key: string;
|
|
6
6
|
panels: IPanel[];
|
|
7
7
|
footer?: string;
|
|
@@ -18,5 +18,6 @@ export declare class Questionnaire {
|
|
|
18
18
|
constructor(data: IQuestionnaire);
|
|
19
19
|
getField(key: string): IQuestion;
|
|
20
20
|
getQuestionsInSameGroup(questionKey: string): IQuestion[];
|
|
21
|
+
getFlatOptions(questionKey: string): (ISelectOption | IRadioOption)[];
|
|
21
22
|
getOptionNumberValue(questionKey: string, optionKey: string): number | null;
|
|
22
23
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
3
2
|
export interface ITranslatable {
|
|
4
3
|
t: string;
|
|
5
4
|
[interpolationKey: string]: string | number;
|
|
@@ -147,7 +146,7 @@ export interface ISplitToUnitsQuestion extends IBaseField, INumberQuestion {
|
|
|
147
146
|
export interface ISelectQuestion extends IBaseField {
|
|
148
147
|
type: "select";
|
|
149
148
|
as: "select";
|
|
150
|
-
children: (ISelectOption)[];
|
|
149
|
+
children: (ISelectOption | IOptgroup)[];
|
|
151
150
|
placeholder: string;
|
|
152
151
|
}
|
|
153
152
|
export interface IRadioQuestion extends IBaseField {
|
|
@@ -187,6 +186,12 @@ export interface IRadioOption extends IOption {
|
|
|
187
186
|
label?: string;
|
|
188
187
|
description?: string;
|
|
189
188
|
}
|
|
189
|
+
export interface IOptgroup {
|
|
190
|
+
type: "optgroup";
|
|
191
|
+
key: string;
|
|
192
|
+
label: string;
|
|
193
|
+
options: ISelectOption[];
|
|
194
|
+
}
|
|
190
195
|
export interface ISelectOption extends IOption {
|
|
191
196
|
value: number;
|
|
192
197
|
label?: string;
|
package/dist/core/response.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { Questionnaire } from
|
|
3
|
-
import { IPanel, ITranslatable, IValidation } from
|
|
4
|
-
import { Calculations } from
|
|
5
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Questionnaire } from "./questionnaire";
|
|
3
|
+
import { IPanel, ITranslatable, IValidation } from "./questionnaire_json";
|
|
4
|
+
import { Calculations } from "./calculations";
|
|
6
5
|
export interface IAnswerFromServer {
|
|
7
6
|
value: IValues;
|
|
8
7
|
flags: IFlags;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Questionnaire } from
|
|
2
|
-
import { IAnswerFromServer } from
|
|
3
|
-
|
|
1
|
+
import { Questionnaire } from "./questionnaire";
|
|
2
|
+
import { IAnswerFromServer } from "./response";
|
|
4
3
|
export declare class ResponseParseError extends Error {
|
|
5
4
|
}
|
|
6
5
|
export interface IResponseJson {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IAnswerGroupMaximumValidation, IAnswerGroupMinimumValidation, IRequiresAnswerValidation, IValidation, IMinimumValidation, IMaximumValidation, IMinimumDateValidation, IMinimumCheckedRequiredValidation, IMaximumCheckedAllowedValidation, IMaximumDateValidation, IValidDateValidation, IValidIntegerValidation, IValidFloatValidation, IRegexpValidation } from
|
|
2
|
-
import { Response } from
|
|
3
|
-
|
|
1
|
+
import { IAnswerGroupMaximumValidation, IAnswerGroupMinimumValidation, IRequiresAnswerValidation, IValidation, IMinimumValidation, IMaximumValidation, IMinimumDateValidation, IMinimumCheckedRequiredValidation, IMaximumCheckedAllowedValidation, IMaximumDateValidation, IValidDateValidation, IValidIntegerValidation, IValidFloatValidation, IRegexpValidation } from "./questionnaire_json";
|
|
2
|
+
import { Response } from "./response";
|
|
4
3
|
export type ValidatableResponse = Pick<Response, "getValidationFieldState">;
|
|
5
4
|
export declare const ignorableErrors: IValidation["type"][];
|
|
6
5
|
export declare function buildValidator(data: IValidation): RequiresAnswerValidator | ValidIntegerValidator | ValidFloatValidator | ValidDateValidator | MinimumValidator | MaximumValidator | MinimumDateValidator | MaximumDateValidator | MinimumCheckedRequiredValidator | MaximumCheckedAllowedValidator | AnswerGroupMinimumValidator | AnswerGroupMaximumValidator | RegexpValidator;
|
package/dist/i18n.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export * from
|
|
3
|
-
export * from './components';
|
|
1
|
+
export * from "./core";
|
|
2
|
+
export * from "./components";
|
package/dist/logic/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./use_might_become_valid";
|
|
2
|
+
export * from "./use_question_shortkeys";
|
|
3
|
+
export * from "./map_css_vars";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
3
2
|
export declare function useMightBecomeValid(value: string | undefined, handleChange: (newValue: string) => string | undefined): {
|
|
4
3
|
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
5
4
|
value: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Response, Questionnaire } from
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Response, Questionnaire } from "../core";
|
|
4
3
|
export declare const useQuestionShortkeys: (response: Response, questionnaire: Questionnaire, qubyRef: React.RefObject<HTMLDivElement | null>) => void;
|