@merkaly/nuxt 0.6.0 → 0.6.4
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/dist/module.d.mts +11 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +86 -28
- package/dist/runtime/components/app.d.vue.ts +3 -3
- package/dist/runtime/components/app.vue +7 -0
- package/dist/runtime/components/app.vue.d.ts +3 -3
- package/dist/runtime/components/format/FormatDate.d.vue.ts +2 -2
- package/dist/runtime/components/format/FormatDate.vue.d.ts +2 -2
- package/dist/runtime/components/format/FormatIcon.d.vue.ts +32 -5
- package/dist/runtime/components/format/FormatIcon.vue +20 -5
- package/dist/runtime/components/format/FormatIcon.vue.d.ts +32 -5
- package/dist/runtime/components/format/FormatMoney.d.vue.ts +2 -2
- package/dist/runtime/components/format/FormatMoney.vue +7 -7
- package/dist/runtime/components/format/FormatMoney.vue.d.ts +2 -2
- package/dist/runtime/components/format/FormatNumber.d.vue.ts +52 -0
- package/dist/runtime/components/format/FormatNumber.vue +38 -0
- package/dist/runtime/components/format/FormatNumber.vue.d.ts +52 -0
- package/dist/runtime/components/format/FormatText.d.vue.ts +9 -3
- package/dist/runtime/components/format/FormatText.vue +2 -2
- package/dist/runtime/components/format/FormatText.vue.d.ts +9 -3
- package/dist/runtime/components/input/InputAddress.d.vue.ts +1 -1
- package/dist/runtime/components/input/InputAddress.vue.d.ts +1 -1
- package/dist/runtime/components/input/InputDateRange.vue +6 -6
- package/dist/runtime/components/input/InputDropzone.vue +1 -1
- package/dist/runtime/components/input/InputMoney.d.vue.ts +1 -1
- package/dist/runtime/components/input/InputMoney.vue +1 -1
- package/dist/runtime/components/input/InputMoney.vue.d.ts +1 -1
- package/dist/runtime/components/input/InputSelect.d.vue.ts +10 -11
- package/dist/runtime/components/input/InputSelect.vue +19 -11
- package/dist/runtime/components/input/InputSelect.vue.d.ts +10 -11
- package/dist/runtime/components/table/TableDatagrid.d.vue.ts +1 -1
- package/dist/runtime/components/table/TableDatagrid.vue +7 -5
- package/dist/runtime/components/table/TableDatagrid.vue.d.ts +1 -1
- package/dist/runtime/composables/useCounterUp.d.ts +8 -0
- package/dist/runtime/composables/useCounterUp.js +30 -0
- package/dist/runtime/composables/useDatagrid.d.ts +7 -2
- package/dist/runtime/composables/useDatagrid.js +7 -2
- package/dist/runtime/composables/useNotify.d.ts +19 -0
- package/dist/runtime/composables/useNotify.js +40 -0
- package/dist/runtime/middleware/auth.d.ts +1 -1
- package/dist/runtime/plugins/api.global.d.ts +1 -1
- package/dist/runtime/plugins/auth0.client.d.ts +2 -2
- package/dist/runtime/plugins/sentry.global.d.ts +1 -1
- package/dist/runtime/types/nuxt.d.ts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +20 -20
- package/dist/runtime/composables/useMoney.d.ts +0 -7
- package/dist/runtime/composables/useMoney.js +0 -10
package/dist/module.d.mts
CHANGED
|
@@ -3,6 +3,12 @@ import { ClientAuthorizationParams } from '@auth0/auth0-spa-js';
|
|
|
3
3
|
export { AdapterArgs, AdapterOptions } from '../dist/runtime/utils/withAdapter.js';
|
|
4
4
|
export { ApiOptions, HooksOptions, ParamsOptions, RefOptions } from '../dist/runtime/plugins/api.global.js';
|
|
5
5
|
|
|
6
|
+
interface MerkalyI18nLocale {
|
|
7
|
+
code: string;
|
|
8
|
+
file: string;
|
|
9
|
+
language: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
6
12
|
interface MerkalyModuleOptions {
|
|
7
13
|
api: {
|
|
8
14
|
url: string;
|
|
@@ -17,6 +23,10 @@ interface MerkalyModuleOptions {
|
|
|
17
23
|
params?: Omit<ClientAuthorizationParams, 'redirect_uri'>;
|
|
18
24
|
requiresAuth: boolean;
|
|
19
25
|
};
|
|
26
|
+
i18n?: {
|
|
27
|
+
defaultLocale: string;
|
|
28
|
+
locales: MerkalyI18nLocale[];
|
|
29
|
+
};
|
|
20
30
|
plausible?: {
|
|
21
31
|
domain: string;
|
|
22
32
|
localhost: string;
|
|
@@ -30,4 +40,4 @@ interface MerkalyModuleOptions {
|
|
|
30
40
|
declare const _default: _nuxt_schema.NuxtModule<MerkalyModuleOptions, MerkalyModuleOptions, false>;
|
|
31
41
|
|
|
32
42
|
export { _default as default };
|
|
33
|
-
export type { MerkalyModuleOptions };
|
|
43
|
+
export type { MerkalyI18nLocale, MerkalyModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineNuxtModule, useLogger, createResolver, addPlugin, addServerHandler, addRouteMiddleware, addImportsDir, addComponentsDir, addTypeTemplate } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, useLogger, createResolver, addPlugin, addServerHandler, addRouteMiddleware, addImportsDir, addComponentsDir, addTypeTemplate, addTemplate } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { createJiti } from 'jiti';
|
|
4
|
-
import { existsSync } from 'node:fs';
|
|
4
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { resolve, dirname } from 'node:path';
|
|
5
6
|
import svgLoader from 'vite-svg-loader';
|
|
6
7
|
import 'reflect-metadata';
|
|
7
8
|
|
|
@@ -19,6 +20,10 @@ const defaultOptions = {
|
|
|
19
20
|
params: {},
|
|
20
21
|
requiresAuth: false
|
|
21
22
|
},
|
|
23
|
+
i18n: {
|
|
24
|
+
defaultLocale: "en-US",
|
|
25
|
+
locales: []
|
|
26
|
+
},
|
|
22
27
|
plausible: {
|
|
23
28
|
domain: "",
|
|
24
29
|
localhost: ""
|
|
@@ -32,14 +37,55 @@ const defaultOptions = {
|
|
|
32
37
|
function hasPlausibleConfig(options) {
|
|
33
38
|
return Boolean(options.plausible?.domain);
|
|
34
39
|
}
|
|
35
|
-
function
|
|
40
|
+
function configureI18n(nuxt, options) {
|
|
41
|
+
if (!options.i18n?.defaultLocale || options.i18n.locales.length === 0) return {};
|
|
42
|
+
const writeTemplate = (filename, contents) => {
|
|
43
|
+
const template = addTemplate({
|
|
44
|
+
filename,
|
|
45
|
+
getContents: () => contents,
|
|
46
|
+
write: true
|
|
47
|
+
});
|
|
48
|
+
mkdirSync(dirname(template.dst), { recursive: true });
|
|
49
|
+
writeFileSync(template.dst, contents);
|
|
50
|
+
return template.dst;
|
|
51
|
+
};
|
|
52
|
+
nuxt.options.alias["i18n"] = resolve(nuxt.options.buildDir, "i18n");
|
|
53
|
+
const vueI18n = writeTemplate(
|
|
54
|
+
"i18n/config.mjs",
|
|
55
|
+
`export default defineI18nConfig(() => (${JSON.stringify({
|
|
56
|
+
fallbackLocale: options.i18n.defaultLocale,
|
|
57
|
+
legacy: false,
|
|
58
|
+
locale: options.i18n.defaultLocale
|
|
59
|
+
}, null, 2)}))
|
|
60
|
+
`
|
|
61
|
+
);
|
|
62
|
+
nuxt.hook("i18n:registerModule", (register) => register({
|
|
63
|
+
langDir: nuxt.options.rootDir,
|
|
64
|
+
locales: options.i18n.locales.map((locale) => ({
|
|
65
|
+
code: locale.code,
|
|
66
|
+
file: locale.file,
|
|
67
|
+
language: locale.language,
|
|
68
|
+
name: locale.name
|
|
69
|
+
}))
|
|
70
|
+
}));
|
|
71
|
+
return {
|
|
72
|
+
defaultLocale: options.i18n.defaultLocale,
|
|
73
|
+
detectBrowserLanguage: { useCookie: true },
|
|
74
|
+
restructureDir: ".",
|
|
75
|
+
strategy: "no_prefix",
|
|
76
|
+
vueI18n
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function buildModuleDependencies(nuxt, options) {
|
|
36
80
|
const dependencies = {
|
|
37
81
|
"@bootstrap-vue-next/nuxt": {},
|
|
38
82
|
"@nuxt/eslint": {},
|
|
39
83
|
"@nuxt/fonts": {},
|
|
40
84
|
"@nuxt/image": {},
|
|
85
|
+
"@nuxtjs/i18n": { overrides: configureI18n(nuxt, options) },
|
|
41
86
|
"@sentry/nuxt/module": {},
|
|
42
|
-
"@vueuse/nuxt": {}
|
|
87
|
+
"@vueuse/nuxt": {},
|
|
88
|
+
"notivue/nuxt": {}
|
|
43
89
|
};
|
|
44
90
|
if (hasPlausibleConfig(options)) {
|
|
45
91
|
dependencies["@nuxtjs/plausible"] = {};
|
|
@@ -64,6 +110,7 @@ function configurePlausible(nuxt, options) {
|
|
|
64
110
|
enabled: process.env.NODE_ENV === "production" && hasPlausibleConfig(options),
|
|
65
111
|
ignoredHostnames: ["localhost", options.plausible?.localhost].filter(Boolean)
|
|
66
112
|
},
|
|
113
|
+
// @ts-expect-error plausible not defined
|
|
67
114
|
nuxt.options.plausible || {}
|
|
68
115
|
);
|
|
69
116
|
}
|
|
@@ -75,32 +122,40 @@ function configureSentry(nuxt, options) {
|
|
|
75
122
|
});
|
|
76
123
|
nuxt.options.sourcemap = { client: "hidden", server: true };
|
|
77
124
|
}
|
|
78
|
-
async function loadBootstrapConfig(nuxt) {
|
|
79
|
-
const rootDirResolver = createResolver(nuxt.options.rootDir);
|
|
80
|
-
const bootstrapConfigPath = rootDirResolver.resolve("bootstrap.config.ts");
|
|
81
|
-
if (!existsSync(bootstrapConfigPath)) {
|
|
82
|
-
return {};
|
|
83
|
-
}
|
|
84
|
-
const jiti = createJiti(import.meta.url);
|
|
85
|
-
const imported = await jiti.import(bootstrapConfigPath).catch(() => ({}));
|
|
86
|
-
return imported.default || {};
|
|
87
|
-
}
|
|
88
125
|
function configureBootstrapVueNext(nuxt, components) {
|
|
89
126
|
nuxt.options.bootstrapVueNext = defu(
|
|
90
127
|
nuxt.options.bootstrapVueNext || {},
|
|
91
|
-
{
|
|
92
|
-
plugin: {
|
|
93
|
-
components
|
|
94
|
-
}
|
|
95
|
-
}
|
|
128
|
+
{ plugin: { components } }
|
|
96
129
|
);
|
|
97
130
|
}
|
|
131
|
+
function configureNotiVue(nuxt) {
|
|
132
|
+
nuxt.options.css.push("notivue/notification.css");
|
|
133
|
+
nuxt.options.css.push("notivue/animations.css");
|
|
134
|
+
nuxt.options.css.push("notivue/notification-progress.css");
|
|
135
|
+
nuxt.options.notivue = {
|
|
136
|
+
centerOnMobile: true,
|
|
137
|
+
clearOnSwipe: true,
|
|
138
|
+
enqueue: true,
|
|
139
|
+
fullWidth: false,
|
|
140
|
+
limit: 3,
|
|
141
|
+
pauseOnHover: true,
|
|
142
|
+
position: "top-right"
|
|
143
|
+
};
|
|
144
|
+
}
|
|
98
145
|
function configureAppHead(nuxt) {
|
|
99
146
|
nuxt.options.app?.head?.script?.push({
|
|
100
147
|
crossorigin: "anonymous",
|
|
101
148
|
src: "https://kit.fontawesome.com/55a4b2f4e1.js"
|
|
102
149
|
});
|
|
103
150
|
}
|
|
151
|
+
function configureVite(nuxt) {
|
|
152
|
+
nuxt.options.vite = defu(
|
|
153
|
+
nuxt.options.vite || {},
|
|
154
|
+
{
|
|
155
|
+
plugins: [svgLoader()]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
104
159
|
function registerRuntimeFeatures(nuxt, options, resolver) {
|
|
105
160
|
addPlugin({ src: resolver.resolve("./runtime/plugins/api.global") });
|
|
106
161
|
addPlugin({ src: resolver.resolve("./runtime/plugins/auth0.client") });
|
|
@@ -126,13 +181,15 @@ function registerRuntimeFeatures(nuxt, options, resolver) {
|
|
|
126
181
|
src: resolver.resolve("./runtime/types/nuxt.d.ts")
|
|
127
182
|
});
|
|
128
183
|
}
|
|
129
|
-
function
|
|
130
|
-
nuxt.options.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
);
|
|
184
|
+
async function loadBootstrapConfig(nuxt) {
|
|
185
|
+
const rootDirResolver = createResolver(nuxt.options.rootDir);
|
|
186
|
+
const bootstrapConfigPath = rootDirResolver.resolve("bootstrap.config.ts");
|
|
187
|
+
if (!existsSync(bootstrapConfigPath)) {
|
|
188
|
+
return {};
|
|
189
|
+
}
|
|
190
|
+
const jiti = createJiti(import.meta.url);
|
|
191
|
+
const imported = await jiti.import(bootstrapConfigPath).catch(() => ({}));
|
|
192
|
+
return imported.default || {};
|
|
136
193
|
}
|
|
137
194
|
const module = defineNuxtModule({
|
|
138
195
|
defaults: defaultOptions,
|
|
@@ -146,17 +203,18 @@ const module = defineNuxtModule({
|
|
|
146
203
|
nuxt.options.merkaly || {},
|
|
147
204
|
defaultOptions
|
|
148
205
|
);
|
|
149
|
-
return buildModuleDependencies(options);
|
|
206
|
+
return buildModuleDependencies(nuxt, options);
|
|
150
207
|
},
|
|
151
208
|
async setup(options, nuxt) {
|
|
152
209
|
const logger = useLogger("@merkaly/nuxt");
|
|
153
210
|
const resolver = createResolver(import.meta.url);
|
|
211
|
+
configureNotiVue(nuxt);
|
|
154
212
|
configureRuntimeConfig(nuxt, options);
|
|
155
213
|
configurePlausible(nuxt, options);
|
|
156
214
|
configureSentry(nuxt, options);
|
|
157
215
|
const bootstrapComponentsConfig = await loadBootstrapConfig(nuxt);
|
|
158
216
|
if (Object.keys(bootstrapComponentsConfig).length > 0) {
|
|
159
|
-
logger.
|
|
217
|
+
logger.success("Loading bootstrap.config.ts");
|
|
160
218
|
}
|
|
161
219
|
configureBootstrapVueNext(nuxt, bootstrapComponentsConfig);
|
|
162
220
|
configureAppHead(nuxt);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_24: {}, __VLS_26: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
loading?: (props: typeof
|
|
3
|
+
loading?: (props: typeof __VLS_24) => any;
|
|
4
4
|
} & {
|
|
5
|
-
default?: (props: typeof
|
|
5
|
+
default?: (props: typeof __VLS_26) => any;
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
8
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,6 +4,7 @@ import { useAuth, watchOnce, addRouteMiddleware, useNuxtApp } from "#imports";
|
|
|
4
4
|
import AuthMiddleware from "../middleware/auth";
|
|
5
5
|
import { useNavigation } from "../composables/useNavigation";
|
|
6
6
|
import { useColorMode } from "@vueuse/core";
|
|
7
|
+
import { Notivue, NotificationProgress, Notification, pastelTheme } from "notivue";
|
|
7
8
|
const $route = useRoute();
|
|
8
9
|
const { isLoading } = useAuth();
|
|
9
10
|
const { hook } = useNuxtApp();
|
|
@@ -16,6 +17,12 @@ hook("page:finish", () => regenerate());
|
|
|
16
17
|
|
|
17
18
|
<template>
|
|
18
19
|
<main>
|
|
20
|
+
<Notivue v-slot="item">
|
|
21
|
+
<Notification :item="item" :theme="pastelTheme" title>
|
|
22
|
+
<NotificationProgress :item="item" />
|
|
23
|
+
</Notification>
|
|
24
|
+
</Notivue>
|
|
25
|
+
|
|
19
26
|
<BApp>
|
|
20
27
|
<!-- Mostramos spinner mientras auth se carga -->
|
|
21
28
|
<slot v-if="isLoading" name="loading" />
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_24: {}, __VLS_26: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
loading?: (props: typeof
|
|
3
|
+
loading?: (props: typeof __VLS_24) => any;
|
|
4
4
|
} & {
|
|
5
|
-
default?: (props: typeof
|
|
5
|
+
default?: (props: typeof __VLS_26) => any;
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
8
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
3
|
date: {
|
|
4
|
-
type: (
|
|
4
|
+
type: (DateConstructor | StringConstructor)[];
|
|
5
5
|
default: () => Date;
|
|
6
6
|
};
|
|
7
7
|
format: {
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
10
10
|
};
|
|
11
11
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
12
|
date: {
|
|
13
|
-
type: (
|
|
13
|
+
type: (DateConstructor | StringConstructor)[];
|
|
14
14
|
default: () => Date;
|
|
15
15
|
};
|
|
16
16
|
format: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
3
|
date: {
|
|
4
|
-
type: (
|
|
4
|
+
type: (DateConstructor | StringConstructor)[];
|
|
5
5
|
default: () => Date;
|
|
6
6
|
};
|
|
7
7
|
format: {
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
10
10
|
};
|
|
11
11
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
12
|
date: {
|
|
13
|
-
type: (
|
|
13
|
+
type: (DateConstructor | StringConstructor)[];
|
|
14
14
|
default: () => Date;
|
|
15
15
|
};
|
|
16
16
|
format: {
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type { ColorVariant } from 'bootstrap-vue-next';
|
|
1
|
+
import type { ColorVariant, AlignmentVertical, AlignmentHorizontal } from 'bootstrap-vue-next';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
alignH: {
|
|
5
|
+
type: PropType<AlignmentHorizontal>;
|
|
6
|
+
default: () => string;
|
|
7
|
+
};
|
|
8
|
+
alignV: {
|
|
9
|
+
type: PropType<AlignmentVertical>;
|
|
10
|
+
default: () => string;
|
|
11
|
+
};
|
|
4
12
|
mode: {
|
|
5
13
|
type: StringConstructor;
|
|
6
14
|
default: string;
|
|
@@ -10,7 +18,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
10
18
|
required: true;
|
|
11
19
|
};
|
|
12
20
|
opacity: {
|
|
13
|
-
type: (
|
|
21
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
14
22
|
default: () => string;
|
|
15
23
|
};
|
|
16
24
|
provider: {
|
|
@@ -21,6 +29,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
21
29
|
type: BooleanConstructor;
|
|
22
30
|
default: boolean;
|
|
23
31
|
};
|
|
32
|
+
rotate: {
|
|
33
|
+
type: PropType<"90" | 90 | "180" | 180 | "270" | 270>;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
24
36
|
size: {
|
|
25
37
|
type: StringConstructor;
|
|
26
38
|
default: () => string;
|
|
@@ -42,6 +54,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
42
54
|
default: () => string;
|
|
43
55
|
};
|
|
44
56
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
alignH: {
|
|
58
|
+
type: PropType<AlignmentHorizontal>;
|
|
59
|
+
default: () => string;
|
|
60
|
+
};
|
|
61
|
+
alignV: {
|
|
62
|
+
type: PropType<AlignmentVertical>;
|
|
63
|
+
default: () => string;
|
|
64
|
+
};
|
|
45
65
|
mode: {
|
|
46
66
|
type: StringConstructor;
|
|
47
67
|
default: string;
|
|
@@ -51,7 +71,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
51
71
|
required: true;
|
|
52
72
|
};
|
|
53
73
|
opacity: {
|
|
54
|
-
type: (
|
|
74
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
55
75
|
default: () => string;
|
|
56
76
|
};
|
|
57
77
|
provider: {
|
|
@@ -62,6 +82,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
62
82
|
type: BooleanConstructor;
|
|
63
83
|
default: boolean;
|
|
64
84
|
};
|
|
85
|
+
rotate: {
|
|
86
|
+
type: PropType<"90" | 90 | "180" | 180 | "270" | 270>;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
65
89
|
size: {
|
|
66
90
|
type: StringConstructor;
|
|
67
91
|
default: () => string;
|
|
@@ -86,9 +110,12 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
86
110
|
text: string;
|
|
87
111
|
mode: string;
|
|
88
112
|
size: string;
|
|
89
|
-
|
|
90
|
-
variant: string;
|
|
113
|
+
rotate: "90" | 90 | "180" | 180 | "270" | 270;
|
|
91
114
|
opacity: string | number;
|
|
115
|
+
variant: string;
|
|
116
|
+
tag: string;
|
|
117
|
+
alignH: AlignmentHorizontal;
|
|
118
|
+
alignV: AlignmentVertical;
|
|
92
119
|
provider: string;
|
|
93
120
|
reversed: boolean;
|
|
94
121
|
spin: boolean;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
|
|
4
|
+
alignH: { type: String, default: () => "start" },
|
|
5
|
+
alignV: { type: String, default: () => "center" },
|
|
6
|
+
mode: { type: String, default: "regular" },
|
|
5
7
|
name: { type: String, required: true },
|
|
6
8
|
opacity: { type: [String, Number], default: () => "" },
|
|
7
9
|
provider: { type: String, default: "fa" },
|
|
8
10
|
reversed: { type: Boolean, default: false },
|
|
11
|
+
rotate: { type: [Number, String], default: void 0 },
|
|
9
12
|
size: { type: String, default: () => "" },
|
|
10
13
|
spin: { type: Boolean, default: false },
|
|
11
14
|
tag: { type: String, default: () => "i" },
|
|
@@ -18,27 +21,39 @@ const iconName = computed(() => `${props.provider}-${props.name}`);
|
|
|
18
21
|
const iconMode = computed(() => `${props.provider}-${props.mode}`);
|
|
19
22
|
const animateSpin = computed(() => props.spin ? `${props.provider}-spin` : void 0);
|
|
20
23
|
const iconOpacity = computed(() => props.opacity ? `opacity-${props.opacity}` : void 0);
|
|
24
|
+
const iconRotate = computed(() => props.rotate ? `fa-rotate-${props.rotate}` : void 0);
|
|
21
25
|
const fontSize = computed(() => props.size ? `fs-${props.size}` : void 0);
|
|
22
26
|
const fontColor = computed(() => props.variant ? `text-${props.variant}` : void 0);
|
|
23
27
|
const classList = computed(() => [
|
|
24
28
|
iconName.value,
|
|
25
29
|
iconMode.value,
|
|
30
|
+
iconRotate.value,
|
|
26
31
|
animateSpin.value,
|
|
27
32
|
iconOpacity.value,
|
|
28
33
|
fontSize.value,
|
|
29
34
|
fontColor.value
|
|
30
35
|
].filter(Boolean));
|
|
36
|
+
const wrapperClass = computed(() => [
|
|
37
|
+
"d-flex",
|
|
38
|
+
`justify-content-${props.alignH}`,
|
|
39
|
+
`align-items-${props.alignV}`,
|
|
40
|
+
{ "flex-row-reverse": props.reversed }
|
|
41
|
+
]);
|
|
42
|
+
defineOptions({
|
|
43
|
+
inheritAttrs: false
|
|
44
|
+
});
|
|
31
45
|
</script>
|
|
32
46
|
|
|
33
47
|
<template>
|
|
34
48
|
<template v-if="hasContent">
|
|
35
|
-
<span :class="
|
|
36
|
-
<component :is="props.tag" :class="classList" />
|
|
49
|
+
<span :class="wrapperClass">
|
|
50
|
+
<component :is="props.tag" :class="classList" v-bind="$attrs" />
|
|
51
|
+
|
|
37
52
|
<slot>
|
|
38
|
-
<span :class="fontColor
|
|
53
|
+
<span :class="[fontColor, `${props.reversed ? 'pe-1' : 'ps-1'}`]" v-text="props.text" />
|
|
39
54
|
</slot>
|
|
40
55
|
</span>
|
|
41
56
|
</template>
|
|
42
57
|
|
|
43
|
-
<component :is="props.tag" v-else :class="classList" />
|
|
58
|
+
<component :is="props.tag" v-else :class="classList" v-bind="$attrs" />
|
|
44
59
|
</template>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type { ColorVariant } from 'bootstrap-vue-next';
|
|
1
|
+
import type { ColorVariant, AlignmentVertical, AlignmentHorizontal } from 'bootstrap-vue-next';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
alignH: {
|
|
5
|
+
type: PropType<AlignmentHorizontal>;
|
|
6
|
+
default: () => string;
|
|
7
|
+
};
|
|
8
|
+
alignV: {
|
|
9
|
+
type: PropType<AlignmentVertical>;
|
|
10
|
+
default: () => string;
|
|
11
|
+
};
|
|
4
12
|
mode: {
|
|
5
13
|
type: StringConstructor;
|
|
6
14
|
default: string;
|
|
@@ -10,7 +18,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
10
18
|
required: true;
|
|
11
19
|
};
|
|
12
20
|
opacity: {
|
|
13
|
-
type: (
|
|
21
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
14
22
|
default: () => string;
|
|
15
23
|
};
|
|
16
24
|
provider: {
|
|
@@ -21,6 +29,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
21
29
|
type: BooleanConstructor;
|
|
22
30
|
default: boolean;
|
|
23
31
|
};
|
|
32
|
+
rotate: {
|
|
33
|
+
type: PropType<"90" | 90 | "180" | 180 | "270" | 270>;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
24
36
|
size: {
|
|
25
37
|
type: StringConstructor;
|
|
26
38
|
default: () => string;
|
|
@@ -42,6 +54,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
42
54
|
default: () => string;
|
|
43
55
|
};
|
|
44
56
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
alignH: {
|
|
58
|
+
type: PropType<AlignmentHorizontal>;
|
|
59
|
+
default: () => string;
|
|
60
|
+
};
|
|
61
|
+
alignV: {
|
|
62
|
+
type: PropType<AlignmentVertical>;
|
|
63
|
+
default: () => string;
|
|
64
|
+
};
|
|
45
65
|
mode: {
|
|
46
66
|
type: StringConstructor;
|
|
47
67
|
default: string;
|
|
@@ -51,7 +71,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
51
71
|
required: true;
|
|
52
72
|
};
|
|
53
73
|
opacity: {
|
|
54
|
-
type: (
|
|
74
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
55
75
|
default: () => string;
|
|
56
76
|
};
|
|
57
77
|
provider: {
|
|
@@ -62,6 +82,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
62
82
|
type: BooleanConstructor;
|
|
63
83
|
default: boolean;
|
|
64
84
|
};
|
|
85
|
+
rotate: {
|
|
86
|
+
type: PropType<"90" | 90 | "180" | 180 | "270" | 270>;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
65
89
|
size: {
|
|
66
90
|
type: StringConstructor;
|
|
67
91
|
default: () => string;
|
|
@@ -86,9 +110,12 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
86
110
|
text: string;
|
|
87
111
|
mode: string;
|
|
88
112
|
size: string;
|
|
89
|
-
|
|
90
|
-
variant: string;
|
|
113
|
+
rotate: "90" | 90 | "180" | 180 | "270" | 270;
|
|
91
114
|
opacity: string | number;
|
|
115
|
+
variant: string;
|
|
116
|
+
tag: string;
|
|
117
|
+
alignH: AlignmentHorizontal;
|
|
118
|
+
alignV: AlignmentVertical;
|
|
92
119
|
provider: string;
|
|
93
120
|
reversed: boolean;
|
|
94
121
|
spin: boolean;
|
|
@@ -59,12 +59,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
};
|
|
60
60
|
}>> & Readonly<{}>, {
|
|
61
61
|
mode: keyof Intl.NumberFormatOptionsStyleRegistry;
|
|
62
|
+
value: number;
|
|
62
63
|
currency: string;
|
|
63
64
|
base: number;
|
|
64
|
-
locale: string;
|
|
65
|
-
value: number;
|
|
66
65
|
tag: string;
|
|
67
66
|
hideDecimal: boolean;
|
|
67
|
+
locale: string;
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
70
70
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { formatMoney } from "../../utils/formatMoney";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
base: { type: Number, default: 100 },
|
|
6
6
|
currency: { type: String, default: () => "USD" },
|
|
@@ -10,12 +10,12 @@ const props = defineProps({
|
|
|
10
10
|
tag: { type: String, default: "span" },
|
|
11
11
|
value: { type: Number, default: 0 }
|
|
12
12
|
});
|
|
13
|
-
const money =
|
|
14
|
-
base:
|
|
15
|
-
currency:
|
|
16
|
-
locale:
|
|
17
|
-
mode:
|
|
18
|
-
});
|
|
13
|
+
const money = computed(() => formatMoney(props.value, {
|
|
14
|
+
base: props.base,
|
|
15
|
+
currency: props.currency,
|
|
16
|
+
locale: props.locale,
|
|
17
|
+
mode: props.mode
|
|
18
|
+
}));
|
|
19
19
|
const price = computed(() => ({
|
|
20
20
|
currency: money.value[0],
|
|
21
21
|
amount: money.value.slice(1, -3),
|
|
@@ -59,12 +59,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
};
|
|
60
60
|
}>> & Readonly<{}>, {
|
|
61
61
|
mode: keyof Intl.NumberFormatOptionsStyleRegistry;
|
|
62
|
+
value: number;
|
|
62
63
|
currency: string;
|
|
63
64
|
base: number;
|
|
64
|
-
locale: string;
|
|
65
|
-
value: number;
|
|
66
65
|
tag: string;
|
|
67
66
|
hideDecimal: boolean;
|
|
67
|
+
locale: string;
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
70
70
|
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
currency: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: () => string;
|
|
6
|
+
};
|
|
7
|
+
tag: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
value: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
type: {
|
|
16
|
+
type: PropType<Intl.NumberFormatOptions["style"]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
maxFractionDigits: {
|
|
20
|
+
type: PropType<Intl.NumberFormatOptions["maximumFractionDigits"]>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
currency: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: () => string;
|
|
27
|
+
};
|
|
28
|
+
tag: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
value: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
type: {
|
|
37
|
+
type: PropType<Intl.NumberFormatOptions["style"]>;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
maxFractionDigits: {
|
|
41
|
+
type: PropType<Intl.NumberFormatOptions["maximumFractionDigits"]>;
|
|
42
|
+
default: undefined;
|
|
43
|
+
};
|
|
44
|
+
}>> & Readonly<{}>, {
|
|
45
|
+
type: keyof Intl.NumberFormatOptionsStyleRegistry | undefined;
|
|
46
|
+
value: number;
|
|
47
|
+
currency: string;
|
|
48
|
+
tag: string;
|
|
49
|
+
maxFractionDigits: number | undefined;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
51
|
+
declare const _default: typeof __VLS_export;
|
|
52
|
+
export default _default;
|