jclib-ui 1.0.129 → 1.0.131

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.
@@ -3,11 +3,12 @@ import { ReactNode } from 'react';
3
3
  type FormEditProps = {
4
4
  title?: string;
5
5
  count?: number | string;
6
+ codigo: number | string;
6
7
  maxWidth?: number | string | undefined;
7
8
  goBack?: boolean;
8
9
  goHome?: boolean;
9
10
  onClose?: () => void;
10
11
  children?: ReactNode;
11
12
  };
12
- export default function FormEdit({ title, count, maxWidth, goBack, goHome, onClose, children, }: FormEditProps): import("react/jsx-runtime").JSX.Element;
13
+ export default function FormEdit({ title, count, codigo, maxWidth, goBack, goHome, onClose, children, }: FormEditProps): import("react/jsx-runtime").JSX.Element;
13
14
  export {};
@@ -4236,7 +4236,6 @@ const TableContainer = styled.table`
4236
4236
 
4237
4237
  tr {
4238
4238
  --table-line-height: 36px;
4239
- /* min-height: var(--table-line-height); */
4240
4239
  height: var(--table-line-height);
4241
4240
  }
4242
4241
 
@@ -4990,8 +4989,9 @@ const ButtonStyled = styled.button`
4990
4989
 
4991
4990
  width: 35px;
4992
4991
  height: 35px;
4992
+ min-width: 35px;
4993
+ min-height: 35px;
4993
4994
  border-radius: var(--pn-button-border);
4994
- margin-left: var(--margin-hor);
4995
4995
 
4996
4996
  &:hover {
4997
4997
  background-color: rgba(0, 0, 0, 0.1);
@@ -4999,14 +4999,13 @@ const ButtonStyled = styled.button`
4999
4999
 
5000
5000
  &.back {
5001
5001
  font-size: 1.2rem;
5002
+ margin-left: var(--margin-hor);
5002
5003
  }
5003
5004
 
5004
5005
  &.close {
5005
5006
  margin-right: var(--margin-hor);
5006
-
5007
5007
  &:hover {
5008
5008
  color: #ff4545;
5009
- /* transform: rotate(90deg); */
5010
5009
  }
5011
5010
  }
5012
5011
  `;
@@ -5261,28 +5260,21 @@ const PanelHeader = styled.div`
5261
5260
  display: flex;
5262
5261
  justify-content: space-between;
5263
5262
  align-items: center;
5264
- gap: 0 5px;
5265
- font-size: 1.2rem;
5263
+ gap: 0 2px;
5264
+
5266
5265
  color: var(--pn-color-font);
5266
+ font-size: 1.2rem;
5267
5267
  background-color: var(--pn-color);
5268
- padding: var(--pn-padding);
5269
5268
  border-radius: var(--pn-internal-radius) var(--pn-internal-radius) 0 0;
5269
+
5270
+ padding: var(--pn-padding);
5270
5271
  min-height: 39px;
5271
5272
 
5272
5273
  .pn-title {
5273
5274
  display: flex;
5274
5275
  align-items: center;
5275
5276
  gap: 5px;
5276
-
5277
- .pn-count {
5278
- background-color: var(--pn-color-font);
5279
- color: var(--pn-color);
5280
- font-size: 0.86rem;
5281
- font-weight: bold;
5282
- padding: 1px 6px;
5283
- /* border-radius: 5px; */
5284
- border-radius: calc(var(--pn-border-radius) - 1px);
5285
- }
5277
+ flex: 1;
5286
5278
  }
5287
5279
 
5288
5280
  @media print {
@@ -5296,6 +5288,25 @@ const PanelHeader = styled.div`
5296
5288
  }
5297
5289
  }
5298
5290
  `;
5291
+ function PanelBadge({ value, isCount, ...rest }) {
5292
+ let total;
5293
+ if (typeof value == "number") {
5294
+ total = value <= 0 ? "Inclusão" : isCount ? value : `#${value}`;
5295
+ } else {
5296
+ total = value;
5297
+ }
5298
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
5299
+ "div",
5300
+ {
5301
+ className: "badge bg-info text-dark",
5302
+ style: {
5303
+ borderRadius: "var(--pn-border-radius)"
5304
+ },
5305
+ ...rest,
5306
+ children: total
5307
+ }
5308
+ );
5309
+ }
5299
5310
  let routeMain = "/home";
