@fishawack/lab-velocity 2.0.0-beta.3 → 2.0.0-beta.30
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/README.md +441 -37
- package/_Build/vue/components/basic/Button.vue +1 -1
- package/_Build/vue/components/form/Select.vue +2 -2
- package/_Build/vue/components/form/Spinner.vue +5 -0
- package/_Build/vue/components/layout/Alert.vue +5 -5
- package/_Build/vue/{modules/AuthModule/components/VBreadcrumbs.vue → components/layout/Breadcrumbs.vue} +4 -4
- package/_Build/vue/{modules/AuthModule/components → components/layout}/Chips.vue +2 -2
- package/_Build/vue/components/layout/Footer.vue +11 -10
- package/_Build/vue/{modules/AuthModule/components/VFormFooter.vue → components/layout/FormFooter.vue} +13 -7
- package/_Build/vue/{modules/AuthModule/components → components/layout}/FormRole.vue +10 -8
- package/_Build/vue/components/layout/Layout.vue +76 -0
- package/_Build/vue/components/layout/Navigation.vue +77 -0
- package/_Build/vue/{modules/AuthModule/components/VPageHeader.vue → components/layout/PageHeader.vue} +7 -2
- package/_Build/vue/components/layout/SideBar.vue +26 -0
- package/_Build/vue/{modules/AuthModule/components/VTable.vue → components/layout/Table.vue} +32 -16
- package/_Build/vue/{modules/AuthModule/components/VTableSorter.vue → components/layout/TableSorter.vue} +68 -43
- package/_Build/vue/components/layout/pageTitle.vue +1 -1
- package/_Build/vue/components/navigation/MenuItem.vue +7 -2
- package/_Build/vue/components/navigation/MenuItemGroup.vue +7 -2
- package/_Build/vue/modules/AuthModule/js/axios.js +19 -0
- package/_Build/vue/modules/AuthModule/js/router.js +28 -88
- package/_Build/vue/modules/AuthModule/js/store.js +15 -6
- package/_Build/vue/modules/AuthModule/{adminRoutes/PCompanies/Children/partials → routes/PCompanies}/form.vue +50 -18
- package/_Build/vue/modules/AuthModule/routes/PCompanies/resource.js +259 -0
- package/_Build/vue/modules/AuthModule/routes/PTeams/resource.js +308 -0
- package/_Build/vue/modules/AuthModule/{adminRoutes/PUsers/Children/partials → routes/PUsers}/form.vue +30 -18
- package/_Build/vue/modules/AuthModule/routes/PUsers/resource.js +215 -0
- package/_Build/vue/modules/AuthModule/routes/account-exists.vue +2 -2
- package/_Build/vue/modules/AuthModule/routes/change-password.vue +23 -24
- package/_Build/vue/modules/AuthModule/routes/container.vue +2 -11
- package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +4 -4
- package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +9 -8
- package/_Build/vue/modules/AuthModule/routes/force-reset.vue +24 -28
- package/_Build/vue/modules/AuthModule/routes/forgot.vue +4 -4
- package/_Build/vue/modules/AuthModule/routes/login.vue +7 -11
- package/_Build/vue/modules/AuthModule/routes/logincallback.vue +2 -4
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +7 -9
- package/_Build/vue/modules/AuthModule/routes/logout.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/register.vue +19 -21
- package/_Build/vue/modules/AuthModule/routes/reset.vue +14 -13
- package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +8 -7
- package/_Build/vue/modules/AuthModule/routes/success-reset.vue +2 -2
- package/_Build/vue/modules/AuthModule/routes/success-verify.vue +1 -3
- package/_Build/vue/modules/AuthModule/routes/verify.vue +11 -14
- package/_Build/vue/modules/resource/Children/create.vue +70 -0
- package/_Build/vue/modules/resource/Children/edit.vue +92 -0
- package/_Build/vue/modules/resource/Children/index.vue +42 -0
- package/_Build/vue/modules/resource/Children/partials/form.vue +57 -0
- package/_Build/vue/modules/resource/Children/show.vue +133 -0
- package/_Build/vue/modules/resource/index.js +486 -0
- package/_Build/vue/modules/resource/parent.vue +63 -0
- package/_base.scss +0 -1
- package/_defaults.scss +2 -13
- package/_variables.scss +9 -4
- package/components/_alert.scss +5 -0
- package/components/_auth.scss +163 -0
- package/components/_basic.scss +55 -0
- package/components/_breadcrumbs.scss +39 -0
- package/components/_button.scss +304 -0
- package/components/_cascader.scss +12 -0
- package/components/_checkbox.scss +41 -0
- package/components/_chip.scss +24 -0
- package/components/_collapse.scss +24 -0
- package/components/_datepicker.scss +52 -0
- package/components/_descriptions.scss +2 -0
- package/components/_footer.scss +47 -0
- package/components/_form.scss +24 -0
- package/components/_header.scss +30 -0
- package/components/_icon.scss +25 -0
- package/components/_inputNumber.scss +22 -0
- package/components/_layout.scss +56 -0
- package/components/_link.scss +44 -0
- package/components/_loader.scss +43 -0
- package/components/_menu.scss +112 -0
- package/components/_modal.scss +24 -0
- package/components/_pageTitle.scss +8 -0
- package/components/_permissionLegend.scss +18 -0
- package/components/_select.scss +29 -0
- package/components/_sidebar.scss +41 -0
- package/components/_switch.scss +14 -0
- package/components/_table.scss +20 -0
- package/components/_tooltip.scss +4 -0
- package/components/_typography.scss +162 -0
- package/components/_upload.scss +15 -0
- package/components/_wysiwyg.scss +7 -0
- package/components/_wysiwyg2.scss +142 -0
- package/index.js +9 -1
- package/package.json +4 -2
- package/vendor.scss +0 -1
- package/_Build/vue/components/layout/sideBar.vue +0 -25
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +0 -251
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +0 -62
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +0 -98
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +0 -90
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +0 -262
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +0 -36
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +0 -103
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +0 -112
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +0 -120
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +0 -36
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/AuthModal.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components → components/layout}/Chip.vue +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VPasswordValidation.vue → components/layout/PasswordValidation.vue} +0 -0
- /package/_Build/vue/{modules/AuthModule/components/VRoleLegend.vue → components/layout/RoleLegend.vue} +0 -0
package/README.md
CHANGED
|
@@ -10,65 +10,469 @@ Prevent code repetition.
|
|
|
10
10
|
|
|
11
11
|
## Getting started
|
|
12
12
|
|
|
13
|
+
### Requirements
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
"vue": "^3.3.4",
|
|
17
|
+
"vue-router": "^4.2.4",
|
|
18
|
+
"vuex": "^4.1.0",
|
|
19
|
+
"vuex-persistedstate": "^4.1.0"
|
|
20
|
+
"vue-loader": "^17.2.2"
|
|
21
|
+
```
|
|
22
|
+
|
|
13
23
|
### Install
|
|
14
24
|
|
|
15
25
|
```bash
|
|
16
26
|
npm install @fishawack/lab-velocity
|
|
17
27
|
```
|
|
18
28
|
|
|
19
|
-
|
|
29
|
+
## Hydrate Views
|
|
20
30
|
|
|
21
|
-
|
|
31
|
+
Frontend & Admin files to work with the Hydrate Module including routes, store, axios and components.
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
### Installation
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
### Configure axios
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
import "@fishawack/lab-velocity/AuthModule/js/AuthAxios.js";
|
|
37
|
+
##### script.js
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
```js
|
|
40
|
+
import { Auth } from "@fishawack/lab-velocity";
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
// Call in your boot method
|
|
43
|
+
Auth.Axios.setAxiosDefaults(process.env.APP_URL, router);
|
|
44
|
+
```
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
Add routes to createRouter call
|
|
46
|
+
### Configure router
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
configureRoutes(router);
|
|
48
|
+
##### router.js
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
```js
|
|
51
|
+
import { Auth } from "@fishawack/lab-velocity";
|
|
52
|
+
import store from "./store.js";
|
|
42
53
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
// ... initialize router
|
|
55
|
+
|
|
56
|
+
Auth.Router.beforeEach(router, store);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Configure routes
|
|
60
|
+
|
|
61
|
+
There are two different set of routes for the admin and the frontend.
|
|
62
|
+
|
|
63
|
+
##### routes.js
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import { Auth } from "@fishawack/lab-velocity";
|
|
50
67
|
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
[
|
|
69
|
+
// ... other routes
|
|
53
70
|
|
|
54
|
-
|
|
71
|
+
// End user routes for login, register, chang password etc
|
|
72
|
+
...Auth.Router.routes(node),
|
|
55
73
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
// Admin routes for headless login & managing users & companies
|
|
75
|
+
...Auth.Router.adminRoutes(node),
|
|
76
|
+
|
|
77
|
+
// ... wildcard 404 routes etc
|
|
78
|
+
];
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
You can override the default setup for companies & user resources by passing an optional second object to the `adminRoutes` method. See the [resources](#Resources) section below for available options.
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
...Auth.Router.adminRoutes(node, {
|
|
85
|
+
userResource: {
|
|
86
|
+
label: "Custom User label",
|
|
87
|
+
api: `/api/v2/users`,
|
|
60
88
|
}
|
|
61
|
-
|
|
89
|
+
})
|
|
90
|
+
```
|
|
62
91
|
|
|
63
|
-
|
|
92
|
+
### Configure store
|
|
64
93
|
|
|
65
|
-
|
|
94
|
+
##### store.js
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import { Auth } from "@fishawack/lab-velocity";
|
|
98
|
+
|
|
99
|
+
// Call in store
|
|
100
|
+
{
|
|
101
|
+
plugins: [
|
|
102
|
+
VuexPersistedState({
|
|
103
|
+
// ...
|
|
104
|
+
paths: ["auth.user"],
|
|
105
|
+
}),
|
|
106
|
+
],
|
|
107
|
+
|
|
108
|
+
modules: {
|
|
109
|
+
auth: Auth.Store,
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
// ...
|
|
113
|
+
}
|
|
114
|
+
```
|
|
66
115
|
|
|
67
|
-
|
|
68
|
-
HYDRATE_REDIRECT=(Default index if not configured)
|
|
69
|
-
HYDRATE_CONTACT=(Default mailto:EP@avalerehealth, Email for contact us button)
|
|
116
|
+
### Base Styles
|
|
70
117
|
|
|
71
|
-
|
|
118
|
+
@fishawack/lab-velocity extends @fishawack/lab-ui, for this reason you should replace the two references to variables & defaults with @fishawack/lab-velocity ones.
|
|
119
|
+
|
|
120
|
+
#### \_variables.scss
|
|
121
|
+
|
|
122
|
+
```sass
|
|
123
|
+
@import "@fishawack/lab-velocity/variables";
|
|
124
|
+
|
|
125
|
+
// Set global variables here, e.g $color6: red;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### \_defaults.scss
|
|
129
|
+
|
|
130
|
+
```sass
|
|
131
|
+
@use "variables";
|
|
132
|
+
@import "@fishawack/lab-velocity/defaults";
|
|
133
|
+
|
|
134
|
+
$colors: variables.dynamic("color", module-variables("variables"));
|
|
135
|
+
|
|
136
|
+
// Override lab-ui defaults here, e.g $button: $color6;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Route Styles
|
|
140
|
+
|
|
141
|
+
There are two different set of sass imports for the admin and the frontend routes.
|
|
142
|
+
|
|
143
|
+
#### Frontend
|
|
144
|
+
|
|
145
|
+
```sass
|
|
146
|
+
// Vendor imports / Lab-ui imports
|
|
147
|
+
@import "@fishawack/lab-ui/typography";
|
|
148
|
+
@import "@fishawack/lab-ui/grid";
|
|
149
|
+
@import "@fishawack/lab-ui/utilities";
|
|
150
|
+
@import "@fishawack/lab-ui/icon";
|
|
151
|
+
|
|
152
|
+
// Lab velocity
|
|
153
|
+
@import "@fishawack/lab-velocity/base";
|
|
154
|
+
@import "@fishawack/lab-velocity/components/basic";
|
|
155
|
+
@import "@fishawack/lab-velocity/components/button";
|
|
156
|
+
@import "@fishawack/lab-velocity/components/form";
|
|
157
|
+
@import "@fishawack/lab-velocity/components/auth";
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### Admin
|
|
161
|
+
|
|
162
|
+
##### vendor.scss
|
|
163
|
+
|
|
164
|
+
```sass
|
|
165
|
+
// Vendor imports / Lab-ui imports
|
|
166
|
+
@import "@fishawack/lab-ui/typography";
|
|
167
|
+
@import "@fishawack/lab-ui/grid";
|
|
168
|
+
@import "@fishawack/lab-ui/utilities";
|
|
169
|
+
@import "@fishawack/lab-ui/icon";
|
|
170
|
+
|
|
171
|
+
// Lab velocity
|
|
172
|
+
@import "@fishawack/lab-velocity/base";
|
|
173
|
+
@import "@fishawack/lab-velocity/components/pageTitle";
|
|
174
|
+
@import "@fishawack/lab-velocity/components/breadcrumbs";
|
|
175
|
+
@import "@fishawack/lab-velocity/components/table";
|
|
176
|
+
@import "@fishawack/lab-velocity/components/icon";
|
|
177
|
+
@import "@fishawack/lab-velocity/components/basic";
|
|
178
|
+
@import "@fishawack/lab-velocity/components/button";
|
|
179
|
+
@import "@fishawack/lab-velocity/components/form";
|
|
180
|
+
@import "@fishawack/lab-velocity/components/checkbox";
|
|
181
|
+
@import "@fishawack/lab-velocity/components/select";
|
|
182
|
+
@import "@fishawack/lab-velocity/components/loader";
|
|
183
|
+
@import "@fishawack/lab-velocity/components/permissionLegend";
|
|
184
|
+
@import "@fishawack/lab-velocity/components/chip";
|
|
185
|
+
@import "@fishawack/lab-velocity/components/header";
|
|
186
|
+
@import "@fishawack/lab-velocity/components/footer";
|
|
187
|
+
@import "@fishawack/lab-velocity/components/sidebar";
|
|
188
|
+
@import "@fishawack/lab-velocity/components/menu";
|
|
189
|
+
@import "@fishawack/lab-velocity/components/layout";
|
|
190
|
+
@import "element-plus/theme-chalk/el-tabs";
|
|
191
|
+
@import "element-plus/theme-chalk/el-tab-pane";
|
|
192
|
+
```
|
|
72
193
|
|
|
73
|
-
|
|
74
|
-
|
|
194
|
+
Lastly for the admin layout & navigation import & apply the Layout component to the app.vue within your project.
|
|
195
|
+
|
|
196
|
+
```vue
|
|
197
|
+
<template>
|
|
198
|
+
<main id="app">
|
|
199
|
+
<VelLayout>
|
|
200
|
+
<router-view />
|
|
201
|
+
</VelLayout>
|
|
202
|
+
</main>
|
|
203
|
+
</template>
|
|
204
|
+
|
|
205
|
+
<script>
|
|
206
|
+
import { Layout as VelLayout } from "@fishawack/lab-velocity";
|
|
207
|
+
export default {
|
|
208
|
+
components: {
|
|
209
|
+
VelLayout,
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
</script>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Icons
|
|
216
|
+
|
|
217
|
+
Ensure Content has Velocity pulled in & copy out the svg folder contents into the svg files within vue.
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"lftp": "ftp-fishawack.egnyte.com",
|
|
222
|
+
"location": "Shared/FW/Knutsford/Digital/Auto-Content/Lab/Velocity"
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### ENV VARS (frontend)
|
|
227
|
+
|
|
228
|
+
```env
|
|
229
|
+
# Descriptions
|
|
230
|
+
HYDRATE_LOGO Name of primary logo (default: example-logo)
|
|
231
|
+
HYDRATE_LOGO_REVERSE Name of the logo when color scheme is reversed (default: to HYDRATE_LOGO value if not provided)
|
|
232
|
+
HYDRATE_REDIRECT Name of the route name to redirect to after login (default: index)
|
|
233
|
+
HYDRATE_CONTACT Email for contact us button (default: mailto:det@avalerehealth.com)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Resources
|
|
237
|
+
|
|
238
|
+
To reduce the amount of template code needed you can import a fairly standard set of route files for index, show, create, edit & form via the resource module.
|
|
239
|
+
|
|
240
|
+
##### routes.js
|
|
241
|
+
|
|
242
|
+
```js
|
|
243
|
+
import { Resource } from "@fishawack/lab-velocity";
|
|
244
|
+
|
|
245
|
+
[
|
|
246
|
+
// ... other routes
|
|
247
|
+
...Resource.routes(node, "posts"),
|
|
248
|
+
];
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
A third optional object can be passed for meta data that contains all of the overrides to customize the full rendering of these resource files. The default meta object is below.
|
|
252
|
+
|
|
253
|
+
```js
|
|
254
|
+
// Name is the first param, properties is the optional second param
|
|
255
|
+
export function meta(name, properties = {}) {
|
|
256
|
+
const singular = properties.singular || name.slice(0, -1);
|
|
257
|
+
|
|
258
|
+
return merge(
|
|
259
|
+
{
|
|
260
|
+
name,
|
|
261
|
+
title: properties.title || name[0].toUpperCase() + name.slice(1),
|
|
262
|
+
singular,
|
|
263
|
+
label: singular,
|
|
264
|
+
multiLabel: name,
|
|
265
|
+
pageLink: name,
|
|
266
|
+
api: `/api/${name}`,
|
|
267
|
+
permissions: {
|
|
268
|
+
create: () => true,
|
|
269
|
+
edit: () => true,
|
|
270
|
+
},
|
|
271
|
+
searchable: {
|
|
272
|
+
value: "name",
|
|
273
|
+
label: `Search ${name}`,
|
|
274
|
+
},
|
|
275
|
+
form: {
|
|
276
|
+
component: null,
|
|
277
|
+
fields: () => ({}),
|
|
278
|
+
},
|
|
279
|
+
table: {
|
|
280
|
+
structure: [
|
|
281
|
+
{
|
|
282
|
+
key: "id",
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
description: {
|
|
287
|
+
structure: [
|
|
288
|
+
{
|
|
289
|
+
key: "id",
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
index: {
|
|
294
|
+
actions: [],
|
|
295
|
+
layout: [
|
|
296
|
+
(props) => {
|
|
297
|
+
const { resource } = props;
|
|
298
|
+
|
|
299
|
+
return h(VTableSorter, {
|
|
300
|
+
key: "PIndex",
|
|
301
|
+
"json-data": {
|
|
302
|
+
...resource,
|
|
303
|
+
tableStructure: resource.table.structure,
|
|
304
|
+
},
|
|
305
|
+
defaults: resource.defaults,
|
|
306
|
+
"fixed-height": false,
|
|
307
|
+
"display-edit-action":
|
|
308
|
+
resource.permissions.create(props),
|
|
309
|
+
});
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
},
|
|
313
|
+
show: {
|
|
314
|
+
actions: [],
|
|
315
|
+
layout: [
|
|
316
|
+
(props) => {
|
|
317
|
+
const { resource, model } = props;
|
|
318
|
+
|
|
319
|
+
return h(
|
|
320
|
+
ElDescriptions,
|
|
321
|
+
{
|
|
322
|
+
border: true,
|
|
323
|
+
column: 1,
|
|
324
|
+
},
|
|
325
|
+
resource.description.structure.map((item, index) =>
|
|
326
|
+
h(
|
|
327
|
+
ElDescriptionsItem,
|
|
328
|
+
{
|
|
329
|
+
key: index,
|
|
330
|
+
labelWidth: "20%",
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
label: () =>
|
|
334
|
+
item.label ||
|
|
335
|
+
item.key[0].toUpperCase() +
|
|
336
|
+
item.key.slice(1),
|
|
337
|
+
default: () =>
|
|
338
|
+
item.render
|
|
339
|
+
? h(item.render(props))
|
|
340
|
+
: model?.[item.key] || "",
|
|
341
|
+
},
|
|
342
|
+
),
|
|
343
|
+
),
|
|
344
|
+
);
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
defaults: "",
|
|
349
|
+
icon: `icon-${singular}`,
|
|
350
|
+
},
|
|
351
|
+
properties,
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Layout is an array of functions that return render functions
|
|
357
|
+
|
|
358
|
+
```js
|
|
359
|
+
import { h, resolveComponent } from "vue";
|
|
360
|
+
|
|
361
|
+
{
|
|
362
|
+
// ...
|
|
363
|
+
show: {
|
|
364
|
+
layout: [
|
|
365
|
+
({ model }) =>
|
|
366
|
+
h(resolveComponent("router-link"), {
|
|
367
|
+
class: "underline",
|
|
368
|
+
to: {
|
|
369
|
+
name: "companies.show",
|
|
370
|
+
params: { id: model.company_id },
|
|
371
|
+
},
|
|
372
|
+
text: model.company.name,
|
|
373
|
+
})
|
|
374
|
+
],
|
|
375
|
+
},
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
You can see above that the show & index route have a default render function returned for a table and description block. If you want to keep this you can grab the existing render function from the `defaultResource` export.
|
|
380
|
+
|
|
381
|
+
```js
|
|
382
|
+
import { defaultResource, meta } from "../../../resource/index.js";
|
|
383
|
+
|
|
384
|
+
{
|
|
385
|
+
// ...
|
|
386
|
+
index: {
|
|
387
|
+
layout: [
|
|
388
|
+
() => h("div", "I appear above"),
|
|
389
|
+
...defaultResource.index.layout,
|
|
390
|
+
() => h("div", "I appear below"),
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Structure arrays take objects. The objects require a key only but have other optional properties. A render function can also be passed to fully customize the rendering that happens.
|
|
397
|
+
|
|
398
|
+
```js
|
|
399
|
+
{
|
|
400
|
+
table: {
|
|
401
|
+
structure: [
|
|
402
|
+
{
|
|
403
|
+
key: "name",
|
|
404
|
+
sortable: true,
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
key: "role",
|
|
408
|
+
render: () => h("div", "Custom template"),
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
},
|
|
412
|
+
form: {
|
|
413
|
+
structure: [
|
|
414
|
+
{
|
|
415
|
+
key: "name",
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
key: "provider_name",
|
|
419
|
+
label: "Provider",
|
|
420
|
+
render: ({ model }) => h("span", model?.provider_name.label ?? ""),
|
|
421
|
+
initial: ({ model }) => model?.provider_name.value ?? null,
|
|
422
|
+
}
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Generally speaking the only different between admin routes tends to do the columns which within a model are shared. Because of this you can use the utility method `columns` to automatically build out the table, description & form fields using the following syntax.
|
|
429
|
+
|
|
430
|
+
```js
|
|
431
|
+
import { Resource } from "@fishawack/lab-velocity";
|
|
432
|
+
import { Checkbox as VelCheckbox } from "@fishawack/lab-velocity";
|
|
433
|
+
|
|
434
|
+
{
|
|
435
|
+
api: `/api/posts`,
|
|
436
|
+
icon: `icon-visibility`,
|
|
437
|
+
permissions: {
|
|
438
|
+
create: ({ $store }) => $store.getters.can("write personas"),
|
|
439
|
+
edit: ({ $store }) => $store.getters.can("write personas"),
|
|
440
|
+
},
|
|
441
|
+
...Resource.columns(
|
|
442
|
+
[
|
|
443
|
+
{
|
|
444
|
+
key: "name",
|
|
445
|
+
sortable: true,
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
key: "description",
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
key: "is_experimental",
|
|
452
|
+
label: "Experimental",
|
|
453
|
+
render: {
|
|
454
|
+
write: () => h(VelCheckbox),
|
|
455
|
+
},
|
|
456
|
+
initial: ({ model }) => model?.is_experimental ?? false,
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
key: "nested",
|
|
460
|
+
label: "Nested",
|
|
461
|
+
render: {
|
|
462
|
+
read: ({ model }) =>
|
|
463
|
+
h("span", model?.nested.name ?? ""),
|
|
464
|
+
},
|
|
465
|
+
initial: ({ model }) =>
|
|
466
|
+
model?.nested.id ?? null,
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
key: "client_id",
|
|
470
|
+
label: "Client id",
|
|
471
|
+
filter: {
|
|
472
|
+
form: true
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
),
|
|
477
|
+
},
|
|
478
|
+
```
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
<script>
|
|
12
12
|
import { ElAlert } from "element-plus";
|
|
13
13
|
export default {
|
|
14
|
-
name: "
|
|
14
|
+
name: "Alert",
|
|
15
|
+
|
|
16
|
+
components: {
|
|
17
|
+
ElAlert,
|
|
18
|
+
},
|
|
15
19
|
|
|
16
20
|
props: {
|
|
17
21
|
effect: {
|
|
@@ -30,9 +34,5 @@ export default {
|
|
|
30
34
|
default: true,
|
|
31
35
|
},
|
|
32
36
|
},
|
|
33
|
-
|
|
34
|
-
components: {
|
|
35
|
-
ElAlert,
|
|
36
|
-
},
|
|
37
37
|
};
|
|
38
38
|
</script>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="container px-6 tablet:px-4 mobile:px-2 mb-8 ml-0 mr-0">
|
|
4
4
|
<div class="grid__1/1">
|
|
5
5
|
<div class="flex items-center">
|
|
6
|
-
<
|
|
6
|
+
<VelBreadcrumbs :crumbs="items" />
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
|
-
import
|
|
14
|
+
import VelBreadcrumbs from "../navigation/Breadcrumbs.vue";
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
|
-
name: "
|
|
17
|
+
name: "Breadcrumbs",
|
|
18
18
|
components: {
|
|
19
|
-
|
|
19
|
+
VelBreadcrumbs,
|
|
20
20
|
},
|
|
21
21
|
|
|
22
22
|
props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="chips">
|
|
3
3
|
<template v-for="(item, index) in array" :key="item.name">
|
|
4
|
-
<
|
|
4
|
+
<VelChip
|
|
5
5
|
class="chip--round"
|
|
6
6
|
:name="item.name"
|
|
7
7
|
:label="`${item.label}${index < array.length - 1 ? ',' : ''}`"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<script>
|
|
14
14
|
export default {
|
|
15
15
|
components: {
|
|
16
|
-
|
|
16
|
+
VelChip: require("./Chip.vue").default,
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
props: {
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
<div class="vel-footer__bottom">
|
|
9
9
|
<div class="vel-footer__bottom__links">
|
|
10
10
|
<p class="color-0">©2025 Avalere Health.</p>
|
|
11
|
-
<
|
|
11
|
+
<VelLink
|
|
12
12
|
underline
|
|
13
13
|
class="color-0 ml"
|
|
14
14
|
href="https://avalerehealth.com/privacy-policy/"
|
|
15
15
|
target="_blank"
|
|
16
|
-
>Privacy Policy</
|
|
16
|
+
>Privacy Policy</VelLink
|
|
17
17
|
>
|
|
18
|
-
<
|
|
18
|
+
<VelLink
|
|
19
19
|
underline
|
|
20
20
|
class="color-0 ml"
|
|
21
21
|
href="https://avalerehealth.com/corporate-policies/"
|
|
22
22
|
target="_blank"
|
|
23
|
-
>Corporate policies and compliance</
|
|
23
|
+
>Corporate policies and compliance</VelLink
|
|
24
24
|
>
|
|
25
25
|
</div>
|
|
26
26
|
<div class="vel-footer__bottom__end">
|
|
27
27
|
<p class="color-0">Have a question?</p>
|
|
28
|
-
<
|
|
29
|
-
>Contact our Support Team</
|
|
28
|
+
<VelLink underline class="color-0 ml" :href="contact"
|
|
29
|
+
>Contact our Support Team</VelLink
|
|
30
30
|
>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
@@ -34,17 +34,18 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script>
|
|
37
|
-
import
|
|
37
|
+
import VelLink from "../basic/link.vue";
|
|
38
38
|
|
|
39
39
|
export default {
|
|
40
|
+
components: {
|
|
41
|
+
VelLink,
|
|
42
|
+
},
|
|
43
|
+
|
|
40
44
|
props: {
|
|
41
45
|
contact: {
|
|
42
46
|
required: true,
|
|
43
47
|
type: String,
|
|
44
48
|
},
|
|
45
49
|
},
|
|
46
|
-
components: {
|
|
47
|
-
elLink,
|
|
48
|
-
},
|
|
49
50
|
};
|
|
50
51
|
</script>
|