Merge branch 'development' of github.com:defuj/eis into dev-bagus

This commit is contained in:
kur0nek-o 2023-10-27 20:25:22 +07:00
commit 1cb73a222a
12 changed files with 59 additions and 51 deletions

16
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "eis",
"version": "0.0.1",
"version": "0.0.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "eis",
"version": "0.0.1",
"version": "0.0.2",
"dependencies": {
"@headlessui/tailwindcss": "^0.2.0",
"@headlessui/vue": "^1.7.16",
@ -8526,9 +8526,9 @@
}
},
"node_modules/vite": {
"version": "4.4.11",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz",
"integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
"dependencies": {
"esbuild": "^0.18.10",
"postcss": "^8.4.27",
@ -15375,9 +15375,9 @@
}
},
"vite": {
"version": "4.4.11",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz",
"integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
"requires": {
"esbuild": "^0.18.10",
"fsevents": "~2.3.2",

View File

@ -4,12 +4,7 @@ import { NotificationProvider } from '@/components/Notification'
import { useDialogStore } from '@/stores/dialog'
import ActionDialog from '@/components/Dialogs/ActionDialog.vue'
import CommandPalettes from '@/components/CommandPalettes.vue'
import { onMounted } from 'vue'
const dialog = useDialogStore()
onMounted(() => {
// remove all local storage
})
</script>
<template>

View File

@ -1136,6 +1136,10 @@ select {
margin-top: 1.5rem;
}
.mt-3\.5 {
margin-top: 0.875rem;
}
.line-clamp-1 {
overflow: hidden;
display: -webkit-box;
@ -1240,6 +1244,18 @@ select {
height: 80vh;
}
.h-screen {
height: 100vh;
}
.h-\[90vh\] {
height: 90vh;
}
.h-\[calc\(90vh-24px\)\] {
height: calc(90vh - 24px);
}
.max-h-0 {
max-height: 0px;
}
@ -1894,6 +1910,10 @@ select {
fill: #4b5563;
}
.fill-green-600 {
fill: #16a34a;
}
.fill-primary-500 {
fill: #035b71;
}
@ -1902,10 +1922,6 @@ select {
fill: #cc0000;
}
.fill-secondary-600 {
fill: #007b8d;
}
.fill-white {
fill: #fff;
}
@ -2350,11 +2366,6 @@ select {
color: rgb(204 0 0 / var(--tw-text-opacity));
}
.text-secondary-600 {
--tw-text-opacity: 1;
color: rgb(0 123 141 / var(--tw-text-opacity));
}
.text-slate-600 {
--tw-text-opacity: 1;
color: rgb(71 85 105 / var(--tw-text-opacity));

View File

@ -1,13 +1,13 @@
<template>
<TransitionRoot :show="command.open" as="template" @after-leave="onQueryChange('')" appear>
<TransitionRoot :show="command.open" @after-leave="onQueryChange('')" appear>
<Dialog as="div" class="relative z-10" @close="command.closeCommand">
<TransitionChild as="template" enter="ease-out duration-300" enter-from="opacity-0" enter-to="opacity-100"
<TransitionChild enter="ease-out duration-300" enter-from="opacity-0" enter-to="opacity-100"
leave="ease-in duration-200" leave-from="opacity-100" leave-to="opacity-0">
<div class="fixed inset-0 transition-opacity bg-gray-500 bg-opacity-25 backdrop-blur" />
</TransitionChild>
<div class="fixed inset-0 z-10 p-4 overflow-y-auto sm:p-6 md:p-20">
<TransitionChild as="template" enter="ease-out duration-300" enter-from="opacity-0 scale-95"
<TransitionChild enter="ease-out duration-300" enter-from="opacity-0 scale-95"
enter-to="opacity-100 scale-100" leave="ease-in duration-200" leave-from="opacity-100 scale-100"
leave-to="opacity-0 scale-95">
<!-- max-w-2xl mx-auto overflow-hidden transition-all transform bg-white bg-opacity-80 divide-y divide-gray-500 shadow-2xl divide-opacity-10 rounded-xl ring-0 ring-black ring-opacity-5 -->
@ -130,7 +130,6 @@
</ComboboxOptions>
<div v-if="query !== '' && filteredMenus.length === 0" class="px-6 text-center py-14 sm:px-14">
<!-- <FolderIcon class="w-6 h-6 mx-auto text-gray-900 text-opacity-40" aria-hidden="true" /> -->
<h2 class="font-semibold text-slate-900">Tidak ada hasil</h2>
<p class="mt-2 text-sm leading-6 text-slate-600">

View File

@ -145,7 +145,7 @@ const handleOnClose = () => {
class="flex items-center justify-center w-12 h-12 mx-auto rounded-full bg-secondary-100">
<!-- <CheckIcon class="w-6 h-6 text-green-600" aria-hidden="true" /> -->
<svg width="32" height="32" viewBox="0 0 32 32"
class="w-6 h-6 text-secondary-600 fill-secondary-600">
class="w-6 h-6 text-green-600 fill-green-600">
<path opacity="0.2"
d="M28 16C28 18.3734 27.2962 20.6935 25.9776 22.6668C24.6591 24.6402 22.7849 26.1783 20.5922 27.0866C18.3995 27.9948 15.9867 28.2324 13.6589 27.7694C11.3312 27.3064 9.19295 26.1635 7.51472 24.4853C5.83649 22.8071 4.6936 20.6689 4.23058 18.3411C3.76756 16.0133 4.0052 13.6005 4.91345 11.4078C5.8217 9.21509 7.35977 7.34094 9.33316 6.02236C11.3066 4.70379 13.6266 4 16 4C19.1826 4 22.2348 5.26428 24.4853 7.51472C26.7357 9.76515 28 12.8174 28 16Z"
fill="#007B8D" />

View File

@ -106,7 +106,7 @@ const closeSideBar = () => menu.toggleSidebar()
<span v-if="menu.sidebarShowed" class="px-4 mt-4 text-sm font-semibold text-primary-800">
Menu
</span>
<div :class="[menu.sidebarShowed ? 'flex flex-col flex-grow overflow-y-auto' : 'hidden', '']">
<div :class="[menu.sidebarShowed ? 'flex flex-col flex-grow overflow-y-auto' : 'hidden']">
<div class="flex flex-col flex-grow mt-3">
<nav class="flex-1 px-2 pb-4 space-y-1">
<template v-for="item in menu.navigation" :key="item.name">

View File

@ -33,8 +33,7 @@ const isMenuSelected = computed(() => {
<template>
<div :class="[isChildren ? 'ml-2 mt-1 bg-primary-100 rounded-xl' : '']">
<Disclosure :defaultOpen="item.expanded" as="dev">
<!-- Nested item with children -->
<Disclosure :defaultOpen="item.expanded">
<DisclosureButton @click="menu.toggleSidebarMenu(item.path, !item.expanded)"
:class="[(isMenuSelected || item.expanded || isChildren) ? 'bg-primary-100 font-bold' : 'font-semibold text-aside hover:bg-primary-100 hover:text-primary-500', isMenuSelected ? 'text-primary-500' : 'text-gray-600', isChildren ? 'pl-1 pr-2' : 'px-2', 'group w-full flex items-center py-2 text-left text-xs rounded-lg focus:outline-none focus:ring-0']">
<component v-if="isChildren" :is="IconDotOutline"

View File

@ -1,6 +1,6 @@
<template>
<div class="flex flex-col items-center justify-center px-4 text-center whitespace-pre-wrap h-screen-80">
<div class="w-full md:w-[440px] py-4 md:py-0 flex flex-col items-center">
<div class="flex flex-col items-center justify-between px-4 text-center whitespace-pre-wrap h-[calc(90vh-24px)]">
<div class="w-full flex-1 md:w-[440px] justify-center py-4 md:py-0 flex flex-col items-center">
<img :src="IconApp" alt="pln" class="h-[66px] object-contain mx-auto mb-4">
<button @click="command.showCommandPalettes" type="button"
class="flex flex-row items-center w-full p-2 text-gray-400 rounded-full bg-gray-50 hover:text-primary-500 focus:outline-none focus:ring-0">
@ -9,10 +9,16 @@
<span class="px-3 text-sm font-medium text-gray-500 text-md">Cari menu</span>
</button>
<div class="flex mt-3.5" v-if="filteredMenus.length === 0 && recent.length === 0">
<h1 class="text-sm text-center text-gray-800">
Silahkan cari menu atau buka menu di samping kiri untuk memulai
</h1>
</div>
<div v-if="query === '' || filteredMenus.length > 0" static class="w-full mt-6 md:mt-8 lg:mt-12">
<div class="flex flex-col items-start w-full p-2" v-if="filteredMenus.length > 0 || recent.length > 0">
<h2 v-if="query === '' && recent.length > 0" class="mb-2 text-xs font-semibold text-gray-900 ">
Terakhir Dikunjungi
Terakhir Diakses
</h2>
<div class="flex flex-col w-full space-y-3" v-for="menu in query === '' ? recent : filteredMenus"
:key="menu.path">
@ -59,6 +65,11 @@
</div>
</div>
</div>
<div class="flex flex-col items-center justify-center py-3">
<dt class="text-xs text-center text-gray-500">
Copyright © 2023 PT PLN (Persero). All Rights Reserved
</dt>
</div>
</div>
</template>

View File

@ -13,11 +13,7 @@ export const useCommandPalattesStore = defineStore('command_palettes', () => {
const keyFStatus = ref(false)
const showCommandPalettes = () => {
open.value = true;
}
const handleOnDismissCommandPalettes = () => {
open.value = false;
open.value = true
}
const onKeyPressed = (event: KeyboardEvent) => {
@ -100,7 +96,6 @@ export const useCommandPalattesStore = defineStore('command_palettes', () => {
return {
open,
showCommandPalettes,
handleOnDismissCommandPalettes,
onKeyPressed,
onKeyUp,
addRecent,

View File

@ -39,19 +39,14 @@ export const useMenuStore = defineStore('menu', () => {
toggleItemExpanded(navigation.value)
}
const toggleSidebarDesktop = () => (sidebarShowed.value = !sidebarShowed.value)
watch(router, (value) => {
if (value.currentRoute.value.fullPath === '/' || value.currentRoute.value.fullPath === '/home') {
const collapseAllMenu = (): void => {
for (const item of navigation.value) {
item.expanded = false
}
}
})
watch(menuSelected, (value) => {
if (value !== '/login' && value !== '/404' && value !== '/home' && value !== '/') {
console.log('current route', value);
const result = command.searchRoutesPath(routes, value)
if (result.length > 0) {
const route = result.find((item) => item.path === value)
@ -59,7 +54,8 @@ export const useMenuStore = defineStore('menu', () => {
command.addRecent(route)
}
}
} else {
collapseAllMenu()
}
})
@ -80,6 +76,7 @@ export const useMenuStore = defineStore('menu', () => {
}
return {
collapseAllMenu,
expandCurrentActiveMenu,
navigation,
toggleSidebar,

View File

@ -18,7 +18,8 @@ export default defineConfig({
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
'@': fileURLToPath(new URL('./src', import.meta.url)),
'inferno': 'inferno/dist/index.dev.esm.js',
}
},
})