@finema/finework-layer 0.2.77 → 0.2.79

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 (41) hide show
  1. package/.husky/pre-commit +1 -1
  2. package/.playground/app/assets/css/main.css +6 -6
  3. package/.playground/app/pages/layout-admin/[id]/index.vue +145 -145
  4. package/.playground/app/pages/layout-admin/test/[id]/index.vue +286 -286
  5. package/.playground/app/pages/layout-admin.vue +283 -285
  6. package/.playground/app/pages/layout-user.vue +284 -284
  7. package/.playground/app/pages/submenu/layout-admin.vue +210 -210
  8. package/.vscode/settings.json +5 -1
  9. package/CHANGELOG.md +382 -374
  10. package/app/app.config.ts +144 -144
  11. package/app/app.vue +10 -10
  12. package/app/assets/css/main.css +77 -77
  13. package/app/components/Button/ActionIcon.vue +29 -29
  14. package/app/components/Button/Back.vue +22 -22
  15. package/app/components/Format/Currency.vue +17 -17
  16. package/app/components/Format/Date.vue +24 -24
  17. package/app/components/Format/DateTime.vue +24 -24
  18. package/app/components/Format/Number.vue +17 -17
  19. package/app/components/Format/Percent.vue +38 -38
  20. package/app/components/Format/TimeFromNow.vue +38 -38
  21. package/app/components/InfoItemList.vue +196 -196
  22. package/app/components/Layout/Admin/Sidebar.vue +343 -329
  23. package/app/components/Layout/Admin/index.vue +240 -224
  24. package/app/components/Layout/Apps.vue +45 -45
  25. package/app/components/Layout/User/index.vue +102 -102
  26. package/app/components/Notifications/index.vue +162 -162
  27. package/app/components/StatusBox.vue +56 -56
  28. package/app/composables/useAuth.ts +207 -207
  29. package/app/composables/useNotification.ts +76 -76
  30. package/app/composables/useRequestOptions.ts +86 -86
  31. package/app/constants/routes.ts +86 -86
  32. package/app/error.vue +218 -218
  33. package/app/middleware/auth.ts +45 -45
  34. package/app/middleware/common.ts +12 -12
  35. package/app/middleware/guest.ts +7 -7
  36. package/app/middleware/permissions.ts +29 -29
  37. package/bun.lock +2758 -2758
  38. package/eslint.config.js +206 -2
  39. package/index.d.ts +16 -16
  40. package/nuxt.config.ts +41 -41
  41. package/package.json +38 -38
