@verdnatura/vn-front-lib 0.1.3 → 0.1.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/components-Bzkod14A.cjs +15 -0
- package/dist/components-CGtJrHS1.js +14051 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/{composables-C8hw-mbt.js → composables-BDoUoFC_.js} +554 -554
- package/dist/composables.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +20 -14
- package/dist/vn-front-lib.cjs +1 -1
- package/dist/vn-front-lib.js +2 -2
- package/lib/utils/advancedFilters.js +21 -8
- package/package.json +1 -1
- package/dist/components-CrAKAINn.js +0 -9547
- package/dist/components-Db6HFd9F.cjs +0 -15
package/dist/composables.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-BDoUoFC_.js";
|
|
2
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/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-DF3sbh8G.cjs");let t=require("axios");t=e.r(t,1);var n=`eq`,r={eq:{icon:`=`,label:`equal`,operator:`eq`,default:!0,expr:e=>e,localEval:(e,t)=>e==t,isBasic:!0},neq:{icon:`≠`,label:`distinct`,operator:`neq`,expr:e=>({neq:e}),isNegation:!0,localEval:(e,t)=>e!=t},inq:{icon:`∈`,label:`include`,operator:`inq`,isArray:!0,expr:e=>({inq:e}),localEval:(e,t)=>t.includes(e)},nin:{icon:`∉`,label:`exclude`,operator:`nin`,isArray:!0,expr:e=>({nin:e}),isNegation:!0,localEval:(e,t)=>!t.includes(e)},like:{icon:`%`,label:`contains`,operator:`like`,isInput:!0,expr:e=>({like:a(e,`%${e}%`)}),localEval:(e,t)=>o(e,t)},nlike:{icon:`≁`,label:`notContains`,operator:`nlike`,isInput:!0,expr:e=>({nlike:a(e,`%${e}%`)}),isNegation:!0,localEval:(e,t)=>!o(e,t)},lt:{icon:`<`,label:`lessThan`,operator:`lt`,expr:e=>({lt:e}),localEval:(e,t)=>e<t,isInput:!0},gt:{icon:`>`,label:`greaterThan`,operator:`gt`,isInput:!0,expr:e=>({gt:e}),localEval:(e,t)=>e>t},lte:{icon:`≤`,label:`lessThanEqualTo`,operator:`lte`,isInput:!0,expr:e=>({lte:e}),localEval:(e,t)=>e<=t},gte:{icon:`≥`,label:`greaterThanEqualTo`,operator:`gte`,isInput:!0,expr:e=>({gte:e}),localEval:(e,t)=>e>=t},null:{icon:`∅`,label:`null`,operator:`null`,expr:()=>({eq:null}),localEval:e=>e==null,isBasic:!0,isNullable:!0},notNull:{icon:`≠`,label:`notNull`,operator:`notNull`,expr:()=>({neq:null}),localEval:e=>e!=null,isBasic:!0,isNullable:!0}},i=Object.values(r);function a(e,t){return e.includes(`%`)?e:t}function o(e,t){let n=e==null?``:String(e),r=(t==null?``:String(t)).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/%/g,`.*`).replace(/_/g,`.`);return RegExp(`^${r}$`,`i`).test(n)}var
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-DF3sbh8G.cjs");let t=require("axios");t=e.r(t,1);var n=`eq`,r={eq:{icon:`=`,label:`equal`,operator:`eq`,default:!0,expr:e=>s(e),localEval:(e,t)=>e==t,isBasic:!0},neq:{icon:`≠`,label:`distinct`,operator:`neq`,expr:e=>({neq:s(e)}),isNegation:!0,localEval:(e,t)=>e!=t},inq:{icon:`∈`,label:`include`,operator:`inq`,isArray:!0,expr:e=>({inq:s(e)}),localEval:(e,t)=>t.includes(e)},nin:{icon:`∉`,label:`exclude`,operator:`nin`,isArray:!0,expr:e=>({nin:s(e)}),isNegation:!0,localEval:(e,t)=>!t.includes(e)},like:{icon:`%`,label:`contains`,operator:`like`,isInput:!0,expr:e=>({like:a(e,`%${e}%`)}),localEval:(e,t)=>o(e,t)},nlike:{icon:`≁`,label:`notContains`,operator:`nlike`,isInput:!0,expr:e=>({nlike:a(e,`%${e}%`)}),isNegation:!0,localEval:(e,t)=>!o(e,t)},lt:{icon:`<`,label:`lessThan`,operator:`lt`,expr:e=>({lt:s(e)}),localEval:(e,t)=>e<t,isInput:!0},gt:{icon:`>`,label:`greaterThan`,operator:`gt`,isInput:!0,expr:e=>({gt:s(e)}),localEval:(e,t)=>e>t},lte:{icon:`≤`,label:`lessThanEqualTo`,operator:`lte`,isInput:!0,expr:e=>({lte:s(e)}),localEval:(e,t)=>e<=t},gte:{icon:`≥`,label:`greaterThanEqualTo`,operator:`gte`,isInput:!0,expr:e=>({gte:s(e)}),localEval:(e,t)=>e>=t},null:{icon:`∅`,label:`null`,operator:`null`,expr:()=>({eq:null}),localEval:e=>e==null,isBasic:!0,isNullable:!0},notNull:{icon:`≠`,label:`notNull`,operator:`notNull`,expr:()=>({neq:null}),localEval:e=>e!=null,isBasic:!0,isNullable:!0}},i=Object.values(r);function a(e,t){return e.includes(`%`)?e:t}function o(e,t){let n=e==null?``:String(e),r=(t==null?``:String(t)).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/%/g,`.*`).replace(/_/g,`.`);return RegExp(`^${r}$`,`i`).test(n)}function s(e){return c(e)?new Intl.DateTimeFormat(`en-CA`).format(new Date(e)):e}function c(e){return e instanceof Date||typeof e==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e?.split(`T`)[0])}var l=new Set;async function u(){try{let{data:e}=await t.default.get(`AnalyticPaths`);e.forEach(e=>l.add(e.path))}catch(e){console.error(`Error loading allowed paths:`,e)}}async function d(e,n){l.size||await u(),l.has(n)&&t.default.post(`AnalyticEvents`,{name:e,path:n})}exports.advancedFilters=r,exports.advancedFiltersList=i,exports.defaultOperator=n,exports.trackAnalyticEvent=d;
|
package/dist/utils.js
CHANGED
|
@@ -6,7 +6,7 @@ var t = "eq", n = {
|
|
|
6
6
|
label: "equal",
|
|
7
7
|
operator: "eq",
|
|
8
8
|
default: !0,
|
|
9
|
-
expr: (e) => e,
|
|
9
|
+
expr: (e) => o(e),
|
|
10
10
|
localEval: (e, t) => e == t,
|
|
11
11
|
isBasic: !0
|
|
12
12
|
},
|
|
@@ -14,7 +14,7 @@ var t = "eq", n = {
|
|
|
14
14
|
icon: "≠",
|
|
15
15
|
label: "distinct",
|
|
16
16
|
operator: "neq",
|
|
17
|
-
expr: (e) => ({ neq: e }),
|
|
17
|
+
expr: (e) => ({ neq: o(e) }),
|
|
18
18
|
isNegation: !0,
|
|
19
19
|
localEval: (e, t) => e != t
|
|
20
20
|
},
|
|
@@ -23,7 +23,7 @@ var t = "eq", n = {
|
|
|
23
23
|
label: "include",
|
|
24
24
|
operator: "inq",
|
|
25
25
|
isArray: !0,
|
|
26
|
-
expr: (e) => ({ inq: e }),
|
|
26
|
+
expr: (e) => ({ inq: o(e) }),
|
|
27
27
|
localEval: (e, t) => t.includes(e)
|
|
28
28
|
},
|
|
29
29
|
nin: {
|
|
@@ -31,7 +31,7 @@ var t = "eq", n = {
|
|
|
31
31
|
label: "exclude",
|
|
32
32
|
operator: "nin",
|
|
33
33
|
isArray: !0,
|
|
34
|
-
expr: (e) => ({ nin: e }),
|
|
34
|
+
expr: (e) => ({ nin: o(e) }),
|
|
35
35
|
isNegation: !0,
|
|
36
36
|
localEval: (e, t) => !t.includes(e)
|
|
37
37
|
},
|
|
@@ -56,7 +56,7 @@ var t = "eq", n = {
|
|
|
56
56
|
icon: "<",
|
|
57
57
|
label: "lessThan",
|
|
58
58
|
operator: "lt",
|
|
59
|
-
expr: (e) => ({ lt: e }),
|
|
59
|
+
expr: (e) => ({ lt: o(e) }),
|
|
60
60
|
localEval: (e, t) => e < t,
|
|
61
61
|
isInput: !0
|
|
62
62
|
},
|
|
@@ -65,7 +65,7 @@ var t = "eq", n = {
|
|
|
65
65
|
label: "greaterThan",
|
|
66
66
|
operator: "gt",
|
|
67
67
|
isInput: !0,
|
|
68
|
-
expr: (e) => ({ gt: e }),
|
|
68
|
+
expr: (e) => ({ gt: o(e) }),
|
|
69
69
|
localEval: (e, t) => e > t
|
|
70
70
|
},
|
|
71
71
|
lte: {
|
|
@@ -73,7 +73,7 @@ var t = "eq", n = {
|
|
|
73
73
|
label: "lessThanEqualTo",
|
|
74
74
|
operator: "lte",
|
|
75
75
|
isInput: !0,
|
|
76
|
-
expr: (e) => ({ lte: e }),
|
|
76
|
+
expr: (e) => ({ lte: o(e) }),
|
|
77
77
|
localEval: (e, t) => e <= t
|
|
78
78
|
},
|
|
79
79
|
gte: {
|
|
@@ -81,7 +81,7 @@ var t = "eq", n = {
|
|
|
81
81
|
label: "greaterThanEqualTo",
|
|
82
82
|
operator: "gte",
|
|
83
83
|
isInput: !0,
|
|
84
|
-
expr: (e) => ({ gte: e }),
|
|
84
|
+
expr: (e) => ({ gte: o(e) }),
|
|
85
85
|
localEval: (e, t) => e >= t
|
|
86
86
|
},
|
|
87
87
|
null: {
|
|
@@ -110,22 +110,28 @@ function a(e, t) {
|
|
|
110
110
|
let n = e == null ? "" : String(e), r = (t == null ? "" : String(t)).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/%/g, ".*").replace(/_/g, ".");
|
|
111
111
|
return RegExp(`^${r}$`, "i").test(n);
|
|
112
112
|
}
|
|
113
|
+
function o(e) {
|
|
114
|
+
return s(e) ? new Intl.DateTimeFormat("en-CA").format(new Date(e)) : e;
|
|
115
|
+
}
|
|
116
|
+
function s(e) {
|
|
117
|
+
return e instanceof Date || typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e?.split("T")[0]);
|
|
118
|
+
}
|
|
113
119
|
//#endregion
|
|
114
120
|
//#region lib/utils/trackAnalytics.js
|
|
115
|
-
var
|
|
116
|
-
async function
|
|
121
|
+
var c = /* @__PURE__ */ new Set();
|
|
122
|
+
async function l() {
|
|
117
123
|
try {
|
|
118
124
|
let { data: t } = await e.get("AnalyticPaths");
|
|
119
|
-
t.forEach((e) =>
|
|
125
|
+
t.forEach((e) => c.add(e.path));
|
|
120
126
|
} catch (e) {
|
|
121
127
|
console.error("Error loading allowed paths:", e);
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
|
-
async function
|
|
125
|
-
|
|
130
|
+
async function u(t, n) {
|
|
131
|
+
c.size || await l(), c.has(n) && e.post("AnalyticEvents", {
|
|
126
132
|
name: t,
|
|
127
133
|
path: n
|
|
128
134
|
});
|
|
129
135
|
}
|
|
130
136
|
//#endregion
|
|
131
|
-
export { n as advancedFilters, r as advancedFiltersList, t as defaultOperator,
|
|
137
|
+
export { n as advancedFilters, r as advancedFiltersList, t as defaultOperator, u as trackAnalyticEvent };
|
package/dist/vn-front-lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./composables-yeEr4YMb.cjs"),t=require("./components-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./composables-yeEr4YMb.cjs"),t=require("./components-Bzkod14A.cjs");function n(n,r={}){for(let e in t.t)n.component(e,t.t[e]);e.f(r.i18n)}var r={install:n};exports.VnConfirm=t.l,exports.VnDate=t.o,exports.VnFetch=t.r,exports.VnForm=t.n,exports.VnInput=t.a,exports.VnInputDate=t.i,exports.VnSkeletonForm=t.c,exports.VnSpinner=t.s,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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { a as _, c as v, i as y, l as b, n as x, o as S, r as C, s as w, t as T } from "./components-
|
|
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-BDoUoFC_.js";
|
|
2
|
+
import { a as _, c as v, i as y, l as b, n as x, o as S, r as C, s as w, t as T } from "./components-CGtJrHS1.js";
|
|
3
3
|
//#region lib/main.js
|
|
4
4
|
function E(e, t = {}) {
|
|
5
5
|
for (let t in T) e.component(t, T[t]);
|
|
@@ -6,7 +6,7 @@ export const advancedFilters = {
|
|
|
6
6
|
label: 'equal',
|
|
7
7
|
operator: defaultOperator,
|
|
8
8
|
default: true,
|
|
9
|
-
expr: (value) => value,
|
|
9
|
+
expr: (value) => parseValue(value),
|
|
10
10
|
localEval: (a, b) => a == b,
|
|
11
11
|
isBasic: true,
|
|
12
12
|
},
|
|
@@ -14,7 +14,7 @@ export const advancedFilters = {
|
|
|
14
14
|
icon: '≠',
|
|
15
15
|
label: 'distinct',
|
|
16
16
|
operator: 'neq',
|
|
17
|
-
expr: (value) => ({ neq: value }),
|
|
17
|
+
expr: (value) => ({ neq: parseValue(value) }),
|
|
18
18
|
isNegation: true,
|
|
19
19
|
localEval: (a, b) => a != b,
|
|
20
20
|
},
|
|
@@ -23,7 +23,7 @@ export const advancedFilters = {
|
|
|
23
23
|
label: 'include',
|
|
24
24
|
operator: 'inq',
|
|
25
25
|
isArray: true,
|
|
26
|
-
expr: (value) => ({ inq: value }),
|
|
26
|
+
expr: (value) => ({ inq: parseValue(value) }),
|
|
27
27
|
localEval: (a, b) => b.includes(a),
|
|
28
28
|
},
|
|
29
29
|
nin: {
|
|
@@ -31,7 +31,7 @@ export const advancedFilters = {
|
|
|
31
31
|
label: 'exclude',
|
|
32
32
|
operator: 'nin',
|
|
33
33
|
isArray: true,
|
|
34
|
-
expr: (value) => ({ nin: value }),
|
|
34
|
+
expr: (value) => ({ nin: parseValue(value) }),
|
|
35
35
|
isNegation: true,
|
|
36
36
|
localEval: (a, b) => !b.includes(a),
|
|
37
37
|
},
|
|
@@ -56,7 +56,7 @@ export const advancedFilters = {
|
|
|
56
56
|
icon: '<',
|
|
57
57
|
label: 'lessThan',
|
|
58
58
|
operator: 'lt',
|
|
59
|
-
expr: (value) => ({ lt: value }),
|
|
59
|
+
expr: (value) => ({ lt: parseValue(value) }),
|
|
60
60
|
localEval: (a, b) => a < b,
|
|
61
61
|
isInput: true,
|
|
62
62
|
},
|
|
@@ -65,7 +65,7 @@ export const advancedFilters = {
|
|
|
65
65
|
label: 'greaterThan',
|
|
66
66
|
operator: 'gt',
|
|
67
67
|
isInput: true,
|
|
68
|
-
expr: (value) => ({ gt: value }),
|
|
68
|
+
expr: (value) => ({ gt: parseValue(value) }),
|
|
69
69
|
localEval: (a, b) => a > b,
|
|
70
70
|
},
|
|
71
71
|
lte: {
|
|
@@ -73,7 +73,7 @@ export const advancedFilters = {
|
|
|
73
73
|
label: 'lessThanEqualTo',
|
|
74
74
|
operator: 'lte',
|
|
75
75
|
isInput: true,
|
|
76
|
-
expr: (value) => ({ lte: value }),
|
|
76
|
+
expr: (value) => ({ lte: parseValue(value) }),
|
|
77
77
|
localEval: (a, b) => a <= b,
|
|
78
78
|
},
|
|
79
79
|
gte: {
|
|
@@ -81,7 +81,7 @@ export const advancedFilters = {
|
|
|
81
81
|
label: 'greaterThanEqualTo',
|
|
82
82
|
operator: 'gte',
|
|
83
83
|
isInput: true,
|
|
84
|
-
expr: (value) => ({ gte: value }),
|
|
84
|
+
expr: (value) => ({ gte: parseValue(value) }),
|
|
85
85
|
localEval: (a, b) => a >= b,
|
|
86
86
|
},
|
|
87
87
|
null: {
|
|
@@ -123,3 +123,16 @@ function matchesLike(a, b) {
|
|
|
123
123
|
|
|
124
124
|
return new RegExp(`^${pattern}$`, 'i').test(source);
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
function parseValue(value) {
|
|
128
|
+
if (!isDate(value)) return value;
|
|
129
|
+
// YYYY-MM-DD
|
|
130
|
+
return new Intl.DateTimeFormat('en-CA').format(new Date(value));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function isDate(value) {
|
|
134
|
+
return (
|
|
135
|
+
value instanceof Date ||
|
|
136
|
+
(typeof value === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(value?.split('T')[0]))
|
|
137
|
+
);
|
|
138
|
+
}
|