jclib-ui 1.0.276 → 1.0.278
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/jclib-ui.es.js +12 -7
- package/dist/jclib-ui.es.js.map +1 -1
- package/dist/jclib-ui.umd.js +16 -16
- package/dist/jclib-ui.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/jclib-ui.es.js
CHANGED
|
@@ -5292,6 +5292,8 @@ function ClipboardArea({ title, url, timerInMilliSeconds = 5e3 }) {
|
|
|
5292
5292
|
] }) })
|
|
5293
5293
|
] });
|
|
5294
5294
|
}
|
|
5295
|
+
const COLOR_DESTAQUE = "var(--data-item-destaque)";
|
|
5296
|
+
const COLOR_BODY = "var(--body-color)";
|
|
5295
5297
|
function DataItem({
|
|
5296
5298
|
caption,
|
|
5297
5299
|
colored,
|
|
@@ -5300,14 +5302,12 @@ function DataItem({
|
|
|
5300
5302
|
className,
|
|
5301
5303
|
...rest
|
|
5302
5304
|
}) {
|
|
5303
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "di-box " + className, ...rest, children: [
|
|
5305
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "di-box " + (className || ""), ...rest, children: [
|
|
5304
5306
|
caption && /* @__PURE__ */ jsxRuntimeExports.jsx("label", { style: { fontWeight: isForm ? "bold" : "normal" }, children: caption }),
|
|
5305
5307
|
isForm ? /* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "form-control", value: children, readOnly: true }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5306
5308
|
"div",
|
|
5307
5309
|
{
|
|
5308
|
-
style: {
|
|
5309
|
-
color: colored ? "var(--data-item-destaque)" : "var(--body-color)"
|
|
5310
|
-
},
|
|
5310
|
+
style: { color: colored ? COLOR_DESTAQUE : COLOR_BODY },
|
|
5311
5311
|
className: "fw-bold",
|
|
5312
5312
|
children
|
|
5313
5313
|
}
|
|
@@ -16076,15 +16076,20 @@ var Vo = /* @__PURE__ */ function() {
|
|
|
16076
16076
|
return Go({ constraints: i2, scanDelay: u2, onResult: c2, videoId: f2 }), React.createElement("section", { className: s2, style: n2 }, React.createElement("div", { style: Xo(Xo({}, Wo.container), r) }, !!a2 && React.createElement(a2, null), React.createElement("video", { muted: true, id: f2, style: Xo(Xo(Xo({}, Wo.video), o2), { transform: "user" === (null == i2 ? void 0 : i2.facingMode) && "scaleX(-1)" }) })));
|
|
16077
16077
|
};
|
|
16078
16078
|
jo.displayName = "QrReader", jo.defaultProps = { constraints: { facingMode: "user" }, videoId: "video", scanDelay: 500 };
|
|
16079
|
+
const ERR_NOT_FOUND = "Requested device not found";
|
|
16080
|
+
const ERR_PERMIS_DENIED = "Permission denied";
|
|
16081
|
+
const ERR_DEFAULT = "Dispositivo de câmera não foi encontrado, está indisponível ou bloqueado!";
|
|
16079
16082
|
function QRCodeReader({ onResult, setVisible, title, helpLink }) {
|
|
16080
16083
|
const [error, setError] = useState("");
|
|
16081
16084
|
const [fatalError, setFatalError] = useState(false);
|
|
16082
16085
|
function handleResult(result, error2) {
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
if (
|
|
16086
|
+
let errorMess = error2 == null ? void 0 : error2.message;
|
|
16087
|
+
if (errorMess) {
|
|
16088
|
+
if ([ERR_NOT_FOUND, ERR_PERMIS_DENIED].includes(errorMess)) {
|
|
16089
|
+
errorMess = ERR_DEFAULT;
|
|
16086
16090
|
setFatalError(true);
|
|
16087
16091
|
}
|
|
16092
|
+
setError(`Ocorreu um erro ao fazer a leitura: ${errorMess}`);
|
|
16088
16093
|
}
|
|
16089
16094
|
if (result && onResult) {
|
|
16090
16095
|
onResult(result);
|