5300
5311
  function setRouteMain(value) {
5301
5312
  routeMain = value;
@@ -5303,6 +5314,7 @@ function setRouteMain(value) {
5303
5314
  function Panel({
5304
5315
  title,
5305
5316
  count,
5317
+ codigo,
5306
5318
  goBack,
5307
5319
  goHome,
5308
5320
  onClose,
@@ -5312,7 +5324,7 @@ function Panel({
5312
5324
  }) {
5313
5325
  const history = useHistory();
5314
5326
  const total = count && typeof count == "number" ? count : 0;
5315
- const totalVisible = total > 5e3 ? "5000+" : total;
5327
+ const totalVisible = total > 9999 ? "9999+" : total;
5316
5328
  const totalTitle = Intl.NumberFormat("pt-br", {}).format(total);
5317
5329
  const handleClick = () => {
5318
5330
  if (onClose) {
@@ -5326,10 +5338,18 @@ function Panel({
5326
5338
  };
5327
5339
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "panel--container " + className, ...rest, children: [
5328
5340
  /* @__PURE__ */ jsxRuntimeExports.jsxs(PanelHeader, { children: [
5341
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "d-none d-sm-block", children: (goBack || goHome || onClose) && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonBack, { title: "Fechar", onClick: handleClick }) }),
5329
5342
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pn-title", children: [
5330
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "d-none d-sm-block", children: (goBack || goHome || onClose) && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonBack, { title: "Fechar", onClick: handleClick }) }),
5331
5343
  title,
5332
- total !== 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pn-count", title: `Total de registros: ${totalTitle}`, children: totalVisible })
5344
+ total !== 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
5345
+ PanelBadge,
5346
+ {
5347
+ title: `Total de registros: ${totalTitle}`,
5348
+ value: totalVisible,
5349
+ isCount: true
5350
+ }
5351
+ ),
5352
+ /* @__PURE__ */ jsxRuntimeExports.jsx(PanelBadge, { value: codigo })
5333
5353
  ] }),
5334
5354
  (goBack || goHome || onClose) && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonClose, { title: "Fechar", onClick: handleClick })
5335
5355
  ] }),
@@ -8253,7 +8273,7 @@ function ModalHeader({
8253
8273
  className: `modal--header ${className}`,
8254
8274
  ...rest,
8255
8275
  children: [
8256
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }),
8276
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pn-title", children }),
8257
8277
  /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonClose, { type: "button", onClick: () => setVisible(false) })
8258
8278
  ]
8259
8279
  }
@@ -19214,6 +19234,7 @@ function ModalFooter({
19214
19234
  function ModalBox({
19215
19235
  visible,
19216
19236
  setVisible,
19237
+ codigo,
19217
19238
  title,
19218
19239
  children,
19219
19240
  paddingBottom = 10,
@@ -19232,7 +19253,10 @@ function ModalBox({
19232
19253
  controls.start(e);
19233
19254
  }
19234
19255
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal, { setVisible, visible, ...rest, children: [
19235
- /* @__PURE__ */ jsxRuntimeExports.jsx(ModalHeader, { onPointerDown: startDrag, setVisible, children: title }),
19256
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalHeader, { onPointerDown: startDrag, setVisible, children: [
19257
+ title,
19258
+ /* @__PURE__ */ jsxRuntimeExports.jsx(PanelBadge, { value: codigo })
19259
+ ] }),
19236
19260
  /* @__PURE__ */ jsxRuntimeExports.jsx(ModalContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { style: { paddingBottom }, children }) })
19237
19261
  ] });
19238
19262
  }
@@ -19368,6 +19392,7 @@ function PanelDashboard({
19368
19392
  function FormEdit({
19369
19393
  title,
19370
19394
  count,
19395
+ codigo,
19371
19396
  maxWidth = 1200,
19372
19397
  goBack,
19373
19398
  goHome,
@@ -19383,6 +19408,7 @@ function FormEdit({
19383
19408
  {
19384
19409
  title,
19385
19410
  count,
19411
+ codigo,
19386
19412
  goBack,
19387
19413
  goHome,
19388
19414
  onClose,