@neutron.co.id/operasional-interfaces 1.17.5-beta.1 → 1.17.6

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.
@@ -13,6 +13,9 @@ export const config = OfficeInterfaces.define({
13
13
  "AttendanceManager",
14
14
  "AttendanceSupervisor",
15
15
  "AttendanceDelegate",
16
+ // Attendance Type
17
+ "AttendanceTypeCollection",
18
+ "AttendanceTypeSingle",
16
19
  // Check In
17
20
  "CheckInCollection",
18
21
  "CheckInSingle",
@@ -202,10 +202,10 @@ async function generate() {
202
202
  >
203
203
  <OfficeRelation
204
204
  v-if="
205
- values.type?.code == 'leave' ||
206
- values.type?.code == 'dayOff' ||
207
- values.type?.code == 'sick' ||
208
- values.type?.code == 'permission'
205
+ values.type == 'leave' ||
206
+ values.type == 'dayOff' ||
207
+ values.type == 'sick' ||
208
+ values.type == 'permission'
209
209
  "
210
210
  v-model="values"
211
211
  :field="fields.delegateStaffs"
@@ -251,10 +251,10 @@ async function generate() {
251
251
  />
252
252
  <!-- <OfficeRelation
253
253
  v-if="
254
- values.type?.code == 'leave' ||
255
- values.type?.code == 'sick' ||
256
- values.type?.code == 'dayOff' ||
257
- values.type?.code == 'permission'
254
+ values.type == 'leave' ||
255
+ values.type == 'sick' ||
256
+ values.type == 'dayOff' ||
257
+ values.type == 'permission'
258
258
  "
259
259
  v-model="values"
260
260
  :field="fields.monitoringStaffs"
@@ -264,10 +264,10 @@ async function generate() {
264
264
  /> -->
265
265
  <NeonField
266
266
  v-if="
267
- values.type?.code == 'leave' ||
268
- values.type?.code == 'dayOff' ||
269
- values.type?.code == 'sick' ||
270
- values.type?.code == 'permission'
267
+ values.type == 'leave' ||
268
+ values.type == 'dayOff' ||
269
+ values.type == 'sick' ||
270
+ values.type == 'permission'
271
271
  "
272
272
  v-model="values.delegateNotes"
273
273
  v-bind="fields.delegateNotes"
@@ -180,9 +180,9 @@ const rejectedAbsensi = async () => {
180
180
  @update:model-value="onStartedAtUpdate"
181
181
  />
182
182
 
183
- <OfficeRelation
184
- v-model="values"
185
- :field="fields.type"
183
+ <NeonField
184
+ v-model="values.type"
185
+ v-bind="fields.type"
186
186
  :is-disabled="
187
187
  values.status == 'approved' || values.status == 'rejected'
188
188
  "
@@ -197,7 +197,7 @@ const rejectedAbsensi = async () => {
197
197
  />
198
198
 
199
199
  <OfficeRelation
200
- v-if="values.type?.code === 'leave'"
200
+ v-if="values.type === 'leave'"
201
201
  v-model="values"
202
202
  :field="fields.delegateStaffs"
203
203
  :is-disabled="
@@ -215,10 +215,10 @@ const rejectedAbsensi = async () => {
215
215
 
216
216
  <NeonField
217
217
  v-if="
218
- values.type?.code === 'dayOff' ||
219
- values.type?.code === 'sick' ||
220
- values.type?.code === 'permission' ||
221
- values.type?.code === 'leave'
218
+ values.type === 'dayOff' ||
219
+ values.type === 'sick' ||
220
+ values.type === 'permission' ||
221
+ values.type === 'leave'
222
222
  "
223
223
  v-model="values.submittedAt"
224
224
  v-bind="fields.submittedAt"
@@ -227,7 +227,7 @@ const rejectedAbsensi = async () => {
227
227
 
228
228
  <!-- EARLY GO HOME -->
229
229
  <div
230
- v-if="values.type?.code == 'homeEarly'"
230
+ v-if="values.type == 'homeEarly'"
231
231
  class="grid gap-2 sm:grid-cols-2"
232
232
  >
233
233
  <NeonField
@@ -275,7 +275,7 @@ const rejectedAbsensi = async () => {
275
275
 
276
276
  <!-- COME TOO LATE -->
277
277
  <div
278
- v-if="values.type?.code == 'comeLate'"
278
+ v-if="values.type == 'comeLate'"
279
279
  class="grid gap-2 sm:grid-cols-2"
280
280
  >
281
281
  <NeonField
@@ -323,7 +323,7 @@ const rejectedAbsensi = async () => {
323
323
 
324
324
  <!-- TIMEOUT -->
325
325
  <div
326
- v-if="values.type?.code == 'timeout'"
326
+ v-if="values.type == 'timeout'"
327
327
  class="grid gap-2 sm:grid-cols-2"
328
328
  >
329
329
  <NeonField
@@ -96,7 +96,7 @@ function onStartedAtUpdate(date: any) {
96
96
  <OfficeRelation v-model="values" :field="fields.decideStaff" />
97
97
 
98
98
  <OfficeRelation
99
- v-if="values.type?.code == 'leave'"
99
+ v-if="values.type == 'leave'"
100
100
  v-model="values"
101
101
  :field="fields.delegateStaffs"
102
102
  />
@@ -276,9 +276,9 @@ const copy = ref({
276
276
  @update:model-value="onStartedAtUpdate"
277
277
  />
278
278
 
279
- <OfficeRelation
280
- v-model="values"
281
- :field="fields.type"
279
+ <NeonField
280
+ v-model="values.type"
281
+ v-bind="fields.type"
282
282
  :is-disabled="
283
283
  values.status == 'notApproved' ||
284
284
  values.status == 'approved' ||
@@ -301,10 +301,10 @@ const copy = ref({
301
301
  <NeonFields class="flex-1"> -->
302
302
  <OfficeRelation
303
303
  v-if="
304
- values.type?.code == 'leave' ||
305
- values.type?.code == 'dayOff' ||
306
- values.type?.code == 'sick' ||
307
- values.type?.code == 'permission'
304
+ values.type == 'leave' ||
305
+ values.type == 'dayOff' ||
306
+ values.type == 'sick' ||
307
+ values.type == 'permission'
308
308
  "
309
309
  v-model="values"
310
310
  :field="fields.delegateStaffs"
@@ -319,10 +319,10 @@ const copy = ref({
319
319
  <!-- <div class="ml-2 flex items-end pb-1">
320
320
  <NeonCopy
321
321
  v-if="
322
- values.type?.code == 'leave' ||
323
- values.type?.code == 'dayOff' ||
324
- values.type?.code == 'sick' ||
325
- values.type?.code == 'permission' ||
322
+ values.type == 'leave' ||
323
+ values.type == 'dayOff' ||
324
+ values.type == 'sick' ||
325
+ values.type == 'permission' ||
326
326
  values.isNotes == true
327
327
  "
328
328
  :size="'sm'"
@@ -332,10 +332,10 @@ const copy = ref({
332
332
  </div> -->
333
333
  <!-- <NeonField
334
334
  v-if="
335
- values.type?.code == 'leave' ||
336
- values.type?.code == 'dayOff' ||
337
- values.type?.code == 'sick' ||
338
- values.type?.code == 'permission'
335
+ values.type == 'leave' ||
336
+ values.type == 'dayOff' ||
337
+ values.type == 'sick' ||
338
+ values.type == 'permission'
339
339
  "
340
340
  v-model="values.isNotes"
341
341
  v-bind="fields.isNotes"
@@ -348,10 +348,10 @@ const copy = ref({
348
348
  <!-- <template #input>
349
349
  <NeonCheck
350
350
  v-if="
351
- values.type?.code == 'leave' ||
352
- values.type?.code == 'dayOff' ||
353
- values.type?.code == 'sick' ||
354
- values.type?.code == 'permission'
351
+ values.type == 'leave' ||
352
+ values.type == 'dayOff' ||
353
+ values.type == 'sick' ||
354
+ values.type == 'permission'
355
355
  "
356
356
  v-model="values.isNotes"
357
357
  label="Catatan"
@@ -368,10 +368,10 @@ const copy = ref({
368
368
  />
369
369
  <NeonField
370
370
  v-if="
371
- values.type?.code == 'leave' ||
372
- values.type?.code == 'dayOff' ||
373
- values.type?.code == 'sick' ||
374
- values.type?.code == 'permission'
371
+ values.type == 'leave' ||
372
+ values.type == 'dayOff' ||
373
+ values.type == 'sick' ||
374
+ values.type == 'permission'
375
375
  "
376
376
  v-model="values.delegateNotes"
377
377
  v-bind="fields.delegateNotes"
@@ -381,10 +381,10 @@ const copy = ref({
381
381
 
382
382
  <NeonField
383
383
  v-if="
384
- values.type?.code == 'dayOff' ||
385
- values.type?.code == 'sick' ||
386
- values.type?.code == 'permission' ||
387
- values.type?.code == 'leave'
384
+ values.type == 'dayOff' ||
385
+ values.type == 'sick' ||
386
+ values.type == 'permission' ||
387
+ values.type == 'leave'
388
388
  "
389
389
  v-model="values.submittedAt"
390
390
  v-bind="fields.submittedAt"
@@ -392,9 +392,9 @@ const copy = ref({
392
392
  />
393
393
  <div
394
394
  v-if="
395
- values.type?.code == 'sick' ||
396
- values.type?.code == 'leave' ||
397
- values.type?.code == 'permission'
395
+ values.type == 'sick' ||
396
+ values.type == 'leave' ||
397
+ values.type == 'permission'
398
398
  "
399
399
  >
400
400
  <NeonDivider
@@ -435,7 +435,7 @@ const copy = ref({
435
435
 
436
436
  <!-- EARLY GO HOME -->
437
437
  <div
438
- v-if="values.type?.code == 'homeEarly'"
438
+ v-if="values.type == 'homeEarly'"
439
439
  class="grid gap-2 sm:grid-cols-2"
440
440
  >
441
441
  <NeonField
@@ -493,7 +493,7 @@ const copy = ref({
493
493
 
494
494
  <!-- COME TOO LATE -->
495
495
  <div
496
- v-if="values.type?.code == 'comeLate'"
496
+ v-if="values.type == 'comeLate'"
497
497
  class="grid gap-2 sm:grid-cols-2"
498
498
  >
499
499
  <NeonField
@@ -551,7 +551,7 @@ const copy = ref({
551
551
 
552
552
  <!-- TIMEOUT -->
553
553
  <div
554
- v-if="values.type?.code == 'timeout'"
554
+ v-if="values.type == 'timeout'"
555
555
  class="grid gap-2 sm:grid-cols-2"
556
556
  >
557
557
  <NeonField
@@ -252,9 +252,9 @@ async function generate() {
252
252
  @update:model-value="onStartedAtUpdate"
253
253
  />
254
254
 
255
- <OfficeRelation
256
- v-model="values"
257
- :field="fields.type"
255
+ <NeonField
256
+ v-model="values.type"
257
+ v-bind="fields.type"
258
258
  :is-disabled="
259
259
  values.status == 'approved' || values.status == 'rejected'
260
260
  "
@@ -269,10 +269,10 @@ async function generate() {
269
269
  />
270
270
  <OfficeRelation
271
271
  v-if="
272
- values.type?.code == 'leave' ||
273
- values.type?.code == 'dayOff' ||
274
- values.type?.code == 'sick' ||
275
- values.type?.code == 'permission'
272
+ values.type == 'leave' ||
273
+ values.type == 'dayOff' ||
274
+ values.type == 'sick' ||
275
+ values.type == 'permission'
276
276
  "
277
277
  v-model="values"
278
278
  :field="fields.delegateStaffs"
@@ -282,10 +282,10 @@ async function generate() {
282
282
  />
283
283
  <!-- <NeonField
284
284
  v-if="
285
- values.type?.code == 'leave' ||
286
- values.type?.code == 'dayOff' ||
287
- values.type?.code == 'sick' ||
288
- values.type?.code == 'permission'
285
+ values.type == 'leave' ||
286
+ values.type == 'dayOff' ||
287
+ values.type == 'sick' ||
288
+ values.type == 'permission'
289
289
  "
290
290
  v-model="values.isNotes"
291
291
  v-bind="fields.isNotes"
@@ -313,10 +313,10 @@ async function generate() {
313
313
  />
314
314
  <NeonField
315
315
  v-if="
316
- values.type?.code == 'leave' ||
317
- values.type?.code == 'dayOff' ||
318
- values.type?.code == 'sick' ||
319
- values.type?.code == 'permission'
316
+ values.type == 'leave' ||
317
+ values.type == 'dayOff' ||
318
+ values.type == 'sick' ||
319
+ values.type == 'permission'
320
320
  "
321
321
  v-model="values.delegateNotes"
322
322
  v-bind="fields.delegateNotes"
@@ -326,10 +326,10 @@ async function generate() {
326
326
 
327
327
  <NeonField
328
328
  v-if="
329
- values.type?.code == 'dayOff' ||
330
- values.type?.code == 'sick' ||
331
- values.type?.code == 'permission' ||
332
- values.type?.code == 'leave'
329
+ values.type == 'dayOff' ||
330
+ values.type == 'sick' ||
331
+ values.type == 'permission' ||
332
+ values.type == 'leave'
333
333
  "
334
334
  v-model="values.submittedAt"
335
335
  v-bind="fields.submittedAt"
@@ -338,9 +338,9 @@ async function generate() {
338
338
 
339
339
  <div
340
340
  v-if="
341
- values.type?.code == 'sick' ||
342
- values.type?.code == 'leave' ||
343
- values.type?.code == 'permission'
341
+ values.type == 'sick' ||
342
+ values.type == 'leave' ||
343
+ values.type == 'permission'
344
344
  "
345
345
  >
346
346
  <NeonDivider
@@ -381,7 +381,7 @@ async function generate() {
381
381
 
382
382
  <!-- EARLY GO HOME -->
383
383
  <div
384
- v-if="values.type?.code == 'homeEarly'"
384
+ v-if="values.type == 'homeEarly'"
385
385
  class="grid gap-2 sm:grid-cols-2"
386
386
  >
387
387
  <NeonField
@@ -429,7 +429,7 @@ async function generate() {
429
429
 
430
430
  <!-- COME TOO LATE -->
431
431
  <div
432
- v-if="values.type?.code == 'comeLate'"
432
+ v-if="values.type == 'comeLate'"
433
433
  class="grid gap-2 sm:grid-cols-2"
434
434
  >
435
435
  <NeonField
@@ -477,7 +477,7 @@ async function generate() {
477
477
 
478
478
  <!-- TIMEOUT -->
479
479
  <div
480
- v-if="values.type?.code == 'timeout'"
480
+ v-if="values.type == 'timeout'"
481
481
  class="grid gap-2 sm:grid-cols-2"
482
482
  >
483
483
  <NeonField
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { NeonSingle, useSingle } from '@neon.id/context'
3
- import { NeonField, NeonForm } from '@neon.id/form'
3
+ import { NeonField, NeonForm, NeonCheck } from '@neon.id/form'
4
4
  import { OfficeRelation, OfficeTab, OfficeTabs } from '@neon.id/office'
5
- import { ref } from 'vue'
5
+ import { useToast } from '@neon.id/interfaces'
6
6
  import type {
7
7
  TPersonaliaAttendanceTypeModel,
8
8
  Schema,
@@ -14,14 +14,27 @@ const {
14
14
  values,
15
15
  isLoading,
16
16
  isChanged,
17
- isReady,
18
17
  isMain,
19
- isNew,
20
18
  saveOne,
21
19
  discardChanges,
22
20
  } = useSingle<Schema.AttendanceType, TPersonaliaAttendanceTypeModel>()
23
21
 
24
- const key = ref(0)
22
+ const toast = useToast()
23
+
24
+ async function saveCheck() {
25
+ if (values.value.code === '') {
26
+ toast.push({
27
+ id: 'neu:attendance-type:code',
28
+ icon: 'warning',
29
+ content: 'Kode dari Tipe Absensi belum diisi!',
30
+ color: 'danger',
31
+ placement: 'bottom-right',
32
+ })
33
+ return
34
+ } else if (values.value.name !== '') {
35
+ await saveOne()
36
+ }
37
+ }
25
38
  </script>
26
39
 
27
40
  <template>
@@ -35,7 +48,7 @@ const key = ref(0)
35
48
  :is-changed="isChanged"
36
49
  use-unsaved
37
50
  @cancel="discardChanges"
38
- @submit="saveOne"
51
+ @submit="saveCheck"
39
52
  >
40
53
  <NeonField v-model="values.name" v-bind="fields.name" />
41
54
  <NeonField v-model="values.code" v-bind="fields.code" />
@@ -1,4 +1,5 @@
1
1
  export * from './attendance';
2
+ export * from './attendanceType';
2
3
  export * from './checkIn';
3
4
  export * from './plan';
4
5
  export * from './planType';
@@ -1,4 +1,5 @@
1
1
  export * from "./attendance/index.mjs";
2
+ export * from "./attendanceType/index.mjs";
2
3
  export * from "./checkIn/index.mjs";
3
4
  export * from "./plan/index.mjs";
4
5
  export * from "./planType/index.mjs";
@@ -0,0 +1 @@
1
+ export { default as AttendanceTypeCollection } from './AttendanceTypeCollection.vue';
@@ -0,0 +1 @@
1
+ export { default as AttendanceTypeSingle } from './AttendanceTypeSingle.vue';
@@ -0,0 +1,2 @@
1
+ export * from './AttendanceTypeCollection';
2
+ export * from './AttendanceTypeSingle';
@@ -1,4 +1,5 @@
1
1
  export * from './attendance';
2
+ export * from './attendanceType';
2
3
  export * from './checkIn';
3
4
  export * from './plan';
4
5
  export * from './planType';