@neutron.co.id/operasional-interfaces 1.14.8-beta.1 → 1.14.9
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/build/@mock/mock.interfaces.d.ts +0 -2
- package/build/@office/common/OfficeSingleSync/OfficeSingleSync.vue +50 -0
- package/build/@office/common/OfficeSingleSync/index.d.ts +1 -0
- package/build/@office/common/OfficeSingleSync/index.mjs +1 -0
- package/build/@office/common/OperasionalIdentitas/OperasionalIdentitas.vue +66 -62
- package/build/@office/common/index.d.ts +1 -0
- package/build/@office/common/index.mjs +1 -0
- package/build/@office/config.mjs +6 -1
- package/build/@office/models/personalia/attendance/AttendanceManager.vue +2 -2
- package/build/@office/models/personalia/attendance/AttendanceStaff.vue +2 -2
- package/build/@office/models/personalia/attendance/AttendanceSupervisor.vue +3 -3
- package/build/@office/models/personalia/index.d.ts +1 -0
- package/build/@office/models/personalia/index.mjs +1 -0
- package/build/@office/models/personalia/plan/PlanSingle/PlanSingle.vue +5 -1
- package/build/@office/models/personalia/plan/PlanStaff.vue +5 -1
- package/build/@office/models/personalia/shift/ShiftAdministrator.vue +78 -0
- package/build/@office/models/personalia/shift/ShiftCollection/ShiftCollection.stories.d.ts +7 -0
- package/build/@office/models/personalia/shift/ShiftCollection/ShiftCollection.stories.mjs +36 -0
- package/build/@office/models/personalia/shift/ShiftCollection/ShiftCollection.vue +73 -0
- package/build/@office/models/personalia/shift/ShiftCollection/index.d.ts +1 -0
- package/build/@office/models/personalia/shift/ShiftCollection/index.mjs +1 -0
- package/build/@office/models/personalia/shift/ShiftSingle/ShiftSingle.stories.d.ts +8 -0
- package/build/@office/models/personalia/shift/ShiftSingle/ShiftSingle.stories.mjs +47 -0
- package/build/@office/models/personalia/shift/ShiftSingle/ShiftSingle.vue +69 -0
- package/build/@office/models/personalia/shift/ShiftSingle/index.d.ts +1 -0
- package/build/@office/models/personalia/shift/ShiftSingle/index.mjs +1 -0
- package/build/@office/models/personalia/shift/ShiftStaff.vue +92 -0
- package/build/@office/models/personalia/shift/index.d.ts +4 -0
- package/build/@office/models/personalia/shift/index.mjs +4 -0
- package/build/@office/models/personalia/situation/SituationSingle/SituationSingle.vue +0 -1
- package/build/@office/models/personalia/staff/StaffIdentity.vue +148 -150
- package/build/@office/models/personalia/staff/StaffSingle/StaffSingle.vue +1 -1
- package/build/@office/models/personalia/submission/SubmissionAudit.vue +21 -55
- package/build/@office/models/personalia/submission/SubmissionDecision.vue +15 -45
- package/build/@office/models/personalia/submission/SubmissionFollowUp.vue +10 -40
- package/build/@office/models/personalia/submission/SubmissionSingle/SubmissionSingle.vue +10 -40
- package/build/@office/models/personalia/submission/SubmissionStaff.vue +31 -72
- package/build/@office/models/personalia/submission/SubmissionSupervisor.vue +10 -40
- package/build/@office/models/personalia/submission/SubmissionWaitingDecision.vue +12 -42
- package/build/@office/models/personalia/target/TargetBranch.vue +5 -1
- package/build/@office/models/personalia/target/TargetSingle/TargetSingle.vue +5 -1
- package/build/@office/models/personalia/task/TaskSingle/TaskSingle.vue +3 -3
- package/build/@package/@office/common/OfficeSingleSync/OfficeSingleSync.vue.d.ts +2 -0
- package/build/@package/@office/common/OfficeSingleSync/index.d.ts +1 -0
- package/build/@package/@office/common/index.d.ts +1 -0
- package/build/@package/@office/models/personalia/index.d.ts +1 -0
- package/build/@package/@office/models/personalia/shift/ShiftAdministrator.vue.d.ts +2 -0
- package/build/@package/@office/models/personalia/shift/ShiftCollection/ShiftCollection.vue.d.ts +43 -0
- package/build/@package/@office/models/personalia/shift/ShiftCollection/index.d.ts +1 -0
- package/build/@package/@office/models/personalia/shift/ShiftSingle/ShiftSingle.vue.d.ts +2 -0
- package/build/@package/@office/models/personalia/shift/ShiftSingle/index.d.ts +1 -0
- package/build/@package/@office/models/personalia/shift/ShiftStaff.vue.d.ts +2 -0
- package/build/@package/@office/models/personalia/shift/index.d.ts +4 -0
- package/build/mock/index.cjs +911 -695
- package/build/mock/index.mjs +915 -699
- package/build/mock/style.css +47 -16
- package/build/module.json +1 -1
- package/build/nuxt.json +1 -1
- package/build/nuxt.mjs +6 -1
- package/package.json +8 -6
|
@@ -8,8 +8,6 @@ import '@neon.id/editor/style.css';
|
|
|
8
8
|
import '@neon.id/relation/style.css';
|
|
9
9
|
import '@neon.id/display/style.css';
|
|
10
10
|
import '@neon.id/video/style.css';
|
|
11
|
-
import '@neon.id/fluffy/style.css';
|
|
12
11
|
import '@neon.id/office/style.css';
|
|
13
|
-
import '@neon.id/dampak-interfaces/style.css';
|
|
14
12
|
import '@neon.id/identitas-interfaces/fluffy.css';
|
|
15
13
|
export declare function mockInterfaces(app: App): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useSingle } from '@neon.id/context'
|
|
3
|
+
import { NeonButton } from '@neon.id/interfaces'
|
|
4
|
+
import { useTimeAgo } from '@vueuse/core'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
|
|
7
|
+
defineOptions({ name: 'OfficeSingleSync' })
|
|
8
|
+
|
|
9
|
+
const { isNew, initialValues, isLoading, syncOne, refreshOne } = useSingle()
|
|
10
|
+
|
|
11
|
+
const syncedAt = computed(() => initialValues.value?.syncedAt)
|
|
12
|
+
|
|
13
|
+
const syncLabel = computed(() => {
|
|
14
|
+
if (!syncedAt.value) return 'Never synced'
|
|
15
|
+
const time = useTimeAgo(syncedAt.value, {})
|
|
16
|
+
return `Synced ${time.value?.toLowerCase()}`
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
async function syncOneSingle() {
|
|
20
|
+
if (isNew.value) return
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
await syncOne()
|
|
24
|
+
await refreshOne()
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error(error)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div v-if="!isNew" class="office-single-sync">
|
|
33
|
+
<NeonButton
|
|
34
|
+
:label="syncLabel"
|
|
35
|
+
icon-left="refresh"
|
|
36
|
+
size="xs"
|
|
37
|
+
display="outline"
|
|
38
|
+
is-rounded
|
|
39
|
+
is-squared-mobile
|
|
40
|
+
:is-loading="isLoading"
|
|
41
|
+
@click="syncOneSingle"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<style scoped>
|
|
47
|
+
.office-single-sync {
|
|
48
|
+
@apply flex items-center space-x-1;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OfficeSingleSync } from './OfficeSingleSync.vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OfficeSingleSync } from "./OfficeSingleSync.vue";
|
|
@@ -323,79 +323,83 @@ function clear() {
|
|
|
323
323
|
|
|
324
324
|
<template>
|
|
325
325
|
<div class="operasional-identitas">
|
|
326
|
-
<
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
326
|
+
<NeonFormWrapper>
|
|
327
|
+
<IdentitasConnect
|
|
328
|
+
v-if="state === 'connect'"
|
|
329
|
+
:user="user as any"
|
|
330
|
+
:candidate="candidate as any"
|
|
331
|
+
:conflict="conflict"
|
|
332
|
+
is-ready
|
|
333
|
+
:is-loading="isLoading"
|
|
334
|
+
@choose="onWillChoose"
|
|
335
|
+
@register="onWillRegister"
|
|
336
|
+
@connect="onConnect"
|
|
337
|
+
@disconnect="onDisconnect"
|
|
338
|
+
@back="onBack"
|
|
339
|
+
>
|
|
340
|
+
<template #ready>
|
|
341
|
+
<NeonField
|
|
342
|
+
:model-value="user?.defaultPassword"
|
|
343
|
+
v-bind="passwordField"
|
|
344
|
+
:more-options="{
|
|
345
|
+
note: `<em>Password</em> awal pengguna. Tidak berlaku apabila pengguna <strong class='text-danger'>telah mengubah <em>password</em></strong> atau <strong class='text-danger'>mendaftarkan akunnya sendiri</strong>.`,
|
|
346
|
+
}"
|
|
347
|
+
is-disabled
|
|
348
|
+
is-alone
|
|
349
|
+
/>
|
|
350
|
+
</template>
|
|
351
|
+
</IdentitasConnect>
|
|
352
|
+
|
|
353
|
+
<IdentitasAssistRegistration
|
|
354
|
+
v-else-if="state === 'register'"
|
|
355
|
+
:initial-values="initialRegistration"
|
|
356
|
+
:is-loading="isLoading"
|
|
357
|
+
:errors="errors"
|
|
358
|
+
@back="state = 'connect'"
|
|
359
|
+
@save="onRegister"
|
|
360
|
+
>
|
|
340
361
|
<NeonField
|
|
341
|
-
:model-value="
|
|
342
|
-
v-bind="
|
|
343
|
-
:more-options="{
|
|
344
|
-
note: `<em>Password</em> awal pengguna. Tidak berlaku apabila pengguna <strong class='text-danger'>telah mengubah <em>password</em></strong> atau <strong class='text-danger'>mendaftarkan akunnya sendiri</strong>.`,
|
|
345
|
-
}"
|
|
362
|
+
:model-value="profile?.name"
|
|
363
|
+
v-bind="fullNameField"
|
|
346
364
|
is-disabled
|
|
347
365
|
is-alone
|
|
348
366
|
/>
|
|
349
|
-
</
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
v-
|
|
363
|
-
is-
|
|
364
|
-
|
|
365
|
-
/>
|
|
366
|
-
</IdentitasAssistRegistration>
|
|
367
|
-
|
|
368
|
-
<div v-if="user && onDelegate" class="section">
|
|
369
|
-
<NeonDivider is-dashed label="Delegasi" class="divider" />
|
|
370
|
-
<IdentitasDelegate
|
|
371
|
-
:user="userForDelegating as any"
|
|
372
|
-
:roles="roles"
|
|
373
|
-
:is-loading="isLoading"
|
|
374
|
-
@save="onDelegate"
|
|
375
|
-
/>
|
|
376
|
-
</div>
|
|
377
|
-
|
|
378
|
-
<NeonModal
|
|
379
|
-
v-if="isChoosing"
|
|
380
|
-
is-active
|
|
381
|
-
size="lg"
|
|
382
|
-
@close="isChoosing = false"
|
|
383
|
-
>
|
|
384
|
-
<NeonSheet
|
|
385
|
-
icon="user-magnifying-glass"
|
|
386
|
-
title="Pilih Akun"
|
|
387
|
-
label="User"
|
|
388
|
-
no-padding
|
|
367
|
+
</IdentitasAssistRegistration>
|
|
368
|
+
|
|
369
|
+
<div v-if="user && onDelegate" class="section">
|
|
370
|
+
<NeonDivider is-dashed label="Delegasi" class="divider" />
|
|
371
|
+
<IdentitasDelegate
|
|
372
|
+
:user="userForDelegating as any"
|
|
373
|
+
:roles="roles"
|
|
374
|
+
:is-loading="isLoading"
|
|
375
|
+
@save="onDelegate"
|
|
376
|
+
/>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<NeonModal
|
|
380
|
+
v-if="isChoosing"
|
|
381
|
+
is-active
|
|
382
|
+
size="lg"
|
|
389
383
|
@close="isChoosing = false"
|
|
390
384
|
>
|
|
391
|
-
<
|
|
392
|
-
|
|
393
|
-
|
|
385
|
+
<NeonSheet
|
|
386
|
+
icon="user-magnifying-glass"
|
|
387
|
+
title="Pilih Akun"
|
|
388
|
+
label="User"
|
|
389
|
+
no-padding
|
|
390
|
+
@close="isChoosing = false"
|
|
391
|
+
>
|
|
392
|
+
<NeonRelationSheet />
|
|
393
|
+
</NeonSheet>
|
|
394
|
+
</NeonModal>
|
|
395
|
+
</NeonFormWrapper>
|
|
394
396
|
</div>
|
|
395
397
|
</template>
|
|
396
398
|
|
|
397
399
|
<style scoped>
|
|
398
400
|
.operasional-identitas {
|
|
401
|
+
@apply overflow-y-auto overflow-x-hidden h-auto !important;
|
|
402
|
+
|
|
399
403
|
.section {
|
|
400
404
|
.divider {
|
|
401
405
|
@apply mb-4;
|
package/build/@office/config.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "@neon.id/context/helpers";
|
|
4
4
|
export const config = OfficeInterfaces.define({
|
|
5
5
|
components: {
|
|
6
|
-
common: [],
|
|
6
|
+
common: ["OfficeSingleSync"],
|
|
7
7
|
models: {
|
|
8
8
|
personalia: [
|
|
9
9
|
// Attendance
|
|
@@ -47,6 +47,11 @@ export const config = OfficeInterfaces.define({
|
|
|
47
47
|
// Responsibility Type
|
|
48
48
|
"ResponsibilityTypeCollection",
|
|
49
49
|
"ResponsibilityTypeSingle",
|
|
50
|
+
//Shift
|
|
51
|
+
"ShiftCollection",
|
|
52
|
+
"ShiftSingle",
|
|
53
|
+
"ShiftStaff",
|
|
54
|
+
"ShiftAdministrator",
|
|
50
55
|
// Situation
|
|
51
56
|
"SituationCollection",
|
|
52
57
|
"SituationSingle",
|
|
@@ -128,7 +128,7 @@ const rejectedAbsensi = async () => {
|
|
|
128
128
|
<NeonField>
|
|
129
129
|
<template #input>
|
|
130
130
|
<NeonButton
|
|
131
|
-
size="
|
|
131
|
+
size="sm"
|
|
132
132
|
color="success"
|
|
133
133
|
icon-left="x"
|
|
134
134
|
:is-disabled="
|
|
@@ -145,7 +145,7 @@ const rejectedAbsensi = async () => {
|
|
|
145
145
|
<NeonField>
|
|
146
146
|
<template #input>
|
|
147
147
|
<NeonButton
|
|
148
|
-
size="
|
|
148
|
+
size="sm"
|
|
149
149
|
color="warning"
|
|
150
150
|
icon-left="trash-can"
|
|
151
151
|
@click="deleteAbsensi"
|
|
@@ -210,7 +210,7 @@ async function generate() {
|
|
|
210
210
|
<NeonField>
|
|
211
211
|
<template #input>
|
|
212
212
|
<NeonButton
|
|
213
|
-
size="
|
|
213
|
+
size="sm"
|
|
214
214
|
color="success"
|
|
215
215
|
icon-left="up-from-line"
|
|
216
216
|
:is-disabled="
|
|
@@ -229,7 +229,7 @@ async function generate() {
|
|
|
229
229
|
<NeonField>
|
|
230
230
|
<template #input>
|
|
231
231
|
<NeonButton
|
|
232
|
-
size="
|
|
232
|
+
size="sm"
|
|
233
233
|
color="warning"
|
|
234
234
|
icon-left="arrows-retweet"
|
|
235
235
|
:is-disabled="
|
|
@@ -173,7 +173,7 @@ async function generate() {
|
|
|
173
173
|
<NeonField>
|
|
174
174
|
<template #input>
|
|
175
175
|
<NeonButton
|
|
176
|
-
size="
|
|
176
|
+
size="sm"
|
|
177
177
|
color="success"
|
|
178
178
|
icon-left="check"
|
|
179
179
|
:is-disabled="
|
|
@@ -190,7 +190,7 @@ async function generate() {
|
|
|
190
190
|
<NeonField>
|
|
191
191
|
<template #input>
|
|
192
192
|
<NeonButton
|
|
193
|
-
size="
|
|
193
|
+
size="sm"
|
|
194
194
|
color="danger"
|
|
195
195
|
icon-left="x"
|
|
196
196
|
:is-disabled="
|
|
@@ -207,7 +207,7 @@ async function generate() {
|
|
|
207
207
|
<NeonField>
|
|
208
208
|
<template #input>
|
|
209
209
|
<NeonButton
|
|
210
|
-
size="
|
|
210
|
+
size="sm"
|
|
211
211
|
color="warning"
|
|
212
212
|
icon-left="trash-can"
|
|
213
213
|
@click="deleteAbsensi"
|
|
@@ -84,7 +84,11 @@ const saveAndSyncOne = async () => {
|
|
|
84
84
|
/>
|
|
85
85
|
|
|
86
86
|
<NeonFields v-if="values.domain == 'marketing'" md="grid-cols-2">
|
|
87
|
-
<OfficeRelation
|
|
87
|
+
<OfficeRelation
|
|
88
|
+
v-model="values"
|
|
89
|
+
:field="fields.stages"
|
|
90
|
+
:filter="{ status: 'published' }"
|
|
91
|
+
/>
|
|
88
92
|
<OfficeRelation
|
|
89
93
|
v-model="values"
|
|
90
94
|
:field="fields.target"
|
|
@@ -98,7 +98,11 @@ const saveAndSyncOne = async () => {
|
|
|
98
98
|
/>
|
|
99
99
|
|
|
100
100
|
<NeonFields v-if="values.domain == 'marketing'" md="grid-cols-2">
|
|
101
|
-
<OfficeRelation
|
|
101
|
+
<OfficeRelation
|
|
102
|
+
v-model="values"
|
|
103
|
+
:field="fields.stages"
|
|
104
|
+
:filter="{ status: 'published' }"
|
|
105
|
+
/>
|
|
102
106
|
<OfficeRelation
|
|
103
107
|
v-model="values"
|
|
104
108
|
:field="fields.target"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { NeonSingle, useSingle } from '@neon.id/context'
|
|
3
|
+
import { NeonField, NeonFields, NeonForm } from '@neon.id/form'
|
|
4
|
+
import { NeonButton, NeonDivider, NeonCopy } from '@neon.id/interfaces'
|
|
5
|
+
import { OfficeRelation, OfficeTab, OfficeTabs } from '@neon.id/office'
|
|
6
|
+
import { Query } from '@neon.id/query'
|
|
7
|
+
import { useOperasional } from '../../../common/providers/operasional'
|
|
8
|
+
import { computed, watch } from 'vue'
|
|
9
|
+
import { PromiseUtil } from '@neon.id/utils/promise'
|
|
10
|
+
import type {
|
|
11
|
+
TPersonaliaShiftModel,
|
|
12
|
+
Schema,
|
|
13
|
+
} from '@neutron.co.id/personalia-models'
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
fields,
|
|
17
|
+
id,
|
|
18
|
+
initialValues,
|
|
19
|
+
values,
|
|
20
|
+
isLoading,
|
|
21
|
+
isChanged,
|
|
22
|
+
isReady,
|
|
23
|
+
isMain,
|
|
24
|
+
isNew,
|
|
25
|
+
syncOne,
|
|
26
|
+
saveOne,
|
|
27
|
+
discardChanges,
|
|
28
|
+
executeOne,
|
|
29
|
+
} = useSingle<Schema.Shift, TPersonaliaShiftModel>()
|
|
30
|
+
|
|
31
|
+
const { staff } = useOperasional()
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<NeonSingle class="neu-shift-single">
|
|
37
|
+
<OfficeTabs>
|
|
38
|
+
<OfficeTab handle="info" icon="circle-info" title="Info">
|
|
39
|
+
<NeonForm
|
|
40
|
+
handle="info"
|
|
41
|
+
:initial-values="initialValues"
|
|
42
|
+
:is-loading="isLoading"
|
|
43
|
+
:is-changed="isChanged"
|
|
44
|
+
use-unsaved
|
|
45
|
+
@cancel="discardChanges"
|
|
46
|
+
@submit="saveOne"
|
|
47
|
+
>
|
|
48
|
+
<NeonField v-model="values.titleShift" v-bind="fields.titleShift" />
|
|
49
|
+
|
|
50
|
+
<OfficeRelation v-model="values" :field="fields.branch" />
|
|
51
|
+
<OfficeRelation v-model="values" :field="fields.shiftingStaff" />
|
|
52
|
+
|
|
53
|
+
<OfficeRelation v-model="values" :field="fields.building" />
|
|
54
|
+
|
|
55
|
+
<NeonFields md="grid-cols-2">
|
|
56
|
+
<NeonField v-model="values.expPresent" v-bind="fields.expPresent" />
|
|
57
|
+
<NeonField
|
|
58
|
+
v-model="values.expPresentEnd"
|
|
59
|
+
v-bind="fields.expPresentEnd"
|
|
60
|
+
/>
|
|
61
|
+
</NeonFields>
|
|
62
|
+
<NeonField
|
|
63
|
+
v-model="values.expTime"
|
|
64
|
+
v-bind="fields.expTime"
|
|
65
|
+
is-disabled
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
</NeonForm>
|
|
69
|
+
</OfficeTab>
|
|
70
|
+
</OfficeTabs>
|
|
71
|
+
</NeonSingle>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<style scoped>
|
|
75
|
+
.neu-shift-single {
|
|
76
|
+
@apply block;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/vue3';
|
|
2
|
+
import ShiftCollection from './ShiftCollection.vue';
|
|
3
|
+
declare const _default: Meta<typeof ShiftCollection>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Main: import("@storybook/csf").StoryAnnotations<import("@storybook/vue3").VueRenderer, {}, {}>;
|
|
6
|
+
export declare const InsideContent: import("@storybook/csf").StoryAnnotations<import("@storybook/vue3").VueRenderer, {}, {}>;
|
|
7
|
+
export declare const $DefaultView: any;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StoryUtil } from "@neon.id/story/helpers";
|
|
2
|
+
import { ShiftModel } from "@neutron.co.id/personalia-models";
|
|
3
|
+
import { ShiftCollectionView } from "@neutron.co.id/operasional-modules";
|
|
4
|
+
import { decorateCollection, viewCollection, wrapCollection } from "@mock";
|
|
5
|
+
import ShiftCollection from "./ShiftCollection.vue";
|
|
6
|
+
export default {
|
|
7
|
+
title: "Office/Shift/Collection",
|
|
8
|
+
tags: [],
|
|
9
|
+
component: ShiftCollection,
|
|
10
|
+
parameters: StoryUtil.parameters({
|
|
11
|
+
description: "`ShiftCollection`",
|
|
12
|
+
layout: "fullscreen",
|
|
13
|
+
controls: { exclude: ["colors"] },
|
|
14
|
+
backgrounds: { default: "light" }
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
export const Main = StoryUtil.story({
|
|
18
|
+
description: "Main.",
|
|
19
|
+
decorators: decorateCollection({
|
|
20
|
+
model: ShiftModel
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
export const InsideContent = StoryUtil.story({
|
|
24
|
+
description: "Inside content.",
|
|
25
|
+
render: wrapCollection(ShiftCollection),
|
|
26
|
+
decorators: decorateCollection({
|
|
27
|
+
model: ShiftModel
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
export const $DefaultView = viewCollection({
|
|
31
|
+
description: "Default view.",
|
|
32
|
+
component: ShiftCollectionView,
|
|
33
|
+
props: {
|
|
34
|
+
overrides: {}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { NeonCollection, useCollection } from '@neon.id/context'
|
|
3
|
+
import { OfficeCollectionTable } from '@neon.id/office'
|
|
4
|
+
import type { NCalendar } from '@neon.id/display'
|
|
5
|
+
import {
|
|
6
|
+
OfficeCollectionCalendar,
|
|
7
|
+
OfficeTabs,
|
|
8
|
+
OfficeTab,
|
|
9
|
+
} from '@neon.id/office'
|
|
10
|
+
import type {
|
|
11
|
+
TPersonaliaShiftModel,
|
|
12
|
+
Schema,
|
|
13
|
+
} from '@neutron.co.id/personalia-models'
|
|
14
|
+
|
|
15
|
+
defineOptions({
|
|
16
|
+
name: 'ShiftCollection',
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const { resource, display, items, userQuery } = useCollection<
|
|
20
|
+
Schema.Shift,
|
|
21
|
+
TPersonaliaShiftModel
|
|
22
|
+
>()
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
expPresentField: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'expPresent',
|
|
27
|
+
},
|
|
28
|
+
endedAtField: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'endedAt',
|
|
31
|
+
},
|
|
32
|
+
period: {
|
|
33
|
+
type: Object as any,
|
|
34
|
+
default: () => ({
|
|
35
|
+
expPresent: new Date(),
|
|
36
|
+
endedAt: new Date(),
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const emit = defineEmits<{
|
|
42
|
+
(e: 'update:period', period: NCalendar.PeriodData): void
|
|
43
|
+
}>()
|
|
44
|
+
|
|
45
|
+
function onCalendarPeriodUpdate(period: NCalendar.PeriodData) {
|
|
46
|
+
console.log('calendar', period)
|
|
47
|
+
emit('update:period', period)
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<OfficeTabs>
|
|
53
|
+
<OfficeTab handle="shift" icon="circle-info" title="Kehadiran">
|
|
54
|
+
<NeonCollection class="neu-shift-collection">
|
|
55
|
+
<OfficeCollectionTable v-if="userQuery.display === 'table'" />
|
|
56
|
+
|
|
57
|
+
<OfficeCollectionCalendar
|
|
58
|
+
v-else-if="userQuery.display === 'calendar' && period.expPresent"
|
|
59
|
+
:default-all-day="false"
|
|
60
|
+
:views="['month']"
|
|
61
|
+
:period="period"
|
|
62
|
+
@update:period="onCalendarPeriodUpdate"
|
|
63
|
+
/>
|
|
64
|
+
</NeonCollection>
|
|
65
|
+
</OfficeTab>
|
|
66
|
+
</OfficeTabs>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<style scoped>
|
|
70
|
+
.neu-shift-collection {
|
|
71
|
+
--neon-calendar-min-height: auto;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ShiftCollection } from './ShiftCollection.vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ShiftCollection } from "./ShiftCollection.vue";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/vue3';
|
|
2
|
+
import ShiftSingle from './ShiftSingle.vue';
|
|
3
|
+
declare const _default: Meta<typeof ShiftSingle>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const New: import("@storybook/csf").StoryAnnotations<import("@storybook/vue3").VueRenderer, {}, {}>;
|
|
6
|
+
export declare const Existing: import("@storybook/csf").StoryAnnotations<import("@storybook/vue3").VueRenderer, {}, {}>;
|
|
7
|
+
export declare const Content: import("@storybook/csf").StoryAnnotations<import("@storybook/vue3").VueRenderer, {}, {}>;
|
|
8
|
+
export declare const $DefaultView: any;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { StoryUtil } from "@neon.id/story/helpers";
|
|
2
|
+
import { ShiftModel } from "@neutron.co.id/personalia-models";
|
|
3
|
+
import { ShiftSingleView } from "@neutron.co.id/operasional-modules";
|
|
4
|
+
import { decorateSingle, viewSingle, wrapSingle } from "@mock";
|
|
5
|
+
import ShiftSingle from "./ShiftSingle.vue";
|
|
6
|
+
export default {
|
|
7
|
+
title: "Office/Shift/Single",
|
|
8
|
+
tags: [],
|
|
9
|
+
component: ShiftSingle,
|
|
10
|
+
parameters: StoryUtil.parameters({
|
|
11
|
+
description: "`ShiftSingle`",
|
|
12
|
+
layout: "fullscreen",
|
|
13
|
+
controls: { exclude: ["colors"] },
|
|
14
|
+
backgrounds: { default: "light" }
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
export const New = StoryUtil.story({
|
|
18
|
+
description: "New.",
|
|
19
|
+
decorators: decorateSingle({
|
|
20
|
+
model: ShiftModel
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
export const Existing = StoryUtil.story({
|
|
24
|
+
description: "Existing.",
|
|
25
|
+
args: { id: "" },
|
|
26
|
+
decorators: decorateSingle({
|
|
27
|
+
model: ShiftModel
|
|
28
|
+
// id: '___',
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
export const Content = StoryUtil.story({
|
|
32
|
+
description: "Inside content.",
|
|
33
|
+
render: wrapSingle(ShiftSingle),
|
|
34
|
+
args: { id: "" },
|
|
35
|
+
decorators: decorateSingle({
|
|
36
|
+
model: ShiftModel
|
|
37
|
+
// id: '___',
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
export const $DefaultView = viewSingle({
|
|
41
|
+
description: "Default view.",
|
|
42
|
+
component: ShiftSingleView,
|
|
43
|
+
props: {
|
|
44
|
+
// id: '___',
|
|
45
|
+
overrides: {}
|
|
46
|
+
}
|
|
47
|
+
});
|