Skip to content

Commit 1699c12

Browse files
committed
refactor!: remove main files
1 parent 6df4ee7 commit 1699c12

File tree

221 files changed

+1296
-8719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+1296
-8719
lines changed

package-lock.json

Lines changed: 1215 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts">
2+
import { dialogItems } from '../composables/useQuickDialog'
3+
</script>
4+
5+
<template>
6+
<v-dialog v-for="d in dialogItems" :key="d.id" :model-value="d.show">
7+
<div>
8+
{{ d.title }}
9+
</div>
10+
</v-dialog>
11+
</template>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import uuid from 'uuid-random'
2+
3+
interface DialogItem {
4+
id: string
5+
title: string
6+
show: boolean
7+
message?: string
8+
result?: any
9+
}
10+
11+
export const dialogItems = [] as DialogItem[]
12+
13+
export default function useQuickDialog() {
14+
function mount(args: Pick<DialogItem, 'title' | 'message'>) {
15+
const id = uuid()
16+
17+
return {
18+
id,
19+
show: false,
20+
...args,
21+
} as DialogItem
22+
}
23+
24+
function open(args: Pick<DialogItem, 'title' | 'message'>) {
25+
const item = mount(args)
26+
27+
return new Promise<any>((resolve) => {
28+
dialogItems.push(item)
29+
30+
const interval = setInterval(() => {
31+
if (!item.show) return
32+
33+
clearInterval(interval)
34+
35+
resolve(item.result)
36+
}, 100)
37+
})
38+
}
39+
40+
function close(id: string) {
41+
const item = dialogItems.find((i) => i.id === id)
42+
43+
if (!item) return
44+
45+
item.show = false
46+
}
47+
48+
return {
49+
open,
50+
close,
51+
dialogItems,
52+
}
53+
}

packages/app/config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import type CoreApp from '@index-san/core/app'
22

3+
interface OpenResult {
4+
displayName: string
5+
path: string
6+
metadata: Record<string, any>
7+
}
8+
39
export interface ClientAppConfig {
410
useCase: CoreApp['useCase']
511
open: {
612
url: (href: string) => Promise<void>
7-
directory: () => Promise<string>
13+
directory: () => Promise<OpenResult>
814
}
915
}
1016

packages/app/modules/workspace/components/WForm.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ async function submit() {
6262
const config = useConfig()
6363
6464
async function pickFolder() {
65-
const path = await config.open.directory()
65+
const result = await config.open.directory()
6666
67-
payload.value.config.path = path
67+
console.log(result)
68+
69+
payload.value.config = result
6870
}
6971
7072
// set edited item
@@ -107,10 +109,13 @@ watch(
107109
value-key="id"
108110
card:color="b-primary"
109111
menu:offset-y
110-
disabled
111112
/>
112113

113-
<v-input v-model="payload.config.path" :label="$t('path')" :disabled="!!editedItem">
114+
<v-input
115+
v-model="payload.config.displayName"
116+
:label="$t('path')"
117+
:disabled="!!editedItem"
118+
>
114119
<template #append>
115120
<v-btn
116121
size="sm"

packages/app/types/components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ declare module '@vue/runtime-core' {
4444
VTd: typeof import('./../components/VTd.vue')['default']
4545
VTextarea: typeof import('./../components/VTextarea.vue')['default']
4646
VTh: typeof import('./../components/VTh.vue')['default']
47+
VToolbar: typeof import('./../components/VToolbar.vue')['default']
4748
VTooltip: typeof import('./../components/VTooltip.vue')['default']
4849
VTr: typeof import('./../components/VTr.vue')['default']
4950
}

packages/core/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/core/.eslintrc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/core/package.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/core/src/__tests__/factories/base.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)