@verdnatura/vn-front-lib 0.0.9 → 0.0.11
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/components-BrEjZWQj.js +3278 -0
- package/dist/components-Dty6kM2e.cjs +2 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +2 -2
- package/dist/composables-DUOUI4DI.js +3558 -0
- package/dist/composables-ZxHJjJGN.cjs +4 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +2 -2
- package/dist/filters.cjs +1 -0
- package/dist/filters.js +62 -0
- package/dist/rolldown-runtime-DF3sbh8G.cjs +1 -0
- package/dist/stores.cjs +1 -1
- package/dist/stores.js +144 -2
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +131 -0
- package/dist/vn-front-lib.cjs +1 -1
- package/dist/vn-front-lib.css +1 -1
- package/dist/vn-front-lib.js +6 -7
- package/lib/components/dialogs/VnConfirm.vue +142 -0
- package/lib/components/feedback/VnSkeletonForm.vue +14 -0
- package/lib/components/feedback/VnSpinner.vue +63 -0
- package/lib/components/index.js +5 -0
- package/lib/components/models/VnFetch.vue +65 -0
- package/lib/components/models/VnForm.vue +492 -0
- package/lib/composables/index.js +7 -0
- package/lib/composables/tMobile.js +8 -0
- package/lib/composables/useArrayData.js +451 -0
- package/lib/composables/useForm.js +12 -0
- package/lib/composables/useNotify.js +24 -0
- package/lib/composables/useObjectComparison.js +67 -0
- package/lib/composables/useQueryResolver.js +306 -0
- package/lib/composables/useState.js +81 -0
- package/lib/filters/filterPanel.js +95 -0
- package/lib/filters/getDifferences.js +18 -0
- package/lib/filters/getUpdatedValues.js +6 -0
- package/lib/filters/index.js +5 -0
- package/lib/filters/isDialogOpened.js +3 -0
- package/lib/filters/onBeforeSave.js +9 -0
- package/lib/stores/index.js +2 -0
- package/lib/stores/useArrayDataStore.js +82 -0
- package/lib/stores/useStateStore.js +84 -0
- package/lib/utils/advancedFilters.js +125 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/trackAnalytics.js +18 -0
- package/package.json +9 -2
- package/dist/components-BLui5eyq.cjs +0 -1
- package/dist/components-Dl-Ieazh.js +0 -2466
- package/dist/useRequired-BqsSq8Mw.cjs +0 -1
- package/dist/useRequired-CTxBp3qy.js +0 -58
- package/dist/useValidationsStore-8JX1-oLO.cjs +0 -1
- package/dist/useValidationsStore-9Fxtj_pd.js +0 -12
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./useValidationsStore-8JX1-oLO.cjs");let t=require("vue-i18n"),n=require("validator");n=e.r(n,1);function r(){let r=e.t().validations;function i(e){let t=r;if(!t||!e)return;let n=e.split(`.`),i=n[0],a=n[1],s=i.charAt(0).toUpperCase()+i.slice(1);if(!t[s])return;let c=t[s].validations;if(c[a])return c[a].map(e=>o(e)[e.validation])}let{t:a}=(0,t.useI18n)({useScope:`global`}),o=function(e={}){return{format:t=>{let{allowNull:n,with:r,allowBlank:i}=e,o=a(e.message)||e.message;if(!i&&t===``||!n&&t===null||!new RegExp(r).test(t))return o},presence:t=>{let r=a(`globals.valueCantBeEmpty`);return e.message&&(r=a(e.message)||e.message),!n.default.isEmpty(t?String(t):``)||r},required:(e,t)=>e?t===0||!!t||a(`globals.fieldRequired`):null,length:t=>{let r={min:e.min||e.is,max:e.max||e.is};t=String(t),t||=``;let i=`Value should have at most ${r.max} characters`;return e.is&&(i=`Value should be ${e.is} characters long`),e.min&&(i=`Value should have at least ${e.min} characters`),e.min&&e.max&&(i=`Value should have a length between ${e.min} and ${e.max}`),n.default.isLength(t,r)||i},numericality:t=>e.int?n.default.isInt(t)||`Value should be integer`:n.default.isNumeric(t)||`Value should be a number`,min:(e,t)=>{if(t>=0&&Math.floor(e)<t)return a(`inputMin`,{value:t})},custom:t=>Function(`return (${e.bindedFunction})`)()(t)||`Invalid value`}};return{validate:i,validations:o,models:r}}function i(e){let{validations:t}=r(),n=typeof e.required==`boolean`?e.required:Object.keys(e).includes(`required`);return{isRequired:n,requiredFieldRule:e=>t().required(n,e)}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./useValidationsStore-9Fxtj_pd.js";
|
|
2
|
-
import { useI18n as t } from "vue-i18n";
|
|
3
|
-
import n from "validator";
|
|
4
|
-
//#region lib/composables/useValidator.js
|
|
5
|
-
function r() {
|
|
6
|
-
let r = e().validations;
|
|
7
|
-
function i(e) {
|
|
8
|
-
let t = r;
|
|
9
|
-
if (!t || !e) return;
|
|
10
|
-
let n = e.split("."), i = n[0], a = n[1], s = i.charAt(0).toUpperCase() + i.slice(1);
|
|
11
|
-
if (!t[s]) return;
|
|
12
|
-
let c = t[s].validations;
|
|
13
|
-
if (c[a]) return c[a].map((e) => o(e)[e.validation]);
|
|
14
|
-
}
|
|
15
|
-
let { t: a } = t({ useScope: "global" }), o = function(e = {}) {
|
|
16
|
-
return {
|
|
17
|
-
format: (t) => {
|
|
18
|
-
let { allowNull: n, with: r, allowBlank: i } = e, o = a(e.message) || e.message;
|
|
19
|
-
if (!i && t === "" || !n && t === null || !new RegExp(r).test(t)) return o;
|
|
20
|
-
},
|
|
21
|
-
presence: (t) => {
|
|
22
|
-
let r = a("globals.valueCantBeEmpty");
|
|
23
|
-
return e.message && (r = a(e.message) || e.message), !n.isEmpty(t ? String(t) : "") || r;
|
|
24
|
-
},
|
|
25
|
-
required: (e, t) => e ? t === 0 || !!t || a("globals.fieldRequired") : null,
|
|
26
|
-
length: (t) => {
|
|
27
|
-
let r = {
|
|
28
|
-
min: e.min || e.is,
|
|
29
|
-
max: e.max || e.is
|
|
30
|
-
};
|
|
31
|
-
t = String(t), t ||= "";
|
|
32
|
-
let i = `Value should have at most ${r.max} characters`;
|
|
33
|
-
return e.is && (i = `Value should be ${e.is} characters long`), e.min && (i = `Value should have at least ${e.min} characters`), e.min && e.max && (i = `Value should have a length between ${e.min} and ${e.max}`), n.isLength(t, r) || i;
|
|
34
|
-
},
|
|
35
|
-
numericality: (t) => e.int ? n.isInt(t) || "Value should be integer" : n.isNumeric(t) || "Value should be a number",
|
|
36
|
-
min: (e, t) => {
|
|
37
|
-
if (t >= 0 && Math.floor(e) < t) return a("inputMin", { value: t });
|
|
38
|
-
},
|
|
39
|
-
custom: (t) => Function(`return (${e.bindedFunction})`)()(t) || "Invalid value"
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
validate: i,
|
|
44
|
-
validations: o,
|
|
45
|
-
models: r
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region lib/composables/useRequired.js
|
|
50
|
-
function i(e) {
|
|
51
|
-
let { validations: t } = r(), n = typeof e.required == "boolean" ? e.required : Object.keys(e).includes("required");
|
|
52
|
-
return {
|
|
53
|
-
isRequired: n,
|
|
54
|
-
requiredFieldRule: (e) => t().required(n, e)
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
export { r as n, i as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require("pinia"),u=require("axios");u=c(u,1);var d=(0,l.defineStore)(`validationsStore`,{state:()=>({validations:null}),actions:{async fetchModels(){let{data:e}=await u.default.get(`Schemas/modelinfo`);this.validations=e}}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineStore as e } from "pinia";
|
|
2
|
-
import t from "axios";
|
|
3
|
-
//#region lib/stores/useValidationsStore.js
|
|
4
|
-
var n = e("validationsStore", {
|
|
5
|
-
state: () => ({ validations: null }),
|
|
6
|
-
actions: { async fetchModels() {
|
|
7
|
-
let { data: e } = await t.get("Schemas/modelinfo");
|
|
8
|
-
this.validations = e;
|
|
9
|
-
} }
|
|
10
|
-
});
|
|
11
|
-
//#endregion
|
|
12
|
-
export { n as t };
|