wad-lab 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/bin/index.js +104 -36
  2. package/package.json +1 -1
  3. package/templates/fullstack-springboot-vue/backend/.mvn/wrapper/maven-wrapper.properties +3 -0
  4. package/templates/fullstack-springboot-vue/backend/mvnw +295 -0
  5. package/templates/fullstack-springboot-vue/backend/mvnw.cmd +189 -0
  6. package/templates/fullstack-springboot-vue/backend/pom.xml +42 -0
  7. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/CompanyApplication.java +11 -0
  8. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/controller/CompanyController.java +74 -0
  9. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/model/Department.java +51 -0
  10. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/model/Employee.java +73 -0
  11. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/repository/DepartmentRepository.java +12 -0
  12. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/repository/EmployeeRepository.java +12 -0
  13. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/service/CompanyService.java +60 -0
  14. package/templates/fullstack-springboot-vue/backend/src/main/resources/application.properties +4 -0
  15. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/index.html +12 -0
  16. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/package.json +19 -0
  17. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/App.vue +405 -0
  18. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/main.js +4 -0
  19. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/services/api.js +7 -0
  20. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/vite.config.js +9 -0
  21. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/index.html +12 -0
  22. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/package.json +20 -0
  23. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/App.vue +159 -0
  24. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/components/ToastNotification.vue +47 -0
  25. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/main.js +7 -0
  26. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/services/api.js +32 -0
  27. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/stores/toastStore.js +23 -0
  28. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/vite.config.js +6 -0
  29. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/index.html +12 -0
  30. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/package.json +20 -0
  31. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/App.vue +427 -0
  32. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/main.js +5 -0
  33. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/services/api.js +7 -0
  34. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/stores/companyStore.js +96 -0
  35. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/vite.config.js +9 -0
  36. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/index.html +12 -0
  37. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/package.json +20 -0
  38. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/App.vue +69 -0
  39. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/components/DepartmentSection.vue +152 -0
  40. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/components/EmployeeSection.vue +181 -0
  41. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/main.js +5 -0
  42. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/services/api.js +7 -0
  43. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/stores/companyStore.js +35 -0
  44. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/vite.config.js +6 -0
  45. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/index.html +12 -0
  46. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/package.json +19 -0
  47. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/App.vue +167 -0
  48. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/DepartmentForm.vue +98 -0
  49. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/DepartmentList.vue +91 -0
  50. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/EmployeeForm.vue +128 -0
  51. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/EmployeeList.vue +94 -0
  52. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/main.js +4 -0
  53. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/services/api.js +7 -0
  54. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/vite.config.js +9 -0
  55. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/index.html +12 -0
  56. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/package.json +20 -0
  57. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/App.vue +90 -0
  58. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/main.js +5 -0
  59. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/router/index.js +19 -0
  60. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/services/api.js +7 -0
  61. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/AddEmployeeView.vue +247 -0
  62. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/DepartmentView.vue +273 -0
  63. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/EmployeeView.vue +196 -0
  64. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/HomeDashboardView.vue +263 -0
  65. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/vite.config.js +6 -0
  66. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/index.html +12 -0
  67. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/package.json +20 -0
  68. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/App.vue +20 -0
  69. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/main.js +5 -0
  70. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/router/index.js +42 -0
  71. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/services/api.js +7 -0
  72. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/CompanyLayout.vue +75 -0
  73. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/CompanyOverview.vue +109 -0
  74. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/DepartmentListView.vue +231 -0
  75. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeDetailView.vue +159 -0
  76. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeListView.vue +295 -0
  77. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/vite.config.js +6 -0
  78. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/index.html +12 -0
  79. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/package.json +21 -0
  80. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/App.vue +92 -0
  81. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/main.js +9 -0
  82. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/router/index.js +17 -0
  83. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/services/api.js +7 -0
  84. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/stores/companyStore.js +70 -0
  85. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DashboardView.vue +77 -0
  86. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DepartmentView.vue +209 -0
  87. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/EmployeeView.vue +237 -0
  88. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/vite.config.js +6 -0
  89. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/index.html +12 -0
  90. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/package.json +21 -0
  91. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/App.vue +67 -0
  92. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/components/EntityForm.vue +101 -0
  93. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/components/EntityTable.vue +92 -0
  94. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/components/SummaryBadge.vue +43 -0
  95. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/main.js +9 -0
  96. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/router/index.js +29 -0
  97. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/services/api.js +29 -0
  98. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/stores/companyStore.js +84 -0
  99. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/ManageDepartmentsView.vue +64 -0
  100. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/ManageEmployeesView.vue +67 -0
  101. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/OverviewView.vue +38 -0
  102. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/vite.config.js +6 -0
  103. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/index.html +12 -0
  104. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/package.json +20 -0
  105. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/App.vue +59 -0
  106. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/components/DataCard.vue +53 -0
  107. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/components/EntryForm.vue +117 -0
  108. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/main.js +7 -0
  109. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/router/index.js +23 -0
  110. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/services/api.js +7 -0
  111. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/views/DepartmentPage.vue +77 -0
  112. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/views/EmployeePage.vue +116 -0
  113. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/vite.config.js +6 -0
