-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from kbss-cvut/add-tree
Add tree to typeahead
- Loading branch information
Showing
7 changed files
with
219 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from "react"; | ||
import TypeaheadAnswer from "../components/answer/TypeaheadAnswer"; | ||
import { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
|
||
import questionExpanded from "./assets/question/questionExpanded.json"; | ||
import possibleValues from "./assets/possibleValues.json"; | ||
import tree from "./assets/question/simple-single-tree-select.json"; | ||
|
||
export default { | ||
title: "Components/TypeaheadAnswer", | ||
component: TypeaheadAnswer, | ||
} as ComponentMeta<typeof TypeaheadAnswer>; | ||
|
||
const Template: ComponentStory<typeof TypeaheadAnswer> = () => { | ||
return ( | ||
<TypeaheadAnswer | ||
question={tree} | ||
answer={tree} | ||
label={""} | ||
onChange={() => void undefined} | ||
/> | ||
); | ||
}; | ||
|
||
export const TypeaheadAnswerTree = Template.bind({}); |
85 changes: 85 additions & 0 deletions
85
src/stories/assets/question/simple-single-tree-select.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"@id": "ma-vlastnika-section-777", | ||
"@type": "http://onto.fel.cvut.cz/ontologies/documentation/question", | ||
"http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class": "type-ahead", | ||
"http://onto.fel.cvut.cz/ontologies/form/has-non-selectable-value": "fyzicka-osoba", | ||
"http://onto.fel.cvut.cz/ontologies/form/has-possible-value": [ | ||
{ | ||
"@id": "fyzicka-osoba", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Fyzická osoba", | ||
"http://www.w3.org/2002/07/owl#disjointWith": { | ||
"@id": "pravnicka-osoba" | ||
} | ||
}, | ||
{ | ||
"@id": "pravnicka-osoba", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Právnická osoba" | ||
}, | ||
{ | ||
"@id": "fyzicka-osoba--nezletila", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Fyzická osoba nezletilá", | ||
"http://www.w3.org/2002/07/owl#disjointWith": { | ||
"@id": "pravnicka-osoba" | ||
}, | ||
"http://www.w3.org/2004/02/skos/core#broader": { | ||
"@id": "fyzicka-osoba" | ||
} | ||
}, | ||
{ | ||
"@id": "fyzicka-osoba--chytra", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Fyzická osoba chytrá", | ||
"http://www.w3.org/2002/07/owl#disjointWith": { | ||
"@id": "pravnicka-osoba" | ||
}, | ||
"http://www.w3.org/2004/02/skos/core#broader": { | ||
"@id": "fyzicka-osoba" | ||
} | ||
}, | ||
{ | ||
"@id": "fyzicka-osoba--hloupa", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Fyzická osoba hloupá", | ||
"http://www.w3.org/2002/07/owl#disjointWith": [ | ||
{ | ||
"@id": "pravnicka-osoba" | ||
}, | ||
{ | ||
"@id": "fyzicka-osoba--chytra" | ||
} | ||
], | ||
"http://www.w3.org/2004/02/skos/core#broader": { | ||
"@id": "fyzicka-osoba" | ||
} | ||
}, | ||
{ | ||
"@id": "podtrida-fyzicka-osoby-s-velice-dlouhym-nazvem", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Podtřída fyzické osoby s velice dlouhým názvem", | ||
"http://www.w3.org/2002/07/owl#disjointWith": { | ||
"@id": "pravnicka-osoba" | ||
}, | ||
"http://www.w3.org/2004/02/skos/core#broader": { | ||
"@id": "fyzicka-osoba" | ||
} | ||
}, | ||
{ | ||
"@id": "jeste-specifickejsi-podtrida-fyzicka-osoby-s-velice-dlouhym-nazvem", | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Ještě specifickejší podtřída fyzické osoby s velice dlouhým názvem", | ||
"http://www.w3.org/2002/07/owl#disjointWith": { | ||
"@id": "pravnicka-osoba" | ||
}, | ||
"http://www.w3.org/2004/02/skos/core#broader": { | ||
"@id": "podtrida-fyzicka-osoby-s-velice-dlouhym-nazvem" | ||
} | ||
} | ||
], | ||
"http://onto.fel.cvut.cz/ontologies/form/has-question-origin": { | ||
"@id": "ma-vlastnika-section-777-qo" | ||
}, | ||
"http://www.w3.org/2000/01/rdf-schema#label": "Má vlastníka", | ||
"http://onto.fel.cvut.cz/ontologies/documentation/has_answer": [ | ||
{ | ||
"http://onto.fel.cvut.cz/ontologies/documentation/has_data_value": "" | ||
} | ||
], | ||
"http://onto.fel.cvut.cz/ontologies/documentation/has_related_question": [], | ||
"http://onto.fel.cvut.cz/ontologies/form/has-comment": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters