@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.cjs
CHANGED
|
@@ -18,7 +18,6 @@ var inputtext = require('primereact/inputtext');
|
|
|
18
18
|
var api = require('primereact/api');
|
|
19
19
|
var menu = require('primereact/menu');
|
|
20
20
|
var menubar = require('primereact/menubar');
|
|
21
|
-
var avatar = require('primereact/avatar');
|
|
22
21
|
var tag = require('primereact/tag');
|
|
23
22
|
var message = require('primereact/message');
|
|
24
23
|
var dialog = require('primereact/dialog');
|
|
@@ -39,7 +38,7 @@ function AccordionTab(_props) {
|
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
41
40
|
var seta = (icon) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-accordion__toggle", "aria-hidden": "true", children: icon });
|
|
42
|
-
var Accordion = react.forwardRef(function Accordion2({ multiple = false, activeIndex, onTabChange, children, id, className }, ref) {
|
|
41
|
+
var Accordion = react.forwardRef(function Accordion2({ multiple = false, activeIndex, onTabChange, children, id, className, ...props }, ref) {
|
|
43
42
|
const primeRef = react.useRef(null);
|
|
44
43
|
react.useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
45
44
|
const [interno, setInterno] = react.useState(multiple ? [0] : 0);
|
|
@@ -50,6 +49,7 @@ var Accordion = react.forwardRef(function Accordion2({ multiple = false, activeI
|
|
|
50
49
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
50
|
accordion.Accordion,
|
|
52
51
|
{
|
|
52
|
+
...props,
|
|
53
53
|
...{ unstyled: true },
|
|
54
54
|
ref: primeRef,
|
|
55
55
|
id,
|
|
@@ -89,6 +89,9 @@ var Accordion = react.forwardRef(function Accordion2({ multiple = false, activeI
|
|
|
89
89
|
);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
+
// src/components/aria.ts
|
|
93
|
+
var juntarIds = (...ids) => ids.filter(Boolean).join(" ") || void 0;
|
|
94
|
+
|
|
92
95
|
// src/components/popup.ts
|
|
93
96
|
function seguirLado(painel, alvo) {
|
|
94
97
|
if (!(painel instanceof HTMLElement) || !alvo) return;
|
|
@@ -150,7 +153,7 @@ var AutoComplete = react.forwardRef(function AutoComplete2({
|
|
|
150
153
|
input: {
|
|
151
154
|
root: {
|
|
152
155
|
className: "cr-field__control cr-autocomplete__input",
|
|
153
|
-
"aria-describedby": supportText
|
|
156
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"]),
|
|
154
157
|
"aria-invalid": error ? true : void 0
|
|
155
158
|
}
|
|
156
159
|
},
|
|
@@ -327,9 +330,17 @@ var lerTema = (el) => {
|
|
|
327
330
|
}
|
|
328
331
|
};
|
|
329
332
|
};
|
|
330
|
-
var comAlfa = (
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
+
var comAlfa = (cor, alfa) => {
|
|
334
|
+
const ctx = document.createElement("canvas").getContext("2d");
|
|
335
|
+
if (!ctx) return cor;
|
|
336
|
+
ctx.fillStyle = cor;
|
|
337
|
+
const normal = String(ctx.fillStyle);
|
|
338
|
+
if (normal.startsWith("#")) {
|
|
339
|
+
const n = parseInt(normal.slice(1, 7), 16);
|
|
340
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alfa})`;
|
|
341
|
+
}
|
|
342
|
+
const [r = 0, g = 0, b = 0] = normal.match(/[\d.]+/g)?.map(Number) ?? [];
|
|
343
|
+
return `rgba(${r}, ${g}, ${b}, ${alfa})`;
|
|
333
344
|
};
|
|
334
345
|
var cruz = (cor) => ({
|
|
335
346
|
id: "crCruz",
|
|
@@ -347,27 +358,61 @@ var cruz = (cor) => ({
|
|
|
347
358
|
ctx.restore();
|
|
348
359
|
}
|
|
349
360
|
});
|
|
361
|
+
var tracar = (ctx, pontos) => {
|
|
362
|
+
pontos.forEach((ponto, i) => {
|
|
363
|
+
const antes = pontos[i - 1];
|
|
364
|
+
if (!antes) return ctx.moveTo(ponto.x, ponto.y);
|
|
365
|
+
const meio = (antes.x + ponto.x) / 2;
|
|
366
|
+
ctx.bezierCurveTo(meio, antes.y, meio, ponto.y, ponto.x, ponto.y);
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
var trechos = (pontos) => pontos.reduce(
|
|
370
|
+
(lista, ponto) => {
|
|
371
|
+
if (ponto.skip) lista.push([]);
|
|
372
|
+
else lista[lista.length - 1].push(ponto);
|
|
373
|
+
return lista;
|
|
374
|
+
},
|
|
375
|
+
[[]]
|
|
376
|
+
).filter((trecho) => trecho.length > 0);
|
|
350
377
|
var curvaDoFigma = {
|
|
351
378
|
id: "crCurva",
|
|
352
379
|
beforeDatasetsDraw(chart) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
380
|
+
const { ctx, chartArea } = chart;
|
|
381
|
+
const series = chart.data.datasets.map((dataset, indice) => ({ dataset, meta: chart.getDatasetMeta(indice), indice })).filter(({ indice }) => chart.isDatasetVisible(indice)).reverse();
|
|
382
|
+
ctx.save();
|
|
383
|
+
ctx.beginPath();
|
|
384
|
+
ctx.rect(chartArea.left, chartArea.top, chartArea.width, chartArea.height);
|
|
385
|
+
ctx.clip();
|
|
386
|
+
series.forEach(({ dataset, meta }) => {
|
|
387
|
+
const cor = String(dataset.borderColor);
|
|
388
|
+
const base = Math.min(meta.yScale?.getPixelForValue(0) ?? chartArea.bottom, chartArea.bottom);
|
|
389
|
+
const degrade = ctx.createLinearGradient(0, chartArea.top, 0, chartArea.bottom);
|
|
390
|
+
degrade.addColorStop(0, comAlfa(cor, 0.1));
|
|
391
|
+
degrade.addColorStop(1, comAlfa(cor, 0.02));
|
|
392
|
+
trechos(meta.data).forEach((trecho) => {
|
|
393
|
+
ctx.beginPath();
|
|
394
|
+
tracar(ctx, trecho);
|
|
395
|
+
ctx.lineTo(trecho[trecho.length - 1].x, base);
|
|
396
|
+
ctx.lineTo(trecho[0].x, base);
|
|
397
|
+
ctx.closePath();
|
|
398
|
+
ctx.fillStyle = degrade;
|
|
399
|
+
ctx.fill();
|
|
363
400
|
});
|
|
364
|
-
if (meta.dataset)
|
|
365
|
-
meta.dataset._pointsUpdated = true;
|
|
366
401
|
});
|
|
402
|
+
series.forEach(({ dataset, meta }) => {
|
|
403
|
+
ctx.strokeStyle = String(dataset.borderColor);
|
|
404
|
+
ctx.lineWidth = 2;
|
|
405
|
+
trechos(meta.data).forEach((trecho) => {
|
|
406
|
+
ctx.beginPath();
|
|
407
|
+
tracar(ctx, trecho);
|
|
408
|
+
ctx.stroke();
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
ctx.restore();
|
|
367
412
|
}
|
|
368
413
|
};
|
|
369
414
|
var formatar = (eixo, valor) => eixo?.format ? eixo.format(valor) : String(valor);
|
|
370
|
-
|
|
415
|
+
var Chart = react.forwardRef(function Chart2({
|
|
371
416
|
type = "line",
|
|
372
417
|
stacked = false,
|
|
373
418
|
labels,
|
|
@@ -380,9 +425,11 @@ function Chart({
|
|
|
380
425
|
actions,
|
|
381
426
|
height = 266,
|
|
382
427
|
id,
|
|
383
|
-
className
|
|
384
|
-
|
|
428
|
+
className,
|
|
429
|
+
...props
|
|
430
|
+
}, ref) {
|
|
385
431
|
const raiz = react.useRef(null);
|
|
432
|
+
react.useImperativeHandle(ref, () => raiz.current);
|
|
386
433
|
const ajuda = react.useRef(null);
|
|
387
434
|
const [tema, setTema] = react.useState();
|
|
388
435
|
react.useLayoutEffect(() => {
|
|
@@ -415,22 +462,13 @@ function Chart({
|
|
|
415
462
|
data: s.data,
|
|
416
463
|
yAxisID: s.axis === "right" ? "y2" : "y",
|
|
417
464
|
borderColor: cor,
|
|
418
|
-
|
|
419
|
-
|
|
465
|
+
// A linha e a área são desenhadas pelo plugin curvaDoFigma.
|
|
466
|
+
showLine: false,
|
|
420
467
|
pointRadius: 0,
|
|
421
468
|
pointHoverRadius: 4,
|
|
422
469
|
pointHoverBorderWidth: 2,
|
|
423
470
|
pointHoverBorderColor: tema.superficie,
|
|
424
|
-
pointHoverBackgroundColor: cor
|
|
425
|
-
fill: "origin",
|
|
426
|
-
backgroundColor: (ctx) => {
|
|
427
|
-
const area = ctx.chart.chartArea;
|
|
428
|
-
if (!area) return comAlfa(cor, 0.1);
|
|
429
|
-
const degrade = ctx.chart.ctx.createLinearGradient(0, area.top, 0, area.bottom);
|
|
430
|
-
degrade.addColorStop(0, comAlfa(cor, 0.1));
|
|
431
|
-
degrade.addColorStop(1, comAlfa(cor, 0.02));
|
|
432
|
-
return degrade;
|
|
433
|
-
}
|
|
471
|
+
pointHoverBackgroundColor: cor
|
|
434
472
|
};
|
|
435
473
|
})
|
|
436
474
|
};
|
|
@@ -498,7 +536,7 @@ function Chart({
|
|
|
498
536
|
}, [tema, yAxis, y2Axis, temDireita, series, type, stacked]);
|
|
499
537
|
const card = Boolean(title || actions);
|
|
500
538
|
const classes = ["cr-chart", card && "cr-chart--card", className].filter(Boolean).join(" ");
|
|
501
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: raiz, id, className: classes, children: [
|
|
539
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, ref: raiz, id, className: classes, children: [
|
|
502
540
|
card && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__header", children: [
|
|
503
541
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__title-row", children: [
|
|
504
542
|
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-chart__title", children: title }),
|
|
@@ -541,25 +579,25 @@ function Chart({
|
|
|
541
579
|
}
|
|
542
580
|
),
|
|
543
581
|
s.label
|
|
544
|
-
] }, s.label)) })
|
|
582
|
+
] }, `${i}-${s.label}`)) })
|
|
545
583
|
] }),
|
|
546
584
|
/* @__PURE__ */ jsxRuntime.jsxs("table", { className: "cr-so-leitor cr-chart__table", children: [
|
|
547
585
|
title && /* @__PURE__ */ jsxRuntime.jsx("caption", { children: title }),
|
|
548
586
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
549
587
|
/* @__PURE__ */ jsxRuntime.jsx("td", {}),
|
|
550
|
-
series.map((s) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: s.label }, s.label))
|
|
588
|
+
series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: s.label }, `${i}-${s.label}`))
|
|
551
589
|
] }) }),
|
|
552
590
|
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: labels.map((rotulo, linha) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
553
591
|
/* @__PURE__ */ jsxRuntime.jsx("th", { scope: "row", children: rotulo }),
|
|
554
|
-
series.map((s) => {
|
|
592
|
+
series.map((s, i) => {
|
|
555
593
|
const valor = s.data[linha];
|
|
556
594
|
const eixo = s.axis === "right" ? y2Axis : yAxis;
|
|
557
|
-
return /* @__PURE__ */ jsxRuntime.jsx("td", { children: valor == null ? "" : formatar(eixo, valor) }, s.label);
|
|
595
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { children: valor == null ? "" : formatar(eixo, valor) }, `${i}-${s.label}`);
|
|
558
596
|
})
|
|
559
|
-
] }, rotulo)) })
|
|
597
|
+
] }, `${linha}-${rotulo}`)) })
|
|
560
598
|
] })
|
|
561
599
|
] });
|
|
562
|
-
}
|
|
600
|
+
});
|
|
563
601
|
var Checkbox = react.forwardRef(function Checkbox2({
|
|
564
602
|
label,
|
|
565
603
|
showLabel = true,
|
|
@@ -574,7 +612,8 @@ var Checkbox = react.forwardRef(function Checkbox2({
|
|
|
574
612
|
value,
|
|
575
613
|
id,
|
|
576
614
|
className,
|
|
577
|
-
style
|
|
615
|
+
style,
|
|
616
|
+
...props
|
|
578
617
|
}, ref) {
|
|
579
618
|
const autoId = react.useId();
|
|
580
619
|
const inputId = id ?? autoId;
|
|
@@ -617,7 +656,7 @@ var Checkbox = react.forwardRef(function Checkbox2({
|
|
|
617
656
|
root: {
|
|
618
657
|
className: `cr-checkbox__control${checked ? " cr-checkbox__control--checked" : ""}`
|
|
619
658
|
},
|
|
620
|
-
input: { className: "cr-checkbox__input" },
|
|
659
|
+
input: { ...props, className: "cr-checkbox__input" },
|
|
621
660
|
box: { className: "cr-checkbox__box" },
|
|
622
661
|
icon: { className: "cr-checkbox__icon", "aria-hidden": true }
|
|
623
662
|
}
|
|
@@ -755,7 +794,7 @@ var IconButton = react.forwardRef(function IconButton2({
|
|
|
755
794
|
] });
|
|
756
795
|
});
|
|
757
796
|
var FOCAVEIS = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
758
|
-
|
|
797
|
+
var Drawer = react.forwardRef(function Drawer2({
|
|
759
798
|
visible,
|
|
760
799
|
onHide,
|
|
761
800
|
title,
|
|
@@ -770,8 +809,13 @@ function Drawer({
|
|
|
770
809
|
footer,
|
|
771
810
|
children,
|
|
772
811
|
id,
|
|
773
|
-
className
|
|
774
|
-
|
|
812
|
+
className,
|
|
813
|
+
...props
|
|
814
|
+
}, ref) {
|
|
815
|
+
const primeRef = react.useRef(null);
|
|
816
|
+
react.useImperativeHandle(ref, () => ({
|
|
817
|
+
getElement: () => primeRef.current?.getElement() ?? null
|
|
818
|
+
}));
|
|
775
819
|
const autoId = react.useId();
|
|
776
820
|
const titleId = `${autoId}-title`;
|
|
777
821
|
const subtitleId = `${autoId}-subtitle`;
|
|
@@ -820,6 +864,8 @@ function Drawer({
|
|
|
820
864
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
821
865
|
sidebar.Sidebar,
|
|
822
866
|
{
|
|
867
|
+
...props,
|
|
868
|
+
ref: primeRef,
|
|
823
869
|
unstyled: true,
|
|
824
870
|
id,
|
|
825
871
|
visible,
|
|
@@ -903,7 +949,7 @@ function Drawer({
|
|
|
903
949
|
)
|
|
904
950
|
}
|
|
905
951
|
);
|
|
906
|
-
}
|
|
952
|
+
});
|
|
907
953
|
var Input = react.forwardRef(function Input2({
|
|
908
954
|
variant = "outline",
|
|
909
955
|
size = "large",
|
|
@@ -948,8 +994,8 @@ var Input = react.forwardRef(function Input2({
|
|
|
948
994
|
disabled,
|
|
949
995
|
invalid: Boolean(error),
|
|
950
996
|
"aria-invalid": error ? true : void 0,
|
|
951
|
-
|
|
952
|
-
|
|
997
|
+
...props,
|
|
998
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"])
|
|
953
999
|
}
|
|
954
1000
|
),
|
|
955
1001
|
trailingIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-field__icon", children: trailingIcon })
|
|
@@ -972,7 +1018,8 @@ var Menu = react.forwardRef(function Menu2({
|
|
|
972
1018
|
onShow,
|
|
973
1019
|
onHide,
|
|
974
1020
|
id,
|
|
975
|
-
className
|
|
1021
|
+
className,
|
|
1022
|
+
...props
|
|
976
1023
|
}, ref) {
|
|
977
1024
|
const primeRef = react.useRef(null);
|
|
978
1025
|
const alvo = react.useRef(null);
|
|
@@ -1035,6 +1082,7 @@ var Menu = react.forwardRef(function Menu2({
|
|
|
1035
1082
|
const menu$1 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
1083
|
menu.Menu,
|
|
1037
1084
|
{
|
|
1085
|
+
...props,
|
|
1038
1086
|
unstyled: true,
|
|
1039
1087
|
ref: primeRef,
|
|
1040
1088
|
id,
|
|
@@ -1123,16 +1171,11 @@ function Profile({ user, menu }) {
|
|
|
1123
1171
|
user.role && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-menubar__profile-role", children: user.role })
|
|
1124
1172
|
] }),
|
|
1125
1173
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1126
|
-
|
|
1174
|
+
"span",
|
|
1127
1175
|
{
|
|
1128
|
-
unstyled: true,
|
|
1129
1176
|
"aria-hidden": "true",
|
|
1130
1177
|
className: `cr-menubar__avatar${user.avatar ? "" : " cr-menubar__avatar--initial"}`,
|
|
1131
|
-
image: user.avatar,
|
|
1132
|
-
imageAlt: "",
|
|
1133
|
-
label: user.avatar ? void 0 : user.name.trim().charAt(0).toUpperCase(),
|
|
1134
|
-
shape: "circle",
|
|
1135
|
-
pt: { image: { className: "cr-menubar__avatar-image" } }
|
|
1178
|
+
children: user.avatar ? /* @__PURE__ */ jsxRuntime.jsx("img", { className: "cr-menubar__avatar-image", src: user.avatar, alt: "" }) : user.name.trim().charAt(0).toUpperCase()
|
|
1136
1179
|
}
|
|
1137
1180
|
)
|
|
1138
1181
|
] });
|
|
@@ -1181,7 +1224,8 @@ var Menubar = react.forwardRef(function Menubar2({
|
|
|
1181
1224
|
user,
|
|
1182
1225
|
userMenu,
|
|
1183
1226
|
id,
|
|
1184
|
-
className
|
|
1227
|
+
className,
|
|
1228
|
+
...props
|
|
1185
1229
|
}, ref) {
|
|
1186
1230
|
const [innerSearch, setInnerSearch] = react.useState("");
|
|
1187
1231
|
const search = searchValue ?? innerSearch;
|
|
@@ -1247,6 +1291,7 @@ var Menubar = react.forwardRef(function Menubar2({
|
|
|
1247
1291
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, id, className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1248
1292
|
menubar.Menubar,
|
|
1249
1293
|
{
|
|
1294
|
+
...props,
|
|
1250
1295
|
unstyled: true,
|
|
1251
1296
|
className: "cr-menubar__bar",
|
|
1252
1297
|
model: [],
|
|
@@ -1278,10 +1323,12 @@ var MenuPrincipal = react.forwardRef(
|
|
|
1278
1323
|
model,
|
|
1279
1324
|
popup = false,
|
|
1280
1325
|
"aria-label": ariaLabel = "Menu principal",
|
|
1326
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1281
1327
|
onShow,
|
|
1282
1328
|
onHide,
|
|
1283
1329
|
id,
|
|
1284
|
-
className
|
|
1330
|
+
className,
|
|
1331
|
+
...props
|
|
1285
1332
|
}, ref) {
|
|
1286
1333
|
const primeRef = react.useRef(null);
|
|
1287
1334
|
const context = react.useContext(api.PrimeReactContext);
|
|
@@ -1355,7 +1402,12 @@ var MenuPrincipal = react.forwardRef(
|
|
|
1355
1402
|
});
|
|
1356
1403
|
const classes = ["cr-menu-principal", popup && "cr-menu-principal--popup", className].filter(Boolean).join(" ");
|
|
1357
1404
|
const pt = {
|
|
1358
|
-
|
|
1405
|
+
// O nome acessível vai na lista (role=menu), como no Menu.
|
|
1406
|
+
menu: {
|
|
1407
|
+
className: "cr-menu-principal__list",
|
|
1408
|
+
"aria-label": ariaLabelledBy ? void 0 : ariaLabel,
|
|
1409
|
+
"aria-labelledby": ariaLabelledBy
|
|
1410
|
+
},
|
|
1359
1411
|
submenuHeader: { className: "cr-menu-principal__group" },
|
|
1360
1412
|
// O divisor tracejado é o Divider do Cristal (dashed).
|
|
1361
1413
|
separator: {
|
|
@@ -1371,6 +1423,7 @@ var MenuPrincipal = react.forwardRef(
|
|
|
1371
1423
|
const menu$1 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
1424
|
menu.Menu,
|
|
1373
1425
|
{
|
|
1426
|
+
...props,
|
|
1374
1427
|
unstyled: true,
|
|
1375
1428
|
ref: primeRef,
|
|
1376
1429
|
id,
|
|
@@ -1402,12 +1455,13 @@ var ICON = {
|
|
|
1402
1455
|
highlight: /* @__PURE__ */ jsxRuntime.jsx(react$1.SealWarning, {}),
|
|
1403
1456
|
neutral: /* @__PURE__ */ jsxRuntime.jsx(react$1.WarningCircle, {})
|
|
1404
1457
|
};
|
|
1405
|
-
var Message = react.forwardRef(function Message2({ type = "info", children, showIcon = true, id, className }, ref) {
|
|
1458
|
+
var Message = react.forwardRef(function Message2({ type = "info", children, showIcon = true, id, className, ...props }, ref) {
|
|
1406
1459
|
const primeRef = react.useRef(null);
|
|
1407
1460
|
react.useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
1408
1461
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1462
|
message.Message,
|
|
1410
1463
|
{
|
|
1464
|
+
...props,
|
|
1411
1465
|
unstyled: true,
|
|
1412
1466
|
ref: primeRef,
|
|
1413
1467
|
id,
|
|
@@ -1423,9 +1477,10 @@ var Message = react.forwardRef(function Message2({ type = "info", children, show
|
|
|
1423
1477
|
}
|
|
1424
1478
|
);
|
|
1425
1479
|
});
|
|
1426
|
-
|
|
1480
|
+
var Modal = react.forwardRef(function Modal2({
|
|
1427
1481
|
visible,
|
|
1428
1482
|
onHide,
|
|
1483
|
+
dismissableMask = true,
|
|
1429
1484
|
title,
|
|
1430
1485
|
size = "large",
|
|
1431
1486
|
onHelp,
|
|
@@ -1435,8 +1490,13 @@ function Modal({
|
|
|
1435
1490
|
footerStart,
|
|
1436
1491
|
children,
|
|
1437
1492
|
id,
|
|
1438
|
-
className
|
|
1439
|
-
|
|
1493
|
+
className,
|
|
1494
|
+
...props
|
|
1495
|
+
}, ref) {
|
|
1496
|
+
const primeRef = react.useRef(null);
|
|
1497
|
+
react.useImperativeHandle(ref, () => ({
|
|
1498
|
+
getElement: () => primeRef.current?.getElement() ?? null
|
|
1499
|
+
}));
|
|
1440
1500
|
const autoId = react.useId();
|
|
1441
1501
|
const titleId = `${autoId}-title`;
|
|
1442
1502
|
const [body, setBody] = react.useState(null);
|
|
@@ -1454,10 +1514,13 @@ function Modal({
|
|
|
1454
1514
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1455
1515
|
dialog.Dialog,
|
|
1456
1516
|
{
|
|
1517
|
+
...props,
|
|
1518
|
+
ref: primeRef,
|
|
1457
1519
|
unstyled: true,
|
|
1458
1520
|
id,
|
|
1459
1521
|
visible,
|
|
1460
1522
|
onHide,
|
|
1523
|
+
dismissableMask,
|
|
1461
1524
|
draggable: false,
|
|
1462
1525
|
resizable: false,
|
|
1463
1526
|
blockScroll: true,
|
|
@@ -1512,7 +1575,7 @@ function Modal({
|
|
|
1512
1575
|
] })
|
|
1513
1576
|
}
|
|
1514
1577
|
);
|
|
1515
|
-
}
|
|
1578
|
+
});
|
|
1516
1579
|
var MultiSelect = react.forwardRef(function MultiSelect2({
|
|
1517
1580
|
variant = "outline",
|
|
1518
1581
|
size = "large",
|
|
@@ -1612,7 +1675,7 @@ var MultiSelect = react.forwardRef(function MultiSelect2({
|
|
|
1612
1675
|
},
|
|
1613
1676
|
hiddenInputWrapper: { className: "cr-so-leitor cr-multiselect__hidden" },
|
|
1614
1677
|
input: {
|
|
1615
|
-
"aria-describedby": supportText
|
|
1678
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"]),
|
|
1616
1679
|
"aria-invalid": error ? true : void 0,
|
|
1617
1680
|
"aria-required": required || void 0
|
|
1618
1681
|
},
|
|
@@ -1815,7 +1878,8 @@ var Select = react.forwardRef(function Select2({
|
|
|
1815
1878
|
disabled,
|
|
1816
1879
|
id,
|
|
1817
1880
|
name,
|
|
1818
|
-
className
|
|
1881
|
+
className,
|
|
1882
|
+
...props
|
|
1819
1883
|
}, ref) {
|
|
1820
1884
|
const autoId = react.useId();
|
|
1821
1885
|
const inputId = id ?? autoId;
|
|
@@ -1880,6 +1944,7 @@ var Select = react.forwardRef(function Select2({
|
|
|
1880
1944
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1881
1945
|
dropdown.Dropdown,
|
|
1882
1946
|
{
|
|
1947
|
+
...props,
|
|
1883
1948
|
unstyled: true,
|
|
1884
1949
|
inputId,
|
|
1885
1950
|
focusInputRef: setInputRef,
|
|
@@ -1902,7 +1967,7 @@ var Select = react.forwardRef(function Select2({
|
|
|
1902
1967
|
"aria-label": label ? void 0 : ariaLabel,
|
|
1903
1968
|
"aria-expanded": open,
|
|
1904
1969
|
"aria-controls": open ? listId : void 0,
|
|
1905
|
-
"aria-describedby": supportText
|
|
1970
|
+
"aria-describedby": juntarIds(supportText && hintId, props["aria-describedby"]),
|
|
1906
1971
|
"aria-invalid": error ? true : void 0,
|
|
1907
1972
|
"aria-required": required || void 0,
|
|
1908
1973
|
pt
|
|
@@ -1934,7 +1999,8 @@ var Paginator = react.forwardRef(function Paginator2({
|
|
|
1934
1999
|
onPageChange,
|
|
1935
2000
|
rowsPerPageLabel = "Itens por p\xE1gina",
|
|
1936
2001
|
id,
|
|
1937
|
-
className
|
|
2002
|
+
className,
|
|
2003
|
+
...props
|
|
1938
2004
|
}, ref) {
|
|
1939
2005
|
const primeRef = react.useRef(null);
|
|
1940
2006
|
react.useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
@@ -1946,6 +2012,7 @@ var Paginator = react.forwardRef(function Paginator2({
|
|
|
1946
2012
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1947
2013
|
paginator.Paginator,
|
|
1948
2014
|
{
|
|
2015
|
+
...props,
|
|
1949
2016
|
unstyled: true,
|
|
1950
2017
|
ref: primeRef,
|
|
1951
2018
|
id,
|
|
@@ -2033,7 +2100,8 @@ var Radio = react.forwardRef(function Radio2({
|
|
|
2033
2100
|
required,
|
|
2034
2101
|
id,
|
|
2035
2102
|
className,
|
|
2036
|
-
style
|
|
2103
|
+
style,
|
|
2104
|
+
...props
|
|
2037
2105
|
}, ref) {
|
|
2038
2106
|
const autoId = react.useId();
|
|
2039
2107
|
const inputId = id ?? autoId;
|
|
@@ -2059,7 +2127,7 @@ var Radio = react.forwardRef(function Radio2({
|
|
|
2059
2127
|
pt: {
|
|
2060
2128
|
// Marcado pela prop do Cristal, não pelo atributo interno do Prime (data-p-checked).
|
|
2061
2129
|
root: { className: `cr-radio__control${checked ? " cr-radio__control--checked" : ""}` },
|
|
2062
|
-
input: { className: "cr-radio__input" },
|
|
2130
|
+
input: { ...props, className: "cr-radio__input" },
|
|
2063
2131
|
box: { className: "cr-radio__box" },
|
|
2064
2132
|
icon: { className: "cr-radio__icon" }
|
|
2065
2133
|
}
|
|
@@ -2076,7 +2144,15 @@ var Radio = react.forwardRef(function Radio2({
|
|
|
2076
2144
|
] });
|
|
2077
2145
|
});
|
|
2078
2146
|
var porcentagem = (posicao, total, visivel) => total > visivel ? Math.round(posicao / (total - visivel) * 100) : 0;
|
|
2079
|
-
var ScrollPanel = react.forwardRef(function ScrollPanel2({
|
|
2147
|
+
var ScrollPanel = react.forwardRef(function ScrollPanel2({
|
|
2148
|
+
children,
|
|
2149
|
+
"aria-label": ariaLabel,
|
|
2150
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2151
|
+
style,
|
|
2152
|
+
id,
|
|
2153
|
+
className,
|
|
2154
|
+
...props
|
|
2155
|
+
}, ref) {
|
|
2080
2156
|
const primeRef = react.useRef(null);
|
|
2081
2157
|
react.useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
2082
2158
|
const contentId = `${react.useId()}-content`;
|
|
@@ -2111,7 +2187,7 @@ var ScrollPanel = react.forwardRef(function ScrollPanel2({ children, "aria-label
|
|
|
2111
2187
|
barx: barra("horizontal", posicao.x),
|
|
2112
2188
|
bary: barra("vertical", posicao.y)
|
|
2113
2189
|
};
|
|
2114
|
-
return /* @__PURE__ */ jsxRuntime.jsx(scrollpanel.ScrollPanel, { unstyled: true, ref: primeRef, id, pt, children });
|
|
2190
|
+
return /* @__PURE__ */ jsxRuntime.jsx(scrollpanel.ScrollPanel, { ...props, unstyled: true, ref: primeRef, id, pt, children });
|
|
2115
2191
|
});
|
|
2116
2192
|
var SegmentControl = react.forwardRef(
|
|
2117
2193
|
function SegmentControl2({
|
|
@@ -2123,7 +2199,8 @@ var SegmentControl = react.forwardRef(
|
|
|
2123
2199
|
"aria-labelledby": ariaLabelledBy,
|
|
2124
2200
|
disabled,
|
|
2125
2201
|
id,
|
|
2126
|
-
className
|
|
2202
|
+
className,
|
|
2203
|
+
...props
|
|
2127
2204
|
}, ref) {
|
|
2128
2205
|
const primeRef = react.useRef(null);
|
|
2129
2206
|
react.useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
@@ -2131,6 +2208,7 @@ var SegmentControl = react.forwardRef(
|
|
|
2131
2208
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2132
2209
|
selectbutton.SelectButton,
|
|
2133
2210
|
{
|
|
2211
|
+
...props,
|
|
2134
2212
|
unstyled: true,
|
|
2135
2213
|
ref: primeRef,
|
|
2136
2214
|
id,
|
|
@@ -2175,7 +2253,8 @@ var Switch = react.forwardRef(function Switch2({
|
|
|
2175
2253
|
name,
|
|
2176
2254
|
id,
|
|
2177
2255
|
className,
|
|
2178
|
-
style
|
|
2256
|
+
style,
|
|
2257
|
+
...props
|
|
2179
2258
|
}, ref) {
|
|
2180
2259
|
const autoId = react.useId();
|
|
2181
2260
|
const inputId = id ?? autoId;
|
|
@@ -2204,7 +2283,7 @@ var Switch = react.forwardRef(function Switch2({
|
|
|
2204
2283
|
role: void 0,
|
|
2205
2284
|
"aria-checked": void 0
|
|
2206
2285
|
},
|
|
2207
|
-
input: { className: "cr-switch__input" },
|
|
2286
|
+
input: { ...props, className: "cr-switch__input" },
|
|
2208
2287
|
slider: { className: "cr-switch__track" }
|
|
2209
2288
|
}
|
|
2210
2289
|
}
|
|
@@ -2222,7 +2301,7 @@ var Switch = react.forwardRef(function Switch2({
|
|
|
2222
2301
|
function TabPanel(_props) {
|
|
2223
2302
|
return null;
|
|
2224
2303
|
}
|
|
2225
|
-
var Tabs = react.forwardRef(function Tabs2({ activeIndex, onTabChange, children, id, className }, ref) {
|
|
2304
|
+
var Tabs = react.forwardRef(function Tabs2({ activeIndex, onTabChange, children, id, className, ...props }, ref) {
|
|
2226
2305
|
const primeRef = react.useRef(null);
|
|
2227
2306
|
react.useImperativeHandle(ref, () => primeRef.current?.getElement());
|
|
2228
2307
|
const [interno, setInterno] = react.useState(0);
|
|
@@ -2265,6 +2344,7 @@ var Tabs = react.forwardRef(function Tabs2({ activeIndex, onTabChange, children,
|
|
|
2265
2344
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2266
2345
|
tabview.TabView,
|
|
2267
2346
|
{
|
|
2347
|
+
...props,
|
|
2268
2348
|
unstyled: true,
|
|
2269
2349
|
ref: primeRef,
|
|
2270
2350
|
id,
|