@finema/finework-layer 0.2.75 → 0.2.77
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.
- package/.husky/pre-commit +1 -1
- package/.playground/.env.example +5 -0
- package/.playground/app/assets/css/main.css +6 -6
- package/.playground/app/pages/layout-admin/[id]/index.vue +145 -145
- package/.playground/app/pages/layout-admin/test/[id]/index.vue +286 -286
- package/.playground/app/pages/layout-admin.vue +285 -285
- package/.playground/app/pages/layout-user.vue +284 -0
- package/.playground/app/pages/submenu/layout-admin.vue +210 -210
- package/.playground/public/admin/clock-in-admin-logo.png +0 -0
- package/.playground/public/admin/clock-in-logo.png +0 -0
- package/.playground/public/admin/clock-in.png +0 -0
- package/.playground/public/admin/pmo-logo.png +0 -0
- package/.playground/public/admin/spider-web.png +0 -0
- package/.playground/public/admin/super-admin-logo.png +0 -0
- package/.playground/public/admin/super-admin.png +0 -0
- package/.playground/public/admin/timesheet-admin-logo.png +0 -0
- package/.playground/public/admin/timesheet-logo.png +0 -0
- package/.playground/public/admin/timesheet.png +0 -0
- package/CHANGELOG.md +378 -364
- package/app/app.config.ts +144 -144
- package/app/app.vue +10 -10
- package/app/assets/css/main.css +77 -77
- package/app/components/Button/ActionIcon.vue +29 -29
- package/app/components/Button/Back.vue +22 -22
- package/app/components/Format/Currency.vue +17 -17
- package/app/components/Format/Date.vue +24 -24
- package/app/components/Format/DateTime.vue +24 -24
- package/app/components/Format/Number.vue +17 -17
- package/app/components/Format/Percent.vue +38 -38
- package/app/components/Format/TimeFromNow.vue +38 -38
- package/app/components/InfoItemList.vue +196 -196
- package/app/components/Layout/Admin/Sidebar.vue +329 -329
- package/app/components/Layout/Admin/index.vue +224 -270
- package/app/components/Layout/Apps.vue +45 -45
- package/app/components/Layout/User/index.vue +102 -145
- package/app/components/Notifications/index.vue +162 -0
- package/app/components/StatusBox.vue +56 -56
- package/app/composables/useAuth.ts +207 -207
- package/app/composables/useNotification.ts +76 -0
- package/app/composables/useRequestOptions.ts +86 -86
- package/app/constants/routes.ts +86 -86
- package/app/error.vue +218 -218
- package/app/middleware/auth.ts +45 -45
- package/app/middleware/common.ts +12 -12
- package/app/middleware/guest.ts +7 -7
- package/app/middleware/permissions.ts +29 -29
- package/bun.lock +2758 -2758
- package/index.d.ts +16 -16
- package/nuxt.config.ts +41 -41
- package/package.json +38 -38
- package/app/components/NotificationList.vue +0 -65
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="space-y-8">
|
|
3
|
-
<!-- Introduction -->
|
|
4
|
-
<div>
|
|
5
|
-
<h1 class="text-primary text-2xl font-bold">
|
|
6
|
-
Dialog Component
|
|
7
|
-
</h1>
|
|
8
|
-
<p class="mt-2 text-gray-600">
|
|
9
|
-
Display modal dialogs for success, warning, error and information
|
|
10
|
-
messages
|
|
11
|
-
</p>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<!-- Success Dialog -->
|
|
15
|
-
<div class="space-y-4">
|
|
16
|
-
<h2 class="text-xl font-medium">
|
|
17
|
-
Success Dialog
|
|
18
|
-
</h2>
|
|
19
|
-
<div class="flex flex-wrap gap-2">
|
|
1
|
+
<template>
|
|
2
|
+
<div class="space-y-8">
|
|
3
|
+
<!-- Introduction -->
|
|
4
|
+
<div>
|
|
5
|
+
<h1 class="text-primary text-2xl font-bold">
|
|
6
|
+
Dialog Component
|
|
7
|
+
</h1>
|
|
8
|
+
<p class="mt-2 text-gray-600">
|
|
9
|
+
Display modal dialogs for success, warning, error and information
|
|
10
|
+
messages
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<!-- Success Dialog -->
|
|
15
|
+
<div class="space-y-4">
|
|
16
|
+
<h2 class="text-xl font-medium">
|
|
17
|
+
Success Dialog
|
|
18
|
+
</h2>
|
|
19
|
+
<div class="flex flex-wrap gap-2">
|
|
20
20
|
<Button
|
|
21
21
|
color="success"
|
|
22
22
|
@click="openSuccessDialog"
|
|
23
|
-
>
|
|
24
|
-
Open Success Dialog
|
|
25
|
-
</Button>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<!-- Error Dialog -->
|
|
30
|
-
<div class="space-y-4">
|
|
31
|
-
<h2 class="text-xl font-medium">
|
|
32
|
-
Error Dialog
|
|
33
|
-
</h2>
|
|
34
|
-
<div class="flex flex-wrap gap-2">
|
|
23
|
+
>
|
|
24
|
+
Open Success Dialog
|
|
25
|
+
</Button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<!-- Error Dialog -->
|
|
30
|
+
<div class="space-y-4">
|
|
31
|
+
<h2 class="text-xl font-medium">
|
|
32
|
+
Error Dialog
|
|
33
|
+
</h2>
|
|
34
|
+
<div class="flex flex-wrap gap-2">
|
|
35
35
|
<Button
|
|
36
36
|
color="error"
|
|
37
37
|
@click="openErrorDialog"
|
|
38
|
-
>
|
|
39
|
-
Open Error Dialog
|
|
40
|
-
</Button>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<!-- Warning Dialog -->
|
|
45
|
-
<div class="space-y-4">
|
|
46
|
-
<h2 class="text-xl font-medium">
|
|
47
|
-
Warning Dialog
|
|
48
|
-
</h2>
|
|
49
|
-
<div class="flex flex-wrap gap-2">
|
|
38
|
+
>
|
|
39
|
+
Open Error Dialog
|
|
40
|
+
</Button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- Warning Dialog -->
|
|
45
|
+
<div class="space-y-4">
|
|
46
|
+
<h2 class="text-xl font-medium">
|
|
47
|
+
Warning Dialog
|
|
48
|
+
</h2>
|
|
49
|
+
<div class="flex flex-wrap gap-2">
|
|
50
50
|
<Button
|
|
51
51
|
color="warning"
|
|
52
52
|
@click="openWarningDialog"
|
|
53
|
-
>
|
|
54
|
-
Open Warning Dialog
|
|
55
|
-
</Button>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<!-- Info Dialog -->
|
|
60
|
-
<div class="space-y-4">
|
|
61
|
-
<h2 class="text-xl font-medium">
|
|
62
|
-
Info Dialog
|
|
63
|
-
</h2>
|
|
64
|
-
<div class="flex flex-wrap gap-2">
|
|
53
|
+
>
|
|
54
|
+
Open Warning Dialog
|
|
55
|
+
</Button>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<!-- Info Dialog -->
|
|
60
|
+
<div class="space-y-4">
|
|
61
|
+
<h2 class="text-xl font-medium">
|
|
62
|
+
Info Dialog
|
|
63
|
+
</h2>
|
|
64
|
+
<div class="flex flex-wrap gap-2">
|
|
65
65
|
<Button
|
|
66
66
|
color="info"
|
|
67
67
|
@click="openInfoDialog"
|
|
68
|
-
>
|
|
69
|
-
Open Info Dialog
|
|
70
|
-
</Button>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
<div class="space-y-4">
|
|
74
|
-
<h2 class="text-xl font-medium">
|
|
75
|
-
Confirm Dialog
|
|
76
|
-
</h2>
|
|
77
|
-
<div class="flex flex-wrap gap-2">
|
|
68
|
+
>
|
|
69
|
+
Open Info Dialog
|
|
70
|
+
</Button>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="space-y-4">
|
|
74
|
+
<h2 class="text-xl font-medium">
|
|
75
|
+
Confirm Dialog
|
|
76
|
+
</h2>
|
|
77
|
+
<div class="flex flex-wrap gap-2">
|
|
78
78
|
<Button
|
|
79
79
|
color="info"
|
|
80
80
|
@click="openConfirmDialog"
|
|
81
|
-
>
|
|
82
|
-
Open Confirm Dialog
|
|
83
|
-
</Button>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
<div class="space-y-4">
|
|
87
|
-
<h2 class="text-xl font-medium">
|
|
88
|
-
Loading Dialog
|
|
89
|
-
</h2>
|
|
90
|
-
<div class="flex flex-wrap gap-2">
|
|
81
|
+
>
|
|
82
|
+
Open Confirm Dialog
|
|
83
|
+
</Button>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="space-y-4">
|
|
87
|
+
<h2 class="text-xl font-medium">
|
|
88
|
+
Loading Dialog
|
|
89
|
+
</h2>
|
|
90
|
+
<div class="flex flex-wrap gap-2">
|
|
91
91
|
<Button
|
|
92
92
|
color="info"
|
|
93
93
|
@click="openLoadingDialog"
|
|
94
|
-
>
|
|
95
|
-
Open Loading Dialog
|
|
96
|
-
</Button>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<!-- Custom Dialog -->
|
|
101
|
-
<div class="space-y-4">
|
|
102
|
-
<h2 class="text-xl font-medium">
|
|
103
|
-
Custom Dialog
|
|
104
|
-
</h2>
|
|
105
|
-
<div class="flex flex-wrap gap-2">
|
|
106
|
-
<Button @click="openCustomDialog">
|
|
107
|
-
Open Custom Dialog
|
|
108
|
-
</Button>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
<!-- <Modal title="title">
|
|
113
|
-
<Button
|
|
114
|
-
label="Open"
|
|
115
|
-
color="neutral"
|
|
116
|
-
variant="subtle"
|
|
117
|
-
/>
|
|
118
|
-
|
|
119
|
-
<template #body>
|
|
120
|
-
gsdfgsdfg
|
|
121
|
-
</template>
|
|
122
|
-
</Modal> -->
|
|
123
|
-
</div>
|
|
124
|
-
</template>
|
|
125
|
-
|
|
126
|
-
<script setup lang="ts">
|
|
127
|
-
import { useDialog } from '#imports'
|
|
128
|
-
|
|
129
|
-
definePageMeta({
|
|
130
|
-
layout: 'example',
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
useSeoMeta({
|
|
134
|
-
title: 'Dialog Component',
|
|
135
|
-
description:
|
|
136
|
-
'Display modal dialogs for success, warning, error and information messages',
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
const dialog = useDialog()
|
|
140
|
-
|
|
141
|
-
// Success Dialog Example
|
|
142
|
-
const openSuccessDialog = () => {
|
|
143
|
-
dialog.success({
|
|
144
|
-
title: 'Operation Successful',
|
|
145
|
-
description: 'Your changes have been saved successfully.',
|
|
146
|
-
})
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Error Dialog Example
|
|
150
|
-
const openErrorDialog = () => {
|
|
151
|
-
dialog.error({
|
|
152
|
-
title: 'Error Occurred',
|
|
153
|
-
description: 'Unable to complete the operation. Please try again.',
|
|
154
|
-
cancelText: 'Close',
|
|
155
|
-
})
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Warning Dialog Example
|
|
159
|
-
const openWarningDialog = () => {
|
|
160
|
-
dialog
|
|
161
|
-
.warning({
|
|
162
|
-
title: 'Warning',
|
|
163
|
-
description:
|
|
164
|
-
'This action cannot be undone. Are you sure you want to continue?',
|
|
165
|
-
confirmText: 'Continue',
|
|
166
|
-
cancelText: 'Cancel',
|
|
167
|
-
})
|
|
168
|
-
.then(() => {
|
|
169
|
-
alert('success')
|
|
170
|
-
})
|
|
171
|
-
.catch(() => {
|
|
172
|
-
alert('cancel')
|
|
173
|
-
})
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Info Dialog Example
|
|
177
|
-
const openInfoDialog = () => {
|
|
178
|
-
dialog.info({
|
|
179
|
-
title: 'Information',
|
|
180
|
-
description: 'Here is some important information you should know.',
|
|
181
|
-
confirmText: 'Got it',
|
|
182
|
-
})
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const openConfirmDialog = () => {
|
|
186
|
-
dialog
|
|
187
|
-
.confirm({
|
|
188
|
-
title: 'Confirm',
|
|
189
|
-
description: 'Here is some important information you should know.',
|
|
190
|
-
})
|
|
191
|
-
.then(() => {
|
|
192
|
-
alert('success')
|
|
193
|
-
})
|
|
194
|
-
.catch(() => {
|
|
195
|
-
alert('cancel')
|
|
196
|
-
})
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const openLoadingDialog = async () => {
|
|
200
|
-
dialog.loading({
|
|
201
|
-
title: 'กรุณารอสักครู่...',
|
|
202
|
-
description: 'กำลังโหลดข้อมูล...',
|
|
203
|
-
})
|
|
204
|
-
|
|
205
|
-
setTimeout(() => {
|
|
206
|
-
dialog.close()
|
|
207
|
-
}, 2000)
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// Custom Dialog Example
|
|
211
|
-
const openCustomDialog = () => {
|
|
212
|
-
dialog
|
|
213
|
-
.success({
|
|
214
|
-
title: 'Custom Dialog',
|
|
215
|
-
description: 'A dialog with custom configuration',
|
|
216
|
-
confirmText: 'Accept',
|
|
217
|
-
cancelText: 'Decline',
|
|
218
|
-
isShowCancelBtn: true,
|
|
219
|
-
isHideIcon: true,
|
|
220
|
-
})
|
|
221
|
-
.then(() => {
|
|
222
|
-
alert('success')
|
|
223
|
-
})
|
|
224
|
-
.catch(() => {
|
|
225
|
-
alert('cancel')
|
|
226
|
-
})
|
|
227
|
-
}
|
|
228
|
-
</script>
|
|
94
|
+
>
|
|
95
|
+
Open Loading Dialog
|
|
96
|
+
</Button>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<!-- Custom Dialog -->
|
|
101
|
+
<div class="space-y-4">
|
|
102
|
+
<h2 class="text-xl font-medium">
|
|
103
|
+
Custom Dialog
|
|
104
|
+
</h2>
|
|
105
|
+
<div class="flex flex-wrap gap-2">
|
|
106
|
+
<Button @click="openCustomDialog">
|
|
107
|
+
Open Custom Dialog
|
|
108
|
+
</Button>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<!-- <Modal title="title">
|
|
113
|
+
<Button
|
|
114
|
+
label="Open"
|
|
115
|
+
color="neutral"
|
|
116
|
+
variant="subtle"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<template #body>
|
|
120
|
+
gsdfgsdfg
|
|
121
|
+
</template>
|
|
122
|
+
</Modal> -->
|
|
123
|
+
</div>
|
|
124
|
+
</template>
|
|
125
|
+
|
|
126
|
+
<script setup lang="ts">
|
|
127
|
+
import { useDialog } from '#imports'
|
|
128
|
+
|
|
129
|
+
definePageMeta({
|
|
130
|
+
layout: 'example',
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
useSeoMeta({
|
|
134
|
+
title: 'Dialog Component',
|
|
135
|
+
description:
|
|
136
|
+
'Display modal dialogs for success, warning, error and information messages',
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
const dialog = useDialog()
|
|
140
|
+
|
|
141
|
+
// Success Dialog Example
|
|
142
|
+
const openSuccessDialog = () => {
|
|
143
|
+
dialog.success({
|
|
144
|
+
title: 'Operation Successful',
|
|
145
|
+
description: 'Your changes have been saved successfully.',
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Error Dialog Example
|
|
150
|
+
const openErrorDialog = () => {
|
|
151
|
+
dialog.error({
|
|
152
|
+
title: 'Error Occurred',
|
|
153
|
+
description: 'Unable to complete the operation. Please try again.',
|
|
154
|
+
cancelText: 'Close',
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Warning Dialog Example
|
|
159
|
+
const openWarningDialog = () => {
|
|
160
|
+
dialog
|
|
161
|
+
.warning({
|
|
162
|
+
title: 'Warning',
|
|
163
|
+
description:
|
|
164
|
+
'This action cannot be undone. Are you sure you want to continue?',
|
|
165
|
+
confirmText: 'Continue',
|
|
166
|
+
cancelText: 'Cancel',
|
|
167
|
+
})
|
|
168
|
+
.then(() => {
|
|
169
|
+
alert('success')
|
|
170
|
+
})
|
|
171
|
+
.catch(() => {
|
|
172
|
+
alert('cancel')
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Info Dialog Example
|
|
177
|
+
const openInfoDialog = () => {
|
|
178
|
+
dialog.info({
|
|
179
|
+
title: 'Information',
|
|
180
|
+
description: 'Here is some important information you should know.',
|
|
181
|
+
confirmText: 'Got it',
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const openConfirmDialog = () => {
|
|
186
|
+
dialog
|
|
187
|
+
.confirm({
|
|
188
|
+
title: 'Confirm',
|
|
189
|
+
description: 'Here is some important information you should know.',
|
|
190
|
+
})
|
|
191
|
+
.then(() => {
|
|
192
|
+
alert('success')
|
|
193
|
+
})
|
|
194
|
+
.catch(() => {
|
|
195
|
+
alert('cancel')
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const openLoadingDialog = async () => {
|
|
200
|
+
dialog.loading({
|
|
201
|
+
title: 'กรุณารอสักครู่...',
|
|
202
|
+
description: 'กำลังโหลดข้อมูล...',
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
setTimeout(() => {
|
|
206
|
+
dialog.close()
|
|
207
|
+
}, 2000)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Custom Dialog Example
|
|
211
|
+
const openCustomDialog = () => {
|
|
212
|
+
dialog
|
|
213
|
+
.success({
|
|
214
|
+
title: 'Custom Dialog',
|
|
215
|
+
description: 'A dialog with custom configuration',
|
|
216
|
+
confirmText: 'Accept',
|
|
217
|
+
cancelText: 'Decline',
|
|
218
|
+
isShowCancelBtn: true,
|
|
219
|
+
isHideIcon: true,
|
|
220
|
+
})
|
|
221
|
+
.then(() => {
|
|
222
|
+
alert('success')
|
|
223
|
+
})
|
|
224
|
+
.catch(() => {
|
|
225
|
+
alert('cancel')
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
</script>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|