Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
node_modules
**/node_modules
/dist
/docs/.vuepress/dist
/coverage
/tests/e2e/videos/
/tests/e2e/screenshots/
Expand Down
5 changes: 4 additions & 1 deletion dev/vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
maxLength,
url,
/* } from '../dist/as-dynamic-forms.common'; */
} from '../src/main';
} from '@/index';

const data = () => ({
formData: {},
Expand Down Expand Up @@ -201,6 +201,9 @@ export default {
name: 'app',
data,
methods,
mounted() {
console.log(this.$formUtils);
},
};
</script>
<style lang="scss">
Expand Down
2 changes: 1 addition & 1 deletion dev/vue/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vue from 'vue';
import App from './App.vue';
import './styles/main.scss';

import VueDynamicForms from '../../src/main'; // Dev
import VueDynamicForms from '@/index'; // Dev
// import VueDynamicForms from '@asigloo/vue-dynamic-forms' // Prod

Vue.config.productionTip = false;
Expand Down
2 changes: 1 addition & 1 deletion dev/vue/styles/_vendors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
$input-border-radius: 50px; */
// @import '../../src/styles/themes/default.scss';

@import '../../src/styles/themes/material.scss';
@import '@/styles/themes/material.scss';
6,174 changes: 3,796 additions & 2,378 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --target lib --name as-dynamic-forms src/main.js",
"build": "vue-cli-service build --target lib --name as-dynamic-forms src/index.js",
"lint": "vue-cli-service lint",
"test": "vue-cli-service test:unit --verbose --no-cache --watchAll",
"publish": "npm run build && npm publish --access public",
Expand All @@ -22,28 +22,28 @@
},
"main": "dist/as-dynamic-forms.common.js",
"dependencies": {
"bootstrap": "^4.4.1",
"core-js": "^3.6.4",
"sass-resources-loader": "^2.0.1",
"bootstrap": "^4.5.0",
"core-js": "^3.6.5",
"sass-resources-loader": "^2.0.3",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.2.3",
"@vue/cli-plugin-eslint": "^4.2.3",
"@vue/cli-plugin-unit-jest": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-plugin-unit-jest": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/test-utils": "1.0.0-beta.32",
"@vue/test-utils": "1.0.3",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.2.6",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.2",
"babel-jest": "^26.1.0",
"eslint": "^7.4.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.13.1",
"prettier": "^2.0.2",
"sass-loader": "^8.0.2",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"sass-loader": "^9.0.1",
"vue-template-compiler": "^2.6.11",
"vuepress": "^1.5.0"
"vuepress": "^1.5.2"
}
}
35 changes: 35 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import DynamicForm from './components/dynamic-form/DynamicForm.vue';
import DynamicInput from './components/dynamic-input/DynamicInput.vue';
import utils from './core/utils';

const version = process.env.VERSION || require('../package.json').version;

export let _Vue;

export function install(Vue) {
if (install.installed && _Vue === Vue) return;
install.installed = true;

_Vue = Vue;

Vue.prototype.$formUtils = utils;

Vue.component('dynamic-form', DynamicForm);
Vue.component('dynamic-input', DynamicInput);
}

export const AsDynamicForms = {
install,
version,
};

// Automatic installation if Vue has been added to the global scope.
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(AsDynamicForms);
}

export * from './core/utils';

export { DynamicForm, DynamicInput };

export default AsDynamicForms;
14 changes: 0 additions & 14 deletions src/main.js

This file was deleted.