@vector-business-services/cristal-ds-web 0.14.0 → 0.15.0
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/index.cjs +156 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +49 -23
- package/dist/index.d.ts +49 -23
- package/dist/index.js +158 -78
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { forwardRef, useRef, useImperativeHandle, useState, Children, isValidElement, useId, useCallback, useEffect, useContext, cloneElement
|
|
1
|
+
import { forwardRef, useRef, useImperativeHandle, useState, Children, isValidElement, useId, useLayoutEffect, useMemo, useCallback, useEffect, useContext, cloneElement } from 'react';
|
|
2
2
|
import { Accordion as Accordion$1, AccordionTab as AccordionTab$1 } from 'primereact/accordion';
|
|
3
|
-
import { WarningCircle, Info, Check, CircleNotch, CaretDown, MagnifyingGlass,
|
|
3
|
+
import { WarningCircle, Info, Question, Check, ArrowLeft, X, CircleNotch, CaretDown, MagnifyingGlass, ArrowsInSimple, ArrowsOutSimple, CaretUp, List, DribbbleLogo, SealWarning, XCircle, CheckCircle, Warning, CaretDoubleRight, CaretRight, CaretLeft, CaretDoubleLeft } from '@phosphor-icons/react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { AutoComplete as AutoComplete$1 } from 'primereact/autocomplete';
|
|
6
6
|
import { Badge as Badge$1 } from 'primereact/badge';
|
|
@@ -16,7 +16,6 @@ import { InputText } from 'primereact/inputtext';
|
|
|
16
16
|
import { PrimeReactContext, PrimeReactProvider } from 'primereact/api';
|
|
17
17
|
import { Menu as Menu$1 } from 'primereact/menu';
|
|
18
18
|
import { Menubar as Menubar$1 } from 'primereact/menubar';
|
|
19
|
-
import { Avatar } from 'primereact/avatar';
|
|
20
19
|
import { Tag as Tag$1 } from 'primereact/tag';
|
|
21
20
|
import { Message as Message$1 } from 'primereact/message';
|
|
22
21
|
import { Dialog } from 'primereact/dialog';
|
|
@@ -37,7 +36,7 @@ function AccordionTab(_props) {
|
|
|
37
36
|
return null;
|
|
38
37
|
}
|
|
39
38
|
var seta = (icon) => /* @__PURE__ */ jsx("span", { className: "cr-accordion__toggle", "aria-hidden": "true", children: icon });
|
|
40
|
-
var Accordion = forwardRef(function Accordion2({ multiple = false, activeIndex, onTabChange, children, id, className }, ref) {
|
|
39
|
+
var Accordion = forwardRef(function Accordion2({ multiple = false, activeIndex, onTabChange, children, id, className, ...props }, ref) {
|
|
41
40
|
const primeRef = useRef(null);
|
|
42
41
|
useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
43
42
|
const [interno, setInterno] = useState(multiple ? [0] : 0);
|
|
@@ -48,6 +47,7 @@ var Accordion = forwardRef(function Accordion2({ multiple = false, activeIndex,
|
|
|
48
47
|
return /* @__PURE__ */ jsx(
|
|
49
48
|
Accordion$1,
|
|
50
49
|
{
|
|
50
|
+
...props,
|
|
51
51
|
...{ unstyled: true },
|
|
52
52
|
ref: primeRef,
|
|
53
53
|
id,
|
|
@@ -87,6 +87,9 @@ var Accordion = forwardRef(function Accordion2({ multiple = false, activeIndex,
|
|
|
87
87
|
);
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
// src/components/aria.ts
|
|
91
|
+
var juntarIds = (...ids) => ids.filter(Boolean).join(" ") || void 0;
|
|
92
|
+
|
|
90
93
|
// src/components/popup.ts
|
|
91
94
|
function seguirLado(painel, alvo) {
|
|
92
95
|
if (!(painel instanceof HTMLElement) || !alvo) return;
|
|
@@ -148,7 +151,7 @@ var AutoComplete = forwardRef(function AutoComplete2({
|
|
|
148
151
|
input: {
|
|
149
152
|
root: {
|
|
150
153
|
className: "cr-field__control cr-autocomplete__input",
|
|
151
|
-
"aria-describedby": supportText
|
|
154
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"]),
|
|
152
155
|
"aria-invalid": error ? true : void 0
|
|
153
156
|
}
|
|
154
157
|
},
|
|
@@ -325,9 +328,17 @@ var lerTema = (el) => {
|
|
|
325
328
|
}
|
|
326
329
|
};
|
|
327
330
|
};
|
|
328
|
-
var comAlfa = (
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
+
var comAlfa = (cor, alfa) => {
|
|
332
|
+
const ctx = document.createElement("canvas").getContext("2d");
|
|
333
|
+
if (!ctx) return cor;
|
|
334
|
+
ctx.fillStyle = cor;
|
|
335
|
+
const normal = String(ctx.fillStyle);
|
|
336
|
+
if (normal.startsWith("#")) {
|
|
337
|
+
const n = parseInt(normal.slice(1, 7), 16);
|
|
338
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alfa})`;
|
|
339
|
+
}
|
|
340
|
+
const [r = 0, g = 0, b = 0] = normal.match(/[\d.]+/g)?.map(Number) ?? [];
|
|
341
|
+
return `rgba(${r}, ${g}, ${b}, ${alfa})`;
|
|
331
342
|
};
|
|
332
343
|
var cruz = (cor) => ({
|
|
333
344
|
id: "crCruz",
|
|
@@ -345,27 +356,61 @@ var cruz = (cor) => ({
|
|
|
345
356
|
ctx.restore();
|
|
346
357
|
}
|
|
347
358
|
});
|
|
359
|
+
var tracar = (ctx, pontos) => {
|
|
360
|
+
pontos.forEach((ponto, i) => {
|
|
361
|
+
const antes = pontos[i - 1];
|
|
362
|
+
if (!antes) return ctx.moveTo(ponto.x, ponto.y);
|
|
363
|
+
const meio = (antes.x + ponto.x) / 2;
|
|
364
|
+
ctx.bezierCurveTo(meio, antes.y, meio, ponto.y, ponto.x, ponto.y);
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
var trechos = (pontos) => pontos.reduce(
|
|
368
|
+
(lista, ponto) => {
|
|
369
|
+
if (ponto.skip) lista.push([]);
|
|
370
|
+
else lista[lista.length - 1].push(ponto);
|
|
371
|
+
return lista;
|
|
372
|
+
},
|
|
373
|
+
[[]]
|
|
374
|
+
).filter((trecho) => trecho.length > 0);
|
|
348
375
|
var curvaDoFigma = {
|
|
349
376
|
id: "crCurva",
|
|
350
377
|
beforeDatasetsDraw(chart) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
378
|
+
const { ctx, chartArea } = chart;
|
|
379
|
+
const series = chart.data.datasets.map((dataset, indice) => ({ dataset, meta: chart.getDatasetMeta(indice), indice })).filter(({ indice }) => chart.isDatasetVisible(indice)).reverse();
|
|
380
|
+
ctx.save();
|
|
381
|
+
ctx.beginPath();
|
|
382
|
+
ctx.rect(chartArea.left, chartArea.top, chartArea.width, chartArea.height);
|
|
383
|
+
ctx.clip();
|
|
384
|
+
series.forEach(({ dataset, meta }) => {
|
|
385
|
+
const cor = String(dataset.borderColor);
|
|
386
|
+
const base = Math.min(meta.yScale?.getPixelForValue(0) ?? chartArea.bottom, chartArea.bottom);
|
|
387
|
+
const degrade = ctx.createLinearGradient(0, chartArea.top, 0, chartArea.bottom);
|
|
388
|
+
degrade.addColorStop(0, comAlfa(cor, 0.1));
|
|
389
|
+
degrade.addColorStop(1, comAlfa(cor, 0.02));
|
|
390
|
+
trechos(meta.data).forEach((trecho) => {
|
|
391
|
+
ctx.beginPath();
|
|
392
|
+
tracar(ctx, trecho);
|
|
393
|
+
ctx.lineTo(trecho[trecho.length - 1].x, base);
|
|
394
|
+
ctx.lineTo(trecho[0].x, base);
|
|
395
|
+
ctx.closePath();
|
|
396
|
+
ctx.fillStyle = degrade;
|
|
397
|
+
ctx.fill();
|
|
361
398
|
});
|
|
362
|
-
if (meta.dataset)
|
|
363
|
-
meta.dataset._pointsUpdated = true;
|
|
364
399
|
});
|
|
400
|
+
series.forEach(({ dataset, meta }) => {
|
|
401
|
+
ctx.strokeStyle = String(dataset.borderColor);
|
|
402
|
+
ctx.lineWidth = 2;
|
|
403
|
+
trechos(meta.data).forEach((trecho) => {
|
|
404
|
+
ctx.beginPath();
|
|
405
|
+
tracar(ctx, trecho);
|
|
406
|
+
ctx.stroke();
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
ctx.restore();
|
|
365
410
|
}
|
|
366
411
|
};
|
|
367
412
|
var formatar = (eixo, valor) => eixo?.format ? eixo.format(valor) : String(valor);
|
|
368
|
-
|
|
413
|
+
var Chart = forwardRef(function Chart2({
|
|
369
414
|
type = "line",
|
|
370
415
|
stacked = false,
|
|
371
416
|
labels,
|
|
@@ -378,9 +423,11 @@ function Chart({
|
|
|
378
423
|
actions,
|
|
379
424
|
height = 266,
|
|
380
425
|
id,
|
|
381
|
-
className
|
|
382
|
-
|
|
426
|
+
className,
|
|
427
|
+
...props
|
|
428
|
+
}, ref) {
|
|
383
429
|
const raiz = useRef(null);
|
|
430
|
+
useImperativeHandle(ref, () => raiz.current);
|
|
384
431
|
const ajuda = useRef(null);
|
|
385
432
|
const [tema, setTema] = useState();
|
|
386
433
|
useLayoutEffect(() => {
|
|
@@ -413,22 +460,13 @@ function Chart({
|
|
|
413
460
|
data: s.data,
|
|
414
461
|
yAxisID: s.axis === "right" ? "y2" : "y",
|
|
415
462
|
borderColor: cor,
|
|
416
|
-
|
|
417
|
-
|
|
463
|
+
// A linha e a área são desenhadas pelo plugin curvaDoFigma.
|
|
464
|
+
showLine: false,
|
|
418
465
|
pointRadius: 0,
|
|
419
466
|
pointHoverRadius: 4,
|
|
420
467
|
pointHoverBorderWidth: 2,
|
|
421
468
|
pointHoverBorderColor: tema.superficie,
|
|
422
|
-
pointHoverBackgroundColor: cor
|
|
423
|
-
fill: "origin",
|
|
424
|
-
backgroundColor: (ctx) => {
|
|
425
|
-
const area = ctx.chart.chartArea;
|
|
426
|
-
if (!area) return comAlfa(cor, 0.1);
|
|
427
|
-
const degrade = ctx.chart.ctx.createLinearGradient(0, area.top, 0, area.bottom);
|
|
428
|
-
degrade.addColorStop(0, comAlfa(cor, 0.1));
|
|
429
|
-
degrade.addColorStop(1, comAlfa(cor, 0.02));
|
|
430
|
-
return degrade;
|
|
431
|
-
}
|
|
469
|
+
pointHoverBackgroundColor: cor
|
|
432
470
|
};
|
|
433
471
|
})
|
|
434
472
|
};
|
|
@@ -496,7 +534,7 @@ function Chart({
|
|
|
496
534
|
}, [tema, yAxis, y2Axis, temDireita, series, type, stacked]);
|
|
497
535
|
const card = Boolean(title || actions);
|
|
498
536
|
const classes = ["cr-chart", card && "cr-chart--card", className].filter(Boolean).join(" ");
|
|
499
|
-
return /* @__PURE__ */ jsxs("div", { ref: raiz, id, className: classes, children: [
|
|
537
|
+
return /* @__PURE__ */ jsxs("div", { ...props, ref: raiz, id, className: classes, children: [
|
|
500
538
|
card && /* @__PURE__ */ jsxs("div", { className: "cr-chart__header", children: [
|
|
501
539
|
/* @__PURE__ */ jsxs("div", { className: "cr-chart__title-row", children: [
|
|
502
540
|
title && /* @__PURE__ */ jsx("span", { className: "cr-chart__title", children: title }),
|
|
@@ -539,25 +577,25 @@ function Chart({
|
|
|
539
577
|
}
|
|
540
578
|
),
|
|
541
579
|
s.label
|
|
542
|
-
] }, s.label)) })
|
|
580
|
+
] }, `${i}-${s.label}`)) })
|
|
543
581
|
] }),
|
|
544
582
|
/* @__PURE__ */ jsxs("table", { className: "cr-so-leitor cr-chart__table", children: [
|
|
545
583
|
title && /* @__PURE__ */ jsx("caption", { children: title }),
|
|
546
584
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
547
585
|
/* @__PURE__ */ jsx("td", {}),
|
|
548
|
-
series.map((s) => /* @__PURE__ */ jsx("th", { scope: "col", children: s.label }, s.label))
|
|
586
|
+
series.map((s, i) => /* @__PURE__ */ jsx("th", { scope: "col", children: s.label }, `${i}-${s.label}`))
|
|
549
587
|
] }) }),
|
|
550
588
|
/* @__PURE__ */ jsx("tbody", { children: labels.map((rotulo, linha) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
551
589
|
/* @__PURE__ */ jsx("th", { scope: "row", children: rotulo }),
|
|
552
|
-
series.map((s) => {
|
|
590
|
+
series.map((s, i) => {
|
|
553
591
|
const valor = s.data[linha];
|
|
554
592
|
const eixo = s.axis === "right" ? y2Axis : yAxis;
|
|
555
|
-
return /* @__PURE__ */ jsx("td", { children: valor == null ? "" : formatar(eixo, valor) }, s.label);
|
|
593
|
+
return /* @__PURE__ */ jsx("td", { children: valor == null ? "" : formatar(eixo, valor) }, `${i}-${s.label}`);
|
|
556
594
|
})
|
|
557
|
-
] }, rotulo)) })
|
|
595
|
+
] }, `${linha}-${rotulo}`)) })
|
|
558
596
|
] })
|
|
559
597
|
] });
|
|
560
|
-
}
|
|
598
|
+
});
|
|
561
599
|
var Checkbox = forwardRef(function Checkbox2({
|
|
562
600
|
label,
|
|
563
601
|
showLabel = true,
|
|
@@ -572,7 +610,8 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
572
610
|
value,
|
|
573
611
|
id,
|
|
574
612
|
className,
|
|
575
|
-
style
|
|
613
|
+
style,
|
|
614
|
+
...props
|
|
576
615
|
}, ref) {
|
|
577
616
|
const autoId = useId();
|
|
578
617
|
const inputId = id ?? autoId;
|
|
@@ -615,7 +654,7 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
615
654
|
root: {
|
|
616
655
|
className: `cr-checkbox__control${checked ? " cr-checkbox__control--checked" : ""}`
|
|
617
656
|
},
|
|
618
|
-
input: { className: "cr-checkbox__input" },
|
|
657
|
+
input: { ...props, className: "cr-checkbox__input" },
|
|
619
658
|
box: { className: "cr-checkbox__box" },
|
|
620
659
|
icon: { className: "cr-checkbox__icon", "aria-hidden": true }
|
|
621
660
|
}
|
|
@@ -753,7 +792,7 @@ var IconButton = forwardRef(function IconButton2({
|
|
|
753
792
|
] });
|
|
754
793
|
});
|
|
755
794
|
var FOCAVEIS = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
756
|
-
|
|
795
|
+
var Drawer = forwardRef(function Drawer2({
|
|
757
796
|
visible,
|
|
758
797
|
onHide,
|
|
759
798
|
title,
|
|
@@ -768,8 +807,13 @@ function Drawer({
|
|
|
768
807
|
footer,
|
|
769
808
|
children,
|
|
770
809
|
id,
|
|
771
|
-
className
|
|
772
|
-
|
|
810
|
+
className,
|
|
811
|
+
...props
|
|
812
|
+
}, ref) {
|
|
813
|
+
const primeRef = useRef(null);
|
|
814
|
+
useImperativeHandle(ref, () => ({
|
|
815
|
+
getElement: () => primeRef.current?.getElement() ?? null
|
|
816
|
+
}));
|
|
773
817
|
const autoId = useId();
|
|
774
818
|
const titleId = `${autoId}-title`;
|
|
775
819
|
const subtitleId = `${autoId}-subtitle`;
|
|
@@ -818,6 +862,8 @@ function Drawer({
|
|
|
818
862
|
return /* @__PURE__ */ jsx(
|
|
819
863
|
Sidebar,
|
|
820
864
|
{
|
|
865
|
+
...props,
|
|
866
|
+
ref: primeRef,
|
|
821
867
|
unstyled: true,
|
|
822
868
|
id,
|
|
823
869
|
visible,
|
|
@@ -901,7 +947,7 @@ function Drawer({
|
|
|
901
947
|
)
|
|
902
948
|
}
|
|
903
949
|
);
|
|
904
|
-
}
|
|
950
|
+
});
|
|
905
951
|
var Input = forwardRef(function Input2({
|
|
906
952
|
variant = "outline",
|
|
907
953
|
size = "large",
|
|
@@ -946,8 +992,8 @@ var Input = forwardRef(function Input2({
|
|
|
946
992
|
disabled,
|
|
947
993
|
invalid: Boolean(error),
|
|
948
994
|
"aria-invalid": error ? true : void 0,
|
|
949
|
-
|
|
950
|
-
|
|
995
|
+
...props,
|
|
996
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"])
|
|
951
997
|
}
|
|
952
998
|
),
|
|
953
999
|
trailingIcon && /* @__PURE__ */ jsx("span", { className: "cr-field__icon", children: trailingIcon })
|
|
@@ -970,7 +1016,8 @@ var Menu = forwardRef(function Menu2({
|
|
|
970
1016
|
onShow,
|
|
971
1017
|
onHide,
|
|
972
1018
|
id,
|
|
973
|
-
className
|
|
1019
|
+
className,
|
|
1020
|
+
...props
|
|
974
1021
|
}, ref) {
|
|
975
1022
|
const primeRef = useRef(null);
|
|
976
1023
|
const alvo = useRef(null);
|
|
@@ -1033,6 +1080,7 @@ var Menu = forwardRef(function Menu2({
|
|
|
1033
1080
|
const menu = /* @__PURE__ */ jsx(
|
|
1034
1081
|
Menu$1,
|
|
1035
1082
|
{
|
|
1083
|
+
...props,
|
|
1036
1084
|
unstyled: true,
|
|
1037
1085
|
ref: primeRef,
|
|
1038
1086
|
id,
|
|
@@ -1121,16 +1169,11 @@ function Profile({ user, menu }) {
|
|
|
1121
1169
|
user.role && /* @__PURE__ */ jsx("span", { className: "cr-menubar__profile-role", children: user.role })
|
|
1122
1170
|
] }),
|
|
1123
1171
|
/* @__PURE__ */ jsx(
|
|
1124
|
-
|
|
1172
|
+
"span",
|
|
1125
1173
|
{
|
|
1126
|
-
unstyled: true,
|
|
1127
1174
|
"aria-hidden": "true",
|
|
1128
1175
|
className: `cr-menubar__avatar${user.avatar ? "" : " cr-menubar__avatar--initial"}`,
|
|
1129
|
-
image: user.avatar,
|
|
1130
|
-
imageAlt: "",
|
|
1131
|
-
label: user.avatar ? void 0 : user.name.trim().charAt(0).toUpperCase(),
|
|
1132
|
-
shape: "circle",
|
|
1133
|
-
pt: { image: { className: "cr-menubar__avatar-image" } }
|
|
1176
|
+
children: user.avatar ? /* @__PURE__ */ jsx("img", { className: "cr-menubar__avatar-image", src: user.avatar, alt: "" }) : user.name.trim().charAt(0).toUpperCase()
|
|
1134
1177
|
}
|
|
1135
1178
|
)
|
|
1136
1179
|
] });
|
|
@@ -1179,7 +1222,8 @@ var Menubar = forwardRef(function Menubar2({
|
|
|
1179
1222
|
user,
|
|
1180
1223
|
userMenu,
|
|
1181
1224
|
id,
|
|
1182
|
-
className
|
|
1225
|
+
className,
|
|
1226
|
+
...props
|
|
1183
1227
|
}, ref) {
|
|
1184
1228
|
const [innerSearch, setInnerSearch] = useState("");
|
|
1185
1229
|
const search = searchValue ?? innerSearch;
|
|
@@ -1245,6 +1289,7 @@ var Menubar = forwardRef(function Menubar2({
|
|
|
1245
1289
|
return /* @__PURE__ */ jsx("div", { ref, id, className: classes, children: /* @__PURE__ */ jsx(
|
|
1246
1290
|
Menubar$1,
|
|
1247
1291
|
{
|
|
1292
|
+
...props,
|
|
1248
1293
|
unstyled: true,
|
|
1249
1294
|
className: "cr-menubar__bar",
|
|
1250
1295
|
model: [],
|
|
@@ -1276,10 +1321,12 @@ var MenuPrincipal = forwardRef(
|
|
|
1276
1321
|
model,
|
|
1277
1322
|
popup = false,
|
|
1278
1323
|
"aria-label": ariaLabel = "Menu principal",
|
|
1324
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1279
1325
|
onShow,
|
|
1280
1326
|
onHide,
|
|
1281
1327
|
id,
|
|
1282
|
-
className
|
|
1328
|
+
className,
|
|
1329
|
+
...props
|
|
1283
1330
|
}, ref) {
|
|
1284
1331
|
const primeRef = useRef(null);
|
|
1285
1332
|
const context = useContext(PrimeReactContext);
|
|
@@ -1353,7 +1400,12 @@ var MenuPrincipal = forwardRef(
|
|
|
1353
1400
|
});
|
|
1354
1401
|
const classes = ["cr-menu-principal", popup && "cr-menu-principal--popup", className].filter(Boolean).join(" ");
|
|
1355
1402
|
const pt = {
|
|
1356
|
-
|
|
1403
|
+
// O nome acessível vai na lista (role=menu), como no Menu.
|
|
1404
|
+
menu: {
|
|
1405
|
+
className: "cr-menu-principal__list",
|
|
1406
|
+
"aria-label": ariaLabelledBy ? void 0 : ariaLabel,
|
|
1407
|
+
"aria-labelledby": ariaLabelledBy
|
|
1408
|
+
},
|
|
1357
1409
|
submenuHeader: { className: "cr-menu-principal__group" },
|
|
1358
1410
|
// O divisor tracejado é o Divider do Cristal (dashed).
|
|
1359
1411
|
separator: {
|
|
@@ -1369,6 +1421,7 @@ var MenuPrincipal = forwardRef(
|
|
|
1369
1421
|
const menu = /* @__PURE__ */ jsx(
|
|
1370
1422
|
Menu$1,
|
|
1371
1423
|
{
|
|
1424
|
+
...props,
|
|
1372
1425
|
unstyled: true,
|
|
1373
1426
|
ref: primeRef,
|
|
1374
1427
|
id,
|
|
@@ -1400,12 +1453,13 @@ var ICON = {
|
|
|
1400
1453
|
highlight: /* @__PURE__ */ jsx(SealWarning, {}),
|
|
1401
1454
|
neutral: /* @__PURE__ */ jsx(WarningCircle, {})
|
|
1402
1455
|
};
|
|
1403
|
-
var Message = forwardRef(function Message2({ type = "info", children, showIcon = true, id, className }, ref) {
|
|
1456
|
+
var Message = forwardRef(function Message2({ type = "info", children, showIcon = true, id, className, ...props }, ref) {
|
|
1404
1457
|
const primeRef = useRef(null);
|
|
1405
1458
|
useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
1406
1459
|
return /* @__PURE__ */ jsx(
|
|
1407
1460
|
Message$1,
|
|
1408
1461
|
{
|
|
1462
|
+
...props,
|
|
1409
1463
|
unstyled: true,
|
|
1410
1464
|
ref: primeRef,
|
|
1411
1465
|
id,
|
|
@@ -1421,9 +1475,10 @@ var Message = forwardRef(function Message2({ type = "info", children, showIcon =
|
|
|
1421
1475
|
}
|
|
1422
1476
|
);
|
|
1423
1477
|
});
|
|
1424
|
-
|
|
1478
|
+
var Modal = forwardRef(function Modal2({
|
|
1425
1479
|
visible,
|
|
1426
1480
|
onHide,
|
|
1481
|
+
dismissableMask = true,
|
|
1427
1482
|
title,
|
|
1428
1483
|
size = "large",
|
|
1429
1484
|
onHelp,
|
|
@@ -1433,8 +1488,13 @@ function Modal({
|
|
|
1433
1488
|
footerStart,
|
|
1434
1489
|
children,
|
|
1435
1490
|
id,
|
|
1436
|
-
className
|
|
1437
|
-
|
|
1491
|
+
className,
|
|
1492
|
+
...props
|
|
1493
|
+
}, ref) {
|
|
1494
|
+
const primeRef = useRef(null);
|
|
1495
|
+
useImperativeHandle(ref, () => ({
|
|
1496
|
+
getElement: () => primeRef.current?.getElement() ?? null
|
|
1497
|
+
}));
|
|
1438
1498
|
const autoId = useId();
|
|
1439
1499
|
const titleId = `${autoId}-title`;
|
|
1440
1500
|
const [body, setBody] = useState(null);
|
|
@@ -1452,10 +1512,13 @@ function Modal({
|
|
|
1452
1512
|
return /* @__PURE__ */ jsx(
|
|
1453
1513
|
Dialog,
|
|
1454
1514
|
{
|
|
1515
|
+
...props,
|
|
1516
|
+
ref: primeRef,
|
|
1455
1517
|
unstyled: true,
|
|
1456
1518
|
id,
|
|
1457
1519
|
visible,
|
|
1458
1520
|
onHide,
|
|
1521
|
+
dismissableMask,
|
|
1459
1522
|
draggable: false,
|
|
1460
1523
|
resizable: false,
|
|
1461
1524
|
blockScroll: true,
|
|
@@ -1510,7 +1573,7 @@ function Modal({
|
|
|
1510
1573
|
] })
|
|
1511
1574
|
}
|
|
1512
1575
|
);
|
|
1513
|
-
}
|
|
1576
|
+
});
|
|
1514
1577
|
var MultiSelect = forwardRef(function MultiSelect2({
|
|
1515
1578
|
variant = "outline",
|
|
1516
1579
|
size = "large",
|
|
@@ -1610,7 +1673,7 @@ var MultiSelect = forwardRef(function MultiSelect2({
|
|
|
1610
1673
|
},
|
|
1611
1674
|
hiddenInputWrapper: { className: "cr-so-leitor cr-multiselect__hidden" },
|
|
1612
1675
|
input: {
|
|
1613
|
-
"aria-describedby": supportText
|
|
1676
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"]),
|
|
1614
1677
|
"aria-invalid": error ? true : void 0,
|
|
1615
1678
|
"aria-required": required || void 0
|
|
1616
1679
|
},
|
|
@@ -1813,7 +1876,8 @@ var Select = forwardRef(function Select2({
|
|
|
1813
1876
|
disabled,
|
|
1814
1877
|
id,
|
|
1815
1878
|
name,
|
|
1816
|
-
className
|
|
1879
|
+
className,
|
|
1880
|
+
...props
|
|
1817
1881
|
}, ref) {
|
|
1818
1882
|
const autoId = useId();
|
|
1819
1883
|
const inputId = id ?? autoId;
|
|
@@ -1878,6 +1942,7 @@ var Select = forwardRef(function Select2({
|
|
|
1878
1942
|
/* @__PURE__ */ jsx(
|
|
1879
1943
|
Dropdown,
|
|
1880
1944
|
{
|
|
1945
|
+
...props,
|
|
1881
1946
|
unstyled: true,
|
|
1882
1947
|
inputId,
|
|
1883
1948
|
focusInputRef: setInputRef,
|
|
@@ -1900,7 +1965,7 @@ var Select = forwardRef(function Select2({
|
|
|
1900
1965
|
"aria-label": label ? void 0 : ariaLabel,
|
|
1901
1966
|
"aria-expanded": open,
|
|
1902
1967
|
"aria-controls": open ? listId : void 0,
|
|
1903
|
-
"aria-describedby": supportText
|
|
1968
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"]),
|
|
1904
1969
|
"aria-invalid": error ? true : void 0,
|
|
1905
1970
|
"aria-required": required || void 0,
|
|
1906
1971
|
pt
|
|
@@ -1932,7 +1997,8 @@ var Paginator = forwardRef(function Paginator2({
|
|
|
1932
1997
|
onPageChange,
|
|
1933
1998
|
rowsPerPageLabel = "Itens por p\xE1gina",
|
|
1934
1999
|
id,
|
|
1935
|
-
className
|
|
2000
|
+
className,
|
|
2001
|
+
...props
|
|
1936
2002
|
}, ref) {
|
|
1937
2003
|
const primeRef = useRef(null);
|
|
1938
2004
|
useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
@@ -1944,6 +2010,7 @@ var Paginator = forwardRef(function Paginator2({
|
|
|
1944
2010
|
return /* @__PURE__ */ jsx(
|
|
1945
2011
|
Paginator$1,
|
|
1946
2012
|
{
|
|
2013
|
+
...props,
|
|
1947
2014
|
unstyled: true,
|
|
1948
2015
|
ref: primeRef,
|
|
1949
2016
|
id,
|
|
@@ -2031,7 +2098,8 @@ var Radio = forwardRef(function Radio2({
|
|
|
2031
2098
|
required,
|
|
2032
2099
|
id,
|
|
2033
2100
|
className,
|
|
2034
|
-
style
|
|
2101
|
+
style,
|
|
2102
|
+
...props
|
|
2035
2103
|
}, ref) {
|
|
2036
2104
|
const autoId = useId();
|
|
2037
2105
|
const inputId = id ?? autoId;
|
|
@@ -2057,7 +2125,7 @@ var Radio = forwardRef(function Radio2({
|
|
|
2057
2125
|
pt: {
|
|
2058
2126
|
// Marcado pela prop do Cristal, não pelo atributo interno do Prime (data-p-checked).
|
|
2059
2127
|
root: { className: `cr-radio__control${checked ? " cr-radio__control--checked" : ""}` },
|
|
2060
|
-
input: { className: "cr-radio__input" },
|
|
2128
|
+
input: { ...props, className: "cr-radio__input" },
|
|
2061
2129
|
box: { className: "cr-radio__box" },
|
|
2062
2130
|
icon: { className: "cr-radio__icon" }
|
|
2063
2131
|
}
|
|
@@ -2074,7 +2142,15 @@ var Radio = forwardRef(function Radio2({
|
|
|
2074
2142
|
] });
|
|
2075
2143
|
});
|
|
2076
2144
|
var porcentagem = (posicao, total, visivel) => total > visivel ? Math.round(posicao / (total - visivel) * 100) : 0;
|
|
2077
|
-
var ScrollPanel = forwardRef(function ScrollPanel2({
|
|
2145
|
+
var ScrollPanel = forwardRef(function ScrollPanel2({
|
|
2146
|
+
children,
|
|
2147
|
+
"aria-label": ariaLabel,
|
|
2148
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2149
|
+
style,
|
|
2150
|
+
id,
|
|
2151
|
+
className,
|
|
2152
|
+
...props
|
|
2153
|
+
}, ref) {
|
|
2078
2154
|
const primeRef = useRef(null);
|
|
2079
2155
|
useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
2080
2156
|
const contentId = `${useId()}-content`;
|
|
@@ -2109,7 +2185,7 @@ var ScrollPanel = forwardRef(function ScrollPanel2({ children, "aria-label": ari
|
|
|
2109
2185
|
barx: barra("horizontal", posicao.x),
|
|
2110
2186
|
bary: barra("vertical", posicao.y)
|
|
2111
2187
|
};
|
|
2112
|
-
return /* @__PURE__ */ jsx(ScrollPanel$1, { unstyled: true, ref: primeRef, id, pt, children });
|
|
2188
|
+
return /* @__PURE__ */ jsx(ScrollPanel$1, { ...props, unstyled: true, ref: primeRef, id, pt, children });
|
|
2113
2189
|
});
|
|
2114
2190
|
var SegmentControl = forwardRef(
|
|
2115
2191
|
function SegmentControl2({
|
|
@@ -2121,7 +2197,8 @@ var SegmentControl = forwardRef(
|
|
|
2121
2197
|
"aria-labelledby": ariaLabelledBy,
|
|
2122
2198
|
disabled,
|
|
2123
2199
|
id,
|
|
2124
|
-
className
|
|
2200
|
+
className,
|
|
2201
|
+
...props
|
|
2125
2202
|
}, ref) {
|
|
2126
2203
|
const primeRef = useRef(null);
|
|
2127
2204
|
useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
@@ -2129,6 +2206,7 @@ var SegmentControl = forwardRef(
|
|
|
2129
2206
|
return /* @__PURE__ */ jsx(
|
|
2130
2207
|
SelectButton,
|
|
2131
2208
|
{
|
|
2209
|
+
...props,
|
|
2132
2210
|
unstyled: true,
|
|
2133
2211
|
ref: primeRef,
|
|
2134
2212
|
id,
|
|
@@ -2173,7 +2251,8 @@ var Switch = forwardRef(function Switch2({
|
|
|
2173
2251
|
name,
|
|
2174
2252
|
id,
|
|
2175
2253
|
className,
|
|
2176
|
-
style
|
|
2254
|
+
style,
|
|
2255
|
+
...props
|
|
2177
2256
|
}, ref) {
|
|
2178
2257
|
const autoId = useId();
|
|
2179
2258
|
const inputId = id ?? autoId;
|
|
@@ -2202,7 +2281,7 @@ var Switch = forwardRef(function Switch2({
|
|
|
2202
2281
|
role: void 0,
|
|
2203
2282
|
"aria-checked": void 0
|
|
2204
2283
|
},
|
|
2205
|
-
input: { className: "cr-switch__input" },
|
|
2284
|
+
input: { ...props, className: "cr-switch__input" },
|
|
2206
2285
|
slider: { className: "cr-switch__track" }
|
|
2207
2286
|
}
|
|
2208
2287
|
}
|
|
@@ -2220,7 +2299,7 @@ var Switch = forwardRef(function Switch2({
|
|
|
2220
2299
|
function TabPanel(_props) {
|
|
2221
2300
|
return null;
|
|
2222
2301
|
}
|
|
2223
|
-
var Tabs = forwardRef(function Tabs2({ activeIndex, onTabChange, children, id, className }, ref) {
|
|
2302
|
+
var Tabs = forwardRef(function Tabs2({ activeIndex, onTabChange, children, id, className, ...props }, ref) {
|
|
2224
2303
|
const primeRef = useRef(null);
|
|
2225
2304
|
useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
2226
2305
|
const [interno, setInterno] = useState(0);
|
|
@@ -2263,6 +2342,7 @@ var Tabs = forwardRef(function Tabs2({ activeIndex, onTabChange, children, id, c
|
|
|
2263
2342
|
return /* @__PURE__ */ jsx(
|
|
2264
2343
|
TabView,
|
|
2265
2344
|
{
|
|
2345
|
+
...props,
|
|
2266
2346
|
unstyled: true,
|
|
2267
2347
|
ref: primeRef,
|
|
2268
2348
|
id,
|