Skip to content

Commit

Permalink
Modified main export so that .default does not have to be used in the…
Browse files Browse the repository at this point in the history
… old syntax. Also exported constants. Bumped version to 0.0.3.
  • Loading branch information
ledsoft committed Aug 23, 2016
1 parent c2befad commit b5f5d71
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "semforms",
"version": "0.0.2",
"version": "0.0.3",
"description": "Semantic forms generator and processor",
"keywords": [
"react",
Expand Down
117 changes: 94 additions & 23 deletions src/constants/Constants.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,105 @@
'use strict';

module.exports = {

// Default bootstrap column count
COLUMN_COUNT: 12,

FORM: 'http://onto.fel.cvut.cz/ontologies/documentation/form',
HAS_SUBQUESTION: 'http://onto.fel.cvut.cz/ontologies/documentation/has_related_question',
HAS_ANSWER: 'http://onto.fel.cvut.cz/ontologies/documentation/has_answer',
HAS_OPTION: 'http://onto.fel.cvut.cz/ontologies/form/has-possible-value',
HAS_OPTIONS_QUERY: 'http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query',
HAS_VALUE_TYPE: 'http://onto.fel.cvut.cz/ontologies/form/has-value-type',
IS_DISABLED: 'http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled',
LAYOUT_CLASS: 'http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class',
LAYOUT: {
// Default bootstrap column count
const COLUMN_COUNT = 12;

const FORM = 'http://onto.fel.cvut.cz/ontologies/documentation/form',
HAS_SUBQUESTION = 'http://onto.fel.cvut.cz/ontologies/documentation/has_related_question',
HAS_ANSWER = 'http://onto.fel.cvut.cz/ontologies/documentation/has_answer',
HAS_OPTION = 'http=//onto.fel.cvut.cz/ontologies/form/has-possible-value',
HAS_OPTIONS_QUERY = 'http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query',
HAS_VALUE_TYPE = 'http://onto.fel.cvut.cz/ontologies/form/has-value-type',
IS_DISABLED = 'http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled',
LAYOUT_CLASS = 'http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class',
LAYOUT = {
FORM: 'form',
QUESTION_TYPEAHEAD: 'type-ahead',
QUESTION_SECTION: 'section',
WIZARD_STEP: 'wizard-step',
DISABLED: 'disabled',
HIDDEN: 'hidden',
TEXTAREA: 'textarea'
TEXTAREA: 'textarea',
DATETIME: 'datetime'
},
VALUE_TYPE_CODE: 'code',
VALUE_TYPE_TEXT: 'text',
GENERATED_ROW_SIZE: 1,
VALUE_TYPE_CODE = 'code',
VALUE_TYPE_TEXT = 'text',
GENERATED_ROW_SIZE = 1,

HAS_QUESTION_ORIGIN = 'http://onto.fel.cvut.cz/ontologies/form/has-question-origin',
HAS_ANSWER_ORIGIN = 'http://onto.fel.cvut.cz/ontologies/form/has-answer-origin',

HAS_DATA_VALUE = 'http://onto.fel.cvut.cz/ontologies/documentation/has_data_value',
HAS_OBJECT_VALUE = 'http://onto.fel.cvut.cz/ontologies/documentation/has_object_value';

/**
* Contains mainly definition of constants used to parse the form declaration.
*/
export default class Constants {
static get COLUMN_COUNT() {
return COLUMN_COUNT;
}

static get FORM() {
return FORM;
}

static get HAS_SUBQUESTION() {
return HAS_SUBQUESTION;
}

static get HAS_ANSWER() {
return HAS_ANSWER;
}

static get HAS_OPTION() {
return HAS_OPTION;
}

static get HAS_OPTIONS_QUERY() {
return HAS_OPTIONS_QUERY;
}

static get HAS_VALUE_TYPE() {
return HAS_VALUE_TYPE;
}

static get IS_DISABLED() {
return IS_DISABLED;
}

static get LAYOUT_CLASS() {
return LAYOUT_CLASS;
}

static get LAYOUT() {
return LAYOUT;
}

static get VALUE_TYPE_CODE() {
return VALUE_TYPE_CODE;
}

static get VALUE_TYPE_TEXT() {
return VALUE_TYPE_TEXT;
}

static get GENERATED_ROW_SIZE() {
return GENERATED_ROW_SIZE;
}

static get HAS_QUESTION_ORIGIN() {
return HAS_QUESTION_ORIGIN;
}

static get HAS_ANSWER_ORIGIN() {
return HAS_ANSWER_ORIGIN;
}

HAS_QUESTION_ORIGIN: 'http://onto.fel.cvut.cz/ontologies/form/has-question-origin',
HAS_ANSWER_ORIGIN: 'http://onto.fel.cvut.cz/ontologies/form/has-answer-origin',
static get HAS_DATA_VALUE() {
return HAS_DATA_VALUE;
}

HAS_DATA_VALUE: 'http://onto.fel.cvut.cz/ontologies/documentation/has_data_value',
HAS_OBJECT_VALUE: 'http://onto.fel.cvut.cz/ontologies/documentation/has_object_value'
};
static get HAS_OBJECT_VALUE() {
return HAS_OBJECT_VALUE;
}
}
9 changes: 4 additions & 5 deletions src/semforms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import WizardGenerator from './model/WizardGenerator';
import Configuration from './model/Configuration';
import QuestionAnswerProcessor from './model/QuestionAnswerProcessor';

export {Configuration, QuestionAnswerProcessor, WizardGenerator};
export WizardGenerator from './model/WizardGenerator';
export Configuration from './model/Configuration';
export QuestionAnswerProcessor from './model/QuestionAnswerProcessor';
export Constants from './constants/Constants';

0 comments on commit b5f5d71

Please sign in to comment.