jclib-ui 1.0.278 → 1.0.280

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.
@@ -3920,7 +3920,7 @@ const LibContext = createContext({
3920
3920
  });
3921
3921
  const cTheme = "sys/theme";
3922
3922
  const LibProvider = ({ apiConfig, children, versionApp, useTheme }) => {
3923
- const canChangeTheme = useTheme && typeof useTheme == "boolean" ? useTheme : false;
3923
+ const canChangeTheme = typeof useTheme == "boolean" ? useTheme : false;
3924
3924
  const [theme, setTheme] = useState(() => {
3925
3925
  let result = "";
3926
3926
  if (canChangeTheme) {
@@ -3933,6 +3933,7 @@ const LibProvider = ({ apiConfig, children, versionApp, useTheme }) => {
3933
3933
  }
3934
3934
  return result;
3935
3935
  });
3936
+ const toggleTheme = () => setTheme(theme == "dark" ? "light" : "dark");
3936
3937
  const [reportType, setReportType] = useLocalStorage("sys/reportType", 0);
3937
3938
  const [modalList, setModalList] = useState([]);
3938
3939
  const [showBtnTop, setShowBtnTop] = useState(false);
@@ -3971,7 +3972,6 @@ const LibProvider = ({ apiConfig, children, versionApp, useTheme }) => {
3971
3972
  },
3972
3973
  [modalList]
3973
3974
  );
3974
- const toggleTheme = () => setTheme(theme == "dark" ? "light" : "dark");
3975
3975
  useEffect(() => {
3976
3976
  const MARCADOR = " 🔴 ";
3977
3977
  const inLocalhost = window.location.hostname == "localhost" || window.location.hostname == "127.0.0.1" || window.location.hostname == "[::1]" || window.location.hostname.startsWith("192.168.");
@@ -5300,9 +5300,10 @@ function DataItem({
5300
5300
  isForm = false,
5301
5301
  children,
5302
5302
  className,
5303
+ minHeight = 40,
5303
5304
  ...rest
5304
5305
  }) {
5305
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "di-box " + (className || ""), ...rest, children: [
5306
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "di-box " + (className || ""), ...rest, style: { minHeight }, children: [
5306
5307
  caption && /* @__PURE__ */ jsxRuntimeExports.jsx("label", { style: { fontWeight: isForm ? "bold" : "normal" }, children: caption }),
5307
5308
  isForm ? /* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "form-control", value: children, readOnly: true }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
5308
5309
  "div",
@@ -6160,23 +6161,21 @@ function Modal({
6160
6161
  }) {
6161
6162
  const { addModal, removeModal } = useLibContext();
6162
6163
  const [modalId] = useState(id || "modal-" + random());
6164
+ function closeModal() {
6165
+ removeModal(modalId);
6166
+ if (hideScrollBar) {
6167
+ document.body.classList.remove(CLASS);
6168
+ }
6169
+ }
6163
6170
  useEffect(() => {
6164
6171
  if (visible) {
6165
6172
  if (hideScrollBar) {
6166
6173
  document.body.classList.add(CLASS);
6167
6174
  }
6168
6175
  } else {
6169
- removeModal(modalId);
6170
- if (hideScrollBar) {
6171
- document.body.classList.remove(CLASS);
6172
- }
6176
+ closeModal();
6173
6177
  }
6174
- return () => {
6175
- removeModal(modalId);
6176
- if (hideScrollBar) {
6177
- document.body.classList.remove(CLASS);
6178
- }
6179
- };
6178
+ return () => closeModal();
6180
6179
  }, [visible, hideScrollBar]);
6181
6180
  useEffect(() => {
6182
6181
  addModal(modalId, setVisible);