@groupteknology/vuno 0.6.1 → 1.0.0
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 +118 -40
- package/dist/module.d.cts +2 -0
- package/dist/module.d.mts +2 -10
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -30
- package/dist/types.d.mts +11 -3
- package/package.json +47 -45
- package/dist/runtime/app/assets/css/main.css +0 -1
- package/dist/runtime/app/components/App/App.d.vue.ts +0 -33
- package/dist/runtime/app/components/App/App.vue +0 -127
- package/dist/runtime/app/components/App/App.vue.d.ts +0 -33
- package/dist/runtime/app/components/App/AppContext.d.vue.ts +0 -3
- package/dist/runtime/app/components/App/AppContext.vue +0 -7
- package/dist/runtime/app/components/App/AppContext.vue.d.ts +0 -3
- package/dist/runtime/app/components/App/AppModal.d.vue.ts +0 -38
- package/dist/runtime/app/components/App/AppModal.vue +0 -103
- package/dist/runtime/app/components/App/AppModal.vue.d.ts +0 -38
- package/dist/runtime/app/components/App/AppOverlay.d.vue.ts +0 -7
- package/dist/runtime/app/components/App/AppOverlay.vue +0 -33
- package/dist/runtime/app/components/App/AppOverlay.vue.d.ts +0 -7
- package/dist/runtime/app/components/App/AppToast.d.vue.ts +0 -11
- package/dist/runtime/app/components/App/AppToast.vue +0 -53
- package/dist/runtime/app/components/App/AppToast.vue.d.ts +0 -11
- package/dist/runtime/app/components/App/AppToaster.d.vue.ts +0 -11
- package/dist/runtime/app/components/App/AppToaster.vue +0 -49
- package/dist/runtime/app/components/App/AppToaster.vue.d.ts +0 -11
- package/dist/runtime/app/components/Cell/CellBadge.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellBadge.vue +0 -24
- package/dist/runtime/app/components/Cell/CellBadge.vue.d.ts +0 -5
- package/dist/runtime/app/components/Cell/CellBoolean.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellBoolean.vue +0 -21
- package/dist/runtime/app/components/Cell/CellBoolean.vue.d.ts +0 -5
- package/dist/runtime/app/components/Cell/CellCurrency.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellCurrency.vue +0 -14
- package/dist/runtime/app/components/Cell/CellCurrency.vue.d.ts +0 -5
- package/dist/runtime/app/components/Cell/CellDate.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellDate.vue +0 -19
- package/dist/runtime/app/components/Cell/CellDate.vue.d.ts +0 -5
- package/dist/runtime/app/components/Cell/CellImage.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellImage.vue +0 -22
- package/dist/runtime/app/components/Cell/CellImage.vue.d.ts +0 -5
- package/dist/runtime/app/components/Cell/CellNumber.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellNumber.vue +0 -15
- package/dist/runtime/app/components/Cell/CellNumber.vue.d.ts +0 -5
- package/dist/runtime/app/components/Cell/CellText.d.vue.ts +0 -5
- package/dist/runtime/app/components/Cell/CellText.vue +0 -13
- package/dist/runtime/app/components/Cell/CellText.vue.d.ts +0 -5
- package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +0 -35
- package/dist/runtime/app/components/Confirm/Confirm.vue +0 -75
- package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +0 -35
- package/dist/runtime/app/components/Field/FieldArray.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldArray.vue +0 -128
- package/dist/runtime/app/components/Field/FieldArray.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldCheckbox.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldCheckbox.vue +0 -30
- package/dist/runtime/app/components/Field/FieldCheckbox.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldColor.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldColor.vue +0 -57
- package/dist/runtime/app/components/Field/FieldColor.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldEmail.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldEmail.vue +0 -37
- package/dist/runtime/app/components/Field/FieldEmail.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldFile.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldFile.vue +0 -93
- package/dist/runtime/app/components/Field/FieldFile.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldNumber.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldNumber.vue +0 -38
- package/dist/runtime/app/components/Field/FieldNumber.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldPassword.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldPassword.vue +0 -35
- package/dist/runtime/app/components/Field/FieldPassword.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldRadio.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldRadio.vue +0 -33
- package/dist/runtime/app/components/Field/FieldRadio.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldSelect.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldSelect.vue +0 -38
- package/dist/runtime/app/components/Field/FieldSelect.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldSlug.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldSlug.vue +0 -92
- package/dist/runtime/app/components/Field/FieldSlug.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldSwitch.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldSwitch.vue +0 -27
- package/dist/runtime/app/components/Field/FieldSwitch.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldText.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldText.vue +0 -38
- package/dist/runtime/app/components/Field/FieldText.vue.d.ts +0 -5
- package/dist/runtime/app/components/Field/FieldTextarea.d.vue.ts +0 -5
- package/dist/runtime/app/components/Field/FieldTextarea.vue +0 -36
- package/dist/runtime/app/components/Field/FieldTextarea.vue.d.ts +0 -5
- package/dist/runtime/app/components/Form/Form.d.vue.ts +0 -48
- package/dist/runtime/app/components/Form/Form.vue +0 -150
- package/dist/runtime/app/components/Form/Form.vue.d.ts +0 -48
- package/dist/runtime/app/components/Form/FormField.d.vue.ts +0 -7
- package/dist/runtime/app/components/Form/FormField.vue +0 -63
- package/dist/runtime/app/components/Form/FormField.vue.d.ts +0 -7
- package/dist/runtime/app/components/Form/FormModal.d.vue.ts +0 -60
- package/dist/runtime/app/components/Form/FormModal.vue +0 -91
- package/dist/runtime/app/components/Form/FormModal.vue.d.ts +0 -60
- package/dist/runtime/app/components/Form/FormSection.d.vue.ts +0 -12
- package/dist/runtime/app/components/Form/FormSection.vue +0 -43
- package/dist/runtime/app/components/Form/FormSection.vue.d.ts +0 -12
- package/dist/runtime/app/components/Page/Page.d.vue.ts +0 -24
- package/dist/runtime/app/components/Page/Page.vue +0 -63
- package/dist/runtime/app/components/Page/Page.vue.d.ts +0 -24
- package/dist/runtime/app/components/State/EmptyState.d.vue.ts +0 -20
- package/dist/runtime/app/components/State/EmptyState.vue +0 -36
- package/dist/runtime/app/components/State/EmptyState.vue.d.ts +0 -20
- package/dist/runtime/app/components/State/FailureState.d.vue.ts +0 -10
- package/dist/runtime/app/components/State/FailureState.vue +0 -34
- package/dist/runtime/app/components/State/FailureState.vue.d.ts +0 -10
- package/dist/runtime/app/components/Table/Table.d.vue.ts +0 -70
- package/dist/runtime/app/components/Table/Table.vue +0 -345
- package/dist/runtime/app/components/Table/Table.vue.d.ts +0 -70
- package/dist/runtime/app/components/Table/TableCell.d.vue.ts +0 -8
- package/dist/runtime/app/components/Table/TableCell.vue +0 -35
- package/dist/runtime/app/components/Table/TableCell.vue.d.ts +0 -8
- package/dist/runtime/app/composables/useVunoConfirm.d.ts +0 -15
- package/dist/runtime/app/composables/useVunoConfirm.js +0 -5
- package/dist/runtime/app/composables/useVunoContext.d.ts +0 -13
- package/dist/runtime/app/composables/useVunoContext.js +0 -9
- package/dist/runtime/app/composables/useVunoCrud.d.ts +0 -23
- package/dist/runtime/app/composables/useVunoCrud.js +0 -139
- package/dist/runtime/app/composables/useVunoField.d.ts +0 -10
- package/dist/runtime/app/composables/useVunoField.js +0 -34
- package/dist/runtime/app/composables/useVunoForm.d.ts +0 -2
- package/dist/runtime/app/composables/useVunoForm.js +0 -9
- package/dist/runtime/app/composables/useVunoModal.d.ts +0 -21
- package/dist/runtime/app/composables/useVunoModal.js +0 -26
- package/dist/runtime/app/composables/useVunoOverlay.d.ts +0 -22
- package/dist/runtime/app/composables/useVunoOverlay.js +0 -10
- package/dist/runtime/app/composables/useVunoTableQuery.d.ts +0 -51
- package/dist/runtime/app/composables/useVunoTableQuery.js +0 -110
- package/dist/runtime/app/composables/useVunoTheme.d.ts +0 -12
- package/dist/runtime/app/composables/useVunoTheme.js +0 -36
- package/dist/runtime/app/composables/useVunoToast.d.ts +0 -28
- package/dist/runtime/app/composables/useVunoToast.js +0 -13
- package/dist/runtime/app/internal/useVunoTable.d.ts +0 -65
- package/dist/runtime/app/internal/useVunoTable.js +0 -161
- package/dist/runtime/app/theme/index.d.ts +0 -14
- package/dist/runtime/app/theme/index.js +0 -281
- package/dist/runtime/app/types/app-config.d.ts +0 -8
- package/dist/runtime/app/types/app-config.js +0 -1
- package/dist/runtime/app/types/app.d.ts +0 -83
- package/dist/runtime/app/types/app.js +0 -0
- package/dist/runtime/app/types/confirm.d.ts +0 -19
- package/dist/runtime/app/types/confirm.js +0 -0
- package/dist/runtime/app/types/crud.d.ts +0 -108
- package/dist/runtime/app/types/crud.js +0 -0
- package/dist/runtime/app/types/field.d.ts +0 -128
- package/dist/runtime/app/types/field.js +0 -0
- package/dist/runtime/app/types/form.d.ts +0 -39
- package/dist/runtime/app/types/form.js +0 -1
- package/dist/runtime/app/types/index.d.ts +0 -10
- package/dist/runtime/app/types/index.js +0 -1
- package/dist/runtime/app/types/page.d.ts +0 -6
- package/dist/runtime/app/types/page.js +0 -0
- package/dist/runtime/app/types/responsive.d.ts +0 -8
- package/dist/runtime/app/types/responsive.js +0 -0
- package/dist/runtime/app/types/table.d.ts +0 -197
- package/dist/runtime/app/types/table.js +0 -0
- package/dist/runtime/app/types/theme.d.ts +0 -89
- package/dist/runtime/app/types/theme.js +0 -0
- package/dist/runtime/app/utils/column.d.ts +0 -9
- package/dist/runtime/app/utils/column.js +0 -5
- package/dist/runtime/app/utils/format.d.ts +0 -9
- package/dist/runtime/app/utils/format.js +0 -30
- package/dist/runtime/app/utils/grid.d.ts +0 -9
- package/dist/runtime/app/utils/grid.js +0 -91
- package/dist/runtime/app/utils/pagination.d.ts +0 -12
- package/dist/runtime/app/utils/pagination.js +0 -6
- package/dist/runtime/app/utils/path.d.ts +0 -16
- package/dist/runtime/app/utils/path.js +0 -74
- package/dist/runtime/app/utils/query-key.d.ts +0 -20
- package/dist/runtime/app/utils/query-key.js +0 -7
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { onBeforeUnmount, provide, reactive, shallowReactive } from "vue";
|
|
3
|
-
import Confirm from "#vuno/components/Confirm/Confirm.vue";
|
|
4
|
-
import { vunoContextInjectionKey } from "#vuno/composables/useVunoContext";
|
|
5
|
-
import AppOverlay from "./AppOverlay.vue";
|
|
6
|
-
import AppToaster from "./AppToaster.vue";
|
|
7
|
-
const overlays = reactive([]);
|
|
8
|
-
const notifications = shallowReactive([]);
|
|
9
|
-
let nextId = 0;
|
|
10
|
-
const EXIT_MS = 220;
|
|
11
|
-
function removeOverlay(id) {
|
|
12
|
-
const index = overlays.findIndex((entry) => entry.id === id);
|
|
13
|
-
if (index !== -1) overlays.splice(index, 1);
|
|
14
|
-
}
|
|
15
|
-
function dismissOverlay(id) {
|
|
16
|
-
const entry = overlays.find((item) => item.id === id);
|
|
17
|
-
if (entry) entry.open = false;
|
|
18
|
-
setTimeout(() => removeOverlay(id), EXIT_MS);
|
|
19
|
-
}
|
|
20
|
-
function open(component, props = {}) {
|
|
21
|
-
return new Promise((resolve) => {
|
|
22
|
-
const id = nextId++;
|
|
23
|
-
let settled = false;
|
|
24
|
-
const settle = (value) => {
|
|
25
|
-
if (settled) return;
|
|
26
|
-
settled = true;
|
|
27
|
-
resolve(value);
|
|
28
|
-
dismissOverlay(id);
|
|
29
|
-
};
|
|
30
|
-
overlays.push({
|
|
31
|
-
id,
|
|
32
|
-
component,
|
|
33
|
-
listeners: {
|
|
34
|
-
close: (value) => settle(value),
|
|
35
|
-
/**
|
|
36
|
-
* Se aplaza una microtarea porque lo normal dentro del modal
|
|
37
|
-
* es cerrar y luego emitir el resultado:
|
|
38
|
-
*
|
|
39
|
-
* ```ts
|
|
40
|
-
* open.value = false
|
|
41
|
-
* emit('close', true)
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* Resolver aquí en el acto se quedaría con el primero de los
|
|
45
|
-
* dos y devolvería `undefined` habiendo un resultado. Con el
|
|
46
|
-
* aplazamiento, un `close` síncrono llega antes y gana; si no
|
|
47
|
-
* llega ninguno —Escape, pulsar fuera—, resuelve sin valor.
|
|
48
|
-
*/
|
|
49
|
-
"update:open": (value) => {
|
|
50
|
-
if (!value) queueMicrotask(() => settle(void 0));
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
open: true,
|
|
54
|
-
props: { ...props }
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function askConfirm(request, dismissed) {
|
|
59
|
-
return new Promise((resolve) => {
|
|
60
|
-
const id = nextId++;
|
|
61
|
-
let settled = false;
|
|
62
|
-
const settle = (value) => {
|
|
63
|
-
if (settled) return;
|
|
64
|
-
settled = true;
|
|
65
|
-
resolve(value);
|
|
66
|
-
dismissOverlay(id);
|
|
67
|
-
};
|
|
68
|
-
overlays.push({
|
|
69
|
-
id,
|
|
70
|
-
component: Confirm,
|
|
71
|
-
listeners: {
|
|
72
|
-
cancel: () => settle(false),
|
|
73
|
-
confirm: () => settle(true),
|
|
74
|
-
// Escape o pulsar fuera: en una confirmación es que no, y en
|
|
75
|
-
// una alerta es que ya se enteró.
|
|
76
|
-
"update:open": (value) => {
|
|
77
|
-
if (!value) settle(dismissed);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
open: true,
|
|
81
|
-
props: { ...request }
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
const confirm = (request) => askConfirm(request, false);
|
|
86
|
-
const alert = async (request) => {
|
|
87
|
-
await askConfirm({ ...request, alert: true }, true);
|
|
88
|
-
};
|
|
89
|
-
function closeAll() {
|
|
90
|
-
for (const entry of [...overlays]) (entry.listeners.cancel ?? entry.listeners.close)?.();
|
|
91
|
-
}
|
|
92
|
-
const timers = /* @__PURE__ */ new Map();
|
|
93
|
-
function dismiss(id) {
|
|
94
|
-
const timer = timers.get(id);
|
|
95
|
-
if (timer) {
|
|
96
|
-
clearTimeout(timer);
|
|
97
|
-
timers.delete(id);
|
|
98
|
-
}
|
|
99
|
-
const index = notifications.findIndex((entry) => entry.id === id);
|
|
100
|
-
if (index !== -1) notifications.splice(index, 1);
|
|
101
|
-
}
|
|
102
|
-
function notify(request) {
|
|
103
|
-
const id = nextId++;
|
|
104
|
-
const duration = request.duration ?? 5e3;
|
|
105
|
-
notifications.push({ ...request, id, color: request.color ?? "neutral", duration });
|
|
106
|
-
if (duration > 0) timers.set(id, setTimeout(() => dismiss(id), duration));
|
|
107
|
-
return id;
|
|
108
|
-
}
|
|
109
|
-
onBeforeUnmount(() => {
|
|
110
|
-
for (const timer of timers.values()) clearTimeout(timer);
|
|
111
|
-
timers.clear();
|
|
112
|
-
});
|
|
113
|
-
const context = { alert, closeAll, confirm, dismiss, notifications, notify, open, overlays };
|
|
114
|
-
provide(vunoContextInjectionKey, context);
|
|
115
|
-
defineExpose({ alert, closeAll, confirm, dismiss, notify, open });
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<template>
|
|
119
|
-
<slot />
|
|
120
|
-
|
|
121
|
-
<AppOverlay :overlays="overlays" />
|
|
122
|
-
|
|
123
|
-
<AppToaster
|
|
124
|
-
:notifications="notifications"
|
|
125
|
-
@dismiss="dismiss"
|
|
126
|
-
/>
|
|
127
|
-
</template>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'vue';
|
|
2
|
-
import type { VunoAlertRequest, VunoConfirmRequest, VunoNotifyRequest } from '#vuno/types/app';
|
|
3
|
-
/**
|
|
4
|
-
* Monta un componente y espera a que emita `close`.
|
|
5
|
-
*
|
|
6
|
-
* Cerrar con Escape o pulsando fuera cuenta como cerrar sin resultado: un
|
|
7
|
-
* `update:open` en falso resuelve igual, porque si no la promesa se quedaría
|
|
8
|
-
* esperando para siempre a un diálogo que ya no está en pantalla.
|
|
9
|
-
*/
|
|
10
|
-
declare function open<TResult = unknown>(component: Component, props?: Record<string, unknown>): Promise<TResult | undefined>;
|
|
11
|
-
declare function closeAll(): void;
|
|
12
|
-
declare function dismiss(id: number): void;
|
|
13
|
-
declare function notify(request: VunoNotifyRequest): number;
|
|
14
|
-
declare var __VLS_1: {};
|
|
15
|
-
type __VLS_Slots = {} & {
|
|
16
|
-
default?: (props: typeof __VLS_1) => any;
|
|
17
|
-
};
|
|
18
|
-
declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
19
|
-
alert: (request: VunoAlertRequest) => Promise<void>;
|
|
20
|
-
closeAll: typeof closeAll;
|
|
21
|
-
confirm: (request: VunoConfirmRequest) => Promise<boolean>;
|
|
22
|
-
dismiss: typeof dismiss;
|
|
23
|
-
notify: typeof notify;
|
|
24
|
-
open: typeof open;
|
|
25
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
-
declare const _default: typeof __VLS_export;
|
|
28
|
-
export default _default;
|
|
29
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
-
new (): {
|
|
31
|
-
$slots: S;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { VunoFieldSlots } from '#vuno/types/field';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
description?: string;
|
|
4
|
-
/** Cerrar con Escape o pulsando el fondo. */
|
|
5
|
-
dismissible?: boolean;
|
|
6
|
-
title?: string;
|
|
7
|
-
ui?: VunoFieldSlots;
|
|
8
|
-
};
|
|
9
|
-
type __VLS_Slots = {
|
|
10
|
-
body?: () => unknown;
|
|
11
|
-
default?: () => unknown;
|
|
12
|
-
footer?: () => unknown;
|
|
13
|
-
header?: () => unknown;
|
|
14
|
-
};
|
|
15
|
-
type __VLS_ModelProps = {
|
|
16
|
-
'open'?: boolean;
|
|
17
|
-
};
|
|
18
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
19
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
close: () => any;
|
|
21
|
-
"update:open": (value: boolean) => any;
|
|
22
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
-
onClose?: (() => any) | undefined;
|
|
24
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
25
|
-
}>, {
|
|
26
|
-
description: string;
|
|
27
|
-
title: string;
|
|
28
|
-
ui: VunoFieldSlots;
|
|
29
|
-
dismissible: boolean;
|
|
30
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
-
declare const _default: typeof __VLS_export;
|
|
33
|
-
export default _default;
|
|
34
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
-
new (): {
|
|
36
|
-
$slots: S;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { onBeforeUnmount, useTemplateRef, watch } from "vue";
|
|
3
|
-
import { useVunoTheme } from "#vuno/composables/useVunoTheme";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
description: { type: String, required: false, default: void 0 },
|
|
6
|
-
dismissible: { type: Boolean, required: false, default: true },
|
|
7
|
-
title: { type: String, required: false, default: void 0 },
|
|
8
|
-
ui: { type: Object, required: false, default: void 0 }
|
|
9
|
-
});
|
|
10
|
-
const emit = defineEmits(["close"]);
|
|
11
|
-
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
12
|
-
defineSlots();
|
|
13
|
-
const ui = useVunoTheme("appModal", () => props.ui);
|
|
14
|
-
const dialog = useTemplateRef("dialog");
|
|
15
|
-
function lockScroll(locked) {
|
|
16
|
-
if (typeof document === "undefined") return;
|
|
17
|
-
document.body.style.overflow = locked ? "hidden" : "";
|
|
18
|
-
}
|
|
19
|
-
watch(
|
|
20
|
-
[open, dialog],
|
|
21
|
-
([value, element]) => {
|
|
22
|
-
if (!element) return;
|
|
23
|
-
if (value && !element.open) {
|
|
24
|
-
element.showModal();
|
|
25
|
-
lockScroll(true);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (!value && element.open) {
|
|
29
|
-
element.close();
|
|
30
|
-
lockScroll(false);
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
{ immediate: true }
|
|
34
|
-
);
|
|
35
|
-
onBeforeUnmount(() => lockScroll(false));
|
|
36
|
-
function requestClose() {
|
|
37
|
-
open.value = false;
|
|
38
|
-
lockScroll(false);
|
|
39
|
-
emit("close");
|
|
40
|
-
}
|
|
41
|
-
function onCancel(event) {
|
|
42
|
-
event.preventDefault();
|
|
43
|
-
if (props.dismissible) requestClose();
|
|
44
|
-
}
|
|
45
|
-
function onClick(event) {
|
|
46
|
-
if (!props.dismissible) return;
|
|
47
|
-
const element = dialog.value;
|
|
48
|
-
if (!element || event.target !== element) return;
|
|
49
|
-
const box = element.getBoundingClientRect();
|
|
50
|
-
const inside = event.clientX >= box.left && event.clientX <= box.right && event.clientY >= box.top && event.clientY <= box.bottom;
|
|
51
|
-
if (!inside) requestClose();
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<template>
|
|
56
|
-
<dialog
|
|
57
|
-
ref="dialog"
|
|
58
|
-
:aria-describedby="props.description ? 'vuno-modal-description' : void 0"
|
|
59
|
-
:aria-labelledby="props.title ? 'vuno-modal-title' : void 0"
|
|
60
|
-
:class="ui.root"
|
|
61
|
-
@cancel="onCancel"
|
|
62
|
-
@click="onClick"
|
|
63
|
-
@close="open = false"
|
|
64
|
-
>
|
|
65
|
-
<div :class="ui.content">
|
|
66
|
-
<slot name="header">
|
|
67
|
-
<div
|
|
68
|
-
v-if="props.title || props.description"
|
|
69
|
-
:class="ui.header"
|
|
70
|
-
>
|
|
71
|
-
<h2
|
|
72
|
-
v-if="props.title"
|
|
73
|
-
id="vuno-modal-title"
|
|
74
|
-
:class="ui.title"
|
|
75
|
-
>
|
|
76
|
-
{{ props.title }}
|
|
77
|
-
</h2>
|
|
78
|
-
|
|
79
|
-
<p
|
|
80
|
-
v-if="props.description"
|
|
81
|
-
id="vuno-modal-description"
|
|
82
|
-
:class="ui.description"
|
|
83
|
-
>
|
|
84
|
-
{{ props.description }}
|
|
85
|
-
</p>
|
|
86
|
-
</div>
|
|
87
|
-
</slot>
|
|
88
|
-
|
|
89
|
-
<div :class="ui.body">
|
|
90
|
-
<slot name="body">
|
|
91
|
-
<slot />
|
|
92
|
-
</slot>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div
|
|
96
|
-
v-if="$slots.footer"
|
|
97
|
-
:class="ui.footer"
|
|
98
|
-
>
|
|
99
|
-
<slot name="footer" />
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</dialog>
|
|
103
|
-
</template>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { VunoFieldSlots } from '#vuno/types/field';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
description?: string;
|
|
4
|
-
/** Cerrar con Escape o pulsando el fondo. */
|
|
5
|
-
dismissible?: boolean;
|
|
6
|
-
title?: string;
|
|
7
|
-
ui?: VunoFieldSlots;
|
|
8
|
-
};
|
|
9
|
-
type __VLS_Slots = {
|
|
10
|
-
body?: () => unknown;
|
|
11
|
-
default?: () => unknown;
|
|
12
|
-
footer?: () => unknown;
|
|
13
|
-
header?: () => unknown;
|
|
14
|
-
};
|
|
15
|
-
type __VLS_ModelProps = {
|
|
16
|
-
'open'?: boolean;
|
|
17
|
-
};
|
|
18
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
19
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
close: () => any;
|
|
21
|
-
"update:open": (value: boolean) => any;
|
|
22
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
-
onClose?: (() => any) | undefined;
|
|
24
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
25
|
-
}>, {
|
|
26
|
-
description: string;
|
|
27
|
-
title: string;
|
|
28
|
-
ui: VunoFieldSlots;
|
|
29
|
-
dismissible: boolean;
|
|
30
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
-
declare const _default: typeof __VLS_export;
|
|
33
|
-
export default _default;
|
|
34
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
-
new (): {
|
|
36
|
-
$slots: S;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { VunoOverlayEntry } from '#vuno/types/app';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
overlays: VunoOverlayEntry[];
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
overlays: { type: Array, required: true }
|
|
4
|
-
});
|
|
5
|
-
const isTopmost = (index) => index === props.overlays.length - 1;
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<!--
|
|
10
|
-
Los overlays globales se pintan aquí y no donde se pidieron. Un diálogo
|
|
11
|
-
montado dentro de la pantalla que lo abre desaparece con ella —al navegar,
|
|
12
|
-
al cerrarse un modal que lo contenía— y su promesa se queda sin resolver.
|
|
13
|
-
|
|
14
|
-
No hay escalera de z-index, y no por olvido: se escribió una y resultó
|
|
15
|
-
inútil. Los diálogos de vuno son `<dialog>` nativos, que viven en la capa
|
|
16
|
-
superior del navegador y se apilan por orden de apertura, por encima de
|
|
17
|
-
cualquier z-index. Mientras todo sea nativo, el apilado ya es correcto;
|
|
18
|
-
en cuanto se mezcla con algo que no lo sea, ningún z-index lo arregla,
|
|
19
|
-
porque la capa superior siempre gana.
|
|
20
|
-
|
|
21
|
-
Tampoco lleva contenedor propio: cada diálogo se sale del flujo por su
|
|
22
|
-
cuenta, así que un elemento aquí solo añadiría un nodo vacío.
|
|
23
|
-
-->
|
|
24
|
-
<component
|
|
25
|
-
:is="entry.component"
|
|
26
|
-
v-for="(entry, index) in props.overlays"
|
|
27
|
-
:key="entry.id"
|
|
28
|
-
v-bind="entry.props"
|
|
29
|
-
:class="isTopmost(index) ? void 0 : 'vuno-overlay-behind'"
|
|
30
|
-
:open="entry.open"
|
|
31
|
-
v-on="entry.listeners"
|
|
32
|
-
/>
|
|
33
|
-
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { VunoOverlayEntry } from '#vuno/types/app';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
overlays: VunoOverlayEntry[];
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VunoNotification } from '#vuno/types/app';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
notification: VunoNotification;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
-
dismiss: () => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
-
onDismiss?: (() => any) | undefined;
|
|
9
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import { useVunoIcons, useVunoMessages, useVunoTheme } from "#vuno/composables/useVunoTheme";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
notification: { type: Object, required: true }
|
|
6
|
-
});
|
|
7
|
-
const emit = defineEmits(["dismiss"]);
|
|
8
|
-
const icons = useVunoIcons();
|
|
9
|
-
const messages = useVunoMessages();
|
|
10
|
-
const ui = useVunoTheme("appToast");
|
|
11
|
-
const defaultIcons = {
|
|
12
|
-
error: icons.value.notifyError,
|
|
13
|
-
info: icons.value.notifyInfo,
|
|
14
|
-
neutral: icons.value.notifyInfo,
|
|
15
|
-
success: icons.value.notifySuccess,
|
|
16
|
-
warning: icons.value.notifyWarning
|
|
17
|
-
};
|
|
18
|
-
const icon = computed(() => props.notification.icon ?? defaultIcons[props.notification.color]);
|
|
19
|
-
const live = computed(() => props.notification.color === "error" ? "assertive" : "polite");
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<div
|
|
24
|
-
:aria-live="live"
|
|
25
|
-
:class="ui.root"
|
|
26
|
-
role="status"
|
|
27
|
-
>
|
|
28
|
-
<UIcon
|
|
29
|
-
:class="[ui.icon, `text-${props.notification.color}`]"
|
|
30
|
-
:name="icon"
|
|
31
|
-
/>
|
|
32
|
-
|
|
33
|
-
<div :class="ui.body">
|
|
34
|
-
<p :class="ui.title">{{ props.notification.title }}</p>
|
|
35
|
-
|
|
36
|
-
<p
|
|
37
|
-
v-if="props.notification.description"
|
|
38
|
-
:class="ui.description"
|
|
39
|
-
>
|
|
40
|
-
{{ props.notification.description }}
|
|
41
|
-
</p>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<UButton
|
|
45
|
-
:aria-label="messages.close"
|
|
46
|
-
color="neutral"
|
|
47
|
-
:icon="icons.close"
|
|
48
|
-
size="xs"
|
|
49
|
-
variant="ghost"
|
|
50
|
-
@click="emit('dismiss')"
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VunoNotification } from '#vuno/types/app';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
notification: VunoNotification;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
-
dismiss: () => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
-
onDismiss?: (() => any) | undefined;
|
|
9
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VunoNotification } from '#vuno/types/app';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
notifications: VunoNotification[];
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
-
dismiss: (id: number) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
-
onDismiss?: ((id: number) => any) | undefined;
|
|
9
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useVunoTheme } from "#vuno/composables/useVunoTheme";
|
|
3
|
-
import AppToast from "./AppToast.vue";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
notifications: { type: Array, required: true }
|
|
6
|
-
});
|
|
7
|
-
const emit = defineEmits(["dismiss"]);
|
|
8
|
-
const ui = useVunoTheme("appToaster");
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<!--
|
|
13
|
-
La pila se porta a `body` para que no la recorte ningún `overflow` ni la
|
|
14
|
-
reordene ningún contexto de apilamiento de la pantalla que la abrió.
|
|
15
|
-
|
|
16
|
-
`pointer-events-none` en el contenedor y `auto` en cada aviso: si no, una
|
|
17
|
-
franja invisible a lo alto de la pantalla se come los clics de lo que hay
|
|
18
|
-
detrás aunque no haya ninguna notificación.
|
|
19
|
-
-->
|
|
20
|
-
<Teleport to="body">
|
|
21
|
-
<div
|
|
22
|
-
v-if="props.notifications.length > 0"
|
|
23
|
-
:class="ui.root"
|
|
24
|
-
>
|
|
25
|
-
<!--
|
|
26
|
-
`TransitionGroup` y no `Transition`: hay varias a la vez y al
|
|
27
|
-
quitar una de en medio las de abajo tienen que subir. `move`
|
|
28
|
-
anima justo eso, que si no da un salto.
|
|
29
|
-
-->
|
|
30
|
-
<TransitionGroup
|
|
31
|
-
:class="ui.list"
|
|
32
|
-
:enterActiveClass="ui.enterActive"
|
|
33
|
-
:enterFromClass="ui.enterFrom"
|
|
34
|
-
:leaveActiveClass="ui.leaveActive"
|
|
35
|
-
:leaveToClass="ui.leaveTo"
|
|
36
|
-
:moveClass="ui.move"
|
|
37
|
-
tag="div"
|
|
38
|
-
>
|
|
39
|
-
<AppToast
|
|
40
|
-
v-for="notification in props.notifications"
|
|
41
|
-
:key="notification.id"
|
|
42
|
-
:class="ui.item"
|
|
43
|
-
:notification="notification"
|
|
44
|
-
@dismiss="emit('dismiss', notification.id)"
|
|
45
|
-
/>
|
|
46
|
-
</TransitionGroup>
|
|
47
|
-
</div>
|
|
48
|
-
</Teleport>
|
|
49
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VunoNotification } from '#vuno/types/app';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
notifications: VunoNotification[];
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
-
dismiss: (id: number) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
-
onDismiss?: ((id: number) => any) | undefined;
|
|
9
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
-
type __VLS_Props = VunoTableCellProps<'badge'>;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
-
declare const _default: typeof __VLS_export;
|
|
5
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
column: { type: Object, required: true },
|
|
5
|
-
row: { type: Object, required: true },
|
|
6
|
-
value: { type: null, required: true }
|
|
7
|
-
});
|
|
8
|
-
const text = computed(() => props.value === null || props.value === void 0 ? "" : String(props.value));
|
|
9
|
-
const badge = computed(() => {
|
|
10
|
-
const entry = props.column.map?.[text.value];
|
|
11
|
-
return {
|
|
12
|
-
color: entry?.color ?? props.column.color ?? "neutral",
|
|
13
|
-
label: entry?.label ?? text.value
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<UBadge
|
|
20
|
-
:color="badge.color"
|
|
21
|
-
:label="badge.label"
|
|
22
|
-
variant="subtle"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
-
type __VLS_Props = VunoTableCellProps<'badge'>;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
-
declare const _default: typeof __VLS_export;
|
|
5
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
-
type __VLS_Props = VunoTableCellProps<'boolean'>;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
-
declare const _default: typeof __VLS_export;
|
|
5
|
-
export default _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import { useVunoIcons } from "#vuno/composables/useVunoTheme";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
column: { type: Object, required: true },
|
|
6
|
-
row: { type: Object, required: true },
|
|
7
|
-
value: { type: null, required: true }
|
|
8
|
-
});
|
|
9
|
-
const icons = useVunoIcons();
|
|
10
|
-
const labelled = computed(() => Boolean(props.column.trueLabel || props.column.falseLabel));
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<span v-if="labelled">{{ props.value ? props.column.trueLabel ?? "" : props.column.falseLabel ?? "" }}</span>
|
|
15
|
-
|
|
16
|
-
<UIcon
|
|
17
|
-
v-else
|
|
18
|
-
:class="props.value ? 'text-success' : 'text-muted'"
|
|
19
|
-
:name="props.value ? icons.booleanTrue : icons.booleanFalse"
|
|
20
|
-
/>
|
|
21
|
-
</template>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
-
type __VLS_Props = VunoTableCellProps<'boolean'>;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
-
declare const _default: typeof __VLS_export;
|
|
5
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
-
type __VLS_Props = VunoTableCellProps<'currency'>;
|
|
3
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
-
declare const _default: typeof __VLS_export;
|
|
5
|
-
export default _default;
|