@initsolusidigital/worksuite-shell 0.0.0-stage → 0.3.0

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 (75) hide show
  1. package/LICENSE +16 -0
  2. package/README.md +122 -2
  3. package/package.json +44 -4
  4. package/src/components/ai/AppAssistantDraft.vue +120 -0
  5. package/src/components/ai/AppAssistantWidget.vue +245 -0
  6. package/src/components/ai/AppCitedAnswer.vue +86 -0
  7. package/src/components/approvals/AppApprovalInbox.vue +265 -0
  8. package/src/components/approvals/AppApprovalSubjectModal.vue +197 -0
  9. package/src/components/chat/AppChatBubble.vue +324 -0
  10. package/src/components/chat/AppChatList.vue +249 -0
  11. package/src/components/chat/AppChatPanel.vue +315 -0
  12. package/src/components/chat/AppChatWidget.vue +126 -0
  13. package/src/components/communications/AppChannelBadge.vue +47 -0
  14. package/src/components/communications/AppConversationThread.vue +439 -0
  15. package/src/components/customFields/CustomFieldFilterPanel.vue +50 -0
  16. package/src/components/customFields/CustomFieldInput.vue +422 -0
  17. package/src/components/customFields/CustomFieldValue.vue +129 -0
  18. package/src/components/customFields/CustomFieldsSection.vue +65 -0
  19. package/src/components/customFields/fieldTypes.js +23 -0
  20. package/src/components/dashboard/AppCustomWidget.vue +138 -0
  21. package/src/components/dashboard/AppCustomWidgetForm.vue +173 -0
  22. package/src/components/dashboard/AppDashboardGrid.vue +200 -0
  23. package/src/components/dashboard/AppDashboardToolbar.vue +66 -0
  24. package/src/components/dashboard/AppSubAppsCatalog.vue +89 -0
  25. package/src/components/dataTools/AppImportExport.vue +724 -0
  26. package/src/components/dataTools/AppImportSchemaGuide.vue +130 -0
  27. package/src/components/hrMetrics/AppHrMetricsDashboard.vue +231 -0
  28. package/src/components/hrMetrics/AppHrMetricsEmployees.vue +87 -0
  29. package/src/components/hrMetrics/AppHrMetricsStat.vue +61 -0
  30. package/src/components/kpi/AppKpiAppraisalConfig.vue +284 -0
  31. package/src/components/kpi/AppKpiAppraisals.vue +733 -0
  32. package/src/components/kpi/AppKpiDefinitionModal.vue +317 -0
  33. package/src/components/kpi/AppKpiEntryModal.vue +122 -0
  34. package/src/components/kpi/AppKpiLeaderboard.vue +108 -0
  35. package/src/components/kpi/AppKpiMyCard.vue +134 -0
  36. package/src/components/kpi/AppKpiPeriodPicker.vue +115 -0
  37. package/src/components/kpi/AppKpiReportTable.vue +214 -0
  38. package/src/components/kpi/AppKpiScorecard.vue +242 -0
  39. package/src/components/kpi/AppKpiTargetsModal.vue +299 -0
  40. package/src/components/kpi/AppKpiTeam.vue +221 -0
  41. package/src/components/kpi/AppKpiWeightProfiles.vue +244 -0
  42. package/src/components/kpi/AppKpiWorkspace.vue +479 -0
  43. package/src/components/layout/AppGlobalSearch.vue +149 -0
  44. package/src/components/layout/AppLanguagePopup.vue +94 -0
  45. package/src/components/layout/AppLauncherPopup.vue +147 -0
  46. package/src/components/layout/AppLegalConsentModal.vue +484 -0
  47. package/src/components/layout/AppNavbar.vue +402 -0
  48. package/src/components/layout/AppNotificationContent.vue +173 -0
  49. package/src/components/layout/AppNotificationDrawer.vue +98 -0
  50. package/src/components/layout/AppNotificationPopup.vue +67 -0
  51. package/src/components/layout/AppPlatformBanners.vue +192 -0
  52. package/src/components/layout/AppSidebar.vue +226 -0
  53. package/src/components/layout/AppSidebarNav.vue +119 -0
  54. package/src/components/layout/AppUserMenu.vue +89 -0
  55. package/src/components/layout/AppUserMenuContent.vue +59 -0
  56. package/src/composables/useKpi.js +232 -0
  57. package/src/composables/useLgViewport.js +25 -0
  58. package/src/composables/useNavigation.js +177 -0
  59. package/src/layouts/AppLayout.vue +207 -0
  60. package/src/locales/en.json +1362 -0
  61. package/src/locales/id.json +1396 -0
  62. package/src/pages/auth/AccountBlocked.vue +55 -0
  63. package/src/pages/auth/IdentityRedirect.vue +37 -0
  64. package/src/pages/profile/Layout.vue +210 -0
  65. package/src/pages/profile/partials/AccountSection.vue +139 -0
  66. package/src/pages/profile/partials/ApprovalDelegationSection.vue +389 -0
  67. package/src/pages/profile/partials/DevicesCard.vue +222 -0
  68. package/src/pages/profile/partials/PreferencesSection.vue +87 -0
  69. package/src/pages/profile/partials/SecuritySection.vue +93 -0
  70. package/src/pages/profile/partials/SessionsCard.vue +418 -0
  71. package/src/pages/profile/partials/SessionsSection.vue +58 -0
  72. package/src/pages/profile/partials/SupportAccessSection.vue +173 -0
  73. package/src/pages/profile/partials/TrustedDevicesCard.vue +141 -0
  74. package/src/pages/profile/partials/TwoFactorSection.vue +304 -0
  75. package/src/shellSetup.js +46 -0
