adminforth 2.4.0-next.26 → 2.4.0-next.261
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/cli.js +10 -3
- 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/utils.js +25 -8
- package/commands/createCustomComponent/configLoader.js +17 -4
- package/commands/createCustomComponent/main.js +1 -0
- package/commands/createCustomComponent/templates/customCrud/beforeActionButtons.vue.hbs +38 -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.map +1 -1
- package/dist/dataConnectors/baseConnector.js +46 -15
- 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 +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -9
- 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 +50 -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 +184 -19
- package/dist/modules/configValidator.js.map +1 -1
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +164 -26
- 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 +5 -4
- package/dist/spa/package.json +1 -1
- package/dist/spa/src/App.vue +58 -173
- package/dist/spa/src/adminforth.ts +42 -18
- 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 +12 -12
- package/dist/spa/src/afcl/Input.vue +5 -5
- 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 +68 -34
- package/dist/spa/src/afcl/Skeleton.vue +6 -6
- package/dist/spa/src/afcl/Table.vue +213 -74
- 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 +26 -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/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 -8
- package/dist/spa/src/components/ErrorMessage.vue +21 -0
- package/dist/spa/src/components/Filters.vue +85 -39
- 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 +90 -80
- package/dist/spa/src/components/ResourceListTableVirtual.vue +86 -76
- 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 +73 -14
- package/dist/spa/src/components/Toast.vue +27 -9
- package/dist/spa/src/components/UserMenuSettingsButton.vue +69 -0
- package/dist/spa/src/components/ValueRenderer.vue +43 -16
- package/dist/spa/src/controls/BoolToggle.vue +34 -0
- package/dist/spa/src/i18n.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 +29 -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 +158 -22
- package/dist/spa/src/types/Common.ts +81 -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 +279 -9
- package/dist/spa/src/views/CreateView.vue +18 -19
- package/dist/spa/src/views/EditView.vue +25 -19
- 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 +59 -39
- 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 +134 -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 +96 -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
|
@@ -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
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<form class="flex items-center justify-center w-full"
|
|
4
4
|
@dragover.prevent="dragging = true"
|
|
5
5
|
@dragleave.prevent="dragging = false"
|
|
6
|
-
@drop.prevent="dragging = false; doEmit($event.dataTransfer.files)"
|
|
6
|
+
@drop.prevent="dragging = false; doEmit(($event.dataTransfer as DataTransfer).files)"
|
|
7
7
|
>
|
|
8
|
-
<label :id="id" class="flex flex-col items-center justify-center w-full border-2 border-dashed rounded-lg cursor-pointer
|
|
9
|
-
hover:bg-
|
|
8
|
+
<label :id="id" class="flex flex-col items-center justify-center w-full border-2 border-dashed rounded-lg cursor-pointer
|
|
9
|
+
hover:bg-lightDropzoneBackgroundHover hover:border-lightDropzoneBorderHover dark:hover:border-darkDropzoneBorderHover dark:hover:bg-darkDropzoneBackgroundHover"
|
|
10
10
|
:class="{
|
|
11
|
-
'border-
|
|
12
|
-
'border-
|
|
13
|
-
'bg-
|
|
14
|
-
'bg-
|
|
11
|
+
'border-lightDropzoneBorderDragging dark:border-darkDropzoneBorderDragging': dragging,
|
|
12
|
+
'border-lightDropzoneBorder dark:border-darkDropzoneBorder': !dragging,
|
|
13
|
+
'bg-lightDropzoneBackgroundDragging dark:bg-darkDropzoneBackgroundDragging': dragging,
|
|
14
|
+
'bg-lightDropzoneBackground dark:bg-darkDropzoneBackground': !dragging,
|
|
15
15
|
'min-h-32 h-full': props.multiple,
|
|
16
16
|
'h-32': !props.multiple,
|
|
17
17
|
}"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
<div class="flex flex-col items-center justify-center pt-5 pb-6">
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
<svg v-if="!selectedFiles.length" class="w-8 h-8 mb-4 text-
|
|
22
|
+
<svg v-if="!selectedFiles.length" class="w-8 h-8 mb-4 text-lightDropzoneIcon dark:text-darkDropzoneIcon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 16">
|
|
23
23
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"/>
|
|
24
24
|
</svg>
|
|
25
25
|
<div v-else class="flex items-center justify-center flex-wrap gap-1 w-full mt-1 mb-4">
|
|
26
26
|
<template v-for="file in selectedFiles">
|
|
27
|
-
<p class="text-sm text-
|
|
27
|
+
<p class="text-sm text-lightDropzoneIcon dark:text-darkDropzoneIcon flex items-center gap-1">
|
|
28
28
|
<IconFileSolid class="w-5 h-5" />
|
|
29
29
|
{{ file.name }} ({{ humanifySize(file.size) }})
|
|
30
30
|
</p>
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
|
-
<p v-if="!selectedFiles.length" class="mb-2 text-sm text-
|
|
36
|
-
<p class="text-xs text-
|
|
35
|
+
<p v-if="!selectedFiles.length" class="mb-2 text-sm text-lightDropzoneText dark:text-darkDropzoneText"><span class="font-semibold">{{ $t('Click to upload') }}</span> {{ $t('or drag and drop') }}</p>
|
|
36
|
+
<p class="text-xs text-lightDropzoneText dark:text-darkDropzoneText">
|
|
37
37
|
{{ props.extensions.join(', ').toUpperCase().replace(/\./g, '') }}
|
|
38
38
|
<template v-if="props.maxSizeBytes">
|
|
39
39
|
(Max size: {{ humanifySize(props.maxSizeBytes) }})
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
<input :id="id" type="file" class="hidden"
|
|
44
44
|
:accept="props.extensions.join(', ')"
|
|
45
|
-
@change="doEmit($event.target.files)"
|
|
45
|
+
@change="$event.target && doEmit(($event.target as HTMLInputElement).files!)"
|
|
46
46
|
:multiple="props.multiple || false"
|
|
47
47
|
/>
|
|
48
48
|
</label>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="afcl-input-wrapper flex z-0 relative" :class="{'opacity-50' : readonly}">
|
|
4
4
|
<span
|
|
5
5
|
v-if="$slots.prefix || prefix"
|
|
6
|
-
class="inline-flex items-center px-3 text-sm text-
|
|
6
|
+
class="inline-flex items-center px-3 text-sm text-lightInputText bg-lightInputBackground border border-s-0 border-lightInputBorder rounded-s-md dark:bg-darkInputBackground dark:text-darkInputText dark:border-darkInputBorder">
|
|
7
7
|
<slot name="prefix">{{ prefix }}</slot>
|
|
8
8
|
</span>
|
|
9
9
|
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
ref="input"
|
|
13
13
|
v-bind="$attrs"
|
|
14
14
|
:type="type"
|
|
15
|
-
@input="$emit('update:modelValue', $event.target?.value)"
|
|
15
|
+
@input="$emit('update:modelValue', type === 'number' ? Number(($event.target as HTMLInputElement)?.value) : ($event.target as HTMLInputElement)?.value)"
|
|
16
16
|
:value="modelValue"
|
|
17
17
|
aria-describedby="helper-text-explanation"
|
|
18
|
-
class="afcl-input inline-flex bg-
|
|
19
|
-
blue-500 focus:border-blue-500 block w-20 p-2.5 dark:bg-
|
|
18
|
+
class="afcl-input inline-flex bg-lightInputBackground border border-lightInputBorder text-lightInputText text-sm rounded-0 focus:ring-lightPrimary focus:border-lightPrimary dark:focus:ring-darkPrimary dark:focus:border-darkPrimary
|
|
19
|
+
blue-500 focus:border-blue-500 block w-20 p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder placeholder-lightInputPlaceholderText dark:placeholder-darkInputPlaceholderText dark:text-darkInputText translate-y-0"
|
|
20
20
|
:class="{'rounded-l-md': !$slots.prefix && !prefix, 'rounded-r-md': !$slots.suffix && !suffix, 'w-full': fullWidth}"
|
|
21
21
|
:disabled="readonly"
|
|
22
22
|
>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
<span
|
|
28
28
|
v-if="$slots.suffix || suffix"
|
|
29
|
-
class="inline-flex items-center px-3 text-sm text-
|
|
29
|
+
class="inline-flex items-center px-3 text-sm text-lightInputText bg-lightInputBackground border border-s-0 border-lightInputBorder rounded-e-md dark:bg-darkInputBackground dark:text-darkInputText dark:border-darkInputBorder ">
|
|
30
30
|
<slot name="suffix">{{ suffix }}</slot>
|
|
31
31
|
</span>
|
|
32
32
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<JsonViewer
|
|
3
|
+
class="afcl-json-viewer min-w-[6rem]"
|
|
4
|
+
:value="value"
|
|
5
|
+
:expandDepth="expandDepth"
|
|
6
|
+
copyable
|
|
7
|
+
sort
|
|
8
|
+
:theme="currentTheme"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { computed } from 'vue'
|
|
14
|
+
import { JsonViewer } from 'vue3-json-viewer'
|
|
15
|
+
import { useCoreStore } from '@/stores/core'
|
|
16
|
+
|
|
17
|
+
defineProps<{
|
|
18
|
+
value: any
|
|
19
|
+
expandDepth?: number
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const coreStore = useCoreStore()
|
|
23
|
+
|
|
24
|
+
const currentTheme = computed(() => (coreStore.theme === 'dark' ? 'dark' : 'light'))
|
|
25
|
+
</script>
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
v-bind="$attrs"
|
|
4
4
|
:to="props.to"
|
|
5
5
|
type="submit"
|
|
6
|
-
class="afcl-link-button flex items-center justify-center gap-1 text-
|
|
7
|
-
focus:ring-4 focus:outline-none focus:ring-
|
|
6
|
+
class="afcl-link-button flex items-center justify-center gap-1 text-lightButtonsText bg-lightButtonsBackground border border-lightButtonsBorder dark:bg-darkButtonsBackground hover:bg-lightButtonsHover hover:border-lightButtonsBorderHover
|
|
7
|
+
focus:ring-4 focus:outline-none focus:ring-lightButtonFocusRing focus:ring-opacity-50 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:focus:ring-darkButtonFocusRing dark:text-darkButtonsText dark:border-darkButtonsBorder dark:hover:bg-darkButtonsHover dark:hover:border-darkButtonsBorderHover"
|
|
8
8
|
:class="{
|
|
9
9
|
'cursor-default': props.disabled,
|
|
10
10
|
'opacity-50': props.disabled,
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
|
|
20
20
|
const props = defineProps<{
|
|
21
|
-
disabled
|
|
21
|
+
disabled?: boolean,
|
|
22
22
|
to: string,
|
|
23
23
|
}>();
|
|
24
24
|
|
|
@@ -63,8 +63,8 @@ const optionsBase = {
|
|
|
63
63
|
show: false,
|
|
64
64
|
fontFamily: "Inter, sans-serif",
|
|
65
65
|
label: "",
|
|
66
|
-
formatter: function (w) {
|
|
67
|
-
const sum = w.globals.seriesTotals.reduce((a, b) => {
|
|
66
|
+
formatter: function (w: any) {
|
|
67
|
+
const sum = w.globals.seriesTotals.reduce((a: any, b: any) => {
|
|
68
68
|
return a + b
|
|
69
69
|
}, 0)
|
|
70
70
|
return sum
|
|
@@ -74,7 +74,7 @@ const optionsBase = {
|
|
|
74
74
|
show: true,
|
|
75
75
|
fontFamily: "Inter, sans-serif",
|
|
76
76
|
offsetY: -20,
|
|
77
|
-
formatter: function (value) {
|
|
77
|
+
formatter: function (value: any) {
|
|
78
78
|
return value + "k"
|
|
79
79
|
},
|
|
80
80
|
},
|
|
@@ -100,14 +100,14 @@ const optionsBase = {
|
|
|
100
100
|
},
|
|
101
101
|
yaxis: {
|
|
102
102
|
labels: {
|
|
103
|
-
formatter: function (value) {
|
|
103
|
+
formatter: function (value: any) {
|
|
104
104
|
return value;
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
xaxis: {
|
|
109
109
|
labels: {
|
|
110
|
-
formatter: function (value) {
|
|
110
|
+
formatter: function (value: any) {
|
|
111
111
|
return value;
|
|
112
112
|
},
|
|
113
113
|
},
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="relative mt-4 lg:mt-10 w-full max-w-[700px] bg-
|
|
3
|
-
<span class="absolute -top-6 left-0 text-sm text-
|
|
4
|
-
<span class="absolute -top-6 right-0 text-sm text-
|
|
2
|
+
<div class="relative mt-4 lg:mt-10 w-full max-w-[700px] bg-lightProgressBarUnfilledColor rounded-full h-2.5 dark:bg-darkProgressBarUnfilledColor">
|
|
3
|
+
<span class="absolute -top-6 left-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ leftLabel }}</span>
|
|
4
|
+
<span class="absolute -top-6 right-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ rightLabel }}</span>
|
|
5
5
|
<div
|
|
6
|
-
class="bg-
|
|
6
|
+
class="bg-lightProgressBarFilledColor dark:bg-darkProgressBarFilledColor h-2.5 rounded-full transition-all duration-300 ease-in-out"
|
|
7
7
|
:style="{ width: `${percentage}%` }"
|
|
8
8
|
></div>
|
|
9
|
-
<span v-if="showValues" class="absolute top-4 left-0 text-sm text-
|
|
10
|
-
<span v-if="showProgress" class="absolute top-4 right-1/2 translate-x-1/2 text-sm text-
|
|
11
|
-
<span v-if="showValues" class="absolute top-4 right-0 text-sm text-
|
|
9
|
+
<span v-if="showValues" class="absolute top-4 left-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ formatValue(minValue) }}</span>
|
|
10
|
+
<span v-if="showProgress" class="absolute top-4 right-1/2 translate-x-1/2 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ progressText }}</span>
|
|
11
|
+
<span v-if="showValues" class="absolute top-4 right-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ formatValue(maxValue) }}</span>
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|