@verdnatura/vn-front-lib 0.0.11 → 0.0.13
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 +22 -13
- package/dist/components-D0h9vBQX.js +4789 -0
- package/dist/components-cImd3SSZ.cjs +2 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/composables-BRRRUB-j.cjs +4 -0
- package/dist/composables-DKarSsx2.js +2283 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +2 -2
- package/dist/vn-front-lib.cjs +1 -1
- package/dist/vn-front-lib.css +1 -1
- package/dist/vn-front-lib.js +6 -6
- package/lib/components/dialogs/VnConfirm.vue +3 -3
- package/lib/components/inputs/VnInput.vue +5 -0
- package/lib/components/models/VnForm.vue +2 -2
- package/lib/composables/index.js +1 -0
- package/lib/composables/useGlobalMessages.js +12 -0
- package/lib/composables/useNotify.js +6 -7
- package/lib/i18n/locale/en.yml +17 -2
- package/lib/i18n/locale/es.yml +17 -2
- package/package.json +2 -3
- package/dist/components-BrEjZWQj.js +0 -3278
- package/dist/components-Dty6kM2e.cjs +0 -2
- package/dist/composables-DUOUI4DI.js +0 -3558
- package/dist/composables-ZxHJjJGN.cjs +0 -4
package/dist/composables.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./composables-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./composables-BRRRUB-j.cjs");exports.fetchLocalData=e.n,exports.focusFirstInput=e.p,exports.getObjectByKeys=e.a,exports.getObjectDifferences=e.o,exports.getRemoteAndLocalParams=e.r,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return e.d}}),exports.isComparableObject=e.s,exports.isSameValue=e.c,exports.requestData=e.i,exports.tMobile=e.h,exports.useArrayData=e.m,exports.useGlobalMessages=e.f,exports.useNotify=e.u,exports.useObjectComparison=e.l,exports.useRequired=e.g,exports.useState=e.t,exports.useValidator=e._;
|
package/dist/composables.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./composables-DKarSsx2.js";
|
|
2
|
+
export { u as fetchLocalData, f as focusFirstInput, t as getObjectByKeys, d as getObjectDifferences, p as getRemoteAndLocalParams, r as i18n, m as isComparableObject, n as isSameValue, s as requestData, o as tMobile, l as useArrayData, i as useGlobalMessages, g as useNotify, c as useObjectComparison, a as useRequired, h as useState, e as useValidator };
|
package/dist/vn-front-lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./composables-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./composables-BRRRUB-j.cjs"),t=require("./components-cImd3SSZ.cjs");function n(e){for(let n in t.t)e.component(n,t.t[n])}var r={install:n};exports.VnConfirm=t.s,exports.VnFetch=t.r,exports.VnForm=t.n,exports.VnInput=t.i,exports.VnSkeletonForm=t.o,exports.VnSpinner=t.a,exports.default=r,exports.fetchLocalData=e.n,exports.focusFirstInput=e.p,exports.getObjectByKeys=e.a,exports.getObjectDifferences=e.o,exports.getRemoteAndLocalParams=e.r,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return e.d}}),exports.isComparableObject=e.s,exports.isSameValue=e.c,exports.requestData=e.i,exports.tMobile=e.h,exports.useArrayData=e.m,exports.useGlobalMessages=e.f,exports.useNotify=e.u,exports.useObjectComparison=e.l,exports.useRequired=e.g,exports.useState=e.t,exports.useValidator=e._;
|
package/dist/vn-front-lib.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.q-card[data-v-
|
|
1
|
+
.q-card[data-v-67508d3b]{white-space:pre-line;min-width:350px}.vn-spinner[data-v-e5edebae]{border:3px solid color-mix(in srgb, var(--vn-label-color) 15%, transparent);border-top-color:var(--q-primary);box-sizing:border-box;border-radius:50%;min-width:16px;min-height:16px;animation:.7s cubic-bezier(.4,.15,.6,.85) infinite vn-spin-e5edebae}@keyframes vn-spin-e5edebae{to{transform:rotate(360deg)}}.vn-spinner-fade-enter-active[data-v-e5edebae],.vn-spinner-fade-leave-active[data-v-e5edebae]{transition:opacity .3s,transform .3s}.vn-spinner-fade-enter-from[data-v-e5edebae],.vn-spinner-fade-leave-to[data-v-e5edebae]{opacity:0;transform:scale(.6)}.uppercase-icon{cursor:pointer;transition:color .3s,transform .2s}.uppercase-icon:hover{color:var(--q-color-primary);transform:scale(1.2)}.q-notifications[data-v-4f7a49f7]{color:#000}.q-card[data-v-4f7a49f7]{padding:32px}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/vn-front-lib.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./composables-DKarSsx2.js";
|
|
2
|
+
import { a as _, i as v, n as y, o as b, r as x, s as S, t as C } from "./components-D0h9vBQX.js";
|
|
3
3
|
//#region lib/main.js
|
|
4
|
-
function
|
|
5
|
-
for (let t in
|
|
4
|
+
function w(e) {
|
|
5
|
+
for (let t in C) e.component(t, C[t]);
|
|
6
6
|
}
|
|
7
|
-
var
|
|
7
|
+
var T = { install: w };
|
|
8
8
|
//#endregion
|
|
9
|
-
export {
|
|
9
|
+
export { S as VnConfirm, x as VnFetch, y as VnForm, v as VnInput, b as VnSkeletonForm, _ as VnSpinner, T as default, u as fetchLocalData, f as focusFirstInput, t as getObjectByKeys, d as getObjectDifferences, p as getRemoteAndLocalParams, r as i18n, m as isComparableObject, n as isSameValue, s as requestData, o as tMobile, l as useArrayData, i as useGlobalMessages, g as useNotify, c as useObjectComparison, a as useRequired, h as useState, e as useValidator };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref } from 'vue';
|
|
3
|
-
import
|
|
3
|
+
import * as quasarPkg from 'quasar';
|
|
4
4
|
import { useI18n } from 'vue-i18n';
|
|
5
5
|
|
|
6
6
|
const { t } = useI18n();
|
|
@@ -42,11 +42,11 @@ const props = defineProps({
|
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const emit = defineEmits(['confirm', 'cancel', ...useDialogPluginComponent.emits]);
|
|
45
|
+
const emit = defineEmits(['confirm', 'cancel', ...quasarPkg.useDialogPluginComponent.emits]);
|
|
46
46
|
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
|
|
47
47
|
|
|
48
48
|
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
|
|
49
|
-
useDialogPluginComponent();
|
|
49
|
+
quasarPkg.useDialogPluginComponent();
|
|
50
50
|
|
|
51
51
|
const title = props.title || t('Confirm');
|
|
52
52
|
const message =
|
|
@@ -37,6 +37,10 @@ const $props = defineProps({
|
|
|
37
37
|
type: Boolean,
|
|
38
38
|
default: false,
|
|
39
39
|
},
|
|
40
|
+
clearOnHover: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
40
44
|
});
|
|
41
45
|
|
|
42
46
|
const model = defineModel({ default: null });
|
|
@@ -177,6 +181,7 @@ onMounted(() => {
|
|
|
177
181
|
<QIcon
|
|
178
182
|
name="close"
|
|
179
183
|
size="xs"
|
|
184
|
+
v-show="!clearOnHover || hover"
|
|
180
185
|
class="cursor-pointer"
|
|
181
186
|
:style="{
|
|
182
187
|
visibility:
|
|
@@ -3,7 +3,7 @@ import axios from 'axios';
|
|
|
3
3
|
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
|
|
4
4
|
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router';
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
|
-
import
|
|
6
|
+
import * as quasarPkg from 'quasar';
|
|
7
7
|
import {
|
|
8
8
|
useState,
|
|
9
9
|
useValidator,
|
|
@@ -16,7 +16,7 @@ import { useStateStore } from 'lib/stores';
|
|
|
16
16
|
import { VnConfirm, VnSpinner, VnSkeletonForm } from 'lib/components';
|
|
17
17
|
import { onBeforeSave } from 'lib/filters';
|
|
18
18
|
const { push } = useRouter();
|
|
19
|
-
const quasar = useQuasar();
|
|
19
|
+
const quasar = quasarPkg.useQuasar();
|
|
20
20
|
const state = useState();
|
|
21
21
|
const stateStore = useStateStore();
|
|
22
22
|
const { t } = useI18n();
|
package/lib/composables/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export let i18n;
|
|
2
|
+
export function useGlobalMessages(_i18n) {
|
|
3
|
+
i18n = _i18n;
|
|
4
|
+
const files = import.meta.glob('../i18n/locale/*.yml', {
|
|
5
|
+
eager: true,
|
|
6
|
+
import: 'default',
|
|
7
|
+
});
|
|
8
|
+
for (const [file, content] of Object.entries(files)) {
|
|
9
|
+
const lang = file.split('/').pop().split('.')[0];
|
|
10
|
+
i18n.global.mergeLocaleMessage(lang, { vnFrontLib: content });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as quasar from 'quasar';
|
|
2
|
+
import { i18n } from './useGlobalMessages';
|
|
3
3
|
|
|
4
4
|
export function useNotify() {
|
|
5
|
-
const { t } = useI18n();
|
|
6
5
|
const notify = (message, type = 'positive', icon, opts = {}) => {
|
|
7
6
|
const defaultIcons = {
|
|
8
7
|
warning: 'warning',
|
|
9
8
|
negative: 'error',
|
|
10
9
|
positive: 'check',
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
message: t(message, opts.translationParams || {}),
|
|
11
|
+
const payload = {
|
|
12
|
+
message: i18n.global.t(message, opts.translationParams || {}),
|
|
15
13
|
type: type,
|
|
16
14
|
icon: icon ? icon : defaultIcons[type],
|
|
17
15
|
...opts,
|
|
18
|
-
}
|
|
16
|
+
};
|
|
17
|
+
quasar.Notify.create(payload);
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
return {
|
package/lib/i18n/locale/en.yml
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
globals:
|
|
2
|
-
fieldRequired:
|
|
3
|
-
valueCantBeEmpty:
|
|
2
|
+
fieldRequired: Field required
|
|
3
|
+
valueCantBeEmpty: Value cannot be empty
|
|
4
|
+
cancel: Cancel
|
|
5
|
+
confirm: Confirm
|
|
6
|
+
pleaseWait: Please wait...
|
|
7
|
+
saveAndContinue: Save and go to
|
|
8
|
+
unsavedPopup:
|
|
9
|
+
title: Unsaved changes will be lost
|
|
10
|
+
subtitle: Are you sure exit without saving?
|
|
11
|
+
pageTitles:
|
|
12
|
+
basicData: Basic data
|
|
4
13
|
inputMin: Must be more than {value}
|
|
14
|
+
inputMax: Must be less than {value}
|
|
15
|
+
maxLength: Must not exceed {value} characters
|
|
16
|
+
Confirm: Confirm
|
|
17
|
+
Are you sure you want to continue?: Are you sure you want to continue?
|
|
18
|
+
Remove: Remove
|
|
19
|
+
Convert to uppercase: Convert to uppercase
|
package/lib/i18n/locale/es.yml
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
globals:
|
|
2
|
-
fieldRequired:
|
|
3
|
-
valueCantBeEmpty:
|
|
2
|
+
fieldRequired: Campo requerido
|
|
3
|
+
valueCantBeEmpty: El valor no puede estar vacío
|
|
4
|
+
cancel: Cancelar
|
|
5
|
+
confirm: Confirmar
|
|
6
|
+
pleaseWait: Por favor espera...
|
|
7
|
+
saveAndContinue: Guardar e ir a
|
|
8
|
+
unsavedPopup:
|
|
9
|
+
title: Los cambios que no haya guardado se perderán
|
|
10
|
+
subtitle: ¿Seguro que quiere salir sin guardar?
|
|
11
|
+
pageTitles:
|
|
12
|
+
basicData: Datos básicos
|
|
4
13
|
inputMin: Debe ser mayor a {value}
|
|
14
|
+
inputMax: Debe ser menor a {value}
|
|
15
|
+
maxLength: No debe superar los {value} caracteres
|
|
16
|
+
Confirm: Confirmar
|
|
17
|
+
Are you sure you want to continue?: ¿Seguro que quieres continuar?
|
|
18
|
+
Remove: Eliminar
|
|
19
|
+
Convert to uppercase: Convertir a mayúsculas
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdnatura/vn-front-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Vue 3 component and composable library",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"author": "Verdnatura Levante SL",
|
|
@@ -67,8 +67,7 @@
|
|
|
67
67
|
"vite": "^8.1.1",
|
|
68
68
|
"vitest": "^4.1.10",
|
|
69
69
|
"vue": "^3.5.13",
|
|
70
|
-
"vue-i18n": "^9.14.4"
|
|
71
|
-
"yaml": "^2.9.0"
|
|
70
|
+
"vue-i18n": "^9.14.4"
|
|
72
71
|
},
|
|
73
72
|
"peerDependencies": {
|
|
74
73
|
"axios": ">=1.0.0",
|