Skip to content

Commit e4a1f8c

Browse files
Merge pull request #9 from SimplrJS/feature/dom
Feature/dom
2 parents 4f1a7b4 + 7f551f8 commit e4a1f8c

File tree

20 files changed

+281
-47
lines changed

20 files changed

+281
-47
lines changed

packages/simplr-forms-core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "simplr-forms-core",
3-
"version": "4.0.0-alpha",
3+
"version": "4.0.0-pre-alpha.4",
44
"description": "Shared simplr-forms logic.",
55
"repository": "https://github.com/SimplrJS/simplr-forms",
66
"main": "dist/simplr-forms-core.js",
77
"types": "@types/index.d.ts",
88
"scripts": {
9-
"build": "webpack && npm run tslint-test",
9+
"build": "webpack && npm run tslint",
1010
"watch": "webpack -w",
11-
"tslint-test": "tslint --config ./tslint.json --project . --exclude __tests__/**/* && echo TsLint test successfully passed.",
11+
"tslint": "tslint --config ./tslint.json --project . --exclude __tests__/**/* && echo TsLint test successfully passed.",
1212
"uglifyjs": "uglifyjs ./dist/simplr-forms-core.js -o ./dist/simplr-forms-core.min.js --compress --mangle",
1313
"release": "npm run build && npm run uglifyjs",
1414
"test": "jest",

packages/simplr-forms-core/src/abstractions/base-field.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as ValueHelpers from "../utils/value-helpers";
1414
import { FormContextPropsObject } from "../contracts/form";
1515
import { FormStore } from "../stores/form-store";
1616
import { FormStoreStateRecord } from "../contracts/form-store";
17-
import * as FormStoreActions from "../actions/form-store-actions";
17+
import * as FormStoreActions from "../actions/form-store";
1818
// import { FieldsGroupContextProps } from "../contracts/fields-group";
1919
import { FSHContainer } from "../stores/form-stores-handler";
2020

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from "./form-store-actions";
2-
export * from "./form-stores-handler-actions";
1+
export * from "./form-store";
2+
export * from "./form-stores-handler";

packages/simplr-forms-core/src/stores/form-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as Immutable from "immutable";
22
import { recordify } from "typed-immutable-record";
33
import { ActionEmitter } from "action-emitter";
44

5-
import * as Actions from "../actions/form-store-actions";
5+
import * as Actions from "../actions/form-store";
66
import {
77
FieldState,
88
FieldValue,

packages/simplr-forms-core/src/stores/form-stores-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as Immutable from "immutable";
22
import { ActionEmitter } from "action-emitter";
33

44
import { FormStore } from "./form-store";
5-
import * as Actions from "../actions/form-stores-handler-actions";
5+
import * as Actions from "../actions/form-stores-handler";
66

77
export class FormStoresHandlerClass extends ActionEmitter {
88
private storesCount: number;

packages/simplr-forms-dom/README.md

Whitespace-only changes.
Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,50 @@
1-
{
2-
"name": "simplr-validation",
3-
"version": "4.0.0-alpha",
4-
"description": "DOM components for simplr-forms.",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
9-
"author": "simplrjs <[email protected]> (https://github.com/simplrjs)",
10-
"license": "AGPL-3.0",
11-
"devDependencies": {
12-
"@types/enzyme": "^2.7.7",
13-
"@types/jest": "^19.2.2",
14-
"@types/sinon": "^2.1.2",
15-
"enzyme": "^2.8.0",
16-
"jest": "^19.0.2",
17-
"jest-enzyme": "^3.0.0",
18-
"sinon": "^2.1.0",
19-
"ts-jest": "^19.0.8",
20-
"tslint": "^5.0.0",
21-
"typescript": "2.3.0"
22-
},
23-
"dependencies": {
24-
"@types/react": "^15.0.21",
25-
"react": "^15.5.4",
26-
"simplr-forms-core": "4.0.0-alpha"
27-
},
28-
"jest": {
29-
"setupTestFrameworkScriptFile": "./node_modules/jest-enzyme/lib/index.js",
30-
"transform": {
31-
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
32-
},
33-
"testRegex": "/__tests__/.*\\.(test|spec).(ts|tsx|js)$",
34-
"moduleFileExtensions": [
35-
"ts",
36-
"tsx",
37-
"js"
38-
]
39-
}
1+
{
2+
"name": "simplr-forms-dom",
3+
"version": "4.0.0-pre-alpha.6",
4+
"description": "DOM components for simplr-forms.",
5+
"main": "dist/simplr-forms-dom.js",
6+
"types": "@types/index.d.ts",
7+
"scripts": {
8+
"build": "webpack && npm run tslint",
9+
"watch": "webpack -w",
10+
"tslint": "tslint --config ./tslint.json --project . --exclude __tests__/**/* && echo TsLint test successfully passed.",
11+
"uglifyjs": "uglifyjs ./dist/simplr-forms-core.js -o ./dist/simplr-forms-core.min.js --compress --mangle",
12+
"release": "npm run build && npm run uglifyjs",
13+
"test": "jest",
14+
"test-watch": "jest --watchAll",
15+
"test-coverage": "npm test -- --coverage"
16+
},
17+
"author": "simplrjs <[email protected]> (https://github.com/simplrjs)",
18+
"license": "AGPL-3.0",
19+
"devDependencies": {
20+
"@types/enzyme": "^2.7.7",
21+
"@types/jest": "^19.2.2",
22+
"@types/sinon": "^2.1.2",
23+
"enzyme": "^2.8.0",
24+
"jest": "^19.0.2",
25+
"jest-enzyme": "^3.0.0",
26+
"sinon": "^2.1.0",
27+
"ts-jest": "^19.0.8",
28+
"ts-loader": "^2.0.3",
29+
"tslint": "^5.0.0",
30+
"typescript": "2.3.0",
31+
"webpack": "^2.4.1"
32+
},
33+
"dependencies": {
34+
"@types/react": "^15.0.21",
35+
"react": "^15.5.4",
36+
"simplr-forms-core": "^4.0.0-pre-alpha.3"
37+
},
38+
"jest": {
39+
"setupTestFrameworkScriptFile": "./node_modules/jest-enzyme/lib/index.js",
40+
"transform": {
41+
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
42+
},
43+
"testRegex": "/__tests__/.*\\.(test|spec).(ts|tsx|js)$",
44+
"moduleFileExtensions": [
45+
"ts",
46+
"tsx",
47+
"js"
48+
]
49+
}
4050
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as React from "react";
2+
import { Abstractions as CoreAbstractions, Contracts as CoreContracts } from "simplr-forms-core";
3+
4+
export interface BaseDomFieldState extends CoreAbstractions.BaseFieldState {
5+
6+
}
7+
8+
export abstract class BaseDomField<TProps extends CoreContracts.FieldProps, TState extends BaseDomFieldState>
9+
extends CoreAbstractions.BaseField<TProps, TState> {
10+
protected RawInitialValue: any;
11+
protected DefaultValue: any;
12+
13+
public abstract renderField(): JSX.Element | null;
14+
15+
public render() {
16+
return this.renderField();
17+
}
18+
}

0 commit comments

Comments
 (0)