@@ -0,0 +1,116 @@
1
+ <script setup>
2
+ import { ref, computed, onMounted } from 'vue'
3
+ import api from '../services/api'
4
+ import EntryForm from '../components/EntryForm.vue'
5
+ import DataCard from '../components/DataCard.vue'
6
+
7
+ const employees = ref([])
8
+ const departments = ref([])
9
+
10
+ const empFields = computed(() => {
11
+ if (departments.value.length > 0) {
12
+ return [
13
+ { key: 'name', label: 'Employee Name', placeholder: 'e.g. Jane Doe' },
14
+ { key: 'email', label: 'Email Address', type: 'email', placeholder: 'e.g. jane@example.com' },
15
+ {
16
+ key: 'departmentId',
17
+ label: 'Department',
18
+ type: 'select',
19
+ placeholder: 'Select Department',
20
+ options: departments.value.map(d => ({ value: d.id, label: `${d.name} (${d.code})` }))
21
+ },
22
+ { key: 'salary', label: 'Salary', type: 'number', placeholder: 'e.g. 75000' }
23
+ ]
24
+ }
25
+ return [
26
+ { key: 'name', label: 'Employee Name', placeholder: 'e.g. Jane Doe' },
27
+ { key: 'email', label: 'Email Address', type: 'email', placeholder: 'e.g. jane@example.com' },
28
+ { key: 'departmentId', label: 'Department ID', placeholder: 'e.g. 1' },
29
+ { key: 'salary', label: 'Salary', type: 'number', placeholder: 'e.g. 75000' }
30
+ ]
31
+ })
32
+
33
+ const fetchEmployees = async () => {
34
+ try {
35
+ const res = await api.get('/employees')
36
+ employees.value = res.data
37
+ } catch (error) {
38
+ console.error(error)
39
+ }
40
+ }
41
+
42
+ const fetchDepartments = async () => {
43
+ try {
44
+ const res = await api.get('/departments')
45
+ departments.value = res.data
46
+ } catch (error) {
47
+ console.error(error)
48
+ }
49
+ }
50
+
51
+ const handleCreateEmployee = async (formData) => {
52
+ try {
53
+ const payload = {
54
+ ...formData,
55
+ salary: Number(formData.salary)
56
+ }
57
+ const res = await api.post('/employees', payload)
58
+ employees.value.push(res.data)
59
+ } catch (error) {
60
+ console.error(error)
61
+ }
62
+ }
63
+
64
+ const handleRemoveEmployee = async (id) => {
65
+ try {
66
+ await api.delete(`/employees/${id}`)
67
+ employees.value = employees.value.filter(emp => emp.id !== id)
68
+ } catch (error) {
69
+ console.error(error)
70
+ }
71
+ }
72
+
73
+ const getSubtitle = (emp) => {
74
+ const dept = departments.value.find(d => d.id === emp.departmentId)
75
+ const deptLabel = dept ? `${dept.name} (${dept.code})` : emp.departmentId
76
+ return `${emp.email} | Dept: ${deptLabel} | $${Number(emp.salary).toLocaleString()}`
77
+ }
78
+
79
+ onMounted(() => {
80
+ fetchDepartments()
81
+ fetchEmployees()
82
+ })
83
+ </script>
84
+
85
+ <template>
86
+ <div class="page-container">
87
+ <h2>Employees</h2>
88
+ <EntryForm :fields="empFields" @submit-data="handleCreateEmployee" />
89
+ <div class="card-list">
90
+ <p v-if="employees.length === 0" class="empty-state">No employees available.</p>
91
+ <DataCard
92
+ v-for="emp in employees"
93
+ :key="emp.id"
94
+ :id="emp.id"
95
+ :title="emp.name"
96
+ :subtitle="getSubtitle(emp)"
97
+ @remove="handleRemoveEmployee"
98
+ />
99
+ </div>
100
+ </div>
101
+ </template>
102
+
103
+ <style scoped>
104
+ .page-container {
105
+ display: flex;
106
+ flex-direction: column;
107
+ }
108
+ .empty-state {
109
+ color: #a0aec0;
110
+ font-style: italic;
111
+ }
112
+ .card-list {
113
+ display: flex;
114
+ flex-direction: column;
115
+ }
116
+ </style>
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+
4
+ export default defineConfig({
5
+ plugins: [vue()]
6
+ })