diff --git a/README.md b/README.md index 3bd7e5a..554532c 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,14 @@ vue add kingscode-scaffold npm run serve ``` -Mind that some of the choices you make in the `vue create my-app` and -later in the `vue add vuetify` will be overwritten by vuetify or the kings code scaffold. +Mind that some choices you make in the `vue create my-app` and +later in the `vue add vuetify` will be overwritten by vuetify, or the kings code scaffold. ## Configuration -``` -Notice: it does not matter which choice you make with options that are not documented. - ``` +> Notice: it does not matter which choice you make with options that are not documented. + ### Vue: We'd recommend you to choose @@ -36,12 +35,7 @@ And then: The rest doesn't matter. ### Vuetify -Configure: -- Pre made templates will be overwritten, so keep it default -- Custom properties -- Font awesome 5 (this will be overwritten with font awesome pro) -- Use a-la-carte components -- Locale will be overwritten to dutch as default +Choose recommended ### Kingscode scaffold This is our own scaffold, which you can use with our laravel API you can answer the questions diff --git a/generator/index.js b/generator/index.js index fc8b7ae..1256f10 100644 --- a/generator/index.js +++ b/generator/index.js @@ -5,13 +5,14 @@ module.exports = (api, options) => { api.extendPackage({ dependencies: { 'axios': '^0.19.2', - 'dayjs': '^1.8.19', - 'vuex': '^3.1.2', + 'dayjs': '^1.8.34', + 'vuex': '^3.4.0', 'vuex-persistedstate': '^2.5.4', - 'lodash.clonedeep': '^4.5.0', 'css-vars-ponyfill': '^2.1.2', 'qs': '^6.9.4', 'vue-router': '3.3.4', + 'vue-i18n': '^8.21.0', + }, }); if (options.plugins.includes('fontawesomepro')) { @@ -28,15 +29,6 @@ module.exports = (api, options) => { }); } - if (options.useCrud) { - api.extendPackage({ - dependencies: { - '@kingscode/vuetify-resource': '^2.0.3', - }, - }); - api.render('./templates/Crud', options); - } - if (options.useGithubDeployments) { api.render('./templates/Deployment', options); } @@ -51,6 +43,15 @@ module.exports = (api, options) => { api.render('./templates/Authorisation', options); } + if (options.useCrud) { + api.extendPackage({ + dependencies: { + '@kingscode/vuetify-resource': '^2.0.3', + }, + }); + api.render('./templates/Crud', options); + } + if (options.plugins.includes('sentry')) { api.extendPackage({ dependencies: { diff --git a/generator/templates/Authorisation/src/api/endpoints/authorisation/login.js b/generator/templates/Authorisation/src/api/endpoints/authorisation/login.js index 90bdfed..628d706 100644 --- a/generator/templates/Authorisation/src/api/endpoints/authorisation/login.js +++ b/generator/templates/Authorisation/src/api/endpoints/authorisation/login.js @@ -2,7 +2,7 @@ import { post } from '../../implementation/app'; export default function (email, password) { return post('auth/login', { - email: email, - password: password, + email, + password, }); } diff --git a/generator/templates/Authorisation/src/api/endpoints/authorisation/password.js b/generator/templates/Authorisation/src/api/endpoints/authorisation/password.js deleted file mode 100644 index c64d13c..0000000 --- a/generator/templates/Authorisation/src/api/endpoints/authorisation/password.js +++ /dev/null @@ -1,21 +0,0 @@ -import { post } from '../../implementation/app'; - -function passwordForgotten(email) { - return post('password/forgotten', { - email: email, - }); -} - -function passwordReset(token, email, password, passwordConfirmation) { - return post('password/reset', { - token: token, - email: email, - password: password, - password_confirmation: passwordConfirmation, - }); -} - -export { - passwordForgotten, - passwordReset, -}; diff --git a/generator/templates/Authorisation/src/api/endpoints/authorisation/password/forgotten.js b/generator/templates/Authorisation/src/api/endpoints/authorisation/password/forgotten.js new file mode 100644 index 0000000..f3c75c5 --- /dev/null +++ b/generator/templates/Authorisation/src/api/endpoints/authorisation/password/forgotten.js @@ -0,0 +1,7 @@ +import { post } from '@/api/implementation/app'; + +export default function (email) { + return post('password/forgotten', { + email, + }); +} diff --git a/generator/templates/Authorisation/src/api/endpoints/authorisation/password/reset.js b/generator/templates/Authorisation/src/api/endpoints/authorisation/password/reset.js new file mode 100644 index 0000000..f3578d0 --- /dev/null +++ b/generator/templates/Authorisation/src/api/endpoints/authorisation/password/reset.js @@ -0,0 +1,10 @@ +import { post } from '@/api/implementation/app'; + +export default async function (email, token, password, passwordConfirmation) { + return post('password/reset', { + email, + token, + password, + passwordConfirmation, + }); +} diff --git a/generator/templates/Authorisation/src/api/endpoints/authorisation/register.js b/generator/templates/Authorisation/src/api/endpoints/authorisation/register.js index 65259aa..de2560e 100644 --- a/generator/templates/Authorisation/src/api/endpoints/authorisation/register.js +++ b/generator/templates/Authorisation/src/api/endpoints/authorisation/register.js @@ -1,22 +1,24 @@ import { post } from '../../implementation/app'; -function register(email, name) { - return post('registration', { +function verify(token, email, password, passwordConfirmation) { + return post('registration/verify', { + token, email, - name, + password, + passwordConfirmation, }); } -function verify(token, email, password, passwordConfirmation) { - return post('registration/verify', { - token: token, - email: email, - password: password, - password_confirmation: passwordConfirmation, +function acceptInvitation(email, token, password, passwordConfirmation) { + return post('invitation/accept', { + email, + password, + passwordConfirmation, + token, }); } export { - register, verify, + acceptInvitation, }; diff --git a/generator/templates/Authorisation/src/api/endpoints/password/reset.js b/generator/templates/Authorisation/src/api/endpoints/password/reset.js index 6897a25..54e65fa 100644 --- a/generator/templates/Authorisation/src/api/endpoints/password/reset.js +++ b/generator/templates/Authorisation/src/api/endpoints/password/reset.js @@ -2,9 +2,9 @@ import { post } from '../../implementation/app'; export default async function (email, token, password, passwordConfirmation) { return post('registration', { - email: email, - token: token, - password: password, - password_confirmation: passwordConfirmation, + email, + token, + password, + passwordConfirmation, }); } diff --git a/generator/templates/Authorisation/src/api/endpoints/user.js b/generator/templates/Authorisation/src/api/endpoints/user.js deleted file mode 100644 index c54a7f3..0000000 --- a/generator/templates/Authorisation/src/api/endpoints/user.js +++ /dev/null @@ -1,41 +0,0 @@ -import axios, { getPaginated } from '../implementation/app'; - -function index(page, perPage, search, sortBy, descending, params) { - return getPaginated('user', page, perPage, search, sortBy, descending, params); -} - -/** - * @param id {number} - */ -function show(id) { - return axios.get(`user/${id}`); -} - -/** - * @param user {User} - */ -function create(user) { - return axios.post('user', user); -} - -/** - * @param user {User} - */ -function update(user) { - return axios.put(`user/${user.id}`, user); -} - -/** - * @param userId {number} - */ -function destroy(userId) { - return axios.delete(`user/${userId}`); -} - -export { - index, - show, - create, - update, - destroy, -}; diff --git a/generator/templates/Authorisation/src/components/Authorisation/PasswordForgottenCard.vue b/generator/templates/Authorisation/src/components/Authorisation/PasswordForgottenCard.vue deleted file mode 100644 index 7091b6b..0000000 --- a/generator/templates/Authorisation/src/components/Authorisation/PasswordForgottenCard.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/generator/templates/Authorisation/src/components/Authorisation/PasswordResetCard.vue b/generator/templates/Authorisation/src/components/Authorisation/PasswordResetCard.vue deleted file mode 100644 index 201a888..0000000 --- a/generator/templates/Authorisation/src/components/Authorisation/PasswordResetCard.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - diff --git a/generator/templates/Authorisation/src/components/Authorisation/LoginCard.vue b/generator/templates/Authorisation/src/components/authorisation/LoginCard.vue similarity index 53% rename from generator/templates/Authorisation/src/components/Authorisation/LoginCard.vue rename to generator/templates/Authorisation/src/components/authorisation/LoginCard.vue index 34d2764..8e22197 100644 --- a/generator/templates/Authorisation/src/components/Authorisation/LoginCard.vue +++ b/generator/templates/Authorisation/src/components/authorisation/LoginCard.vue @@ -1,7 +1,7 @@ diff --git a/generator/templates/Authorisation/src/components/authorisation/PasswordResetCard.vue b/generator/templates/Authorisation/src/components/authorisation/PasswordResetCard.vue new file mode 100644 index 0000000..f4c040a --- /dev/null +++ b/generator/templates/Authorisation/src/components/authorisation/PasswordResetCard.vue @@ -0,0 +1,119 @@ + + + + + diff --git a/generator/templates/Authorisation/src/components/Authorisation/RegisterCard.vue b/generator/templates/Authorisation/src/components/authorisation/RegisterCard.vue similarity index 91% rename from generator/templates/Authorisation/src/components/Authorisation/RegisterCard.vue rename to generator/templates/Authorisation/src/components/authorisation/RegisterCard.vue index f2944da..a4b73bb 100644 --- a/generator/templates/Authorisation/src/components/Authorisation/RegisterCard.vue +++ b/generator/templates/Authorisation/src/components/authorisation/RegisterCard.vue @@ -4,36 +4,36 @@ Ik wil een account aanvragen {{ alertMessage }} - Registreren + Registreren - - diff --git a/generator/templates/Authorisation/src/views/Verify.vue b/generator/templates/Authorisation/src/views/Verify.vue deleted file mode 100644 index f3fcb48..0000000 --- a/generator/templates/Authorisation/src/views/Verify.vue +++ /dev/null @@ -1,116 +0,0 @@ - - - -= diff --git a/generator/templates/Authorisation/src/views/AuthorisationCallback.vue b/generator/templates/Authorisation/src/views/authorisation/AuthorisationCallback.vue similarity index 89% rename from generator/templates/Authorisation/src/views/AuthorisationCallback.vue rename to generator/templates/Authorisation/src/views/authorisation/AuthorisationCallback.vue index a36cdb1..6ae7dd9 100644 --- a/generator/templates/Authorisation/src/views/AuthorisationCallback.vue +++ b/generator/templates/Authorisation/src/views/authorisation/AuthorisationCallback.vue @@ -5,8 +5,8 @@ + + diff --git a/generator/templates/Authorisation/src/views/Login.vue b/generator/templates/Authorisation/src/views/authorisation/Login.vue similarity index 52% rename from generator/templates/Authorisation/src/views/Login.vue rename to generator/templates/Authorisation/src/views/authorisation/Login.vue index 691d904..93e9c57 100644 --- a/generator/templates/Authorisation/src/views/Login.vue +++ b/generator/templates/Authorisation/src/views/authorisation/Login.vue @@ -3,20 +3,15 @@ - - - diff --git a/generator/templates/Crud/src/api/endpoints/user.js b/generator/templates/Crud/src/api/endpoints/user.js new file mode 100644 index 0000000..f909e11 --- /dev/null +++ b/generator/templates/Crud/src/api/endpoints/user.js @@ -0,0 +1,30 @@ +import { getPaginated } from '@/api/implementation/app/wrapper.js'; +import { destroy, get, post, put } from '@/api/implementation/app'; + +function index(page, perPage, search, sortBy, descending, params) { + return getPaginated('user', page, perPage, search, sortBy, descending, params); +} + +function show(id) { + return get(`user/${id}`); +} + +function create(user) { + return post('user', user); +} + +function update(user) { + return put(`user/${user.id}`, user); +} + +function remove(userId) { + return destroy(`user/${userId}`); +} + +export { + index, + show, + create, + update, + remove, +}; diff --git a/generator/templates/Crud/src/components/Resource.vue b/generator/templates/Crud/src/components/Resource.vue index 7f04c5d..da89953 100644 --- a/generator/templates/Crud/src/components/Resource.vue +++ b/generator/templates/Crud/src/components/Resource.vue @@ -1,40 +1,38 @@ diff --git a/generator/templates/Crud/src/locales/nl/user.json b/generator/templates/Crud/src/locales/nl/user.json new file mode 100644 index 0000000..14108fe --- /dev/null +++ b/generator/templates/Crud/src/locales/nl/user.json @@ -0,0 +1,7 @@ +{ + "title": "Gebruiker|Gebruikers", + "fields": { + "name": "Naam", + "email": "E-mail" + } +} diff --git a/generator/templates/Crud/src/mixins/formDataValues.js b/generator/templates/Crud/src/mixins/formDataValues.js deleted file mode 100644 index 4376d0a..0000000 --- a/generator/templates/Crud/src/mixins/formDataValues.js +++ /dev/null @@ -1,17 +0,0 @@ -export default { - methods: { - appendFormData(form_data, values, startKey = '') { - if (typeof values === 'object') { - for (const key in values) { - const currentKey = startKey.length ? startKey + '[' + key + ']' : key; - - if (typeof values[key] === 'object' && !(values[key] instanceof File)) { - this.appendFormData(form_data, values[key], currentKey); - } else if (typeof values[key] !== 'undefined') { - form_data.append(currentKey, values[key]); - } - } - } - }, - }, -}; diff --git a/generator/templates/Crud/src/router/routes/authorised.js b/generator/templates/Crud/src/router/routes/authorised.js new file mode 100644 index 0000000..cfa1439 --- /dev/null +++ b/generator/templates/Crud/src/router/routes/authorised.js @@ -0,0 +1,18 @@ +import AuthorisationGuard from '@/router/guards/AuthorisationGuard.js'; + +export default { + path: '', + beforeEnter: AuthorisationGuard, + component: () => import('@/templates/Default'), + children: [ + { + path: '', + name: 'home', + component: () => import('@/views/Home'), + },{ + path: '/users', + name: 'users', + component: () => import('@/views/UserResource.vue') + }, + ] +} diff --git a/generator/templates/Crud/src/views/UserResource.vue b/generator/templates/Crud/src/views/UserResource.vue index 73e47ac..811bea5 100644 --- a/generator/templates/Crud/src/views/UserResource.vue +++ b/generator/templates/Crud/src/views/UserResource.vue @@ -5,7 +5,7 @@ :delete-request="deleteHandler" :form-component="() => import('../components/forms/UserForm.vue')" :index-request="indexHandler" - :meta="{name: 'gebruiker', namePlural: 'gebruikers'}" + :meta="{name: $tc('user.title', 1), namePlural: $tc('user.title', 2)}" :model-type="modelType" :show-request="showHandler" :table-content="tableContent" @@ -16,7 +16,8 @@ diff --git a/generator/templates/Default/src/api/implementation/app/index.js b/generator/templates/Default/src/api/implementation/app/index.js index 57da027..a680a82 100644 --- a/generator/templates/Default/src/api/implementation/app/index.js +++ b/generator/templates/Default/src/api/implementation/app/index.js @@ -7,7 +7,6 @@ import { onResponseRejected, } from './interceptor'; import { transformParams, transformRequest, transformResponse } from './transformer'; -import { getPaginated } from './wrapper'; /** * Returns an axios instance @@ -32,13 +31,11 @@ const instance = axios.create(config); instance.interceptors.request.use(onRequestFulFilled, onRequestRejected); instance.interceptors.response.use(onResponseFulFilled, onResponseRejected); -const get = instance.get; -const post = instance.post; +const { get, post, put } = instance; const destroy = instance.delete; -const put = instance.put; + export { - getPaginated, get, post, destroy, diff --git a/generator/templates/Default/src/api/implementation/app/interceptor.js b/generator/templates/Default/src/api/implementation/app/interceptor.js index 696c42c..26a843e 100644 --- a/generator/templates/Default/src/api/implementation/app/interceptor.js +++ b/generator/templates/Default/src/api/implementation/app/interceptor.js @@ -1,4 +1,5 @@ -import store from '../../../store'; +import router from '@/router'; +import store from '@/store'; /** * @param request {AxiosRequestConfig} @@ -9,14 +10,14 @@ function onRequestFulFilled(request) { if (request.data instanceof FormData) { request.data.append('_method', 'put'); } else { - request.data['_method'] = 'put'; + request.data._method = 'put'; } } const computedHeaders = computeHeaders(); Object.keys(computedHeaders) - .forEach(header => { + .forEach((header) => { Object.assign(request.headers.common, { [header]: computedHeaders[header], }); @@ -51,17 +52,27 @@ function onResponseFulFilled(response) { * @param error {AxiosError} */ function onResponseRejected(error) { - const response = error.response; + const { response } = error; if (!response) return Promise.reject(error); // network error, not axios related - const status = response.status; - const errors = response.data.errors; + const { status } = response; + const { errors } = response.data; + + if (status === 401) { + store.dispatch('authorisation/logout'); + router.push({ name: 'login' }); + return; + } else if (status === 403) { + router.push({ name: '403' }); + } else if (status === 404) { + router.push({ name: '404' }); + } if (errors && status === 422) { Object.keys(errors) - .forEach(key => store.commit('error/add', { - key: key, + .forEach((key) => store.commit('error/add', { + key, message: errors[key][0], })); } diff --git a/generator/templates/Default/src/api/implementation/app/transformer.js b/generator/templates/Default/src/api/implementation/app/transformer.js index d7d647c..64cac2a 100644 --- a/generator/templates/Default/src/api/implementation/app/transformer.js +++ b/generator/templates/Default/src/api/implementation/app/transformer.js @@ -1,7 +1,7 @@ import Qs from 'qs'; -import Model from '../../../application/models/model.js'; +import Model from '@/application/models/model'; import { camelToSnake, snakeToCamel } from '../../util/keyConverter'; -import objectToFormData from '../../util/objectToFormDataConverter.js'; +import objectToFormData from '../../util/objectToFormDataConverter'; /** * @param response @@ -9,8 +9,12 @@ import objectToFormData from '../../util/objectToFormDataConverter.js'; */ function transformResponse(response) { if (typeof response === 'string' && response.length > 0) { - const result = JSON.parse(response); - return snakeToCamel(result); + try { + const result = JSON.parse(response); + return snakeToCamel(result); + } catch (e) { + return response; + } } if (!response) { diff --git a/generator/templates/Default/src/api/implementation/app/wrapper.js b/generator/templates/Default/src/api/implementation/app/wrapper.js index 9456dbf..c067a9d 100644 --- a/generator/templates/Default/src/api/implementation/app/wrapper.js +++ b/generator/templates/Default/src/api/implementation/app/wrapper.js @@ -1,4 +1,5 @@ -import handle from './index'; +import { get } from '@/api/implementation/app'; +import { convertCamelToSnake } from '@/api/util/keyConverter.js'; /** * @param url @@ -14,17 +15,18 @@ function getPaginated(url, page = 1, perPage = 10, search, sortBy, descending, p if (search) { params.search = search; } + if (sortBy) { - params.sortBy = sortBy; + params.sortBy = convertCamelToSnake(sortBy); } if (typeof descending !== 'undefined') { params.desc = descending ? '1' : '0'; } - return handle.get(url, { + return get(url, { params: { - page: page, - perPage: perPage, + page, + perPage, ...params, }, }); diff --git a/generator/templates/Default/src/api/util/keyConverter.js b/generator/templates/Default/src/api/util/keyConverter.js index 54338a0..775b9c4 100644 --- a/generator/templates/Default/src/api/util/keyConverter.js +++ b/generator/templates/Default/src/api/util/keyConverter.js @@ -6,9 +6,11 @@ function camelToSnake(data) { const target = Array.isArray(data) ? [] : {}; Object.keys(data) - .forEach(key => { + .forEach((key) => { Object.assign(target, { - [convertCamelToSnake(key)]: isIterableObject(data[key]) ? camelToSnake(data[key]) : data[key], + [convertCamelToSnake(key)]: isIterableObject(data[key]) + ? camelToSnake(data[key]) + : data[key], }); }); @@ -16,9 +18,7 @@ function camelToSnake(data) { } function convertCamelToSnake(key) { - return key.replace(/[A-Z]/g, value => { - return '_' + value[0].toLowerCase(); - }); + return key.replace(/[A-Z]/g, (value) => `_${value[0].toLowerCase()}`); } function snakeToCamel(data) { @@ -29,9 +29,11 @@ function snakeToCamel(data) { const target = Array.isArray(data) ? [] : {}; Object.keys(data) - .forEach(key => { + .forEach((key) => { Object.assign(target, { - [convertSnakeToCamel(key)]: isIterableObject(data[key]) ? snakeToCamel(data[key]) : data[key], + [convertSnakeToCamel(key)]: isIterableObject(data[key]) + ? snakeToCamel(data[key]) + : data[key], }); }); @@ -39,9 +41,7 @@ function snakeToCamel(data) { } function convertSnakeToCamel(key) { - return key.replace(/_\w/g, value => { - return value[1].toUpperCase(); - }); + return key.replace(/_\w/g, (value) => value[1].toUpperCase()); } function isIterableObject(target) { @@ -51,4 +51,6 @@ function isIterableObject(target) { export { snakeToCamel, camelToSnake, + convertCamelToSnake, + convertSnakeToCamel, }; diff --git a/generator/templates/Default/src/api/util/response.js b/generator/templates/Default/src/api/util/response.js index 3b3c370..b3f8a8e 100644 --- a/generator/templates/Default/src/api/util/response.js +++ b/generator/templates/Default/src/api/util/response.js @@ -1,4 +1,4 @@ -import dayjs from '../../plugins/dayJs.js'; +import dayjs from '../../plugins/dayJs'; function getRateLimitMinutes(response, defaultMinutes = 15) { const remainingMilliseconds = (+response.headers['retry-after']) * 1000; diff --git a/generator/templates/Default/src/application/models/model.js b/generator/templates/Default/src/application/models/model.js index ed45054..262d4e6 100644 --- a/generator/templates/Default/src/application/models/model.js +++ b/generator/templates/Default/src/application/models/model.js @@ -29,48 +29,29 @@ class Model { const value = assignable[key]; const type = typeof value; - if (typeof data[key] === type) { - assignable[key] = data[key]; + if (typeof data === 'undefined') { + assignable[key] = value; return; } - const defaultValue = this.getDefaultValueFromType(type, value); - - assignable[key] = data[key] || defaultValue; - }); - - Object.keys(data) - .forEach(key => { - if (typeof assignable[key] === 'undefined') { - assignable[key] = data[key]; - } + const apiValue = data[key]; + assignable[key] = this.convertByType(type, value, apiValue); }); return assignable; } - /** - * @private - * @param type - * @param defaultModelValue - * @return {*} - */ - getDefaultValueFromType(type, defaultModelValue) { - let defaultValue; - - if (type === 'string') { - defaultValue = defaultModelValue || ''; + convertByType(type, currentValue, apiValue) { + if (type === 'object' && currentValue && typeof currentValue.mapResponse === 'function') { + return currentValue.mapResponse(apiValue); + } else if (type === 'string') { + return apiValue ? String(apiValue) : ''; } else if (type === 'boolean') { - defaultValue = defaultModelValue || false; + return Boolean(apiValue); } else if (type === 'number') { - defaultValue = defaultModelValue || 0; - } else if (Array.isArray(defaultModelValue)) { - defaultValue = defaultModelValue || []; - } else { - defaultValue = defaultModelValue || null; + return parseFloat(apiValue); } - - return defaultValue; + return apiValue || currentValue; } } diff --git a/generator/templates/Default/src/application/util/translation.js b/generator/templates/Default/src/application/util/translation.js new file mode 100644 index 0000000..ffee3b5 --- /dev/null +++ b/generator/templates/Default/src/application/util/translation.js @@ -0,0 +1,20 @@ +import i18n from '@/plugins/i18n.js'; + +function translateField(field, translationPrefix) { + if (translationPrefix) { + const translationKey = `${translationPrefix}.${field}`; + if (translationPrefix && i18n.te(translationKey)) { + return i18n.t(translationKey); + } + + if (i18n.te(field)) { + return i18n.t(field); + } + + return i18n.t(translationKey); + } +} + +export { + translateField, +}; diff --git a/generator/templates/Default/src/application/util/url.js b/generator/templates/Default/src/application/util/url.js index 4c606b9..59801b5 100644 --- a/generator/templates/Default/src/application/util/url.js +++ b/generator/templates/Default/src/application/util/url.js @@ -1,6 +1,6 @@ function getFragment(key, defaultValue = '') { const fragmentRegExp = new RegExp(`[\\#&]${key}=([^&#]*)`); - const result = fragmentRegExp.exec(location.hash); + const result = fragmentRegExp.exec(window.location.hash); if (result && result.length >= 2) { return decodeURIComponent(result[1]); diff --git a/generator/templates/Default/src/components/BaseForm.vue b/generator/templates/Default/src/components/BaseForm.vue deleted file mode 100644 index 87beb3f..0000000 --- a/generator/templates/Default/src/components/BaseForm.vue +++ /dev/null @@ -1,58 +0,0 @@ - diff --git a/generator/templates/Default/src/components/Breadcrumbs.vue b/generator/templates/Default/src/components/Breadcrumbs.vue new file mode 100644 index 0000000..0a290bb --- /dev/null +++ b/generator/templates/Default/src/components/Breadcrumbs.vue @@ -0,0 +1,27 @@ + + + diff --git a/generator/templates/Default/src/components/PaginatedAutocomplete.vue b/generator/templates/Default/src/components/PaginatedAutocomplete.vue deleted file mode 100644 index 1dc3ed3..0000000 --- a/generator/templates/Default/src/components/PaginatedAutocomplete.vue +++ /dev/null @@ -1,138 +0,0 @@ - - - - - diff --git a/generator/templates/Default/src/components/crud/fields/FieldMixin.vue b/generator/templates/Default/src/components/crud/fields/FieldMixin.vue new file mode 100644 index 0000000..9f22f69 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/FieldMixin.vue @@ -0,0 +1,90 @@ + + diff --git a/generator/templates/Default/src/components/crud/fields/KAutocomplete.vue b/generator/templates/Default/src/components/crud/fields/KAutocomplete.vue new file mode 100644 index 0000000..c5c959a --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KAutocomplete.vue @@ -0,0 +1,21 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KDateField.vue b/generator/templates/Default/src/components/crud/fields/KDateField.vue new file mode 100644 index 0000000..161fe93 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KDateField.vue @@ -0,0 +1,95 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KFieldGroup.vue b/generator/templates/Default/src/components/crud/fields/KFieldGroup.vue new file mode 100644 index 0000000..ef4f203 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KFieldGroup.vue @@ -0,0 +1,37 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KFileField.vue b/generator/templates/Default/src/components/crud/fields/KFileField.vue new file mode 100644 index 0000000..5420be1 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KFileField.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/generator/templates/Default/src/components/crud/fields/KPaginatedAutocomplete.vue b/generator/templates/Default/src/components/crud/fields/KPaginatedAutocomplete.vue new file mode 100644 index 0000000..34a8fe9 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KPaginatedAutocomplete.vue @@ -0,0 +1,129 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KRadioGroup.vue b/generator/templates/Default/src/components/crud/fields/KRadioGroup.vue new file mode 100644 index 0000000..d1cf11a --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KRadioGroup.vue @@ -0,0 +1,34 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KSelect.vue b/generator/templates/Default/src/components/crud/fields/KSelect.vue new file mode 100644 index 0000000..15d3f9b --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KSelect.vue @@ -0,0 +1,21 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KTextField.vue b/generator/templates/Default/src/components/crud/fields/KTextField.vue new file mode 100644 index 0000000..0302bb8 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KTextField.vue @@ -0,0 +1,21 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KTextarea.vue b/generator/templates/Default/src/components/crud/fields/KTextarea.vue new file mode 100644 index 0000000..4893ef4 --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KTextarea.vue @@ -0,0 +1,17 @@ + + + diff --git a/generator/templates/Default/src/components/crud/fields/KTimeField.vue b/generator/templates/Default/src/components/crud/fields/KTimeField.vue new file mode 100644 index 0000000..7b7737e --- /dev/null +++ b/generator/templates/Default/src/components/crud/fields/KTimeField.vue @@ -0,0 +1,87 @@ + + + diff --git a/generator/templates/Default/src/components/menu/Menu.vue b/generator/templates/Default/src/components/menu/Menu.vue index 74fd5c0..d8ede5a 100644 --- a/generator/templates/Default/src/components/menu/Menu.vue +++ b/generator/templates/Default/src/components/menu/Menu.vue @@ -1,5 +1,5 @@