adminforth 1.0.66 → 1.0.68
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/index.js +20 -12
- package/dist/modules/codeInjector.js +12 -2
- package/dist/servers/express.js +1 -1
- package/dist/spa/index.html +2 -2
- package/dist/spa/package-lock.json +1 -189
- package/dist/spa/package.json +1 -6
- package/dist/spa/spa/index.html +2 -2
- package/dist/spa/spa/package-lock.json +4 -4
- package/dist/spa/spa/package.json +1 -1
- package/dist/spa/spa/public/favicon.png +0 -0
- package/dist/spa/spa/src/App.vue +48 -20
- package/dist/spa/spa/src/assets/logo.svg +19 -1
- package/dist/spa/spa/src/components/ShowTableItem.vue +14 -0
- package/dist/spa/spa/src/router/index.ts +12 -5
- package/dist/spa/spa/src/stores/core.ts +3 -2
- package/dist/spa/spa/src/views/CreateView.vue +1 -1
- package/dist/spa/spa/src/views/EditView.vue +1 -1
- package/dist/spa/spa/src/views/HomeView.vue +8 -0
- package/dist/spa/spa/src/views/ListView.vue +2 -2
- package/dist/spa/spa/src/views/ShowView.vue +1 -1
- package/dist/spa/spa/vite.config.ts +6 -0
- package/dist/spa/src/App.vue +57 -76
- package/dist/spa/src/components/AcceptModal.vue +1 -1
- package/dist/spa/src/components/CustomDatePicker.vue +3 -3
- package/dist/spa/src/components/CustomDateRangePicker.vue +3 -3
- package/dist/spa/src/components/Dropdown.vue +4 -13
- package/dist/spa/src/components/Filters.vue +22 -55
- package/dist/spa/src/components/MenuLink.vue +2 -2
- package/dist/spa/src/components/ResourceForm.vue +99 -157
- package/dist/spa/src/components/ValueRenderer.vue +1 -11
- package/dist/spa/src/router/index.ts +2 -3
- package/dist/spa/src/stores/core.ts +33 -22
- package/dist/spa/src/utils.ts +3 -5
- package/dist/spa/src/views/CreateView.vue +7 -15
- package/dist/spa/src/views/EditView.vue +8 -36
- package/dist/spa/src/views/HomeView.vue +8 -0
- package/dist/spa/src/views/ListView.vue +23 -35
- package/dist/spa/src/views/LoginView.vue +1 -1
- package/dist/spa/src/views/ResourceParent.vue +1 -1
- package/dist/spa/src/views/ShowView.vue +9 -20
- package/dist/spa/tailwind.config.js +2 -5
- package/documentation/docusaurus.config.ts +2 -2
- package/documentation/sidebars.ts +1 -1
- package/index.ts +23 -13
- package/modules/codeInjector.ts +12 -2
- package/package.json +1 -1
- package/servers/express.ts +1 -1
- package/spa/index.html +2 -2
- package/spa/package-lock.json +4 -4
- package/spa/package.json +1 -1
- package/spa/public/favicon.png +0 -0
- package/spa/src/App.vue +48 -20
- package/spa/src/assets/logo.svg +19 -1
- package/spa/src/router/index.ts +12 -5
- package/spa/src/stores/core.ts +3 -2
- package/spa/src/views/CreateView.vue +1 -1
- package/spa/src/views/EditView.vue +1 -1
- package/spa/src/views/ListView.vue +2 -2
- package/spa/src/views/ShowView.vue +1 -1
- package/spa/vite.config.ts +6 -0
- package/types/AdminForthConfig.ts +10 -3
- package/dist/spa/src/components/CustomRangePicker.vue +0 -148
- package/spa/public/favicon.ico +0 -0
package/spa/src/stores/core.ts
CHANGED
|
@@ -66,7 +66,7 @@ export const useCoreStore = defineStore('core', () => {
|
|
|
66
66
|
resourceOptions.value = respData.options;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
async function
|
|
69
|
+
async function fetchResourceFull({ resourceId }) {
|
|
70
70
|
if (resourceColumnsId.value === resourceId && resourceColumns.value) {
|
|
71
71
|
// already fetched
|
|
72
72
|
return;
|
|
@@ -86,6 +86,7 @@ export const useCoreStore = defineStore('core', () => {
|
|
|
86
86
|
resourceColumnsError.value = res.error;
|
|
87
87
|
} else {
|
|
88
88
|
resourceColumns.value = res.resource.columns;
|
|
89
|
+
resourceById.value[resourceId] = res.resource;
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -126,7 +127,7 @@ export const useCoreStore = defineStore('core', () => {
|
|
|
126
127
|
fetchRecord,
|
|
127
128
|
record,
|
|
128
129
|
resourceColumns,
|
|
129
|
-
|
|
130
|
+
fetchResourceFull,
|
|
130
131
|
resourceColumnsError,
|
|
131
132
|
flowBitIsInitialised,
|
|
132
133
|
resourceOptions,
|
|
@@ -71,7 +71,7 @@ async function onUpdateRecord(newRecord) {
|
|
|
71
71
|
|
|
72
72
|
onMounted(async () => {
|
|
73
73
|
loading.value = true;
|
|
74
|
-
await coreStore.
|
|
74
|
+
await coreStore.fetchResourceFull({
|
|
75
75
|
resourceId: route.params.resourceId
|
|
76
76
|
});
|
|
77
77
|
createComponentsPerColumn = coreStore.resourceColumns.reduce((acc, column) => {
|
|
@@ -377,7 +377,7 @@ async function selectAll(value) {
|
|
|
377
377
|
// checkboxes.value = rows.value.map((v) => v.id);
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
-
const pageSize = computed(() => coreStore.resourceById[route.params.resourceId]?.
|
|
380
|
+
const pageSize = computed(() => coreStore.resourceById[route.params.resourceId]?.options?.listPageSize || DEFAULT_PAGE_SIZE);
|
|
381
381
|
const totalPages = computed(() => Math.ceil(totalRows.value / pageSize.value));
|
|
382
382
|
let listComponentsPerColumn = {};
|
|
383
383
|
const allFromThisPageChecked = computed(() => {
|
|
@@ -510,7 +510,7 @@ function addToCheckedValues(id) {
|
|
|
510
510
|
|
|
511
511
|
async function init() {
|
|
512
512
|
|
|
513
|
-
await coreStore.
|
|
513
|
+
await coreStore.fetchResourceFull({
|
|
514
514
|
resourceId: route.params.resourceId
|
|
515
515
|
});
|
|
516
516
|
|
package/spa/vite.config.ts
CHANGED
|
@@ -11,6 +11,9 @@ export type AdminForthConfigMenuItem = {
|
|
|
11
11
|
open?: boolean,
|
|
12
12
|
children?: Array<AdminForthConfigMenuItem>,
|
|
13
13
|
isStaticRoute?: boolean,
|
|
14
|
+
meta?: {
|
|
15
|
+
title?: string,
|
|
16
|
+
},
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
|
|
@@ -79,6 +82,7 @@ export type AdminForthResource = {
|
|
|
79
82
|
}>,
|
|
80
83
|
allowedActions?: AllowedActions,
|
|
81
84
|
allowDelete?: boolean,
|
|
85
|
+
listPageSize?: number,
|
|
82
86
|
},
|
|
83
87
|
}
|
|
84
88
|
|
|
@@ -107,12 +111,15 @@ export type AdminForthConfig = {
|
|
|
107
111
|
customComponentsDir?: string,
|
|
108
112
|
vueUsesFile?: string,
|
|
109
113
|
customPublicDir?: string,
|
|
114
|
+
brandName?: string,
|
|
115
|
+
datesFormat?: string,
|
|
116
|
+
title?: string,
|
|
117
|
+
brandLogo?: string,
|
|
110
118
|
},
|
|
111
119
|
baseUrl?: string,
|
|
112
|
-
|
|
113
|
-
datesFormat?: string,
|
|
120
|
+
|
|
114
121
|
deleteConfirmation?: boolean,
|
|
115
|
-
|
|
122
|
+
|
|
116
123
|
styles?: Object,
|
|
117
124
|
}
|
|
118
125
|
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex flex-wrap gap-2">
|
|
3
|
-
<input
|
|
4
|
-
type="number" aria-describedby="helper-text-explanation"
|
|
5
|
-
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
6
|
-
placeholder="From"
|
|
7
|
-
v-model="start"
|
|
8
|
-
>
|
|
9
|
-
|
|
10
|
-
<input
|
|
11
|
-
type="number" aria-describedby="helper-text-explanation"
|
|
12
|
-
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-20 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
13
|
-
placeholder="To"
|
|
14
|
-
v-model="end"
|
|
15
|
-
>
|
|
16
|
-
|
|
17
|
-
<button
|
|
18
|
-
v-if="isChanged"
|
|
19
|
-
type="button"
|
|
20
|
-
class="flex items-center p-0.5 ml-auto px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
21
|
-
@click="clear">Clear
|
|
22
|
-
</button>
|
|
23
|
-
|
|
24
|
-
<div class="w-full">
|
|
25
|
-
<vue-slider
|
|
26
|
-
class="custom-slider"
|
|
27
|
-
:dot-size="20"
|
|
28
|
-
height="7.99px"
|
|
29
|
-
:min="minFormatted"
|
|
30
|
-
:max="maxFormatted"
|
|
31
|
-
v-model="sliderValue"
|
|
32
|
-
@update:model-value="updateFromSlider($event)"
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
<script setup lang="ts">
|
|
38
|
-
import VueSlider from 'vue-slider-component';
|
|
39
|
-
import 'vue-slider-component/theme/antd.css'
|
|
40
|
-
import {computed, onMounted, ref, watch} from "vue";
|
|
41
|
-
import debounce from 'debounce'
|
|
42
|
-
|
|
43
|
-
const props = defineProps({
|
|
44
|
-
valueStart: {
|
|
45
|
-
default: '',
|
|
46
|
-
},
|
|
47
|
-
valueEnd: {
|
|
48
|
-
default: '',
|
|
49
|
-
},
|
|
50
|
-
min: {
|
|
51
|
-
default: 0,
|
|
52
|
-
},
|
|
53
|
-
max: {
|
|
54
|
-
default: 10,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const emit = defineEmits(['update:valueStart', 'update:valueEnd']);
|
|
59
|
-
|
|
60
|
-
const minFormatted = computed(() => Math.floor(props.min));
|
|
61
|
-
const maxFormatted = computed(() => Math.ceil(props.max));
|
|
62
|
-
|
|
63
|
-
const isChanged = computed(() => {
|
|
64
|
-
return start.value && start.value !== minFormatted.value || end.value && end.value !== maxFormatted.value;
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const start = ref(props.valueStart);
|
|
68
|
-
const end = ref(props.valueEnd);
|
|
69
|
-
|
|
70
|
-
const sliderValue = ref([minFormatted.value, maxFormatted.value]);
|
|
71
|
-
|
|
72
|
-
const updateFromSlider =
|
|
73
|
-
debounce((value: [number, number]) => {
|
|
74
|
-
start.value = value[0] === minFormatted.value ? '': value[0];
|
|
75
|
-
end.value = value[1] === maxFormatted.value ? '': value[1];
|
|
76
|
-
}, 500);
|
|
77
|
-
|
|
78
|
-
onMounted(() => {
|
|
79
|
-
updateStartFromProps();
|
|
80
|
-
updateEndFromProps();
|
|
81
|
-
|
|
82
|
-
watch(() => props.valueStart, (value) => {
|
|
83
|
-
updateStartFromProps();
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
watch(() => props.valueEnd, (value) => {
|
|
87
|
-
updateEndFromProps();
|
|
88
|
-
});
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
function updateStartFromProps() {
|
|
92
|
-
start.value = props.valueStart;
|
|
93
|
-
setSliderValues(start.value, end.value)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function updateEndFromProps() {
|
|
97
|
-
end.value = props.valueEnd;
|
|
98
|
-
setSliderValues(start.value, end.value)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
watch(start, () => {
|
|
102
|
-
console.log('⚡ emit', start.value)
|
|
103
|
-
emit('update:valueStart', start.value)
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
watch(end, () => {
|
|
107
|
-
console.log('⚡ emit', end.value)
|
|
108
|
-
emit('update:valueEnd', end.value);
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
const clear = () => {
|
|
112
|
-
start.value = ''
|
|
113
|
-
end.value = ''
|
|
114
|
-
setSliderValues('', '')
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function setSliderValues(start, end) {
|
|
118
|
-
sliderValue.value = [start || minFormatted.value, end || maxFormatted.value];
|
|
119
|
-
}
|
|
120
|
-
</script>
|
|
121
|
-
|
|
122
|
-
<style lang="scss" scoped>
|
|
123
|
-
.custom-slider {
|
|
124
|
-
&:deep(.vue-slider-rail) {
|
|
125
|
-
background-color: rgb(229 231 235);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
&:deep(.vue-slider-dot-handle) {
|
|
129
|
-
background-color: #1c64f2;
|
|
130
|
-
border: none;
|
|
131
|
-
box-shadow: none;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&:deep(.vue-slider-dot-handle:hover) {
|
|
135
|
-
background-color: #1c64f2;
|
|
136
|
-
border: none;
|
|
137
|
-
box-shadow: none;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&:deep(.vue-slider-process) {
|
|
141
|
-
background-color: rgb(225 239 254);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&:deep(.vue-slider-process:hover) {
|
|
145
|
-
background-color: rgb(225 239 254);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
</style>
|
package/spa/public/favicon.ico
DELETED
|
Binary file
|