@sidekick-coder/zenith-kit 0.5.0 → 0.5.2
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/dist/client/{Icon-C-SaxixA.mjs → Icon-CV9WhwVm.js} +1 -1
- package/dist/client/client/components.d.ts +0 -2
- package/dist/client/client/composables/useLayoutOptions.d.ts +1 -1
- package/dist/client/client/contracts/events.d.ts +3 -1
- package/dist/client/client/facades/layout.d.ts +2 -1
- package/dist/client/client/facades/router.d.ts +2 -2
- package/dist/client/client/index.d.ts +2 -2
- package/dist/client/client/services/LayoutService.d.ts +15 -2
- package/dist/client/client/services/MenuService.d.ts +5 -0
- package/dist/client/client/services/RouterService.d.ts +24 -14
- package/dist/client/index.es.js +2832 -2850
- package/dist/client/styles.css +1 -1
- package/dist/components/client/components.d.ts +0 -2
- package/dist/components/client/composables/useLayoutOptions.d.ts +1 -1
- package/dist/components/client/contracts/events.d.ts +3 -1
- package/dist/components/client/facades/layout.d.ts +2 -1
- package/dist/components/client/facades/router.d.ts +2 -2
- package/dist/components/client/index.d.ts +2 -2
- package/dist/components/client/services/LayoutService.d.ts +15 -2
- package/dist/components/client/services/MenuService.d.ts +5 -0
- package/dist/components/client/services/RouterService.d.ts +24 -14
- package/dist/components/index.es.js +8683 -8840
- package/dist/components/styles.css +1 -1
- package/dist/server/{CliService-UyeGvdqO.d.mts → CliService-BK2WjuQn.d.mts} +5 -1
- package/dist/server/{MigratorService-DdU4M8On.d.mts → MigratorService-D358VLQ9.d.mts} +5 -2
- package/dist/server/RouterService-CESQPVL7.mjs +2 -0
- package/dist/server/{RouterService-B1ctfFiu.d.mts → RouterService-fMVXU5LB.d.mts} +7 -1
- package/dist/server/{SeederService-RbqVMK6q.d.mts → SeederService-Bmb0A6fK.d.mts} +3 -0
- package/dist/server/commands/pluginBuild.d.mts +1 -1
- package/dist/server/commands/pluginGenerateId.d.mts +1 -1
- package/dist/server/contracts/EventContract.d.mts +5 -5
- package/dist/server/facades/emmitter.d.mts +2 -1
- package/dist/server/facades/emmitter.mjs +1 -1
- package/dist/server/facades/migrator.d.mts +1 -1
- package/dist/server/facades/router.d.mts +1 -1
- package/dist/server/facades/router.mjs +1 -1
- package/dist/server/index.d.mts +5 -5
- package/dist/server/index.mjs +1 -1
- package/dist/server/services/CliService.d.mts +2 -2
- package/dist/server/services/CliService.mjs +2 -2
- package/dist/server/services/CliTesterService.d.mts +1 -1
- package/dist/server/services/HttpService.d.mts +1 -1
- package/dist/server/services/HttpService.mjs +1 -1
- package/dist/server/services/MigratorService.d.mts +2 -2
- package/dist/server/services/MigratorService.mjs +1 -1
- package/dist/server/services/RouterFileBaseRoutingService.d.mts +1 -1
- package/dist/server/services/RouterRegisterService.d.mts +1 -1
- package/dist/server/services/RouterRegisterService.mjs +1 -1
- package/dist/server/services/RouterResourceService.d.mts +1 -1
- package/dist/server/services/RouterService.d.mts +2 -2
- package/dist/server/services/RouterService.mjs +1 -1
- package/dist/server/services/SeederService.d.mts +1 -1
- package/dist/server/services/SeederService.mjs +1 -1
- package/dist/shared/schemas/dashboardSchema.d.mts +18 -18
- package/dist/shared/schemas/userSchema.d.mts +2 -2
- package/package.json +8 -13
- package/src/client/components/DataTable.vue +0 -2
- package/src/client/components/FormFileUploader.vue +6 -1
- package/src/client/components.ts +0 -2
- package/src/client/contracts/events.ts +3 -1
- package/src/client/css/styles.css +68 -38
- package/src/client/css/theme.css +2 -70
- package/src/client/facades/layout.ts +3 -6
- package/src/client/facades/router.ts +2 -2
- package/src/client/index.ts +2 -2
- package/src/client/services/LayoutService.ts +24 -8
- package/src/client/services/MenuService.ts +6 -0
- package/src/client/services/RouterService.ts +105 -91
- package/src/server/contracts/EventContract.ts +2 -2
- package/src/server/facades/emmitter.ts +2 -1
- package/src/server/services/CliService.ts +10 -0
- package/src/server/services/MigratorService.ts +4 -1
- package/src/server/services/RouterService.ts +11 -0
- package/src/server/services/SeederService.ts +3 -0
- package/vite.client.config.ts +2 -1
- package/vite.components.config.ts +1 -1
- package/dist/client/client/components/PageCrud.vue.d.ts +0 -78
- package/dist/client/client/entities/PluginEntity.d.ts +0 -8
- package/dist/components/client/components/PageCrud.vue.d.ts +0 -78
- package/dist/components/client/entities/PluginEntity.d.ts +0 -8
- package/dist/server/RouterService-mnw6gjdF.mjs +0 -2
- package/src/client/components/PageCrud.vue +0 -197
- package/src/client/entities/PluginEntity.ts +0 -14
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" generic="T extends Record<string, any>">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import type { PropType } from 'vue'
|
|
4
|
-
import DataTable from '#client/components/DataTable.vue'
|
|
5
|
-
import ClientOnly from '#client/components/ClientOnly.vue'
|
|
6
|
-
import ZButton from '#client/components/ZButton.vue'
|
|
7
|
-
import Icon from '#client/components/Icon.vue'
|
|
8
|
-
import ZAlertButton from '#client/components/ZAlertButton.vue'
|
|
9
|
-
import DialogForm from '#client/components/DialogForm.vue'
|
|
10
|
-
import PageTitle from '#client/components/PageTitle.vue'
|
|
11
|
-
import PageSubtitle from '#client/components/PageSubtitle.vue'
|
|
12
|
-
|
|
13
|
-
defineProps({
|
|
14
|
-
title: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: () => $t('Items')
|
|
17
|
-
},
|
|
18
|
-
description: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: ''
|
|
21
|
-
},
|
|
22
|
-
serialize: {
|
|
23
|
-
type: Function as PropType<(row: any) => T>,
|
|
24
|
-
default: (row: any) => row as T,
|
|
25
|
-
},
|
|
26
|
-
fetch: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: null
|
|
29
|
-
},
|
|
30
|
-
fetchDestroy: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: null
|
|
33
|
-
},
|
|
34
|
-
fetchUpdateMethod: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: 'PUT'
|
|
37
|
-
},
|
|
38
|
-
viewTo: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: null
|
|
41
|
-
},
|
|
42
|
-
actions: {
|
|
43
|
-
type: Array as PropType<Array<'create' | 'edit' | 'destroy'>> ,
|
|
44
|
-
default: () => ['create', 'edit', 'destroy'],
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const tableRef = ref()
|
|
49
|
-
|
|
50
|
-
const fetchQuery = defineModel('fetchQuery', {
|
|
51
|
-
type: Object as PropType<Record<string, any>>,
|
|
52
|
-
default: null
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const loading = defineModel('loading', {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: false,
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const columns = defineModel('columns', {
|
|
61
|
-
type: Array as PropType<Array<any>>,
|
|
62
|
-
default: () => [],
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
const fields = defineModel('fields', {
|
|
66
|
-
type: Object,
|
|
67
|
-
default: () => ({}),
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
const fieldsEdit = defineModel('fieldsEdit', {
|
|
71
|
-
type: Object,
|
|
72
|
-
default: null,
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
function parse(url: string, row: any): string {
|
|
76
|
-
return url.replace(/:([a-zA-Z_]+)/g, (_, key) => row[key]) as string
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function load(){
|
|
80
|
-
tableRef.value?.load()
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
defineExpose({
|
|
84
|
-
load,
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<template>
|
|
90
|
-
<div>
|
|
91
|
-
<div class="flex mb-4 justify-between items-center gap-4">
|
|
92
|
-
<div class="flex-1">
|
|
93
|
-
<PageTitle>
|
|
94
|
-
{{ title }}
|
|
95
|
-
</PageTitle>
|
|
96
|
-
<PageSubtitle v-if="description">
|
|
97
|
-
{{ description }}
|
|
98
|
-
</PageSubtitle>
|
|
99
|
-
</div>
|
|
100
|
-
<div class="flex items-center gap-2">
|
|
101
|
-
<ZButton
|
|
102
|
-
variant="outline"
|
|
103
|
-
size="icon"
|
|
104
|
-
:disabled="loading"
|
|
105
|
-
@click="load"
|
|
106
|
-
>
|
|
107
|
-
<Icon
|
|
108
|
-
name="RotateCcw"
|
|
109
|
-
:class="{ 'animate-spin': loading }"
|
|
110
|
-
/>
|
|
111
|
-
</ZButton>
|
|
112
|
-
<ClientOnly v-if="actions.includes('create')">
|
|
113
|
-
<DialogForm
|
|
114
|
-
:fetch
|
|
115
|
-
:title="$t('Add new')"
|
|
116
|
-
:description="$t('Fill in the details below to add a new repository')"
|
|
117
|
-
:fields="fields"
|
|
118
|
-
@submit="load"
|
|
119
|
-
>
|
|
120
|
-
<ZButton>
|
|
121
|
-
{{ $t('Add new') }}
|
|
122
|
-
</ZButton>
|
|
123
|
-
</DialogForm>
|
|
124
|
-
</ClientOnly>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<slot name="header-append" />
|
|
129
|
-
|
|
130
|
-
<DataTable
|
|
131
|
-
v-if="fetch"
|
|
132
|
-
ref="tableRef"
|
|
133
|
-
v-model:fetch-query="fetchQuery"
|
|
134
|
-
v-model:loading="loading"
|
|
135
|
-
v-model:columns="columns"
|
|
136
|
-
:fetch="fetch"
|
|
137
|
-
>
|
|
138
|
-
<template
|
|
139
|
-
v-for="c in columns.filter((c: any) => c.id !== 'actions')"
|
|
140
|
-
#[`row-${c.id}`]="slotProps"
|
|
141
|
-
:key="c.id"
|
|
142
|
-
>
|
|
143
|
-
<slot
|
|
144
|
-
:name="`row-${c.id}`"
|
|
145
|
-
v-bind="slotProps"
|
|
146
|
-
/>
|
|
147
|
-
</template>
|
|
148
|
-
|
|
149
|
-
<template #row-actions="{ row }">
|
|
150
|
-
<div class="flex items-center gap-2 justify-end">
|
|
151
|
-
<slot
|
|
152
|
-
name="prepend-actions"
|
|
153
|
-
:row="row"
|
|
154
|
-
/>
|
|
155
|
-
|
|
156
|
-
<ZButton
|
|
157
|
-
v-if="viewTo"
|
|
158
|
-
size="icon"
|
|
159
|
-
variant="ghost"
|
|
160
|
-
:to="parse(viewTo, row)"
|
|
161
|
-
>
|
|
162
|
-
<Icon name="Eye" />
|
|
163
|
-
</ZButton>
|
|
164
|
-
|
|
165
|
-
<DialogForm
|
|
166
|
-
v-if="actions.includes('edit')"
|
|
167
|
-
:fetch="parse(fetch + '/:id', row)"
|
|
168
|
-
:method="fetchUpdateMethod"
|
|
169
|
-
:title="$t('Edit')"
|
|
170
|
-
:description="$t('Fill in the details below to edit')"
|
|
171
|
-
:fields="fieldsEdit || fields"
|
|
172
|
-
:values="row"
|
|
173
|
-
@submit="load"
|
|
174
|
-
>
|
|
175
|
-
<ZButton
|
|
176
|
-
size="icon"
|
|
177
|
-
variant="ghost"
|
|
178
|
-
>
|
|
179
|
-
<Icon name="Edit" />
|
|
180
|
-
</ZButton>
|
|
181
|
-
</DialogForm>
|
|
182
|
-
|
|
183
|
-
<ZAlertButton
|
|
184
|
-
v-if="actions.includes('destroy')"
|
|
185
|
-
variant="ghost"
|
|
186
|
-
size="sm"
|
|
187
|
-
:fetch="parse(fetchDestroy || fetch, row)"
|
|
188
|
-
fetch-method="DELETE"
|
|
189
|
-
@fetched="load"
|
|
190
|
-
>
|
|
191
|
-
<Icon name="trash" />
|
|
192
|
-
</ZAlertButton>
|
|
193
|
-
</div>
|
|
194
|
-
</template>
|
|
195
|
-
</DataTable>
|
|
196
|
-
</div>
|
|
197
|
-
</template>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Base from '#shared/entities/PluginEntity.ts'
|
|
2
|
-
import router from '#client/facades/router.ts'
|
|
3
|
-
import { composeWith } from '#shared/utils/compose.ts'
|
|
4
|
-
import type { AutoOptions } from '#client/services/RouterService.ts'
|
|
5
|
-
|
|
6
|
-
export default class PluginEntity extends composeWith(Base) {
|
|
7
|
-
public addPagesFolder(imports: any, options?: AutoOptions) {
|
|
8
|
-
router.auto(imports, options)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public async load() {
|
|
12
|
-
// This method can be used to load additional data from the plugin's directory if needed
|
|
13
|
-
}
|
|
14
|
-
}
|