jclib-ui 1.0.294 → 1.0.295
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import React__default, { useEffect, createContext, useContext, useState, useCallback, useRef, useLayoutEffect, useImperativeHandle
|
|
2
|
+
import React__default, { useEffect, createContext, useContext, useState, useCallback, useRef, useMemo, useLayoutEffect, useImperativeHandle } from "react";
|
|
3
3
|
import { isDarkMode, random, isMobile, formatData, formatDataHora, formatValor, isDesktop, getDateTimeStr, getHash, validarCNPJ, validarCPF } from "jcinfo-utils";
|
|
4
4
|
import { useDragControls, motion } from "framer-motion";
|
|
5
5
|
import styled from "styled-components";
|
|
@@ -21480,41 +21480,6 @@ function Input({
|
|
|
21480
21480
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "form-control", onClick: handleClick, ...props });
|
|
21481
21481
|
}
|
|
21482
21482
|
}
|
|
21483
|
-
const Container$3 = styled.div`
|
|
21484
|
-
display: inline-block;
|
|
21485
|
-
`;
|
|
21486
|
-
const Label = styled.span`
|
|
21487
|
-
color: ${(props) => props.disabled ? "silver" : "#333"};
|
|
21488
|
-
display: flex;
|
|
21489
|
-
align-items: center;
|
|
21490
|
-
margin: 0px 0 0;
|
|
21491
|
-
cursor: ${(props) => props.disabled ? "default" : "pointer"};
|
|
21492
|
-
|
|
21493
|
-
span {
|
|
21494
|
-
font-size: 20px;
|
|
21495
|
-
}
|
|
21496
|
-
`;
|
|
21497
|
-
const InputCheckBox = ({ disabled, children, name, checked, onChange }) => {
|
|
21498
|
-
function handleClick() {
|
|
21499
|
-
if (!disabled && onChange) {
|
|
21500
|
-
const event = {
|
|
21501
|
-
target: {
|
|
21502
|
-
name,
|
|
21503
|
-
checked: !checked
|
|
21504
|
-
}
|
|
21505
|
-
};
|
|
21506
|
-
onChange(event);
|
|
21507
|
-
}
|
|
21508
|
-
}
|
|
21509
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Label, { disabled, onClick: handleClick, children: [
|
|
21510
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
21511
|
-
checked && /* @__PURE__ */ jsxRuntimeExports.jsx(IconToggleOn, { color: disabled && "silver" }),
|
|
21512
|
-
!checked && /* @__PURE__ */ jsxRuntimeExports.jsx(IconToggleOff, { color: disabled && "silver" })
|
|
21513
|
-
] }),
|
|
21514
|
-
" ",
|
|
21515
|
-
children
|
|
21516
|
-
] }) });
|
|
21517
|
-
};
|
|
21518
21483
|
const InputPasswordContainer = styled.div`
|
|
21519
21484
|
position: relative;
|
|
21520
21485
|
|
|
@@ -21581,6 +21546,91 @@ function InputPassword({ disabled, autoSelect, ...rest }) {
|
|
|
21581
21546
|
function InputBox({ children }) {
|
|
21582
21547
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jclib-ui-input-box", children });
|
|
21583
21548
|
}
|
|
21549
|
+
const Container$3 = styled.div`
|
|
21550
|
+
display: inline-block;
|
|
21551
|
+
`;
|
|
21552
|
+
const Label = styled.span`
|
|
21553
|
+
color: ${(props) => props.disabled ? "silver" : "#333"};
|
|
21554
|
+
display: flex;
|
|
21555
|
+
align-items: center;
|
|
21556
|
+
margin: 0px 0 0;
|
|
21557
|
+
cursor: ${(props) => props.disabled ? "default" : "pointer"};
|
|
21558
|
+
|
|
21559
|
+
span {
|
|
21560
|
+
font-size: 20px;
|
|
21561
|
+
}
|
|
21562
|
+
`;
|
|
21563
|
+
const InputCheckBox = ({ disabled, children, name, checked, onChange }) => {
|
|
21564
|
+
function handleClick() {
|
|
21565
|
+
if (!disabled && onChange) {
|
|
21566
|
+
const event = {
|
|
21567
|
+
target: {
|
|
21568
|
+
name,
|
|
21569
|
+
checked: !checked
|
|
21570
|
+
}
|
|
21571
|
+
};
|
|
21572
|
+
onChange(event);
|
|
21573
|
+
}
|
|
21574
|
+
}
|
|
21575
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Label, { disabled, onClick: handleClick, children: [
|
|
21576
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
21577
|
+
checked && /* @__PURE__ */ jsxRuntimeExports.jsx(IconToggleOn, { color: disabled && "silver" }),
|
|
21578
|
+
!checked && /* @__PURE__ */ jsxRuntimeExports.jsx(IconToggleOff, { color: disabled && "silver" })
|
|
21579
|
+
] }),
|
|
21580
|
+
" ",
|
|
21581
|
+
children
|
|
21582
|
+
] }) });
|
|
21583
|
+
};
|
|
21584
|
+
function InputOff({
|
|
21585
|
+
campo,
|
|
21586
|
+
dados,
|
|
21587
|
+
setDados,
|
|
21588
|
+
type,
|
|
21589
|
+
className,
|
|
21590
|
+
disabled,
|
|
21591
|
+
...rest
|
|
21592
|
+
}) {
|
|
21593
|
+
const nameDom = useMemo(
|
|
21594
|
+
() => `${campo}_${Math.random().toString(36).slice(2, 8)}`,
|
|
21595
|
+
[campo]
|
|
21596
|
+
);
|
|
21597
|
+
const [readOnly, setReadOnly] = useState(true);
|
|
21598
|
+
const [showPass, setShowPass] = useState(false);
|
|
21599
|
+
const isPass = type == "password";
|
|
21600
|
+
useEffect(() => {
|
|
21601
|
+
setShowPass(false);
|
|
21602
|
+
}, [disabled]);
|
|
21603
|
+
const handleShowPass = () => {
|
|
21604
|
+
if (!disabled) {
|
|
21605
|
+
setShowPass(!showPass);
|
|
21606
|
+
}
|
|
21607
|
+
};
|
|
21608
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "input-off", children: [
|
|
21609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21610
|
+
"input",
|
|
21611
|
+
{
|
|
21612
|
+
className: `form-control ${className} ${isPass && !showPass ? "input-off-senha" : ""}`,
|
|
21613
|
+
type: "text",
|
|
21614
|
+
name: nameDom,
|
|
21615
|
+
value: dados[campo] ?? "",
|
|
21616
|
+
onChange: (e) => setDados({ ...dados, [campo]: e.target.value }),
|
|
21617
|
+
autoComplete: "off",
|
|
21618
|
+
onFocus: () => setReadOnly(false),
|
|
21619
|
+
readOnly,
|
|
21620
|
+
disabled,
|
|
21621
|
+
...rest
|
|
21622
|
+
}
|
|
21623
|
+
),
|
|
21624
|
+
type == "password" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21625
|
+
"div",
|
|
21626
|
+
{
|
|
21627
|
+
className: `icone ${disabled ? "disabled" : ""}`,
|
|
21628
|
+
onClick: handleShowPass,
|
|
21629
|
+
children: showPass ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "fa-solid fa-eye-slash" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "fa-solid fa-eye" })
|
|
21630
|
+
}
|
|
21631
|
+
)
|
|
21632
|
+
] });
|
|
21633
|
+
}
|
|
21584
21634
|
function LabelHint({ label, hint }) {
|
|
21585
21635
|
const hintTitle = "Ajuda";
|
|
21586
21636
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "label-hint--container", children: [
|
|
@@ -25757,6 +25807,7 @@ export {
|
|
|
25757
25807
|
InputFinder$1 as InputFinder,
|
|
25758
25808
|
InputFone,
|
|
25759
25809
|
InputHora,
|
|
25810
|
+
InputOff,
|
|
25760
25811
|
InputPassword,
|
|
25761
25812
|
InputPercent,
|
|
25762
25813
|
InputPesquisa,
|