@sysvale/citizen-components 1.7.0 → 1.7.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Vr = Object.defineProperty;
|
|
2
2
|
var jr = (e, a, r) => a in e ? Vr(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
3
|
var S = (e, a, r) => jr(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
-
import { watch as me, getCurrentScope as Yr, onScopeDispose as Ur, computed as Z, toValue as ue, unref as G, defineComponent as ve, mergeModels as pe, useCssVars as $r, useModel as Je, ref as N, createElementBlock as j, openBlock as M, createElementVNode as
|
|
4
|
+
import { watch as me, getCurrentScope as Yr, onScopeDispose as Ur, computed as Z, toValue as ue, unref as G, defineComponent as ve, mergeModels as pe, useCssVars as $r, useModel as Je, ref as N, createElementBlock as j, openBlock as M, createElementVNode as re, Fragment as Fe, renderList as _r, withModifiers as qr, renderSlot as Ee, createTextVNode as H, toDisplayString as x, inject as $a, useTemplateRef as Zr, resolveComponent as W, createBlock as K, withCtx as w, createVNode as T, createCommentVNode as ae, withKeys as Xr, onMounted as Qr, mergeProps as te } from "vue";
|
|
5
5
|
import { removeCpfMask as _a, removeCnsMask as qa, maskCpf as Za, maskCns as Xa } from "@sysvale/foundry";
|
|
6
6
|
import { cloneDeep as en } from "lodash";
|
|
7
7
|
import { Form as an, Field as Ce } from "vee-validate";
|
|
@@ -230,7 +230,7 @@ function Jo(e, a = "rgb", r = "sRGB") {
|
|
|
230
230
|
return `rgb(${e[0]}, ${e[1]}, ${e[2]})`;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function ie(e, a, r = "rgb", n = "sRGB") {
|
|
234
234
|
switch (a) {
|
|
235
235
|
case "css":
|
|
236
236
|
return Jo(e, r, n);
|
|
@@ -255,35 +255,35 @@ var zo = class extends P {
|
|
|
255
255
|
}
|
|
256
256
|
rgb(e = {}) {
|
|
257
257
|
let { format: a = "hex", includeAlpha: r = !1, prefix: n = "#", casing: i = "lower" } = e, t, o = "rgb";
|
|
258
|
-
return a === "hex" ? (t = this.faker.string.hexadecimal({ length: r ? 8 : 6, prefix: "" }), t = Ko(t, { prefix: n, casing: i }), t) : (t = Array.from({ length: 3 }, () => this.faker.number.int(255)), r && (t.push(this.faker.number.float({ multipleOf: 0.01 })), o = "rgba"),
|
|
258
|
+
return a === "hex" ? (t = this.faker.string.hexadecimal({ length: r ? 8 : 6, prefix: "" }), t = Ko(t, { prefix: n, casing: i }), t) : (t = Array.from({ length: 3 }, () => this.faker.number.int(255)), r && (t.push(this.faker.number.float({ multipleOf: 0.01 })), o = "rgba"), ie(t, a, o));
|
|
259
259
|
}
|
|
260
260
|
cmyk(e = {}) {
|
|
261
261
|
let { format: a = "decimal" } = e, r = Array.from({ length: 4 }, () => this.faker.number.float({ multipleOf: 0.01 }));
|
|
262
|
-
return
|
|
262
|
+
return ie(r, a, "cmyk");
|
|
263
263
|
}
|
|
264
264
|
hsl(e = {}) {
|
|
265
265
|
let { format: a = "decimal", includeAlpha: r = !1 } = e, n = [this.faker.number.int(360)];
|
|
266
266
|
for (let i = 0; i < (e != null && e.includeAlpha ? 3 : 2); i++) n.push(this.faker.number.float({ multipleOf: 0.01 }));
|
|
267
|
-
return
|
|
267
|
+
return ie(n, a, r ? "hsla" : "hsl");
|
|
268
268
|
}
|
|
269
269
|
hwb(e = {}) {
|
|
270
270
|
let { format: a = "decimal" } = e, r = [this.faker.number.int(360)];
|
|
271
271
|
for (let n = 0; n < 2; n++) r.push(this.faker.number.float({ multipleOf: 0.01 }));
|
|
272
|
-
return
|
|
272
|
+
return ie(r, a, "hwb");
|
|
273
273
|
}
|
|
274
274
|
lab(e = {}) {
|
|
275
275
|
let { format: a = "decimal" } = e, r = [this.faker.number.float({ multipleOf: 1e-6 })];
|
|
276
276
|
for (let n = 0; n < 2; n++) r.push(this.faker.number.float({ min: -100, max: 100, multipleOf: 1e-4 }));
|
|
277
|
-
return
|
|
277
|
+
return ie(r, a, "lab");
|
|
278
278
|
}
|
|
279
279
|
lch(e = {}) {
|
|
280
280
|
let { format: a = "decimal" } = e, r = [this.faker.number.float({ multipleOf: 1e-6 })];
|
|
281
281
|
for (let n = 0; n < 2; n++) r.push(this.faker.number.float({ max: 230, multipleOf: 0.1 }));
|
|
282
|
-
return
|
|
282
|
+
return ie(r, a, "lch");
|
|
283
283
|
}
|
|
284
284
|
colorByCSSColorSpace(e = {}) {
|
|
285
285
|
let { format: a = "decimal", space: r = "sRGB" } = e, n = Array.from({ length: 3 }, () => this.faker.number.float({ multipleOf: 1e-4 }));
|
|
286
|
-
return
|
|
286
|
+
return ie(n, a, "color", r);
|
|
287
287
|
}
|
|
288
288
|
}, tr = ((e) => (e.Legacy = "legacy", e.Segwit = "segwit", e.Bech32 = "bech32", e.Taproot = "taproot", e))(tr || {}), Vo = ((e) => (e.Mainnet = "mainnet", e.Testnet = "testnet", e))(Vo || {}), jo = { legacy: { prefix: { mainnet: "1", testnet: "m" }, length: { min: 26, max: 34 }, casing: "mixed", exclude: "0OIl" }, segwit: { prefix: { mainnet: "3", testnet: "2" }, length: { min: 26, max: 34 }, casing: "mixed", exclude: "0OIl" }, bech32: { prefix: { mainnet: "bc1", testnet: "tb1" }, length: { min: 42, max: 42 }, casing: "lower", exclude: "1bBiIoO" }, taproot: { prefix: { mainnet: "bc1p", testnet: "tb1p" }, length: { min: 62, max: 62 }, casing: "lower", exclude: "1bBiIoO" } }, or = typeof Buffer > "u" || !ur("base64") ? (e) => {
|
|
289
289
|
let a = new TextEncoder().encode(e), r = Array.from(a, (n) => String.fromCodePoint(n)).join("");
|
|
@@ -3142,7 +3142,7 @@ const xr = (e) => {
|
|
|
3142
3142
|
} = xr(d), ya = a || fetch;
|
|
3143
3143
|
v = v ? (v + "").toLowerCase() : "text";
|
|
3144
3144
|
let Le = $s([b, D && D.toAbortSignal()], B), be = null;
|
|
3145
|
-
const
|
|
3145
|
+
const ne = Le && Le.unsubscribe && (() => {
|
|
3146
3146
|
Le.unsubscribe();
|
|
3147
3147
|
});
|
|
3148
3148
|
let ga;
|
|
@@ -3174,7 +3174,7 @@ const xr = (e) => {
|
|
|
3174
3174
|
be = t && new r(p, fa);
|
|
3175
3175
|
let X = await (t ? ya(be, pa) : ya(p, fa));
|
|
3176
3176
|
const ba = h && (v === "stream" || v === "response");
|
|
3177
|
-
if (h && (C || ba &&
|
|
3177
|
+
if (h && (C || ba && ne)) {
|
|
3178
3178
|
const Q = {};
|
|
3179
3179
|
["status", "statusText", "headers"].forEach((Ca) => {
|
|
3180
3180
|
Q[Ca] = X[Ca];
|
|
@@ -3185,14 +3185,14 @@ const xr = (e) => {
|
|
|
3185
3185
|
) || [];
|
|
3186
3186
|
X = new n(
|
|
3187
3187
|
Oa(X.body, Ka, $e, () => {
|
|
3188
|
-
Pe && Pe(),
|
|
3188
|
+
Pe && Pe(), ne && ne();
|
|
3189
3189
|
}),
|
|
3190
3190
|
Q
|
|
3191
3191
|
);
|
|
3192
3192
|
}
|
|
3193
3193
|
v = v || "text";
|
|
3194
3194
|
let zr = await m[c.findKey(m, v) || "text"](X, d);
|
|
3195
|
-
return !ba &&
|
|
3195
|
+
return !ba && ne && ne(), await new Promise((Q, de) => {
|
|
3196
3196
|
Nr(Q, de, {
|
|
3197
3197
|
data: zr,
|
|
3198
3198
|
headers: z.from(X.headers),
|
|
@@ -3203,7 +3203,7 @@ const xr = (e) => {
|
|
|
3203
3203
|
});
|
|
3204
3204
|
});
|
|
3205
3205
|
} catch (U) {
|
|
3206
|
-
throw
|
|
3206
|
+
throw ne && ne(), U && U.name === "TypeError" && /Load failed|fetch/i.test(U.message) ? Object.assign(
|
|
3207
3207
|
new E("Network Error", E.ERR_NETWORK, d, be),
|
|
3208
3208
|
{
|
|
3209
3209
|
cause: U.cause || U
|
|
@@ -3840,8 +3840,8 @@ const oc = {
|
|
|
3840
3840
|
return (d, p) => {
|
|
3841
3841
|
var F;
|
|
3842
3842
|
return M(), j("div", oc, [
|
|
3843
|
-
|
|
3844
|
-
|
|
3843
|
+
re("div", uc, [
|
|
3844
|
+
re("div", lc, [
|
|
3845
3845
|
((F = i.value) == null ? void 0 : F.length) > 0 ? (M(), j("ul", sc, [
|
|
3846
3846
|
(M(!0), j(Fe, null, _r(i.value, (y, b) => (M(), j("li", {
|
|
3847
3847
|
key: y.id,
|
|
@@ -3861,7 +3861,7 @@ const oc = {
|
|
|
3861
3861
|
], !0)
|
|
3862
3862
|
], 40, cc))), 128))
|
|
3863
3863
|
])) : (M(), j("ul", dc, [...p[1] || (p[1] = [
|
|
3864
|
-
|
|
3864
|
+
re("li", { class: "option__text--muted" }, " Nenhuma opção encontrada ", -1)
|
|
3865
3865
|
])]))
|
|
3866
3866
|
], 512)
|
|
3867
3867
|
])
|
|
@@ -3881,7 +3881,11 @@ const oc = {
|
|
|
3881
3881
|
fluid: { type: Boolean, default: !1 },
|
|
3882
3882
|
variant: { default: "green" },
|
|
3883
3883
|
optionsField: { default: "name" },
|
|
3884
|
-
disabled: { type: Boolean, default: !1 }
|
|
3884
|
+
disabled: { type: Boolean, default: !1 },
|
|
3885
|
+
label: { default: "Usuário SUS" },
|
|
3886
|
+
placeholder: { default: "Selecione um usuário" },
|
|
3887
|
+
state: { default: "default" },
|
|
3888
|
+
errorMessage: { default: "" }
|
|
3885
3889
|
}, {
|
|
3886
3890
|
modelValue: {},
|
|
3887
3891
|
modelModifiers: {}
|
|
@@ -3950,16 +3954,19 @@ const oc = {
|
|
|
3950
3954
|
fluid: e.fluid
|
|
3951
3955
|
}, {
|
|
3952
3956
|
default: w(() => [
|
|
3953
|
-
T(D,
|
|
3957
|
+
T(D, {
|
|
3954
3958
|
modelValue: s.value,
|
|
3955
3959
|
"onUpdate:modelValue": b[0] || (b[0] = (v) => s.value = v),
|
|
3956
3960
|
modelModifiers: { trim: !0 },
|
|
3957
|
-
state: "default",
|
|
3958
3961
|
fluid: e.fluid,
|
|
3962
|
+
label: e.label,
|
|
3963
|
+
placeholder: e.placeholder,
|
|
3964
|
+
state: e.state,
|
|
3965
|
+
"error-message": e.errorMessage,
|
|
3959
3966
|
disabled: o.value || e.disabled,
|
|
3960
3967
|
onKeydown: Xr(p, ["enter"]),
|
|
3961
3968
|
onBlur: b[1] || (b[1] = (v) => u.value = !1)
|
|
3962
|
-
}
|
|
3969
|
+
}, null, 8, ["modelValue", "fluid", "label", "placeholder", "state", "error-message", "disabled"]),
|
|
3963
3970
|
u.value ? (M(), K(mc, {
|
|
3964
3971
|
key: 0,
|
|
3965
3972
|
modelValue: r.value,
|
|
@@ -3985,28 +3992,28 @@ const oc = {
|
|
|
3985
3992
|
}, 1024),
|
|
3986
3993
|
T(B, { as: "body-2" }, {
|
|
3987
3994
|
default: w(() => [
|
|
3988
|
-
b[3] || (b[3] =
|
|
3995
|
+
b[3] || (b[3] = re("br", null, null, -1)),
|
|
3989
3996
|
H(" CPF: " + x(v.cpf ? G(Za)(v.cpf) : "--"), 1)
|
|
3990
3997
|
]),
|
|
3991
3998
|
_: 2
|
|
3992
3999
|
}, 1024),
|
|
3993
4000
|
T(B, { as: "body-2" }, {
|
|
3994
4001
|
default: w(() => [
|
|
3995
|
-
b[4] || (b[4] =
|
|
4002
|
+
b[4] || (b[4] = re("br", null, null, -1)),
|
|
3996
4003
|
H(" CNS: " + x(v.cns ? G(Xa)(v.cns) : "--"), 1)
|
|
3997
4004
|
]),
|
|
3998
4005
|
_: 2
|
|
3999
4006
|
}, 1024),
|
|
4000
4007
|
T(B, { as: "body-2" }, {
|
|
4001
4008
|
default: w(() => [
|
|
4002
|
-
b[5] || (b[5] =
|
|
4009
|
+
b[5] || (b[5] = re("br", null, null, -1)),
|
|
4003
4010
|
H(" Data de nascimento: " + x(F(v.birth_date)), 1)
|
|
4004
4011
|
]),
|
|
4005
4012
|
_: 2
|
|
4006
4013
|
}, 1024)
|
|
4007
4014
|
]),
|
|
4008
4015
|
_: 1
|
|
4009
|
-
}, 8, ["modelValue", "options", "fluid", "options-field"])) :
|
|
4016
|
+
}, 8, ["modelValue", "options", "fluid", "options-field"])) : ae("", !0)
|
|
4010
4017
|
]),
|
|
4011
4018
|
_: 1
|
|
4012
4019
|
}, 8, ["fluid"]),
|
|
@@ -4019,7 +4026,7 @@ const oc = {
|
|
|
4019
4026
|
"tooltip-text": f.value,
|
|
4020
4027
|
disabled: m.value,
|
|
4021
4028
|
onButtonClick: p
|
|
4022
|
-
}, null, 8, ["text", "variant", "tooltip-text", "disabled"])) :
|
|
4029
|
+
}, null, 8, ["text", "variant", "tooltip-text", "disabled"])) : ae("", !0)
|
|
4023
4030
|
]),
|
|
4024
4031
|
_: 1
|
|
4025
4032
|
}, 8, ["fluid"]);
|
|
@@ -4087,7 +4094,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4087
4094
|
]),
|
|
4088
4095
|
_: 1
|
|
4089
4096
|
}),
|
|
4090
|
-
|
|
4097
|
+
re("div", yc, [
|
|
4091
4098
|
T(l, {
|
|
4092
4099
|
"font-weight": "semibold",
|
|
4093
4100
|
as: "caption"
|
|
@@ -4104,7 +4111,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4104
4111
|
_: 1
|
|
4105
4112
|
})
|
|
4106
4113
|
]),
|
|
4107
|
-
|
|
4114
|
+
re("div", null, [
|
|
4108
4115
|
T(l, {
|
|
4109
4116
|
"font-weight": "semibold",
|
|
4110
4117
|
as: "caption"
|
|
@@ -4138,7 +4145,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4138
4145
|
H(x(e.data.address.street) + ", Nº " + x(e.data.address.number ?? "--"), 1)
|
|
4139
4146
|
]),
|
|
4140
4147
|
_: 1
|
|
4141
|
-
})) :
|
|
4148
|
+
})) : ae("", !0),
|
|
4142
4149
|
e.data.address.neighborhood ? (M(), K(l, {
|
|
4143
4150
|
key: 1,
|
|
4144
4151
|
as: "caption"
|
|
@@ -4147,7 +4154,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4147
4154
|
H(x(e.data.address.neighborhood), 1)
|
|
4148
4155
|
]),
|
|
4149
4156
|
_: 1
|
|
4150
|
-
})) :
|
|
4157
|
+
})) : ae("", !0),
|
|
4151
4158
|
e.data.address.city && e.data.address.uf ? (M(), K(l, {
|
|
4152
4159
|
key: 2,
|
|
4153
4160
|
as: "caption"
|
|
@@ -4156,7 +4163,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4156
4163
|
H(x(e.data.address.city) + " / " + x(e.data.address.uf), 1)
|
|
4157
4164
|
]),
|
|
4158
4165
|
_: 1
|
|
4159
|
-
})) :
|
|
4166
|
+
})) : ae("", !0)
|
|
4160
4167
|
], 64)) : (M(), K(l, {
|
|
4161
4168
|
key: 1,
|
|
4162
4169
|
as: "caption"
|
|
@@ -4181,14 +4188,14 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4181
4188
|
}, {
|
|
4182
4189
|
default: w(() => [
|
|
4183
4190
|
Ee(u.$slots, "prepend-action"),
|
|
4184
|
-
e.hideDetailsIcon ?
|
|
4191
|
+
e.hideDetailsIcon ? ae("", !0) : (M(), K(m, {
|
|
4185
4192
|
key: 0,
|
|
4186
4193
|
size: "sm",
|
|
4187
4194
|
icon: "document-text-outline",
|
|
4188
4195
|
"tooltip-text": "Ver detalhes",
|
|
4189
4196
|
onCdsClick: s[0] || (s[0] = (g) => r("details"))
|
|
4190
4197
|
})),
|
|
4191
|
-
e.hideEditIcon ?
|
|
4198
|
+
e.hideEditIcon ? ae("", !0) : (M(), K(m, {
|
|
4192
4199
|
key: 1,
|
|
4193
4200
|
size: "sm",
|
|
4194
4201
|
icon: "edit-outline",
|
|
@@ -4338,7 +4345,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4338
4345
|
return (F, y) => {
|
|
4339
4346
|
const b = W("CdsDataTable"), D = W("CdsPagination");
|
|
4340
4347
|
return M(), j("div", null, [
|
|
4341
|
-
T(b,
|
|
4348
|
+
T(b, te({ ...F.$attrs }, {
|
|
4342
4349
|
modelValue: t.value,
|
|
4343
4350
|
"onUpdate:modelValue": y[2] || (y[2] = (B) => t.value = B),
|
|
4344
4351
|
fields: s.value,
|
|
@@ -4395,7 +4402,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4395
4402
|
total: h.value.total,
|
|
4396
4403
|
variant: F.$attrs.variant ?? "green",
|
|
4397
4404
|
fluid: ""
|
|
4398
|
-
}, null, 8, ["modelValue", "per-page", "total", "variant"])) :
|
|
4405
|
+
}, null, 8, ["modelValue", "per-page", "total", "variant"])) : ae("", !0)
|
|
4399
4406
|
]);
|
|
4400
4407
|
};
|
|
4401
4408
|
}
|
|
@@ -4491,7 +4498,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4491
4498
|
}
|
|
4492
4499
|
return (g, f) => {
|
|
4493
4500
|
const d = W("CdsTextInput"), p = W("CdsGridItem"), F = W("CdsDateInput"), y = W("CdsSelect"), b = W("CdsToast"), D = W("CdsGrid"), B = W("CdsSideSheet");
|
|
4494
|
-
return M(), K(B,
|
|
4501
|
+
return M(), K(B, te(g.$attrs, {
|
|
4495
4502
|
modelValue: t.value,
|
|
4496
4503
|
"onUpdate:modelValue": f[0] || (f[0] = (C) => t.value = C),
|
|
4497
4504
|
title: "Cadastrar usuário SUS",
|
|
@@ -4521,7 +4528,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4521
4528
|
rules: "required|minLength:5"
|
|
4522
4529
|
}, {
|
|
4523
4530
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4524
|
-
T(d,
|
|
4531
|
+
T(d, te(C, {
|
|
4525
4532
|
modelValue: C.value,
|
|
4526
4533
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4527
4534
|
label: "Nome",
|
|
@@ -4546,7 +4553,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4546
4553
|
rules: "required|cns"
|
|
4547
4554
|
}, {
|
|
4548
4555
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4549
|
-
T(d,
|
|
4556
|
+
T(d, te(C, {
|
|
4550
4557
|
modelValue: C.value,
|
|
4551
4558
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4552
4559
|
label: "CNS",
|
|
@@ -4572,7 +4579,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4572
4579
|
rules: "required|cpf"
|
|
4573
4580
|
}, {
|
|
4574
4581
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4575
|
-
T(d,
|
|
4582
|
+
T(d, te(C, {
|
|
4576
4583
|
modelValue: C.value,
|
|
4577
4584
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4578
4585
|
label: "CPF",
|
|
@@ -4598,7 +4605,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4598
4605
|
rules: "required"
|
|
4599
4606
|
}, {
|
|
4600
4607
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4601
|
-
T(F,
|
|
4608
|
+
T(F, te(C, {
|
|
4602
4609
|
modelValue: C.value,
|
|
4603
4610
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4604
4611
|
label: "Data de nascimento",
|
|
@@ -4623,7 +4630,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4623
4630
|
rules: "required"
|
|
4624
4631
|
}, {
|
|
4625
4632
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4626
|
-
T(y,
|
|
4633
|
+
T(y, te(C, {
|
|
4627
4634
|
modelValue: C.value,
|
|
4628
4635
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4629
4636
|
"options-field": "name",
|