@@ -1,86 +1,86 @@
1
- import type { AxiosRequestConfig } from 'axios'
2
-
3
- export enum FileAppType {
4
- COMMON = 'COMMON',
5
- PMO = 'PMO',
6
- HR = 'HR',
7
- FINANCE = 'FINANCE',
8
- QUOTATION = 'QUOTATION',
9
- TODO = 'TODO',
10
- }
11
-
12
- export const useRequestOptions = () => {
13
- const config = useRuntimeConfig()
14
-
15
- const mock = (): Omit<AxiosRequestConfig, 'baseURL'> & {
16
- baseURL: string
17
- } => {
18
- return {
19
- baseURL: config.public.baseAPIMock || 'http://localhost:3000/api/mock',
20
- }
21
- }
22
-
23
- const base = (): Omit<AxiosRequestConfig, 'baseURL'> & {
24
- baseURL: string
25
- } => {
26
- return {
27
- baseURL: config.public.baseAPI,
28
- }
29
- }
30
-
31
- const auth = (): Omit<AxiosRequestConfig, 'baseURL'> & {
32
- baseURL: string
33
- } => {
34
- return {
35
- baseURL: config.public.baseAPI,
36
- headers: {
37
- Authorization: `Bearer ${useAuth().token.value}`,
38
- },
39
- }
40
- }
41
-
42
- const file = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
43
- baseURL: string
44
- } => {
45
- return {
46
- baseURL: config.public.baseAPI + '/uploads',
47
- headers: {
48
- Authorization: `Bearer ${useAuth().token.value}`,
49
- },
50
- transformRequest: (data) => {
51
- if (data instanceof FormData) {
52
- data.append('app', fileAppType)
53
- }
54
-
55
- return data
56
- },
57
- }
58
- }
59
-
60
- const filePublic = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
61
- baseURL: string
62
- } => {
63
- return {
64
- baseURL: config.public.baseAPI + '/uploads',
65
- headers: {
66
- Authorization: `Bearer ${useAuth().token.value}`,
67
- },
68
- transformRequest: (data) => {
69
- if (data instanceof FormData) {
70
- data.append('is_public', 'true')
71
- data.append('app', fileAppType)
72
- }
73
-
74
- return data
75
- },
76
- }
77
- }
78
-
79
- return {
80
- base,
81
- mock,
82
- auth,
83
- file,
84
- filePublic,
85
- }
86
- }
1
+ import type { AxiosRequestConfig } from 'axios'
2
+
3
+ export enum FileAppType {
4
+ COMMON = 'COMMON',
5
+ PMO = 'PMO',
6
+ HR = 'HR',
7
+ FINANCE = 'FINANCE',
8
+ QUOTATION = 'QUOTATION',
9
+ TODO = 'TODO',
10
+ }
11
+
12
+ export const useRequestOptions = () => {
13
+ const config = useRuntimeConfig()
14
+
15
+ const mock = (): Omit<AxiosRequestConfig, 'baseURL'> & {
16
+ baseURL: string
17
+ } => {
18
+ return {
19
+ baseURL: config.public.baseAPIMock || 'http://localhost:3000/api/mock',
20
+ }
21
+ }
22
+
23
+ const base = (): Omit<AxiosRequestConfig, 'baseURL'> & {
24
+ baseURL: string
25
+ } => {
26
+ return {
27
+ baseURL: config.public.baseAPI,
28
+ }
29
+ }
30
+
31
+ const auth = (): Omit<AxiosRequestConfig, 'baseURL'> & {
32
+ baseURL: string
33
+ } => {
34
+ return {
35
+ baseURL: config.public.baseAPI,
36
+ headers: {
37
+ Authorization: `Bearer ${useAuth().token.value}`,
38
+ },
39
+ }
40
+ }
41
+
42
+ const file = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
43
+ baseURL: string
44
+ } => {
45
+ return {
46
+ baseURL: config.public.baseAPI + '/uploads',
47
+ headers: {
48
+ Authorization: `Bearer ${useAuth().token.value}`,
49
+ },
50
+ transformRequest: (data) => {
51
+ if (data instanceof FormData) {
52
+ data.append('app', fileAppType)
53
+ }
54
+
55
+ return data
56
+ },
57
+ }
58
+ }
59
+
60
+ const filePublic = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
61
+ baseURL: string
62
+ } => {
63
+ return {
64
+ baseURL: config.public.baseAPI + '/uploads',
65
+ headers: {
66
+ Authorization: `Bearer ${useAuth().token.value}`,
67
+ },
68
+ transformRequest: (data) => {
69
+ if (data instanceof FormData) {
70
+ data.append('is_public', 'true')
71
+ data.append('app', fileAppType)
72
+ }
73
+
74
+ return data
75
+ },
76
+ }
77
+ }
78
+
79
+ return {
80
+ base,
81
+ mock,
82
+ auth,
83
+ file,
84
+ filePublic,
85
+ }
86
+ }
@@ -1,86 +1,86 @@
1
- export const routes = {
2
- home: {
3
- label: 'หน้าแรก',
4
- to: '/',
5
- },
6
- chooseTeam: {
7
- label: 'เลือกทีม',
8
- to: '/choose-team',
9
- },
10
- login: {
11
- label: 'เลือก',
12
- to: '/login',
13
- },
14
- logout: {
15
- label: 'Log out',
16
- to: '/api/auth/logout',
17
- },
18
- releaseHistory: {
19
- label: 'Release History',
20
- to: '/releases',
21
- icon: 'heroicons:tag',
22
- },
23
- account: {
24
- profile: {
25
- label: 'โปรไฟล์',
26
- to: '/account/profile',
27
- icon: 'mage:user',
28
- },
29
- },
30
-
31
- announcements: {
32
- label: 'Finema Newsletter',
33
- to: '/announcements',
34
- icon: 'mage:announcement',
35
- },
36
-
37
- adminClockin: {
38
- checkinDashboard: {
39
- label: 'ภาพรวมเช็คอิน',
40
- icon: 'mage:dashboard',
41
- to: '/clockin-admin',
42
- permissions: ['clockin:ADMIN'],
43
- },
44
- },
45
- adminTimesheet: {
46
- summaryReport: {
47
- label: 'ภาพรวม',
48
- icon: 'heroicons-outline:user-group',
49
- to: '/timesheet-admin/reports/summary',
50
- permissions: ['timesheet:ADMIN'],
51
- },
52
- },
53
- admin: {
54
- users: {
55
- label: 'จัดการผู้ใช้งาน',
56
- icon: 'hugeicons:user-circle-02',
57
- to: '/admin/users',
58
- // permissions: ['setting:SUPER'],
59
- },
60
- },
61
- clockin: {
62
- home: {
63
- label: 'Clock-In',
64
- icon: 'i-heroicons-outline:location-marker',
65
- to: '/clockin',
66
- },
67
- },
68
- timesheet: {
69
- home: {
70
- label: 'Timesheet',
71
- icon: 'mage:dashboard',
72
- to: '/timesheet',
73
- },
74
- },
75
- pmo: {
76
- project: {
77
- projects: {
78
- label: 'โครงการของฉัน',
79
- to: '/pmo/projects',
80
- icon: 'lucide:layers',
81
- permissions: ['pmo:USER', 'pmo:ADMIN', 'pmo:SUPER'],
82
- },
83
- },
84
- },
85
-
86
- } as const
1
+ export const routes = {
2
+ home: {
3
+ label: 'หน้าแรก',
4
+ to: '/',
5
+ },
6
+ chooseTeam: {
7
+ label: 'เลือกทีม',
8
+ to: '/choose-team',
9
+ },
10
+ login: {
11
+ label: 'เลือก',
12
+ to: '/login',
13
+ },
14
+ logout: {
15
+ label: 'Log out',
16
+ to: '/api/auth/logout',
17
+ },
18
+ releaseHistory: {
19
+ label: 'Release History',
20
+ to: '/releases',
21
+ icon: 'heroicons:tag',
22
+ },
23
+ account: {
24
+ profile: {
25
+ label: 'โปรไฟล์',
26
+ to: '/account/profile',
27
+ icon: 'mage:user',
28
+ },
29
+ },
30
+
31
+ announcements: {
32
+ label: 'Finema Newsletter',
33
+ to: '/announcements',
34
+ icon: 'mage:announcement',
35
+ },
36
+
37
+ adminClockin: {
38
+ checkinDashboard: {
39
+ label: 'ภาพรวมเช็คอิน',
40
+ icon: 'mage:dashboard',
41
+ to: '/clockin-admin',
42
+ permissions: ['clockin:ADMIN'],
43
+ },
44
+ },
45
+ adminTimesheet: {
46
+ summaryReport: {
47
+ label: 'ภาพรวม',
48
+ icon: 'heroicons-outline:user-group',
49
+ to: '/timesheet-admin/reports/summary',
50
+ permissions: ['timesheet:ADMIN'],
51
+ },
52
+ },
53
+ admin: {
54
+ users: {
55
+ label: 'จัดการผู้ใช้งาน',
56
+ icon: 'hugeicons:user-circle-02',
57
+ to: '/admin/users',
58
+ // permissions: ['setting:SUPER'],
59
+ },
60
+ },
61
+ clockin: {
62
+ home: {
63
+ label: 'Clock-In',
64
+ icon: 'i-heroicons-outline:location-marker',
65
+ to: '/clockin',
66
+ },
67
+ },
68
+ timesheet: {
69
+ home: {
70
+ label: 'Timesheet',
71
+ icon: 'mage:dashboard',
72
+ to: '/timesheet',
73
+ },
74
+ },
75
+ pmo: {
76
+ project: {
77
+ projects: {
78
+ label: 'โครงการของฉัน',
79
+ to: '/pmo/projects',
80
+ icon: 'lucide:layers',
81
+ permissions: ['pmo:USER', 'pmo:ADMIN', 'pmo:SUPER'],
82
+ },
83
+ },
84
+ },
85
+
86
+ } as const