jclib-ui 1.0.129 → 1.0.130
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/formEdit/formEdit.d.ts +2 -1
- package/dist/jclib-ui.es.js +47 -22
- package/dist/jclib-ui.es.js.map +1 -1
- package/dist/jclib-ui.umd.js +26 -34
- package/dist/jclib-ui.umd.js.map +1 -1
- package/dist/modalBox/ModalBox.d.ts +1 -0
- package/dist/panel/panel.d.ts +1 -1
- package/dist/panel/panelBadge.d.ts +4 -0
- package/package.json +1 -1
|
@@ -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 {};
|
package/dist/jclib-ui.es.js
CHANGED
|
@@ -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
|
|
5265
|
-
|
|
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, ...rest }) {
|
|
5292
|
+
let total;
|
|
5293
|
+
if (typeof value == "number") {
|
|
5294
|
+
total = value <= 0 ? "Inclusão" : `#${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 >
|
|
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,17 @@ 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(
|
|
5344
|
+
total !== 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5345
|
+
PanelBadge,
|
|
5346
|
+
{
|
|
5347
|
+
title: `Total de registros: ${totalTitle}`,
|
|
5348
|
+
value: totalVisible
|
|
5349
|
+
}
|
|
5350
|
+
),
|
|
5351
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PanelBadge, { value: codigo })
|
|
5333
5352
|
] }),
|
|
5334
5353
|
(goBack || goHome || onClose) && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonClose, { title: "Fechar", onClick: handleClick })
|
|
5335
5354
|
] }),
|
|
@@ -8253,7 +8272,7 @@ function ModalHeader({
|
|
|
8253
8272
|
className: `modal--header ${className}`,
|
|
8254
8273
|
...rest,
|
|
8255
8274
|
children: [
|
|
8256
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
8275
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pn-title", children }),
|
|
8257
8276
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ButtonClose, { type: "button", onClick: () => setVisible(false) })
|
|
8258
8277
|
]
|
|
8259
8278
|
}
|
|
@@ -19214,6 +19233,7 @@ function ModalFooter({
|
|
|
19214
19233
|
function ModalBox({
|
|
19215
19234
|
visible,
|
|
19216
19235
|
setVisible,
|
|
19236
|
+
codigo,
|
|
19217
19237
|
title,
|
|
19218
19238
|
children,
|
|
19219
19239
|
paddingBottom = 10,
|
|
@@ -19232,7 +19252,10 @@ function ModalBox({
|
|
|
19232
19252
|
controls.start(e);
|
|
19233
19253
|
}
|
|
19234
19254
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal, { setVisible, visible, ...rest, children: [
|
|
19235
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
19255
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ModalHeader, { onPointerDown: startDrag, setVisible, children: [
|
|
19256
|
+
title,
|
|
19257
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PanelBadge, { value: codigo })
|
|
19258
|
+
] }),
|
|
19236
19259
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ModalContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { style: { paddingBottom }, children }) })
|
|
19237
19260
|
] });
|
|
19238
19261
|
}
|
|
@@ -19368,6 +19391,7 @@ function PanelDashboard({
|
|
|
19368
19391
|
function FormEdit({
|
|
19369
19392
|
title,
|
|
19370
19393
|
count,
|
|
19394
|
+
codigo,
|
|
19371
19395
|
maxWidth = 1200,
|
|
19372
19396
|
goBack,
|
|
19373
19397
|
goHome,
|
|
@@ -19383,6 +19407,7 @@ function FormEdit({
|
|
|
19383
19407
|
{
|
|
19384
19408
|
title,
|
|
19385
19409
|
count,
|
|
19410
|
+
codigo,
|
|
19386
19411
|
goBack,
|
|
19387
19412
|
goHome,
|
|
19388
19413
|
onClose,
|