adminforth 2.4.0-next.31 → 2.4.0-next.310
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/commands/callTsProxy.js +14 -4
- package/commands/createApp/templates/api.ts.hbs +10 -0
- package/commands/createApp/templates/custom/tsconfig.json.hbs +2 -3
- package/commands/createApp/templates/index.ts.hbs +12 -1
- package/commands/createApp/templates/package.json.hbs +1 -1
- package/commands/createApp/templates/prisma.config.ts.hbs +8 -0
- package/commands/createApp/templates/schema.prisma.hbs +0 -1
- package/commands/createApp/utils.js +10 -0
- package/commands/createCustomComponent/configLoader.js +17 -4
- package/commands/createCustomComponent/main.js +13 -7
- package/commands/createCustomComponent/templates/customCrud/beforeActionButtons.vue.hbs +38 -0
- package/commands/createCustomComponent/templates/customCrud/saveButton.vue.hbs +28 -0
- package/commands/createPlugin/templates/custom/tsconfig.json.hbs +2 -5
- package/commands/createPlugin/templates/package.json.hbs +1 -1
- package/commands/generateModels.js +30 -22
- package/dist/auth.d.ts +9 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +21 -2
- package/dist/auth.js.map +1 -1
- package/dist/dataConnectors/baseConnector.d.ts +1 -1
- package/dist/dataConnectors/baseConnector.d.ts.map +1 -1
- package/dist/dataConnectors/baseConnector.js +69 -17
- package/dist/dataConnectors/baseConnector.js.map +1 -1
- package/dist/dataConnectors/clickhouse.d.ts.map +1 -1
- package/dist/dataConnectors/clickhouse.js +15 -0
- package/dist/dataConnectors/clickhouse.js.map +1 -1
- package/dist/dataConnectors/mongo.d.ts.map +1 -1
- package/dist/dataConnectors/mongo.js +50 -15
- package/dist/dataConnectors/mongo.js.map +1 -1
- package/dist/dataConnectors/mysql.d.ts.map +1 -1
- package/dist/dataConnectors/mysql.js +11 -0
- package/dist/dataConnectors/mysql.js.map +1 -1
- package/dist/dataConnectors/postgres.d.ts.map +1 -1
- package/dist/dataConnectors/postgres.js +43 -14
- package/dist/dataConnectors/postgres.js.map +1 -1
- package/dist/dataConnectors/sqlite.d.ts.map +1 -1
- package/dist/dataConnectors/sqlite.js +11 -0
- package/dist/dataConnectors/sqlite.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -22
- package/dist/index.js.map +1 -1
- package/dist/modules/codeInjector.d.ts +2 -0
- package/dist/modules/codeInjector.d.ts.map +1 -1
- package/dist/modules/codeInjector.js +62 -6
- package/dist/modules/codeInjector.js.map +1 -1
- package/dist/modules/configValidator.d.ts +6 -0
- package/dist/modules/configValidator.d.ts.map +1 -1
- package/dist/modules/configValidator.js +202 -25
- package/dist/modules/configValidator.js.map +1 -1
- package/dist/modules/restApi.d.ts +1 -1
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +172 -31
- package/dist/modules/restApi.js.map +1 -1
- package/dist/modules/styles.d.ts +499 -13
- package/dist/modules/styles.d.ts.map +1 -1
- package/dist/modules/styles.js +555 -31
- package/dist/modules/styles.js.map +1 -1
- package/dist/modules/utils.d.ts +7 -15
- package/dist/modules/utils.d.ts.map +1 -1
- package/dist/modules/utils.js +45 -68
- package/dist/modules/utils.js.map +1 -1
- package/dist/servers/express.d.ts +5 -0
- package/dist/servers/express.d.ts.map +1 -1
- package/dist/servers/express.js +40 -1
- package/dist/servers/express.js.map +1 -1
- package/dist/spa/index.html +1 -1
- package/dist/spa/package-lock.json +1208 -708
- package/dist/spa/package.json +34 -34
- package/dist/spa/src/App.vue +59 -174
- package/dist/spa/src/adminforth.ts +42 -18
- package/dist/spa/src/afcl/AreaChart.vue +0 -1
- package/dist/spa/src/afcl/BarChart.vue +2 -2
- package/dist/spa/src/afcl/Button.vue +6 -6
- package/dist/spa/src/afcl/ButtonGroup.vue +91 -0
- package/dist/spa/src/afcl/Card.vue +25 -0
- package/dist/spa/src/afcl/Checkbox.vue +21 -13
- package/dist/spa/src/afcl/CountryFlag.vue +4 -1
- package/dist/spa/src/{components/CustomDatePicker.vue → afcl/DatePicker.vue} +95 -9
- package/dist/spa/src/afcl/Dialog.vue +47 -27
- package/dist/spa/src/afcl/Dropzone.vue +127 -48
- package/dist/spa/src/afcl/Input.vue +14 -6
- package/dist/spa/src/afcl/JsonViewer.vue +25 -0
- package/dist/spa/src/afcl/LinkButton.vue +3 -3
- package/dist/spa/src/afcl/PieChart.vue +5 -5
- package/dist/spa/src/afcl/ProgressBar.vue +7 -7
- package/dist/spa/src/afcl/Select.vue +82 -34
- package/dist/spa/src/afcl/Skeleton.vue +6 -6
- package/dist/spa/src/afcl/Table.vue +315 -73
- package/dist/spa/src/afcl/Textarea.vue +31 -0
- package/dist/spa/src/afcl/Toggle.vue +32 -0
- package/dist/spa/src/afcl/Tooltip.vue +28 -18
- package/dist/spa/src/afcl/VerticalTabs.vue +16 -7
- package/dist/spa/src/afcl/index.ts +6 -3
- package/dist/spa/src/components/AcceptModal.vue +48 -14
- package/dist/spa/src/components/Breadcrumbs.vue +5 -5
- package/dist/spa/src/components/CallActionWrapper.vue +15 -0
- package/dist/spa/src/components/ColumnValueInput.vue +38 -18
- package/dist/spa/src/components/ColumnValueInputWrapper.vue +4 -3
- package/dist/spa/src/components/CustomDateRangePicker.vue +9 -8
- package/dist/spa/src/components/CustomRangePicker.vue +37 -21
- package/dist/spa/src/components/ErrorMessage.vue +21 -0
- package/dist/spa/src/components/Filters.vue +195 -132
- package/dist/spa/src/components/GroupsTable.vue +9 -8
- package/dist/spa/src/components/MenuLink.vue +90 -23
- package/dist/spa/src/components/ResourceForm.vue +94 -51
- package/dist/spa/src/components/ResourceListTable.vue +115 -85
- package/dist/spa/src/components/ResourceListTableVirtual.vue +114 -80
- package/dist/spa/src/components/ShowTable.vue +21 -15
- package/dist/spa/src/components/Sidebar.vue +470 -0
- package/dist/spa/src/components/SingleSkeletLoader.vue +6 -6
- package/dist/spa/src/components/SkeleteLoader.vue +3 -3
- package/dist/spa/src/components/ThreeDotsMenu.vue +84 -15
- package/dist/spa/src/components/Toast.vue +40 -29
- package/dist/spa/src/components/UserMenuSettingsButton.vue +69 -0
- package/dist/spa/src/components/ValueRenderer.vue +44 -17
- package/dist/spa/src/controls/BoolToggle.vue +34 -0
- package/dist/spa/src/i18n.ts +5 -3
- package/dist/spa/src/main.ts +1 -1
- package/dist/spa/src/renderers/CompactField.vue +1 -1
- package/dist/spa/src/renderers/CompactUUID.vue +1 -1
- package/dist/spa/src/router/index.ts +8 -0
- package/dist/spa/src/shims-vue.d.ts +5 -0
- package/dist/spa/src/spa_types/core.ts +13 -1
- package/dist/spa/src/stores/core.ts +13 -1
- package/dist/spa/src/stores/filters.ts +33 -2
- package/dist/spa/src/stores/modal.ts +6 -1
- package/dist/spa/src/stores/toast.ts +22 -3
- package/dist/spa/src/types/Back.ts +163 -23
- package/dist/spa/src/types/Common.ts +91 -32
- package/dist/spa/src/types/FrontendAPI.ts +31 -5
- package/dist/spa/src/types/adapters/CaptchaAdapter.ts +34 -0
- package/dist/spa/src/types/adapters/EmailAdapter.ts +2 -2
- package/dist/spa/src/types/adapters/ImageVisionAdapter.ts +30 -0
- package/dist/spa/src/types/adapters/KeyValueAdapter.ts +16 -0
- package/dist/spa/src/types/adapters/index.ts +8 -0
- package/dist/spa/src/utils.ts +291 -11
- package/dist/spa/src/views/CreateView.vue +63 -21
- package/dist/spa/src/views/EditView.vue +55 -22
- package/dist/spa/src/views/ListView.vue +144 -87
- package/dist/spa/src/views/LoginView.vue +26 -35
- package/dist/spa/src/views/ResourceParent.vue +2 -2
- package/dist/spa/src/views/SettingsView.vue +121 -0
- package/dist/spa/src/views/ShowView.vue +83 -53
- package/dist/spa/src/websocket.ts +6 -1
- package/dist/spa/tsconfig.app.json +1 -1
- package/dist/spa/vite.config.ts +45 -2
- package/dist/types/Back.d.ts +146 -14
- package/dist/types/Back.d.ts.map +1 -1
- package/dist/types/Back.js +15 -0
- package/dist/types/Back.js.map +1 -1
- package/dist/types/Common.d.ts +106 -29
- package/dist/types/Common.d.ts.map +1 -1
- package/dist/types/Common.js.map +1 -1
- package/dist/types/FrontendAPI.d.ts +31 -3
- package/dist/types/FrontendAPI.d.ts.map +1 -1
- package/dist/types/FrontendAPI.js.map +1 -1
- package/dist/types/adapters/CaptchaAdapter.d.ts +30 -0
- package/dist/types/adapters/CaptchaAdapter.d.ts.map +1 -0
- package/dist/types/adapters/CaptchaAdapter.js +5 -0
- package/dist/types/adapters/CaptchaAdapter.js.map +1 -0
- package/dist/types/adapters/EmailAdapter.d.ts +1 -1
- package/dist/types/adapters/ImageVisionAdapter.d.ts +25 -0
- package/dist/types/adapters/ImageVisionAdapter.d.ts.map +1 -0
- package/dist/types/adapters/ImageVisionAdapter.js +2 -0
- package/dist/types/adapters/ImageVisionAdapter.js.map +1 -0
- package/dist/types/adapters/KeyValueAdapter.d.ts +10 -0
- package/dist/types/adapters/KeyValueAdapter.d.ts.map +1 -0
- package/dist/types/adapters/KeyValueAdapter.js +2 -0
- package/dist/types/adapters/KeyValueAdapter.js.map +1 -0
- package/dist/types/adapters/index.d.ts +9 -0
- package/dist/types/adapters/index.d.ts.map +1 -0
- package/dist/types/adapters/index.js +2 -0
- package/dist/types/adapters/index.js.map +1 -0
- package/package.json +4 -2
- package/dist/spa/src/types/adapters/index.js +0 -5
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="isInitFinished" class="inline-flex rounded-md shadow-xs" role="group">
|
|
3
|
+
<button v-for="button in buttons" :key="`${button}-button-controll`"
|
|
4
|
+
:disabled="slotProps[button].disabled"
|
|
5
|
+
class="inline-flex items-center text-sm font-medium border-t border-b border-r border-lightButtonGroupBorder focus:z-10 focus:ring-2 dark:border-darkButtonGroupBorder disabled:opacity-50 disabled:cursor-not-allowed"
|
|
6
|
+
:class="[
|
|
7
|
+
buttonsStyles[button] === 'rounded' ? 'border rounded-lg'
|
|
8
|
+
: buttonsStyles[button] === 'rounded-left' ? 'border rounded-s-lg'
|
|
9
|
+
: buttonsStyles[button] === 'rounded-right' ? 'border rounded-e-lg border-l-lightButtonGroupBackground focus:border-l-lightButtonGroupBorder dark:border-l-darkButtonGroupBackground dark:focus:border-l-darkButtonGroupBorder'
|
|
10
|
+
: buttonsStyles[button] === 'no-rounded' ? 'border border-l-lightButtonGroupBackground focus:border-l-lightButtonGroupBorder dark:border-l-darkButtonGroupBackground dark:focus:border-l-darkButtonGroupBorder'
|
|
11
|
+
: buttonsStyles[button] === 'rounded-left-with-right-border' ? 'border rounded-s-lg' : '',
|
|
12
|
+
(button === activeButton || props.solidColor === true) ? 'bg-lightButtonGroupActiveBackground text-lightButtonGroupActiveText focus:ring-lightButtonGroupActiveFocusRing dark:bg-darkButtonGroupActiveBackground dark:text-darkButtonGroupActiveText dark:focus:ring-darkButtonGroupActiveFocusRing'
|
|
13
|
+
:'text-lightButtonGroupText bg-lightButtonGroupBackground focus:ring-lightButtonGroupFocusRing hover:bg-lightButtonGroupBackgroundHover hover:text-lightButtonGroupTextHover dark:bg-darkButtonGroupBackground dark:text-darkButtonGroupText dark:hover:text-darkButtonGroupTextHover dark:hover:bg-darkButtonGroupBackgroundHover dark:focus:ring-darkButtonGroupFocusRing'
|
|
14
|
+
]"
|
|
15
|
+
@click="setActiveButton(button)"
|
|
16
|
+
>
|
|
17
|
+
<slot :name="`button:${button}`"></slot>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import { onMounted, useSlots, reactive, ref, type Ref } from 'vue';
|
|
24
|
+
|
|
25
|
+
const buttons : Ref<string[]> = ref([]);
|
|
26
|
+
const buttonsStyles : Ref<Record<string, string>> = ref({});
|
|
27
|
+
const activeButton = ref('');
|
|
28
|
+
const slotProps = reactive<Record<string, any>>({});
|
|
29
|
+
const isInitFinished = ref(false);
|
|
30
|
+
|
|
31
|
+
const emits = defineEmits(['update:modelValue']);
|
|
32
|
+
|
|
33
|
+
const props = defineProps<{
|
|
34
|
+
solidColor?: boolean;
|
|
35
|
+
modelValue?: string;
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
onMounted(() => {
|
|
39
|
+
const slots = useSlots();
|
|
40
|
+
buttons.value = Object.keys(slots).reduce((tbs: string[], tb: string) => {
|
|
41
|
+
if (tb.startsWith('button:')) {
|
|
42
|
+
tbs.push(tb.replace('button:', ''));
|
|
43
|
+
}
|
|
44
|
+
return tbs;
|
|
45
|
+
}, []);
|
|
46
|
+
if (buttons.value.length > 0) {
|
|
47
|
+
activeButton.value = buttons.value[0];
|
|
48
|
+
}
|
|
49
|
+
for (const button of buttons.value) {
|
|
50
|
+
const temp = {
|
|
51
|
+
[button]: getButtonsClasses(button)
|
|
52
|
+
}
|
|
53
|
+
buttonsStyles.value = { ...buttonsStyles.value, ...temp };
|
|
54
|
+
const slot = slots[`button:${button}`];
|
|
55
|
+
if (slot && slot()[0]?.props) {
|
|
56
|
+
slotProps[button] = slot()[0].props;
|
|
57
|
+
} else {
|
|
58
|
+
slotProps[button] = {};
|
|
59
|
+
}
|
|
60
|
+
if (slotProps[button]?.disabled === undefined) {
|
|
61
|
+
slotProps[button].disabled = false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
isInitFinished.value = true;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
function setActiveButton(button: string) {
|
|
69
|
+
if (buttons.value.includes(button)) {
|
|
70
|
+
activeButton.value = button;
|
|
71
|
+
emits('update:modelValue', button);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function getButtonsClasses(button: string) {
|
|
76
|
+
const index = buttons.value.indexOf(button);
|
|
77
|
+
const lenght = buttons.value.length;
|
|
78
|
+
if ( lenght === 1 ) {
|
|
79
|
+
return 'rounded'
|
|
80
|
+
} else if ( lenght === 2 && index === 0 ) {
|
|
81
|
+
return 'rounded-left-with-right-border'
|
|
82
|
+
} else if ( index === 0 ) {
|
|
83
|
+
return 'rounded-left'
|
|
84
|
+
} else if ( index === lenght - 1 ) {
|
|
85
|
+
return 'rounded-right'
|
|
86
|
+
} else {
|
|
87
|
+
return 'no-rounded'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a href="#"
|
|
3
|
+
class="block max-w-sm bg-lightCardBackground border border-lightCardBorder rounded-lg shadow-sm hover:bg-lightCardBackgroundHover dark:bg-darkCardBackground dark:border-darkCardBorder dark:hover:bg-darkCardBackgroundHover"
|
|
4
|
+
:class="[
|
|
5
|
+
props.size === 'sm' ? 'p-2' : props.size === 'md' ? 'p-4' : 'p-6',
|
|
6
|
+
props.hideBorder ? 'border-0' : ''
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
<h5 class="font-bold tracking-tight text-lightCardTitle dark:text-darkCardTitle" :class="[props.size === 'sm' ? 'text-base' : props.size === 'md' ? 'text-lg mb-1' : 'text-xl mb-2']">{{ props.title }}</h5>
|
|
11
|
+
<p class="font-normal text-lightCardDescription dark:text-darkCardDescription" :class="[props.size === 'sm' ? 'text-sm' : props.size === 'md' ? 'text-base' : 'text-lg']">{{ props.description }}</p>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</a>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
size?: 'sm' | 'md' | 'lg';
|
|
22
|
+
hideBorder?: boolean;
|
|
23
|
+
}>();
|
|
24
|
+
|
|
25
|
+
</script>
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="afcl-checkbox flex items-center h-5" :class="{'opacity-50' : props.disabled}">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<div class="afcl-checkbox flex items-center relative h-5" :class="{'opacity-50' : props.disabled}">
|
|
3
|
+
<div class="flex items-center justify-center">
|
|
4
|
+
<input :id="id"
|
|
5
|
+
ref="rememberInput"
|
|
6
|
+
type="checkbox"
|
|
7
|
+
:checked="props.modelValue"
|
|
8
|
+
:disabled="props.disabled"
|
|
9
|
+
@change="$emit('update:modelValue', ($event.target as HTMLInputElement).checked)"
|
|
10
|
+
class="peer appearance-none min-w-4 min-h-4 bg-lightCheckboxBgUnchecked border border-lightCheckboxBorderColor rounded-sm checked:bg-lightCheckboxBgChecked
|
|
11
|
+
focus:ring-lightFocusRing dark:focus:ring-darkFocusRing dark:focus:ring-darkFocusRing
|
|
12
|
+
focus:ring-2 dark:bg-darkCheckboxBgUnchecked dark:border-darkCheckboxBorderColor dark:checked:bg-darkCheckboxBgChecked cursor-pointer"
|
|
13
|
+
>
|
|
14
|
+
<div class="pointer-events-none absolute text-lightCheckboxIconColor dark:text-darkCheckboxIconColor leading-none peer-checked:block hidden">
|
|
15
|
+
<IconCheckOutline class="w-[1.1rem] h-[1.1rem]" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<label :for="id" class="ms-2 text-sm font-medium text-lightTextLabel dark:text-darkTextLabel">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</label>
|
|
21
|
+
|
|
11
22
|
</div>
|
|
12
|
-
<label :for="id" class="ms-2 text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
13
|
-
<slot></slot>
|
|
14
|
-
</label>
|
|
15
23
|
</template>
|
|
16
24
|
|
|
17
25
|
<script setup lang="ts">
|
|
18
|
-
|
|
26
|
+
import { IconCheckOutline } from '@iconify-prerendered/vue-flowbite';
|
|
19
27
|
const props = defineProps({
|
|
20
28
|
modelValue: Boolean,
|
|
21
29
|
disabled: Boolean,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<div class="aspect-[4/3] w-8 h-6 flex items-center justify-center">
|
|
3
|
+
<component v-if="getFlagComponent(countryCode)" :is="getFlagComponent(countryCode)" class="flag-icon h-full object-contain rounded-sm"/>
|
|
3
4
|
<span v-else-if="countryCode">{{ countryCode }}</span>
|
|
5
|
+
</div>
|
|
4
6
|
</template>
|
|
5
7
|
|
|
6
8
|
<script setup lang="ts">
|
|
@@ -22,5 +24,6 @@ const getFlagComponent = (countryCode: string) => {
|
|
|
22
24
|
box-shadow: inset -0.3px -0.3px 0.3px 0px rgba(0 0 0 / 0.2),
|
|
23
25
|
inset 0.3px 0.3px 0.3px 0px rgba(255 255 255 / 0.2),
|
|
24
26
|
0px 0px 3px #00000030;
|
|
27
|
+
width: auto;
|
|
25
28
|
}
|
|
26
29
|
</style>
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div class="grid w-40 gap-4 mb-2">
|
|
4
4
|
<div>
|
|
5
|
-
<label v-if="label" for="start-time" class="block mb-2 text-sm font-medium text-
|
|
5
|
+
<label v-if="label" for="start-time" class="block mb-2 text-sm font-medium text-lightDatePickerButtonText dark:text-darkDatePickerButtonText">{{ label }}</label>
|
|
6
6
|
|
|
7
7
|
<div class="relative" :class="{hidden: column.type === 'time'}">
|
|
8
8
|
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
9
|
-
<IconCalendar class="w-4 h-4 text-
|
|
9
|
+
<IconCalendar class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon"/>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
12
|
<input ref="datepickerStartEl" type="text"
|
|
13
|
-
class="
|
|
13
|
+
class="af-pick-date-button bg-lightDatePickerButtonBackground border border-lightDatePickerButtonBorder text-lightDatePickerButtonText text-sm rounded-lg block w-full p-2.5 dark:bg-darkDatePickerButtonBackground dark:border-darkDatePickerButtonBorder dark:placeholder-darkInputPlaceholderText dark:text-darkDatePickerButtonText focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
|
|
14
14
|
:placeholder="$t('Select date')" :disabled="readonly" />
|
|
15
15
|
|
|
16
16
|
</div>
|
|
@@ -22,18 +22,17 @@
|
|
|
22
22
|
<div>
|
|
23
23
|
<div class="relative">
|
|
24
24
|
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
25
|
-
<IconTime class="w-4 h-4 text-
|
|
25
|
+
<IconTime class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
|
|
26
26
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white focus:ring-lightPrimary focus:border-lightPrimary dark:focus:ring-darkPrimary dark:focus:border-darkPrimary"
|
|
27
|
+
<input v-model="startTime" type="time" id="start-time" step="1"
|
|
28
|
+
class="af-pick-time-button bg-lightDatePickerButtonBackground border border-lightDatePickerButtonBorder text-lightDatePickerButtonText text-sm rounded-lg block w-full p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkDatePickerButtonText focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
|
|
30
29
|
value="00:00" :disabled="readonly" required/>
|
|
31
30
|
</div>
|
|
32
31
|
</div>
|
|
33
32
|
</div>
|
|
34
33
|
|
|
35
34
|
<button type="button"
|
|
36
|
-
class="text-
|
|
35
|
+
class="text-lightDatePickerExpandText dark:text-darkDatePickerExpandText text-base font-medium hover:underline p-0 inline-flex items-center mb-2"
|
|
37
36
|
:class="{hidden: column.type !== 'datetime'}"
|
|
38
37
|
@click="toggleTimeInputs">{{ showTimeInputs ? $t('Hide time') : $t('Show time') }}
|
|
39
38
|
<svg class="w-8 h-8 ms-0.5" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
|
|
@@ -197,4 +196,91 @@ function focus() {
|
|
|
197
196
|
defineExpose({
|
|
198
197
|
focus,
|
|
199
198
|
});
|
|
200
|
-
</script>
|
|
199
|
+
</script>
|
|
200
|
+
|
|
201
|
+
<style lang="css" scoped>
|
|
202
|
+
|
|
203
|
+
:global(.datepicker-controls button svg),
|
|
204
|
+
:global(.datepicker-controls button) {
|
|
205
|
+
@apply text-lightDatePickerCalendarText;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:global( .datepicker-dropdown ),
|
|
209
|
+
:global( .datepicker-picker ) {
|
|
210
|
+
@apply !bg-lightDatePickerCalendarBackground
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
:global(.datepicker-controls button:hover) {
|
|
214
|
+
@apply bg-lightDatePickerCalendarArrowButtonBackgroundHover;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
:global(.datepicker-controls button) {
|
|
218
|
+
@apply ring-lightDatePickerCalendarArrowButtonFocusRing bg-lightDatePickerCalendarArrowButtonBackground;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:global(.datepicker-controls button:focus) {
|
|
222
|
+
@apply ring-lightDatePickerCalendarArrowButtonFocusRing;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:global(.days-of-week span) {
|
|
226
|
+
@apply text-lightDatePickerCalendarDaysOfWeekText;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
:global(.datepicker-grid span) {
|
|
230
|
+
@apply text-lightDatePickerCalendarDateButtonText;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:global(.datepicker-grid span:hover:not(.selected)) {
|
|
234
|
+
@apply bg-lightDatePickerCalendarDateButtonBackgroundHover;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
:global(.datepicker-grid .selected ) {
|
|
238
|
+
@apply text-lightDatePickerCalendarDateActiveButtonText bg-lightDatePickerCalendarDateActiveButtonBackground;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
:global(.dark .datepicker-controls button svg),
|
|
249
|
+
:global(.dark .datepicker-controls button) {
|
|
250
|
+
@apply text-darkDatePickerCalendarMainText;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
:global(.dark .datepicker-dropdown),
|
|
254
|
+
:global(.dark .datepicker-picker) {
|
|
255
|
+
@apply !bg-darkDatePickerCalendarBackground;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:global(.dark .datepicker-controls button:hover) {
|
|
259
|
+
@apply bg-darkDatePickerCalendarArrowButtonBackgroundHover;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:global(.dark .datepicker-controls button) {
|
|
263
|
+
@apply ring-darkDatePickerCalendarArrowButtonFocusRing bg-darkDatePickerCalendarArrowButtonBackground;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
:global(.dark .datepicker-controls button) {
|
|
267
|
+
@apply ring-darkDatePickerCalendarArrowButtonFocusRing;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
:global(.dark .days-of-week span) {
|
|
271
|
+
@apply text-darkDatePickerCalendarDaysOfWeekText;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
:global(.dark .datepicker-grid span) {
|
|
275
|
+
@apply text-darkDatePickerCalendarDateButtonText;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
:global(.dark .datepicker-grid span:hover:not(.selected)) {
|
|
279
|
+
@apply bg-darkDatePickerCalendarDateButtonBackgroundHover;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:global(.dark .datepicker-grid .selected) {
|
|
283
|
+
@apply text-darkDatePickerCalendarDateActiveButtonText
|
|
284
|
+
bg-darkDatePickerCalendarDateActiveButtonBackground;
|
|
285
|
+
}
|
|
286
|
+
</style>
|
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
<slot name="trigger"></slot>
|
|
7
7
|
</div>
|
|
8
8
|
<Teleport to="body">
|
|
9
|
-
<div ref="modalEl" tabindex="-1" aria-hidden="true" class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-full max-h-full">
|
|
10
|
-
<div v-bind="$attrs" class="relative p-4 max-w-2xl max-h-full" :class="$attrs.class?.includes('w-') ? '' : 'w-full'">
|
|
9
|
+
<div ref="modalEl" tabindex="-1" aria-hidden="true" class="[scrollbar-gutter:stable] hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-full max-h-full">
|
|
10
|
+
<div v-bind="$attrs" class="relative p-4 max-w-2xl max-h-full" :class="($attrs.class as string)?.includes('w-') ? '' : 'w-full'">
|
|
11
11
|
<!-- Modal content -->
|
|
12
|
-
<div class="relative bg-
|
|
12
|
+
<div class="relative bg-lightDialogBackgorund rounded-lg shadow-sm dark:bg-darkDialogBackgorund">
|
|
13
13
|
<!-- Modal header -->
|
|
14
14
|
<div
|
|
15
15
|
v-if="header"
|
|
16
|
-
class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-
|
|
16
|
+
class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-darkDialogBreakLine border-lightDialogBreakLine"
|
|
17
17
|
>
|
|
18
|
-
<h3 class="text-xl font-semibold text-
|
|
18
|
+
<h3 class="text-xl font-semibold text-lightDialogHeaderText dark:text-darkDialogHeaderText">
|
|
19
19
|
{{ header }}
|
|
20
20
|
</h3>
|
|
21
21
|
<button
|
|
22
22
|
v-if="headerCloseButton"
|
|
23
23
|
type="button"
|
|
24
|
-
class="text-
|
|
24
|
+
class="text-lightDialogCloseButton bg-transparent hover:bg-lightDialogCloseButtonHoverBackground hover:text-lightDialogCloseButtonHover rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:text-darkDialogCloseButton dark:hover:bg-darkDialogCloseButtonHoverBackground dark:hover:text-darkDialogCloseButtonHover"
|
|
25
25
|
@click="modal?.hide()"
|
|
26
26
|
>
|
|
27
27
|
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
</button>
|
|
32
32
|
</div>
|
|
33
33
|
<!-- Modal body -->
|
|
34
|
-
<div class="p-4 md:p-5 space-y-4 text-
|
|
34
|
+
<div class="p-4 md:p-5 space-y-4 text-lightDialogBodyText dark:text-darkDialogBodyText">
|
|
35
35
|
<slot></slot>
|
|
36
36
|
</div>
|
|
37
37
|
<!-- Modal footer -->
|
|
38
38
|
<div
|
|
39
39
|
v-if="buttons.length"
|
|
40
|
-
class="flex items-center p-4 md:p-5 border-t border-
|
|
40
|
+
class="flex items-center p-4 md:p-5 border-t border-lightDialogBreakLine rounded-b dark:border-darkDialogBreakLine"
|
|
41
41
|
>
|
|
42
42
|
<Button
|
|
43
43
|
v-for="(button, buttonIndex) in buttons"
|
|
@@ -63,24 +63,33 @@ 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
|
+
options?: Record<string, any>
|
|
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
|
+
closable?: boolean
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const props = withDefaults(defineProps<DialogProps>(), {
|
|
83
|
+
header: '',
|
|
84
|
+
headerCloseButton: true,
|
|
85
|
+
buttons: () => [
|
|
86
|
+
{ label: 'Close', onclick: (dialog: any) => dialog.hide(), type: '' },
|
|
87
|
+
],
|
|
88
|
+
clickToCloseOutside: true,
|
|
89
|
+
beforeCloseFunction: null,
|
|
90
|
+
beforeOpenFunction: null,
|
|
91
|
+
closable: true,
|
|
92
|
+
})
|
|
84
93
|
|
|
85
94
|
onMounted(async () => {
|
|
86
95
|
//await one tick when all is mounted
|
|
@@ -88,8 +97,19 @@ onMounted(async () => {
|
|
|
88
97
|
modal.value = new Modal(
|
|
89
98
|
modalEl.value,
|
|
90
99
|
{
|
|
100
|
+
closable: props.closable,
|
|
91
101
|
backdrop: props.clickToCloseOutside ? 'dynamic' : 'static',
|
|
92
|
-
|
|
102
|
+
onHide: async () => {
|
|
103
|
+
if (props.beforeCloseFunction) {
|
|
104
|
+
await props.beforeCloseFunction();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
onShow: async () => {
|
|
108
|
+
if (props.beforeOpenFunction) {
|
|
109
|
+
await props.beforeOpenFunction();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
}
|
|
93
113
|
);
|
|
94
114
|
})
|
|
95
115
|
|