jclib-ui 1.0.149 → 1.0.150

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.
@@ -0,0 +1,26 @@
1
+ export default function FormDesk({ children, labelWidth, sizeBreak, lineShortWidth, gap, ...rest }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ labelWidth?: number | undefined;
5
+ sizeBreak?: number | undefined;
6
+ lineShortWidth?: number | undefined;
7
+ gap?: string | undefined;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export function FormDeskLine({ children, label, isShort, className, classNameLabel, classNameCol, extraComp, inpWidth, ...rest }: {
10
+ [x: string]: any;
11
+ children: any;
12
+ label?: string | undefined;
13
+ isShort?: boolean | undefined;
14
+ className?: string | undefined;
15
+ classNameLabel?: string | undefined;
16
+ classNameCol?: string | undefined;
17
+ extraComp: any;
18
+ inpWidth: any;
19
+ }): import("react/jsx-runtime").JSX.Element;
20
+ export function FormDeskGrid({ grid, gap, className, children, ...rest }: {
21
+ [x: string]: any;
22
+ grid: any;
23
+ gap?: number | undefined;
24
+ className?: string | undefined;
25
+ children: any;
26
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export const Container: import('styled-components').StyledComponent<"div", any, {}, never>;
package/dist/index.d.ts CHANGED
@@ -61,6 +61,7 @@ export { CheckUpdates } from './update/update';
61
61
  export { ScrollContainer } from './ScrollContainer/ScrollContainer';
62
62
  export { default as BoxSearch } from './BoxSearch/BoxSearch';
63
63
  export { default as PrintButtons } from './printButtons/printButtons';
64
+ export { FormDeskGrid, FormDeskLine, default as FormDesk } from './formDesk/formDesk';
64
65
  export { useLocalForage } from './hooks/useLocalForage';
65
66
  export { default as useParamId } from './hooks/useParamId';
66
67
  export { default as useQuery } from './hooks/useQuery';
@@ -4222,7 +4222,7 @@ function createApiConfig(obj = initConfig) {
4222
4222
  result.auth = { ...initConfig.auth, ...obj.auth };
4223
4223
  return result;
4224
4224
  }
4225
- const Container$6 = styled.div`
4225
+ const Container$7 = styled.div`
4226
4226
  @media (max-width: 767px) {
4227
4227
  overflow-x: auto;
4228
4228
  }
@@ -4542,7 +4542,7 @@ function Table({
4542
4542
  }
4543
4543
  if (!dados || dados.length == 0)
4544
4544
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "alert alert-warning", children: msgSemDados });
4545
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$6, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableContainer, { alignTop, sizeBreak, hasBorder: border, children: [
4545
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$7, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableContainer, { alignTop, sizeBreak, hasBorder: border, children: [
4546
4546
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { colunas, incColActions }),
4547
4547
  /* @__PURE__ */ jsxRuntimeExports.jsx(
4548
4548
  TableBody,
@@ -4878,7 +4878,7 @@ function BoxColor({ corFonte, setCorFonte, corFundo, setCorFundo }) {
4878
4878
  )
4879
4879
  ] });
4880
4880
  }
4881
- const Container$5 = styled.div`
4881
+ const Container$6 = styled.div`
4882
4882
  margin: ${({ noMargin }) => noMargin ? "0" : "5px 0 8px"};
4883
4883
  border: 1px solid var(--bi-color-border);
4884
4884
  border-radius: ${(props) => props.open ? "0 0 var(--pn-border-radius) var(--pn-border-radius)" : "0"};
@@ -4967,7 +4967,7 @@ function BoxInfo({
4967
4967
  if (!isVisible) {
4968
4968
  return null;
4969
4969
  }
4970
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$5, { open, noMargin, ...rest, children: [
4970
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$6, { open, noMargin, ...rest, children: [
4971
4971
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bi-btn-area", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => setOpen(!open), children: [
4972
4972
  title,
4973
4973
  " ",
@@ -5018,7 +5018,7 @@ const ButtonClose = ({ ...rest }) => {
5018
5018
  const ButtonBack = ({ ...rest }) => {
5019
5019
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonStyled, { type: "button", className: "back", ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "fa-solid fa-arrow-left" }) });
5020
5020
  };
5021
- const Container$4 = styled.div`
5021
+ const Container$5 = styled.div`
5022
5022
  font-size: 1.4rem;
5023
5023
  line-height: 100%;
5024
5024
  color: #fff;
@@ -5080,7 +5080,7 @@ function ButtonTop({ smooth, center }) {
5080
5080
  };
5081
5081
  }, []);
5082
5082
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: visible && /* @__PURE__ */ jsxRuntimeExports.jsx(
5083
- Container$4,
5083
+ Container$5,
5084
5084
  {
5085
5085
  title: "Ir para o início da tela",
5086
5086
  visible: showBtnTop,
@@ -7657,7 +7657,7 @@ function LinkToMaps({
7657
7657
  function LinkToNewPage({ to: to2, children, ...rest }) {
7658
7658
  return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: to2 || children, target: "_blank", rel: "noreferrer", ...rest, children: children || to2 });
7659
7659
  }
7660
- const Container$3 = styled.div`
7660
+ const Container$4 = styled.div`
7661
7661
  .alert {
7662
7662
  font-weight: bold;
7663
7663
  margin-bottom: 0;
@@ -7683,7 +7683,7 @@ const Container$3 = styled.div`
7683
7683
  }
7684
7684
  `;
7685
7685
  function MessageNoConection() {
7686
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$3, { children: [
7686
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$4, { children: [
7687
7687
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "alert alert-danger", children: "Sem conexão com o servidor!" }),
7688
7688
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
7689
7689
  "Possíveis causas:",
@@ -19128,7 +19128,7 @@ function Input({
19128
19128
  return /* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "form-control", onClick: handleClick, ...props });
19129
19129
  }
19130
19130
  }
19131
- const Container$2 = styled.div`
19131
+ const Container$3 = styled.div`
19132
19132
  display: inline-block;
19133
19133
  `;
19134
19134
  const Label = styled.span`
@@ -19154,7 +19154,7 @@ const InputCheckBox = ({ disabled, children, name, checked, onChange }) => {
19154
19154
  onChange(event);
19155
19155
  }
19156
19156
  }
19157
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Label, { disabled, onClick: handleClick, children: [
19157
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Label, { disabled, onClick: handleClick, children: [
19158
19158
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
19159
19159
  checked && /* @__PURE__ */ jsxRuntimeExports.jsx(IconToggleOn, { color: disabled && "silver" }),
19160
19160
  !checked && /* @__PURE__ */ jsxRuntimeExports.jsx(IconToggleOff, { color: disabled && "silver" })
@@ -19458,7 +19458,7 @@ function TextHTML({ value }) {
19458
19458
  }
19459
19459
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: value } });
19460
19460
  }
19461
- const Container$1 = styled.div`
19461
+ const Container$2 = styled.div`
19462
19462
  --toggle-color-on: #4169ed;
19463
19463
  --toggle-color-off: #666;
19464
19464
  --toggle-color-inactive: #999;
@@ -19521,7 +19521,7 @@ function Toggle({
19521
19521
  });
19522
19522
  }
19523
19523
  }
19524
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$1, { checked, disabled, className, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
19524
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$2, { checked, disabled, className, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
19525
19525
  "label",
19526
19526
  {
19527
19527
  style: {
@@ -19544,7 +19544,7 @@ function Toggle({
19544
19544
  }
19545
19545
  ) });
19546
19546
  }
19547
- const Container = styled.div`
19547
+ const Container$1 = styled.div`
19548
19548
  --margin-up: 15px;
19549
19549
  --margin-down: -120px;
19550
19550
 
@@ -19679,7 +19679,7 @@ function CheckUpdates() {
19679
19679
  useLayoutEffect(() => {
19680
19680
  checkUpdate();
19681
19681
  }, []);
19682
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { onClick: handleClick, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: showRef, className: "update-box", children: [
19682
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$1, { onClick: handleClick, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: showRef, className: "update-box", children: [
19683
19683
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "update-line" }),
19684
19684
  /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "fas fa-info-circle" }),
19685
19685
  "Nova versão disponível, atualizando..."
@@ -19800,6 +19800,137 @@ function PrintButtons({ onClose, showTypes }) {
19800
19800
  ] })
19801
19801
  ] });
19802
19802
  }
19803
+ const Container = styled.div`
19804
+ display: flex;
19805
+ flex-direction: column;
19806
+ gap: var(--form-desk-gap);
19807
+
19808
+ hr {
19809
+ margin-block: 1px;
19810
+ }
19811
+
19812
+ .form-desk-line {
19813
+ display: grid;
19814
+ grid-template-columns: var(--form-desk-label-width) 1fr;
19815
+ gap: 0px 8px;
19816
+
19817
+ &[data-has-extra-comp='true'] {
19818
+ grid-template-columns: var(--form-desk-label-width) auto 1fr;
19819
+ }
19820
+
19821
+ .form-desk-label {
19822
+ padding-top: 6px;
19823
+ }
19824
+
19825
+ [data-is-line-short='true'] {
19826
+ width: var(--form-desk-line-short-width);
19827
+ }
19828
+ }
19829
+
19830
+ .form-desk--grid {
19831
+ display: grid;
19832
+
19833
+ & > div:nth-child(n + 2) {
19834
+ --form-desk-label-width: auto;
19835
+ .form-desk-label {
19836
+ text-align: end;
19837
+ }
19838
+ }
19839
+ }
19840
+
19841
+ @media (max-width: ${({ sizeBreak }) => sizeBreak}px) {
19842
+ --form-desk-gap: 12px !important;
19843
+
19844
+ .form-desk-line,
19845
+ .form-desk-line[data-has-extra-comp='true'] {
19846
+ grid-template-columns: 1fr;
19847
+
19848
+ .form-desk-label {
19849
+ padding-top: 0;
19850
+ }
19851
+ [data-is-line-short='true'] {
19852
+ width: 100%;
19853
+ }
19854
+ }
19855
+
19856
+ .form-desk--grid {
19857
+ gap: var(--form-desk-gap) !important;
19858
+ grid-template-columns: 1fr !important;
19859
+
19860
+ & > div:nth-child(n + 2) {
19861
+ .form-desk-label {
19862
+ text-align: start;
19863
+ }
19864
+ }
19865
+ }
19866
+ }
19867
+ `;
19868
+ function FormDesk({
19869
+ children,
19870
+ labelWidth = 100,
19871
+ sizeBreak = 767,
19872
+ lineShortWidth = 250,
19873
+ gap = "8px",
19874
+ ...rest
19875
+ }) {
19876
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
19877
+ Container,
19878
+ {
19879
+ style: {
19880
+ "--form-desk-label-width": `${labelWidth}px`,
19881
+ "--form-desk-line-short-width": `${lineShortWidth}px`,
19882
+ "--form-desk-gap": gap
19883
+ },
19884
+ sizeBreak,
19885
+ ...rest,
19886
+ children
19887
+ }
19888
+ );
19889
+ }
19890
+ function FormDeskLine({
19891
+ children,
19892
+ label = "",
19893
+ isShort = false,
19894
+ className = "",
19895
+ classNameLabel = "",
19896
+ classNameCol = "",
19897
+ extraComp,
19898
+ inpWidth,
19899
+ ...rest
19900
+ }) {
19901
+ const styles = {};
19902
+ if (inpWidth) {
19903
+ styles["--form-desk-line-short-width"] = inpWidth;
19904
+ }
19905
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
19906
+ "div",
19907
+ {
19908
+ className: `form-desk-line ${className}`,
19909
+ "data-has-extra-comp": extraComp ? "true" : "false",
19910
+ ...rest,
19911
+ style: { ...rest.styles, ...styles },
19912
+ children: [
19913
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: `form-desk-label ${classNameLabel}`, children: label }),
19914
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNameCol, "data-is-line-short": String(isShort), children }),
19915
+ extraComp && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "my-auto", children: extraComp })
19916
+ ]
19917
+ }
19918
+ );
19919
+ }
19920
+ function FormDeskGrid({ grid, gap = 25, className = "", children, ...rest }) {
19921
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
19922
+ "div",
19923
+ {
19924
+ className: `form-desk--grid ${className}`,
19925
+ style: {
19926
+ gridTemplateColumns: grid,
19927
+ gap
19928
+ },
19929
+ ...rest,
19930
+ children
19931
+ }
19932
+ );
19933
+ }
19803
19934
  const report = localforage.createInstance({
19804
19935
  name: "report",
19805
19936
  storeName: "report"
@@ -20778,6 +20909,9 @@ export {
20778
20909
  DataItem,
20779
20910
  DropDownButton,
20780
20911
  DynamicCounter,
20912
+ FormDesk,
20913
+ FormDeskGrid,
20914
+ FormDeskLine,
20781
20915
  FormEdit,
20782
20916
  FormEnter,
20783
20917
  FormatData,