@appmax_npm/ds-prime 1.0.0-alpha.161 → 1.0.0-alpha.163
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/amfield/index.js +11 -11
- package/aminputcurrency/index.js +55 -55
- package/config/presets/appmax-preset.d.ts +1 -2
- package/config/presets/appmax-preset.js +3 -3
- package/config/presets/max-preset.d.ts +1 -2
- package/config/presets/max-preset.js +3 -3
- package/index/index.js +637 -259
- package/package.json +4 -4
- package/plugins/themes/useTheme.js +1 -1
package/amfield/index.js
CHANGED
|
@@ -16,12 +16,12 @@ const v = { name: "AmField" }, B = /* @__PURE__ */ m({
|
|
|
16
16
|
disabled: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
setup(d) {
|
|
19
|
-
const
|
|
19
|
+
const r = p(d, ["as", "help", "label", "labelHint", "hint", "dataTestPrefix"]);
|
|
20
20
|
return (e, T) => (o(), n(u(_), {
|
|
21
|
-
name:
|
|
21
|
+
name: r.name
|
|
22
22
|
}, {
|
|
23
|
-
default: s((
|
|
24
|
-
var
|
|
23
|
+
default: s((a) => {
|
|
24
|
+
var l;
|
|
25
25
|
return [
|
|
26
26
|
b(P, {
|
|
27
27
|
dataTestPrefix: e.dataTestPrefix,
|
|
@@ -29,20 +29,20 @@ const v = { name: "AmField" }, B = /* @__PURE__ */ m({
|
|
|
29
29
|
label: e.label,
|
|
30
30
|
labelHint: e.labelHint,
|
|
31
31
|
hint: e.hint,
|
|
32
|
-
error:
|
|
33
|
-
disabled:
|
|
32
|
+
error: a.touched || a.error ? r.error || ((l = a.error) == null ? void 0 : l.message) : "",
|
|
33
|
+
disabled: r.disabled
|
|
34
34
|
}, {
|
|
35
35
|
default: s(() => {
|
|
36
36
|
var t;
|
|
37
37
|
return [
|
|
38
38
|
(o(), n(f(e.as), h({
|
|
39
|
-
modelValue:
|
|
40
|
-
"onUpdate:modelValue": (i) =>
|
|
39
|
+
modelValue: a.value,
|
|
40
|
+
"onUpdate:modelValue": (i) => a.value = i,
|
|
41
41
|
class: "overflow-hidden"
|
|
42
|
-
}, { ...e.$attrs, ...
|
|
42
|
+
}, { ...e.$attrs, ...r }, {
|
|
43
43
|
"data-test": `${e.dataTestPrefix}-field`,
|
|
44
|
-
invalid:
|
|
45
|
-
disabled:
|
|
44
|
+
invalid: (a.touched || !!a.error) && !!(r.error || (t = a.error) != null && t.message),
|
|
45
|
+
disabled: r.disabled
|
|
46
46
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "data-test", "invalid", "disabled"]))
|
|
47
47
|
];
|
|
48
48
|
}),
|
package/aminputcurrency/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { InputText as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
},
|
|
1
|
+
import { defineComponent as L, ref as U, computed as f, watch as S, openBlock as B, createBlock as E, unref as H, mergeProps as T } from "vue";
|
|
2
|
+
import { InputText as h } from "primevue";
|
|
3
|
+
const m = (t, n = !1) => {
|
|
4
|
+
const e = Number(t) || 0;
|
|
5
|
+
return n ? -e : e;
|
|
6
|
+
}, P = (t) => {
|
|
7
|
+
if (!t) return 0;
|
|
8
|
+
const n = t.startsWith("-"), e = t.replace(/[^\d]/g, "");
|
|
7
9
|
if (!e) return 0;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return t ? Math.round(n * 100) : n;
|
|
18
|
-
}, g = (e, t) => Math.round((e + t) * 100) / 100, D = {
|
|
10
|
+
const u = e.padStart(3, "0").replace(/(\d{2})$/, ".$1");
|
|
11
|
+
return m(u, n);
|
|
12
|
+
}, C = (t, n = !1) => {
|
|
13
|
+
const e = m(t);
|
|
14
|
+
return n ? e / 100 : e;
|
|
15
|
+
}, v = (t, n = !1) => {
|
|
16
|
+
const e = m(t);
|
|
17
|
+
return n ? Math.round(e * 100) : e;
|
|
18
|
+
}, _ = (t, n) => Math.round((t + n) * 100) / 100, V = {
|
|
19
19
|
AUD: "en-AU",
|
|
20
20
|
BGN: "bg-BG",
|
|
21
21
|
BRL: "pt-BR",
|
|
@@ -49,59 +49,59 @@ const i = (e, t = !1) => {
|
|
|
49
49
|
TRY: "tr-TR",
|
|
50
50
|
USD: "en-US",
|
|
51
51
|
ZAR: "en-ZA"
|
|
52
|
-
},
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
return Array.isArray(
|
|
52
|
+
}, b = "pt-BR", D = "BRL", w = (t = D) => {
|
|
53
|
+
if (t in V) {
|
|
54
|
+
const n = V[t];
|
|
55
|
+
return Array.isArray(n) ? n[0] : n;
|
|
56
56
|
} else
|
|
57
|
-
return
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
return new Intl.NumberFormat(
|
|
57
|
+
return b;
|
|
58
|
+
}, N = (t, n = D, e) => {
|
|
59
|
+
const u = e || w(n);
|
|
60
|
+
return new Intl.NumberFormat(u, {
|
|
61
61
|
style: "currency",
|
|
62
|
-
currency:
|
|
63
|
-
}).format(
|
|
64
|
-
},
|
|
65
|
-
...
|
|
66
|
-
props:
|
|
62
|
+
currency: n
|
|
63
|
+
}).format(m(t));
|
|
64
|
+
}, M = { name: "AmInputCurrency" }, F = /* @__PURE__ */ L({
|
|
65
|
+
...M,
|
|
66
|
+
props: {
|
|
67
67
|
currency: {},
|
|
68
68
|
locale: {},
|
|
69
69
|
inCents: { type: Boolean },
|
|
70
70
|
modelValue: {},
|
|
71
71
|
max: {}
|
|
72
|
-
},
|
|
73
|
-
modelValue: { default: 0 },
|
|
74
|
-
modelModifiers: {}
|
|
75
|
-
}),
|
|
72
|
+
},
|
|
76
73
|
emits: ["update:modelValue"],
|
|
77
|
-
setup(
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
|
|
74
|
+
setup(t, { emit: n }) {
|
|
75
|
+
const e = t, u = n, p = U(""), l = f(() => e.max), R = f(() => {
|
|
76
|
+
const { currency: r, locale: o, inCents: a, max: i, modelValue: s, ...c } = e;
|
|
77
|
+
return c;
|
|
78
|
+
}), d = (r) => r < 0 ? 0 : typeof l.value != "number" ? r : l.value <= 0 ? 0 : l.value < r ? l.value : r, y = (r) => {
|
|
79
|
+
const o = C(r, e.inCents);
|
|
80
|
+
p.value = N(o, e.currency, e.locale);
|
|
81
|
+
}, A = (r) => {
|
|
82
|
+
const o = r.target, a = P(o.value), i = v(a, e.inCents), s = d(i);
|
|
83
|
+
u("update:modelValue", s);
|
|
84
|
+
const c = C(s, e.inCents);
|
|
85
|
+
o.value = N(c, e.currency, e.locale);
|
|
81
86
|
}, K = (r) => {
|
|
82
|
-
const o = r.target, d = w(o.value), p = Y(d, s), c = m(p);
|
|
83
|
-
u.value = c;
|
|
84
|
-
const U = N(c, s);
|
|
85
|
-
o.value = R(U, n, a);
|
|
86
|
-
}, I = (r) => {
|
|
87
87
|
if (!["ArrowUp", "ArrowDown"].includes(r.key)) return;
|
|
88
88
|
r.preventDefault();
|
|
89
|
-
const
|
|
90
|
-
u
|
|
89
|
+
const a = e.inCents ? 100 : 1, i = r.key === "ArrowUp" ? 1 : -1, s = e.modelValue ?? 0, c = _(s, a * i);
|
|
90
|
+
u("update:modelValue", d(c));
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
const o =
|
|
94
|
-
|
|
92
|
+
S(() => e.modelValue, (r) => {
|
|
93
|
+
const o = r ?? 0, a = d(o);
|
|
94
|
+
o !== a && u("update:modelValue", a), y(a);
|
|
95
95
|
}, { immediate: !0 });
|
|
96
|
-
const
|
|
97
|
-
return (r, o) => (
|
|
98
|
-
inputmode:
|
|
99
|
-
value:
|
|
100
|
-
onInput:
|
|
101
|
-
onKeydown:
|
|
96
|
+
const I = "numeric";
|
|
97
|
+
return (r, o) => (B(), E(H(h), T(R.value, {
|
|
98
|
+
inputmode: I,
|
|
99
|
+
value: p.value,
|
|
100
|
+
onInput: A,
|
|
101
|
+
onKeydown: K
|
|
102
102
|
}), null, 16, ["value"]));
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
F as default
|
|
107
107
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const AppmaxPreset: typeof Lara;
|
|
1
|
+
export declare const AppmaxPreset: import("@primeuix/themes/types").Preset;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { definePreset } from '@
|
|
2
|
-
import Lara from '@
|
|
3
|
-
import Aura from '@
|
|
1
|
+
import { definePreset } from '@primeuix/themes';
|
|
2
|
+
import Lara from '@primeuix/themes/lara';
|
|
3
|
+
import Aura from '@primeuix/themes/aura';
|
|
4
4
|
import { AmColors } from '../colors';
|
|
5
5
|
export const AppmaxPreset = definePreset(Lara, {
|
|
6
6
|
primitive: {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const MaxPreset: typeof Lara;
|
|
1
|
+
export declare const MaxPreset: import("@primeuix/themes/types").Preset;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { definePreset } from '@
|
|
2
|
-
import Lara from '@
|
|
3
|
-
import Aura from '@
|
|
1
|
+
import { definePreset } from '@primeuix/themes';
|
|
2
|
+
import Lara from '@primeuix/themes/lara';
|
|
3
|
+
import Aura from '@primeuix/themes/aura';
|
|
4
4
|
import { AmColors } from '../colors';
|
|
5
5
|
export const MaxPreset = definePreset(Lara, {
|
|
6
6
|
primitive: {
|