adminforth 2.4.0-next.117 → 2.4.0-next.119
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.
|
@@ -63,24 +63,31 @@ import { Modal } from 'flowbite';
|
|
|
63
63
|
const modalEl = ref(null);
|
|
64
64
|
const modal: Ref<Modal|null> = ref(null);
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
buttons
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
interface DialogButton {
|
|
67
|
+
label: string
|
|
68
|
+
onclick: (dialog: any) => void
|
|
69
|
+
type?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface DialogProps {
|
|
73
|
+
header?: string
|
|
74
|
+
headerCloseButton?: boolean
|
|
75
|
+
buttons?: DialogButton[]
|
|
76
|
+
clickToCloseOutside?: boolean
|
|
77
|
+
beforeCloseFunction?: (() => void | Promise<void>) | null
|
|
78
|
+
beforeOpenFunction?: (() => void | Promise<void>) | null
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const props = withDefaults(defineProps<DialogProps>(), {
|
|
82
|
+
header: '',
|
|
83
|
+
headerCloseButton: true,
|
|
84
|
+
buttons: () => [
|
|
85
|
+
{ label: 'Close', onclick: (dialog: any) => dialog.hide(), type: '' },
|
|
86
|
+
],
|
|
87
|
+
clickToCloseOutside: true,
|
|
88
|
+
beforeCloseFunction: null,
|
|
89
|
+
beforeOpenFunction: null,
|
|
90
|
+
})
|
|
84
91
|
|
|
85
92
|
onMounted(async () => {
|
|
86
93
|
//await one tick when all is mounted
|
|
@@ -89,7 +96,17 @@ onMounted(async () => {
|
|
|
89
96
|
modalEl.value,
|
|
90
97
|
{
|
|
91
98
|
backdrop: props.clickToCloseOutside ? 'dynamic' : 'static',
|
|
92
|
-
|
|
99
|
+
onHide: async () => {
|
|
100
|
+
if (props.beforeCloseFunction) {
|
|
101
|
+
await props.beforeCloseFunction();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
onShow: async () => {
|
|
105
|
+
if (props.beforeOpenFunction) {
|
|
106
|
+
await props.beforeOpenFunction();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
}
|
|
93
110
|
);
|
|
94
111
|
})
|
|
95
112
|
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
<ul class="py-2 text-sm text-lightThreeDotsMenuBodyText dark:text-darkThreeDotsMenuBodyText" aria-labelledby="dropdownMenuIconButton">
|
|
17
17
|
<li v-for="item in threeDotsDropdownItems" :key="`dropdown-item-${item.label}`">
|
|
18
18
|
<a href="#"
|
|
19
|
-
class="block px-4 py-2 hover:bg-lightThreeDotsMenuBodyBackgroundHover hover:text-lightThreeDotsMenuBodyTextHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
|
|
19
|
+
class="block px-4 py-2 hover:bg-lightThreeDotsMenuBodyBackgroundHover hover:text-lightThreeDotsMenuBodyTextHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
|
|
20
20
|
:class="{
|
|
21
|
-
'pointer-events-none':
|
|
22
|
-
'opacity-50':
|
|
23
|
-
'cursor-not-allowed':
|
|
21
|
+
'pointer-events-none': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
|
|
22
|
+
'opacity-50': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
|
|
23
|
+
'cursor-not-allowed': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
|
|
24
24
|
}">
|
|
25
25
|
<component :is="getCustomComponent(item)"
|
|
26
26
|
:meta="item.meta"
|
|
@@ -115,7 +115,6 @@ const readonlyColumns = ref([]);
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
async function onUpdateRecord(newRecord: any) {
|
|
118
|
-
console.log('newRecord', newRecord);
|
|
119
118
|
record.value = newRecord;
|
|
120
119
|
}
|
|
121
120
|
|
|
@@ -143,7 +142,6 @@ onMounted(async () => {
|
|
|
143
142
|
});
|
|
144
143
|
|
|
145
144
|
async function saveRecord() {
|
|
146
|
-
console.log('saveRecord isValid', isValid.value);
|
|
147
145
|
if (!isValid.value) {
|
|
148
146
|
validating.value = true;
|
|
149
147
|
return;
|