@groupteknology/vuno 0.4.0 → 0.6.1
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/LICENSE +21 -21
- package/README.md +198 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -0
- package/dist/runtime/app/assets/css/main.css +1 -1
- package/dist/runtime/app/components/App/App.d.vue.ts +33 -0
- package/dist/runtime/app/components/App/App.vue +127 -0
- package/dist/runtime/app/components/App/App.vue.d.ts +33 -0
- package/dist/runtime/app/components/App/AppContext.d.vue.ts +3 -0
- package/dist/runtime/app/components/App/AppContext.vue +7 -0
- package/dist/runtime/app/components/App/AppContext.vue.d.ts +3 -0
- package/dist/runtime/app/components/App/AppModal.d.vue.ts +38 -0
- package/dist/runtime/app/components/App/AppModal.vue +103 -0
- package/dist/runtime/app/components/App/AppModal.vue.d.ts +38 -0
- package/dist/runtime/app/components/App/AppOverlay.d.vue.ts +7 -0
- package/dist/runtime/app/components/App/AppOverlay.vue +33 -0
- package/dist/runtime/app/components/App/AppOverlay.vue.d.ts +7 -0
- package/dist/runtime/app/components/App/AppToast.d.vue.ts +11 -0
- package/dist/runtime/app/components/App/AppToast.vue +53 -0
- package/dist/runtime/app/components/App/AppToast.vue.d.ts +11 -0
- package/dist/runtime/app/components/App/AppToaster.d.vue.ts +11 -0
- package/dist/runtime/app/components/App/AppToaster.vue +49 -0
- package/dist/runtime/app/components/App/AppToaster.vue.d.ts +11 -0
- package/dist/runtime/app/components/Cell/CellBadge.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellBadge.vue +24 -0
- package/dist/runtime/app/components/Cell/CellBadge.vue.d.ts +5 -0
- package/dist/runtime/app/components/Cell/CellBoolean.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellBoolean.vue +21 -0
- package/dist/runtime/app/components/Cell/CellBoolean.vue.d.ts +5 -0
- package/dist/runtime/app/components/Cell/CellCurrency.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellCurrency.vue +14 -0
- package/dist/runtime/app/components/Cell/CellCurrency.vue.d.ts +5 -0
- package/dist/runtime/app/components/Cell/CellDate.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellDate.vue +19 -0
- package/dist/runtime/app/components/Cell/CellDate.vue.d.ts +5 -0
- package/dist/runtime/app/components/Cell/CellImage.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellImage.vue +22 -0
- package/dist/runtime/app/components/Cell/CellImage.vue.d.ts +5 -0
- package/dist/runtime/app/components/Cell/CellNumber.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellNumber.vue +15 -0
- package/dist/runtime/app/components/Cell/CellNumber.vue.d.ts +5 -0
- package/dist/runtime/app/components/Cell/CellText.d.vue.ts +5 -0
- package/dist/runtime/app/components/Cell/CellText.vue +13 -0
- package/dist/runtime/app/components/Cell/CellText.vue.d.ts +5 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue +20 -13
- package/dist/runtime/app/components/Field/FieldArray.vue +68 -68
- package/dist/runtime/app/components/Field/FieldColor.vue +36 -36
- package/dist/runtime/app/components/Form/Form.vue +61 -49
- package/dist/runtime/app/components/Form/FormModal.vue +23 -15
- package/dist/runtime/app/components/Form/FormSection.vue +27 -27
- package/dist/runtime/app/components/Page/Page.vue +46 -46
- package/dist/runtime/app/components/State/EmptyState.vue +20 -20
- package/dist/runtime/app/components/State/FailureState.vue +21 -21
- package/dist/runtime/app/components/Table/Table.vue +286 -373
- package/dist/runtime/app/components/Table/TableCell.vue +24 -73
- package/dist/runtime/app/composables/useVunoConfirm.d.ts +15 -0
- package/dist/runtime/app/composables/useVunoConfirm.js +5 -0
- package/dist/runtime/app/composables/useVunoContext.d.ts +13 -0
- package/dist/runtime/app/composables/useVunoContext.js +9 -0
- package/dist/runtime/app/composables/useVunoModal.d.ts +21 -0
- package/dist/runtime/app/composables/useVunoModal.js +26 -0
- package/dist/runtime/app/composables/useVunoOverlay.d.ts +22 -0
- package/dist/runtime/app/composables/useVunoOverlay.js +10 -0
- package/dist/runtime/app/composables/useVunoTableQuery.js +3 -3
- package/dist/runtime/app/composables/useVunoTheme.js +2 -1
- package/dist/runtime/app/composables/useVunoToast.d.ts +28 -0
- package/dist/runtime/app/composables/useVunoToast.js +13 -0
- package/dist/runtime/app/internal/useVunoTable.d.ts +65 -0
- package/dist/runtime/app/internal/useVunoTable.js +161 -0
- package/dist/runtime/app/theme/index.js +69 -2
- package/dist/runtime/app/types/app.d.ts +83 -0
- package/dist/runtime/app/types/app.js +0 -0
- package/dist/runtime/app/types/confirm.d.ts +8 -0
- package/dist/runtime/app/types/index.d.ts +1 -0
- package/dist/runtime/app/types/table.d.ts +80 -13
- package/dist/runtime/app/types/theme.d.ts +12 -0
- package/dist/runtime/app/utils/column.d.ts +9 -0
- package/dist/runtime/app/utils/column.js +5 -0
- package/dist/runtime/app/utils/pagination.d.ts +12 -0
- package/dist/runtime/app/utils/pagination.js +6 -0
- package/package.json +6 -3
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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>
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,53 @@
|
|
|
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>
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,49 @@
|
|
|
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>
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,24 @@
|
|
|
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>
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
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>
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useLocale } from "@nuxt/ui/composables";
|
|
3
|
+
import { formatCurrency } from "#vuno/utils/format";
|
|
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 locale = useLocale();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<span class="tabular-nums">{{ formatCurrency(props.value, locale.code.value, props.column.currency, props.column.decimals) }}</span>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'date'>;
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useLocale } from "@nuxt/ui/composables";
|
|
4
|
+
import { formatDate } from "#vuno/utils/format";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
column: { type: Object, required: true },
|
|
7
|
+
row: { type: Object, required: true },
|
|
8
|
+
value: { type: null, required: true }
|
|
9
|
+
});
|
|
10
|
+
const locale = useLocale();
|
|
11
|
+
const options = computed(() => ({
|
|
12
|
+
dateStyle: props.column.dateStyle ?? "medium",
|
|
13
|
+
...props.column.timeStyle ? { timeStyle: props.column.timeStyle } : {}
|
|
14
|
+
}));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<span class="tabular-nums">{{ formatDate(props.value, locale.code.value, options) }}</span>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'date'>;
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'image'>;
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { getPath } from "#vuno/utils/path";
|
|
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 src = computed(() => props.value === null || props.value === void 0 ? "" : String(props.value));
|
|
10
|
+
const alt = computed(() => {
|
|
11
|
+
if (props.column.altKey) return String(getPath(props.row, props.column.altKey) ?? "");
|
|
12
|
+
return props.column.alt ?? "";
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<UAvatar
|
|
18
|
+
:alt="alt"
|
|
19
|
+
:size="props.column.size ?? 'md'"
|
|
20
|
+
:src="src"
|
|
21
|
+
/>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'image'>;
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'number'>;
|
|
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;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useLocale } from "@nuxt/ui/composables";
|
|
3
|
+
import { formatNumber } from "#vuno/utils/format";
|
|
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 locale = useLocale();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<!-- `tabular-nums` alinea las cifras en columna; sin ello los dígitos bailan. -->
|
|
14
|
+
<span class="tabular-nums">{{ formatNumber(props.value, locale.code.value, props.column.decimals) }}</span>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'number'>;
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'text'>;
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<span :class="props.column.truncate ? 'block max-w-[32ch] truncate' : void 0">{{ text }}</span>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoTableCellProps } from '#vuno/types/table';
|
|
2
|
+
type __VLS_Props = VunoTableCellProps<'text'>;
|
|
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,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
+
import AppModal from "#vuno/components/App/AppModal.vue";
|
|
3
4
|
import { useVunoIcons, useVunoMessages, useVunoTheme } from "#vuno/composables/useVunoTheme";
|
|
4
5
|
const props = defineProps({
|
|
6
|
+
alert: { type: Boolean, required: false },
|
|
5
7
|
cancelLabel: { type: String, required: false },
|
|
6
8
|
color: { type: String, required: false },
|
|
7
9
|
confirmLabel: { type: String, required: false },
|
|
@@ -30,27 +32,32 @@ function onConfirm() {
|
|
|
30
32
|
</script>
|
|
31
33
|
|
|
32
34
|
<template>
|
|
33
|
-
|
|
35
|
+
<!--
|
|
36
|
+
Sobre `AppModal`, no sobre el de Nuxt UI, y no por gusto: un `<dialog>`
|
|
37
|
+
nativo vive en la capa superior del navegador, que queda por encima de
|
|
38
|
+
cualquier z-index. Mezclando los dos sistemas, un confirm abierto desde
|
|
39
|
+
dentro de un `AppModal` se pintaba detrás de él —estaba en el DOM y no se
|
|
40
|
+
veía—. Nativos los dos, el navegador los apila por orden de apertura.
|
|
41
|
+
-->
|
|
42
|
+
<AppModal
|
|
34
43
|
v-model:open="open"
|
|
35
44
|
:dismissible="!props.loading"
|
|
36
|
-
scrollable
|
|
37
45
|
:title="props.title ?? messages.confirmTitle"
|
|
38
46
|
:ui="modalUi"
|
|
39
47
|
>
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
<slot>{{ props.description ?? messages.confirmDescription }}</slot>
|
|
48
|
-
</div>
|
|
48
|
+
<div :class="ui.body">
|
|
49
|
+
<UIcon
|
|
50
|
+
:class="[ui.icon, `text-${color}`]"
|
|
51
|
+
:name="props.icon ?? icons.confirm"
|
|
52
|
+
/>
|
|
53
|
+
<div :class="ui.description">
|
|
54
|
+
<slot>{{ props.description ?? messages.confirmDescription }}</slot>
|
|
49
55
|
</div>
|
|
50
|
-
</
|
|
56
|
+
</div>
|
|
51
57
|
|
|
52
58
|
<template #footer>
|
|
53
59
|
<UButton
|
|
60
|
+
v-if="!props.alert"
|
|
54
61
|
color="neutral"
|
|
55
62
|
:disabled="props.loading"
|
|
56
63
|
:label="props.cancelLabel ?? messages.cancel"
|
|
@@ -64,5 +71,5 @@ function onConfirm() {
|
|
|
64
71
|
@click="onConfirm"
|
|
65
72
|
/>
|
|
66
73
|
</template>
|
|
67
|
-
</
|
|
74
|
+
</AppModal>
|
|
68
75
|
</template>
|