Skip to content

Commit

Permalink
Merge pull request #121 from lionel-bijaoui/separate_bundle
Browse files Browse the repository at this point in the history
Separate bundle and remove deprecated fields
  • Loading branch information
lionel-bijaoui authored Feb 15, 2017
2 parents ade96b4 + 63268f4 commit 94a0648
Show file tree
Hide file tree
Showing 61 changed files with 124 additions and 702 deletions.
6 changes: 3 additions & 3 deletions dev/full/data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Fakerator from "fakerator";
import moment from "moment";
import fecha from "fecha";

let fakerator = new Fakerator();

Expand All @@ -26,8 +26,8 @@ module.exports = {
user.bio = fakerator.lorem.paragraph();
let dob = fakerator.date.past(40, "1998-01-01");
user.dob = dob.valueOf();
user.time = moment().format("hh:mm:ss");
user.age = moment().year() - moment(dob).year();
user.time = fecha.format(new Date(), "hh:mm:ss");
user.age = fecha.format(new Date().getFullYear() - dob, "YY");
user.rank = fakerator.random.number(1, 10);
user.role = fakerator.random.arrayElement(roles).id;
//user.mobile = fakerator.phone.phoneNumber();
Expand Down
8 changes: 4 additions & 4 deletions dev/full/schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from "moment";
import fecha from "fecha";

import {
validators
Expand Down Expand Up @@ -352,7 +352,7 @@ module.exports = {
label: "Created (label field)",
model: "created",
get(model) {
return model && model.created ? moment(model.created).format("LLL") : "-";
// return model && model.created ? fecha.format(model.created,"MMMM D YYYY H") : "-";
},
styleClasses: "half-width"
}, {
Expand Down Expand Up @@ -535,8 +535,8 @@ module.exports = {
model: "dob",
required: true,
placeholder: "User's birth of date",
min: moment("1900-01-01").toDate(),
max: moment("2018-01-01").toDate(),
min: fecha.parse("1900-01-01", "YYYY-MM-DD"),
max: fecha.parse("2018-01-01", "YYYY-MM-DD"),
validator: [
validators.date
],
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"main": "dist/vue-form-generator.js",
"scripts": {
"prebuild": "npm run test",
"build": "webpack --progress --config webpack.build.config.js",
"build:core": "webpack --progress --config webpack.build.config.js --define process.env.FULL_BUNDLE=false --output-filename=vue-form-generator-core.js",
"build:full": "webpack --progress --config webpack.build.config.js --define process.env.FULL_BUNDLE=true",
"build": "npm run build:core && npm run build:full",
"dev": "webpack-dev-server --config webpack.dev.config.js --inline --hot --content-base dev/",
"lint": "eslint --ext=.js,.vue src test/unit/specs",
"coverall": "cat ./test/unit/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
Expand Down Expand Up @@ -34,6 +36,8 @@
"files": [
"dist/vue-form-generator.js",
"dist/vue-form-generator.css",
"dist/vue-form-generator-core.js",
"dist/vue-form-generator-core.css",
"src"
],
"author": "Icebob",
Expand Down Expand Up @@ -79,7 +83,6 @@
"mocha": "2.5.3",
"mocha-generators": "1.2.0",
"mocha-loader": "0.7.1",
"moment": "2.17.1",
"node-sass": "3.10.1",
"phantomjs-prebuilt": "2.1.14",
"sass-loader": "3.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<script>
import {isObject, isNil} from "lodash";
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
9 changes: 6 additions & 3 deletions src/fields/fieldInput.vue → src/fields/core/fieldInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,22 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import fecha from "fecha";
export default {
mixins: [ abstractField ],
methods: {
formatValueToField(value) {
if (value != null) {
console.info(value);
if (typeof value === "undefined") {
return value;
}else{
switch(this.schema.inputType){
case "date":
return fecha.format(value, "YYYY-MM-DD");
case "datetime":
return fecha.format(value);
return fecha.format(value, "YYYY-MM-DD HH:mm:ss");
case "datetime-local":
return fecha.format(value, "YYYY-MM-DDTHH:mm:ss");
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script>
import {isObject} from "lodash";
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script>
import {isObject} from "lodash";
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { isFunction } from "lodash";
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ]
Expand Down
26 changes: 0 additions & 26 deletions src/fields/fieldColor.vue

This file was deleted.

14 changes: 0 additions & 14 deletions src/fields/fieldEmail.vue

This file was deleted.

14 changes: 0 additions & 14 deletions src/fields/fieldNumber.vue

This file was deleted.

14 changes: 0 additions & 14 deletions src/fields/fieldPassword.vue

This file was deleted.

25 changes: 0 additions & 25 deletions src/fields/fieldRange.vue

This file was deleted.

15 changes: 0 additions & 15 deletions src/fields/fieldText.vue

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { defaults } from "lodash";
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

<script>
/* global $ */
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { defaults } from "lodash";
import dateFieldHelper from "../utils/dateFieldHelper";
import dateFieldHelper from "../../utils/dateFieldHelper";
let inputFormat = "YYYY-MM-DD HH:mm:ss";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* https://github.com/gocanto/google-autocomplete
*/
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { isFunction } from "lodash";
/* global google */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
/* global $ */
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { isArray, defaults } from "lodash";
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { defaults } from "lodash";
import dateFieldHelper from "../utils/dateFieldHelper";
import dateFieldHelper from "../../utils/dateFieldHelper";
let inputFormat = "YYYY-MM-DD";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
/* global $ */
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { defaults, isArray } from "lodash";
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script>
/* global $ */
import {isObject} from "lodash";
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script>
/* global $ */
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { defaults } from "lodash";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
import { defaults } from "lodash";
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</template>

<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [ abstractField ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
)
</template>
<script>
import abstractField from "./abstractField";
import abstractField from "../abstractField";
export default {
mixins: [abstractField],
Expand Down
Loading

0 comments on commit 94a0648

Please sign in to comment.