@kbss-cvut/s-forms 0.6.3 → 0.6.4
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/Answer.d.ts +13 -0
- package/dist/components/DefaultInput.d.ts +39 -0
- package/dist/components/FormManager.d.ts +23 -0
- package/dist/components/FormWindow.d.ts +3 -0
- package/dist/components/HelpIcon.d.ts +20 -0
- package/dist/components/IconOverlay.d.ts +17 -0
- package/dist/components/LinkIcon.d.ts +20 -0
- package/dist/components/MaskedInput.d.ts +42 -0
- package/dist/components/MediaContent.d.ts +5 -0
- package/dist/components/PrefixIcon.d.ts +21 -0
- package/dist/components/Question.d.ts +86 -0
- package/dist/components/QuestionStatic.d.ts +9 -0
- package/dist/components/SForms.d.ts +3 -0
- package/dist/components/answer/CheckboxAnswer.d.ts +23 -0
- package/dist/components/answer/DateTimeAnswer.d.ts +12 -0
- package/dist/components/answer/InputAnswer.d.ts +25 -0
- package/dist/components/answer/MaskedInputAnswer.d.ts +13 -0
- package/dist/components/answer/OptimizedMenuList.d.ts +5 -0
- package/dist/components/answer/SelectAnswer.d.ts +27 -0
- package/dist/components/answer/TypeaheadAnswer.d.ts +13 -0
- package/dist/components/comment/CommentForm.d.ts +8 -0
- package/dist/components/comment/CommentList.d.ts +6 -0
- package/dist/components/comment/CommentView.d.ts +13 -0
- package/dist/components/comment/QuestionCommentIcon.d.ts +9 -0
- package/dist/components/wizard/HorizontalWizardNav.d.ts +14 -0
- package/dist/components/wizard/VerticalWizardNav.d.ts +14 -0
- package/dist/components/wizard/Wizard.d.ts +2 -0
- package/dist/components/wizard/WizardStep.d.ts +25 -0
- package/dist/constants/Constants.d.ts +127 -0
- package/dist/contexts/ConfigurationContext.d.ts +15 -0
- package/dist/contexts/FormGenContext.d.ts +13 -0
- package/dist/contexts/FormQuestionsContext.d.ts +12 -0
- package/dist/contexts/IntlContextProvider.d.ts +8 -0
- package/dist/model/DefaultFormGenerator.d.ts +8 -0
- package/dist/model/FormGenerator.d.ts +20 -0
- package/dist/model/QuestionAnswerProcessor.d.ts +44 -0
- package/dist/model/ValidatorFactory.d.ts +5 -0
- package/dist/s-forms.cjs +2 -0
- package/dist/s-forms.cjs.map +1 -0
- package/dist/s-forms.css +2 -0
- package/dist/s-forms.css.map +1 -0
- package/dist/s-forms.d.ts +16 -0
- package/dist/s-forms.js +2 -6842
- package/dist/s-forms.js.map +1 -0
- package/dist/s-forms.modern.js +2 -0
- package/dist/s-forms.modern.js.map +1 -0
- package/dist/s-forms.umd.js +2 -0
- package/dist/s-forms.umd.js.map +1 -0
- package/dist/stories/Answer.stories.d.ts +90 -0
- package/dist/stories/CommentForm.stories.d.ts +14 -0
- package/dist/stories/HelpIcon.stories.d.ts +47 -0
- package/dist/stories/LinkIcon.stories.d.ts +32 -0
- package/dist/stories/PrefixIcon.stories.d.ts +5 -0
- package/dist/stories/Question.stories.d.ts +13 -0
- package/dist/stories/QuestionCommentIcon.stories.d.ts +23 -0
- package/dist/stories/SForms.stories.d.ts +9 -0
- package/dist/styles/icons/ArrowRight.d.ts +2 -0
- package/dist/styles/icons/CaretSquareDown.d.ts +4 -0
- package/dist/styles/icons/CaretSquareUp.d.ts +4 -0
- package/dist/styles/icons/Close.d.ts +2 -0
- package/dist/styles/icons/CommentBubble.d.ts +2 -0
- package/dist/styles/icons/ExternalLink.d.ts +2 -0
- package/dist/styles/icons/InfoCircle.d.ts +2 -0
- package/dist/styles/icons/QuestionCircle.d.ts +2 -0
- package/dist/styles/icons/RecycleBin.d.ts +2 -0
- package/dist/styles/icons/index.d.ts +4 -0
- package/dist/util/FormUtils.d.ts +40 -0
- package/dist/util/JsonLdFramingUtils.d.ts +16 -0
- package/dist/util/JsonLdObjectMap.d.ts +5 -0
- package/dist/util/JsonLdObjectUtils.d.ts +32 -0
- package/dist/util/Logger.d.ts +5 -0
- package/dist/util/MaskMapper.d.ts +12 -0
- package/dist/util/Utils.d.ts +15 -0
- package/package.json +3 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
declare const _default: ComponentMeta<{
|
|
3
|
+
(props: any): JSX.Element | null;
|
|
4
|
+
propTypes: {
|
|
5
|
+
answer: import("prop-types").Validator<object>;
|
|
6
|
+
question: import("prop-types").Validator<object>;
|
|
7
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
8
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
9
|
+
index: import("prop-types").Requireable<number>;
|
|
10
|
+
icons: import("prop-types").Requireable<object>;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare const RegularInput: ComponentStory<{
|
|
15
|
+
(props: any): JSX.Element | null;
|
|
16
|
+
propTypes: {
|
|
17
|
+
answer: import("prop-types").Validator<object>;
|
|
18
|
+
question: import("prop-types").Validator<object>;
|
|
19
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
20
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
21
|
+
index: import("prop-types").Requireable<number>;
|
|
22
|
+
icons: import("prop-types").Requireable<object>;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
export declare const TypeHead: ComponentStory<{
|
|
26
|
+
(props: any): JSX.Element | null;
|
|
27
|
+
propTypes: {
|
|
28
|
+
answer: import("prop-types").Validator<object>;
|
|
29
|
+
question: import("prop-types").Validator<object>;
|
|
30
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
31
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
32
|
+
index: import("prop-types").Requireable<number>;
|
|
33
|
+
icons: import("prop-types").Requireable<object>;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
export declare const DateTimePicker: ComponentStory<{
|
|
37
|
+
(props: any): JSX.Element | null;
|
|
38
|
+
propTypes: {
|
|
39
|
+
answer: import("prop-types").Validator<object>;
|
|
40
|
+
question: import("prop-types").Validator<object>;
|
|
41
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
42
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
43
|
+
index: import("prop-types").Requireable<number>;
|
|
44
|
+
icons: import("prop-types").Requireable<object>;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
export declare const CheckBox: ComponentStory<{
|
|
48
|
+
(props: any): JSX.Element | null;
|
|
49
|
+
propTypes: {
|
|
50
|
+
answer: import("prop-types").Validator<object>;
|
|
51
|
+
question: import("prop-types").Validator<object>;
|
|
52
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
53
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
54
|
+
index: import("prop-types").Requireable<number>;
|
|
55
|
+
icons: import("prop-types").Requireable<object>;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
export declare const MaskedInput: ComponentStory<{
|
|
59
|
+
(props: any): JSX.Element | null;
|
|
60
|
+
propTypes: {
|
|
61
|
+
answer: import("prop-types").Validator<object>;
|
|
62
|
+
question: import("prop-types").Validator<object>;
|
|
63
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
64
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
65
|
+
index: import("prop-types").Requireable<number>;
|
|
66
|
+
icons: import("prop-types").Requireable<object>;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
export declare const SparqlInput: ComponentStory<{
|
|
70
|
+
(props: any): JSX.Element | null;
|
|
71
|
+
propTypes: {
|
|
72
|
+
answer: import("prop-types").Validator<object>;
|
|
73
|
+
question: import("prop-types").Validator<object>;
|
|
74
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
75
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
76
|
+
index: import("prop-types").Requireable<number>;
|
|
77
|
+
icons: import("prop-types").Requireable<object>;
|
|
78
|
+
};
|
|
79
|
+
}>;
|
|
80
|
+
export declare const TurtleInput: ComponentStory<{
|
|
81
|
+
(props: any): JSX.Element | null;
|
|
82
|
+
propTypes: {
|
|
83
|
+
answer: import("prop-types").Validator<object>;
|
|
84
|
+
question: import("prop-types").Validator<object>;
|
|
85
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
86
|
+
onCommentChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
87
|
+
index: import("prop-types").Requireable<number>;
|
|
88
|
+
icons: import("prop-types").Requireable<object>;
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
declare const _default: ComponentMeta<{
|
|
3
|
+
(props: any): JSX.Element;
|
|
4
|
+
propTypes: {
|
|
5
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Default: ComponentStory<{
|
|
10
|
+
(props: any): JSX.Element;
|
|
11
|
+
propTypes: {
|
|
12
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
declare const _default: ComponentMeta<{
|
|
3
|
+
(props: any): JSX.Element;
|
|
4
|
+
propTypes: {
|
|
5
|
+
text: import("prop-types").Validator<string>;
|
|
6
|
+
iconClassContainer: import("prop-types").Requireable<string>;
|
|
7
|
+
iconClass: import("prop-types").Requireable<string>;
|
|
8
|
+
overlayPlacement: import("prop-types").Requireable<string>;
|
|
9
|
+
absolutePosition: import("prop-types").Requireable<boolean>;
|
|
10
|
+
};
|
|
11
|
+
defaultProps: {
|
|
12
|
+
iconClassContainer: string;
|
|
13
|
+
iconClass: string;
|
|
14
|
+
absolutePosition: boolean;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Default: ComponentStory<{
|
|
19
|
+
(props: any): JSX.Element;
|
|
20
|
+
propTypes: {
|
|
21
|
+
text: import("prop-types").Validator<string>;
|
|
22
|
+
iconClassContainer: import("prop-types").Requireable<string>;
|
|
23
|
+
iconClass: import("prop-types").Requireable<string>;
|
|
24
|
+
overlayPlacement: import("prop-types").Requireable<string>;
|
|
25
|
+
absolutePosition: import("prop-types").Requireable<boolean>;
|
|
26
|
+
};
|
|
27
|
+
defaultProps: {
|
|
28
|
+
iconClassContainer: string;
|
|
29
|
+
iconClass: string;
|
|
30
|
+
absolutePosition: boolean;
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
export declare const LongText: ComponentStory<{
|
|
34
|
+
(props: any): JSX.Element;
|
|
35
|
+
propTypes: {
|
|
36
|
+
text: import("prop-types").Validator<string>;
|
|
37
|
+
iconClassContainer: import("prop-types").Requireable<string>;
|
|
38
|
+
iconClass: import("prop-types").Requireable<string>;
|
|
39
|
+
overlayPlacement: import("prop-types").Requireable<string>;
|
|
40
|
+
absolutePosition: import("prop-types").Requireable<boolean>;
|
|
41
|
+
};
|
|
42
|
+
defaultProps: {
|
|
43
|
+
iconClassContainer: string;
|
|
44
|
+
iconClass: string;
|
|
45
|
+
absolutePosition: boolean;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
declare const _default: ComponentMeta<{
|
|
3
|
+
(props: any): JSX.Element;
|
|
4
|
+
propTypes: {
|
|
5
|
+
url: import("prop-types").Requireable<string | object>;
|
|
6
|
+
iconClassContainer: import("prop-types").Requireable<string>;
|
|
7
|
+
iconClass: import("prop-types").Requireable<string>;
|
|
8
|
+
overlayPlacement: import("prop-types").Requireable<string>;
|
|
9
|
+
absolutePosition: import("prop-types").Requireable<boolean>;
|
|
10
|
+
};
|
|
11
|
+
defaultProps: {
|
|
12
|
+
iconClassContainer: string;
|
|
13
|
+
iconClass: string;
|
|
14
|
+
absolutePosition: boolean;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Default: ComponentStory<{
|
|
19
|
+
(props: any): JSX.Element;
|
|
20
|
+
propTypes: {
|
|
21
|
+
url: import("prop-types").Requireable<string | object>;
|
|
22
|
+
iconClassContainer: import("prop-types").Requireable<string>;
|
|
23
|
+
iconClass: import("prop-types").Requireable<string>;
|
|
24
|
+
overlayPlacement: import("prop-types").Requireable<string>;
|
|
25
|
+
absolutePosition: import("prop-types").Requireable<boolean>;
|
|
26
|
+
};
|
|
27
|
+
defaultProps: {
|
|
28
|
+
iconClassContainer: string;
|
|
29
|
+
iconClass: string;
|
|
30
|
+
absolutePosition: boolean;
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import PrefixIcon from "../components/PrefixIcon";
|
|
2
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
3
|
+
declare const _default: ComponentMeta<typeof PrefixIcon>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: ComponentStory<typeof PrefixIcon>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Question from "../components/Question";
|
|
2
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
3
|
+
declare const _default: ComponentMeta<typeof Question>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const TestedQuestionIsIrrelevant: ComponentStory<typeof Question>;
|
|
6
|
+
export declare const TestedQuestionIsRelevant: ComponentStory<typeof Question>;
|
|
7
|
+
export declare const TestedQuestionIsIrrelevantWithDebugModeOn: ComponentStory<typeof Question>;
|
|
8
|
+
export declare const TestedQuestionIsIrrelevantAndStartingId: ComponentStory<typeof Question>;
|
|
9
|
+
export declare const CollapsedQuestion: ComponentStory<typeof Question>;
|
|
10
|
+
export declare const ExpandedQuestion: ComponentStory<typeof Question>;
|
|
11
|
+
export declare const QuestionWithoutHeader: ComponentStory<typeof Question>;
|
|
12
|
+
export declare const AnswerableQuestion: ComponentStory<typeof Question>;
|
|
13
|
+
export declare const AnswerableQuestionExpanded: ComponentStory<typeof Question>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
+
declare const _default: ComponentMeta<{
|
|
3
|
+
(props: any): JSX.Element;
|
|
4
|
+
propTypes: {
|
|
5
|
+
question: import("prop-types").Validator<object>;
|
|
6
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
export default _default;
|
|
10
|
+
export declare const Default: ComponentStory<{
|
|
11
|
+
(props: any): JSX.Element;
|
|
12
|
+
propTypes: {
|
|
13
|
+
question: import("prop-types").Validator<object>;
|
|
14
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export declare const WithComment: ComponentStory<{
|
|
18
|
+
(props: any): JSX.Element;
|
|
19
|
+
propTypes: {
|
|
20
|
+
question: import("prop-types").Validator<object>;
|
|
21
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
declare const _default: ComponentMeta<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Form1: ComponentStory<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
6
|
+
export declare const Form2: ComponentStory<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
7
|
+
export declare const TouristDestinationForm1: ComponentStory<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
8
|
+
export declare const TouristDestinationForm2: ComponentStory<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
9
|
+
export declare const OccurenceReportingForm: ComponentStory<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default class FormUtils {
|
|
2
|
+
static isForm(structure: any): any;
|
|
3
|
+
static isWizardStep(structure: any): any;
|
|
4
|
+
static isSection(question: any): any;
|
|
5
|
+
static isAnswerable(question: any): any;
|
|
6
|
+
static isTypeahead(question: any): any;
|
|
7
|
+
static getPossibleValuesQuery(question: any): any;
|
|
8
|
+
static isDisabled(question: any): any;
|
|
9
|
+
static isHidden(question: any): any;
|
|
10
|
+
static isTextarea(question: any, answerValue: any): any;
|
|
11
|
+
static isText(question: any): any;
|
|
12
|
+
static isCalendar(question: any): any;
|
|
13
|
+
static isDate(question: any): any;
|
|
14
|
+
static isTime(question: any): any;
|
|
15
|
+
static isDateTime(question: any): any;
|
|
16
|
+
static isCheckbox(question: any): any;
|
|
17
|
+
static isMaskedInput(question: any): any;
|
|
18
|
+
static isSparqlInput(question: any): any;
|
|
19
|
+
static isTurtleInput(question: any): any;
|
|
20
|
+
static isCollapsed(question: any): any;
|
|
21
|
+
static isEmphasised(question: any): any;
|
|
22
|
+
static getCategory(question: any): string | undefined;
|
|
23
|
+
static resolveValue(answer: any): any;
|
|
24
|
+
static resolveValueObject(answer: any): any;
|
|
25
|
+
static isRelevant(question: any): boolean;
|
|
26
|
+
static hasValidationLogic(question: any): boolean;
|
|
27
|
+
static isValid(question: any): boolean;
|
|
28
|
+
static testOrCondition(condition: any): boolean;
|
|
29
|
+
static testCondition(condition: any): boolean;
|
|
30
|
+
static _getMappedObjectsArray(jsonObjects: any, objectType: any): any;
|
|
31
|
+
static hasAnswer(question: any): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Resolves which format of date/time/datetime value should be used in the datetime picker.
|
|
34
|
+
* @param question Question with format info
|
|
35
|
+
* @param originalValue Value read from answer, not processed by the rendered component
|
|
36
|
+
* @param options Object with datetime formats
|
|
37
|
+
* @return {*} Format from Configuration
|
|
38
|
+
*/
|
|
39
|
+
static resolveDateTimeFormat(question: any, originalValue: any, options: any): any;
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default class JsonLdFramingUtils {
|
|
2
|
+
/**
|
|
3
|
+
* Performs JSON-LD custom framing using shapes. Shape is declaration of the JSON-LD framing
|
|
4
|
+
* in a language that is incompatible with JSON-LD specification.
|
|
5
|
+
*
|
|
6
|
+
* @param input the JSON-LD input to framing by a shape.
|
|
7
|
+
* @param shape the JSON-LD custom frame configuration using shapes.
|
|
8
|
+
* @param callback(err, framed) called once the operation completes.
|
|
9
|
+
*/
|
|
10
|
+
static customFrame(input: any, shape: any, callback: any, ...args: any[]): any;
|
|
11
|
+
static expandStructure(structure: any): {};
|
|
12
|
+
static _expandGraph(parentNode: any, shape: any, id2ObjectMap: any): void;
|
|
13
|
+
static _getId(jsonObject: any): any;
|
|
14
|
+
static compressStructure: (rootNode: any) => any;
|
|
15
|
+
static _compressGraph: (parentNode: any, object2IdMap: any, idIncluded: any) => any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default class JsonLdObjectUtils {
|
|
2
|
+
static getFirstObject(subject: any, predicate: any): any;
|
|
3
|
+
static compareValues(jsonLdValue1: any, jsonLdValue2: any): any;
|
|
4
|
+
/**
|
|
5
|
+
* Sorts the specified JSON-LD data using a topological sort over partially ordered set defined by gtProperty.
|
|
6
|
+
*
|
|
7
|
+
* This is useful for situations where each item only knows its immediate neighbour in the list.
|
|
8
|
+
* @param data The data to sort, should be an array
|
|
9
|
+
* @param gtProperty Property specifying that an item is greater than another item. It is used for comparison.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
static toplogicalSort(data: any, gtProperty: any): any;
|
|
13
|
+
/**
|
|
14
|
+
* Sorts the specified JSON-LD data using a topological sort over partially ordered set defined by gtProperty,
|
|
15
|
+
* while preserving original order.
|
|
16
|
+
*
|
|
17
|
+
* This is useful for situations where each item only knows its immediate neighbour in the list.
|
|
18
|
+
* @param data The data to sort, should be an array
|
|
19
|
+
* @param gtProperty Property specifying that an item is greater than another item. It is used for comparison.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
static orderPreservingToplogicalSort(data: any, gtProperty: any): any;
|
|
23
|
+
static getCompareLocalizedLabelFunction(intl: any): (a: any, b: any) => 0 | 1 | -1;
|
|
24
|
+
static orderByLocalizedLabels(data: any, intl: any): any;
|
|
25
|
+
/**
|
|
26
|
+
* Evaluates if jsonLdObject has provided id.
|
|
27
|
+
* @param jsonLdObject
|
|
28
|
+
* @param id
|
|
29
|
+
* @returns {boolean}
|
|
30
|
+
*/
|
|
31
|
+
static checkId(jsonLdObject: any, id: any): boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class MaskMapper {
|
|
2
|
+
/**
|
|
3
|
+
* Attempts to map regular mask (e.g. date) to the format supported by inputmask-core.
|
|
4
|
+
*
|
|
5
|
+
* E.g. it maps (DD-MM-YYYY) to 11-11-1111.
|
|
6
|
+
*
|
|
7
|
+
* If an unsupported mask character is encountered, it is simply skipped. Datetime masks are processed according to
|
|
8
|
+
* ISO 8601 acronyms (e.g. M for month and m for minute).
|
|
9
|
+
* @param mask The mask to map
|
|
10
|
+
*/
|
|
11
|
+
static mapMask(mask: any): any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default class Utils {
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a simple hash of the specified string, much like usual Java implementations.
|
|
4
|
+
* @param str The string to compute has for
|
|
5
|
+
* @return {number}
|
|
6
|
+
*/
|
|
7
|
+
static getStringHash(str: any): number;
|
|
8
|
+
/**
|
|
9
|
+
* Wraps passed object into new array if it is not array already.
|
|
10
|
+
* @param object_or_array An object or array.
|
|
11
|
+
* @returns {*} New array containing passed object or passed array.
|
|
12
|
+
*/
|
|
13
|
+
static asArray(object_or_array: any): any;
|
|
14
|
+
static findQuestionById(id: any, question: any, reflexive: any, asserted: any, transitive: any): any;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kbss-cvut/s-forms",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Semantic forms generator and processor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"jsonld": "^0.4.12",
|
|
56
56
|
"jsonld-utils": "https://kbss.felk.cvut.cz/dist/jsonld-utils-0.0.11.tgz",
|
|
57
57
|
"microbundle": "^0.14.2",
|
|
58
|
+
"npm-packlist": "^7.0.2",
|
|
58
59
|
"prop-types": "^15.7.2",
|
|
59
60
|
"react-bootstrap": "1.0.1",
|
|
60
61
|
"react-datepicker": "^4.2.1",
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
"test": "jest",
|
|
106
107
|
"dev": "start-storybook --no-manager-cache -p 6006",
|
|
107
108
|
"build": "microbundle --jsx React.createElement --jsxFragment React.Fragment",
|
|
109
|
+
"build:lib": "npm run build && npm pack",
|
|
108
110
|
"build-storybook": "build-storybook",
|
|
109
111
|
"chromatic": "npx chromatic",
|
|
110
112
|
"release:patch": "npm test && standard-version --release-as patch && npm publish",
|