@@ -0,0 +1,94 @@
1
+ <script setup>
2
+ import { useI18n } from 'vue-i18n'
3
+ import { useAppStore } from '@initsolusidigital/worksuite-core/stores/app.js'
4
+ import { useDismissOnEscape } from '@initsolusidigital/worksuite-core/composables/useDismissOnEscape.js'
5
+
6
+ const { locale, t } = useI18n()
7
+ const appStore = useAppStore()
8
+
9
+ // Escape menutup popup ini — mengalah bila ada dialog di atasnya (lihat composable).
10
+ useDismissOnEscape(() => appStore.showLanguage, () => appStore.closeLanguage())
11
+
12
+ const languages = [
13
+ { code: 'en', flag: 'fi fi-us' },
14
+ { code: 'id', flag: 'fi fi-id' },
15
+ ]
16
+
17
+ function switchLocale(code) {
18
+ locale.value = code
19
+ localStorage.setItem('locale', code)
20
+ appStore.closeLanguage()
21
+ }
22
+ </script>
23
+
24
+ <template>
25
+ <!-- Backdrop transparan — menutup popup saat klik di luar panel -->
26
+ <div
27
+ v-if="appStore.showLanguage"
28
+ class="fixed inset-0 z-[55]"
29
+ @click="appStore.closeLanguage()"
30
+ />
31
+
32
+ <!-- Wrapper posisi — mirror navbar (fixed + px-4 + max-w-7xl) agar popup
33
+ sejajar dengan batas kanan navbar di semua lebar layar, identik dengan
34
+ pola AppNotificationPopup dan AppUserMenu -->
35
+ <!-- 8 px di bawah header: 88 = 16 + 64 (bilah layar sempit), 72 = 16 + 48 (pulau ≥lg) -->
36
+ <div class="fixed top-[88px] lg:top-[72px] left-0 right-0 z-[60] pointer-events-none">
37
+ <div class="w-full px-4 sm:px-6 lg:px-8 flex justify-end pointer-events-none">
38
+
39
+ <Transition name="fade-down">
40
+ <div
41
+ v-if="appStore.showLanguage"
42
+ class="pointer-events-auto w-52 bg-white dark:bg-gray-800 rounded-xl shadow-2xl border border-gray-100 dark:border-gray-700 overflow-hidden"
43
+ >
44
+ <!-- Header popup -->
45
+ <div class="px-4 py-2.5 border-b border-gray-100 dark:border-gray-700 bg-gray-50/60 dark:bg-gray-700/40">
46
+ <p class="text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider">
47
+ {{ t('lang.switchTitle') }}
48
+ </p>
49
+ </div>
50
+
51
+ <!-- Pilihan bahasa -->
52
+ <button
53
+ v-for="lang in languages"
54
+ :key="lang.code"
55
+ @click="switchLocale(lang.code)"
56
+ class="w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors text-left"
57
+ :class="locale === lang.code
58
+ ? 'text-blue-600 dark:text-blue-400 font-medium bg-blue-50 dark:bg-blue-900/20'
59
+ : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700'"
60
+ >
61
+ <!-- Bendera negara via flag-icons -->
62
+ <span
63
+ :class="lang.flag"
64
+ style="width:20px;height:14px;border-radius:2px;flex-shrink:0;display:inline-block;"
65
+ />
66
+ <!-- Nama bahasa sesuai locale aktif -->
67
+ <span class="flex-1">{{ t(`lang.${lang.code}_full`) }}</span>
68
+ <!-- Checkmark untuk bahasa yang sedang aktif -->
69
+ <svg
70
+ v-if="locale === lang.code"
71
+ class="w-4 h-4 shrink-0 text-blue-600 dark:text-blue-400"
72
+ xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
73
+ >
74
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"/>
75
+ </svg>
76
+ </button>
77
+ </div>
78
+ </Transition>
79
+
80
+ </div>
81
+ </div>
82
+ </template>
83
+
84
+ <style scoped>
85
+ .fade-down-enter-active,
86
+ .fade-down-leave-active {
87
+ transition: opacity 0.2s ease, transform 0.2s ease;
88
+ }
89
+ .fade-down-enter-from,
90
+ .fade-down-leave-to {
91
+ opacity: 0;
92
+ transform: translateY(-8px);
93
+ }
94
+ </style>
@@ -0,0 +1,147 @@
1
+ <script setup>
2
+ import { computed, onMounted, watch } from 'vue'
3
+ import { useAppStore } from '@initsolusidigital/worksuite-core/stores/app.js'
4
+ import { useDismissOnEscape } from '@initsolusidigital/worksuite-core/composables/useDismissOnEscape.js'
5
+ import { useI18n } from 'vue-i18n'
6
+ import { useApps } from '@initsolusidigital/worksuite-core/composables/useApps.js'
7
+ import { appUrl } from '@initsolusidigital/worksuite-core/utils/appUrl.js'
8
+
9
+ // App Launcher — popup grid app ala Google. Muncul di navbar,
10
+ // bisa dibuka dari halaman mana pun untuk lompat cepat ke sub-app lain tanpa ke Dashboard.
11
+ const { t } = useI18n()
12
+ const appStore = useAppStore()
13
+
14
+ // Escape menutup popup ini — mengalah bila ada dialog di atasnya (lihat composable).
15
+ useDismissOnEscape(() => appStore.showAppLauncher, () => appStore.closeAppLauncher())
16
+ const { apps, loading, fetchApps, appIcon, appColor, appAccent, appName, isCurrent, appAccess, appStatusLabel, sortByOpenable } = useApps()
17
+
18
+ onMounted(() => fetchApps())
19
+
20
+ // Status app berubah selagi halaman terbuka (dinyatakan System Owner, atau hasil pemeriksaan
21
+ // otomatis), jadi katalog dimuat ulang tiap launcher dibuka — bukan sekali per sesi halaman.
22
+ watch(() => appStore.showAppLauncher, (open) => { if (open) fetchApps(true) })
23
+
24
+ // Yang tampil = app berlisensi. Yang belum bisa dibuka (sedang diperbaiki, segera, gangguan) tetap
25
+ // tampil redup berlencana di bawah yang bisa dibuka, supaya pengguna tahu app itu ada dan kenapa
26
+ // tertutup. App tanpa lisensi tidak tampil. Aturannya di `utils/appStatus.js`.
27
+ const listed = computed(() => sortByOpenable(apps.value.filter((a) => appAccess(a).listed)))
28
+
29
+ const BADGE_CLASS = {
30
+ maintenance: 'bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300',
31
+ coming_soon: 'bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300',
32
+ degraded: 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300',
33
+ }
34
+
35
+ const isClosed = (app) => !isCurrent(app) && !appAccess(app).openable
36
+
37
+ function cardTitle(app) {
38
+ if (isCurrent(app)) return t('launcher.current')
39
+ const status = appStatusLabel(app)
40
+ return status ? `${appName(app)} — ${status}` : appName(app)
41
+ }
42
+
43
+ // Klik app lain → buka TAB BARU (app yang sedang dibuka tetap ada).
44
+ // App yang sedang dibuka (isCurrent) → no-op, cuma tutup popup.
45
+ // ⚠️ Alamatnya diturunkan `appUrl()`, BUKAN `app.url` mentah. `apps.url` disusun backend dari
46
+ // `APP_{SLUG}_URL` dan SELALU origin ber-port, jadi memakainya apa adanya di belakang proxy
47
+ // melempar pengguna keluar dari origin tunggal tepat pada tombol yang paling sering dipakai untuk
48
+ // berpindah app. `app.url` tetap dipakai sebagai sumber alamat saat dev per-port — jadi kanon
49
+ // "backend yang menentukan tujuan" tak dilanggar: yang diturunkan sendiri hanya BENTUK alamatnya,
50
+ // bukan app mana yang ada dan boleh dibuka.
51
+ function openApp(app) {
52
+ if (isCurrent(app)) { appStore.closeAppLauncher(); return }
53
+ if (!appAccess(app).openable) return
54
+ const url = appUrl(app.slug, app.url)
55
+ if (url) window.open(url, '_blank', 'noopener')
56
+ appStore.closeAppLauncher()
57
+ }
58
+ </script>
59
+
60
+ <template>
61
+ <!-- Backdrop transparan — menutup popup saat klik di luar panel -->
62
+ <div
63
+ v-if="appStore.showAppLauncher"
64
+ class="fixed inset-0 z-[55]"
65
+ @click="appStore.closeAppLauncher()"
66
+ />
67
+
68
+ <!-- Wrapper posisi — mirror navbar (fixed + px responsif), KANAN (justify-end) supaya
69
+ sejajar dengan tombol launcher di gugus utilitas kanan navbar. Jaraknya 8 px di bawah header (88 px layar sempit, 72 px ≥lg). -->
70
+ <div class="fixed top-[88px] lg:top-[72px] left-0 right-0 z-[60] pointer-events-none">
71
+ <div class="w-full px-4 sm:px-6 lg:px-8 flex justify-end pointer-events-none">
72
+
73
+ <Transition name="fade-down">
74
+ <div
75
+ v-if="appStore.showAppLauncher"
76
+ data-app-launcher
77
+ class="pointer-events-auto w-[calc(100vw-2rem)] max-w-[340px] bg-white dark:bg-gray-800 rounded-xl shadow-2xl border border-gray-100 dark:border-gray-700 overflow-hidden"
78
+ >
79
+ <div class="px-4 py-3 border-b border-gray-100 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-700/50">
80
+ <h3 class="text-sm font-semibold text-gray-800 dark:text-white">{{ t('launcher.title') }}</h3>
81
+ </div>
82
+
83
+ <div class="p-3 max-h-[420px] overflow-y-auto scrollbar-rounded">
84
+ <div v-if="loading && !listed.length" class="py-10 text-center text-sm text-gray-400">
85
+ {{ t('common.loading') }}
86
+ </div>
87
+ <div v-else-if="!listed.length" class="py-10 text-center text-sm text-gray-400">
88
+ {{ t('launcher.empty') }}
89
+ </div>
90
+ <div v-else class="grid grid-cols-3 gap-1">
91
+ <!-- App aktif (isCurrent): border PUTUS-PUTUS + latar tipis mengikuti WARNA app-nya,
92
+ TIDAK bisa diklik (disabled) — user tahu sudah di sini. App lain: border transparan
93
+ (ukuran seragam) + hover tint mengikuti warna app masing-masing (bukan biru tetap).
94
+ App yang tak bisa dibuka: ikon & nama redup, lencana statusnya tetap terbaca. -->
95
+ <button
96
+ v-for="app in listed"
97
+ :key="app.slug"
98
+ type="button"
99
+ :disabled="isCurrent(app) || isClosed(app)"
100
+ :data-app="app.slug"
101
+ :data-app-status="appAccess(app).status"
102
+ @click="openApp(app)"
103
+ class="flex flex-col items-center gap-2 px-2 py-3 rounded-xl border-2 transition-colors"
104
+ :class="isCurrent(app)
105
+ ? `border-dashed ${appAccent(app).active} cursor-default`
106
+ : isClosed(app)
107
+ ? 'border-transparent cursor-not-allowed'
108
+ : `border-transparent ${appAccent(app).hover}`"
109
+ :title="cardTitle(app)"
110
+ >
111
+ <span
112
+ class="w-11 h-11 rounded-xl flex items-center justify-center"
113
+ :class="[appColor(app), isClosed(app) && 'opacity-50 grayscale']"
114
+ >
115
+ <component :is="appIcon(app)" class="w-6 h-6" />
116
+ </span>
117
+ <span
118
+ class="text-xs text-center leading-tight line-clamp-2"
119
+ :class="isClosed(app) ? 'text-gray-400 dark:text-gray-500' : 'text-gray-700 dark:text-gray-300'"
120
+ >{{ appName(app) }}</span>
121
+ <span
122
+ v-if="appStatusLabel(app)"
123
+ data-app-badge
124
+ class="px-1.5 py-0.5 rounded-md text-[10px] font-medium leading-tight text-center"
125
+ :class="BADGE_CLASS[appAccess(app).badge]"
126
+ >{{ appStatusLabel(app) }}</span>
127
+ </button>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </Transition>
132
+
133
+ </div>
134
+ </div>
135
+ </template>
136
+
137
+ <style scoped>
138
+ .fade-down-enter-active,
139
+ .fade-down-leave-active {
140
+ transition: opacity 0.2s ease, transform 0.2s ease;
141
+ }
142
+ .fade-down-enter-from,
143
+ .fade-down-leave-to {
144
+ opacity: 0;
145
+ transform: translateY(-8px);
146
+ }
147
+ </style>