@dxc-technology/halstack-react 15.1.3 → 15.2.1
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.d.mts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +1305 -1239
- package/dist/index.mjs +1082 -1016
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6043,14 +6043,223 @@ function DxcContextualMenu({ items }) {
|
|
|
6043
6043
|
}
|
|
6044
6044
|
|
|
6045
6045
|
// src/data-grid/DataGrid.tsx
|
|
6046
|
-
import { useContext as
|
|
6046
|
+
import { useContext as useContext25, useEffect as useEffect8, useMemo as useMemo11, useState as useState18 } from "react";
|
|
6047
6047
|
import DataGrid from "react-data-grid";
|
|
6048
|
-
import
|
|
6048
|
+
import styled38, { ThemeProvider as ThemeProvider18 } from "styled-components";
|
|
6049
6049
|
import "react-data-grid/lib/styles.css";
|
|
6050
6050
|
|
|
6051
6051
|
// src/data-grid/utils.tsx
|
|
6052
|
+
import { useState as useState15 } from "react";
|
|
6052
6053
|
import { textEditor } from "react-data-grid";
|
|
6054
|
+
|
|
6055
|
+
// src/spinner/Spinner.tsx
|
|
6056
|
+
import { useContext as useContext20, useId as useId7, useMemo as useMemo9 } from "react";
|
|
6057
|
+
import styled32, { ThemeProvider as ThemeProvider14 } from "styled-components";
|
|
6053
6058
|
import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6059
|
+
var DxcSpinner = ({
|
|
6060
|
+
label,
|
|
6061
|
+
value,
|
|
6062
|
+
showValue = false,
|
|
6063
|
+
mode = "large",
|
|
6064
|
+
margin,
|
|
6065
|
+
ariaLabel = "Spinner"
|
|
6066
|
+
}) => {
|
|
6067
|
+
const labelId = useId7();
|
|
6068
|
+
const colorsTheme = useContext20(HalstackContext);
|
|
6069
|
+
const determinated = useMemo9(() => value != null && value >= 0 && value <= 100, [value]);
|
|
6070
|
+
return /* @__PURE__ */ jsx38(ThemeProvider14, { theme: colorsTheme.spinner, children: /* @__PURE__ */ jsx38(DXCSpinner, { margin, mode, children: /* @__PURE__ */ jsxs24(SpinnerContainer, { mode, children: [
|
|
6071
|
+
mode === "overlay" && /* @__PURE__ */ jsx38(BackOverlay, {}),
|
|
6072
|
+
/* @__PURE__ */ jsx38(BackgroundSpinner, { children: mode === "small" ? /* @__PURE__ */ jsx38(SVGBackground, { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx38(CircleBackground, { cx: "8", cy: "8", r: "6", mode }) }) : /* @__PURE__ */ jsx38(SVGBackground, { viewBox: "0 0 140 140", children: /* @__PURE__ */ jsx38(CircleBackground, { cx: "70", cy: "70", r: "65", mode }) }) }),
|
|
6073
|
+
/* @__PURE__ */ jsx38(
|
|
6074
|
+
Spinner,
|
|
6075
|
+
{
|
|
6076
|
+
role: "progressbar",
|
|
6077
|
+
"aria-valuenow": determinated && showValue ? value : void 0,
|
|
6078
|
+
"aria-valuemin": determinated ? 0 : void 0,
|
|
6079
|
+
"aria-valuemax": determinated ? 100 : void 0,
|
|
6080
|
+
"aria-labelledby": label && mode !== "small" ? labelId : void 0,
|
|
6081
|
+
"aria-label": !label ? ariaLabel : mode === "small" ? ariaLabel : void 0,
|
|
6082
|
+
children: mode === "small" ? /* @__PURE__ */ jsx38(SVGSpinner, { viewBox: "0 0 16 16", determinated, children: /* @__PURE__ */ jsx38(CircleSpinner, { cx: "8", cy: "8", r: "6", mode, determinated, value }) }) : /* @__PURE__ */ jsx38(SVGSpinner, { viewBox: "0 0 140 140", determinated, children: /* @__PURE__ */ jsx38(CircleSpinner, { cx: "70", cy: "70", r: "65", mode, determinated, value }) })
|
|
6083
|
+
}
|
|
6084
|
+
),
|
|
6085
|
+
mode !== "small" && /* @__PURE__ */ jsxs24(LabelsContainer2, { children: [
|
|
6086
|
+
label && /* @__PURE__ */ jsx38(SpinnerLabel, { id: labelId, mode, children: label }),
|
|
6087
|
+
(value || value === 0) && showValue && /* @__PURE__ */ jsxs24(SpinnerProgress, { value, mode, showValue, children: [
|
|
6088
|
+
value,
|
|
6089
|
+
"%"
|
|
6090
|
+
] })
|
|
6091
|
+
] })
|
|
6092
|
+
] }) }) });
|
|
6093
|
+
};
|
|
6094
|
+
var determinateValue = (value, strokeDashArray) => {
|
|
6095
|
+
let val = 0;
|
|
6096
|
+
if (value != null && value >= 0 && value <= 100) {
|
|
6097
|
+
val = strokeDashArray * (1 - value / 100);
|
|
6098
|
+
}
|
|
6099
|
+
return val;
|
|
6100
|
+
};
|
|
6101
|
+
var DXCSpinner = styled32.div`
|
|
6102
|
+
height: ${(props) => props.mode === "overlay" ? "100vh" : ""};
|
|
6103
|
+
width: ${(props) => props.mode === "overlay" ? "100vw" : ""};
|
|
6104
|
+
display: ${(props) => props.mode === "overlay" ? "flex" : ""};
|
|
6105
|
+
position: ${(props) => props.mode === "overlay" ? "fixed" : ""};
|
|
6106
|
+
top: ${(props) => props.mode === "overlay" ? 0 : ""};
|
|
6107
|
+
left: ${(props) => props.mode === "overlay" ? 0 : ""};
|
|
6108
|
+
justify-content: ${(props) => props.mode === "overlay" ? "center" : ""};
|
|
6109
|
+
align-items: ${(props) => props.mode === "overlay" ? "center" : ""};
|
|
6110
|
+
z-index: ${(props) => props.mode === "overlay" ? 400 : ""};
|
|
6111
|
+
|
|
6112
|
+
margin: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px" : ""};
|
|
6113
|
+
margin-top: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.top ? spaces[props.margin.top] : "" : ""};
|
|
6114
|
+
margin-right: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.right ? spaces[props.margin.right] : "" : ""};
|
|
6115
|
+
margin-bottom: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.bottom ? spaces[props.margin.bottom] : "" : ""};
|
|
6116
|
+
margin-left: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : "" : ""};
|
|
6117
|
+
`;
|
|
6118
|
+
var SpinnerContainer = styled32.div`
|
|
6119
|
+
align-items: center;
|
|
6120
|
+
display: flex;
|
|
6121
|
+
height: ${(props) => props.mode === "small" ? "16px" : "140px"};
|
|
6122
|
+
width: ${(props) => props.mode === "small" ? "16px" : "140px"};
|
|
6123
|
+
justify-content: center;
|
|
6124
|
+
position: relative;
|
|
6125
|
+
background-color: transparent;
|
|
6126
|
+
|
|
6127
|
+
@keyframes spinner-svg {
|
|
6128
|
+
0% {
|
|
6129
|
+
transform: rotateZ(0deg);
|
|
6130
|
+
}
|
|
6131
|
+
100% {
|
|
6132
|
+
transform: rotateZ(360deg);
|
|
6133
|
+
}
|
|
6134
|
+
}
|
|
6135
|
+
@keyframes svg-circle-large {
|
|
6136
|
+
0% {
|
|
6137
|
+
stroke-dashoffset: 400;
|
|
6138
|
+
transform: rotate(0);
|
|
6139
|
+
}
|
|
6140
|
+
|
|
6141
|
+
50% {
|
|
6142
|
+
stroke-dashoffset: 75;
|
|
6143
|
+
transform: rotate(45deg);
|
|
6144
|
+
}
|
|
6145
|
+
|
|
6146
|
+
100% {
|
|
6147
|
+
stroke-dashoffset: 400;
|
|
6148
|
+
transform: rotate(360deg);
|
|
6149
|
+
}
|
|
6150
|
+
}
|
|
6151
|
+
@keyframes svg-circle-small {
|
|
6152
|
+
0% {
|
|
6153
|
+
stroke-dashoffset: 35;
|
|
6154
|
+
transform: rotate(0);
|
|
6155
|
+
}
|
|
6156
|
+
|
|
6157
|
+
50% {
|
|
6158
|
+
stroke-dashoffset: 8;
|
|
6159
|
+
transform: rotate(45deg);
|
|
6160
|
+
}
|
|
6161
|
+
|
|
6162
|
+
100% {
|
|
6163
|
+
stroke-dashoffset: 35;
|
|
6164
|
+
transform: rotate(360deg);
|
|
6165
|
+
}
|
|
6166
|
+
}
|
|
6167
|
+
`;
|
|
6168
|
+
var BackOverlay = styled32.div`
|
|
6169
|
+
width: 100vw;
|
|
6170
|
+
height: 100vh;
|
|
6171
|
+
opacity: 1;
|
|
6172
|
+
transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
6173
|
+
position: fixed;
|
|
6174
|
+
top: 0;
|
|
6175
|
+
left: 0;
|
|
6176
|
+
background-color: ${(props) => `${props.theme.overlayBackgroundColor}`};
|
|
6177
|
+
opacity: ${(props) => `${props.theme.overlayOpacity}`};
|
|
6178
|
+
`;
|
|
6179
|
+
var BackgroundSpinner = styled32.div`
|
|
6180
|
+
height: inherit;
|
|
6181
|
+
width: inherit;
|
|
6182
|
+
position: absolute;
|
|
6183
|
+
`;
|
|
6184
|
+
var SVGBackground = styled32.svg`
|
|
6185
|
+
height: inherit;
|
|
6186
|
+
width: inherit;
|
|
6187
|
+
`;
|
|
6188
|
+
var CircleBackground = styled32.circle`
|
|
6189
|
+
animation: none;
|
|
6190
|
+
fill: transparent;
|
|
6191
|
+
stroke: ${(props) => `${props.theme.totalCircleColor}`};
|
|
6192
|
+
stroke-dasharray: ${(props) => props.mode !== "small" ? "409" : "38"};
|
|
6193
|
+
stroke-linecap: initial;
|
|
6194
|
+
stroke-width: ${(props) => props.mode !== "small" ? "8.5px" : "2px"};
|
|
6195
|
+
transform-origin: 50% 50%;
|
|
6196
|
+
vector-effect: non-scaling-stroke;
|
|
6197
|
+
`;
|
|
6198
|
+
var Spinner = styled32.div`
|
|
6199
|
+
height: inherit;
|
|
6200
|
+
width: inherit;
|
|
6201
|
+
position: relative;
|
|
6202
|
+
`;
|
|
6203
|
+
var SVGSpinner = styled32.svg`
|
|
6204
|
+
height: inherit;
|
|
6205
|
+
width: inherit;
|
|
6206
|
+
transform: rotate(-90deg);
|
|
6207
|
+
top: 0;
|
|
6208
|
+
left: 0;
|
|
6209
|
+
transform-origin: center;
|
|
6210
|
+
overflow: visible;
|
|
6211
|
+
animation: ${(props) => !props.determinated ? "1.4s linear infinite both spinner-svg" : ""};
|
|
6212
|
+
`;
|
|
6213
|
+
var CircleSpinner = styled32.circle`
|
|
6214
|
+
fill: transparent;
|
|
6215
|
+
stroke-linecap: initial;
|
|
6216
|
+
vector-effect: non-scaling-stroke;
|
|
6217
|
+
animation: ${(props) => props.determinated ? "none" : props.mode !== "small" ? "1.4s ease-in-out infinite both svg-circle-large" : "1.4s ease-in-out infinite both svg-circle-small"};
|
|
6218
|
+
stroke: ${(props) => props.mode === "overlay" ? props.theme.trackCircleColorOverlay : props.theme.trackCircleColor};
|
|
6219
|
+
transform-origin: ${(props) => !props.determinated ? "50% 50%" : ""};
|
|
6220
|
+
stroke-dasharray: ${(props) => props.mode !== "small" ? "409" : "38"};
|
|
6221
|
+
stroke-width: ${(props) => props.mode !== "small" ? "8.5px" : "2px"};
|
|
6222
|
+
stroke-dashoffset: ${(props) => props.determinated ? props.mode !== "small" ? determinateValue(props.value, 409) : determinateValue(props.value, 38) : ""};
|
|
6223
|
+
`;
|
|
6224
|
+
var LabelsContainer2 = styled32.div`
|
|
6225
|
+
position: absolute;
|
|
6226
|
+
margin: 0 auto;
|
|
6227
|
+
width: 110px;
|
|
6228
|
+
text-align: center;
|
|
6229
|
+
`;
|
|
6230
|
+
var SpinnerLabel = styled32.p`
|
|
6231
|
+
margin: 0;
|
|
6232
|
+
width: 100%;
|
|
6233
|
+
white-space: nowrap;
|
|
6234
|
+
overflow: hidden;
|
|
6235
|
+
text-overflow: ellipsis;
|
|
6236
|
+
font-family: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontFamily : props.theme.labelFontFamily};
|
|
6237
|
+
font-weight: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontWeight : props.theme.labelFontWeight};
|
|
6238
|
+
font-size: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontSize : props.theme.labelFontSize};
|
|
6239
|
+
font-style: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontStyle : props.theme.labelFontStyle};
|
|
6240
|
+
color: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.theme.labelFontColor};
|
|
6241
|
+
text-align: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelTextAlign : props.theme.labelTextAlign};
|
|
6242
|
+
letter-spacing: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing};
|
|
6243
|
+
`;
|
|
6244
|
+
var SpinnerProgress = styled32.p`
|
|
6245
|
+
margin: 0;
|
|
6246
|
+
width: 100%;
|
|
6247
|
+
white-space: nowrap;
|
|
6248
|
+
overflow: hidden;
|
|
6249
|
+
text-overflow: ellipsis;
|
|
6250
|
+
display: ${(props) => props.value && props.showValue === true && "block" || "none"};
|
|
6251
|
+
font-family: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily};
|
|
6252
|
+
font-weight: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontWeight : props.theme.progressValueFontWeight};
|
|
6253
|
+
font-size: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontSize : props.theme.progressValueFontSize};
|
|
6254
|
+
font-style: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontStyle : props.theme.progressValueFontStyle};
|
|
6255
|
+
color: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.theme.progressValueFontColor};
|
|
6256
|
+
text-align: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueTextAlign : props.theme.progressValueTextAlign};
|
|
6257
|
+
letter-spacing: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueLetterSpacing : props.theme.progressValueLetterSpacing};
|
|
6258
|
+
`;
|
|
6259
|
+
var Spinner_default = DxcSpinner;
|
|
6260
|
+
|
|
6261
|
+
// src/data-grid/utils.tsx
|
|
6262
|
+
import { jsx as jsx39, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6054
6263
|
var overwriteTheme = (theme) => {
|
|
6055
6264
|
const newTheme = {
|
|
6056
6265
|
checkbox: {
|
|
@@ -6073,11 +6282,27 @@ var convertToRDGColumns = (gridColumn, summaryRow) => ({
|
|
|
6073
6282
|
editable: gridColumn.textEditable,
|
|
6074
6283
|
headerCellClass: gridColumn.alignment ? `header-align-${gridColumn.alignment}` : `header-align-left`,
|
|
6075
6284
|
renderEditCell: gridColumn.textEditable ? textEditor : void 0,
|
|
6076
|
-
renderCell: ({ row }) => /* @__PURE__ */
|
|
6077
|
-
renderSummaryCell: () => gridColumn.summaryKey ? /* @__PURE__ */
|
|
6285
|
+
renderCell: ({ row }) => /* @__PURE__ */ jsx39("div", { className: `ellipsis-cell ${gridColumn.alignment ? `align-${gridColumn.alignment}` : "align-left"}`, children: row[gridColumn.key] }),
|
|
6286
|
+
renderSummaryCell: () => gridColumn.summaryKey ? /* @__PURE__ */ jsx39("div", { className: `ellipsis-cell ${gridColumn.alignment ? `align-${gridColumn.alignment}` : "align-left"}`, children: summaryRow?.[gridColumn.summaryKey] }) : void 0
|
|
6078
6287
|
});
|
|
6079
|
-
var renderSortStatus = ({ sortDirection }) => /* @__PURE__ */
|
|
6080
|
-
var
|
|
6288
|
+
var renderSortStatus = ({ sortDirection }) => /* @__PURE__ */ jsx39("div", { className: "sortIconContainer", children: sortDirection !== void 0 ? sortDirection === "ASC" ? /* @__PURE__ */ jsx39(Icon_default, { icon: "Keyboard_Arrow_Up" }) : /* @__PURE__ */ jsx39(Icon_default, { icon: "Keyboard_Arrow_Down" }) : /* @__PURE__ */ jsx39(Icon_default, { icon: "Expand_All" }) });
|
|
6289
|
+
var expandRow = (row, rows, uniqueRowId) => {
|
|
6290
|
+
const rowIndex = rows.findIndex((r) => r === row);
|
|
6291
|
+
addRow(rows, rowIndex + 1, {
|
|
6292
|
+
isExpandedChildContent: true,
|
|
6293
|
+
[uniqueRowId]: `${rowKeyGetter(row, uniqueRowId)}_expanded`,
|
|
6294
|
+
expandedChildContent: row.expandedContent,
|
|
6295
|
+
triggerRowKey: rowKeyGetter(row, uniqueRowId),
|
|
6296
|
+
expandedContentHeight: row.expandedContentHeight
|
|
6297
|
+
});
|
|
6298
|
+
};
|
|
6299
|
+
var collapseRow = (row, rows) => {
|
|
6300
|
+
const rowIndex = rows.findIndex((r) => r === row);
|
|
6301
|
+
const newRows = [...rows];
|
|
6302
|
+
deleteRow(newRows, rowIndex + 1);
|
|
6303
|
+
return newRows;
|
|
6304
|
+
};
|
|
6305
|
+
var renderExpandableTrigger = (row, rows, uniqueRowId, setRowsToRender) => /* @__PURE__ */ jsx39(
|
|
6081
6306
|
ActionIcon_default,
|
|
6082
6307
|
{
|
|
6083
6308
|
icon: row.contentIsExpanded ? "arrow_drop_down" : "arrow_right",
|
|
@@ -6086,50 +6311,63 @@ var renderExpandableTrigger = (row, rows, uniqueRowId, setRowsToRender) => /* @_
|
|
|
6086
6311
|
onClick: () => {
|
|
6087
6312
|
row.contentIsExpanded = !row.contentIsExpanded;
|
|
6088
6313
|
if (row.contentIsExpanded) {
|
|
6089
|
-
const rowIndex = rows.findIndex((rowToRender) => row === rowToRender);
|
|
6090
6314
|
setRowsToRender((currentRows) => {
|
|
6091
|
-
const
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
[uniqueRowId]: `${rowKeyGetter(row, uniqueRowId)}_expanded`,
|
|
6095
|
-
expandedChildContent: row.expandedContent,
|
|
6096
|
-
triggerRowKey: rowKeyGetter(row, uniqueRowId),
|
|
6097
|
-
expandedContentHeight: row.expandedContentHeight
|
|
6098
|
-
});
|
|
6099
|
-
return newRows;
|
|
6315
|
+
const finalRows = [...currentRows];
|
|
6316
|
+
expandRow(row, finalRows, uniqueRowId);
|
|
6317
|
+
return finalRows;
|
|
6100
6318
|
});
|
|
6101
6319
|
} else {
|
|
6102
|
-
|
|
6103
|
-
setRowsToRender((currentRows) => {
|
|
6104
|
-
const newRows = [...currentRows];
|
|
6105
|
-
deleteRow(newRows, rowIndex + 1);
|
|
6106
|
-
return newRows;
|
|
6107
|
-
});
|
|
6320
|
+
setRowsToRender((currentRows) => collapseRow(row, [...currentRows]));
|
|
6108
6321
|
}
|
|
6109
6322
|
},
|
|
6110
6323
|
disabled: !rows.some((row2) => uniqueRowId in row2)
|
|
6111
6324
|
}
|
|
6112
6325
|
);
|
|
6113
|
-
var renderHierarchyTrigger = (rows, triggerRow, uniqueRowId, columnKey, setRowsToRender) =>
|
|
6114
|
-
|
|
6115
|
-
{
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6326
|
+
var renderHierarchyTrigger = (rows, triggerRow, uniqueRowId, columnKey, setRowsToRender, childrenTrigger) => {
|
|
6327
|
+
const [loading, setLoading] = useState15(false);
|
|
6328
|
+
const onClick = async () => {
|
|
6329
|
+
if (loading) return;
|
|
6330
|
+
if (!triggerRow.visibleChildren) {
|
|
6331
|
+
if (childrenTrigger) {
|
|
6332
|
+
setLoading(true);
|
|
6333
|
+
triggerRow.loadingChildren = true;
|
|
6334
|
+
try {
|
|
6335
|
+
const dynamicChildren = await childrenTrigger(true, triggerRow);
|
|
6336
|
+
triggerRow.childRows = dynamicChildren;
|
|
6337
|
+
setRowsToRender((currentRows) => {
|
|
6338
|
+
const newRowsToRender = [...currentRows];
|
|
6339
|
+
if (newRowsToRender.some((row) => rowKeyGetter(row, uniqueRowId) === triggerRow[uniqueRowId])) {
|
|
6340
|
+
const rowIndex = currentRows.findIndex((row) => triggerRow === row);
|
|
6341
|
+
dynamicChildren.forEach((childRow, index) => {
|
|
6342
|
+
childRow.rowLevel = triggerRow.rowLevel && typeof triggerRow.rowLevel === "number" ? triggerRow.rowLevel + 1 : 1;
|
|
6343
|
+
childRow.parentKey = rowKeyGetter(triggerRow, uniqueRowId);
|
|
6344
|
+
addRow(newRowsToRender, rowIndex + 1 + index, childRow);
|
|
6345
|
+
});
|
|
6346
|
+
}
|
|
6347
|
+
return newRowsToRender;
|
|
6348
|
+
});
|
|
6349
|
+
} catch (error) {
|
|
6350
|
+
console.error("Error loading children:", error);
|
|
6351
|
+
} finally {
|
|
6352
|
+
setLoading(false);
|
|
6353
|
+
}
|
|
6354
|
+
} else if (triggerRow.childRows) {
|
|
6355
|
+
setRowsToRender((currentRows) => {
|
|
6356
|
+
const newRowsToRender = [...currentRows];
|
|
6357
|
+
const rowIndex = currentRows.findIndex((row) => triggerRow === row);
|
|
6358
|
+
triggerRow.childRows?.forEach((childRow, index) => {
|
|
6359
|
+
childRow.rowLevel = triggerRow.rowLevel && typeof triggerRow.rowLevel === "number" ? triggerRow.rowLevel + 1 : 1;
|
|
6360
|
+
childRow.parentKey = rowKeyGetter(triggerRow, uniqueRowId);
|
|
6361
|
+
addRow(newRowsToRender, rowIndex + 1 + index, childRow);
|
|
6362
|
+
});
|
|
6363
|
+
return newRowsToRender;
|
|
6126
6364
|
});
|
|
6127
|
-
}
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
)
|
|
6132
|
-
|
|
6365
|
+
}
|
|
6366
|
+
} else {
|
|
6367
|
+
setRowsToRender((currentRows) => {
|
|
6368
|
+
const rowsToRemove = rows.filter(
|
|
6369
|
+
(rowToRender) => rowToRender.parentKey && rowToRender.parentKey === rowKeyGetter(triggerRow, uniqueRowId)
|
|
6370
|
+
);
|
|
6133
6371
|
const rowsToCheck = [...rowsToRemove];
|
|
6134
6372
|
while (rowsToCheck.length > 0) {
|
|
6135
6373
|
const currentRow = rowsToCheck.pop();
|
|
@@ -6137,7 +6375,7 @@ var renderHierarchyTrigger = (rows, triggerRow, uniqueRowId, columnKey, setRowsT
|
|
|
6137
6375
|
rowsToRemove.push(...childRows);
|
|
6138
6376
|
rowsToCheck.push(...childRows);
|
|
6139
6377
|
}
|
|
6140
|
-
newRowsToRender =
|
|
6378
|
+
const newRowsToRender = currentRows.filter(
|
|
6141
6379
|
(row) => !rowsToRemove.map((rowToRemove) => {
|
|
6142
6380
|
if (rowToRemove.visibleChildren) {
|
|
6143
6381
|
rowToRemove.visibleChildren = false;
|
|
@@ -6145,39 +6383,40 @@ var renderHierarchyTrigger = (rows, triggerRow, uniqueRowId, columnKey, setRowsT
|
|
|
6145
6383
|
return rowKeyGetter(rowToRemove, uniqueRowId);
|
|
6146
6384
|
}).includes(rowKeyGetter(row, uniqueRowId))
|
|
6147
6385
|
);
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
]
|
|
6156
|
-
}
|
|
6157
|
-
|
|
6158
|
-
var
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
} else {
|
|
6167
|
-
selected.delete(rowKeyGetter(row, uniqueRowId));
|
|
6168
|
-
}
|
|
6169
|
-
if (row.childRows && Array.isArray(row.childRows)) {
|
|
6170
|
-
getChildrenSelection(row.childRows, uniqueRowId, selected, checked);
|
|
6171
|
-
}
|
|
6172
|
-
if (row.parentKey) {
|
|
6173
|
-
getParentSelectedState(rows, row.parentKey, uniqueRowId, selected, checked);
|
|
6174
|
-
}
|
|
6175
|
-
onSelectRows(selected);
|
|
6176
|
-
},
|
|
6177
|
-
disabled: !rows.some((row2) => uniqueRowId in row2)
|
|
6386
|
+
return newRowsToRender;
|
|
6387
|
+
});
|
|
6388
|
+
}
|
|
6389
|
+
triggerRow.visibleChildren = !triggerRow.visibleChildren;
|
|
6390
|
+
};
|
|
6391
|
+
return /* @__PURE__ */ jsxs25("button", { type: "button", disabled: !rows.some((row) => uniqueRowId in row), onClick, children: [
|
|
6392
|
+
loading ? /* @__PURE__ */ jsx39(Spinner_default, { mode: "small" }) : /* @__PURE__ */ jsx39(Icon_default, { icon: triggerRow.visibleChildren ? "Keyboard_Arrow_Down" : "Chevron_Right" }),
|
|
6393
|
+
/* @__PURE__ */ jsx39("span", { className: "ellipsis-cell", children: triggerRow[columnKey] })
|
|
6394
|
+
] });
|
|
6395
|
+
};
|
|
6396
|
+
var rowHasHierarchy = (row) => {
|
|
6397
|
+
return Array.isArray(row.childRows) && row.childRows.length > 0 || typeof row.childrenTrigger === "function";
|
|
6398
|
+
};
|
|
6399
|
+
var renderCheckbox = (rows, row, uniqueRowId, selectedRows, onSelectRows) => {
|
|
6400
|
+
const checked = selectedRows.has(rowKeyGetter(row, uniqueRowId));
|
|
6401
|
+
if (row.loadingChildren && row.childRows) {
|
|
6402
|
+
handleCheckboxUpdate(rows, row, uniqueRowId, selectedRows, checked, onSelectRows, true);
|
|
6403
|
+
row.loadingChildren = false;
|
|
6178
6404
|
}
|
|
6179
|
-
|
|
6180
|
-
|
|
6405
|
+
return /* @__PURE__ */ jsx39(
|
|
6406
|
+
Checkbox_default,
|
|
6407
|
+
{
|
|
6408
|
+
checked,
|
|
6409
|
+
onChange: (checked2) => {
|
|
6410
|
+
handleCheckboxUpdate(rows, row, uniqueRowId, selectedRows, checked2, onSelectRows);
|
|
6411
|
+
},
|
|
6412
|
+
disabled: (
|
|
6413
|
+
// row.loadingChildren ||
|
|
6414
|
+
!rows.some((row2) => uniqueRowId in row2)
|
|
6415
|
+
)
|
|
6416
|
+
}
|
|
6417
|
+
);
|
|
6418
|
+
};
|
|
6419
|
+
var renderHeaderCheckbox = (rows, uniqueRowId, selectedRows, colorsTheme, onSelectRows) => /* @__PURE__ */ jsx39(HalstackProvider, { advancedTheme: overwriteTheme(colorsTheme), children: /* @__PURE__ */ jsx39(
|
|
6181
6420
|
Checkbox_default,
|
|
6182
6421
|
{
|
|
6183
6422
|
checked: rows.length > 0 && !rows.some((row) => !selectedRows.has(rowKeyGetter(row, uniqueRowId))),
|
|
@@ -6294,15 +6533,17 @@ var rowFinderBasedOnId = (rowList, uniqueRowId, uniqueRowIdValue) => {
|
|
|
6294
6533
|
}
|
|
6295
6534
|
return void 0;
|
|
6296
6535
|
};
|
|
6297
|
-
var getChildrenSelection = (rowList, uniqueRowId, selectedRows, checked) => {
|
|
6536
|
+
var getChildrenSelection = (rowList, uniqueRowId, selectedRows, checked, hierarchyValidation) => {
|
|
6298
6537
|
rowList.forEach((row) => {
|
|
6299
6538
|
if (row.childRows) {
|
|
6300
|
-
getChildrenSelection(row.childRows, uniqueRowId, selectedRows, checked);
|
|
6539
|
+
getChildrenSelection(row.childRows, uniqueRowId, selectedRows, checked, hierarchyValidation);
|
|
6301
6540
|
}
|
|
6302
6541
|
if (checked) {
|
|
6303
6542
|
selectedRows.add(rowKeyGetter(row, uniqueRowId));
|
|
6304
6543
|
} else {
|
|
6305
|
-
|
|
6544
|
+
if (!hierarchyValidation) {
|
|
6545
|
+
selectedRows.delete(rowKeyGetter(row, uniqueRowId));
|
|
6546
|
+
}
|
|
6306
6547
|
}
|
|
6307
6548
|
});
|
|
6308
6549
|
};
|
|
@@ -6326,6 +6567,21 @@ var getParentSelectedState = (rowList, parentKeyValue, uniqueRowId, selectedRows
|
|
|
6326
6567
|
getParentSelectedState(rowList, parentRow.parentKey, uniqueRowId, selectedRows, checkedStateToMatch);
|
|
6327
6568
|
}
|
|
6328
6569
|
};
|
|
6570
|
+
var handleCheckboxUpdate = (rows, row, uniqueRowId, selectedRows, checked, onSelectRows, hierarchyValidation) => {
|
|
6571
|
+
const selected = new Set(selectedRows);
|
|
6572
|
+
if (checked) {
|
|
6573
|
+
selected.add(rowKeyGetter(row, uniqueRowId));
|
|
6574
|
+
} else if (!hierarchyValidation) {
|
|
6575
|
+
selected.delete(rowKeyGetter(row, uniqueRowId));
|
|
6576
|
+
}
|
|
6577
|
+
if (row.childRows && Array.isArray(row.childRows)) {
|
|
6578
|
+
getChildrenSelection(row.childRows, uniqueRowId, selected, checked, hierarchyValidation);
|
|
6579
|
+
}
|
|
6580
|
+
if (row.parentKey) {
|
|
6581
|
+
getParentSelectedState(rows, row.parentKey, uniqueRowId, selected, checked);
|
|
6582
|
+
}
|
|
6583
|
+
onSelectRows?.(selected);
|
|
6584
|
+
};
|
|
6329
6585
|
var getMinItemsPerPageIndex = (currentPageInternal, itemsPerPage, page) => currentPageInternal === 1 ? 0 : itemsPerPage * (page - 1);
|
|
6330
6586
|
var getMaxItemsPerPageIndex = (minItemsPerPageIndex, itemsPerPage, rows, page) => minItemsPerPageIndex + itemsPerPage > rows.length ? rows.length : itemsPerPage * page - 1;
|
|
6331
6587
|
var getPaginatedNodes = (rows, uniqueRowId, start, end) => {
|
|
@@ -6347,30 +6603,30 @@ var getPaginatedNodes = (rows, uniqueRowId, start, end) => {
|
|
|
6347
6603
|
};
|
|
6348
6604
|
|
|
6349
6605
|
// src/paginator/Paginator.tsx
|
|
6350
|
-
import { useContext as
|
|
6351
|
-
import
|
|
6606
|
+
import { useContext as useContext23 } from "react";
|
|
6607
|
+
import styled36, { ThemeProvider as ThemeProvider16 } from "styled-components";
|
|
6352
6608
|
|
|
6353
6609
|
// src/select/Select.tsx
|
|
6354
6610
|
import * as Popover2 from "@radix-ui/react-popover";
|
|
6355
6611
|
import {
|
|
6356
6612
|
forwardRef as forwardRef5,
|
|
6357
6613
|
useCallback as useCallback6,
|
|
6358
|
-
useContext as
|
|
6359
|
-
useId as
|
|
6360
|
-
useMemo as
|
|
6614
|
+
useContext as useContext22,
|
|
6615
|
+
useId as useId8,
|
|
6616
|
+
useMemo as useMemo10,
|
|
6361
6617
|
useRef as useRef9,
|
|
6362
|
-
useState as
|
|
6618
|
+
useState as useState17
|
|
6363
6619
|
} from "react";
|
|
6364
|
-
import
|
|
6620
|
+
import styled35, { ThemeProvider as ThemeProvider15 } from "styled-components";
|
|
6365
6621
|
|
|
6366
6622
|
// src/select/Listbox.tsx
|
|
6367
|
-
import { useContext as
|
|
6368
|
-
import
|
|
6623
|
+
import { useContext as useContext21, useLayoutEffect as useLayoutEffect4, useRef as useRef8 } from "react";
|
|
6624
|
+
import styled34 from "styled-components";
|
|
6369
6625
|
|
|
6370
6626
|
// src/select/ListOption.tsx
|
|
6371
|
-
import
|
|
6372
|
-
import { useState as
|
|
6373
|
-
import { jsx as
|
|
6627
|
+
import styled33 from "styled-components";
|
|
6628
|
+
import { useState as useState16 } from "react";
|
|
6629
|
+
import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6374
6630
|
var ListOption = ({
|
|
6375
6631
|
id,
|
|
6376
6632
|
option,
|
|
@@ -6381,12 +6637,12 @@ var ListOption = ({
|
|
|
6381
6637
|
isLastOption,
|
|
6382
6638
|
isSelected
|
|
6383
6639
|
}) => {
|
|
6384
|
-
const [hasTooltip, setHasTooltip] =
|
|
6640
|
+
const [hasTooltip, setHasTooltip] = useState16(false);
|
|
6385
6641
|
const handleOnMouseEnter = (event) => {
|
|
6386
6642
|
const text = event.currentTarget;
|
|
6387
6643
|
setHasTooltip(text.scrollWidth > text.clientWidth);
|
|
6388
6644
|
};
|
|
6389
|
-
return /* @__PURE__ */
|
|
6645
|
+
return /* @__PURE__ */ jsx40(TooltipWrapper, { condition: hasTooltip, label: option.label, children: /* @__PURE__ */ jsx40(
|
|
6390
6646
|
OptionItem,
|
|
6391
6647
|
{
|
|
6392
6648
|
id,
|
|
@@ -6397,7 +6653,7 @@ var ListOption = ({
|
|
|
6397
6653
|
selected: isSelected,
|
|
6398
6654
|
role: "option",
|
|
6399
6655
|
"aria-selected": !multiple ? isSelected : void 0,
|
|
6400
|
-
children: /* @__PURE__ */
|
|
6656
|
+
children: /* @__PURE__ */ jsxs26(
|
|
6401
6657
|
StyledOption,
|
|
6402
6658
|
{
|
|
6403
6659
|
visualFocused,
|
|
@@ -6406,11 +6662,11 @@ var ListOption = ({
|
|
|
6406
6662
|
grouped: isGroupedOption,
|
|
6407
6663
|
multiple,
|
|
6408
6664
|
children: [
|
|
6409
|
-
multiple && /* @__PURE__ */
|
|
6410
|
-
option.icon && /* @__PURE__ */
|
|
6411
|
-
/* @__PURE__ */
|
|
6412
|
-
/* @__PURE__ */
|
|
6413
|
-
!multiple && isSelected && /* @__PURE__ */
|
|
6665
|
+
multiple && /* @__PURE__ */ jsx40("div", { style: { display: "flex", pointerEvents: "none" }, children: /* @__PURE__ */ jsx40(Checkbox_default, { checked: isSelected, tabIndex: -1 }) }),
|
|
6666
|
+
option.icon && /* @__PURE__ */ jsx40(OptionIcon, { grouped: isGroupedOption, multiple, children: typeof option.icon === "string" ? /* @__PURE__ */ jsx40(Icon_default, { icon: option.icon }) : option.icon }),
|
|
6667
|
+
/* @__PURE__ */ jsxs26(OptionContent, { grouped: isGroupedOption, hasIcon: option.icon ? true : false, multiple, children: [
|
|
6668
|
+
/* @__PURE__ */ jsx40(OptionLabel, { onMouseEnter: handleOnMouseEnter, children: option.label }),
|
|
6669
|
+
!multiple && isSelected && /* @__PURE__ */ jsx40(OptionSelectedIndicator, { children: /* @__PURE__ */ jsx40(Icon_default, { icon: "done" }) })
|
|
6414
6670
|
] })
|
|
6415
6671
|
]
|
|
6416
6672
|
}
|
|
@@ -6418,7 +6674,7 @@ var ListOption = ({
|
|
|
6418
6674
|
}
|
|
6419
6675
|
) });
|
|
6420
6676
|
};
|
|
6421
|
-
var OptionItem =
|
|
6677
|
+
var OptionItem = styled33.li`
|
|
6422
6678
|
padding: 0 0.5rem;
|
|
6423
6679
|
box-shadow: inset 0 0 0 2px transparent;
|
|
6424
6680
|
${(props) => props.visualFocused && `box-shadow: inset 0 0 0 2px ${props.theme.focusListOptionBorderColor};`}
|
|
@@ -6432,7 +6688,7 @@ var OptionItem = styled32.li`
|
|
|
6432
6688
|
${(props) => props.selected ? `background-color: ${props.theme.selectedActiveListOptionBackgroundColor};` : `background-color: ${props.theme.unselectedActiveListOptionBackgroundColor};`};
|
|
6433
6689
|
}
|
|
6434
6690
|
`;
|
|
6435
|
-
var StyledOption =
|
|
6691
|
+
var StyledOption = styled33.span`
|
|
6436
6692
|
box-sizing: border-box;
|
|
6437
6693
|
display: flex;
|
|
6438
6694
|
align-items: center;
|
|
@@ -6441,7 +6697,7 @@ var StyledOption = styled32.span`
|
|
|
6441
6697
|
${(props) => props.grouped && props.multiple && `padding-left: 16px;`}
|
|
6442
6698
|
${(props) => props.last || props.visualFocused || props.selected ? `border-bottom: 1px solid transparent` : `border-bottom: 1px solid ${props.theme.listOptionDividerColor}`};
|
|
6443
6699
|
`;
|
|
6444
|
-
var OptionIcon =
|
|
6700
|
+
var OptionIcon = styled33.span`
|
|
6445
6701
|
margin-left: ${(props) => props.grouped && !props.multiple ? "16px" : "8px"};
|
|
6446
6702
|
display: grid;
|
|
6447
6703
|
place-items: center;
|
|
@@ -6452,7 +6708,7 @@ var OptionIcon = styled32.span`
|
|
|
6452
6708
|
width: 24px;
|
|
6453
6709
|
}
|
|
6454
6710
|
`;
|
|
6455
|
-
var OptionContent =
|
|
6711
|
+
var OptionContent = styled33.span`
|
|
6456
6712
|
margin-left: ${(props) => props.grouped && !props.multiple && !props.hasIcon ? "16px" : "8px"};
|
|
6457
6713
|
display: flex;
|
|
6458
6714
|
justify-content: space-between;
|
|
@@ -6460,12 +6716,12 @@ var OptionContent = styled32.span`
|
|
|
6460
6716
|
width: 100%;
|
|
6461
6717
|
overflow: hidden;
|
|
6462
6718
|
`;
|
|
6463
|
-
var OptionLabel =
|
|
6719
|
+
var OptionLabel = styled33.span`
|
|
6464
6720
|
overflow: hidden;
|
|
6465
6721
|
text-overflow: ellipsis;
|
|
6466
6722
|
white-space: nowrap;
|
|
6467
6723
|
`;
|
|
6468
|
-
var OptionSelectedIndicator =
|
|
6724
|
+
var OptionSelectedIndicator = styled33.span`
|
|
6469
6725
|
display: flex;
|
|
6470
6726
|
align-items: center;
|
|
6471
6727
|
color: ${(props) => props.theme.selectedListOptionIconColor};
|
|
@@ -6563,7 +6819,7 @@ var getSelectedOption = (value, options, multiple, optional, optionalItem) => {
|
|
|
6563
6819
|
var getSelectedOptionLabel = (placeholder, selectedOption) => Array.isArray(selectedOption) ? selectedOption.length === 0 ? placeholder : selectedOption.map((option) => option.label).join(", ") : selectedOption.label ?? placeholder;
|
|
6564
6820
|
|
|
6565
6821
|
// src/select/Listbox.tsx
|
|
6566
|
-
import { jsx as
|
|
6822
|
+
import { jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6567
6823
|
var Listbox = ({
|
|
6568
6824
|
id,
|
|
6569
6825
|
currentValue,
|
|
@@ -6577,17 +6833,17 @@ var Listbox = ({
|
|
|
6577
6833
|
handleOptionOnClick,
|
|
6578
6834
|
styles
|
|
6579
6835
|
}) => {
|
|
6580
|
-
const translatedLabels =
|
|
6836
|
+
const translatedLabels = useContext21(HalstackLanguageContext);
|
|
6581
6837
|
const listboxRef = useRef8(null);
|
|
6582
6838
|
let globalIndex = optional && !multiple ? 0 : -1;
|
|
6583
6839
|
const mapOptionFunc = (option, mapIndex) => {
|
|
6584
6840
|
const groupId = `${id}-group-${mapIndex}`;
|
|
6585
6841
|
if ("options" in option) {
|
|
6586
|
-
return option.options.length > 0 && /* @__PURE__ */
|
|
6587
|
-
/* @__PURE__ */
|
|
6842
|
+
return option.options.length > 0 && /* @__PURE__ */ jsx41("li", { children: /* @__PURE__ */ jsxs27("ul", { role: "listbox", "aria-labelledby": groupId, style: { padding: 0 }, children: [
|
|
6843
|
+
/* @__PURE__ */ jsx41(GroupLabel, { role: "presentation", id: groupId, children: option.label }),
|
|
6588
6844
|
option.options.map((singleOption) => {
|
|
6589
6845
|
globalIndex++;
|
|
6590
|
-
return /* @__PURE__ */
|
|
6846
|
+
return /* @__PURE__ */ jsx41(
|
|
6591
6847
|
ListOption_default,
|
|
6592
6848
|
{
|
|
6593
6849
|
id: `${id}-option-${globalIndex}`,
|
|
@@ -6605,7 +6861,7 @@ var Listbox = ({
|
|
|
6605
6861
|
] }) }, groupId);
|
|
6606
6862
|
} else {
|
|
6607
6863
|
globalIndex++;
|
|
6608
|
-
return /* @__PURE__ */
|
|
6864
|
+
return /* @__PURE__ */ jsx41(
|
|
6609
6865
|
ListOption_default,
|
|
6610
6866
|
{
|
|
6611
6867
|
id: `${id}-option-${globalIndex}`,
|
|
@@ -6637,7 +6893,7 @@ var Listbox = ({
|
|
|
6637
6893
|
});
|
|
6638
6894
|
}, [visualFocusIndex]);
|
|
6639
6895
|
const hasOptionGroups = options.some((option) => "options" in option && option.options.length > 0);
|
|
6640
|
-
return /* @__PURE__ */
|
|
6896
|
+
return /* @__PURE__ */ jsxs27(
|
|
6641
6897
|
ListboxContainer,
|
|
6642
6898
|
{
|
|
6643
6899
|
id,
|
|
@@ -6653,10 +6909,10 @@ var Listbox = ({
|
|
|
6653
6909
|
role: hasOptionGroups ? "list" : "listbox",
|
|
6654
6910
|
"aria-label": "List of options",
|
|
6655
6911
|
children: [
|
|
6656
|
-
searchable && (options.length === 0 || !groupsHaveOptions(options)) ? /* @__PURE__ */
|
|
6657
|
-
/* @__PURE__ */
|
|
6912
|
+
searchable && (options.length === 0 || !groupsHaveOptions(options)) ? /* @__PURE__ */ jsxs27(OptionsSystemMessage, { children: [
|
|
6913
|
+
/* @__PURE__ */ jsx41(NoMatchesFoundIcon, { children: /* @__PURE__ */ jsx41(Icon_default, { icon: "search_off" }) }),
|
|
6658
6914
|
translatedLabels.select.noMatchesErrorMessage
|
|
6659
|
-
] }) : optional && !multiple && /* @__PURE__ */
|
|
6915
|
+
] }) : optional && !multiple && /* @__PURE__ */ jsx41(
|
|
6660
6916
|
ListOption_default,
|
|
6661
6917
|
{
|
|
6662
6918
|
id: `${id}-option-${0}`,
|
|
@@ -6675,7 +6931,7 @@ var Listbox = ({
|
|
|
6675
6931
|
}
|
|
6676
6932
|
);
|
|
6677
6933
|
};
|
|
6678
|
-
var ListboxContainer =
|
|
6934
|
+
var ListboxContainer = styled34.ul`
|
|
6679
6935
|
box-sizing: border-box;
|
|
6680
6936
|
max-height: 304px;
|
|
6681
6937
|
overflow-y: auto;
|
|
@@ -6693,14 +6949,14 @@ var ListboxContainer = styled33.ul`
|
|
|
6693
6949
|
line-height: 24px;
|
|
6694
6950
|
cursor: default;
|
|
6695
6951
|
`;
|
|
6696
|
-
var OptionsSystemMessage =
|
|
6952
|
+
var OptionsSystemMessage = styled34.span`
|
|
6697
6953
|
display: flex;
|
|
6698
6954
|
padding: 4px 16px;
|
|
6699
6955
|
color: ${(props) => props.theme.systemMessageFontColor};
|
|
6700
6956
|
font-size: 0.875rem;
|
|
6701
6957
|
line-height: 1.715em;
|
|
6702
6958
|
`;
|
|
6703
|
-
var NoMatchesFoundIcon =
|
|
6959
|
+
var NoMatchesFoundIcon = styled34.span`
|
|
6704
6960
|
display: flex;
|
|
6705
6961
|
flex-wrap: wrap;
|
|
6706
6962
|
align-content: center;
|
|
@@ -6710,7 +6966,7 @@ var NoMatchesFoundIcon = styled33.span`
|
|
|
6710
6966
|
margin-right: 0.25rem;
|
|
6711
6967
|
font-size: 16px;
|
|
6712
6968
|
`;
|
|
6713
|
-
var GroupLabel =
|
|
6969
|
+
var GroupLabel = styled34.li`
|
|
6714
6970
|
padding: 4px 16px;
|
|
6715
6971
|
font-weight: ${(props) => props.theme.listGroupLabelFontWeight};
|
|
6716
6972
|
line-height: 1.715em;
|
|
@@ -6718,7 +6974,7 @@ var GroupLabel = styled33.li`
|
|
|
6718
6974
|
var Listbox_default = Listbox;
|
|
6719
6975
|
|
|
6720
6976
|
// src/select/Select.tsx
|
|
6721
|
-
import { jsx as
|
|
6977
|
+
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6722
6978
|
var DxcSelect = forwardRef5(
|
|
6723
6979
|
({
|
|
6724
6980
|
label,
|
|
@@ -6740,27 +6996,27 @@ var DxcSelect = forwardRef5(
|
|
|
6740
6996
|
tabIndex = 0,
|
|
6741
6997
|
ariaLabel = "Select"
|
|
6742
6998
|
}, ref) => {
|
|
6743
|
-
const selectId = `select-${
|
|
6999
|
+
const selectId = `select-${useId8()}`;
|
|
6744
7000
|
const selectLabelId = `label-${selectId}`;
|
|
6745
7001
|
const errorId = `error-${selectId}`;
|
|
6746
7002
|
const listboxId = `${selectId}-listbox`;
|
|
6747
|
-
const [innerValue, setInnerValue] =
|
|
6748
|
-
const [searchValue, setSearchValue] =
|
|
6749
|
-
const [visualFocusIndex, changeVisualFocusIndex] =
|
|
6750
|
-
const [isOpen, changeIsOpen] =
|
|
6751
|
-
const [hasTooltip, setHasTooltip] =
|
|
7003
|
+
const [innerValue, setInnerValue] = useState17(defaultValue ?? (multiple ? [] : ""));
|
|
7004
|
+
const [searchValue, setSearchValue] = useState17("");
|
|
7005
|
+
const [visualFocusIndex, changeVisualFocusIndex] = useState17(-1);
|
|
7006
|
+
const [isOpen, changeIsOpen] = useState17(false);
|
|
7007
|
+
const [hasTooltip, setHasTooltip] = useState17(false);
|
|
6752
7008
|
const selectRef = useRef9(null);
|
|
6753
7009
|
const selectSearchInputRef = useRef9(null);
|
|
6754
7010
|
const width = useWidth_default(selectRef.current);
|
|
6755
|
-
const colorsTheme =
|
|
6756
|
-
const translatedLabels =
|
|
7011
|
+
const colorsTheme = useContext22(HalstackContext);
|
|
7012
|
+
const translatedLabels = useContext22(HalstackLanguageContext);
|
|
6757
7013
|
const optionalItem = { label: placeholder, value: "" };
|
|
6758
|
-
const filteredOptions =
|
|
6759
|
-
const lastOptionIndex =
|
|
7014
|
+
const filteredOptions = useMemo10(() => filterOptionsBySearchValue(options, searchValue), [options, searchValue]);
|
|
7015
|
+
const lastOptionIndex = useMemo10(
|
|
6760
7016
|
() => getLastOptionIndex(options, filteredOptions, searchable, optional, multiple),
|
|
6761
7017
|
[options, filteredOptions, searchable, optional, multiple]
|
|
6762
7018
|
);
|
|
6763
|
-
const { selectedOption, singleSelectionIndex } =
|
|
7019
|
+
const { selectedOption, singleSelectionIndex } = useMemo10(
|
|
6764
7020
|
() => getSelectedOption(value ?? innerValue, options, multiple, optional, optionalItem),
|
|
6765
7021
|
[value, innerValue, options, multiple, optional, optionalItem]
|
|
6766
7022
|
);
|
|
@@ -6946,8 +7202,8 @@ var DxcSelect = forwardRef5(
|
|
|
6946
7202
|
const text = event.currentTarget;
|
|
6947
7203
|
setHasTooltip(text.scrollWidth > text.clientWidth);
|
|
6948
7204
|
};
|
|
6949
|
-
return /* @__PURE__ */
|
|
6950
|
-
label && /* @__PURE__ */
|
|
7205
|
+
return /* @__PURE__ */ jsx42(ThemeProvider15, { theme: colorsTheme.select, children: /* @__PURE__ */ jsxs28(SelectContainer, { margin, size, ref, children: [
|
|
7206
|
+
label && /* @__PURE__ */ jsxs28(
|
|
6951
7207
|
Label3,
|
|
6952
7208
|
{
|
|
6953
7209
|
id: selectLabelId,
|
|
@@ -6959,13 +7215,13 @@ var DxcSelect = forwardRef5(
|
|
|
6959
7215
|
children: [
|
|
6960
7216
|
label,
|
|
6961
7217
|
" ",
|
|
6962
|
-
optional && /* @__PURE__ */
|
|
7218
|
+
optional && /* @__PURE__ */ jsx42(OptionalLabel, { children: translatedLabels.formFields.optionalLabel })
|
|
6963
7219
|
]
|
|
6964
7220
|
}
|
|
6965
7221
|
),
|
|
6966
|
-
helperText && /* @__PURE__ */
|
|
6967
|
-
/* @__PURE__ */
|
|
6968
|
-
/* @__PURE__ */
|
|
7222
|
+
helperText && /* @__PURE__ */ jsx42(HelperText, { disabled, children: helperText }),
|
|
7223
|
+
/* @__PURE__ */ jsxs28(Popover2.Root, { open: isOpen, children: [
|
|
7224
|
+
/* @__PURE__ */ jsx42(Popover2.Trigger, { asChild: true, type: void 0, children: /* @__PURE__ */ jsxs28(
|
|
6969
7225
|
Select,
|
|
6970
7226
|
{
|
|
6971
7227
|
id: selectId,
|
|
@@ -6989,9 +7245,9 @@ var DxcSelect = forwardRef5(
|
|
|
6989
7245
|
"aria-required": !disabled && !optional,
|
|
6990
7246
|
"aria-label": label ? void 0 : ariaLabel,
|
|
6991
7247
|
children: [
|
|
6992
|
-
multiple && Array.isArray(selectedOption) && selectedOption.length > 0 && /* @__PURE__ */
|
|
6993
|
-
/* @__PURE__ */
|
|
6994
|
-
/* @__PURE__ */
|
|
7248
|
+
multiple && Array.isArray(selectedOption) && selectedOption.length > 0 && /* @__PURE__ */ jsxs28(SelectionIndicator, { children: [
|
|
7249
|
+
/* @__PURE__ */ jsx42(SelectionNumber, { disabled, children: selectedOption.length }),
|
|
7250
|
+
/* @__PURE__ */ jsx42(Tooltip, { label: translatedLabels.select.actionClearSelectionTitle, children: /* @__PURE__ */ jsx42(
|
|
6995
7251
|
ClearOptionsAction,
|
|
6996
7252
|
{
|
|
6997
7253
|
disabled,
|
|
@@ -7001,12 +7257,12 @@ var DxcSelect = forwardRef5(
|
|
|
7001
7257
|
onClick: handleClearOptionsActionOnClick,
|
|
7002
7258
|
tabIndex: -1,
|
|
7003
7259
|
"aria-label": translatedLabels.select.actionClearSelectionTitle,
|
|
7004
|
-
children: /* @__PURE__ */
|
|
7260
|
+
children: /* @__PURE__ */ jsx42(Icon_default, { icon: "clear" })
|
|
7005
7261
|
}
|
|
7006
7262
|
) })
|
|
7007
7263
|
] }),
|
|
7008
|
-
/* @__PURE__ */
|
|
7009
|
-
/* @__PURE__ */
|
|
7264
|
+
/* @__PURE__ */ jsx42(TooltipWrapper, { condition: hasTooltip, label: getSelectedOptionLabel(placeholder, selectedOption), children: /* @__PURE__ */ jsxs28(SearchableValueContainer, { children: [
|
|
7265
|
+
/* @__PURE__ */ jsx42(
|
|
7010
7266
|
"input",
|
|
7011
7267
|
{
|
|
7012
7268
|
style: { display: "none" },
|
|
@@ -7017,7 +7273,7 @@ var DxcSelect = forwardRef5(
|
|
|
7017
7273
|
"aria-hidden": "true"
|
|
7018
7274
|
}
|
|
7019
7275
|
),
|
|
7020
|
-
searchable && /* @__PURE__ */
|
|
7276
|
+
searchable && /* @__PURE__ */ jsx42(
|
|
7021
7277
|
SearchInput,
|
|
7022
7278
|
{
|
|
7023
7279
|
value: searchValue,
|
|
@@ -7030,17 +7286,17 @@ var DxcSelect = forwardRef5(
|
|
|
7030
7286
|
"aria-labelledby": label ? selectLabelId : void 0
|
|
7031
7287
|
}
|
|
7032
7288
|
),
|
|
7033
|
-
(!searchable || searchValue === "") && /* @__PURE__ */
|
|
7289
|
+
(!searchable || searchValue === "") && /* @__PURE__ */ jsx42(
|
|
7034
7290
|
SelectedOption,
|
|
7035
7291
|
{
|
|
7036
7292
|
disabled,
|
|
7037
7293
|
atBackground: (multiple ? (value ?? innerValue).length === 0 : !(value ?? innerValue)) || searchable && isOpen,
|
|
7038
|
-
children: /* @__PURE__ */
|
|
7294
|
+
children: /* @__PURE__ */ jsx42(SelectedOptionLabel, { onMouseEnter: handleOnMouseEnter, children: getSelectedOptionLabel(placeholder, selectedOption) })
|
|
7039
7295
|
}
|
|
7040
7296
|
)
|
|
7041
7297
|
] }) }),
|
|
7042
|
-
!disabled && error && /* @__PURE__ */
|
|
7043
|
-
searchable && searchValue.length > 0 && /* @__PURE__ */
|
|
7298
|
+
!disabled && error && /* @__PURE__ */ jsx42(ErrorIcon, { children: /* @__PURE__ */ jsx42(Icon_default, { icon: "filled_error" }) }),
|
|
7299
|
+
searchable && searchValue.length > 0 && /* @__PURE__ */ jsx42(Tooltip, { label: translatedLabels.select.actionClearSelectionTitle, children: /* @__PURE__ */ jsx42(
|
|
7044
7300
|
ClearSearchAction,
|
|
7045
7301
|
{
|
|
7046
7302
|
onMouseDown: (event) => {
|
|
@@ -7049,14 +7305,14 @@ var DxcSelect = forwardRef5(
|
|
|
7049
7305
|
onClick: handleClearSearchActionOnClick,
|
|
7050
7306
|
tabIndex: -1,
|
|
7051
7307
|
"aria-label": translatedLabels.select.actionClearSearchTitle,
|
|
7052
|
-
children: /* @__PURE__ */
|
|
7308
|
+
children: /* @__PURE__ */ jsx42(Icon_default, { icon: "clear" })
|
|
7053
7309
|
}
|
|
7054
7310
|
) }),
|
|
7055
|
-
/* @__PURE__ */
|
|
7311
|
+
/* @__PURE__ */ jsx42(CollapseIndicator2, { disabled, children: /* @__PURE__ */ jsx42(Icon_default, { icon: isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down" }) })
|
|
7056
7312
|
]
|
|
7057
7313
|
}
|
|
7058
7314
|
) }),
|
|
7059
|
-
/* @__PURE__ */
|
|
7315
|
+
/* @__PURE__ */ jsx42(Popover2.Portal, { children: /* @__PURE__ */ jsx42(
|
|
7060
7316
|
Popover2.Content,
|
|
7061
7317
|
{
|
|
7062
7318
|
sideOffset: 4,
|
|
@@ -7067,7 +7323,7 @@ var DxcSelect = forwardRef5(
|
|
|
7067
7323
|
onCloseAutoFocus: (event) => {
|
|
7068
7324
|
event.preventDefault();
|
|
7069
7325
|
},
|
|
7070
|
-
children: /* @__PURE__ */
|
|
7326
|
+
children: /* @__PURE__ */ jsx42(
|
|
7071
7327
|
Listbox_default,
|
|
7072
7328
|
{
|
|
7073
7329
|
id: listboxId,
|
|
@@ -7086,7 +7342,7 @@ var DxcSelect = forwardRef5(
|
|
|
7086
7342
|
}
|
|
7087
7343
|
) })
|
|
7088
7344
|
] }),
|
|
7089
|
-
!disabled && typeof error === "string" && /* @__PURE__ */
|
|
7345
|
+
!disabled && typeof error === "string" && /* @__PURE__ */ jsx42(Error2, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
|
|
7090
7346
|
] }) });
|
|
7091
7347
|
}
|
|
7092
7348
|
);
|
|
@@ -7097,7 +7353,7 @@ var sizes3 = {
|
|
|
7097
7353
|
fillParent: "100%"
|
|
7098
7354
|
};
|
|
7099
7355
|
var calculateWidth6 = (margin, size) => size === "fillParent" ? `calc(${sizes3[size]} - ${getMargin(margin, "left")} - ${getMargin(margin, "right")})` : size && sizes3[size];
|
|
7100
|
-
var SelectContainer =
|
|
7356
|
+
var SelectContainer = styled35.div`
|
|
7101
7357
|
box-sizing: border-box;
|
|
7102
7358
|
display: flex;
|
|
7103
7359
|
flex-direction: column;
|
|
@@ -7110,7 +7366,7 @@ var SelectContainer = styled34.div`
|
|
|
7110
7366
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
7111
7367
|
font-family: ${(props) => props.theme.fontFamily};
|
|
7112
7368
|
`;
|
|
7113
|
-
var Label3 =
|
|
7369
|
+
var Label3 = styled35.label`
|
|
7114
7370
|
color: ${(props) => props.disabled ? props.theme.disabledColor : props.theme.labelFontColor};
|
|
7115
7371
|
font-size: ${(props) => props.theme.labelFontSize};
|
|
7116
7372
|
font-style: ${(props) => props.theme.labelFontStyle};
|
|
@@ -7119,10 +7375,10 @@ var Label3 = styled34.label`
|
|
|
7119
7375
|
cursor: default;
|
|
7120
7376
|
${(props) => !props.helperText && `margin-bottom: 0.25rem`}
|
|
7121
7377
|
`;
|
|
7122
|
-
var OptionalLabel =
|
|
7378
|
+
var OptionalLabel = styled35.span`
|
|
7123
7379
|
font-weight: ${(props) => props.theme.optionalLabelFontWeight};
|
|
7124
7380
|
`;
|
|
7125
|
-
var HelperText =
|
|
7381
|
+
var HelperText = styled35.span`
|
|
7126
7382
|
color: ${(props) => props.disabled ? props.theme.disabledColor : props.theme.helperTextFontColor};
|
|
7127
7383
|
font-size: ${(props) => props.theme.helperTextFontSize};
|
|
7128
7384
|
font-style: ${(props) => props.theme.helperTextFontStyle};
|
|
@@ -7130,7 +7386,7 @@ var HelperText = styled34.span`
|
|
|
7130
7386
|
line-height: ${(props) => props.theme.helperTextLineHeight};
|
|
7131
7387
|
margin-bottom: 0.25rem;
|
|
7132
7388
|
`;
|
|
7133
|
-
var Select =
|
|
7389
|
+
var Select = styled35.div`
|
|
7134
7390
|
display: flex;
|
|
7135
7391
|
position: relative;
|
|
7136
7392
|
align-items: center;
|
|
@@ -7158,7 +7414,7 @@ var Select = styled34.div`
|
|
|
7158
7414
|
}
|
|
7159
7415
|
`};
|
|
7160
7416
|
`;
|
|
7161
|
-
var SelectionIndicator =
|
|
7417
|
+
var SelectionIndicator = styled35.div`
|
|
7162
7418
|
box-sizing: border-box;
|
|
7163
7419
|
display: grid;
|
|
7164
7420
|
grid-template-columns: 1fr 1fr;
|
|
@@ -7167,7 +7423,7 @@ var SelectionIndicator = styled34.div`
|
|
|
7167
7423
|
border-radius: 2px;
|
|
7168
7424
|
border: 1px solid ${(props) => props.theme.selectionIndicatorBorderColor};
|
|
7169
7425
|
`;
|
|
7170
|
-
var SelectionNumber =
|
|
7426
|
+
var SelectionNumber = styled35.span`
|
|
7171
7427
|
display: grid;
|
|
7172
7428
|
place-items: center;
|
|
7173
7429
|
border-right: 1px solid ${(props) => props.theme.selectionIndicatorBorderColor};
|
|
@@ -7179,7 +7435,7 @@ var SelectionNumber = styled34.span`
|
|
|
7179
7435
|
font-weight: ${(props) => props.theme.selectionIndicatorFontWeight};
|
|
7180
7436
|
${(props) => props.disabled ? `cursor: not-allowed;` : `cursor: default;`}
|
|
7181
7437
|
`;
|
|
7182
|
-
var ClearOptionsAction =
|
|
7438
|
+
var ClearOptionsAction = styled35.button`
|
|
7183
7439
|
display: grid;
|
|
7184
7440
|
place-items: center;
|
|
7185
7441
|
border: none;
|
|
@@ -7204,11 +7460,11 @@ var ClearOptionsAction = styled34.button`
|
|
|
7204
7460
|
}
|
|
7205
7461
|
`}
|
|
7206
7462
|
`;
|
|
7207
|
-
var SearchableValueContainer =
|
|
7463
|
+
var SearchableValueContainer = styled35.div`
|
|
7208
7464
|
display: grid;
|
|
7209
7465
|
width: 100%;
|
|
7210
7466
|
`;
|
|
7211
|
-
var SelectedOption =
|
|
7467
|
+
var SelectedOption = styled35.span`
|
|
7212
7468
|
grid-area: 1 / 1 / 1 / 1;
|
|
7213
7469
|
display: inline-flex;
|
|
7214
7470
|
align-items: center;
|
|
@@ -7224,12 +7480,12 @@ var SelectedOption = styled34.span`
|
|
|
7224
7480
|
font-style: ${(props) => props.theme.valueFontStyle};
|
|
7225
7481
|
font-weight: ${(props) => props.theme.valueFontWeight};
|
|
7226
7482
|
`;
|
|
7227
|
-
var SelectedOptionLabel =
|
|
7483
|
+
var SelectedOptionLabel = styled35.span`
|
|
7228
7484
|
overflow: hidden;
|
|
7229
7485
|
text-overflow: ellipsis;
|
|
7230
7486
|
white-space: nowrap;
|
|
7231
7487
|
`;
|
|
7232
|
-
var SearchInput =
|
|
7488
|
+
var SearchInput = styled35.input`
|
|
7233
7489
|
grid-area: 1 / 1 / 1 / 1;
|
|
7234
7490
|
height: calc(2.5rem - 2px);
|
|
7235
7491
|
background: none;
|
|
@@ -7242,7 +7498,7 @@ var SearchInput = styled34.input`
|
|
|
7242
7498
|
font-weight: ${(props) => props.theme.valueFontWeight};
|
|
7243
7499
|
line-height: 1.5em;
|
|
7244
7500
|
`;
|
|
7245
|
-
var ErrorIcon =
|
|
7501
|
+
var ErrorIcon = styled35.span`
|
|
7246
7502
|
display: flex;
|
|
7247
7503
|
flex-wrap: wrap;
|
|
7248
7504
|
align-content: center;
|
|
@@ -7253,14 +7509,14 @@ var ErrorIcon = styled34.span`
|
|
|
7253
7509
|
color: ${(props) => props.theme.errorIconColor};
|
|
7254
7510
|
font-size: 1.25rem;
|
|
7255
7511
|
`;
|
|
7256
|
-
var Error2 =
|
|
7512
|
+
var Error2 = styled35.span`
|
|
7257
7513
|
min-height: 1.5em;
|
|
7258
7514
|
color: ${(props) => props.theme.errorMessageColor};
|
|
7259
7515
|
font-size: 0.75rem;
|
|
7260
7516
|
line-height: 1.5em;
|
|
7261
7517
|
margin-top: 0.25rem;
|
|
7262
7518
|
`;
|
|
7263
|
-
var CollapseIndicator2 =
|
|
7519
|
+
var CollapseIndicator2 = styled35.span`
|
|
7264
7520
|
display: grid;
|
|
7265
7521
|
place-items: center;
|
|
7266
7522
|
padding: 4px;
|
|
@@ -7268,7 +7524,7 @@ var CollapseIndicator2 = styled34.span`
|
|
|
7268
7524
|
margin-left: 0.25rem;
|
|
7269
7525
|
color: ${(props) => props.disabled ? props.theme.disabledColor : props.theme.collapseIndicatorColor};
|
|
7270
7526
|
`;
|
|
7271
|
-
var ClearSearchAction =
|
|
7527
|
+
var ClearSearchAction = styled35.button`
|
|
7272
7528
|
display: grid;
|
|
7273
7529
|
place-items: center;
|
|
7274
7530
|
min-height: 24px;
|
|
@@ -7294,7 +7550,7 @@ var ClearSearchAction = styled34.button`
|
|
|
7294
7550
|
var Select_default = DxcSelect;
|
|
7295
7551
|
|
|
7296
7552
|
// src/paginator/Paginator.tsx
|
|
7297
|
-
import { jsx as
|
|
7553
|
+
import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7298
7554
|
var DxcPaginator = ({
|
|
7299
7555
|
currentPage = 1,
|
|
7300
7556
|
itemsPerPage = 5,
|
|
@@ -7309,12 +7565,12 @@ var DxcPaginator = ({
|
|
|
7309
7565
|
const currentPageInternal = currentPage === -1 ? totalPages : currentPage;
|
|
7310
7566
|
const minItemsPerPage = currentPageInternal === 1 || currentPageInternal === 0 ? currentPageInternal : (currentPageInternal - 1) * itemsPerPage + 1;
|
|
7311
7567
|
const maxItemsPerPage = minItemsPerPage - 1 + itemsPerPage > totalItems ? totalItems : minItemsPerPage - 1 + itemsPerPage;
|
|
7312
|
-
const colorsTheme =
|
|
7313
|
-
const translatedLabels =
|
|
7314
|
-
return /* @__PURE__ */
|
|
7315
|
-
itemsPerPageOptions && /* @__PURE__ */
|
|
7316
|
-
/* @__PURE__ */
|
|
7317
|
-
/* @__PURE__ */
|
|
7568
|
+
const colorsTheme = useContext23(HalstackContext);
|
|
7569
|
+
const translatedLabels = useContext23(HalstackLanguageContext);
|
|
7570
|
+
return /* @__PURE__ */ jsx43(ThemeProvider16, { theme: colorsTheme.paginator, children: /* @__PURE__ */ jsx43(DxcPaginatorContainer, { children: /* @__PURE__ */ jsxs29(LabelsContainer3, { children: [
|
|
7571
|
+
itemsPerPageOptions && /* @__PURE__ */ jsxs29(ItemsPageContainer, { children: [
|
|
7572
|
+
/* @__PURE__ */ jsx43(ItemsLabel, { children: translatedLabels.paginator.itemsPerPageText }),
|
|
7573
|
+
/* @__PURE__ */ jsx43(SelectContainer2, { children: /* @__PURE__ */ jsx43(
|
|
7318
7574
|
Select_default,
|
|
7319
7575
|
{
|
|
7320
7576
|
options: itemsPerPageOptions.map((num) => ({
|
|
@@ -7330,8 +7586,8 @@ var DxcPaginator = ({
|
|
|
7330
7586
|
}
|
|
7331
7587
|
) })
|
|
7332
7588
|
] }),
|
|
7333
|
-
/* @__PURE__ */
|
|
7334
|
-
onPageChange && /* @__PURE__ */
|
|
7589
|
+
/* @__PURE__ */ jsx43(TotalItemsContainer, { children: translatedLabels.paginator.minToMaxOfText(minItemsPerPage, maxItemsPerPage, totalItems) }),
|
|
7590
|
+
onPageChange && /* @__PURE__ */ jsx43(
|
|
7335
7591
|
Button_default,
|
|
7336
7592
|
{
|
|
7337
7593
|
mode: "secondary",
|
|
@@ -7344,7 +7600,7 @@ var DxcPaginator = ({
|
|
|
7344
7600
|
title: translatedLabels.paginator.firstResultsTitle
|
|
7345
7601
|
}
|
|
7346
7602
|
),
|
|
7347
|
-
onPageChange && /* @__PURE__ */
|
|
7603
|
+
onPageChange && /* @__PURE__ */ jsx43(
|
|
7348
7604
|
Button_default,
|
|
7349
7605
|
{
|
|
7350
7606
|
mode: "secondary",
|
|
@@ -7357,12 +7613,12 @@ var DxcPaginator = ({
|
|
|
7357
7613
|
title: translatedLabels.paginator.previousResultsTitle
|
|
7358
7614
|
}
|
|
7359
7615
|
),
|
|
7360
|
-
showGoToPage ? /* @__PURE__ */
|
|
7361
|
-
/* @__PURE__ */
|
|
7616
|
+
showGoToPage ? /* @__PURE__ */ jsxs29(PageToSelectContainer, { children: [
|
|
7617
|
+
/* @__PURE__ */ jsxs29(GoToLabel, { children: [
|
|
7362
7618
|
translatedLabels.paginator.goToPageText,
|
|
7363
7619
|
" "
|
|
7364
7620
|
] }),
|
|
7365
|
-
/* @__PURE__ */
|
|
7621
|
+
/* @__PURE__ */ jsx43(SelectContainer2, { children: /* @__PURE__ */ jsx43(
|
|
7366
7622
|
Select_default,
|
|
7367
7623
|
{
|
|
7368
7624
|
options: Array.from(Array(totalPages), (e, num) => ({
|
|
@@ -7377,8 +7633,8 @@ var DxcPaginator = ({
|
|
|
7377
7633
|
tabIndex
|
|
7378
7634
|
}
|
|
7379
7635
|
) })
|
|
7380
|
-
] }) : /* @__PURE__ */
|
|
7381
|
-
onPageChange && /* @__PURE__ */
|
|
7636
|
+
] }) : /* @__PURE__ */ jsx43("span", { children: translatedLabels.paginator.pageOfText(currentPageInternal, totalPages) }),
|
|
7637
|
+
onPageChange && /* @__PURE__ */ jsx43(
|
|
7382
7638
|
Button_default,
|
|
7383
7639
|
{
|
|
7384
7640
|
mode: "secondary",
|
|
@@ -7391,7 +7647,7 @@ var DxcPaginator = ({
|
|
|
7391
7647
|
title: "Next results"
|
|
7392
7648
|
}
|
|
7393
7649
|
),
|
|
7394
|
-
onPageChange && /* @__PURE__ */
|
|
7650
|
+
onPageChange && /* @__PURE__ */ jsx43(
|
|
7395
7651
|
Button_default,
|
|
7396
7652
|
{
|
|
7397
7653
|
mode: "secondary",
|
|
@@ -7406,7 +7662,7 @@ var DxcPaginator = ({
|
|
|
7406
7662
|
)
|
|
7407
7663
|
] }) }) });
|
|
7408
7664
|
};
|
|
7409
|
-
var DxcPaginatorContainer =
|
|
7665
|
+
var DxcPaginatorContainer = styled36.div`
|
|
7410
7666
|
display: flex;
|
|
7411
7667
|
font-family: ${(props) => props.theme.fontFamily};
|
|
7412
7668
|
font-size: ${(props) => props.theme.fontSize};
|
|
@@ -7424,34 +7680,34 @@ var DxcPaginatorContainer = styled35.div`
|
|
|
7424
7680
|
}
|
|
7425
7681
|
}
|
|
7426
7682
|
`;
|
|
7427
|
-
var SelectContainer2 =
|
|
7683
|
+
var SelectContainer2 = styled36.div`
|
|
7428
7684
|
min-width: 5.25rem;
|
|
7429
7685
|
`;
|
|
7430
|
-
var ItemsPageContainer =
|
|
7686
|
+
var ItemsPageContainer = styled36.span`
|
|
7431
7687
|
display: flex;
|
|
7432
7688
|
align-items: center;
|
|
7433
7689
|
margin-right: ${(props) => props.theme.itemsPerPageSelectorMarginRight};
|
|
7434
7690
|
margin-left: ${(props) => props.theme.itemsPerPageSelectorMarginLeft};
|
|
7435
7691
|
`;
|
|
7436
|
-
var ItemsLabel =
|
|
7692
|
+
var ItemsLabel = styled36.span`
|
|
7437
7693
|
margin-right: 0.5rem;
|
|
7438
7694
|
`;
|
|
7439
|
-
var GoToLabel =
|
|
7695
|
+
var GoToLabel = styled36.span`
|
|
7440
7696
|
margin-right: 0.5rem;
|
|
7441
7697
|
margin-left: 0.5rem;
|
|
7442
7698
|
`;
|
|
7443
|
-
var TotalItemsContainer =
|
|
7699
|
+
var TotalItemsContainer = styled36.span`
|
|
7444
7700
|
margin-right: ${(props) => props.theme.totalItemsContainerMarginRight};
|
|
7445
7701
|
margin-left: ${(props) => props.theme.totalItemsContainerMarginLeft};
|
|
7446
7702
|
`;
|
|
7447
|
-
var
|
|
7703
|
+
var LabelsContainer3 = styled36.div`
|
|
7448
7704
|
display: flex;
|
|
7449
7705
|
gap: 0.5rem;
|
|
7450
7706
|
width: 100%;
|
|
7451
7707
|
justify-content: flex-end;
|
|
7452
7708
|
align-items: center;
|
|
7453
7709
|
`;
|
|
7454
|
-
var PageToSelectContainer =
|
|
7710
|
+
var PageToSelectContainer = styled36.span`
|
|
7455
7711
|
display: flex;
|
|
7456
7712
|
align-items: center;
|
|
7457
7713
|
margin-right: 0.5rem;
|
|
@@ -7459,8 +7715,8 @@ var PageToSelectContainer = styled35.span`
|
|
|
7459
7715
|
var Paginator_default = DxcPaginator;
|
|
7460
7716
|
|
|
7461
7717
|
// src/table/Table.tsx
|
|
7462
|
-
import { useContext as
|
|
7463
|
-
import
|
|
7718
|
+
import { useContext as useContext24 } from "react";
|
|
7719
|
+
import styled37, { ThemeProvider as ThemeProvider17 } from "styled-components";
|
|
7464
7720
|
|
|
7465
7721
|
// src/table/dropdownTheme.ts
|
|
7466
7722
|
var dropdownTheme_default2 = {
|
|
@@ -7520,7 +7776,7 @@ var dropdownTheme_default2 = {
|
|
|
7520
7776
|
};
|
|
7521
7777
|
|
|
7522
7778
|
// src/table/Table.tsx
|
|
7523
|
-
import { jsx as
|
|
7779
|
+
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7524
7780
|
var overwriteTheme2 = (theme) => {
|
|
7525
7781
|
const newTheme = dropdownTheme_default2;
|
|
7526
7782
|
newTheme.dropdown.buttonBackgroundColor = theme.table.actionBackgroundColor;
|
|
@@ -7535,10 +7791,10 @@ var DxcActionsCell = ({ actions }) => {
|
|
|
7535
7791
|
const actionIcons = actions.filter((action) => !action.options);
|
|
7536
7792
|
const actionDropdown = actions.find((action) => action.options);
|
|
7537
7793
|
const maxNumberOfActions = actionDropdown ? 2 : 3;
|
|
7538
|
-
const colorsTheme =
|
|
7539
|
-
return /* @__PURE__ */
|
|
7794
|
+
const colorsTheme = useContext24(HalstackContext);
|
|
7795
|
+
return /* @__PURE__ */ jsxs30(Flex_default, { gap: "0.5rem", alignItems: "center", children: [
|
|
7540
7796
|
actionIcons.map(
|
|
7541
|
-
(action, index) => index < maxNumberOfActions && /* @__PURE__ */
|
|
7797
|
+
(action, index) => index < maxNumberOfActions && /* @__PURE__ */ jsx44(
|
|
7542
7798
|
ActionIcon_default,
|
|
7543
7799
|
{
|
|
7544
7800
|
icon: action.icon,
|
|
@@ -7550,7 +7806,7 @@ var DxcActionsCell = ({ actions }) => {
|
|
|
7550
7806
|
`action-${index}`
|
|
7551
7807
|
)
|
|
7552
7808
|
),
|
|
7553
|
-
actionDropdown && /* @__PURE__ */
|
|
7809
|
+
actionDropdown && /* @__PURE__ */ jsx44(HalstackProvider, { advancedTheme: overwriteTheme2(colorsTheme), children: /* @__PURE__ */ jsx44(
|
|
7554
7810
|
Dropdown_default,
|
|
7555
7811
|
{
|
|
7556
7812
|
options: actionDropdown.options ?? [],
|
|
@@ -7564,11 +7820,11 @@ var DxcActionsCell = ({ actions }) => {
|
|
|
7564
7820
|
] });
|
|
7565
7821
|
};
|
|
7566
7822
|
var DxcTable = ({ children, margin, mode = "default" }) => {
|
|
7567
|
-
const colorsTheme =
|
|
7568
|
-
return /* @__PURE__ */
|
|
7823
|
+
const colorsTheme = useContext24(HalstackContext);
|
|
7824
|
+
return /* @__PURE__ */ jsx44(ThemeProvider17, { theme: colorsTheme.table, children: /* @__PURE__ */ jsx44(DxcTableContainer, { margin, children: /* @__PURE__ */ jsx44(DxcTableContent, { mode, children }) }) });
|
|
7569
7825
|
};
|
|
7570
7826
|
var calculateWidth7 = (margin) => `calc(100% - ${getMargin(margin, "left")} - ${getMargin(margin, "right")})`;
|
|
7571
|
-
var DxcTableContainer =
|
|
7827
|
+
var DxcTableContainer = styled37.div`
|
|
7572
7828
|
width: ${(props) => calculateWidth7(props.margin)};
|
|
7573
7829
|
margin: ${(props) => props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px"};
|
|
7574
7830
|
margin-top: ${(props) => props.margin && typeof props.margin === "object" && props.margin.top ? spaces[props.margin.top] : ""};
|
|
@@ -7590,7 +7846,7 @@ var DxcTableContainer = styled36.div`
|
|
|
7590
7846
|
border-radius: 6px;
|
|
7591
7847
|
}
|
|
7592
7848
|
`;
|
|
7593
|
-
var DxcTableContent =
|
|
7849
|
+
var DxcTableContent = styled37.table`
|
|
7594
7850
|
border-collapse: collapse;
|
|
7595
7851
|
width: 100%;
|
|
7596
7852
|
|
|
@@ -7641,8 +7897,8 @@ DxcTable.ActionsCell = DxcActionsCell;
|
|
|
7641
7897
|
var Table_default = DxcTable;
|
|
7642
7898
|
|
|
7643
7899
|
// src/data-grid/DataGrid.tsx
|
|
7644
|
-
import { jsx as
|
|
7645
|
-
var ActionContainer =
|
|
7900
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7901
|
+
var ActionContainer = styled38.div`
|
|
7646
7902
|
display: flex;
|
|
7647
7903
|
height: 100%;
|
|
7648
7904
|
align-items: center;
|
|
@@ -7650,7 +7906,7 @@ var ActionContainer = styled37.div`
|
|
|
7650
7906
|
font-size: 14px;
|
|
7651
7907
|
width: 100%;
|
|
7652
7908
|
`;
|
|
7653
|
-
var HierarchyContainer =
|
|
7909
|
+
var HierarchyContainer = styled38.div`
|
|
7654
7910
|
padding-left: ${(props) => `calc(${props.theme.dataPaddingLeft} * ${props.level})`};
|
|
7655
7911
|
button {
|
|
7656
7912
|
display: grid;
|
|
@@ -7669,7 +7925,7 @@ var HierarchyContainer = styled37.div`
|
|
|
7669
7925
|
cursor: pointer;
|
|
7670
7926
|
}
|
|
7671
7927
|
`;
|
|
7672
|
-
var DataGridContainer =
|
|
7928
|
+
var DataGridContainer = styled38.div`
|
|
7673
7929
|
width: 100%;
|
|
7674
7930
|
height: ${(props) => props.paginatorRendered ? `calc(100% - 50px)` : `100%`};
|
|
7675
7931
|
.rdg {
|
|
@@ -7798,9 +8054,9 @@ var DxcDataGrid = ({
|
|
|
7798
8054
|
totalItems,
|
|
7799
8055
|
defaultPage = 1
|
|
7800
8056
|
}) => {
|
|
7801
|
-
const [rowsToRender, setRowsToRender] =
|
|
7802
|
-
const colorsTheme =
|
|
7803
|
-
const [page, changePage] =
|
|
8057
|
+
const [rowsToRender, setRowsToRender] = useState18([...rows]);
|
|
8058
|
+
const colorsTheme = useContext25(HalstackContext);
|
|
8059
|
+
const [page, changePage] = useState18(defaultPage);
|
|
7804
8060
|
const goToPage = (newPage) => {
|
|
7805
8061
|
if (onPageChange) {
|
|
7806
8062
|
onPageChange(newPage);
|
|
@@ -7818,7 +8074,7 @@ var DxcDataGrid = ({
|
|
|
7818
8074
|
}
|
|
7819
8075
|
setSortColumns(newSortColumns);
|
|
7820
8076
|
};
|
|
7821
|
-
const columnsToRender =
|
|
8077
|
+
const columnsToRender = useMemo11(() => {
|
|
7822
8078
|
let expectedColumns = columns.map((column) => convertToRDGColumns(column, summaryRow));
|
|
7823
8079
|
if (expandable) {
|
|
7824
8080
|
expectedColumns = [
|
|
@@ -7835,22 +8091,29 @@ var DxcDataGrid = ({
|
|
|
7835
8091
|
if (row.isExpandedChildContent) {
|
|
7836
8092
|
return row.expandedChildContent || null;
|
|
7837
8093
|
}
|
|
7838
|
-
return /* @__PURE__ */
|
|
8094
|
+
return /* @__PURE__ */ jsx45(ActionContainer, { id: "action", children: row.expandedContent && renderExpandableTrigger(row, rowsToRender, uniqueRowId, setRowsToRender) });
|
|
7839
8095
|
}
|
|
7840
8096
|
},
|
|
7841
8097
|
...expectedColumns
|
|
7842
8098
|
];
|
|
7843
8099
|
}
|
|
7844
|
-
if (!expandable && rows.some((row) =>
|
|
8100
|
+
if (!expandable && rows.some((row) => rowHasHierarchy(row)) && uniqueRowId) {
|
|
7845
8101
|
const firstColumnKey = expectedColumns[0]?.key;
|
|
7846
8102
|
if (firstColumnKey) {
|
|
7847
8103
|
expectedColumns[0] = {
|
|
7848
8104
|
...expectedColumns[0],
|
|
7849
8105
|
renderCell({ row }) {
|
|
7850
|
-
if (row
|
|
7851
|
-
return /* @__PURE__ */
|
|
8106
|
+
if (rowHasHierarchy(row)) {
|
|
8107
|
+
return /* @__PURE__ */ jsx45(HierarchyContainer, { level: typeof row.rowLevel === "number" ? row.rowLevel : 0, children: renderHierarchyTrigger(
|
|
8108
|
+
rowsToRender,
|
|
8109
|
+
row,
|
|
8110
|
+
uniqueRowId,
|
|
8111
|
+
firstColumnKey,
|
|
8112
|
+
setRowsToRender,
|
|
8113
|
+
row.childrenTrigger
|
|
8114
|
+
) });
|
|
7852
8115
|
}
|
|
7853
|
-
return /* @__PURE__ */
|
|
8116
|
+
return /* @__PURE__ */ jsx45(HierarchyContainer, { level: typeof row.rowLevel === "number" ? row.rowLevel : 0, className: "ellipsis-cell", children: row[firstColumnKey] });
|
|
7854
8117
|
}
|
|
7855
8118
|
};
|
|
7856
8119
|
}
|
|
@@ -7865,40 +8128,35 @@ var DxcDataGrid = ({
|
|
|
7865
8128
|
minWidth: 36,
|
|
7866
8129
|
renderCell({ row }) {
|
|
7867
8130
|
if (!row.isExpandedChildContent) {
|
|
7868
|
-
return /* @__PURE__ */
|
|
8131
|
+
return /* @__PURE__ */ jsx45(ActionContainer, { id: "action", children: renderCheckbox(rows, row, uniqueRowId, selectedRows, onSelectRows) });
|
|
7869
8132
|
}
|
|
7870
8133
|
return null;
|
|
7871
8134
|
},
|
|
7872
|
-
renderHeaderCell: () => /* @__PURE__ */
|
|
8135
|
+
renderHeaderCell: () => /* @__PURE__ */ jsx45(ActionContainer, { id: "action", children: renderHeaderCheckbox(rows, uniqueRowId, selectedRows, colorsTheme, onSelectRows) })
|
|
7873
8136
|
},
|
|
7874
8137
|
...expectedColumns
|
|
7875
8138
|
];
|
|
7876
8139
|
}
|
|
7877
8140
|
return expectedColumns;
|
|
7878
8141
|
}, [selectable, expandable, columns, rowsToRender, onSelectRows, rows, summaryRow, uniqueRowId, selectedRows]);
|
|
7879
|
-
const [columnsOrder, setColumnsOrder] =
|
|
7880
|
-
const [sortColumns, setSortColumns] =
|
|
8142
|
+
const [columnsOrder, setColumnsOrder] = useState18(() => columnsToRender.map((_, index) => index));
|
|
8143
|
+
const [sortColumns, setSortColumns] = useState18([]);
|
|
7881
8144
|
useEffect8(() => {
|
|
7882
8145
|
setColumnsOrder(Array.from({ length: columnsToRender.length }, (_, index) => index));
|
|
7883
8146
|
}, [columnsToRender.length]);
|
|
7884
8147
|
useEffect8(() => {
|
|
7885
8148
|
const finalRows = [...rows];
|
|
7886
8149
|
if (expandable) {
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
expandedChildContent: row.expandedContent,
|
|
7893
|
-
triggerRowKey: rowKeyGetter(row, uniqueRowId),
|
|
7894
|
-
expandedContentHeight: row.expandedContentHeight
|
|
7895
|
-
});
|
|
7896
|
-
}
|
|
8150
|
+
finalRows.filter((row) => {
|
|
8151
|
+
const rowId = rowKeyGetter(row, uniqueRowId);
|
|
8152
|
+
return row.contentIsExpanded && !rows.some((r) => r[uniqueRowId] === `${rowId}_expanded`);
|
|
8153
|
+
}).forEach((row) => {
|
|
8154
|
+
expandRow(row, finalRows, uniqueRowId);
|
|
7897
8155
|
});
|
|
7898
8156
|
}
|
|
7899
8157
|
setRowsToRender(finalRows);
|
|
7900
8158
|
}, [rows]);
|
|
7901
|
-
const reorderedColumns =
|
|
8159
|
+
const reorderedColumns = useMemo11(
|
|
7902
8160
|
() => (
|
|
7903
8161
|
// Array ordered by columnsOrder
|
|
7904
8162
|
columnsOrder.map((index) => columnsToRender[index])
|
|
@@ -7930,7 +8188,7 @@ var DxcDataGrid = ({
|
|
|
7930
8188
|
onGridRowsChange(newRows);
|
|
7931
8189
|
}
|
|
7932
8190
|
};
|
|
7933
|
-
const sortedRows =
|
|
8191
|
+
const sortedRows = useMemo11(() => {
|
|
7934
8192
|
const sortFunctions = getCustomSortFn(columns);
|
|
7935
8193
|
if (!onSort) {
|
|
7936
8194
|
if (sortColumns.length > 0 && uniqueRowId) {
|
|
@@ -7959,19 +8217,19 @@ var DxcDataGrid = ({
|
|
|
7959
8217
|
}
|
|
7960
8218
|
return rowsToRender;
|
|
7961
8219
|
}, [expandable, rowsToRender, sortColumns, uniqueRowId]);
|
|
7962
|
-
const minItemsPerPageIndex =
|
|
7963
|
-
const maxItemsPerPageIndex =
|
|
8220
|
+
const minItemsPerPageIndex = useMemo11(() => getMinItemsPerPageIndex(page, itemsPerPage, page), [itemsPerPage, page]);
|
|
8221
|
+
const maxItemsPerPageIndex = useMemo11(
|
|
7964
8222
|
() => getMaxItemsPerPageIndex(minItemsPerPageIndex, itemsPerPage, rows, page),
|
|
7965
8223
|
[itemsPerPage, minItemsPerPageIndex, page, rows]
|
|
7966
8224
|
);
|
|
7967
|
-
const filteredRows =
|
|
8225
|
+
const filteredRows = useMemo11(() => {
|
|
7968
8226
|
if (onSort && sortColumns?.length > 0) {
|
|
7969
8227
|
onSort?.(sortColumns?.[0]);
|
|
7970
8228
|
}
|
|
7971
8229
|
return !showPaginator || onPageChange ? sortedRows : getPaginatedNodes(sortedRows, uniqueRowId, minItemsPerPageIndex, maxItemsPerPageIndex + 1);
|
|
7972
8230
|
}, [sortedRows, minItemsPerPageIndex, maxItemsPerPageIndex]);
|
|
7973
|
-
return /* @__PURE__ */
|
|
7974
|
-
/* @__PURE__ */
|
|
8231
|
+
return /* @__PURE__ */ jsx45(ThemeProvider18, { theme: colorsTheme.dataGrid, children: /* @__PURE__ */ jsxs31(DataGridContainer, { paginatorRendered: showPaginator && (totalItems ?? rows.length) > itemsPerPage, children: [
|
|
8232
|
+
/* @__PURE__ */ jsx45(
|
|
7975
8233
|
DataGrid,
|
|
7976
8234
|
{
|
|
7977
8235
|
columns: reorderedColumns,
|
|
@@ -7990,7 +8248,7 @@ var DxcDataGrid = ({
|
|
|
7990
8248
|
className: "fill-grid"
|
|
7991
8249
|
}
|
|
7992
8250
|
),
|
|
7993
|
-
showPaginator && (totalItems ?? rows.length) > itemsPerPage && /* @__PURE__ */
|
|
8251
|
+
showPaginator && (itemsPerPageOptions?.some((itemsPerPage2) => (totalItems ?? rows.length) > itemsPerPage2) || (totalItems ?? rows.length) > itemsPerPage) && /* @__PURE__ */ jsx45(
|
|
7994
8252
|
Paginator_default,
|
|
7995
8253
|
{
|
|
7996
8254
|
totalItems: totalItems ?? rows.length,
|
|
@@ -8009,28 +8267,28 @@ var DataGrid_default = DxcDataGrid;
|
|
|
8009
8267
|
|
|
8010
8268
|
// src/date-input/DateInput.tsx
|
|
8011
8269
|
import {
|
|
8012
|
-
useState as
|
|
8270
|
+
useState as useState23,
|
|
8013
8271
|
useRef as useRef12,
|
|
8014
8272
|
useEffect as useEffect13,
|
|
8015
|
-
useId as
|
|
8273
|
+
useId as useId12,
|
|
8016
8274
|
useCallback as useCallback7,
|
|
8017
|
-
useContext as
|
|
8275
|
+
useContext as useContext30,
|
|
8018
8276
|
forwardRef as forwardRef7
|
|
8019
8277
|
} from "react";
|
|
8020
8278
|
import dayjs3 from "dayjs";
|
|
8021
|
-
import
|
|
8279
|
+
import styled45, { ThemeProvider as ThemeProvider20 } from "styled-components";
|
|
8022
8280
|
import * as Popover4 from "@radix-ui/react-popover";
|
|
8023
8281
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
8024
8282
|
|
|
8025
8283
|
// src/date-input/DatePicker.tsx
|
|
8026
|
-
import { memo as memo7, useContext as
|
|
8284
|
+
import { memo as memo7, useContext as useContext27, useState as useState21 } from "react";
|
|
8027
8285
|
import dayjs2 from "dayjs";
|
|
8028
|
-
import
|
|
8286
|
+
import styled41 from "styled-components";
|
|
8029
8287
|
|
|
8030
8288
|
// src/date-input/Calendar.tsx
|
|
8031
|
-
import { useContext as
|
|
8032
|
-
import
|
|
8033
|
-
import { jsx as
|
|
8289
|
+
import { useContext as useContext26, useState as useState19, useMemo as useMemo12, useEffect as useEffect9, useId as useId9, memo as memo5 } from "react";
|
|
8290
|
+
import styled39 from "styled-components";
|
|
8291
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8034
8292
|
var getDays = (innerDate) => {
|
|
8035
8293
|
const monthDayCells = [];
|
|
8036
8294
|
const lastMonthNumberOfDays = innerDate.set("month", innerDate.get("month") - 1).endOf("month");
|
|
@@ -8072,11 +8330,11 @@ var Calendar = ({
|
|
|
8072
8330
|
onDaySelect,
|
|
8073
8331
|
today: today2
|
|
8074
8332
|
}) => {
|
|
8075
|
-
const [dateToFocus, setDateToFocus] =
|
|
8076
|
-
const [isFocusable, setIsFocusable] =
|
|
8077
|
-
const id =
|
|
8078
|
-
const translatedLabels =
|
|
8079
|
-
const dayCells =
|
|
8333
|
+
const [dateToFocus, setDateToFocus] = useState19(getDateToFocus(selectedDate, innerDate, today2));
|
|
8334
|
+
const [isFocusable, setIsFocusable] = useState19(false);
|
|
8335
|
+
const id = useId9();
|
|
8336
|
+
const translatedLabels = useContext26(HalstackLanguageContext);
|
|
8337
|
+
const dayCells = useMemo12(() => getDays(innerDate), [innerDate]);
|
|
8080
8338
|
const onDateClickHandler = (date) => {
|
|
8081
8339
|
const newDate = innerDate.set("month", date.month).set("date", date.day);
|
|
8082
8340
|
onDaySelect(newDate);
|
|
@@ -8170,9 +8428,9 @@ var Calendar = ({
|
|
|
8170
8428
|
break;
|
|
8171
8429
|
}
|
|
8172
8430
|
};
|
|
8173
|
-
return /* @__PURE__ */
|
|
8174
|
-
/* @__PURE__ */
|
|
8175
|
-
/* @__PURE__ */
|
|
8431
|
+
return /* @__PURE__ */ jsxs32(CalendarContainer, { role: "grid", children: [
|
|
8432
|
+
/* @__PURE__ */ jsx46(CalendarHeaderRow, { role: "row", children: translatedLabels.calendar.daysShort.map((weekDay) => /* @__PURE__ */ jsx46(WeekHeaderCell, { role: "columnheader", children: weekDay }, weekDay)) }),
|
|
8433
|
+
/* @__PURE__ */ jsx46(MonthContainer, { onBlur: handleOnBlur, role: "rowgroup", children: divideDaysIntoWeeks(dayCells, translatedLabels.calendar.daysShort.length).map((week, rowIndex) => /* @__PURE__ */ jsx46(WeekContainer, { role: "row", children: week.map((date) => /* @__PURE__ */ jsx46(
|
|
8176
8434
|
DayCellButton,
|
|
8177
8435
|
{
|
|
8178
8436
|
id: `${id}_day_${date.day}_month${date.month}`,
|
|
@@ -8191,7 +8449,7 @@ var Calendar = ({
|
|
|
8191
8449
|
)) }, `${id}_week_${rowIndex}`)) })
|
|
8192
8450
|
] });
|
|
8193
8451
|
};
|
|
8194
|
-
var CalendarContainer =
|
|
8452
|
+
var CalendarContainer = styled39.div`
|
|
8195
8453
|
box-sizing: border-box;
|
|
8196
8454
|
display: flex;
|
|
8197
8455
|
flex-direction: column;
|
|
@@ -8203,34 +8461,34 @@ var CalendarContainer = styled38.div`
|
|
|
8203
8461
|
color: ${(props) => props.theme.dateInput.pickerFontColor};
|
|
8204
8462
|
font-weight: ${(props) => props.theme.dateInput.pickerFontWeight};
|
|
8205
8463
|
`;
|
|
8206
|
-
var CalendarHeaderRow =
|
|
8464
|
+
var CalendarHeaderRow = styled39.div`
|
|
8207
8465
|
display: flex;
|
|
8208
8466
|
flex-direction: row;
|
|
8209
8467
|
flex-wrap: nowrap;
|
|
8210
8468
|
justify-content: space-between;
|
|
8211
8469
|
align-items: center;
|
|
8212
8470
|
`;
|
|
8213
|
-
var WeekHeaderCell =
|
|
8471
|
+
var WeekHeaderCell = styled39.span`
|
|
8214
8472
|
display: flex;
|
|
8215
8473
|
align-items: center;
|
|
8216
8474
|
justify-content: center;
|
|
8217
8475
|
width: 36px;
|
|
8218
8476
|
height: 36px;
|
|
8219
8477
|
`;
|
|
8220
|
-
var MonthContainer =
|
|
8478
|
+
var MonthContainer = styled39.div`
|
|
8221
8479
|
box-sizing: border-box;
|
|
8222
8480
|
display: flex;
|
|
8223
8481
|
gap: 4px;
|
|
8224
8482
|
flex-direction: column;
|
|
8225
8483
|
justify-content: space-between;
|
|
8226
8484
|
`;
|
|
8227
|
-
var WeekContainer =
|
|
8485
|
+
var WeekContainer = styled39.div`
|
|
8228
8486
|
box-sizing: border-box;
|
|
8229
8487
|
display: flex;
|
|
8230
8488
|
gap: 4px;
|
|
8231
8489
|
justify-content: space-between;
|
|
8232
8490
|
`;
|
|
8233
|
-
var DayCellButton =
|
|
8491
|
+
var DayCellButton = styled39.button`
|
|
8234
8492
|
display: inline-flex;
|
|
8235
8493
|
justify-content: center;
|
|
8236
8494
|
align-items: center;
|
|
@@ -8265,9 +8523,9 @@ var Calendar_default = memo5(Calendar);
|
|
|
8265
8523
|
|
|
8266
8524
|
// src/date-input/YearPicker.tsx
|
|
8267
8525
|
import dayjs from "dayjs";
|
|
8268
|
-
import { useEffect as useEffect10, useId as
|
|
8269
|
-
import
|
|
8270
|
-
import { jsx as
|
|
8526
|
+
import { useEffect as useEffect10, useId as useId10, useState as useState20, memo as memo6 } from "react";
|
|
8527
|
+
import styled40 from "styled-components";
|
|
8528
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
8271
8529
|
var getYearsArray = () => {
|
|
8272
8530
|
const yearList2 = [];
|
|
8273
8531
|
for (let i = 1899; i <= 2100; i++) {
|
|
@@ -8277,8 +8535,8 @@ var getYearsArray = () => {
|
|
|
8277
8535
|
};
|
|
8278
8536
|
var yearList = getYearsArray();
|
|
8279
8537
|
var YearPicker = ({ onYearSelect, selectedDate, today: today2 }) => {
|
|
8280
|
-
const id =
|
|
8281
|
-
const [yearToFocus, setYearToFocus] =
|
|
8538
|
+
const id = useId10();
|
|
8539
|
+
const [yearToFocus, setYearToFocus] = useState20(selectedDate ? selectedDate.get("year") : dayjs().get("year"));
|
|
8282
8540
|
useEffect10(() => {
|
|
8283
8541
|
const yearToFocusEl = document.getElementById(`${id}_year_${yearToFocus}`);
|
|
8284
8542
|
yearToFocusEl?.scrollIntoView?.({ block: "nearest", inline: "start" });
|
|
@@ -8296,7 +8554,7 @@ var YearPicker = ({ onYearSelect, selectedDate, today: today2 }) => {
|
|
|
8296
8554
|
break;
|
|
8297
8555
|
}
|
|
8298
8556
|
};
|
|
8299
|
-
return /* @__PURE__ */
|
|
8557
|
+
return /* @__PURE__ */ jsx47(YearPickerContainer, { role: "listbox", "aria-label": "Year Picker", children: yearList.map((year2) => /* @__PURE__ */ jsx47(
|
|
8300
8558
|
YearPickerButton,
|
|
8301
8559
|
{
|
|
8302
8560
|
"aria-label": year2.toString(),
|
|
@@ -8315,7 +8573,7 @@ var YearPicker = ({ onYearSelect, selectedDate, today: today2 }) => {
|
|
|
8315
8573
|
year2
|
|
8316
8574
|
)) });
|
|
8317
8575
|
};
|
|
8318
|
-
var YearPickerContainer =
|
|
8576
|
+
var YearPickerContainer = styled40.div`
|
|
8319
8577
|
box-sizing: border-box;
|
|
8320
8578
|
display: flex;
|
|
8321
8579
|
flex-direction: column;
|
|
@@ -8326,7 +8584,7 @@ var YearPickerContainer = styled39.div`
|
|
|
8326
8584
|
height: 312px;
|
|
8327
8585
|
padding: 2px 8px 8px 8px;
|
|
8328
8586
|
`;
|
|
8329
|
-
var YearPickerButton =
|
|
8587
|
+
var YearPickerButton = styled40.button`
|
|
8330
8588
|
display: flex;
|
|
8331
8589
|
align-items: center;
|
|
8332
8590
|
justify-content: center;
|
|
@@ -8369,13 +8627,13 @@ var YearPickerButton = styled39.button`
|
|
|
8369
8627
|
var YearPicker_default = memo6(YearPicker);
|
|
8370
8628
|
|
|
8371
8629
|
// src/date-input/DatePicker.tsx
|
|
8372
|
-
import { jsx as
|
|
8630
|
+
import { jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8373
8631
|
var today = dayjs2();
|
|
8374
8632
|
var DatePicker = ({ date, onDateSelect, id }) => {
|
|
8375
|
-
const [innerDate, setInnerDate] =
|
|
8376
|
-
const [content, setContent] =
|
|
8633
|
+
const [innerDate, setInnerDate] = useState21(date?.isValid() ? date : dayjs2());
|
|
8634
|
+
const [content, setContent] = useState21("calendar");
|
|
8377
8635
|
const selectedDate = date?.isValid() ? date : dayjs2(null);
|
|
8378
|
-
const translatedLabels =
|
|
8636
|
+
const translatedLabels = useContext27(HalstackLanguageContext);
|
|
8379
8637
|
const handleDateSelect = (chosenDate) => {
|
|
8380
8638
|
setInnerDate(chosenDate);
|
|
8381
8639
|
onDateSelect(chosenDate);
|
|
@@ -8387,41 +8645,41 @@ var DatePicker = ({ date, onDateSelect, id }) => {
|
|
|
8387
8645
|
const handleMonthChange = (chosenDate) => {
|
|
8388
8646
|
setInnerDate(chosenDate);
|
|
8389
8647
|
};
|
|
8390
|
-
return /* @__PURE__ */
|
|
8391
|
-
/* @__PURE__ */
|
|
8392
|
-
/* @__PURE__ */
|
|
8648
|
+
return /* @__PURE__ */ jsxs33(DatePickerContainer, { id, children: [
|
|
8649
|
+
/* @__PURE__ */ jsxs33(PickerHeader, { children: [
|
|
8650
|
+
/* @__PURE__ */ jsx48(Tooltip, { label: translatedLabels.calendar.previousMonthTitle, children: /* @__PURE__ */ jsx48(
|
|
8393
8651
|
HeaderButton,
|
|
8394
8652
|
{
|
|
8395
8653
|
"aria-label": translatedLabels.calendar.previousMonthTitle,
|
|
8396
8654
|
onClick: () => handleMonthChange(innerDate.set("month", innerDate.get("month") - 1)),
|
|
8397
|
-
children: /* @__PURE__ */
|
|
8655
|
+
children: /* @__PURE__ */ jsx48(Icon_default, { icon: "keyboard_arrow_left" })
|
|
8398
8656
|
}
|
|
8399
8657
|
) }),
|
|
8400
|
-
/* @__PURE__ */
|
|
8658
|
+
/* @__PURE__ */ jsxs33(
|
|
8401
8659
|
HeaderYearTrigger,
|
|
8402
8660
|
{
|
|
8403
8661
|
"aria-live": "polite",
|
|
8404
8662
|
onClick: () => setContent((currentContent) => currentContent === "yearPicker" ? "calendar" : "yearPicker"),
|
|
8405
8663
|
children: [
|
|
8406
|
-
/* @__PURE__ */
|
|
8664
|
+
/* @__PURE__ */ jsxs33(HeaderYearTriggerLabel, { children: [
|
|
8407
8665
|
translatedLabels.calendar.months[innerDate.get("month")],
|
|
8408
8666
|
" ",
|
|
8409
8667
|
innerDate.format("YYYY")
|
|
8410
8668
|
] }),
|
|
8411
|
-
/* @__PURE__ */
|
|
8669
|
+
/* @__PURE__ */ jsx48(Icon_default, { icon: content === "yearPicker" ? "arrow_drop_up" : "arrow_drop_down" })
|
|
8412
8670
|
]
|
|
8413
8671
|
}
|
|
8414
8672
|
),
|
|
8415
|
-
/* @__PURE__ */
|
|
8673
|
+
/* @__PURE__ */ jsx48(Tooltip, { label: translatedLabels.calendar.nextMonthTitle, children: /* @__PURE__ */ jsx48(
|
|
8416
8674
|
HeaderButton,
|
|
8417
8675
|
{
|
|
8418
8676
|
"aria-label": translatedLabels.calendar.nextMonthTitle,
|
|
8419
8677
|
onClick: () => handleMonthChange(innerDate.set("month", innerDate.get("month") + 1)),
|
|
8420
|
-
children: /* @__PURE__ */
|
|
8678
|
+
children: /* @__PURE__ */ jsx48(Icon_default, { icon: "keyboard_arrow_right" })
|
|
8421
8679
|
}
|
|
8422
8680
|
) })
|
|
8423
8681
|
] }),
|
|
8424
|
-
content === "calendar" && /* @__PURE__ */
|
|
8682
|
+
content === "calendar" && /* @__PURE__ */ jsx48(
|
|
8425
8683
|
Calendar_default,
|
|
8426
8684
|
{
|
|
8427
8685
|
innerDate,
|
|
@@ -8431,10 +8689,10 @@ var DatePicker = ({ date, onDateSelect, id }) => {
|
|
|
8431
8689
|
today
|
|
8432
8690
|
}
|
|
8433
8691
|
),
|
|
8434
|
-
content === "yearPicker" && /* @__PURE__ */
|
|
8692
|
+
content === "yearPicker" && /* @__PURE__ */ jsx48(YearPicker_default, { selectedDate, onYearSelect: handleOnYearSelect, today })
|
|
8435
8693
|
] });
|
|
8436
8694
|
};
|
|
8437
|
-
var DatePickerContainer =
|
|
8695
|
+
var DatePickerContainer = styled41.div`
|
|
8438
8696
|
padding-top: 16px;
|
|
8439
8697
|
background-color: ${(props) => props.theme.dateInput.pickerBackgroundColor};
|
|
8440
8698
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
@@ -8447,7 +8705,7 @@ var DatePickerContainer = styled40.div`
|
|
|
8447
8705
|
color: ${(props) => props.theme.dateInput.pickerFontColor};
|
|
8448
8706
|
font-weight: ${(props) => props.theme.dateInput.pickerFontWeight};
|
|
8449
8707
|
`;
|
|
8450
|
-
var PickerHeader =
|
|
8708
|
+
var PickerHeader = styled41.div`
|
|
8451
8709
|
box-sizing: border-box;
|
|
8452
8710
|
display: flex;
|
|
8453
8711
|
gap: 8px;
|
|
@@ -8455,7 +8713,7 @@ var PickerHeader = styled40.div`
|
|
|
8455
8713
|
justify-content: space-between;
|
|
8456
8714
|
padding: 0px 16px;
|
|
8457
8715
|
`;
|
|
8458
|
-
var HeaderButton =
|
|
8716
|
+
var HeaderButton = styled41.button`
|
|
8459
8717
|
display: flex;
|
|
8460
8718
|
align-items: center;
|
|
8461
8719
|
justify-content: center;
|
|
@@ -8485,7 +8743,7 @@ var HeaderButton = styled40.button`
|
|
|
8485
8743
|
font-size: 24px;
|
|
8486
8744
|
}
|
|
8487
8745
|
`;
|
|
8488
|
-
var HeaderYearTrigger =
|
|
8746
|
+
var HeaderYearTrigger = styled41(HeaderButton)`
|
|
8489
8747
|
gap: 8px;
|
|
8490
8748
|
height: 40px;
|
|
8491
8749
|
width: 172px;
|
|
@@ -8494,7 +8752,7 @@ var HeaderYearTrigger = styled40(HeaderButton)`
|
|
|
8494
8752
|
font-size: 24px;
|
|
8495
8753
|
}
|
|
8496
8754
|
`;
|
|
8497
|
-
var HeaderYearTriggerLabel =
|
|
8755
|
+
var HeaderYearTriggerLabel = styled41.span`
|
|
8498
8756
|
display: flex;
|
|
8499
8757
|
align-items: center;
|
|
8500
8758
|
justify-content: center;
|
|
@@ -8507,25 +8765,25 @@ var DatePicker_default = memo7(DatePicker);
|
|
|
8507
8765
|
import * as Popover3 from "@radix-ui/react-popover";
|
|
8508
8766
|
import {
|
|
8509
8767
|
forwardRef as forwardRef6,
|
|
8510
|
-
useContext as
|
|
8768
|
+
useContext as useContext29,
|
|
8511
8769
|
useEffect as useEffect12,
|
|
8512
|
-
useId as
|
|
8770
|
+
useId as useId11,
|
|
8513
8771
|
useRef as useRef11,
|
|
8514
|
-
useState as
|
|
8772
|
+
useState as useState22
|
|
8515
8773
|
} from "react";
|
|
8516
|
-
import
|
|
8774
|
+
import styled44, { ThemeProvider as ThemeProvider19 } from "styled-components";
|
|
8517
8775
|
|
|
8518
8776
|
// src/number-input/NumberInputContext.tsx
|
|
8519
8777
|
import { createContext as createContext7 } from "react";
|
|
8520
8778
|
var NumberInputContext_default = createContext7(null);
|
|
8521
8779
|
|
|
8522
8780
|
// src/text-input/Suggestions.tsx
|
|
8523
|
-
import { memo as memo9, useContext as
|
|
8524
|
-
import
|
|
8781
|
+
import { memo as memo9, useContext as useContext28, useEffect as useEffect11, useRef as useRef10 } from "react";
|
|
8782
|
+
import styled43 from "styled-components";
|
|
8525
8783
|
|
|
8526
8784
|
// src/text-input/Suggestion.tsx
|
|
8527
|
-
import { memo as memo8, useMemo as
|
|
8528
|
-
import
|
|
8785
|
+
import { memo as memo8, useMemo as useMemo13 } from "react";
|
|
8786
|
+
import styled42 from "styled-components";
|
|
8529
8787
|
|
|
8530
8788
|
// src/text-input/utils.ts
|
|
8531
8789
|
var sizes4 = {
|
|
@@ -8569,8 +8827,8 @@ var transformSpecialChars = (str) => {
|
|
|
8569
8827
|
};
|
|
8570
8828
|
|
|
8571
8829
|
// src/text-input/Suggestion.tsx
|
|
8572
|
-
import { Fragment as Fragment11, jsx as
|
|
8573
|
-
var SuggestionContainer =
|
|
8830
|
+
import { Fragment as Fragment11, jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8831
|
+
var SuggestionContainer = styled42.li`
|
|
8574
8832
|
display: flex;
|
|
8575
8833
|
padding: 0 0.5rem;
|
|
8576
8834
|
line-height: 1.715em;
|
|
@@ -8585,7 +8843,7 @@ var SuggestionContainer = styled41.li`
|
|
|
8585
8843
|
background-color: ${(props) => props.theme.activeListOptionBackgroundColor};
|
|
8586
8844
|
}
|
|
8587
8845
|
`;
|
|
8588
|
-
var StyledSuggestion =
|
|
8846
|
+
var StyledSuggestion = styled42.span`
|
|
8589
8847
|
width: 100%;
|
|
8590
8848
|
overflow: hidden;
|
|
8591
8849
|
text-overflow: ellipsis;
|
|
@@ -8602,11 +8860,11 @@ var Suggestion = ({
|
|
|
8602
8860
|
visuallyFocused,
|
|
8603
8861
|
highlighted
|
|
8604
8862
|
}) => {
|
|
8605
|
-
const matchedSuggestion =
|
|
8863
|
+
const matchedSuggestion = useMemo13(() => {
|
|
8606
8864
|
const regEx = new RegExp(transformSpecialChars(value), "i");
|
|
8607
8865
|
return { matchedWords: suggestion.match(regEx), noMatchedWords: suggestion.replace(regEx, "") };
|
|
8608
8866
|
}, [value, suggestion]);
|
|
8609
|
-
return /* @__PURE__ */
|
|
8867
|
+
return /* @__PURE__ */ jsx49(
|
|
8610
8868
|
SuggestionContainer,
|
|
8611
8869
|
{
|
|
8612
8870
|
id,
|
|
@@ -8616,8 +8874,8 @@ var Suggestion = ({
|
|
|
8616
8874
|
visuallyFocused,
|
|
8617
8875
|
role: "option",
|
|
8618
8876
|
"aria-selected": visuallyFocused ? true : void 0,
|
|
8619
|
-
children: /* @__PURE__ */
|
|
8620
|
-
/* @__PURE__ */
|
|
8877
|
+
children: /* @__PURE__ */ jsx49(StyledSuggestion, { isLast, visuallyFocused, children: highlighted ? /* @__PURE__ */ jsxs34(Fragment11, { children: [
|
|
8878
|
+
/* @__PURE__ */ jsx49("strong", { children: matchedSuggestion.matchedWords }),
|
|
8621
8879
|
matchedSuggestion.noMatchedWords
|
|
8622
8880
|
] }) : suggestion })
|
|
8623
8881
|
}
|
|
@@ -8626,8 +8884,8 @@ var Suggestion = ({
|
|
|
8626
8884
|
var Suggestion_default = memo8(Suggestion);
|
|
8627
8885
|
|
|
8628
8886
|
// src/text-input/Suggestions.tsx
|
|
8629
|
-
import { jsx as
|
|
8630
|
-
var SuggestionsContainer =
|
|
8887
|
+
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
8888
|
+
var SuggestionsContainer = styled43.ul`
|
|
8631
8889
|
box-sizing: border-box;
|
|
8632
8890
|
max-height: 304px;
|
|
8633
8891
|
overflow-y: auto;
|
|
@@ -8645,13 +8903,13 @@ var SuggestionsContainer = styled42.ul`
|
|
|
8645
8903
|
font-style: ${(props) => props.theme.listOptionFontStyle};
|
|
8646
8904
|
font-weight: ${(props) => props.theme.listOptionFontWeight};
|
|
8647
8905
|
`;
|
|
8648
|
-
var SuggestionsSystemMessage =
|
|
8906
|
+
var SuggestionsSystemMessage = styled43.span`
|
|
8649
8907
|
display: flex;
|
|
8650
8908
|
padding: 0.25rem 1rem;
|
|
8651
8909
|
color: ${(props) => props.theme.systemMessageFontColor};
|
|
8652
8910
|
line-height: 1.715em;
|
|
8653
8911
|
`;
|
|
8654
|
-
var SuggestionsErrorIcon =
|
|
8912
|
+
var SuggestionsErrorIcon = styled43.span`
|
|
8655
8913
|
display: flex;
|
|
8656
8914
|
flex-wrap: wrap;
|
|
8657
8915
|
align-content: center;
|
|
@@ -8661,7 +8919,7 @@ var SuggestionsErrorIcon = styled42.span`
|
|
|
8661
8919
|
font-size: 18px;
|
|
8662
8920
|
color: ${(props) => props.theme.errorIconColor};
|
|
8663
8921
|
`;
|
|
8664
|
-
var SuggestionsError =
|
|
8922
|
+
var SuggestionsError = styled43.span`
|
|
8665
8923
|
display: flex;
|
|
8666
8924
|
padding: 0.25rem 1rem;
|
|
8667
8925
|
align-items: center;
|
|
@@ -8679,7 +8937,7 @@ var Suggestions = ({
|
|
|
8679
8937
|
suggestionOnClick,
|
|
8680
8938
|
styles
|
|
8681
8939
|
}) => {
|
|
8682
|
-
const translatedLabels =
|
|
8940
|
+
const translatedLabels = useContext28(HalstackLanguageContext);
|
|
8683
8941
|
const listboxRef = useRef10(null);
|
|
8684
8942
|
useEffect11(() => {
|
|
8685
8943
|
const visualFocusedOptionEl = listboxRef?.current?.querySelectorAll("[role='option']")[visualFocusIndex];
|
|
@@ -8688,7 +8946,7 @@ var Suggestions = ({
|
|
|
8688
8946
|
inline: "start"
|
|
8689
8947
|
});
|
|
8690
8948
|
}, [visualFocusIndex]);
|
|
8691
|
-
return /* @__PURE__ */
|
|
8949
|
+
return /* @__PURE__ */ jsxs35(
|
|
8692
8950
|
SuggestionsContainer,
|
|
8693
8951
|
{
|
|
8694
8952
|
id,
|
|
@@ -8701,7 +8959,7 @@ var Suggestions = ({
|
|
|
8701
8959
|
style: styles,
|
|
8702
8960
|
"aria-label": "Suggestions",
|
|
8703
8961
|
children: [
|
|
8704
|
-
!isSearching && !searchHasErrors && suggestions.length > 0 && suggestions.map((suggestion, index) => /* @__PURE__ */
|
|
8962
|
+
!isSearching && !searchHasErrors && suggestions.length > 0 && suggestions.map((suggestion, index) => /* @__PURE__ */ jsx50(
|
|
8705
8963
|
Suggestion_default,
|
|
8706
8964
|
{
|
|
8707
8965
|
id: `${id}-suggestion-${index}`,
|
|
@@ -8714,9 +8972,9 @@ var Suggestions = ({
|
|
|
8714
8972
|
},
|
|
8715
8973
|
`${id}-suggestion-${index}`
|
|
8716
8974
|
)),
|
|
8717
|
-
isSearching && /* @__PURE__ */
|
|
8718
|
-
searchHasErrors && /* @__PURE__ */
|
|
8719
|
-
/* @__PURE__ */
|
|
8975
|
+
isSearching && /* @__PURE__ */ jsx50(SuggestionsSystemMessage, { role: "option", children: translatedLabels.textInput.searchingMessage }),
|
|
8976
|
+
searchHasErrors && /* @__PURE__ */ jsx50("span", { role: "option", children: /* @__PURE__ */ jsxs35(SuggestionsError, { role: "alert", "aria-live": "assertive", children: [
|
|
8977
|
+
/* @__PURE__ */ jsx50(SuggestionsErrorIcon, { children: /* @__PURE__ */ jsx50(Icon_default, { icon: "filled_error" }) }),
|
|
8720
8978
|
translatedLabels.textInput.fetchingDataErrorMessage
|
|
8721
8979
|
] }) })
|
|
8722
8980
|
]
|
|
@@ -8726,8 +8984,8 @@ var Suggestions = ({
|
|
|
8726
8984
|
var Suggestions_default = memo9(Suggestions);
|
|
8727
8985
|
|
|
8728
8986
|
// src/text-input/TextInput.tsx
|
|
8729
|
-
import { Fragment as Fragment12, jsx as
|
|
8730
|
-
var TextInputContainer =
|
|
8987
|
+
import { Fragment as Fragment12, jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
8988
|
+
var TextInputContainer = styled44.div`
|
|
8731
8989
|
box-sizing: border-box;
|
|
8732
8990
|
display: flex;
|
|
8733
8991
|
flex-direction: column;
|
|
@@ -8740,7 +8998,7 @@ var TextInputContainer = styled43.div`
|
|
|
8740
8998
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
8741
8999
|
font-family: ${(props) => props.theme.fontFamily};
|
|
8742
9000
|
`;
|
|
8743
|
-
var Label4 =
|
|
9001
|
+
var Label4 = styled44.label`
|
|
8744
9002
|
color: ${(props) => props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor};
|
|
8745
9003
|
font-size: ${(props) => props.theme.labelFontSize};
|
|
8746
9004
|
font-style: ${(props) => props.theme.labelFontStyle};
|
|
@@ -8748,10 +9006,10 @@ var Label4 = styled43.label`
|
|
|
8748
9006
|
line-height: ${(props) => props.theme.labelLineHeight};
|
|
8749
9007
|
${(props) => !props.hasHelperText && `margin-bottom: 0.25rem`}
|
|
8750
9008
|
`;
|
|
8751
|
-
var OptionalLabel2 =
|
|
9009
|
+
var OptionalLabel2 = styled44.span`
|
|
8752
9010
|
font-weight: ${(props) => props.theme.optionalLabelFontWeight};
|
|
8753
9011
|
`;
|
|
8754
|
-
var HelperText2 =
|
|
9012
|
+
var HelperText2 = styled44.span`
|
|
8755
9013
|
color: ${(props) => props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor};
|
|
8756
9014
|
font-size: ${(props) => props.theme.helperTextFontSize};
|
|
8757
9015
|
font-style: ${(props) => props.theme.helperTextFontStyle};
|
|
@@ -8759,7 +9017,7 @@ var HelperText2 = styled43.span`
|
|
|
8759
9017
|
line-height: ${(props) => props.theme.helperTextLineHeight};
|
|
8760
9018
|
margin-bottom: 0.25rem;
|
|
8761
9019
|
`;
|
|
8762
|
-
var InputContainer =
|
|
9020
|
+
var InputContainer = styled44.div`
|
|
8763
9021
|
position: relative;
|
|
8764
9022
|
display: flex;
|
|
8765
9023
|
align-items: center;
|
|
@@ -8785,7 +9043,7 @@ var InputContainer = styled43.div`
|
|
|
8785
9043
|
}
|
|
8786
9044
|
` : "cursor: not-allowed;"};
|
|
8787
9045
|
`;
|
|
8788
|
-
var Input =
|
|
9046
|
+
var Input = styled44.input`
|
|
8789
9047
|
height: calc(2.5rem - 2px);
|
|
8790
9048
|
width: 100%;
|
|
8791
9049
|
background: none;
|
|
@@ -8802,12 +9060,13 @@ var Input = styled43.input`
|
|
|
8802
9060
|
font-weight: ${(props) => props.theme.valueFontWeight};
|
|
8803
9061
|
line-height: 1.5em;
|
|
8804
9062
|
${(props) => props.disabled && `cursor: not-allowed;`}
|
|
9063
|
+
${({ alignment }) => `text-align: ${alignment}`};
|
|
8805
9064
|
|
|
8806
9065
|
::placeholder {
|
|
8807
9066
|
color: ${(props) => props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor};
|
|
8808
9067
|
}
|
|
8809
9068
|
`;
|
|
8810
|
-
var Prefix =
|
|
9069
|
+
var Prefix = styled44.span`
|
|
8811
9070
|
height: 1.5rem;
|
|
8812
9071
|
margin-left: 0.25rem;
|
|
8813
9072
|
padding-right: ${(props) => props.theme.prefixDividerPaddingRight};
|
|
@@ -8819,7 +9078,7 @@ var Prefix = styled43.span`
|
|
|
8819
9078
|
line-height: 1.5rem;
|
|
8820
9079
|
pointer-events: none;
|
|
8821
9080
|
`;
|
|
8822
|
-
var Suffix =
|
|
9081
|
+
var Suffix = styled44.span`
|
|
8823
9082
|
height: 1.5rem;
|
|
8824
9083
|
margin: 0 0.25rem;
|
|
8825
9084
|
padding-left: ${(props) => props.theme.suffixDividerPaddingLeft};
|
|
@@ -8831,7 +9090,7 @@ var Suffix = styled43.span`
|
|
|
8831
9090
|
line-height: 1.5rem;
|
|
8832
9091
|
pointer-events: none;
|
|
8833
9092
|
`;
|
|
8834
|
-
var ErrorIcon2 =
|
|
9093
|
+
var ErrorIcon2 = styled44.span`
|
|
8835
9094
|
display: flex;
|
|
8836
9095
|
flex-wrap: wrap;
|
|
8837
9096
|
align-content: center;
|
|
@@ -8841,7 +9100,7 @@ var ErrorIcon2 = styled43.span`
|
|
|
8841
9100
|
font-size: 18px;
|
|
8842
9101
|
color: ${(props) => props.theme.errorIconColor};
|
|
8843
9102
|
`;
|
|
8844
|
-
var ErrorMessageContainer =
|
|
9103
|
+
var ErrorMessageContainer = styled44.span`
|
|
8845
9104
|
min-height: 1.5em;
|
|
8846
9105
|
color: ${(props) => props.theme.errorMessageColor};
|
|
8847
9106
|
font-size: 0.75rem;
|
|
@@ -8849,9 +9108,10 @@ var ErrorMessageContainer = styled43.span`
|
|
|
8849
9108
|
line-height: 1.5em;
|
|
8850
9109
|
margin-top: 0.25rem;
|
|
8851
9110
|
`;
|
|
8852
|
-
var AutosuggestWrapper = ({ condition, wrapper, children }) => /* @__PURE__ */
|
|
9111
|
+
var AutosuggestWrapper = ({ condition, wrapper, children }) => /* @__PURE__ */ jsx51(Fragment12, { children: condition ? wrapper(children) : children });
|
|
8853
9112
|
var DxcTextInput = forwardRef6(
|
|
8854
9113
|
({
|
|
9114
|
+
alignment = "left",
|
|
8855
9115
|
label,
|
|
8856
9116
|
name = "",
|
|
8857
9117
|
defaultValue = "",
|
|
@@ -8878,21 +9138,21 @@ var DxcTextInput = forwardRef6(
|
|
|
8878
9138
|
tabIndex = 0,
|
|
8879
9139
|
ariaLabel = "Text input"
|
|
8880
9140
|
}, ref) => {
|
|
8881
|
-
const inputId = `input-${
|
|
9141
|
+
const inputId = `input-${useId11()}`;
|
|
8882
9142
|
const autosuggestId = `suggestions-${inputId}`;
|
|
8883
9143
|
const errorId = `error-${inputId}`;
|
|
8884
|
-
const colorsTheme =
|
|
8885
|
-
const translatedLabels =
|
|
8886
|
-
const numberInputContext =
|
|
9144
|
+
const colorsTheme = useContext29(HalstackContext);
|
|
9145
|
+
const translatedLabels = useContext29(HalstackLanguageContext);
|
|
9146
|
+
const numberInputContext = useContext29(NumberInputContext_default);
|
|
8887
9147
|
const inputRef = useRef11(null);
|
|
8888
9148
|
const inputContainerRef = useRef11(null);
|
|
8889
9149
|
const actionRef = useRef11(null);
|
|
8890
|
-
const [innerValue, setInnerValue] =
|
|
8891
|
-
const [isOpen, changeIsOpen] =
|
|
8892
|
-
const [isSearching, changeIsSearching] =
|
|
8893
|
-
const [isAutosuggestError, changeIsAutosuggestError] =
|
|
8894
|
-
const [filteredSuggestions, changeFilteredSuggestions] =
|
|
8895
|
-
const [visualFocusIndex, changeVisualFocusIndex] =
|
|
9150
|
+
const [innerValue, setInnerValue] = useState22(defaultValue);
|
|
9151
|
+
const [isOpen, changeIsOpen] = useState22(false);
|
|
9152
|
+
const [isSearching, changeIsSearching] = useState22(false);
|
|
9153
|
+
const [isAutosuggestError, changeIsAutosuggestError] = useState22(false);
|
|
9154
|
+
const [filteredSuggestions, changeFilteredSuggestions] = useState22([]);
|
|
9155
|
+
const [visualFocusIndex, changeVisualFocusIndex] = useState22(-1);
|
|
8896
9156
|
const width = useWidth_default(inputContainerRef.current);
|
|
8897
9157
|
const getNumberErrorMessage = (checkedValue) => numberInputContext?.minNumber != null && checkedValue < numberInputContext?.minNumber ? translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage?.(numberInputContext.minNumber) : numberInputContext?.maxNumber != null && checkedValue > numberInputContext?.maxNumber ? translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage?.(numberInputContext.maxNumber) : void 0;
|
|
8898
9158
|
const openSuggestions = () => {
|
|
@@ -9138,19 +9398,19 @@ var DxcTextInput = forwardRef6(
|
|
|
9138
9398
|
}
|
|
9139
9399
|
return void 0;
|
|
9140
9400
|
}, [value, innerValue, suggestions, numberInputContext]);
|
|
9141
|
-
return /* @__PURE__ */
|
|
9142
|
-
label && /* @__PURE__ */
|
|
9401
|
+
return /* @__PURE__ */ jsx51(ThemeProvider19, { theme: colorsTheme.textInput, children: /* @__PURE__ */ jsxs36(TextInputContainer, { margin, size, ref, children: [
|
|
9402
|
+
label && /* @__PURE__ */ jsxs36(Label4, { htmlFor: inputId, disabled, hasHelperText: !!helperText, children: [
|
|
9143
9403
|
label,
|
|
9144
9404
|
" ",
|
|
9145
|
-
optional && /* @__PURE__ */
|
|
9405
|
+
optional && /* @__PURE__ */ jsx51(OptionalLabel2, { children: translatedLabels.formFields.optionalLabel })
|
|
9146
9406
|
] }),
|
|
9147
|
-
helperText && /* @__PURE__ */
|
|
9148
|
-
/* @__PURE__ */
|
|
9407
|
+
helperText && /* @__PURE__ */ jsx51(HelperText2, { disabled, children: helperText }),
|
|
9408
|
+
/* @__PURE__ */ jsx51(
|
|
9149
9409
|
AutosuggestWrapper,
|
|
9150
9410
|
{
|
|
9151
9411
|
condition: hasSuggestions(suggestions),
|
|
9152
|
-
wrapper: (children) => /* @__PURE__ */
|
|
9153
|
-
/* @__PURE__ */
|
|
9412
|
+
wrapper: (children) => /* @__PURE__ */ jsxs36(Popover3.Root, { open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError), children: [
|
|
9413
|
+
/* @__PURE__ */ jsx51(
|
|
9154
9414
|
Popover3.Trigger,
|
|
9155
9415
|
{
|
|
9156
9416
|
asChild: true,
|
|
@@ -9161,7 +9421,7 @@ var DxcTextInput = forwardRef6(
|
|
|
9161
9421
|
children
|
|
9162
9422
|
}
|
|
9163
9423
|
),
|
|
9164
|
-
/* @__PURE__ */
|
|
9424
|
+
/* @__PURE__ */ jsx51(Popover3.Portal, { children: /* @__PURE__ */ jsx51(
|
|
9165
9425
|
Popover3.Content,
|
|
9166
9426
|
{
|
|
9167
9427
|
sideOffset: 5,
|
|
@@ -9172,7 +9432,7 @@ var DxcTextInput = forwardRef6(
|
|
|
9172
9432
|
onCloseAutoFocus: (event) => {
|
|
9173
9433
|
event.preventDefault();
|
|
9174
9434
|
},
|
|
9175
|
-
children: /* @__PURE__ */
|
|
9435
|
+
children: /* @__PURE__ */ jsx51(
|
|
9176
9436
|
Suggestions_default,
|
|
9177
9437
|
{
|
|
9178
9438
|
id: autosuggestId,
|
|
@@ -9192,7 +9452,7 @@ var DxcTextInput = forwardRef6(
|
|
|
9192
9452
|
}
|
|
9193
9453
|
) })
|
|
9194
9454
|
] }),
|
|
9195
|
-
children: /* @__PURE__ */
|
|
9455
|
+
children: /* @__PURE__ */ jsxs36(
|
|
9196
9456
|
InputContainer,
|
|
9197
9457
|
{
|
|
9198
9458
|
error: !!error,
|
|
@@ -9202,11 +9462,12 @@ var DxcTextInput = forwardRef6(
|
|
|
9202
9462
|
onMouseDown: handleInputContainerOnMouseDown,
|
|
9203
9463
|
ref: inputContainerRef,
|
|
9204
9464
|
children: [
|
|
9205
|
-
prefix && /* @__PURE__ */
|
|
9206
|
-
/* @__PURE__ */
|
|
9207
|
-
/* @__PURE__ */
|
|
9465
|
+
prefix && /* @__PURE__ */ jsx51(Prefix, { disabled, children: prefix }),
|
|
9466
|
+
/* @__PURE__ */ jsxs36(Flex_default, { gap: "0.25rem", alignItems: "center", grow: 1, children: [
|
|
9467
|
+
/* @__PURE__ */ jsx51(
|
|
9208
9468
|
Input,
|
|
9209
9469
|
{
|
|
9470
|
+
alignment,
|
|
9210
9471
|
id: inputId,
|
|
9211
9472
|
name,
|
|
9212
9473
|
value: value ?? innerValue,
|
|
@@ -9240,8 +9501,8 @@ var DxcTextInput = forwardRef6(
|
|
|
9240
9501
|
"aria-label": label ? void 0 : ariaLabel
|
|
9241
9502
|
}
|
|
9242
9503
|
),
|
|
9243
|
-
!disabled && error && /* @__PURE__ */
|
|
9244
|
-
!disabled && !readOnly && clearable && (value ?? innerValue).length > 0 && /* @__PURE__ */
|
|
9504
|
+
!disabled && error && /* @__PURE__ */ jsx51(ErrorIcon2, { "aria-hidden": "true", children: /* @__PURE__ */ jsx51(Icon_default, { icon: "filled_error" }) }),
|
|
9505
|
+
!disabled && !readOnly && clearable && (value ?? innerValue).length > 0 && /* @__PURE__ */ jsx51(
|
|
9245
9506
|
ActionIcon_default,
|
|
9246
9507
|
{
|
|
9247
9508
|
onClick: handleClearActionOnClick,
|
|
@@ -9250,8 +9511,8 @@ var DxcTextInput = forwardRef6(
|
|
|
9250
9511
|
title: translatedLabels.textInput.clearFieldActionTitle
|
|
9251
9512
|
}
|
|
9252
9513
|
),
|
|
9253
|
-
numberInputContext?.typeNumber === "number" && numberInputContext?.showControls && /* @__PURE__ */
|
|
9254
|
-
/* @__PURE__ */
|
|
9514
|
+
numberInputContext?.typeNumber === "number" && numberInputContext?.showControls && /* @__PURE__ */ jsxs36(Fragment12, { children: [
|
|
9515
|
+
/* @__PURE__ */ jsx51(
|
|
9255
9516
|
ActionIcon_default,
|
|
9256
9517
|
{
|
|
9257
9518
|
onClick: !readOnly ? handleDecrementActionOnClick : void 0,
|
|
@@ -9262,7 +9523,7 @@ var DxcTextInput = forwardRef6(
|
|
|
9262
9523
|
disabled
|
|
9263
9524
|
}
|
|
9264
9525
|
),
|
|
9265
|
-
/* @__PURE__ */
|
|
9526
|
+
/* @__PURE__ */ jsx51(
|
|
9266
9527
|
ActionIcon_default,
|
|
9267
9528
|
{
|
|
9268
9529
|
onClick: !readOnly ? handleIncrementActionOnClick : void 0,
|
|
@@ -9274,7 +9535,7 @@ var DxcTextInput = forwardRef6(
|
|
|
9274
9535
|
}
|
|
9275
9536
|
)
|
|
9276
9537
|
] }),
|
|
9277
|
-
action && /* @__PURE__ */
|
|
9538
|
+
action && /* @__PURE__ */ jsx51(
|
|
9278
9539
|
ActionIcon_default,
|
|
9279
9540
|
{
|
|
9280
9541
|
onClick: !readOnly ? action.onClick : void 0,
|
|
@@ -9286,20 +9547,20 @@ var DxcTextInput = forwardRef6(
|
|
|
9286
9547
|
}
|
|
9287
9548
|
)
|
|
9288
9549
|
] }),
|
|
9289
|
-
suffix && /* @__PURE__ */
|
|
9550
|
+
suffix && /* @__PURE__ */ jsx51(Suffix, { disabled, children: suffix })
|
|
9290
9551
|
]
|
|
9291
9552
|
}
|
|
9292
9553
|
)
|
|
9293
9554
|
}
|
|
9294
9555
|
),
|
|
9295
|
-
!disabled && typeof error === "string" && /* @__PURE__ */
|
|
9556
|
+
!disabled && typeof error === "string" && /* @__PURE__ */ jsx51(ErrorMessageContainer, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
|
|
9296
9557
|
] }) });
|
|
9297
9558
|
}
|
|
9298
9559
|
);
|
|
9299
9560
|
var TextInput_default = DxcTextInput;
|
|
9300
9561
|
|
|
9301
9562
|
// src/date-input/DateInput.tsx
|
|
9302
|
-
import { jsx as
|
|
9563
|
+
import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
9303
9564
|
dayjs3.extend(customParseFormat);
|
|
9304
9565
|
var SIDEOFFSET = 4;
|
|
9305
9566
|
var getValueForPicker = (value, format) => dayjs3(value, format.toUpperCase(), true);
|
|
@@ -9343,16 +9604,16 @@ var DxcDateInput = forwardRef7(
|
|
|
9343
9604
|
tabIndex,
|
|
9344
9605
|
ariaLabel = "Date input"
|
|
9345
9606
|
}, ref) => {
|
|
9346
|
-
const [innerValue, setInnerValue] =
|
|
9347
|
-
const [isOpen, setIsOpen] =
|
|
9348
|
-
const calendarId = `date-picker-${
|
|
9349
|
-
const [dayjsDate, setDayjsDate] =
|
|
9350
|
-
const [lastValidYear, setLastValidYear] =
|
|
9607
|
+
const [innerValue, setInnerValue] = useState23(defaultValue);
|
|
9608
|
+
const [isOpen, setIsOpen] = useState23(false);
|
|
9609
|
+
const calendarId = `date-picker-${useId12()}`;
|
|
9610
|
+
const [dayjsDate, setDayjsDate] = useState23(getValueForPicker(value ?? defaultValue ?? "", format));
|
|
9611
|
+
const [lastValidYear, setLastValidYear] = useState23(
|
|
9351
9612
|
innerValue || value ? !format.toUpperCase().includes("YYYY") && +getValueForPicker(value ?? innerValue, format).format("YY") < 68 ? 2e3 : 1900 : null
|
|
9352
9613
|
);
|
|
9353
|
-
const [sideOffset, setSideOffset] =
|
|
9354
|
-
const colorsTheme =
|
|
9355
|
-
const translatedLabels =
|
|
9614
|
+
const [sideOffset, setSideOffset] = useState23(SIDEOFFSET);
|
|
9615
|
+
const colorsTheme = useContext30(HalstackContext);
|
|
9616
|
+
const translatedLabels = useContext30(HalstackLanguageContext);
|
|
9356
9617
|
const dateRef = useRef12(null);
|
|
9357
9618
|
const popoverContentRef = useRef12(null);
|
|
9358
9619
|
const handleCalendarOnClick = (newDate) => {
|
|
@@ -9470,8 +9731,8 @@ var DxcDateInput = forwardRef7(
|
|
|
9470
9731
|
}
|
|
9471
9732
|
}
|
|
9472
9733
|
}, [isOpen, disabled, calendarId]);
|
|
9473
|
-
return /* @__PURE__ */
|
|
9474
|
-
label && /* @__PURE__ */
|
|
9734
|
+
return /* @__PURE__ */ jsx52(ThemeProvider20, { theme: colorsTheme, children: /* @__PURE__ */ jsxs37(DateInputContainer, { margin, size, ref, children: [
|
|
9735
|
+
label && /* @__PURE__ */ jsxs37(
|
|
9475
9736
|
Label5,
|
|
9476
9737
|
{
|
|
9477
9738
|
htmlFor: dateRef.current?.getElementsByTagName("input")[0]?.id,
|
|
@@ -9480,13 +9741,13 @@ var DxcDateInput = forwardRef7(
|
|
|
9480
9741
|
children: [
|
|
9481
9742
|
label,
|
|
9482
9743
|
" ",
|
|
9483
|
-
optional && /* @__PURE__ */
|
|
9744
|
+
optional && /* @__PURE__ */ jsx52(OptionalLabel3, { children: translatedLabels.formFields.optionalLabel })
|
|
9484
9745
|
]
|
|
9485
9746
|
}
|
|
9486
9747
|
),
|
|
9487
|
-
helperText && /* @__PURE__ */
|
|
9488
|
-
/* @__PURE__ */
|
|
9489
|
-
/* @__PURE__ */
|
|
9748
|
+
helperText && /* @__PURE__ */ jsx52(HelperText3, { disabled, children: helperText }),
|
|
9749
|
+
/* @__PURE__ */ jsxs37(Popover4.Root, { open: isOpen, children: [
|
|
9750
|
+
/* @__PURE__ */ jsx52(Popover4.Trigger, { asChild: true, "aria-controls": void 0, children: /* @__PURE__ */ jsx52(
|
|
9490
9751
|
TextInput_default,
|
|
9491
9752
|
{
|
|
9492
9753
|
name,
|
|
@@ -9512,7 +9773,7 @@ var DxcDateInput = forwardRef7(
|
|
|
9512
9773
|
ariaLabel
|
|
9513
9774
|
}
|
|
9514
9775
|
) }),
|
|
9515
|
-
/* @__PURE__ */
|
|
9776
|
+
/* @__PURE__ */ jsx52(Popover4.Portal, { children: /* @__PURE__ */ jsx52(
|
|
9516
9777
|
StyledPopoverContent,
|
|
9517
9778
|
{
|
|
9518
9779
|
sideOffset,
|
|
@@ -9521,7 +9782,7 @@ var DxcDateInput = forwardRef7(
|
|
|
9521
9782
|
onBlur: handleDatePickerOnBlur,
|
|
9522
9783
|
onKeyDown: handleDatePickerEscKeydown,
|
|
9523
9784
|
ref: popoverContentRef,
|
|
9524
|
-
children: /* @__PURE__ */
|
|
9785
|
+
children: /* @__PURE__ */ jsx52(DatePicker_default, { id: calendarId, onDateSelect: handleCalendarOnClick, date: dayjsDate })
|
|
9525
9786
|
}
|
|
9526
9787
|
) })
|
|
9527
9788
|
] })
|
|
@@ -9535,7 +9796,7 @@ var sizes5 = {
|
|
|
9535
9796
|
fillParent: "100%"
|
|
9536
9797
|
};
|
|
9537
9798
|
var calculateWidth9 = (margin, size) => size === "fillParent" ? `calc(${sizes5[size]} - ${getMargin(margin, "left")} - ${getMargin(margin, "right")})` : size && sizes5[size];
|
|
9538
|
-
var DateInputContainer =
|
|
9799
|
+
var DateInputContainer = styled45.div`
|
|
9539
9800
|
${(props) => props.size === "fillParent" && "width: 100%;"}
|
|
9540
9801
|
display: flex;
|
|
9541
9802
|
flex-direction: column;
|
|
@@ -9548,7 +9809,7 @@ var DateInputContainer = styled44.div`
|
|
|
9548
9809
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
9549
9810
|
font-family: ${(props) => props.theme.textInput.fontFamily};
|
|
9550
9811
|
`;
|
|
9551
|
-
var Label5 =
|
|
9812
|
+
var Label5 = styled45.label`
|
|
9552
9813
|
color: ${(props) => props.disabled ? props.theme.textInput.disabledLabelFontColor : props.theme.textInput.labelFontColor};
|
|
9553
9814
|
font-size: ${(props) => props.theme.textInput.labelFontSize};
|
|
9554
9815
|
font-style: ${(props) => props.theme.textInput.labelFontStyle};
|
|
@@ -9556,10 +9817,10 @@ var Label5 = styled44.label`
|
|
|
9556
9817
|
line-height: ${(props) => props.theme.textInput.labelLineHeight};
|
|
9557
9818
|
${(props) => !props.hasHelperText && `margin-bottom: 0.25rem`}
|
|
9558
9819
|
`;
|
|
9559
|
-
var OptionalLabel3 =
|
|
9820
|
+
var OptionalLabel3 = styled45.span`
|
|
9560
9821
|
font-weight: ${(props) => props.theme.textInput.optionalLabelFontWeight};
|
|
9561
9822
|
`;
|
|
9562
|
-
var HelperText3 =
|
|
9823
|
+
var HelperText3 = styled45.span`
|
|
9563
9824
|
color: ${(props) => props.disabled ? props.theme.textInput.disabledHelperTextFontColor : props.theme.textInput.helperTextFontColor};
|
|
9564
9825
|
font-size: ${(props) => props.theme.textInput.helperTextFontSize};
|
|
9565
9826
|
font-style: ${(props) => props.theme.textInput.helperTextFontStyle};
|
|
@@ -9567,7 +9828,7 @@ var HelperText3 = styled44.span`
|
|
|
9567
9828
|
line-height: ${(props) => props.theme.textInput.helperTextLineHeight};
|
|
9568
9829
|
margin-bottom: 0.25rem;
|
|
9569
9830
|
`;
|
|
9570
|
-
var StyledPopoverContent =
|
|
9831
|
+
var StyledPopoverContent = styled45(Popover4.Content)`
|
|
9571
9832
|
z-index: 300;
|
|
9572
9833
|
&:focus-visible {
|
|
9573
9834
|
outline: none;
|
|
@@ -9576,16 +9837,16 @@ var StyledPopoverContent = styled44(Popover4.Content)`
|
|
|
9576
9837
|
var DateInput_default = DxcDateInput;
|
|
9577
9838
|
|
|
9578
9839
|
// src/dialog/Dialog.tsx
|
|
9579
|
-
import { useContext as
|
|
9840
|
+
import { useContext as useContext31, useEffect as useEffect14 } from "react";
|
|
9580
9841
|
import { createPortal as createPortal2 } from "react-dom";
|
|
9581
|
-
import
|
|
9582
|
-
import { jsx as
|
|
9842
|
+
import styled46, { createGlobalStyle as createGlobalStyle2, ThemeProvider as ThemeProvider21 } from "styled-components";
|
|
9843
|
+
import { Fragment as Fragment13, jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9583
9844
|
var BodyStyle2 = createGlobalStyle2`
|
|
9584
9845
|
body {
|
|
9585
9846
|
overflow: hidden;
|
|
9586
9847
|
}
|
|
9587
9848
|
`;
|
|
9588
|
-
var DialogContainer =
|
|
9849
|
+
var DialogContainer = styled46.div`
|
|
9589
9850
|
position: fixed;
|
|
9590
9851
|
inset: 0;
|
|
9591
9852
|
display: flex;
|
|
@@ -9594,13 +9855,13 @@ var DialogContainer = styled45.div`
|
|
|
9594
9855
|
height: 100%;
|
|
9595
9856
|
z-index: 420;
|
|
9596
9857
|
`;
|
|
9597
|
-
var Overlay3 =
|
|
9858
|
+
var Overlay3 = styled46.div`
|
|
9598
9859
|
position: fixed;
|
|
9599
9860
|
inset: 0;
|
|
9600
9861
|
height: 100%;
|
|
9601
9862
|
background-color: ${(props) => props.theme.overlayColor};
|
|
9602
9863
|
`;
|
|
9603
|
-
var Dialog =
|
|
9864
|
+
var Dialog = styled46.div`
|
|
9604
9865
|
position: relative;
|
|
9605
9866
|
box-sizing: border-box;
|
|
9606
9867
|
max-width: 80%;
|
|
@@ -9615,7 +9876,7 @@ var Dialog = styled45.div`
|
|
|
9615
9876
|
min-width: 92%;
|
|
9616
9877
|
}
|
|
9617
9878
|
`;
|
|
9618
|
-
var CloseIconActionContainer =
|
|
9879
|
+
var CloseIconActionContainer = styled46.div`
|
|
9619
9880
|
position: absolute;
|
|
9620
9881
|
top: 24px;
|
|
9621
9882
|
right: 24px;
|
|
@@ -9626,10 +9887,11 @@ var DxcDialog = ({
|
|
|
9626
9887
|
onBackgroundClick,
|
|
9627
9888
|
onCloseClick,
|
|
9628
9889
|
overlay = true,
|
|
9629
|
-
tabIndex = 0
|
|
9890
|
+
tabIndex = 0,
|
|
9891
|
+
disableFocusLock = false
|
|
9630
9892
|
}) => {
|
|
9631
|
-
const colorsTheme =
|
|
9632
|
-
const translatedLabels =
|
|
9893
|
+
const colorsTheme = useContext31(HalstackContext);
|
|
9894
|
+
const translatedLabels = useContext31(HalstackLanguageContext);
|
|
9633
9895
|
useEffect14(() => {
|
|
9634
9896
|
const handleKeyDown = (event) => {
|
|
9635
9897
|
if (event.key === "Escape") {
|
|
@@ -9642,31 +9904,33 @@ var DxcDialog = ({
|
|
|
9642
9904
|
document.removeEventListener("keydown", handleKeyDown);
|
|
9643
9905
|
};
|
|
9644
9906
|
}, [onCloseClick]);
|
|
9645
|
-
return /* @__PURE__ */
|
|
9646
|
-
/* @__PURE__ */
|
|
9907
|
+
return /* @__PURE__ */ jsxs38(ThemeProvider21, { theme: colorsTheme.dialog, children: [
|
|
9908
|
+
/* @__PURE__ */ jsx53(BodyStyle2, {}),
|
|
9647
9909
|
createPortal2(
|
|
9648
|
-
/* @__PURE__ */
|
|
9649
|
-
overlay && /* @__PURE__ */
|
|
9650
|
-
/* @__PURE__ */
|
|
9910
|
+
/* @__PURE__ */ jsxs38(DialogContainer, { children: [
|
|
9911
|
+
overlay && /* @__PURE__ */ jsx53(Overlay3, { onClick: onBackgroundClick }),
|
|
9912
|
+
/* @__PURE__ */ jsx53(Dialog, { "aria-label": "Dialog", "aria-modal": overlay, closable, role: "dialog", children: !disableFocusLock ? /* @__PURE__ */ jsxs38(FocusLock_default, { children: [
|
|
9651
9913
|
children,
|
|
9652
|
-
closable && /* @__PURE__ */
|
|
9653
|
-
|
|
9914
|
+
closable && /* @__PURE__ */ jsx53(CloseIconActionContainer, { children: /* @__PURE__ */ jsx53(
|
|
9915
|
+
ActionIcon_default,
|
|
9654
9916
|
{
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
children: /* @__PURE__ */ jsx52(CloseIconActionContainer, { children: /* @__PURE__ */ jsx52(
|
|
9660
|
-
ActionIcon_default,
|
|
9661
|
-
{
|
|
9662
|
-
icon: "close",
|
|
9663
|
-
onClick: onCloseClick,
|
|
9664
|
-
tabIndex,
|
|
9665
|
-
title: translatedLabels.dialog.closeIconAriaLabel
|
|
9666
|
-
}
|
|
9667
|
-
) })
|
|
9917
|
+
icon: "close",
|
|
9918
|
+
onClick: onCloseClick,
|
|
9919
|
+
tabIndex,
|
|
9920
|
+
title: translatedLabels.dialog.closeIconAriaLabel
|
|
9668
9921
|
}
|
|
9669
|
-
)
|
|
9922
|
+
) })
|
|
9923
|
+
] }) : /* @__PURE__ */ jsxs38(Fragment13, { children: [
|
|
9924
|
+
children,
|
|
9925
|
+
closable && /* @__PURE__ */ jsx53(CloseIconActionContainer, { children: /* @__PURE__ */ jsx53(
|
|
9926
|
+
ActionIcon_default,
|
|
9927
|
+
{
|
|
9928
|
+
icon: "close",
|
|
9929
|
+
onClick: onCloseClick,
|
|
9930
|
+
tabIndex,
|
|
9931
|
+
title: translatedLabels.dialog.closeIconAriaLabel
|
|
9932
|
+
}
|
|
9933
|
+
) })
|
|
9670
9934
|
] }) })
|
|
9671
9935
|
] }),
|
|
9672
9936
|
document.body
|
|
@@ -9676,14 +9940,14 @@ var DxcDialog = ({
|
|
|
9676
9940
|
var Dialog_default = DxcDialog;
|
|
9677
9941
|
|
|
9678
9942
|
// src/file-input/FileInput.tsx
|
|
9679
|
-
import { useCallback as useCallback8, useContext as
|
|
9680
|
-
import
|
|
9943
|
+
import { useCallback as useCallback8, useContext as useContext33, useEffect as useEffect15, useId as useId14, useState as useState24, forwardRef as forwardRef8 } from "react";
|
|
9944
|
+
import styled48, { ThemeProvider as ThemeProvider22 } from "styled-components";
|
|
9681
9945
|
|
|
9682
9946
|
// src/file-input/FileItem.tsx
|
|
9683
|
-
import { memo as memo10, useContext as
|
|
9684
|
-
import
|
|
9685
|
-
import { jsx as
|
|
9686
|
-
var MainContainer3 =
|
|
9947
|
+
import { memo as memo10, useContext as useContext32, useId as useId13 } from "react";
|
|
9948
|
+
import styled47 from "styled-components";
|
|
9949
|
+
import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9950
|
+
var MainContainer3 = styled47.div`
|
|
9687
9951
|
box-sizing: border-box;
|
|
9688
9952
|
display: flex;
|
|
9689
9953
|
justify-content: center;
|
|
@@ -9696,13 +9960,13 @@ var MainContainer3 = styled46.div`
|
|
|
9696
9960
|
border-style: ${(props) => props.theme.fileItemBorderStyle};
|
|
9697
9961
|
border-radius: ${(props) => props.theme.fileItemBorderRadius};
|
|
9698
9962
|
`;
|
|
9699
|
-
var ImagePreview =
|
|
9963
|
+
var ImagePreview = styled47.img`
|
|
9700
9964
|
width: 48px;
|
|
9701
9965
|
height: 48px;
|
|
9702
9966
|
border-radius: 2px;
|
|
9703
9967
|
object-fit: contain;
|
|
9704
9968
|
`;
|
|
9705
|
-
var IconPreview =
|
|
9969
|
+
var IconPreview = styled47.span`
|
|
9706
9970
|
box-sizing: border-box;
|
|
9707
9971
|
display: flex;
|
|
9708
9972
|
align-items: center;
|
|
@@ -9719,14 +9983,14 @@ var IconPreview = styled46.span`
|
|
|
9719
9983
|
width: 18px;
|
|
9720
9984
|
}
|
|
9721
9985
|
`;
|
|
9722
|
-
var FileItemContent =
|
|
9986
|
+
var FileItemContent = styled47.div`
|
|
9723
9987
|
flex-grow: 1;
|
|
9724
9988
|
display: grid;
|
|
9725
9989
|
grid-template-columns: auto min-content;
|
|
9726
9990
|
grid-template-rows: min-content auto;
|
|
9727
9991
|
column-gap: 0.25rem;
|
|
9728
9992
|
`;
|
|
9729
|
-
var FileName =
|
|
9993
|
+
var FileName = styled47.span`
|
|
9730
9994
|
align-self: center;
|
|
9731
9995
|
color: ${(props) => props.theme.fileNameFontColor};
|
|
9732
9996
|
font-family: ${(props) => props.theme.fileItemFontFamily};
|
|
@@ -9737,7 +10001,7 @@ var FileName = styled46.span`
|
|
|
9737
10001
|
overflow: hidden;
|
|
9738
10002
|
text-overflow: ellipsis;
|
|
9739
10003
|
`;
|
|
9740
|
-
var ErrorIcon3 =
|
|
10004
|
+
var ErrorIcon3 = styled47.span`
|
|
9741
10005
|
display: flex;
|
|
9742
10006
|
flex-wrap: wrap;
|
|
9743
10007
|
align-content: center;
|
|
@@ -9747,7 +10011,7 @@ var ErrorIcon3 = styled46.span`
|
|
|
9747
10011
|
font-size: 18px;
|
|
9748
10012
|
color: #d0011b;
|
|
9749
10013
|
`;
|
|
9750
|
-
var ErrorMessage =
|
|
10014
|
+
var ErrorMessage = styled47.span`
|
|
9751
10015
|
color: ${(props) => props.theme.errorMessageFontColor};
|
|
9752
10016
|
font-family: ${(props) => props.theme.errorMessageFontFamily};
|
|
9753
10017
|
font-size: ${(props) => props.theme.errorMessageFontSize};
|
|
@@ -9764,15 +10028,15 @@ var FileItem = ({
|
|
|
9764
10028
|
onDelete,
|
|
9765
10029
|
tabIndex
|
|
9766
10030
|
}) => {
|
|
9767
|
-
const translatedLabels =
|
|
9768
|
-
const fileNameId =
|
|
9769
|
-
return /* @__PURE__ */
|
|
9770
|
-
showPreview && (type.includes("image") ? /* @__PURE__ */
|
|
9771
|
-
/* @__PURE__ */
|
|
9772
|
-
/* @__PURE__ */
|
|
9773
|
-
/* @__PURE__ */
|
|
9774
|
-
error && /* @__PURE__ */
|
|
9775
|
-
/* @__PURE__ */
|
|
10031
|
+
const translatedLabels = useContext32(HalstackLanguageContext);
|
|
10032
|
+
const fileNameId = useId13();
|
|
10033
|
+
return /* @__PURE__ */ jsxs39(MainContainer3, { error, role: "listitem", singleFileMode, showPreview, children: [
|
|
10034
|
+
showPreview && (type.includes("image") ? /* @__PURE__ */ jsx54(ImagePreview, { src: preview, alt: fileName }) : /* @__PURE__ */ jsx54(IconPreview, { "aria-labelledby": fileNameId, error, role: "img", children: /* @__PURE__ */ jsx54(Icon_default, { icon: preview }) })),
|
|
10035
|
+
/* @__PURE__ */ jsxs39(FileItemContent, { children: [
|
|
10036
|
+
/* @__PURE__ */ jsx54(FileName, { id: fileNameId, children: fileName }),
|
|
10037
|
+
/* @__PURE__ */ jsxs39(Flex_default, { gap: "0.25rem", children: [
|
|
10038
|
+
error && /* @__PURE__ */ jsx54(ErrorIcon3, { children: /* @__PURE__ */ jsx54(Icon_default, { icon: "filled_error" }) }),
|
|
10039
|
+
/* @__PURE__ */ jsx54(
|
|
9776
10040
|
ActionIcon_default,
|
|
9777
10041
|
{
|
|
9778
10042
|
onClick: () => onDelete(fileName),
|
|
@@ -9782,7 +10046,7 @@ var FileItem = ({
|
|
|
9782
10046
|
}
|
|
9783
10047
|
)
|
|
9784
10048
|
] }),
|
|
9785
|
-
error && !singleFileMode && /* @__PURE__ */
|
|
10049
|
+
error && !singleFileMode && /* @__PURE__ */ jsx54(ErrorMessage, { role: "alert", "aria-live": "assertive", children: error })
|
|
9786
10050
|
] })
|
|
9787
10051
|
] });
|
|
9788
10052
|
};
|
|
@@ -9793,13 +10057,7 @@ var getFilePreview = async (file) => {
|
|
|
9793
10057
|
if (file.type.includes("video")) return "filled_movie";
|
|
9794
10058
|
else if (file.type.includes("audio")) return "music_video";
|
|
9795
10059
|
else if (file.type.includes("image")) {
|
|
9796
|
-
return
|
|
9797
|
-
const reader = new FileReader();
|
|
9798
|
-
reader.readAsDataURL(file);
|
|
9799
|
-
reader.onload = (e) => {
|
|
9800
|
-
resolve(e.target?.result);
|
|
9801
|
-
};
|
|
9802
|
-
});
|
|
10060
|
+
return Promise.resolve(URL.createObjectURL(file));
|
|
9803
10061
|
} else return "draft";
|
|
9804
10062
|
};
|
|
9805
10063
|
var isFileIncluded = (file, fileList) => {
|
|
@@ -9810,8 +10068,8 @@ var isFileIncluded = (file, fileList) => {
|
|
|
9810
10068
|
};
|
|
9811
10069
|
|
|
9812
10070
|
// src/file-input/FileInput.tsx
|
|
9813
|
-
import { jsx as
|
|
9814
|
-
var FileInputContainer =
|
|
10071
|
+
import { jsx as jsx55, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
10072
|
+
var FileInputContainer = styled48.div`
|
|
9815
10073
|
display: flex;
|
|
9816
10074
|
flex-direction: column;
|
|
9817
10075
|
margin: ${(props) => props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px"};
|
|
@@ -9821,40 +10079,40 @@ var FileInputContainer = styled47.div`
|
|
|
9821
10079
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
9822
10080
|
width: fit-content;
|
|
9823
10081
|
`;
|
|
9824
|
-
var Label6 =
|
|
10082
|
+
var Label6 = styled48.label`
|
|
9825
10083
|
color: ${(props) => props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor};
|
|
9826
10084
|
font-family: ${(props) => props.theme.labelFontFamily};
|
|
9827
10085
|
font-size: ${(props) => props.theme.labelFontSize};
|
|
9828
10086
|
font-weight: ${(props) => props.theme.labelFontWeight};
|
|
9829
10087
|
line-height: ${(props) => props.theme.labelLineHeight};
|
|
9830
10088
|
`;
|
|
9831
|
-
var HelperText4 =
|
|
10089
|
+
var HelperText4 = styled48.span`
|
|
9832
10090
|
color: ${(props) => props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor};
|
|
9833
10091
|
font-family: ${(props) => props.theme.helperTextFontFamily};
|
|
9834
10092
|
font-size: ${(props) => props.theme.helperTextFontSize};
|
|
9835
10093
|
font-weight: ${(props) => props.theme.helperTextFontWeight};
|
|
9836
10094
|
line-height: ${(props) => props.theme.helperTextLineHeight};
|
|
9837
10095
|
`;
|
|
9838
|
-
var FileContainer =
|
|
10096
|
+
var FileContainer = styled48.div`
|
|
9839
10097
|
display: flex;
|
|
9840
10098
|
${(props) => props.singleFileMode ? "flex-direction: row; column-gap: 0.25rem;" : "flex-direction: column; row-gap: 0.25rem;"}
|
|
9841
10099
|
margin-top: 0.25rem;
|
|
9842
10100
|
`;
|
|
9843
|
-
var ValueInput2 =
|
|
10101
|
+
var ValueInput2 = styled48.input`
|
|
9844
10102
|
display: none;
|
|
9845
10103
|
`;
|
|
9846
|
-
var FileItemListContainer =
|
|
10104
|
+
var FileItemListContainer = styled48.div`
|
|
9847
10105
|
display: flex;
|
|
9848
10106
|
flex-direction: column;
|
|
9849
10107
|
row-gap: 0.25rem;
|
|
9850
10108
|
`;
|
|
9851
|
-
var Container2 =
|
|
10109
|
+
var Container2 = styled48.div`
|
|
9852
10110
|
display: flex;
|
|
9853
10111
|
flex-direction: column;
|
|
9854
10112
|
row-gap: 0.25rem;
|
|
9855
10113
|
margin-top: 0.25rem;
|
|
9856
10114
|
`;
|
|
9857
|
-
var DragDropArea =
|
|
10115
|
+
var DragDropArea = styled48.div`
|
|
9858
10116
|
box-sizing: border-box;
|
|
9859
10117
|
display: flex;
|
|
9860
10118
|
${(props) => props.mode === "filedrop" ? "flex-direction: row; column-gap: 0.75rem; height: 48px;" : "justify-content: center; flex-direction: column; row-gap: 0.5rem; height: 160px;"}
|
|
@@ -9874,7 +10132,7 @@ var DragDropArea = styled47.div`
|
|
|
9874
10132
|
`}
|
|
9875
10133
|
cursor: ${(props) => props.disabled && "not-allowed"};
|
|
9876
10134
|
`;
|
|
9877
|
-
var DropzoneLabel =
|
|
10135
|
+
var DropzoneLabel = styled48.div`
|
|
9878
10136
|
display: -webkit-box;
|
|
9879
10137
|
-webkit-box-orient: vertical;
|
|
9880
10138
|
overflow: hidden;
|
|
@@ -9886,7 +10144,7 @@ var DropzoneLabel = styled47.div`
|
|
|
9886
10144
|
font-size: ${(props) => props.theme.dropLabelFontSize};
|
|
9887
10145
|
font-weight: ${(props) => props.theme.dropLabelFontWeight};
|
|
9888
10146
|
`;
|
|
9889
|
-
var FiledropLabel =
|
|
10147
|
+
var FiledropLabel = styled48.span`
|
|
9890
10148
|
overflow: hidden;
|
|
9891
10149
|
white-space: nowrap;
|
|
9892
10150
|
text-overflow: ellipsis;
|
|
@@ -9895,7 +10153,7 @@ var FiledropLabel = styled47.span`
|
|
|
9895
10153
|
font-size: ${(props) => props.theme.dropLabelFontSize};
|
|
9896
10154
|
font-weight: ${(props) => props.theme.dropLabelFontWeight};
|
|
9897
10155
|
`;
|
|
9898
|
-
var ErrorMessage2 =
|
|
10156
|
+
var ErrorMessage2 = styled48.div`
|
|
9899
10157
|
color: ${(props) => props.theme.errorMessageFontColor};
|
|
9900
10158
|
font-family: ${(props) => props.theme.errorMessageFontFamily};
|
|
9901
10159
|
font-size: ${(props) => props.theme.errorMessageFontSize};
|
|
@@ -9921,11 +10179,11 @@ var DxcFileInput = forwardRef8(
|
|
|
9921
10179
|
margin,
|
|
9922
10180
|
tabIndex = 0
|
|
9923
10181
|
}, ref) => {
|
|
9924
|
-
const [isDragging, setIsDragging] =
|
|
9925
|
-
const [files, setFiles] =
|
|
9926
|
-
const fileInputId = `file-input-${
|
|
9927
|
-
const colorsTheme =
|
|
9928
|
-
const translatedLabels =
|
|
10182
|
+
const [isDragging, setIsDragging] = useState24(false);
|
|
10183
|
+
const [files, setFiles] = useState24([]);
|
|
10184
|
+
const fileInputId = `file-input-${useId14()}`;
|
|
10185
|
+
const colorsTheme = useContext33(HalstackContext);
|
|
10186
|
+
const translatedLabels = useContext33(HalstackLanguageContext);
|
|
9929
10187
|
const checkFileSize = (file) => {
|
|
9930
10188
|
if (minSize && file.size < minSize) return translatedLabels.fileInput.fileSizeGreaterThanErrorMessage;
|
|
9931
10189
|
else if (maxSize && file.size > maxSize) return translatedLabels.fileInput.fileSizeLessThanErrorMessage;
|
|
@@ -10014,11 +10272,11 @@ var DxcFileInput = forwardRef8(
|
|
|
10014
10272
|
};
|
|
10015
10273
|
getFiles();
|
|
10016
10274
|
}, [value]);
|
|
10017
|
-
return /* @__PURE__ */
|
|
10018
|
-
/* @__PURE__ */
|
|
10019
|
-
/* @__PURE__ */
|
|
10020
|
-
mode === "file" ? /* @__PURE__ */
|
|
10021
|
-
/* @__PURE__ */
|
|
10275
|
+
return /* @__PURE__ */ jsx55(ThemeProvider22, { theme: colorsTheme.fileInput, children: /* @__PURE__ */ jsxs40(FileInputContainer, { margin, ref, children: [
|
|
10276
|
+
/* @__PURE__ */ jsx55(Label6, { htmlFor: fileInputId, disabled, children: label }),
|
|
10277
|
+
/* @__PURE__ */ jsx55(HelperText4, { disabled, children: helperText }),
|
|
10278
|
+
mode === "file" ? /* @__PURE__ */ jsxs40(FileContainer, { singleFileMode: !multiple && files.length === 1, children: [
|
|
10279
|
+
/* @__PURE__ */ jsx55(
|
|
10022
10280
|
ValueInput2,
|
|
10023
10281
|
{
|
|
10024
10282
|
id: fileInputId,
|
|
@@ -10030,7 +10288,7 @@ var DxcFileInput = forwardRef8(
|
|
|
10030
10288
|
readOnly: true
|
|
10031
10289
|
}
|
|
10032
10290
|
),
|
|
10033
|
-
/* @__PURE__ */
|
|
10291
|
+
/* @__PURE__ */ jsx55(
|
|
10034
10292
|
Button_default,
|
|
10035
10293
|
{
|
|
10036
10294
|
mode: "secondary",
|
|
@@ -10041,7 +10299,7 @@ var DxcFileInput = forwardRef8(
|
|
|
10041
10299
|
tabIndex
|
|
10042
10300
|
}
|
|
10043
10301
|
),
|
|
10044
|
-
files.length > 0 && /* @__PURE__ */
|
|
10302
|
+
files.length > 0 && /* @__PURE__ */ jsx55(FileItemListContainer, { role: "list", children: files.map((file, index) => /* @__PURE__ */ jsx55(
|
|
10045
10303
|
FileItem_default,
|
|
10046
10304
|
{
|
|
10047
10305
|
fileName: file.file.name,
|
|
@@ -10055,8 +10313,8 @@ var DxcFileInput = forwardRef8(
|
|
|
10055
10313
|
},
|
|
10056
10314
|
`file-${index}`
|
|
10057
10315
|
)) })
|
|
10058
|
-
] }) : /* @__PURE__ */
|
|
10059
|
-
/* @__PURE__ */
|
|
10316
|
+
] }) : /* @__PURE__ */ jsxs40(Container2, { children: [
|
|
10317
|
+
/* @__PURE__ */ jsx55(
|
|
10060
10318
|
ValueInput2,
|
|
10061
10319
|
{
|
|
10062
10320
|
id: fileInputId,
|
|
@@ -10068,7 +10326,7 @@ var DxcFileInput = forwardRef8(
|
|
|
10068
10326
|
readOnly: true
|
|
10069
10327
|
}
|
|
10070
10328
|
),
|
|
10071
|
-
/* @__PURE__ */
|
|
10329
|
+
/* @__PURE__ */ jsxs40(
|
|
10072
10330
|
DragDropArea,
|
|
10073
10331
|
{
|
|
10074
10332
|
isDragging,
|
|
@@ -10079,7 +10337,7 @@ var DxcFileInput = forwardRef8(
|
|
|
10079
10337
|
onDragOver: handleDrag,
|
|
10080
10338
|
onDragLeave: handleDragOut,
|
|
10081
10339
|
children: [
|
|
10082
|
-
/* @__PURE__ */
|
|
10340
|
+
/* @__PURE__ */ jsx55(
|
|
10083
10341
|
Button_default,
|
|
10084
10342
|
{
|
|
10085
10343
|
mode: "secondary",
|
|
@@ -10089,11 +10347,11 @@ var DxcFileInput = forwardRef8(
|
|
|
10089
10347
|
size: { width: "fitContent" }
|
|
10090
10348
|
}
|
|
10091
10349
|
),
|
|
10092
|
-
mode === "dropzone" ? /* @__PURE__ */
|
|
10350
|
+
mode === "dropzone" ? /* @__PURE__ */ jsx55(DropzoneLabel, { disabled, children: dropAreaLabel ?? (multiple ? translatedLabels.fileInput.multipleDropAreaLabelDefault : translatedLabels.fileInput.singleDropAreaLabelDefault) }) : /* @__PURE__ */ jsx55(FiledropLabel, { disabled, children: dropAreaLabel ?? (multiple ? translatedLabels.fileInput.multipleDropAreaLabelDefault : translatedLabels.fileInput.singleDropAreaLabelDefault) })
|
|
10093
10351
|
]
|
|
10094
10352
|
}
|
|
10095
10353
|
),
|
|
10096
|
-
files.length > 0 && /* @__PURE__ */
|
|
10354
|
+
files.length > 0 && /* @__PURE__ */ jsx55(FileItemListContainer, { role: "list", children: files.map((file, index) => /* @__PURE__ */ jsx55(
|
|
10097
10355
|
FileItem_default,
|
|
10098
10356
|
{
|
|
10099
10357
|
fileName: file.file.name,
|
|
@@ -10108,16 +10366,16 @@ var DxcFileInput = forwardRef8(
|
|
|
10108
10366
|
`file-${index}`
|
|
10109
10367
|
)) })
|
|
10110
10368
|
] }),
|
|
10111
|
-
mode === "file" && !multiple && files.length === 1 && files[0]?.error && /* @__PURE__ */
|
|
10369
|
+
mode === "file" && !multiple && files.length === 1 && files[0]?.error && /* @__PURE__ */ jsx55(ErrorMessage2, { children: files[0].error })
|
|
10112
10370
|
] }) });
|
|
10113
10371
|
}
|
|
10114
10372
|
);
|
|
10115
10373
|
var FileInput_default = DxcFileInput;
|
|
10116
10374
|
|
|
10117
10375
|
// src/grid/Grid.tsx
|
|
10118
|
-
import
|
|
10119
|
-
import { jsx as
|
|
10120
|
-
var Grid =
|
|
10376
|
+
import styled49 from "styled-components";
|
|
10377
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
10378
|
+
var Grid = styled49.div`
|
|
10121
10379
|
display: grid;
|
|
10122
10380
|
${(props) => `
|
|
10123
10381
|
${props.templateColumns ? `grid-template-columns: ${props.templateColumns.join(" ")};` : ""}
|
|
@@ -10135,7 +10393,7 @@ var Grid = styled48.div`
|
|
|
10135
10393
|
${props.placeSelf ? typeof props.placeSelf === "string" ? `place-self: ${props.placeSelf};` : `align-self: ${props.placeSelf.alignSelf ?? ""}; justify-self: ${props.placeSelf.justifySelf ?? ""};` : ""}
|
|
10136
10394
|
`}
|
|
10137
10395
|
`;
|
|
10138
|
-
var GridItem =
|
|
10396
|
+
var GridItem = styled49.div`
|
|
10139
10397
|
${(props) => `
|
|
10140
10398
|
${props.areaName ? `grid-area: ${props.areaName};` : ""}
|
|
10141
10399
|
${props.column ? `grid-column: ${typeof props.column === "string" || typeof props.column === "number" ? props.column : `${props.column.start} / ${props.column.end};`};` : ""}
|
|
@@ -10143,29 +10401,29 @@ var GridItem = styled48.div`
|
|
|
10143
10401
|
${props.placeSelf ? typeof props.placeSelf === "string" ? `place-self: ${props.placeSelf};` : `align-self: ${props.placeSelf.alignSelf ?? ""}; justify-self: ${props.placeSelf.justifySelf ?? ""};` : ""}
|
|
10144
10402
|
`}
|
|
10145
10403
|
`;
|
|
10146
|
-
var DxcGrid = (props) => /* @__PURE__ */
|
|
10404
|
+
var DxcGrid = (props) => /* @__PURE__ */ jsx56(Grid, { ...props });
|
|
10147
10405
|
DxcGrid.Item = GridItem;
|
|
10148
10406
|
var Grid_default = DxcGrid;
|
|
10149
10407
|
|
|
10150
10408
|
// src/heading/Heading.tsx
|
|
10151
|
-
import
|
|
10152
|
-
import { useContext as
|
|
10153
|
-
import { jsx as
|
|
10409
|
+
import styled50, { ThemeProvider as ThemeProvider23 } from "styled-components";
|
|
10410
|
+
import { useContext as useContext34 } from "react";
|
|
10411
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
10154
10412
|
var DxcHeading = ({ level = 1, text = "", as, weight, margin }) => {
|
|
10155
|
-
const colorsTheme =
|
|
10413
|
+
const colorsTheme = useContext34(HalstackContext);
|
|
10156
10414
|
const checkValidAs = () => {
|
|
10157
10415
|
if (as === "h1" || as === "h2" || as === "h3" || as === "h4" || as === "h5") return as;
|
|
10158
10416
|
};
|
|
10159
|
-
return /* @__PURE__ */
|
|
10417
|
+
return /* @__PURE__ */ jsx57(ThemeProvider23, { theme: colorsTheme.heading, children: /* @__PURE__ */ jsx57(HeadingContainer, { margin, children: level === 1 ? /* @__PURE__ */ jsx57(HeadingLevel1, { as: checkValidAs(), weight, children: text }) : level === 2 ? /* @__PURE__ */ jsx57(HeadingLevel2, { as: checkValidAs(), weight, children: text }) : level === 3 ? /* @__PURE__ */ jsx57(HeadingLevel3, { as: checkValidAs(), weight, children: text }) : level === 4 ? /* @__PURE__ */ jsx57(HeadingLevel4, { as: checkValidAs(), weight, children: text }) : /* @__PURE__ */ jsx57(HeadingLevel5, { as: checkValidAs(), weight, children: text }) }) });
|
|
10160
10418
|
};
|
|
10161
|
-
var HeadingContainer =
|
|
10419
|
+
var HeadingContainer = styled50.div`
|
|
10162
10420
|
margin: ${(props) => props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px"};
|
|
10163
10421
|
margin-top: ${(props) => props.margin && typeof props.margin === "object" && props.margin.top ? spaces[props.margin.top] : ""};
|
|
10164
10422
|
margin-right: ${(props) => props.margin && typeof props.margin === "object" && props.margin.right ? spaces[props.margin.right] : ""};
|
|
10165
10423
|
margin-bottom: ${(props) => props.margin && typeof props.margin === "object" && props.margin.bottom ? spaces[props.margin.bottom] : ""};
|
|
10166
10424
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
10167
10425
|
`;
|
|
10168
|
-
var HeadingLevel1 =
|
|
10426
|
+
var HeadingLevel1 = styled50.h1`
|
|
10169
10427
|
font-family: ${(props) => props.theme.level1FontFamily};
|
|
10170
10428
|
font-style: ${(props) => props.theme.level1FontStyle};
|
|
10171
10429
|
font-size: ${(props) => props.theme.level1FontSize};
|
|
@@ -10175,7 +10433,7 @@ var HeadingLevel1 = styled49.h1`
|
|
|
10175
10433
|
color: ${(props) => props.theme.level1FontColor};
|
|
10176
10434
|
margin: 0;
|
|
10177
10435
|
`;
|
|
10178
|
-
var HeadingLevel2 =
|
|
10436
|
+
var HeadingLevel2 = styled50.h2`
|
|
10179
10437
|
font-family: ${(props) => props.theme.level2FontFamily};
|
|
10180
10438
|
font-style: ${(props) => props.theme.level2FontStyle};
|
|
10181
10439
|
font-size: ${(props) => props.theme.level2FontSize};
|
|
@@ -10185,7 +10443,7 @@ var HeadingLevel2 = styled49.h2`
|
|
|
10185
10443
|
color: ${(props) => props.theme.level2FontColor};
|
|
10186
10444
|
margin: 0;
|
|
10187
10445
|
`;
|
|
10188
|
-
var HeadingLevel3 =
|
|
10446
|
+
var HeadingLevel3 = styled50.h3`
|
|
10189
10447
|
font-family: ${(props) => props.theme.level3FontFamily};
|
|
10190
10448
|
font-style: ${(props) => props.theme.level3FontStyle};
|
|
10191
10449
|
font-size: ${(props) => props.theme.level3FontSize};
|
|
@@ -10195,7 +10453,7 @@ var HeadingLevel3 = styled49.h3`
|
|
|
10195
10453
|
color: ${(props) => props.theme.level3FontColor};
|
|
10196
10454
|
margin: 0;
|
|
10197
10455
|
`;
|
|
10198
|
-
var HeadingLevel4 =
|
|
10456
|
+
var HeadingLevel4 = styled50.h4`
|
|
10199
10457
|
font-family: ${(props) => props.theme.level4FontFamily};
|
|
10200
10458
|
font-style: ${(props) => props.theme.level4FontStyle};
|
|
10201
10459
|
font-size: ${(props) => props.theme.level4FontSize};
|
|
@@ -10205,7 +10463,7 @@ var HeadingLevel4 = styled49.h4`
|
|
|
10205
10463
|
color: ${(props) => props.theme.level4FontColor};
|
|
10206
10464
|
margin: 0;
|
|
10207
10465
|
`;
|
|
10208
|
-
var HeadingLevel5 =
|
|
10466
|
+
var HeadingLevel5 = styled50.h5`
|
|
10209
10467
|
font-family: ${(props) => props.theme.level5FontFamily};
|
|
10210
10468
|
font-style: ${(props) => props.theme.level5FontStyle};
|
|
10211
10469
|
font-size: ${(props) => props.theme.level5FontSize};
|
|
@@ -10218,10 +10476,10 @@ var HeadingLevel5 = styled49.h5`
|
|
|
10218
10476
|
var Heading_default = DxcHeading;
|
|
10219
10477
|
|
|
10220
10478
|
// src/image/Image.tsx
|
|
10221
|
-
import
|
|
10222
|
-
import { useContext as
|
|
10223
|
-
import { jsx as
|
|
10224
|
-
var Figure =
|
|
10479
|
+
import styled51, { ThemeProvider as ThemeProvider24 } from "styled-components";
|
|
10480
|
+
import { useContext as useContext35 } from "react";
|
|
10481
|
+
import { jsx as jsx58, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
10482
|
+
var Figure = styled51.figure`
|
|
10225
10483
|
display: flex;
|
|
10226
10484
|
flex-direction: column;
|
|
10227
10485
|
gap: 1rem;
|
|
@@ -10229,7 +10487,7 @@ var Figure = styled50.figure`
|
|
|
10229
10487
|
margin: 0;
|
|
10230
10488
|
padding: 0;
|
|
10231
10489
|
`;
|
|
10232
|
-
var CaptionContainer =
|
|
10490
|
+
var CaptionContainer = styled51.figcaption`
|
|
10233
10491
|
color: ${(props) => props.theme.captionFontColor};
|
|
10234
10492
|
font-family: ${(props) => props.theme.captionFontFamily};
|
|
10235
10493
|
font-size: ${(props) => props.theme.captionFontSize};
|
|
@@ -10237,9 +10495,9 @@ var CaptionContainer = styled50.figcaption`
|
|
|
10237
10495
|
font-weight: ${(props) => props.theme.captionFontWeight};
|
|
10238
10496
|
line-height: ${(props) => props.theme.captionLineHeight};
|
|
10239
10497
|
`;
|
|
10240
|
-
var CaptionWrapper = ({ caption, children }) => caption != null ? /* @__PURE__ */
|
|
10498
|
+
var CaptionWrapper = ({ caption, children }) => caption != null ? /* @__PURE__ */ jsxs41(Figure, { children: [
|
|
10241
10499
|
children,
|
|
10242
|
-
/* @__PURE__ */
|
|
10500
|
+
/* @__PURE__ */ jsx58(CaptionContainer, { children: caption })
|
|
10243
10501
|
] }) : children;
|
|
10244
10502
|
function DxcImage({
|
|
10245
10503
|
alt,
|
|
@@ -10255,8 +10513,8 @@ function DxcImage({
|
|
|
10255
10513
|
onLoad,
|
|
10256
10514
|
onError
|
|
10257
10515
|
}) {
|
|
10258
|
-
const colorsTheme =
|
|
10259
|
-
return /* @__PURE__ */
|
|
10516
|
+
const colorsTheme = useContext35(HalstackContext);
|
|
10517
|
+
return /* @__PURE__ */ jsx58(ThemeProvider24, { theme: colorsTheme.image, children: /* @__PURE__ */ jsx58(CaptionWrapper, { caption, children: /* @__PURE__ */ jsx58(
|
|
10260
10518
|
"img",
|
|
10261
10519
|
{
|
|
10262
10520
|
alt,
|
|
@@ -10277,16 +10535,16 @@ function DxcImage({
|
|
|
10277
10535
|
}
|
|
10278
10536
|
|
|
10279
10537
|
// src/inset/Inset.tsx
|
|
10280
|
-
import
|
|
10281
|
-
import { jsx as
|
|
10538
|
+
import styled52 from "styled-components";
|
|
10539
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
10282
10540
|
var getSpacingValue2 = (spacingName) => spacingName ?? "0rem";
|
|
10283
|
-
var StyledInset =
|
|
10541
|
+
var StyledInset = styled52.div`
|
|
10284
10542
|
${({ space, horizontal, vertical, top, right, bottom, left }) => `
|
|
10285
10543
|
padding: ${getSpacingValue2(top || vertical || space)} ${getSpacingValue2(right || horizontal || space)}
|
|
10286
10544
|
${getSpacingValue2(bottom || vertical || space)} ${getSpacingValue2(left || horizontal || space)};
|
|
10287
10545
|
`}
|
|
10288
10546
|
`;
|
|
10289
|
-
var Inset = ({ space, horizontal, vertical, top, right, bottom, left, children }) => /* @__PURE__ */
|
|
10547
|
+
var Inset = ({ space, horizontal, vertical, top, right, bottom, left, children }) => /* @__PURE__ */ jsx59(
|
|
10290
10548
|
StyledInset,
|
|
10291
10549
|
{
|
|
10292
10550
|
space,
|
|
@@ -10302,10 +10560,10 @@ var Inset = ({ space, horizontal, vertical, top, right, bottom, left, children }
|
|
|
10302
10560
|
var Inset_default = Inset;
|
|
10303
10561
|
|
|
10304
10562
|
// src/link/Link.tsx
|
|
10305
|
-
import { forwardRef as forwardRef9, useContext as
|
|
10306
|
-
import
|
|
10307
|
-
import { jsx as
|
|
10308
|
-
var StyledLink =
|
|
10563
|
+
import { forwardRef as forwardRef9, useContext as useContext36 } from "react";
|
|
10564
|
+
import styled53, { ThemeProvider as ThemeProvider25 } from "styled-components";
|
|
10565
|
+
import { jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10566
|
+
var StyledLink = styled53.a`
|
|
10309
10567
|
all: unset;
|
|
10310
10568
|
display: inline-flex;
|
|
10311
10569
|
align-items: baseline;
|
|
@@ -10342,7 +10600,7 @@ var StyledLink = styled52.a`
|
|
|
10342
10600
|
${(props) => props.disabled && "outline: none"}
|
|
10343
10601
|
}
|
|
10344
10602
|
`;
|
|
10345
|
-
var LinkContainer =
|
|
10603
|
+
var LinkContainer = styled53.span`
|
|
10346
10604
|
${(props) => `border-bottom: ${props.theme.underlineThickness} ${props.theme.underlineStyle} transparent;`}
|
|
10347
10605
|
display: inline-flex;
|
|
10348
10606
|
align-items: center;
|
|
@@ -10359,7 +10617,7 @@ var LinkContainer = styled52.span`
|
|
|
10359
10617
|
border-bottom-color: ${props.theme.activeUnderlineColor} !important;`}
|
|
10360
10618
|
}
|
|
10361
10619
|
`;
|
|
10362
|
-
var LinkIconContainer =
|
|
10620
|
+
var LinkIconContainer = styled53.div`
|
|
10363
10621
|
display: flex;
|
|
10364
10622
|
font-size: ${(props) => props.theme.iconSize};
|
|
10365
10623
|
svg {
|
|
@@ -10381,8 +10639,8 @@ var DxcLink = forwardRef9(
|
|
|
10381
10639
|
children,
|
|
10382
10640
|
...otherProps
|
|
10383
10641
|
}, ref) => {
|
|
10384
|
-
const colorsTheme =
|
|
10385
|
-
return /* @__PURE__ */
|
|
10642
|
+
const colorsTheme = useContext36(HalstackContext);
|
|
10643
|
+
return /* @__PURE__ */ jsx60(ThemeProvider25, { theme: colorsTheme.link, children: /* @__PURE__ */ jsx60(
|
|
10386
10644
|
StyledLink,
|
|
10387
10645
|
{
|
|
10388
10646
|
as: onClick && !href ? "button" : "a",
|
|
@@ -10395,9 +10653,9 @@ var DxcLink = forwardRef9(
|
|
|
10395
10653
|
margin,
|
|
10396
10654
|
ref,
|
|
10397
10655
|
...otherProps,
|
|
10398
|
-
children: /* @__PURE__ */
|
|
10656
|
+
children: /* @__PURE__ */ jsxs42(LinkContainer, { iconPosition, inheritColor, children: [
|
|
10399
10657
|
children,
|
|
10400
|
-
icon && /* @__PURE__ */
|
|
10658
|
+
icon && /* @__PURE__ */ jsx60(LinkIconContainer, { children: typeof icon === "string" ? /* @__PURE__ */ jsx60(Icon_default, { icon }) : icon })
|
|
10401
10659
|
] })
|
|
10402
10660
|
}
|
|
10403
10661
|
) });
|
|
@@ -10406,23 +10664,32 @@ var DxcLink = forwardRef9(
|
|
|
10406
10664
|
var Link_default = DxcLink;
|
|
10407
10665
|
|
|
10408
10666
|
// src/nav-tabs/NavTabs.tsx
|
|
10409
|
-
import { Children as Children4, useContext as
|
|
10410
|
-
import
|
|
10667
|
+
import { Children as Children4, useContext as useContext38, useEffect as useEffect17, useMemo as useMemo14, useRef as useRef14, useState as useState25 } from "react";
|
|
10668
|
+
import styled55, { ThemeProvider as ThemeProvider26 } from "styled-components";
|
|
10411
10669
|
|
|
10412
10670
|
// src/nav-tabs/Tab.tsx
|
|
10413
|
-
import { useEffect as useEffect16, forwardRef as forwardRef10, useContext as
|
|
10414
|
-
import
|
|
10671
|
+
import { useEffect as useEffect16, forwardRef as forwardRef10, useContext as useContext37, useRef as useRef13, useImperativeHandle } from "react";
|
|
10672
|
+
import styled54 from "styled-components";
|
|
10415
10673
|
|
|
10416
10674
|
// src/nav-tabs/NavTabsContext.tsx
|
|
10417
10675
|
import { createContext as createContext8 } from "react";
|
|
10418
10676
|
var NavTabsContext_default = createContext8(null);
|
|
10419
10677
|
|
|
10420
10678
|
// src/nav-tabs/Tab.tsx
|
|
10421
|
-
import { jsx as
|
|
10679
|
+
import { jsx as jsx61, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
10422
10680
|
var DxcTab = forwardRef10(
|
|
10423
|
-
({
|
|
10681
|
+
({
|
|
10682
|
+
href,
|
|
10683
|
+
active = false,
|
|
10684
|
+
icon,
|
|
10685
|
+
disabled = false,
|
|
10686
|
+
onClick,
|
|
10687
|
+
notificationNumber = false,
|
|
10688
|
+
children,
|
|
10689
|
+
...otherProps
|
|
10690
|
+
}, ref) => {
|
|
10424
10691
|
const tabRef = useRef13();
|
|
10425
|
-
const { iconPosition, tabIndex, focusedLabel } =
|
|
10692
|
+
const { iconPosition, tabIndex, focusedLabel } = useContext37(NavTabsContext_default) ?? {};
|
|
10426
10693
|
const innerRef = useRef13(null);
|
|
10427
10694
|
useImperativeHandle(ref, () => innerRef.current, []);
|
|
10428
10695
|
useEffect16(() => {
|
|
@@ -10441,13 +10708,17 @@ var DxcTab = forwardRef10(
|
|
|
10441
10708
|
break;
|
|
10442
10709
|
}
|
|
10443
10710
|
};
|
|
10444
|
-
return /* @__PURE__ */
|
|
10711
|
+
return /* @__PURE__ */ jsx61(TabContainer, { active, children: /* @__PURE__ */ jsxs43(
|
|
10445
10712
|
Tab,
|
|
10446
10713
|
{
|
|
10447
|
-
|
|
10714
|
+
"aria-disabled": disabled,
|
|
10715
|
+
"aria-selected": active,
|
|
10448
10716
|
disabled,
|
|
10449
10717
|
active,
|
|
10718
|
+
href: !disabled ? href : void 0,
|
|
10450
10719
|
iconPosition,
|
|
10720
|
+
onClick,
|
|
10721
|
+
onKeyDown: handleOnKeyDown,
|
|
10451
10722
|
hasIcon: icon != null,
|
|
10452
10723
|
ref: (anchorRef) => {
|
|
10453
10724
|
tabRef.current = anchorRef;
|
|
@@ -10459,17 +10730,14 @@ var DxcTab = forwardRef10(
|
|
|
10459
10730
|
}
|
|
10460
10731
|
}
|
|
10461
10732
|
},
|
|
10462
|
-
onKeyDown: handleOnKeyDown,
|
|
10463
10733
|
tabIndex: active ? tabIndex : -1,
|
|
10464
10734
|
role: "tab",
|
|
10465
|
-
"aria-selected": active,
|
|
10466
|
-
"aria-disabled": disabled,
|
|
10467
10735
|
...otherProps,
|
|
10468
10736
|
children: [
|
|
10469
|
-
icon && /* @__PURE__ */
|
|
10470
|
-
/* @__PURE__ */
|
|
10471
|
-
/* @__PURE__ */
|
|
10472
|
-
notificationNumber && !disabled && /* @__PURE__ */
|
|
10737
|
+
icon && /* @__PURE__ */ jsx61(TabIconContainer, { iconPosition, active, disabled, children: typeof icon === "string" ? /* @__PURE__ */ jsx61(Icon_default, { icon }) : icon }),
|
|
10738
|
+
/* @__PURE__ */ jsxs43(Flex_default, { alignItems: "center", gap: "0.5rem", children: [
|
|
10739
|
+
/* @__PURE__ */ jsx61(Label7, { active, disabled, children }),
|
|
10740
|
+
notificationNumber && !disabled && /* @__PURE__ */ jsx61(
|
|
10473
10741
|
Badge_default,
|
|
10474
10742
|
{
|
|
10475
10743
|
mode: "notification",
|
|
@@ -10483,12 +10751,12 @@ var DxcTab = forwardRef10(
|
|
|
10483
10751
|
) });
|
|
10484
10752
|
}
|
|
10485
10753
|
);
|
|
10486
|
-
var TabContainer =
|
|
10754
|
+
var TabContainer = styled54.div`
|
|
10487
10755
|
align-items: stretch;
|
|
10488
10756
|
border-bottom: 2px solid ${(props) => props.active ? props.theme.selectedUnderlineColor : "transparent"};
|
|
10489
10757
|
padding: 0.5rem;
|
|
10490
10758
|
`;
|
|
10491
|
-
var Tab =
|
|
10759
|
+
var Tab = styled54.a`
|
|
10492
10760
|
box-sizing: border-box;
|
|
10493
10761
|
display: flex;
|
|
10494
10762
|
flex-direction: ${(props) => props.hasIcon && props.iconPosition === "top" ? "column" : "row"};
|
|
@@ -10518,7 +10786,7 @@ var Tab = styled53.a`
|
|
|
10518
10786
|
}
|
|
10519
10787
|
`}
|
|
10520
10788
|
`;
|
|
10521
|
-
var Label7 =
|
|
10789
|
+
var Label7 = styled54.span`
|
|
10522
10790
|
display: inline;
|
|
10523
10791
|
color: ${(props) => props.disabled ? props.theme.disabledFontColor : props.active ? props.theme.selectedFontColor : props.theme.unselectedFontColor};
|
|
10524
10792
|
font-family: ${(props) => props.theme.fontFamily};
|
|
@@ -10533,7 +10801,7 @@ var Label7 = styled53.span`
|
|
|
10533
10801
|
white-space: normal;
|
|
10534
10802
|
margin: 0;
|
|
10535
10803
|
`;
|
|
10536
|
-
var TabIconContainer =
|
|
10804
|
+
var TabIconContainer = styled54.div`
|
|
10537
10805
|
display: flex;
|
|
10538
10806
|
font-size: 24px;
|
|
10539
10807
|
color: ${(props) => props.active ? props.theme.selectedIconColor : props.disabled ? props.theme.disabledIconColor : props.theme.unselectedIconColor};
|
|
@@ -10545,7 +10813,7 @@ var TabIconContainer = styled53.div`
|
|
|
10545
10813
|
var Tab_default = DxcTab;
|
|
10546
10814
|
|
|
10547
10815
|
// src/nav-tabs/NavTabs.tsx
|
|
10548
|
-
import { jsx as
|
|
10816
|
+
import { jsx as jsx62, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10549
10817
|
var getPropInChild = (child, propName) => {
|
|
10550
10818
|
if (child && typeof child === "object" && "props" in child) {
|
|
10551
10819
|
const childWithProps = child;
|
|
@@ -10583,17 +10851,17 @@ var getNextTabIndex = (array, initialIndex) => {
|
|
|
10583
10851
|
return index;
|
|
10584
10852
|
};
|
|
10585
10853
|
var DxcNavTabs = ({ iconPosition = "top", tabIndex = 0, children }) => {
|
|
10586
|
-
const [innerFocusIndex, setInnerFocusIndex] =
|
|
10587
|
-
const [underlineWidth, setUnderlineWidth] =
|
|
10854
|
+
const [innerFocusIndex, setInnerFocusIndex] = useState25(null);
|
|
10855
|
+
const [underlineWidth, setUnderlineWidth] = useState25(null);
|
|
10588
10856
|
const refNavTabList = useRef14(null);
|
|
10589
|
-
const colorsTheme =
|
|
10857
|
+
const colorsTheme = useContext38(HalstackContext);
|
|
10590
10858
|
const childArray = Children4.toArray(children).filter(
|
|
10591
10859
|
(child) => typeof child === "object" && "props" in child
|
|
10592
10860
|
);
|
|
10593
10861
|
useEffect17(() => {
|
|
10594
10862
|
setUnderlineWidth(refNavTabList?.current?.scrollWidth ?? null);
|
|
10595
10863
|
}, [children]);
|
|
10596
|
-
const contextValue =
|
|
10864
|
+
const contextValue = useMemo14(
|
|
10597
10865
|
() => ({
|
|
10598
10866
|
iconPosition,
|
|
10599
10867
|
tabIndex,
|
|
@@ -10618,12 +10886,12 @@ var DxcNavTabs = ({ iconPosition = "top", tabIndex = 0, children }) => {
|
|
|
10618
10886
|
break;
|
|
10619
10887
|
}
|
|
10620
10888
|
};
|
|
10621
|
-
return /* @__PURE__ */
|
|
10622
|
-
/* @__PURE__ */
|
|
10623
|
-
/* @__PURE__ */
|
|
10889
|
+
return /* @__PURE__ */ jsx62(ThemeProvider26, { theme: colorsTheme.navTabs, children: /* @__PURE__ */ jsxs44(NavTabsContainer, { onKeyDown: handleOnKeyDown, ref: refNavTabList, role: "tablist", "aria-label": "Navigation tabs", children: [
|
|
10890
|
+
/* @__PURE__ */ jsx62(NavTabsContext_default.Provider, { value: contextValue, children }),
|
|
10891
|
+
/* @__PURE__ */ jsx62(Underline, { underlineWidth: underlineWidth ?? 0 })
|
|
10624
10892
|
] }) });
|
|
10625
10893
|
};
|
|
10626
|
-
var Underline =
|
|
10894
|
+
var Underline = styled55.div`
|
|
10627
10895
|
position: absolute;
|
|
10628
10896
|
bottom: 0;
|
|
10629
10897
|
left: 0;
|
|
@@ -10633,7 +10901,7 @@ var Underline = styled54.div`
|
|
|
10633
10901
|
width: ${(props) => props.underlineWidth}px;
|
|
10634
10902
|
`;
|
|
10635
10903
|
DxcNavTabs.Tab = Tab_default;
|
|
10636
|
-
var NavTabsContainer =
|
|
10904
|
+
var NavTabsContainer = styled55.div`
|
|
10637
10905
|
display: flex;
|
|
10638
10906
|
position: relative;
|
|
10639
10907
|
overflow: auto;
|
|
@@ -10642,9 +10910,9 @@ var NavTabsContainer = styled54.div`
|
|
|
10642
10910
|
var NavTabs_default = DxcNavTabs;
|
|
10643
10911
|
|
|
10644
10912
|
// src/number-input/NumberInput.tsx
|
|
10645
|
-
import { forwardRef as forwardRef11, useEffect as useEffect18, useMemo as
|
|
10646
|
-
import
|
|
10647
|
-
import { jsx as
|
|
10913
|
+
import { forwardRef as forwardRef11, useEffect as useEffect18, useMemo as useMemo15, useRef as useRef15 } from "react";
|
|
10914
|
+
import styled56 from "styled-components";
|
|
10915
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
10648
10916
|
var DxcNumberInput = forwardRef11(
|
|
10649
10917
|
({
|
|
10650
10918
|
label,
|
|
@@ -10672,7 +10940,7 @@ var DxcNumberInput = forwardRef11(
|
|
|
10672
10940
|
showControls = true
|
|
10673
10941
|
}, ref) => {
|
|
10674
10942
|
const numberInputRef = useRef15(null);
|
|
10675
|
-
const contextValue =
|
|
10943
|
+
const contextValue = useMemo15(
|
|
10676
10944
|
() => ({
|
|
10677
10945
|
maxNumber: max,
|
|
10678
10946
|
minNumber: min,
|
|
@@ -10692,7 +10960,7 @@ var DxcNumberInput = forwardRef11(
|
|
|
10692
10960
|
input?.removeEventListener("wheel", preventDefault);
|
|
10693
10961
|
};
|
|
10694
10962
|
}, []);
|
|
10695
|
-
return /* @__PURE__ */
|
|
10963
|
+
return /* @__PURE__ */ jsx63(NumberInputContext_default.Provider, { value: contextValue, children: /* @__PURE__ */ jsx63(NumberInputContainer, { ref: numberInputRef, size, children: /* @__PURE__ */ jsx63(
|
|
10696
10964
|
TextInput_default,
|
|
10697
10965
|
{
|
|
10698
10966
|
label,
|
|
@@ -10719,7 +10987,7 @@ var DxcNumberInput = forwardRef11(
|
|
|
10719
10987
|
) }) });
|
|
10720
10988
|
}
|
|
10721
10989
|
);
|
|
10722
|
-
var NumberInputContainer =
|
|
10990
|
+
var NumberInputContainer = styled56.div`
|
|
10723
10991
|
${(props) => props.size === "fillParent" && "width: 100%;"}
|
|
10724
10992
|
// Chrome, Safari, Edge, Opera
|
|
10725
10993
|
input::-webkit-outer-spin-button,
|
|
@@ -10736,10 +11004,10 @@ var NumberInputContainer = styled55.div`
|
|
|
10736
11004
|
var NumberInput_default = DxcNumberInput;
|
|
10737
11005
|
|
|
10738
11006
|
// src/paragraph/Paragraph.tsx
|
|
10739
|
-
import { useContext as
|
|
10740
|
-
import
|
|
10741
|
-
import { jsx as
|
|
10742
|
-
var Paragraph =
|
|
11007
|
+
import { useContext as useContext39 } from "react";
|
|
11008
|
+
import styled57, { ThemeProvider as ThemeProvider27 } from "styled-components";
|
|
11009
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
11010
|
+
var Paragraph = styled57.p`
|
|
10743
11011
|
display: ${(props) => props.theme.display};
|
|
10744
11012
|
font-family: "Open Sans", sans-serif;
|
|
10745
11013
|
font-size: ${(props) => props.theme.fontSize};
|
|
@@ -10755,14 +11023,14 @@ var Paragraph = styled56.p`
|
|
|
10755
11023
|
margin: 0;
|
|
10756
11024
|
`;
|
|
10757
11025
|
function DxcParagraph({ children }) {
|
|
10758
|
-
const colorsTheme =
|
|
10759
|
-
return /* @__PURE__ */
|
|
11026
|
+
const colorsTheme = useContext39(HalstackContext);
|
|
11027
|
+
return /* @__PURE__ */ jsx64(ThemeProvider27, { theme: colorsTheme.paragraph, children: /* @__PURE__ */ jsx64(Paragraph, { children }) });
|
|
10760
11028
|
}
|
|
10761
11029
|
|
|
10762
11030
|
// src/password-input/PasswordInput.tsx
|
|
10763
|
-
import { forwardRef as forwardRef12, useContext as
|
|
10764
|
-
import
|
|
10765
|
-
import { jsx as
|
|
11031
|
+
import { forwardRef as forwardRef12, useContext as useContext40, useEffect as useEffect19, useRef as useRef16, useState as useState26 } from "react";
|
|
11032
|
+
import styled58 from "styled-components";
|
|
11033
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
10766
11034
|
var setInputType = (type, element) => {
|
|
10767
11035
|
element?.getElementsByTagName("input")[0]?.setAttribute("type", type);
|
|
10768
11036
|
};
|
|
@@ -10789,9 +11057,9 @@ var DxcPasswordInput = forwardRef12(
|
|
|
10789
11057
|
tabIndex = 0,
|
|
10790
11058
|
ariaLabel = "Password input"
|
|
10791
11059
|
}, ref) => {
|
|
10792
|
-
const [isPasswordVisible, setIsPasswordVisible] =
|
|
11060
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState26(false);
|
|
10793
11061
|
const inputRef = useRef16(null);
|
|
10794
|
-
const { passwordInput } =
|
|
11062
|
+
const { passwordInput } = useContext40(HalstackLanguageContext);
|
|
10795
11063
|
useEffect19(() => {
|
|
10796
11064
|
(() => {
|
|
10797
11065
|
if (isPasswordVisible) {
|
|
@@ -10807,7 +11075,7 @@ var DxcPasswordInput = forwardRef12(
|
|
|
10807
11075
|
}
|
|
10808
11076
|
})();
|
|
10809
11077
|
}, [isPasswordVisible, passwordInput]);
|
|
10810
|
-
return /* @__PURE__ */
|
|
11078
|
+
return /* @__PURE__ */ jsx65(PasswordInput, { ref, role: "group", size, children: /* @__PURE__ */ jsx65(
|
|
10811
11079
|
TextInput_default,
|
|
10812
11080
|
{
|
|
10813
11081
|
label,
|
|
@@ -10838,7 +11106,7 @@ var DxcPasswordInput = forwardRef12(
|
|
|
10838
11106
|
) });
|
|
10839
11107
|
}
|
|
10840
11108
|
);
|
|
10841
|
-
var PasswordInput =
|
|
11109
|
+
var PasswordInput = styled58.div`
|
|
10842
11110
|
${(props) => props.size === "fillParent" && "width: 100%;"}
|
|
10843
11111
|
& ::-ms-reveal {
|
|
10844
11112
|
display: none;
|
|
@@ -10847,10 +11115,10 @@ var PasswordInput = styled57.div`
|
|
|
10847
11115
|
var PasswordInput_default = DxcPasswordInput;
|
|
10848
11116
|
|
|
10849
11117
|
// src/progress-bar/ProgressBar.tsx
|
|
10850
|
-
import { useContext as
|
|
10851
|
-
import
|
|
10852
|
-
import { jsx as
|
|
10853
|
-
var Overlay4 =
|
|
11118
|
+
import { useContext as useContext41, useEffect as useEffect20, useId as useId15, useState as useState27 } from "react";
|
|
11119
|
+
import styled59, { ThemeProvider as ThemeProvider28 } from "styled-components";
|
|
11120
|
+
import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
11121
|
+
var Overlay4 = styled59.div`
|
|
10854
11122
|
${({ overlay, theme }) => overlay ? `background-color: ${theme.overlayColor};
|
|
10855
11123
|
width: 100%;
|
|
10856
11124
|
justify-content: center;
|
|
@@ -10868,7 +11136,7 @@ var Overlay4 = styled58.div`
|
|
|
10868
11136
|
min-width: 100px;
|
|
10869
11137
|
width: 100%;
|
|
10870
11138
|
`;
|
|
10871
|
-
var MainContainer4 =
|
|
11139
|
+
var MainContainer4 = styled59.div`
|
|
10872
11140
|
width: ${(props) => props.overlay ? "80%" : "100%"};
|
|
10873
11141
|
margin: ${(props) => props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px"};
|
|
10874
11142
|
margin-top: ${(props) => props.margin && typeof props.margin === "object" && props.margin.top ? spaces[props.margin.top] : ""};
|
|
@@ -10880,7 +11148,7 @@ var MainContainer4 = styled58.div`
|
|
|
10880
11148
|
gap: 0.5rem;
|
|
10881
11149
|
z-index: ${(props) => props.overlay ? "1" : "0"};
|
|
10882
11150
|
`;
|
|
10883
|
-
var ProgressBarLabel =
|
|
11151
|
+
var ProgressBarLabel = styled59.div`
|
|
10884
11152
|
font-family: ${(props) => props.theme.labelFontFamily};
|
|
10885
11153
|
font-style: ${(props) => props.theme.labelFontStyle};
|
|
10886
11154
|
font-size: ${(props) => props.theme.labelFontSize};
|
|
@@ -10892,7 +11160,7 @@ var ProgressBarLabel = styled58.div`
|
|
|
10892
11160
|
white-space: nowrap;
|
|
10893
11161
|
text-overflow: ellipsis;
|
|
10894
11162
|
`;
|
|
10895
|
-
var ProgressBarProgress =
|
|
11163
|
+
var ProgressBarProgress = styled59.div`
|
|
10896
11164
|
flex-shrink: 0;
|
|
10897
11165
|
color: ${(props) => props.overlay ? props.theme.overlayFontColor : props.theme.valueFontColor};
|
|
10898
11166
|
font-family: ${(props) => props.theme.valueFontFamily};
|
|
@@ -10901,7 +11169,7 @@ var ProgressBarProgress = styled58.div`
|
|
|
10901
11169
|
font-weight: ${(props) => props.theme.valueFontWeight};
|
|
10902
11170
|
text-transform: ${(props) => props.theme.valueFontTextTransform};
|
|
10903
11171
|
`;
|
|
10904
|
-
var HelperText5 =
|
|
11172
|
+
var HelperText5 = styled59.span`
|
|
10905
11173
|
color: ${(props) => props.overlay ? props.theme.overlayFontColor : props.theme.helperTextFontColor};
|
|
10906
11174
|
font-family: ${(props) => props.theme.helperTextFontFamily};
|
|
10907
11175
|
font-size: ${(props) => props.theme.helperTextFontSize};
|
|
@@ -10909,14 +11177,14 @@ var HelperText5 = styled58.span`
|
|
|
10909
11177
|
font-weight: ${(props) => props.theme.helperTextFontWeight};
|
|
10910
11178
|
line-height: 1.5em;
|
|
10911
11179
|
`;
|
|
10912
|
-
var LinearProgress =
|
|
11180
|
+
var LinearProgress = styled59.div`
|
|
10913
11181
|
position: relative;
|
|
10914
11182
|
border-radius: ${(props) => props.theme.borderRadius};
|
|
10915
11183
|
height: ${(props) => props.theme.thickness};
|
|
10916
11184
|
background-color: ${(props) => props.theme.totalLineColor};
|
|
10917
11185
|
overflow: hidden;
|
|
10918
11186
|
`;
|
|
10919
|
-
var LinearProgressBar =
|
|
11187
|
+
var LinearProgressBar = styled59.span`
|
|
10920
11188
|
position: absolute;
|
|
10921
11189
|
top: 0;
|
|
10922
11190
|
bottom: 0;
|
|
@@ -10967,21 +11235,21 @@ var DxcProgressBar = ({
|
|
|
10967
11235
|
margin,
|
|
10968
11236
|
ariaLabel = "Progress bar"
|
|
10969
11237
|
}) => {
|
|
10970
|
-
const colorsTheme =
|
|
10971
|
-
const labelId = `label-${
|
|
10972
|
-
const [innerValue, setInnerValue] =
|
|
11238
|
+
const colorsTheme = useContext41(HalstackContext);
|
|
11239
|
+
const labelId = `label-${useId15()}`;
|
|
11240
|
+
const [innerValue, setInnerValue] = useState27();
|
|
10973
11241
|
useEffect20(() => {
|
|
10974
11242
|
if (value != null) setInnerValue(value < 0 ? 0 : value > 100 ? 100 : value);
|
|
10975
11243
|
}, [value]);
|
|
10976
|
-
return /* @__PURE__ */
|
|
10977
|
-
/* @__PURE__ */
|
|
10978
|
-
label && /* @__PURE__ */
|
|
10979
|
-
innerValue != null && showValue && /* @__PURE__ */
|
|
11244
|
+
return /* @__PURE__ */ jsx66(ThemeProvider28, { theme: colorsTheme.progressBar, children: /* @__PURE__ */ jsx66(Overlay4, { overlay, children: /* @__PURE__ */ jsxs45(MainContainer4, { overlay, margin, children: [
|
|
11245
|
+
/* @__PURE__ */ jsxs45(Flex_default, { justifyContent: "space-between", gap: "0.5rem", children: [
|
|
11246
|
+
label && /* @__PURE__ */ jsx66(ProgressBarLabel, { id: labelId, overlay, children: label }),
|
|
11247
|
+
innerValue != null && showValue && /* @__PURE__ */ jsxs45(ProgressBarProgress, { overlay, children: [
|
|
10980
11248
|
innerValue,
|
|
10981
11249
|
" %"
|
|
10982
11250
|
] })
|
|
10983
11251
|
] }),
|
|
10984
|
-
/* @__PURE__ */
|
|
11252
|
+
/* @__PURE__ */ jsx66(
|
|
10985
11253
|
LinearProgress,
|
|
10986
11254
|
{
|
|
10987
11255
|
role: "progressbar",
|
|
@@ -10991,27 +11259,27 @@ var DxcProgressBar = ({
|
|
|
10991
11259
|
"aria-valuenow": innerValue,
|
|
10992
11260
|
"aria-valuemin": 0,
|
|
10993
11261
|
"aria-valuemax": 100,
|
|
10994
|
-
children: /* @__PURE__ */
|
|
11262
|
+
children: /* @__PURE__ */ jsx66(LinearProgressBar, { variant: innerValue == null ? "indeterminate" : "determinate", value: innerValue })
|
|
10995
11263
|
}
|
|
10996
11264
|
),
|
|
10997
|
-
helperText && /* @__PURE__ */
|
|
11265
|
+
helperText && /* @__PURE__ */ jsx66(HelperText5, { overlay, children: helperText })
|
|
10998
11266
|
] }) }) });
|
|
10999
11267
|
};
|
|
11000
11268
|
var ProgressBar_default = DxcProgressBar;
|
|
11001
11269
|
|
|
11002
11270
|
// src/quick-nav/QuickNav.tsx
|
|
11003
|
-
import { useContext as
|
|
11271
|
+
import { useContext as useContext42 } from "react";
|
|
11004
11272
|
import slugify from "slugify";
|
|
11005
|
-
import
|
|
11006
|
-
import { jsx as
|
|
11273
|
+
import styled60, { ThemeProvider as ThemeProvider29 } from "styled-components";
|
|
11274
|
+
import { jsx as jsx67, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11007
11275
|
var DxcQuickNav = ({ title, links }) => {
|
|
11008
|
-
const translatedLabels =
|
|
11009
|
-
const colorsTheme =
|
|
11010
|
-
return /* @__PURE__ */
|
|
11011
|
-
/* @__PURE__ */
|
|
11012
|
-
/* @__PURE__ */
|
|
11013
|
-
/* @__PURE__ */
|
|
11014
|
-
/* @__PURE__ */
|
|
11276
|
+
const translatedLabels = useContext42(HalstackLanguageContext);
|
|
11277
|
+
const colorsTheme = useContext42(HalstackContext);
|
|
11278
|
+
return /* @__PURE__ */ jsx67(ThemeProvider29, { theme: colorsTheme.quickNav, children: /* @__PURE__ */ jsx67(QuickNavContainer, { children: /* @__PURE__ */ jsxs46(Flex_default, { direction: "column", gap: "0.5rem", children: [
|
|
11279
|
+
/* @__PURE__ */ jsx67(Heading_default, { level: 4, text: title || translatedLabels.quickNav.contentTitle }),
|
|
11280
|
+
/* @__PURE__ */ jsx67(ListColumn, { children: links.map((link) => /* @__PURE__ */ jsx67("li", { children: /* @__PURE__ */ jsx67(Inset_default, { space: "0.25rem", children: /* @__PURE__ */ jsxs46(DxcTypography, { children: [
|
|
11281
|
+
/* @__PURE__ */ jsx67(Link3, { href: `#${slugify(link.label, { lower: true })}`, children: link.label }),
|
|
11282
|
+
/* @__PURE__ */ jsx67(ListSecondColumn, { children: link.links?.map((sublink) => /* @__PURE__ */ jsx67("li", { children: /* @__PURE__ */ jsx67(Inset_default, { horizontal: "0.5rem", children: /* @__PURE__ */ jsx67(DxcTypography, { children: /* @__PURE__ */ jsx67(
|
|
11015
11283
|
Link3,
|
|
11016
11284
|
{
|
|
11017
11285
|
href: `#${slugify(link?.label, { lower: true })}-${slugify(sublink?.label, {
|
|
@@ -11023,14 +11291,14 @@ var DxcQuickNav = ({ title, links }) => {
|
|
|
11023
11291
|
] }) }) }, link.label)) })
|
|
11024
11292
|
] }) }) });
|
|
11025
11293
|
};
|
|
11026
|
-
var QuickNavContainer =
|
|
11294
|
+
var QuickNavContainer = styled60.div`
|
|
11027
11295
|
padding-top: ${(props) => props.theme.paddingTop};
|
|
11028
11296
|
padding-bottom: ${(props) => props.theme.paddingBottom};
|
|
11029
11297
|
padding-left: ${(props) => props.theme.paddingLeft};
|
|
11030
11298
|
padding-right: ${(props) => props.theme.paddingRight};
|
|
11031
11299
|
border-left: 2px solid ${(props) => props.theme.dividerBorderColor};
|
|
11032
11300
|
`;
|
|
11033
|
-
var ListColumn =
|
|
11301
|
+
var ListColumn = styled60.ul`
|
|
11034
11302
|
display: flex;
|
|
11035
11303
|
flex-direction: column;
|
|
11036
11304
|
gap: 0.5rem;
|
|
@@ -11038,14 +11306,14 @@ var ListColumn = styled59.ul`
|
|
|
11038
11306
|
padding: 0;
|
|
11039
11307
|
list-style-type: none;
|
|
11040
11308
|
`;
|
|
11041
|
-
var ListSecondColumn =
|
|
11309
|
+
var ListSecondColumn = styled60.ul`
|
|
11042
11310
|
display: flex;
|
|
11043
11311
|
flex-direction: column;
|
|
11044
11312
|
margin: 0;
|
|
11045
11313
|
padding: 0;
|
|
11046
11314
|
list-style-type: none;
|
|
11047
11315
|
`;
|
|
11048
|
-
var Link3 =
|
|
11316
|
+
var Link3 = styled60.a`
|
|
11049
11317
|
text-decoration: none;
|
|
11050
11318
|
font-size: ${(props) => props.theme.fontSize};
|
|
11051
11319
|
font-family: ${(props) => props.theme.fontFamily};
|
|
@@ -11072,13 +11340,13 @@ var Link3 = styled59.a`
|
|
|
11072
11340
|
var QuickNav_default = DxcQuickNav;
|
|
11073
11341
|
|
|
11074
11342
|
// src/radio-group/RadioGroup.tsx
|
|
11075
|
-
import { forwardRef as forwardRef13, useCallback as useCallback10, useContext as
|
|
11076
|
-
import
|
|
11343
|
+
import { forwardRef as forwardRef13, useCallback as useCallback10, useContext as useContext44, useId as useId17, useMemo as useMemo16, useState as useState29 } from "react";
|
|
11344
|
+
import styled62, { ThemeProvider as ThemeProvider31 } from "styled-components";
|
|
11077
11345
|
|
|
11078
11346
|
// src/radio-group/Radio.tsx
|
|
11079
|
-
import { memo as memo11, useContext as
|
|
11080
|
-
import
|
|
11081
|
-
import { jsx as
|
|
11347
|
+
import { memo as memo11, useContext as useContext43, useEffect as useEffect21, useId as useId16, useRef as useRef17, useState as useState28 } from "react";
|
|
11348
|
+
import styled61, { ThemeProvider as ThemeProvider30 } from "styled-components";
|
|
11349
|
+
import { jsx as jsx68, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
11082
11350
|
var DxcRadio = ({
|
|
11083
11351
|
label,
|
|
11084
11352
|
checked,
|
|
@@ -11089,14 +11357,14 @@ var DxcRadio = ({
|
|
|
11089
11357
|
readOnly,
|
|
11090
11358
|
tabIndex
|
|
11091
11359
|
}) => {
|
|
11092
|
-
const radioLabelId = `radio-${
|
|
11360
|
+
const radioLabelId = `radio-${useId16()}`;
|
|
11093
11361
|
const ref = useRef17(null);
|
|
11094
|
-
const colorsTheme =
|
|
11362
|
+
const colorsTheme = useContext43(HalstackContext);
|
|
11095
11363
|
const handleOnClick = () => {
|
|
11096
11364
|
onClick();
|
|
11097
11365
|
document.activeElement !== ref.current && ref.current?.focus();
|
|
11098
11366
|
};
|
|
11099
|
-
const [firstUpdate, setFirstUpdate] =
|
|
11367
|
+
const [firstUpdate, setFirstUpdate] = useState28(true);
|
|
11100
11368
|
useEffect21(() => {
|
|
11101
11369
|
if (firstUpdate) {
|
|
11102
11370
|
setFirstUpdate(false);
|
|
@@ -11104,7 +11372,7 @@ var DxcRadio = ({
|
|
|
11104
11372
|
}
|
|
11105
11373
|
focused && ref.current?.focus();
|
|
11106
11374
|
}, [focused]);
|
|
11107
|
-
return /* @__PURE__ */
|
|
11375
|
+
return /* @__PURE__ */ jsx68(ThemeProvider30, { theme: colorsTheme.radioGroup, children: /* @__PURE__ */ jsx68(Flex_default, { children: /* @__PURE__ */ jsxs47(
|
|
11108
11376
|
RadioContainer,
|
|
11109
11377
|
{
|
|
11110
11378
|
error,
|
|
@@ -11112,7 +11380,7 @@ var DxcRadio = ({
|
|
|
11112
11380
|
readOnly,
|
|
11113
11381
|
onClick: disabled ? void 0 : handleOnClick,
|
|
11114
11382
|
children: [
|
|
11115
|
-
/* @__PURE__ */
|
|
11383
|
+
/* @__PURE__ */ jsx68(RadioInputContainer, { children: /* @__PURE__ */ jsx68(
|
|
11116
11384
|
RadioInput,
|
|
11117
11385
|
{
|
|
11118
11386
|
error,
|
|
@@ -11124,10 +11392,10 @@ var DxcRadio = ({
|
|
|
11124
11392
|
"aria-labelledby": radioLabelId,
|
|
11125
11393
|
tabIndex: disabled ? -1 : focused ? tabIndex : -1,
|
|
11126
11394
|
ref,
|
|
11127
|
-
children: checked && /* @__PURE__ */
|
|
11395
|
+
children: checked && /* @__PURE__ */ jsx68(Dot, { disabled, readOnly, error })
|
|
11128
11396
|
}
|
|
11129
11397
|
) }),
|
|
11130
|
-
/* @__PURE__ */
|
|
11398
|
+
/* @__PURE__ */ jsx68(Label8, { id: radioLabelId, disabled, children: label })
|
|
11131
11399
|
]
|
|
11132
11400
|
}
|
|
11133
11401
|
) }) });
|
|
@@ -11142,14 +11410,14 @@ var getRadioInputStateColor = (props, state) => {
|
|
|
11142
11410
|
return props.error ? props.theme.activeErrorRadioInputColor : props.readOnly ? props.theme.activeReadOnlyRadioInputColor : props.theme.activeRadioInputColor;
|
|
11143
11411
|
}
|
|
11144
11412
|
};
|
|
11145
|
-
var RadioInputContainer =
|
|
11413
|
+
var RadioInputContainer = styled61.span`
|
|
11146
11414
|
display: flex;
|
|
11147
11415
|
align-items: center;
|
|
11148
11416
|
justify-content: center;
|
|
11149
11417
|
height: 24px;
|
|
11150
11418
|
width: 24px;
|
|
11151
11419
|
`;
|
|
11152
|
-
var RadioInput =
|
|
11420
|
+
var RadioInput = styled61.span`
|
|
11153
11421
|
box-sizing: border-box;
|
|
11154
11422
|
display: flex;
|
|
11155
11423
|
align-items: center;
|
|
@@ -11165,13 +11433,13 @@ var RadioInput = styled60.span`
|
|
|
11165
11433
|
}
|
|
11166
11434
|
${(props) => props.disabled && "pointer-events: none;"}
|
|
11167
11435
|
`;
|
|
11168
|
-
var Dot =
|
|
11436
|
+
var Dot = styled61.span`
|
|
11169
11437
|
height: 10px;
|
|
11170
11438
|
width: 10px;
|
|
11171
11439
|
border-radius: 50%;
|
|
11172
11440
|
background-color: ${(props) => getRadioInputStateColor(props, "enabled")};
|
|
11173
11441
|
`;
|
|
11174
|
-
var Label8 =
|
|
11442
|
+
var Label8 = styled61.span`
|
|
11175
11443
|
margin-left: ${(props) => props.theme.radioInputLabelMargin};
|
|
11176
11444
|
font-family: ${(props) => props.theme.fontFamily};
|
|
11177
11445
|
font-size: ${(props) => props.theme.radioInputLabelFontSize};
|
|
@@ -11180,7 +11448,7 @@ var Label8 = styled60.span`
|
|
|
11180
11448
|
line-height: ${(props) => props.theme.radioInputLabelLineHeight};
|
|
11181
11449
|
${(props) => props.disabled ? `color: ${props.theme.disabledRadioInputLabelFontColor};` : `color: ${props.theme.radioInputLabelFontColor}`}
|
|
11182
11450
|
`;
|
|
11183
|
-
var RadioContainer =
|
|
11451
|
+
var RadioContainer = styled61.span`
|
|
11184
11452
|
display: inline-flex;
|
|
11185
11453
|
align-items: center;
|
|
11186
11454
|
cursor: ${(props) => props.disabled ? "not-allowed" : props.readOnly ? "default" : "pointer"};
|
|
@@ -11205,7 +11473,7 @@ var RadioContainer = styled60.span`
|
|
|
11205
11473
|
var Radio_default = memo11(DxcRadio);
|
|
11206
11474
|
|
|
11207
11475
|
// src/radio-group/RadioGroup.tsx
|
|
11208
|
-
import { jsx as
|
|
11476
|
+
import { jsx as jsx69, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
11209
11477
|
var getInitialFocusIndex = (innerOptions, value) => {
|
|
11210
11478
|
const initialSelectedOptionIndex = innerOptions.findIndex((option) => option.value === value);
|
|
11211
11479
|
return initialSelectedOptionIndex !== -1 ? initialSelectedOptionIndex : 0;
|
|
@@ -11229,14 +11497,14 @@ var DxcRadioGroup = forwardRef13(
|
|
|
11229
11497
|
tabIndex = 0,
|
|
11230
11498
|
ariaLabel = "Radio group"
|
|
11231
11499
|
}, ref) => {
|
|
11232
|
-
const radioGroupId = `radio-group-${
|
|
11500
|
+
const radioGroupId = `radio-group-${useId17()}`;
|
|
11233
11501
|
const radioGroupLabelId = `label-${radioGroupId}`;
|
|
11234
11502
|
const errorId = `error-${radioGroupId}`;
|
|
11235
|
-
const [innerValue, setInnerValue] =
|
|
11236
|
-
const [firstTimeFocus, setFirstTimeFocus] =
|
|
11237
|
-
const colorsTheme =
|
|
11238
|
-
const translatedLabels =
|
|
11239
|
-
const innerOptions =
|
|
11503
|
+
const [innerValue, setInnerValue] = useState29(defaultValue);
|
|
11504
|
+
const [firstTimeFocus, setFirstTimeFocus] = useState29(true);
|
|
11505
|
+
const colorsTheme = useContext44(HalstackContext);
|
|
11506
|
+
const translatedLabels = useContext44(HalstackLanguageContext);
|
|
11507
|
+
const innerOptions = useMemo16(
|
|
11240
11508
|
() => optional ? [
|
|
11241
11509
|
...options,
|
|
11242
11510
|
{
|
|
@@ -11247,7 +11515,7 @@ var DxcRadioGroup = forwardRef13(
|
|
|
11247
11515
|
] : options,
|
|
11248
11516
|
[optional, options, optionalItemLabel, translatedLabels]
|
|
11249
11517
|
);
|
|
11250
|
-
const [currentFocusIndex, setCurrentFocusIndex] =
|
|
11518
|
+
const [currentFocusIndex, setCurrentFocusIndex] = useState29(getInitialFocusIndex(innerOptions, value ?? innerValue));
|
|
11251
11519
|
const handleOnChange = useCallback10(
|
|
11252
11520
|
(newValue) => {
|
|
11253
11521
|
const currentValue = value ?? innerValue;
|
|
@@ -11331,13 +11599,13 @@ var DxcRadioGroup = forwardRef13(
|
|
|
11331
11599
|
break;
|
|
11332
11600
|
}
|
|
11333
11601
|
};
|
|
11334
|
-
return /* @__PURE__ */
|
|
11335
|
-
label && /* @__PURE__ */
|
|
11602
|
+
return /* @__PURE__ */ jsx69(ThemeProvider31, { theme: colorsTheme.radioGroup, children: /* @__PURE__ */ jsxs48(RadioGroupContainer, { ref, children: [
|
|
11603
|
+
label && /* @__PURE__ */ jsxs48(Label9, { id: radioGroupLabelId, helperText, disabled, children: [
|
|
11336
11604
|
label,
|
|
11337
|
-
optional && /* @__PURE__ */
|
|
11605
|
+
optional && /* @__PURE__ */ jsx69(OptionalLabel4, { children: ` ${translatedLabels.formFields.optionalLabel}` })
|
|
11338
11606
|
] }),
|
|
11339
|
-
helperText && /* @__PURE__ */
|
|
11340
|
-
/* @__PURE__ */
|
|
11607
|
+
helperText && /* @__PURE__ */ jsx69(HelperText6, { disabled, children: helperText }),
|
|
11608
|
+
/* @__PURE__ */ jsxs48(
|
|
11341
11609
|
RadioGroup,
|
|
11342
11610
|
{
|
|
11343
11611
|
onBlur: handleOnBlur,
|
|
@@ -11354,8 +11622,8 @@ var DxcRadioGroup = forwardRef13(
|
|
|
11354
11622
|
"aria-orientation": stacking === "column" ? "vertical" : "horizontal",
|
|
11355
11623
|
"aria-label": label ? void 0 : ariaLabel,
|
|
11356
11624
|
children: [
|
|
11357
|
-
/* @__PURE__ */
|
|
11358
|
-
innerOptions.map((option, index) => /* @__PURE__ */
|
|
11625
|
+
/* @__PURE__ */ jsx69(ValueInput3, { name, disabled, value: value ?? innerValue ?? "", readOnly: true }),
|
|
11626
|
+
innerOptions.map((option, index) => /* @__PURE__ */ jsx69(
|
|
11359
11627
|
Radio_default,
|
|
11360
11628
|
{
|
|
11361
11629
|
label: option.label ?? "",
|
|
@@ -11375,16 +11643,16 @@ var DxcRadioGroup = forwardRef13(
|
|
|
11375
11643
|
]
|
|
11376
11644
|
}
|
|
11377
11645
|
),
|
|
11378
|
-
!disabled && typeof error === "string" && /* @__PURE__ */
|
|
11646
|
+
!disabled && typeof error === "string" && /* @__PURE__ */ jsx69(ErrorMessageContainer2, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
|
|
11379
11647
|
] }) });
|
|
11380
11648
|
}
|
|
11381
11649
|
);
|
|
11382
|
-
var RadioGroupContainer =
|
|
11650
|
+
var RadioGroupContainer = styled62.div`
|
|
11383
11651
|
box-sizing: border-box;
|
|
11384
11652
|
display: inline-flex;
|
|
11385
11653
|
flex-direction: column;
|
|
11386
11654
|
`;
|
|
11387
|
-
var Label9 =
|
|
11655
|
+
var Label9 = styled62.span`
|
|
11388
11656
|
color: ${(props) => props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor};
|
|
11389
11657
|
font-family: ${(props) => props.theme.fontFamily};
|
|
11390
11658
|
font-size: ${(props) => props.theme.labelFontSize};
|
|
@@ -11393,10 +11661,10 @@ var Label9 = styled61.span`
|
|
|
11393
11661
|
line-height: ${(props) => props.theme.labelLineHeight};
|
|
11394
11662
|
${(props) => !props.helperText && `margin-bottom: ${props.theme.groupLabelMargin}`}
|
|
11395
11663
|
`;
|
|
11396
|
-
var OptionalLabel4 =
|
|
11664
|
+
var OptionalLabel4 = styled62.span`
|
|
11397
11665
|
font-weight: ${(props) => props.theme.optionalLabelFontWeight};
|
|
11398
11666
|
`;
|
|
11399
|
-
var HelperText6 =
|
|
11667
|
+
var HelperText6 = styled62.span`
|
|
11400
11668
|
color: ${(props) => props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor};
|
|
11401
11669
|
font-family: ${(props) => props.theme.fontFamily};
|
|
11402
11670
|
font-size: ${(props) => props.theme.helperTextFontSize};
|
|
@@ -11405,17 +11673,17 @@ var HelperText6 = styled61.span`
|
|
|
11405
11673
|
line-height: ${(props) => props.theme.helperTextLineHeight};
|
|
11406
11674
|
margin-bottom: ${(props) => props.theme.groupLabelMargin};
|
|
11407
11675
|
`;
|
|
11408
|
-
var RadioGroup =
|
|
11676
|
+
var RadioGroup = styled62.div`
|
|
11409
11677
|
display: flex;
|
|
11410
11678
|
flex-wrap: wrap;
|
|
11411
11679
|
flex-direction: ${(props) => props.stacking};
|
|
11412
11680
|
row-gap: ${(props) => props.theme.groupVerticalGutter};
|
|
11413
11681
|
column-gap: ${(props) => props.theme.groupHorizontalGutter};
|
|
11414
11682
|
`;
|
|
11415
|
-
var ValueInput3 =
|
|
11683
|
+
var ValueInput3 = styled62.input`
|
|
11416
11684
|
display: none;
|
|
11417
11685
|
`;
|
|
11418
|
-
var ErrorMessageContainer2 =
|
|
11686
|
+
var ErrorMessageContainer2 = styled62.span`
|
|
11419
11687
|
min-height: 1.5em;
|
|
11420
11688
|
color: ${(props) => props.theme.errorMessageColor};
|
|
11421
11689
|
font-family: ${(props) => props.theme.fontFamily};
|
|
@@ -11427,29 +11695,20 @@ var ErrorMessageContainer2 = styled61.span`
|
|
|
11427
11695
|
var RadioGroup_default = DxcRadioGroup;
|
|
11428
11696
|
|
|
11429
11697
|
// src/resultset-table/ResultsetTable.tsx
|
|
11430
|
-
import { useContext as
|
|
11431
|
-
import
|
|
11698
|
+
import { useContext as useContext45, useEffect as useEffect22, useMemo as useMemo17, useRef as useRef18, useState as useState30 } from "react";
|
|
11699
|
+
import styled63, { ThemeProvider as ThemeProvider32 } from "styled-components";
|
|
11432
11700
|
|
|
11433
11701
|
// src/resultset-table/Icons.tsx
|
|
11434
|
-
import { jsx as
|
|
11702
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
11435
11703
|
var icons = {
|
|
11436
|
-
arrowUp: /* @__PURE__ */
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
] }),
|
|
11440
|
-
arrowDown: /* @__PURE__ */ jsxs48("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", fill: "currentColor", children: [
|
|
11441
|
-
/* @__PURE__ */ jsx69("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
11442
|
-
/* @__PURE__ */ jsx69("path", { d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z" })
|
|
11443
|
-
] }),
|
|
11444
|
-
bothArrows: /* @__PURE__ */ jsxs48("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", fill: "currentColor", children: [
|
|
11445
|
-
/* @__PURE__ */ jsx69("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
11446
|
-
/* @__PURE__ */ jsx69("path", { d: "M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z" })
|
|
11447
|
-
] })
|
|
11704
|
+
arrowUp: /* @__PURE__ */ jsx70(Icon_default, { icon: "arrow_upward" }),
|
|
11705
|
+
arrowDown: /* @__PURE__ */ jsx70(Icon_default, { icon: "arrow_downward" }),
|
|
11706
|
+
bothArrows: /* @__PURE__ */ jsx70(Icon_default, { icon: "unfold_more" })
|
|
11448
11707
|
};
|
|
11449
11708
|
var Icons_default2 = icons;
|
|
11450
11709
|
|
|
11451
11710
|
// src/resultset-table/ResultsetTable.tsx
|
|
11452
|
-
import { jsx as
|
|
11711
|
+
import { jsx as jsx71, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
11453
11712
|
var normalizeSortValue = (sortValue) => typeof sortValue === "string" ? sortValue.toUpperCase() : sortValue;
|
|
11454
11713
|
var isDateType = (value) => value instanceof Date;
|
|
11455
11714
|
var sortArray = (index, order, resultset) => resultset.slice().sort((element1, element2) => {
|
|
@@ -11492,22 +11751,22 @@ var DxcResultsetTable = ({
|
|
|
11492
11751
|
tabIndex = 0,
|
|
11493
11752
|
mode = "default"
|
|
11494
11753
|
}) => {
|
|
11495
|
-
const colorsTheme =
|
|
11496
|
-
const [page, changePage] =
|
|
11497
|
-
const [sortColumnIndex, changeSortColumnIndex] =
|
|
11498
|
-
const [sortOrder, changeSortOrder] =
|
|
11754
|
+
const colorsTheme = useContext45(HalstackContext);
|
|
11755
|
+
const [page, changePage] = useState30(1);
|
|
11756
|
+
const [sortColumnIndex, changeSortColumnIndex] = useState30(-1);
|
|
11757
|
+
const [sortOrder, changeSortOrder] = useState30("ascending");
|
|
11499
11758
|
const prevRowCountRef = useRef18(rows.length);
|
|
11500
|
-
const rowsWithIds =
|
|
11501
|
-
const minItemsPerPageIndex =
|
|
11502
|
-
const maxItemsPerPageIndex =
|
|
11759
|
+
const rowsWithIds = useMemo17(() => assignIdsToRows(rows), [rows]);
|
|
11760
|
+
const minItemsPerPageIndex = useMemo17(() => getMinItemsPerPageIndex2(page, itemsPerPage, page), [itemsPerPage, page]);
|
|
11761
|
+
const maxItemsPerPageIndex = useMemo17(
|
|
11503
11762
|
() => getMaxItemsPerPageIndex2(minItemsPerPageIndex, itemsPerPage, rows, page),
|
|
11504
11763
|
[itemsPerPage, minItemsPerPageIndex, page, rows]
|
|
11505
11764
|
);
|
|
11506
|
-
const sortedResultset =
|
|
11765
|
+
const sortedResultset = useMemo17(
|
|
11507
11766
|
() => sortColumnIndex !== -1 ? sortArray(sortColumnIndex, sortOrder, rowsWithIds) : rowsWithIds,
|
|
11508
11767
|
[sortColumnIndex, sortOrder, rowsWithIds]
|
|
11509
11768
|
);
|
|
11510
|
-
const filteredResultset =
|
|
11769
|
+
const filteredResultset = useMemo17(
|
|
11511
11770
|
() => sortedResultset && sortedResultset.slice(minItemsPerPageIndex, maxItemsPerPageIndex + 1),
|
|
11512
11771
|
[sortedResultset, minItemsPerPageIndex, maxItemsPerPageIndex]
|
|
11513
11772
|
);
|
|
@@ -11537,9 +11796,9 @@ var DxcResultsetTable = ({
|
|
|
11537
11796
|
prevRowCountRef.current = rows.length;
|
|
11538
11797
|
}
|
|
11539
11798
|
}, [rows.length]);
|
|
11540
|
-
return /* @__PURE__ */
|
|
11799
|
+
return /* @__PURE__ */ jsx71(ThemeProvider32, { theme: colorsTheme.table, children: /* @__PURE__ */ jsxs49(DxcResultsetTableContainer, { margin, children: [
|
|
11541
11800
|
/* @__PURE__ */ jsxs49(Table_default, { mode, children: [
|
|
11542
|
-
/* @__PURE__ */
|
|
11801
|
+
/* @__PURE__ */ jsx71("thead", { children: /* @__PURE__ */ jsx71("tr", { children: columns.map((column, index) => /* @__PURE__ */ jsx71(
|
|
11543
11802
|
"th",
|
|
11544
11803
|
{
|
|
11545
11804
|
"aria-sort": column.isSortable ? sortColumnIndex === index ? sortOrder : "none" : void 0,
|
|
@@ -11558,16 +11817,16 @@ var DxcResultsetTable = ({
|
|
|
11558
11817
|
"aria-label": column.isSortable ? "Sort column" : void 0,
|
|
11559
11818
|
children: [
|
|
11560
11819
|
column.displayValue,
|
|
11561
|
-
column.isSortable && /* @__PURE__ */
|
|
11820
|
+
column.isSortable && /* @__PURE__ */ jsx71(SortIcon, { children: sortColumnIndex === index ? sortOrder === "ascending" ? Icons_default2.arrowUp : Icons_default2.arrowDown : Icons_default2.bothArrows })
|
|
11562
11821
|
]
|
|
11563
11822
|
}
|
|
11564
11823
|
)
|
|
11565
11824
|
},
|
|
11566
11825
|
`tableHeader_${index}`
|
|
11567
11826
|
)) }) }),
|
|
11568
|
-
/* @__PURE__ */
|
|
11827
|
+
/* @__PURE__ */ jsx71("tbody", { children: filteredResultset.map((row) => /* @__PURE__ */ jsx71("tr", { children: row.cells.map((cellContent, cellIndex) => /* @__PURE__ */ jsx71("td", { children: cellContent.displayValue }, `resultSetTableCellContent_${cellIndex}`)) }, `resultSetTableCell_${row.id}`)) })
|
|
11569
11828
|
] }),
|
|
11570
|
-
!hidePaginator && /* @__PURE__ */
|
|
11829
|
+
!hidePaginator && (itemsPerPageOptions?.some((itemsPerPage2) => rows.length > itemsPerPage2) || rows.length > itemsPerPage) && /* @__PURE__ */ jsx71(
|
|
11571
11830
|
Paginator_default,
|
|
11572
11831
|
{
|
|
11573
11832
|
totalItems: rows.length,
|
|
@@ -11583,7 +11842,7 @@ var DxcResultsetTable = ({
|
|
|
11583
11842
|
] }) });
|
|
11584
11843
|
};
|
|
11585
11844
|
var calculateWidth10 = (margin) => `calc(100% - ${getMargin(margin, "left")} - ${getMargin(margin, "right")})`;
|
|
11586
|
-
var DxcResultsetTableContainer =
|
|
11845
|
+
var DxcResultsetTableContainer = styled63.div`
|
|
11587
11846
|
width: ${(props) => calculateWidth10(props.margin)};
|
|
11588
11847
|
margin: ${(props) => props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px"};
|
|
11589
11848
|
margin-top: ${(props) => props.margin && typeof props.margin === "object" && props.margin.top ? spaces[props.margin.top] : ""};
|
|
@@ -11591,7 +11850,7 @@ var DxcResultsetTableContainer = styled62.div`
|
|
|
11591
11850
|
margin-bottom: ${(props) => props.margin && typeof props.margin === "object" && props.margin.bottom ? spaces[props.margin.bottom] : ""};
|
|
11592
11851
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
11593
11852
|
`;
|
|
11594
|
-
var HeaderContainer3 =
|
|
11853
|
+
var HeaderContainer3 = styled63.span`
|
|
11595
11854
|
display: flex;
|
|
11596
11855
|
align-items: center;
|
|
11597
11856
|
justify-content: ${(props) => props.theme.headerTextAlign === "center" ? "center" : props.theme.headerTextAlign === "right" ? "flex-end" : "flex-start"};
|
|
@@ -11605,7 +11864,7 @@ var HeaderContainer3 = styled62.span`
|
|
|
11605
11864
|
outline: #0095ff solid 2px;
|
|
11606
11865
|
}`}
|
|
11607
11866
|
`;
|
|
11608
|
-
var SortIcon =
|
|
11867
|
+
var SortIcon = styled63.span`
|
|
11609
11868
|
display: flex;
|
|
11610
11869
|
height: 14px;
|
|
11611
11870
|
width: 14px;
|
|
@@ -11620,9 +11879,9 @@ DxcResultsetTable.ActionsCell = DxcActionsCell;
|
|
|
11620
11879
|
var ResultsetTable_default = DxcResultsetTable;
|
|
11621
11880
|
|
|
11622
11881
|
// src/slider/Slider.tsx
|
|
11623
|
-
import { forwardRef as forwardRef14, useContext as
|
|
11624
|
-
import
|
|
11625
|
-
import { jsx as
|
|
11882
|
+
import { forwardRef as forwardRef14, useContext as useContext46, useId as useId18, useMemo as useMemo18, useState as useState31 } from "react";
|
|
11883
|
+
import styled64, { ThemeProvider as ThemeProvider33 } from "styled-components";
|
|
11884
|
+
import { jsx as jsx72, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
11626
11885
|
var sizes6 = {
|
|
11627
11886
|
medium: "360px",
|
|
11628
11887
|
large: "480px",
|
|
@@ -11635,7 +11894,7 @@ var getChromeStyles = () => `
|
|
|
11635
11894
|
var getFirefoxStyles = () => `
|
|
11636
11895
|
width: calc(100% - 16px);
|
|
11637
11896
|
margin-right: 3px;`;
|
|
11638
|
-
var Container3 =
|
|
11897
|
+
var Container3 = styled64.div`
|
|
11639
11898
|
display: flex;
|
|
11640
11899
|
flex-direction: column;
|
|
11641
11900
|
margin: ${(props) => props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px"};
|
|
@@ -11645,7 +11904,7 @@ var Container3 = styled63.div`
|
|
|
11645
11904
|
margin-left: ${(props) => props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : ""};
|
|
11646
11905
|
width: ${(props) => calculateWidth11(props.margin, props.size)};
|
|
11647
11906
|
`;
|
|
11648
|
-
var Label10 =
|
|
11907
|
+
var Label10 = styled64.label`
|
|
11649
11908
|
color: ${(props) => props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor};
|
|
11650
11909
|
font-family: ${(props) => props.theme.fontFamily};
|
|
11651
11910
|
font-size: ${(props) => props.theme.labelFontSize};
|
|
@@ -11653,7 +11912,7 @@ var Label10 = styled63.label`
|
|
|
11653
11912
|
font-weight: ${(props) => props.theme.labelFontWeight};
|
|
11654
11913
|
line-height: ${(props) => props.theme.labelLineHeight};
|
|
11655
11914
|
`;
|
|
11656
|
-
var HelperText7 =
|
|
11915
|
+
var HelperText7 = styled64.span`
|
|
11657
11916
|
color: ${(props) => props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor};
|
|
11658
11917
|
font-family: ${(props) => props.theme.fontFamily};
|
|
11659
11918
|
font-size: ${(props) => props.theme.helperTextFontSize};
|
|
@@ -11661,7 +11920,7 @@ var HelperText7 = styled63.span`
|
|
|
11661
11920
|
font-weight: ${(props) => props.theme.helperTextFontWeight};
|
|
11662
11921
|
line-height: ${(props) => props.theme.helperTextLineHeight};
|
|
11663
11922
|
`;
|
|
11664
|
-
var SliderInput =
|
|
11923
|
+
var SliderInput = styled64.input`
|
|
11665
11924
|
width: 100%;
|
|
11666
11925
|
min-width: 240px;
|
|
11667
11926
|
height: ${(props) => props.theme.trackLineThickness};
|
|
@@ -11739,12 +11998,12 @@ var SliderInput = styled63.input`
|
|
|
11739
11998
|
}
|
|
11740
11999
|
}
|
|
11741
12000
|
`;
|
|
11742
|
-
var SliderContainer =
|
|
12001
|
+
var SliderContainer = styled64.div`
|
|
11743
12002
|
display: flex;
|
|
11744
12003
|
height: 48px;
|
|
11745
12004
|
align-items: center;
|
|
11746
12005
|
`;
|
|
11747
|
-
var LimitLabelContainer =
|
|
12006
|
+
var LimitLabelContainer = styled64.span`
|
|
11748
12007
|
color: ${(props) => props.disabled ? props.theme.disabledLimitValuesFontColor : props.theme.limitValuesFontColor};
|
|
11749
12008
|
font-family: ${(props) => props.theme.fontFamily};
|
|
11750
12009
|
font-size: ${(props) => props.theme.limitValuesFontSize};
|
|
@@ -11753,13 +12012,13 @@ var LimitLabelContainer = styled63.span`
|
|
|
11753
12012
|
letter-spacing: ${(props) => props.theme.limitValuesFontLetterSpacing};
|
|
11754
12013
|
white-space: nowrap;
|
|
11755
12014
|
`;
|
|
11756
|
-
var MinLabelContainer =
|
|
12015
|
+
var MinLabelContainer = styled64(LimitLabelContainer)`
|
|
11757
12016
|
margin-right: ${(props) => props.theme.floorLabelMarginRight};
|
|
11758
12017
|
`;
|
|
11759
|
-
var MaxLabelContainer =
|
|
12018
|
+
var MaxLabelContainer = styled64(LimitLabelContainer)`
|
|
11760
12019
|
margin-left: ${(props) => props.step === 1 ? props.theme.ceilLabelMarginLeft : "1.25rem"};
|
|
11761
12020
|
`;
|
|
11762
|
-
var SliderInputContainer =
|
|
12021
|
+
var SliderInputContainer = styled64.div`
|
|
11763
12022
|
position: relative;
|
|
11764
12023
|
width: 100%;
|
|
11765
12024
|
height: 24px;
|
|
@@ -11770,7 +12029,7 @@ var SliderInputContainer = styled63.div`
|
|
|
11770
12029
|
padding-top: 1px;
|
|
11771
12030
|
z-index: 0;
|
|
11772
12031
|
`;
|
|
11773
|
-
var MarksContainer =
|
|
12032
|
+
var MarksContainer = styled64.div`
|
|
11774
12033
|
${(props) => props.isFirefox ? getFirefoxStyles() : getChromeStyles()}
|
|
11775
12034
|
position: absolute;
|
|
11776
12035
|
pointer-events: none;
|
|
@@ -11778,7 +12037,7 @@ var MarksContainer = styled63.div`
|
|
|
11778
12037
|
display: flex;
|
|
11779
12038
|
align-items: center;
|
|
11780
12039
|
`;
|
|
11781
|
-
var TickMark =
|
|
12040
|
+
var TickMark = styled64.span`
|
|
11782
12041
|
position: absolute;
|
|
11783
12042
|
background: ${(props) => props.disabled ? props.theme.disabledTickBackgroundColor : props.theme.tickBackgroundColor};
|
|
11784
12043
|
height: ${(props) => props.theme.tickHeight};
|
|
@@ -11787,7 +12046,7 @@ var TickMark = styled63.span`
|
|
|
11787
12046
|
left: ${(props) => `calc(${props.stepPosition} * 100%)`};
|
|
11788
12047
|
z-index: ${(props) => props.stepValue != null && `${props.stepPosition <= props.stepValue ? "-1" : "0"}`};
|
|
11789
12048
|
`;
|
|
11790
|
-
var TextInputContainer2 =
|
|
12049
|
+
var TextInputContainer2 = styled64.div`
|
|
11791
12050
|
margin-left: ${(props) => props.theme.inputMarginLeft};
|
|
11792
12051
|
max-width: 70px;
|
|
11793
12052
|
`;
|
|
@@ -11812,27 +12071,27 @@ var DxcSlider = forwardRef14(
|
|
|
11812
12071
|
size = "fillParent",
|
|
11813
12072
|
ariaLabel = "Slider"
|
|
11814
12073
|
}, ref) => {
|
|
11815
|
-
const labelId = `label-${
|
|
11816
|
-
const [innerValue, setInnerValue] =
|
|
11817
|
-
const [dragging, setDragging] =
|
|
11818
|
-
const colorsTheme =
|
|
12074
|
+
const labelId = `label-${useId18()}`;
|
|
12075
|
+
const [innerValue, setInnerValue] = useState31(defaultValue ?? 0);
|
|
12076
|
+
const [dragging, setDragging] = useState31(false);
|
|
12077
|
+
const colorsTheme = useContext46(HalstackContext);
|
|
11819
12078
|
const isFirefox = navigator.userAgent.indexOf("Firefox") !== -1;
|
|
11820
|
-
const minLabel =
|
|
12079
|
+
const minLabel = useMemo18(
|
|
11821
12080
|
() => labelFormatCallback ? labelFormatCallback(minValue) : minValue,
|
|
11822
12081
|
[labelFormatCallback, minValue]
|
|
11823
12082
|
);
|
|
11824
|
-
const maxLabel =
|
|
12083
|
+
const maxLabel = useMemo18(
|
|
11825
12084
|
() => labelFormatCallback ? labelFormatCallback(maxValue) : maxValue,
|
|
11826
12085
|
[labelFormatCallback, maxValue]
|
|
11827
12086
|
);
|
|
11828
|
-
const tickMarks =
|
|
12087
|
+
const tickMarks = useMemo18(() => {
|
|
11829
12088
|
const numberOfMarks = Math.floor(maxValue / step - minValue / step);
|
|
11830
12089
|
const range = maxValue - minValue;
|
|
11831
12090
|
const ticks = [];
|
|
11832
12091
|
if (marks) {
|
|
11833
12092
|
for (let index = 0; index <= numberOfMarks; index++) {
|
|
11834
12093
|
ticks.push(
|
|
11835
|
-
/* @__PURE__ */
|
|
12094
|
+
/* @__PURE__ */ jsx72(
|
|
11836
12095
|
TickMark,
|
|
11837
12096
|
{
|
|
11838
12097
|
disabled,
|
|
@@ -11871,13 +12130,13 @@ var DxcSlider = forwardRef14(
|
|
|
11871
12130
|
onChange?.(intValue > maxValue ? maxValue : intValue);
|
|
11872
12131
|
}
|
|
11873
12132
|
};
|
|
11874
|
-
return /* @__PURE__ */
|
|
11875
|
-
label && /* @__PURE__ */
|
|
11876
|
-
/* @__PURE__ */
|
|
12133
|
+
return /* @__PURE__ */ jsx72(ThemeProvider33, { theme: colorsTheme.slider, children: /* @__PURE__ */ jsxs50(Container3, { margin, size, ref, children: [
|
|
12134
|
+
label && /* @__PURE__ */ jsx72(Label10, { id: labelId, disabled, children: label }),
|
|
12135
|
+
/* @__PURE__ */ jsx72(HelperText7, { disabled, children: helperText }),
|
|
11877
12136
|
/* @__PURE__ */ jsxs50(SliderContainer, { children: [
|
|
11878
|
-
showLimitsValues && /* @__PURE__ */
|
|
12137
|
+
showLimitsValues && /* @__PURE__ */ jsx72(MinLabelContainer, { disabled, children: minLabel }),
|
|
11879
12138
|
/* @__PURE__ */ jsxs50(SliderInputContainer, { children: [
|
|
11880
|
-
/* @__PURE__ */
|
|
12139
|
+
/* @__PURE__ */ jsx72(
|
|
11881
12140
|
SliderInput,
|
|
11882
12141
|
{
|
|
11883
12142
|
role: "slider",
|
|
@@ -11898,10 +12157,10 @@ var DxcSlider = forwardRef14(
|
|
|
11898
12157
|
onMouseDown: handleSliderDragging
|
|
11899
12158
|
}
|
|
11900
12159
|
),
|
|
11901
|
-
marks && /* @__PURE__ */
|
|
12160
|
+
marks && /* @__PURE__ */ jsx72(MarksContainer, { isFirefox, children: tickMarks })
|
|
11902
12161
|
] }),
|
|
11903
|
-
showLimitsValues && /* @__PURE__ */
|
|
11904
|
-
showInput && /* @__PURE__ */
|
|
12162
|
+
showLimitsValues && /* @__PURE__ */ jsx72(MaxLabelContainer, { disabled, step, children: maxLabel }),
|
|
12163
|
+
showInput && /* @__PURE__ */ jsx72(TextInputContainer2, { children: /* @__PURE__ */ jsx72(
|
|
11905
12164
|
TextInput_default,
|
|
11906
12165
|
{
|
|
11907
12166
|
name,
|
|
@@ -11917,217 +12176,11 @@ var DxcSlider = forwardRef14(
|
|
|
11917
12176
|
);
|
|
11918
12177
|
var Slider_default = DxcSlider;
|
|
11919
12178
|
|
|
11920
|
-
// src/spinner/Spinner.tsx
|
|
11921
|
-
import { useContext as useContext46, useId as useId18, useMemo as useMemo18 } from "react";
|
|
11922
|
-
import styled64, { ThemeProvider as ThemeProvider33 } from "styled-components";
|
|
11923
|
-
import { jsx as jsx72, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
11924
|
-
var DxcSpinner = ({
|
|
11925
|
-
label,
|
|
11926
|
-
value,
|
|
11927
|
-
showValue = false,
|
|
11928
|
-
mode = "large",
|
|
11929
|
-
margin,
|
|
11930
|
-
ariaLabel = "Spinner"
|
|
11931
|
-
}) => {
|
|
11932
|
-
const labelId = useId18();
|
|
11933
|
-
const colorsTheme = useContext46(HalstackContext);
|
|
11934
|
-
const determinated = useMemo18(() => value != null && value >= 0 && value <= 100, [value]);
|
|
11935
|
-
return /* @__PURE__ */ jsx72(ThemeProvider33, { theme: colorsTheme.spinner, children: /* @__PURE__ */ jsx72(DXCSpinner, { margin, mode, children: /* @__PURE__ */ jsxs51(SpinnerContainer, { mode, children: [
|
|
11936
|
-
mode === "overlay" && /* @__PURE__ */ jsx72(BackOverlay, {}),
|
|
11937
|
-
/* @__PURE__ */ jsx72(BackgroundSpinner, { children: mode === "small" ? /* @__PURE__ */ jsx72(SVGBackground, { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx72(CircleBackground, { cx: "8", cy: "8", r: "6", mode }) }) : /* @__PURE__ */ jsx72(SVGBackground, { viewBox: "0 0 140 140", children: /* @__PURE__ */ jsx72(CircleBackground, { cx: "70", cy: "70", r: "65", mode }) }) }),
|
|
11938
|
-
/* @__PURE__ */ jsx72(
|
|
11939
|
-
Spinner,
|
|
11940
|
-
{
|
|
11941
|
-
role: "progressbar",
|
|
11942
|
-
"aria-valuenow": determinated && showValue ? value : void 0,
|
|
11943
|
-
"aria-valuemin": determinated ? 0 : void 0,
|
|
11944
|
-
"aria-valuemax": determinated ? 100 : void 0,
|
|
11945
|
-
"aria-labelledby": label && mode !== "small" ? labelId : void 0,
|
|
11946
|
-
"aria-label": !label ? ariaLabel : mode === "small" ? ariaLabel : void 0,
|
|
11947
|
-
children: mode === "small" ? /* @__PURE__ */ jsx72(SVGSpinner, { viewBox: "0 0 16 16", determinated, children: /* @__PURE__ */ jsx72(CircleSpinner, { cx: "8", cy: "8", r: "6", mode, determinated, value }) }) : /* @__PURE__ */ jsx72(SVGSpinner, { viewBox: "0 0 140 140", determinated, children: /* @__PURE__ */ jsx72(CircleSpinner, { cx: "70", cy: "70", r: "65", mode, determinated, value }) })
|
|
11948
|
-
}
|
|
11949
|
-
),
|
|
11950
|
-
mode !== "small" && /* @__PURE__ */ jsxs51(LabelsContainer3, { children: [
|
|
11951
|
-
label && /* @__PURE__ */ jsx72(SpinnerLabel, { id: labelId, mode, children: label }),
|
|
11952
|
-
(value || value === 0) && showValue && /* @__PURE__ */ jsxs51(SpinnerProgress, { value, mode, showValue, children: [
|
|
11953
|
-
value,
|
|
11954
|
-
"%"
|
|
11955
|
-
] })
|
|
11956
|
-
] })
|
|
11957
|
-
] }) }) });
|
|
11958
|
-
};
|
|
11959
|
-
var determinateValue = (value, strokeDashArray) => {
|
|
11960
|
-
let val = 0;
|
|
11961
|
-
if (value != null && value >= 0 && value <= 100) {
|
|
11962
|
-
val = strokeDashArray * (1 - value / 100);
|
|
11963
|
-
}
|
|
11964
|
-
return val;
|
|
11965
|
-
};
|
|
11966
|
-
var DXCSpinner = styled64.div`
|
|
11967
|
-
height: ${(props) => props.mode === "overlay" ? "100vh" : ""};
|
|
11968
|
-
width: ${(props) => props.mode === "overlay" ? "100vw" : ""};
|
|
11969
|
-
display: ${(props) => props.mode === "overlay" ? "flex" : ""};
|
|
11970
|
-
position: ${(props) => props.mode === "overlay" ? "fixed" : ""};
|
|
11971
|
-
top: ${(props) => props.mode === "overlay" ? 0 : ""};
|
|
11972
|
-
left: ${(props) => props.mode === "overlay" ? 0 : ""};
|
|
11973
|
-
justify-content: ${(props) => props.mode === "overlay" ? "center" : ""};
|
|
11974
|
-
align-items: ${(props) => props.mode === "overlay" ? "center" : ""};
|
|
11975
|
-
z-index: ${(props) => props.mode === "overlay" ? 400 : ""};
|
|
11976
|
-
|
|
11977
|
-
margin: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin !== "object" ? spaces[props.margin] : "0px" : ""};
|
|
11978
|
-
margin-top: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.top ? spaces[props.margin.top] : "" : ""};
|
|
11979
|
-
margin-right: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.right ? spaces[props.margin.right] : "" : ""};
|
|
11980
|
-
margin-bottom: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.bottom ? spaces[props.margin.bottom] : "" : ""};
|
|
11981
|
-
margin-left: ${(props) => props.mode !== "overlay" ? props.margin && typeof props.margin === "object" && props.margin.left ? spaces[props.margin.left] : "" : ""};
|
|
11982
|
-
`;
|
|
11983
|
-
var SpinnerContainer = styled64.div`
|
|
11984
|
-
align-items: center;
|
|
11985
|
-
display: flex;
|
|
11986
|
-
height: ${(props) => props.mode === "small" ? "16px" : "140px"};
|
|
11987
|
-
width: ${(props) => props.mode === "small" ? "16px" : "140px"};
|
|
11988
|
-
justify-content: center;
|
|
11989
|
-
position: relative;
|
|
11990
|
-
background-color: transparent;
|
|
11991
|
-
|
|
11992
|
-
@keyframes spinner-svg {
|
|
11993
|
-
0% {
|
|
11994
|
-
transform: rotateZ(0deg);
|
|
11995
|
-
}
|
|
11996
|
-
100% {
|
|
11997
|
-
transform: rotateZ(360deg);
|
|
11998
|
-
}
|
|
11999
|
-
}
|
|
12000
|
-
@keyframes svg-circle-large {
|
|
12001
|
-
0% {
|
|
12002
|
-
stroke-dashoffset: 400;
|
|
12003
|
-
transform: rotate(0);
|
|
12004
|
-
}
|
|
12005
|
-
|
|
12006
|
-
50% {
|
|
12007
|
-
stroke-dashoffset: 75;
|
|
12008
|
-
transform: rotate(45deg);
|
|
12009
|
-
}
|
|
12010
|
-
|
|
12011
|
-
100% {
|
|
12012
|
-
stroke-dashoffset: 400;
|
|
12013
|
-
transform: rotate(360deg);
|
|
12014
|
-
}
|
|
12015
|
-
}
|
|
12016
|
-
@keyframes svg-circle-small {
|
|
12017
|
-
0% {
|
|
12018
|
-
stroke-dashoffset: 35;
|
|
12019
|
-
transform: rotate(0);
|
|
12020
|
-
}
|
|
12021
|
-
|
|
12022
|
-
50% {
|
|
12023
|
-
stroke-dashoffset: 8;
|
|
12024
|
-
transform: rotate(45deg);
|
|
12025
|
-
}
|
|
12026
|
-
|
|
12027
|
-
100% {
|
|
12028
|
-
stroke-dashoffset: 35;
|
|
12029
|
-
transform: rotate(360deg);
|
|
12030
|
-
}
|
|
12031
|
-
}
|
|
12032
|
-
`;
|
|
12033
|
-
var BackOverlay = styled64.div`
|
|
12034
|
-
width: 100vw;
|
|
12035
|
-
height: 100vh;
|
|
12036
|
-
opacity: 1;
|
|
12037
|
-
transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
12038
|
-
position: fixed;
|
|
12039
|
-
top: 0;
|
|
12040
|
-
left: 0;
|
|
12041
|
-
background-color: ${(props) => `${props.theme.overlayBackgroundColor}`};
|
|
12042
|
-
opacity: ${(props) => `${props.theme.overlayOpacity}`};
|
|
12043
|
-
`;
|
|
12044
|
-
var BackgroundSpinner = styled64.div`
|
|
12045
|
-
height: inherit;
|
|
12046
|
-
width: inherit;
|
|
12047
|
-
position: absolute;
|
|
12048
|
-
`;
|
|
12049
|
-
var SVGBackground = styled64.svg`
|
|
12050
|
-
height: inherit;
|
|
12051
|
-
width: inherit;
|
|
12052
|
-
`;
|
|
12053
|
-
var CircleBackground = styled64.circle`
|
|
12054
|
-
animation: none;
|
|
12055
|
-
fill: transparent;
|
|
12056
|
-
stroke: ${(props) => `${props.theme.totalCircleColor}`};
|
|
12057
|
-
stroke-dasharray: ${(props) => props.mode !== "small" ? "409" : "38"};
|
|
12058
|
-
stroke-linecap: initial;
|
|
12059
|
-
stroke-width: ${(props) => props.mode !== "small" ? "8.5px" : "2px"};
|
|
12060
|
-
transform-origin: 50% 50%;
|
|
12061
|
-
vector-effect: non-scaling-stroke;
|
|
12062
|
-
`;
|
|
12063
|
-
var Spinner = styled64.div`
|
|
12064
|
-
height: inherit;
|
|
12065
|
-
width: inherit;
|
|
12066
|
-
position: relative;
|
|
12067
|
-
`;
|
|
12068
|
-
var SVGSpinner = styled64.svg`
|
|
12069
|
-
height: inherit;
|
|
12070
|
-
width: inherit;
|
|
12071
|
-
transform: rotate(-90deg);
|
|
12072
|
-
top: 0;
|
|
12073
|
-
left: 0;
|
|
12074
|
-
transform-origin: center;
|
|
12075
|
-
overflow: visible;
|
|
12076
|
-
animation: ${(props) => !props.determinated ? "1.4s linear infinite both spinner-svg" : ""};
|
|
12077
|
-
`;
|
|
12078
|
-
var CircleSpinner = styled64.circle`
|
|
12079
|
-
fill: transparent;
|
|
12080
|
-
stroke-linecap: initial;
|
|
12081
|
-
vector-effect: non-scaling-stroke;
|
|
12082
|
-
animation: ${(props) => props.determinated ? "none" : props.mode !== "small" ? "1.4s ease-in-out infinite both svg-circle-large" : "1.4s ease-in-out infinite both svg-circle-small"};
|
|
12083
|
-
stroke: ${(props) => props.mode === "overlay" ? props.theme.trackCircleColorOverlay : props.theme.trackCircleColor};
|
|
12084
|
-
transform-origin: ${(props) => !props.determinated ? "50% 50%" : ""};
|
|
12085
|
-
stroke-dasharray: ${(props) => props.mode !== "small" ? "409" : "38"};
|
|
12086
|
-
stroke-width: ${(props) => props.mode !== "small" ? "8.5px" : "2px"};
|
|
12087
|
-
stroke-dashoffset: ${(props) => props.determinated ? props.mode !== "small" ? determinateValue(props.value, 409) : determinateValue(props.value, 38) : ""};
|
|
12088
|
-
`;
|
|
12089
|
-
var LabelsContainer3 = styled64.div`
|
|
12090
|
-
position: absolute;
|
|
12091
|
-
margin: 0 auto;
|
|
12092
|
-
width: 110px;
|
|
12093
|
-
text-align: center;
|
|
12094
|
-
`;
|
|
12095
|
-
var SpinnerLabel = styled64.p`
|
|
12096
|
-
margin: 0;
|
|
12097
|
-
width: 100%;
|
|
12098
|
-
white-space: nowrap;
|
|
12099
|
-
overflow: hidden;
|
|
12100
|
-
text-overflow: ellipsis;
|
|
12101
|
-
font-family: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontFamily : props.theme.labelFontFamily};
|
|
12102
|
-
font-weight: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontWeight : props.theme.labelFontWeight};
|
|
12103
|
-
font-size: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontSize : props.theme.labelFontSize};
|
|
12104
|
-
font-style: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontStyle : props.theme.labelFontStyle};
|
|
12105
|
-
color: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.theme.labelFontColor};
|
|
12106
|
-
text-align: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelTextAlign : props.theme.labelTextAlign};
|
|
12107
|
-
letter-spacing: ${(props) => props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing};
|
|
12108
|
-
`;
|
|
12109
|
-
var SpinnerProgress = styled64.p`
|
|
12110
|
-
margin: 0;
|
|
12111
|
-
width: 100%;
|
|
12112
|
-
white-space: nowrap;
|
|
12113
|
-
overflow: hidden;
|
|
12114
|
-
text-overflow: ellipsis;
|
|
12115
|
-
display: ${(props) => props.value && props.showValue === true && "block" || "none"};
|
|
12116
|
-
font-family: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily};
|
|
12117
|
-
font-weight: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontWeight : props.theme.progressValueFontWeight};
|
|
12118
|
-
font-size: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontSize : props.theme.progressValueFontSize};
|
|
12119
|
-
font-style: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontStyle : props.theme.progressValueFontStyle};
|
|
12120
|
-
color: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.theme.progressValueFontColor};
|
|
12121
|
-
text-align: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueTextAlign : props.theme.progressValueTextAlign};
|
|
12122
|
-
letter-spacing: ${(props) => props.mode === "overlay" ? props.theme.overlayProgressValueLetterSpacing : props.theme.progressValueLetterSpacing};
|
|
12123
|
-
`;
|
|
12124
|
-
var Spinner_default = DxcSpinner;
|
|
12125
|
-
|
|
12126
12179
|
// src/status-light/StatusLight.tsx
|
|
12127
12180
|
import styled65 from "styled-components";
|
|
12128
|
-
import { jsx as jsx73, jsxs as
|
|
12181
|
+
import { jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
12129
12182
|
var DxcStatusLight = ({ mode = "default", label, size = "medium" }) => {
|
|
12130
|
-
return /* @__PURE__ */
|
|
12183
|
+
return /* @__PURE__ */ jsxs51(StatusLightContainer, { size, "aria-label": `${mode}: ${label}`, role: "status", children: [
|
|
12131
12184
|
/* @__PURE__ */ jsx73(StatusDot, { mode, size, "aria-hidden": "true" }),
|
|
12132
12185
|
/* @__PURE__ */ jsx73(StatusLabel, { mode, size, children: label })
|
|
12133
12186
|
] });
|
|
@@ -12157,9 +12210,9 @@ var StatusLabel = styled65.span`
|
|
|
12157
12210
|
var StatusLight_default = DxcStatusLight;
|
|
12158
12211
|
|
|
12159
12212
|
// src/switch/Switch.tsx
|
|
12160
|
-
import { forwardRef as forwardRef15, useContext as useContext47, useId as useId19, useRef as useRef19, useState as
|
|
12213
|
+
import { forwardRef as forwardRef15, useContext as useContext47, useId as useId19, useRef as useRef19, useState as useState32 } from "react";
|
|
12161
12214
|
import styled66, { ThemeProvider as ThemeProvider34 } from "styled-components";
|
|
12162
|
-
import { Fragment as
|
|
12215
|
+
import { Fragment as Fragment14, jsx as jsx74, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
12163
12216
|
var DxcSwitch = forwardRef15(
|
|
12164
12217
|
({
|
|
12165
12218
|
defaultChecked = false,
|
|
@@ -12178,7 +12231,7 @@ var DxcSwitch = forwardRef15(
|
|
|
12178
12231
|
}, ref) => {
|
|
12179
12232
|
const switchId = `switch-${useId19()}`;
|
|
12180
12233
|
const labelId = `label-${switchId}`;
|
|
12181
|
-
const [innerChecked, setInnerChecked] =
|
|
12234
|
+
const [innerChecked, setInnerChecked] = useState32(defaultChecked);
|
|
12182
12235
|
const colorsTheme = useContext47(HalstackContext);
|
|
12183
12236
|
const translatedLabels = useContext47(HalstackLanguageContext);
|
|
12184
12237
|
const refTrack = useRef19(null);
|
|
@@ -12201,7 +12254,7 @@ var DxcSwitch = forwardRef15(
|
|
|
12201
12254
|
}
|
|
12202
12255
|
onChange?.(checked ? !checked : !innerChecked);
|
|
12203
12256
|
};
|
|
12204
|
-
return /* @__PURE__ */ jsx74(ThemeProvider34, { theme: colorsTheme.switch, children: /* @__PURE__ */
|
|
12257
|
+
return /* @__PURE__ */ jsx74(ThemeProvider34, { theme: colorsTheme.switch, children: /* @__PURE__ */ jsxs52(
|
|
12205
12258
|
SwitchContainer,
|
|
12206
12259
|
{
|
|
12207
12260
|
margin,
|
|
@@ -12211,10 +12264,10 @@ var DxcSwitch = forwardRef15(
|
|
|
12211
12264
|
onClick: !disabled ? handlerSwitchChange : void 0,
|
|
12212
12265
|
ref,
|
|
12213
12266
|
children: [
|
|
12214
|
-
labelPosition === "before" && label && /* @__PURE__ */
|
|
12267
|
+
labelPosition === "before" && label && /* @__PURE__ */ jsxs52(LabelContainer4, { id: labelId, labelPosition, disabled, label, children: [
|
|
12215
12268
|
label,
|
|
12216
12269
|
" ",
|
|
12217
|
-
optional && /* @__PURE__ */ jsx74(
|
|
12270
|
+
optional && /* @__PURE__ */ jsx74(Fragment14, { children: translatedLabels.formFields.optionalLabel })
|
|
12218
12271
|
] }),
|
|
12219
12272
|
/* @__PURE__ */ jsx74(
|
|
12220
12273
|
ValueInput4,
|
|
@@ -12241,8 +12294,8 @@ var DxcSwitch = forwardRef15(
|
|
|
12241
12294
|
ref: refTrack
|
|
12242
12295
|
}
|
|
12243
12296
|
) }),
|
|
12244
|
-
labelPosition === "after" && label && /* @__PURE__ */
|
|
12245
|
-
optional && /* @__PURE__ */ jsx74(
|
|
12297
|
+
labelPosition === "after" && label && /* @__PURE__ */ jsxs52(LabelContainer4, { id: labelId, labelPosition, disabled, label, children: [
|
|
12298
|
+
optional && /* @__PURE__ */ jsx74(Fragment14, { children: translatedLabels.formFields.optionalLabel }),
|
|
12246
12299
|
" ",
|
|
12247
12300
|
label
|
|
12248
12301
|
] })
|
|
@@ -12407,7 +12460,7 @@ import {
|
|
|
12407
12460
|
useEffect as useEffect25,
|
|
12408
12461
|
useMemo as useMemo20,
|
|
12409
12462
|
useRef as useRef22,
|
|
12410
|
-
useState as
|
|
12463
|
+
useState as useState34
|
|
12411
12464
|
} from "react";
|
|
12412
12465
|
import styled70, { ThemeProvider as ThemeProvider36 } from "styled-components";
|
|
12413
12466
|
|
|
@@ -12418,7 +12471,7 @@ var TabsContext_default = createContext9(null);
|
|
|
12418
12471
|
// src/tabs/Tab.tsx
|
|
12419
12472
|
import { forwardRef as forwardRef16, useContext as useContext48, useEffect as useEffect23, useRef as useRef20 } from "react";
|
|
12420
12473
|
import styled67 from "styled-components";
|
|
12421
|
-
import { jsx as jsx75, jsxs as
|
|
12474
|
+
import { jsx as jsx75, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
12422
12475
|
var DxcTab2 = forwardRef16(
|
|
12423
12476
|
({
|
|
12424
12477
|
icon,
|
|
@@ -12472,7 +12525,7 @@ var DxcTab2 = forwardRef16(
|
|
|
12472
12525
|
break;
|
|
12473
12526
|
}
|
|
12474
12527
|
};
|
|
12475
|
-
return /* @__PURE__ */ jsx75(Tooltip, { label: title, children: /* @__PURE__ */
|
|
12528
|
+
return /* @__PURE__ */ jsx75(Tooltip, { label: title, children: /* @__PURE__ */ jsxs53(
|
|
12476
12529
|
TabContainer2,
|
|
12477
12530
|
{
|
|
12478
12531
|
role: "tab",
|
|
@@ -12504,7 +12557,7 @@ var DxcTab2 = forwardRef16(
|
|
|
12504
12557
|
onMouseEnter: () => onHover(),
|
|
12505
12558
|
onKeyDown: handleOnKeyDown,
|
|
12506
12559
|
children: [
|
|
12507
|
-
/* @__PURE__ */
|
|
12560
|
+
/* @__PURE__ */ jsxs53(
|
|
12508
12561
|
MainLabelContainer,
|
|
12509
12562
|
{
|
|
12510
12563
|
notificationNumber,
|
|
@@ -12632,15 +12685,15 @@ var TabIconContainer2 = styled67.div`
|
|
|
12632
12685
|
var Tab_default2 = DxcTab2;
|
|
12633
12686
|
|
|
12634
12687
|
// src/tabs/TabsLegacy.tsx
|
|
12635
|
-
import { useCallback as useCallback11, useContext as useContext49, useEffect as useEffect24, useMemo as useMemo19, useRef as useRef21, useState as
|
|
12688
|
+
import { useCallback as useCallback11, useContext as useContext49, useEffect as useEffect24, useMemo as useMemo19, useRef as useRef21, useState as useState33 } from "react";
|
|
12636
12689
|
import styled69, { ThemeProvider as ThemeProvider35 } from "styled-components";
|
|
12637
12690
|
|
|
12638
12691
|
// src/tabs/TabLegacy.tsx
|
|
12639
12692
|
import { forwardRef as forwardRef17, memo as memo12 } from "react";
|
|
12640
12693
|
import styled68 from "styled-components";
|
|
12641
|
-
import { jsx as jsx76, jsxs as
|
|
12694
|
+
import { jsx as jsx76, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
12642
12695
|
var Tab2 = forwardRef17(
|
|
12643
|
-
({ active, tab, tabIndex, hasLabelAndIcon, iconPosition, onClick, onMouseEnter, onMouseLeave }, ref) => /* @__PURE__ */
|
|
12696
|
+
({ active, tab, tabIndex, hasLabelAndIcon, iconPosition, onClick, onMouseEnter, onMouseLeave }, ref) => /* @__PURE__ */ jsxs54(
|
|
12644
12697
|
TabContainer3,
|
|
12645
12698
|
{
|
|
12646
12699
|
role: "tab",
|
|
@@ -12661,7 +12714,7 @@ var Tab2 = forwardRef17(
|
|
|
12661
12714
|
onMouseLeave();
|
|
12662
12715
|
},
|
|
12663
12716
|
children: [
|
|
12664
|
-
/* @__PURE__ */
|
|
12717
|
+
/* @__PURE__ */ jsxs54(
|
|
12665
12718
|
MainLabelContainer2,
|
|
12666
12719
|
{
|
|
12667
12720
|
notificationNumber: tab.notificationNumber,
|
|
@@ -12786,9 +12839,9 @@ var TabIconContainer3 = styled68.div`
|
|
|
12786
12839
|
var TabLegacy_default = memo12(Tab2);
|
|
12787
12840
|
|
|
12788
12841
|
// src/tabs/TabsLegacy.tsx
|
|
12789
|
-
import { jsx as jsx77, jsxs as
|
|
12842
|
+
import { jsx as jsx77, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
12790
12843
|
var useResize = (refTabList) => {
|
|
12791
|
-
const [viewWidth, setViewWidth] =
|
|
12844
|
+
const [viewWidth, setViewWidth] = useState33(0);
|
|
12792
12845
|
const handleWindowSizeChange = useCallback11(() => {
|
|
12793
12846
|
setViewWidth(refTabList.current?.offsetWidth ?? 0);
|
|
12794
12847
|
}, [refTabList]);
|
|
@@ -12814,19 +12867,19 @@ var DxcTabs = ({
|
|
|
12814
12867
|
const colorsTheme = useContext49(HalstackContext);
|
|
12815
12868
|
const hasLabelAndIcon = tabs != null && tabs.filter((tab) => tab.label && tab.icon).length > 0;
|
|
12816
12869
|
const firstFocus = tabs != null ? tabs.findIndex((tab) => !tab.isDisabled) : null;
|
|
12817
|
-
const [innerActiveTabIndex, setInnerActiveTabIndex] =
|
|
12870
|
+
const [innerActiveTabIndex, setInnerActiveTabIndex] = useState33(
|
|
12818
12871
|
tabs != null && defaultActiveTabIndex && !tabs[defaultActiveTabIndex]?.isDisabled ? defaultActiveTabIndex : firstFocus
|
|
12819
12872
|
);
|
|
12820
|
-
const [activeIndicatorWidth, setActiveIndicatorWidth] =
|
|
12821
|
-
const [activeIndicatorLeft, setActiveIndicatorLeft] =
|
|
12822
|
-
const [translateScroll, setTranslateScroll] =
|
|
12823
|
-
const [scrollRightEnabled, setScrollRightEnabled] =
|
|
12824
|
-
const [scrollLeftEnabled, setScrollLeftEnabled] =
|
|
12825
|
-
const [countClick, setCountClick] =
|
|
12826
|
-
const [totalTabsWidth, setTotalTabsWidth] =
|
|
12827
|
-
const [currentFocusIndex, setCurrentFocusIndex] =
|
|
12828
|
-
const [temporalFocusIndex, setTemporalFocusIndex] =
|
|
12829
|
-
const [minHeightTabs, setMinHeightTabs] =
|
|
12873
|
+
const [activeIndicatorWidth, setActiveIndicatorWidth] = useState33(0);
|
|
12874
|
+
const [activeIndicatorLeft, setActiveIndicatorLeft] = useState33(0);
|
|
12875
|
+
const [translateScroll, setTranslateScroll] = useState33(0);
|
|
12876
|
+
const [scrollRightEnabled, setScrollRightEnabled] = useState33(true);
|
|
12877
|
+
const [scrollLeftEnabled, setScrollLeftEnabled] = useState33(false);
|
|
12878
|
+
const [countClick, setCountClick] = useState33(0);
|
|
12879
|
+
const [totalTabsWidth, setTotalTabsWidth] = useState33(0);
|
|
12880
|
+
const [currentFocusIndex, setCurrentFocusIndex] = useState33(activeTabIndex ?? innerActiveTabIndex);
|
|
12881
|
+
const [temporalFocusIndex, setTemporalFocusIndex] = useState33(activeTabIndex ?? innerActiveTabIndex);
|
|
12882
|
+
const [minHeightTabs, setMinHeightTabs] = useState33(0);
|
|
12830
12883
|
const refTabs = useRef21([]);
|
|
12831
12884
|
const refTabList = useRef21(null);
|
|
12832
12885
|
const viewWidth = useResize(refTabList);
|
|
@@ -12983,9 +13036,9 @@ var DxcTabs = ({
|
|
|
12983
13036
|
};
|
|
12984
13037
|
const isTabActive = (index) => activeTabIndex != null && activeTabIndex >= 0 ? activeTabIndex === index : innerActiveTabIndex === index;
|
|
12985
13038
|
const isActiveIndicatorDisabled = firstFocus === -1 || tabs != null && activeTabIndex !== void 0 && activeTabIndex >= 0 && !!tabs[activeTabIndex]?.isDisabled;
|
|
12986
|
-
return /* @__PURE__ */ jsx77(ThemeProvider35, { theme: colorsTheme.tabs, children: /* @__PURE__ */
|
|
13039
|
+
return /* @__PURE__ */ jsx77(ThemeProvider35, { theme: colorsTheme.tabs, children: /* @__PURE__ */ jsxs55(TabsContainer, { margin, children: [
|
|
12987
13040
|
/* @__PURE__ */ jsx77(Underline2, {}),
|
|
12988
|
-
/* @__PURE__ */
|
|
13041
|
+
/* @__PURE__ */ jsxs55(Tabs, { hasLabelAndIcon, iconPosition, children: [
|
|
12989
13042
|
/* @__PURE__ */ jsx77(
|
|
12990
13043
|
ScrollIndicator,
|
|
12991
13044
|
{
|
|
@@ -12998,7 +13051,7 @@ var DxcTabs = ({
|
|
|
12998
13051
|
children: /* @__PURE__ */ jsx77(Icon_default, { icon: "keyboard_arrow_left" })
|
|
12999
13052
|
}
|
|
13000
13053
|
),
|
|
13001
|
-
/* @__PURE__ */ jsx77(TabsContent, { children: /* @__PURE__ */
|
|
13054
|
+
/* @__PURE__ */ jsx77(TabsContent, { children: /* @__PURE__ */ jsxs55(TabsContentScroll, { translateScroll, ref: refTabList, enabled: enabledIndicator, children: [
|
|
13002
13055
|
/* @__PURE__ */ jsx77(TabList, { role: "tablist", onKeyDown: handleOnKeyDown, minHeightTabs, children: tabs?.map((tab, i) => /* @__PURE__ */ jsx77(
|
|
13003
13056
|
TabLegacy_default,
|
|
13004
13057
|
{
|
|
@@ -13152,9 +13205,9 @@ var TabsContentScroll = styled69.div`
|
|
|
13152
13205
|
var TabsLegacy_default = DxcTabs;
|
|
13153
13206
|
|
|
13154
13207
|
// src/tabs/Tabs.tsx
|
|
13155
|
-
import { Fragment as
|
|
13208
|
+
import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
13156
13209
|
var useResize2 = (refTabList) => {
|
|
13157
|
-
const [viewWidth, setViewWidth] =
|
|
13210
|
+
const [viewWidth, setViewWidth] = useState34(0);
|
|
13158
13211
|
const handleWindowSizeChange = useCallback12(() => {
|
|
13159
13212
|
setViewWidth(refTabList?.current?.offsetWidth ?? 0);
|
|
13160
13213
|
}, [refTabList]);
|
|
@@ -13200,7 +13253,7 @@ var DxcTabs2 = ({
|
|
|
13200
13253
|
() => childrenArray.some((child) => isValidElement2(child) && child.props.icon && child.props.label),
|
|
13201
13254
|
[childrenArray]
|
|
13202
13255
|
);
|
|
13203
|
-
const [activeTab, setActiveTab] =
|
|
13256
|
+
const [activeTab, setActiveTab] = useState34(() => {
|
|
13204
13257
|
const hasActiveChild = childrenArray.some(
|
|
13205
13258
|
(child) => isValidElement2(child) && (child.props.active || child.props.defaultActive) && !child.props.disabled
|
|
13206
13259
|
);
|
|
@@ -13209,16 +13262,17 @@ var DxcTabs2 = ({
|
|
|
13209
13262
|
) : childrenArray.find((child) => isValidElement2(child) && !child.props.disabled);
|
|
13210
13263
|
return isValidElement2(initialActiveTab) ? initialActiveTab.props.label ?? initialActiveTab.props.tabId : "";
|
|
13211
13264
|
});
|
|
13212
|
-
const [innerFocusIndex, setInnerFocusIndex] =
|
|
13213
|
-
const [activeIndicatorWidth, setActiveIndicatorWidth] =
|
|
13214
|
-
const [activeIndicatorLeft, setActiveIndicatorLeft] =
|
|
13215
|
-
const [countClick, setCountClick] =
|
|
13216
|
-
const [totalTabsWidth, setTotalTabsWidth] =
|
|
13217
|
-
const [translateScroll, setTranslateScroll] =
|
|
13218
|
-
const [scrollRightEnabled, setScrollRightEnabled] =
|
|
13219
|
-
const [scrollLeftEnabled, setScrollLeftEnabled] =
|
|
13220
|
-
const [minHeightTabs, setMinHeightTabs] =
|
|
13265
|
+
const [innerFocusIndex, setInnerFocusIndex] = useState34(null);
|
|
13266
|
+
const [activeIndicatorWidth, setActiveIndicatorWidth] = useState34(0);
|
|
13267
|
+
const [activeIndicatorLeft, setActiveIndicatorLeft] = useState34(0);
|
|
13268
|
+
const [countClick, setCountClick] = useState34(0);
|
|
13269
|
+
const [totalTabsWidth, setTotalTabsWidth] = useState34(0);
|
|
13270
|
+
const [translateScroll, setTranslateScroll] = useState34(0);
|
|
13271
|
+
const [scrollRightEnabled, setScrollRightEnabled] = useState34(true);
|
|
13272
|
+
const [scrollLeftEnabled, setScrollLeftEnabled] = useState34(false);
|
|
13273
|
+
const [minHeightTabs, setMinHeightTabs] = useState34(0);
|
|
13221
13274
|
const refTabList = useRef22(null);
|
|
13275
|
+
const refTabListContainer = useRef22(null);
|
|
13222
13276
|
const colorsTheme = useContext50(HalstackContext);
|
|
13223
13277
|
const viewWidth = useResize2(refTabList);
|
|
13224
13278
|
const translatedLabels = useContext50(HalstackLanguageContext);
|
|
@@ -13243,51 +13297,46 @@ var DxcTabs2 = ({
|
|
|
13243
13297
|
setActiveIndicatorLeft
|
|
13244
13298
|
};
|
|
13245
13299
|
}, [iconPosition, tabIndex, innerFocusIndex, activeTab, childrenArray, hasLabelAndIcon]);
|
|
13300
|
+
const scrollLimitCheck = () => {
|
|
13301
|
+
const container = refTabListContainer.current;
|
|
13302
|
+
if (container) {
|
|
13303
|
+
const currentScroll = container.scrollLeft;
|
|
13304
|
+
const scrollingLength = container.scrollWidth - container.offsetWidth;
|
|
13305
|
+
const startingScroll = currentScroll <= 1;
|
|
13306
|
+
const endScroll = currentScroll >= scrollingLength - 1;
|
|
13307
|
+
setScrollLeftEnabled(!startingScroll);
|
|
13308
|
+
setScrollRightEnabled(!endScroll);
|
|
13309
|
+
}
|
|
13310
|
+
};
|
|
13246
13311
|
const scrollLeft = () => {
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
moveX = 0;
|
|
13251
|
-
setScrollLeftEnabled(false);
|
|
13252
|
-
setScrollRightEnabled(true);
|
|
13253
|
-
} else {
|
|
13254
|
-
moveX = countClick - scrollWidth;
|
|
13255
|
-
setScrollRightEnabled(true);
|
|
13256
|
-
setScrollLeftEnabled(true);
|
|
13312
|
+
if (refTabListContainer.current) {
|
|
13313
|
+
refTabListContainer.current.scrollLeft -= 100;
|
|
13314
|
+
scrollLimitCheck();
|
|
13257
13315
|
}
|
|
13258
|
-
setTranslateScroll(-moveX);
|
|
13259
|
-
setCountClick(moveX);
|
|
13260
13316
|
};
|
|
13261
13317
|
const scrollRight = () => {
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
if (countClick + scrollWidth + offsetHeight >= totalTabsWidth) {
|
|
13266
|
-
moveX = totalTabsWidth - offsetHeight;
|
|
13267
|
-
setScrollRightEnabled(false);
|
|
13268
|
-
setScrollLeftEnabled(true);
|
|
13269
|
-
} else {
|
|
13270
|
-
moveX = countClick + scrollWidth;
|
|
13271
|
-
setScrollLeftEnabled(true);
|
|
13272
|
-
setScrollRightEnabled(true);
|
|
13318
|
+
if (refTabListContainer.current) {
|
|
13319
|
+
refTabListContainer.current.scrollLeft += 100;
|
|
13320
|
+
scrollLimitCheck();
|
|
13273
13321
|
}
|
|
13274
|
-
setTranslateScroll(-moveX);
|
|
13275
|
-
setCountClick(moveX);
|
|
13276
13322
|
};
|
|
13277
13323
|
const handleOnKeyDown = (event) => {
|
|
13278
13324
|
const active = childrenArray.findIndex(
|
|
13279
13325
|
(child) => child.props.label ?? child.props.tabId === activeTab
|
|
13280
13326
|
);
|
|
13327
|
+
let index;
|
|
13281
13328
|
switch (event.key) {
|
|
13282
13329
|
case "Left":
|
|
13283
13330
|
case "ArrowLeft":
|
|
13284
13331
|
event.preventDefault();
|
|
13285
|
-
|
|
13332
|
+
index = getPreviousTabIndex2(childrenArray, innerFocusIndex === null ? active : innerFocusIndex);
|
|
13333
|
+
setInnerFocusIndex(index);
|
|
13286
13334
|
break;
|
|
13287
13335
|
case "Right":
|
|
13288
13336
|
case "ArrowRight":
|
|
13289
13337
|
event.preventDefault();
|
|
13290
|
-
|
|
13338
|
+
index = getNextTabIndex2(childrenArray, innerFocusIndex === null ? active : innerFocusIndex);
|
|
13339
|
+
setInnerFocusIndex(index);
|
|
13291
13340
|
break;
|
|
13292
13341
|
case "Tab":
|
|
13293
13342
|
if (active !== innerFocusIndex) {
|
|
@@ -13297,11 +13346,28 @@ var DxcTabs2 = ({
|
|
|
13297
13346
|
default:
|
|
13298
13347
|
break;
|
|
13299
13348
|
}
|
|
13349
|
+
setTimeout(() => {
|
|
13350
|
+
scrollLimitCheck();
|
|
13351
|
+
}, 0);
|
|
13300
13352
|
};
|
|
13301
|
-
|
|
13302
|
-
|
|
13353
|
+
useEffect25(() => {
|
|
13354
|
+
if (refTabList.current)
|
|
13355
|
+
setTotalTabsWidth(() => {
|
|
13356
|
+
let total = 0;
|
|
13357
|
+
refTabList.current?.querySelectorAll('[role="tab"]').forEach((tab, index) => {
|
|
13358
|
+
if (tab.ariaSelected === "true" && viewWidth && viewWidth < totalTabsWidth) {
|
|
13359
|
+
setInnerFocusIndex(index);
|
|
13360
|
+
}
|
|
13361
|
+
total += tab.offsetWidth;
|
|
13362
|
+
});
|
|
13363
|
+
return total;
|
|
13364
|
+
});
|
|
13365
|
+
scrollLimitCheck();
|
|
13366
|
+
}, [viewWidth, totalTabsWidth]);
|
|
13367
|
+
return children ? /* @__PURE__ */ jsxs56(Fragment15, { children: [
|
|
13368
|
+
/* @__PURE__ */ jsx78(ThemeProvider36, { theme: colorsTheme.tabs, children: /* @__PURE__ */ jsxs56(TabsContainer2, { margin, children: [
|
|
13303
13369
|
/* @__PURE__ */ jsx78(Underline3, {}),
|
|
13304
|
-
/* @__PURE__ */
|
|
13370
|
+
/* @__PURE__ */ jsxs56(Tabs2, { hasLabelAndIcon, iconPosition, children: [
|
|
13305
13371
|
/* @__PURE__ */ jsx78(
|
|
13306
13372
|
ScrollIndicator2,
|
|
13307
13373
|
{
|
|
@@ -13314,7 +13380,7 @@ var DxcTabs2 = ({
|
|
|
13314
13380
|
children: /* @__PURE__ */ jsx78(Icon_default, { icon: "keyboard_arrow_left" })
|
|
13315
13381
|
}
|
|
13316
13382
|
),
|
|
13317
|
-
/* @__PURE__ */ jsx78(TabsContent2, { children: /* @__PURE__ */
|
|
13383
|
+
/* @__PURE__ */ jsx78(TabsContent2, { ref: refTabListContainer, children: /* @__PURE__ */ jsxs56(TabsContentScroll2, { translateScroll, ref: refTabList, enabled: enabledIndicator, children: [
|
|
13318
13384
|
/* @__PURE__ */ jsx78(TabList2, { role: "tablist", onKeyDown: handleOnKeyDown, minHeightTabs, children: /* @__PURE__ */ jsx78(TabsContext_default.Provider, { value: contextValue, children }) }),
|
|
13319
13385
|
/* @__PURE__ */ jsx78(
|
|
13320
13386
|
ActiveIndicator2,
|
|
@@ -13466,10 +13532,10 @@ DxcTabs2.Tab = Tab_default2;
|
|
|
13466
13532
|
var Tabs_default = DxcTabs2;
|
|
13467
13533
|
|
|
13468
13534
|
// src/tag/Tag.tsx
|
|
13469
|
-
import { useContext as useContext51, useState as
|
|
13535
|
+
import { useContext as useContext51, useState as useState35 } from "react";
|
|
13470
13536
|
import styled71, { ThemeProvider as ThemeProvider37 } from "styled-components";
|
|
13471
|
-
import { Fragment as
|
|
13472
|
-
var TagWrapper = ({ condition, wrapper, children }) => /* @__PURE__ */ jsx79(
|
|
13537
|
+
import { Fragment as Fragment16, jsx as jsx79, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
13538
|
+
var TagWrapper = ({ condition, wrapper, children }) => /* @__PURE__ */ jsx79(Fragment16, { children: condition ? wrapper(children) : children });
|
|
13473
13539
|
var DxcTag = ({
|
|
13474
13540
|
icon,
|
|
13475
13541
|
label = "",
|
|
@@ -13483,7 +13549,7 @@ var DxcTag = ({
|
|
|
13483
13549
|
tabIndex = 0
|
|
13484
13550
|
}) => {
|
|
13485
13551
|
const colorsTheme = useContext51(HalstackContext);
|
|
13486
|
-
const [isHovered, changeIsHovered] =
|
|
13552
|
+
const [isHovered, changeIsHovered] = useState35(false);
|
|
13487
13553
|
return /* @__PURE__ */ jsx79(ThemeProvider37, { theme: colorsTheme.tag, children: /* @__PURE__ */ jsx79(
|
|
13488
13554
|
StyledDxcTag,
|
|
13489
13555
|
{
|
|
@@ -13500,8 +13566,8 @@ var DxcTag = ({
|
|
|
13500
13566
|
TagWrapper,
|
|
13501
13567
|
{
|
|
13502
13568
|
condition: !!onClick || !!linkHref,
|
|
13503
|
-
wrapper: (children) => onClick ? /* @__PURE__ */ jsx79(StyledButton, { tabIndex, children }) : linkHref ? /* @__PURE__ */ jsx79(StyledLink2, { tabIndex, href: linkHref, target: newWindow ? "_blank" : "_self", children }) : /* @__PURE__ */ jsx79(
|
|
13504
|
-
children: /* @__PURE__ */
|
|
13569
|
+
wrapper: (children) => onClick ? /* @__PURE__ */ jsx79(StyledButton, { tabIndex, children }) : linkHref ? /* @__PURE__ */ jsx79(StyledLink2, { tabIndex, href: linkHref, target: newWindow ? "_blank" : "_self", children }) : /* @__PURE__ */ jsx79(Fragment16, {}),
|
|
13570
|
+
children: /* @__PURE__ */ jsxs57(TagContent, { children: [
|
|
13505
13571
|
labelPosition === "before" && size !== "small" && label && /* @__PURE__ */ jsx79(TagLabel, { children: label }),
|
|
13506
13572
|
icon && /* @__PURE__ */ jsx79(IconContainer6, { iconBgColor, children: typeof icon === "string" ? /* @__PURE__ */ jsx79(Icon_default, { icon }) : icon }),
|
|
13507
13573
|
labelPosition === "after" && size !== "small" && label && /* @__PURE__ */ jsx79(TagLabel, { children: label })
|
|
@@ -13594,9 +13660,9 @@ var TagLabel = styled71.div`
|
|
|
13594
13660
|
var Tag_default = DxcTag;
|
|
13595
13661
|
|
|
13596
13662
|
// src/textarea/Textarea.tsx
|
|
13597
|
-
import { forwardRef as forwardRef18, useContext as useContext52, useEffect as useEffect26, useId as useId20, useRef as useRef23, useState as
|
|
13663
|
+
import { forwardRef as forwardRef18, useContext as useContext52, useEffect as useEffect26, useId as useId20, useRef as useRef23, useState as useState36 } from "react";
|
|
13598
13664
|
import styled72, { ThemeProvider as ThemeProvider38 } from "styled-components";
|
|
13599
|
-
import { jsx as jsx80, jsxs as
|
|
13665
|
+
import { jsx as jsx80, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
13600
13666
|
var patternMatch = (pattern, value) => new RegExp(pattern).test(value);
|
|
13601
13667
|
var DxcTextarea = forwardRef18(
|
|
13602
13668
|
({
|
|
@@ -13623,7 +13689,7 @@ var DxcTextarea = forwardRef18(
|
|
|
13623
13689
|
tabIndex = 0,
|
|
13624
13690
|
ariaLabel = "Text area"
|
|
13625
13691
|
}, ref) => {
|
|
13626
|
-
const [innerValue, setInnerValue] =
|
|
13692
|
+
const [innerValue, setInnerValue] = useState36(defaultValue);
|
|
13627
13693
|
const textareaId = `textarea-${useId20()}`;
|
|
13628
13694
|
const colorsTheme = useContext52(HalstackContext);
|
|
13629
13695
|
const translatedLabels = useContext52(HalstackLanguageContext);
|
|
@@ -13689,8 +13755,8 @@ var DxcTextarea = forwardRef18(
|
|
|
13689
13755
|
prevValueRef.current = value ?? innerValue;
|
|
13690
13756
|
}
|
|
13691
13757
|
}, [verticalGrow, value, innerValue, rows]);
|
|
13692
|
-
return /* @__PURE__ */ jsx80(ThemeProvider38, { theme: colorsTheme.textarea, children: /* @__PURE__ */
|
|
13693
|
-
label && /* @__PURE__ */
|
|
13758
|
+
return /* @__PURE__ */ jsx80(ThemeProvider38, { theme: colorsTheme.textarea, children: /* @__PURE__ */ jsxs58(TextareaContainer, { margin, size, ref, children: [
|
|
13759
|
+
label && /* @__PURE__ */ jsxs58(Label12, { htmlFor: textareaId, disabled, helperText, children: [
|
|
13694
13760
|
label,
|
|
13695
13761
|
" ",
|
|
13696
13762
|
optional && /* @__PURE__ */ jsx80(OptionalLabel5, { children: translatedLabels.formFields.optionalLabel })
|
|
@@ -13822,12 +13888,12 @@ var ErrorMessageContainer3 = styled72.span`
|
|
|
13822
13888
|
var Textarea_default = DxcTextarea;
|
|
13823
13889
|
|
|
13824
13890
|
// src/toast/ToastsQueue.tsx
|
|
13825
|
-
import { useCallback as useCallback14, useEffect as useEffect28, useMemo as useMemo21, useState as
|
|
13891
|
+
import { useCallback as useCallback14, useEffect as useEffect28, useMemo as useMemo21, useState as useState38 } from "react";
|
|
13826
13892
|
import { createPortal as createPortal3 } from "react-dom";
|
|
13827
13893
|
import styled74 from "styled-components";
|
|
13828
13894
|
|
|
13829
13895
|
// src/toast/Toast.tsx
|
|
13830
|
-
import { memo as memo13, useContext as useContext53, useState as
|
|
13896
|
+
import { memo as memo13, useContext as useContext53, useState as useState37 } from "react";
|
|
13831
13897
|
import styled73, { keyframes } from "styled-components";
|
|
13832
13898
|
|
|
13833
13899
|
// src/utils/useTimeout.tsx
|
|
@@ -13852,7 +13918,7 @@ function useTimeout(callback, delay) {
|
|
|
13852
13918
|
}
|
|
13853
13919
|
|
|
13854
13920
|
// src/toast/Toast.tsx
|
|
13855
|
-
import { jsx as jsx81, jsxs as
|
|
13921
|
+
import { jsx as jsx81, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
13856
13922
|
var fadeInUp = keyframes`
|
|
13857
13923
|
0% {
|
|
13858
13924
|
transform: translateY(100%);
|
|
@@ -13966,7 +14032,7 @@ var DxcToast = ({
|
|
|
13966
14032
|
onClear,
|
|
13967
14033
|
semantic
|
|
13968
14034
|
}) => {
|
|
13969
|
-
const [isClosing, setIsClosing] =
|
|
14035
|
+
const [isClosing, setIsClosing] = useState37(false);
|
|
13970
14036
|
const translatedLabels = useContext53(HalstackLanguageContext);
|
|
13971
14037
|
const clearClosingAnimationTimer = useTimeout(
|
|
13972
14038
|
() => {
|
|
@@ -13980,12 +14046,12 @@ var DxcToast = ({
|
|
|
13980
14046
|
},
|
|
13981
14047
|
loading ? void 0 : duration
|
|
13982
14048
|
);
|
|
13983
|
-
return /* @__PURE__ */
|
|
13984
|
-
/* @__PURE__ */
|
|
14049
|
+
return /* @__PURE__ */ jsxs59(Toast, { semantic, isClosing, role: "status", children: [
|
|
14050
|
+
/* @__PURE__ */ jsxs59(ContentContainer2, { loading, semantic, children: [
|
|
13985
14051
|
/* @__PURE__ */ jsx81(ToastIcon, { hideSemanticIcon, icon, loading, semantic }),
|
|
13986
14052
|
/* @__PURE__ */ jsx81(Message2, { children: message })
|
|
13987
14053
|
] }),
|
|
13988
|
-
/* @__PURE__ */
|
|
14054
|
+
/* @__PURE__ */ jsxs59(Flex_default, { alignItems: "center", gap: "0.25rem", children: [
|
|
13989
14055
|
action && /* @__PURE__ */ jsx81(
|
|
13990
14056
|
Button_default,
|
|
13991
14057
|
{
|
|
@@ -14024,7 +14090,7 @@ import { createContext as createContext10 } from "react";
|
|
|
14024
14090
|
var ToastContext_default = createContext10(null);
|
|
14025
14091
|
|
|
14026
14092
|
// src/toast/ToastsQueue.tsx
|
|
14027
|
-
import { jsx as jsx82, jsxs as
|
|
14093
|
+
import { jsx as jsx82, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
14028
14094
|
var ToastsQueue = styled74.section`
|
|
14029
14095
|
box-sizing: border-box;
|
|
14030
14096
|
position: fixed;
|
|
@@ -14052,8 +14118,8 @@ var generateUniqueToastId = (toasts) => {
|
|
|
14052
14118
|
return id;
|
|
14053
14119
|
};
|
|
14054
14120
|
var DxcToastsQueue = ({ children, duration = 3e3 }) => {
|
|
14055
|
-
const [toasts, setToasts] =
|
|
14056
|
-
const [isMounted, setIsMounted] =
|
|
14121
|
+
const [toasts, setToasts] = useState38([]);
|
|
14122
|
+
const [isMounted, setIsMounted] = useState38(false);
|
|
14057
14123
|
const adjustedDuration = useMemo21(() => duration > 5e3 ? 5e3 : duration < 3e3 ? 3e3 : duration, [duration]);
|
|
14058
14124
|
const remove = useCallback14((id) => {
|
|
14059
14125
|
setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));
|
|
@@ -14069,7 +14135,7 @@ var DxcToastsQueue = ({ children, duration = 3e3 }) => {
|
|
|
14069
14135
|
useEffect28(() => {
|
|
14070
14136
|
setIsMounted(true);
|
|
14071
14137
|
}, []);
|
|
14072
|
-
return /* @__PURE__ */
|
|
14138
|
+
return /* @__PURE__ */ jsxs60(ToastContext_default.Provider, { value: add, children: [
|
|
14073
14139
|
isMounted && createPortal3(
|
|
14074
14140
|
/* @__PURE__ */ jsx82(ToastsQueue, { children: toasts.map((t) => /* @__PURE__ */ jsx82(
|
|
14075
14141
|
Toast_default,
|
|
@@ -14090,9 +14156,9 @@ var DxcToastsQueue = ({ children, duration = 3e3 }) => {
|
|
|
14090
14156
|
var ToastsQueue_default = DxcToastsQueue;
|
|
14091
14157
|
|
|
14092
14158
|
// src/toggle-group/ToggleGroup.tsx
|
|
14093
|
-
import { useContext as useContext54, useId as useId21, useState as
|
|
14159
|
+
import { useContext as useContext54, useId as useId21, useState as useState39 } from "react";
|
|
14094
14160
|
import styled75, { ThemeProvider as ThemeProvider39 } from "styled-components";
|
|
14095
|
-
import { jsx as jsx83, jsxs as
|
|
14161
|
+
import { jsx as jsx83, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
14096
14162
|
var DxcToggleGroup = ({
|
|
14097
14163
|
label,
|
|
14098
14164
|
helperText,
|
|
@@ -14106,7 +14172,7 @@ var DxcToggleGroup = ({
|
|
|
14106
14172
|
tabIndex = 0
|
|
14107
14173
|
}) => {
|
|
14108
14174
|
const toggleGroupLabelId = `label-toggle-group-${useId21()}`;
|
|
14109
|
-
const [selectedValue, setSelectedValue] =
|
|
14175
|
+
const [selectedValue, setSelectedValue] = useState39(defaultValue ?? (multiple ? [] : -1));
|
|
14110
14176
|
const colorsTheme = useContext54(HalstackContext);
|
|
14111
14177
|
const handleToggleChange = (selectedOption) => {
|
|
14112
14178
|
let newSelectedOptions = [];
|
|
@@ -14145,7 +14211,7 @@ var DxcToggleGroup = ({
|
|
|
14145
14211
|
break;
|
|
14146
14212
|
}
|
|
14147
14213
|
};
|
|
14148
|
-
return /* @__PURE__ */ jsx83(ThemeProvider39, { theme: colorsTheme.toggleGroup, children: /* @__PURE__ */
|
|
14214
|
+
return /* @__PURE__ */ jsx83(ThemeProvider39, { theme: colorsTheme.toggleGroup, children: /* @__PURE__ */ jsxs61(ToggleGroup, { margin, children: [
|
|
14149
14215
|
/* @__PURE__ */ jsx83(Label13, { id: toggleGroupLabelId, disabled, children: label }),
|
|
14150
14216
|
/* @__PURE__ */ jsx83(HelperText9, { disabled, children: helperText }),
|
|
14151
14217
|
/* @__PURE__ */ jsx83(OptionsContainer, { "aria-labelledby": toggleGroupLabelId, children: options.map((option, i) => /* @__PURE__ */ jsx83(Tooltip, { label: option.title, children: /* @__PURE__ */ jsx83(
|
|
@@ -14164,7 +14230,7 @@ var DxcToggleGroup = ({
|
|
|
14164
14230
|
hasIcon: option.icon,
|
|
14165
14231
|
optionLabel: option.label ?? "",
|
|
14166
14232
|
selected: multiple ? value ? Array.isArray(value) && value.includes(option.value) : Array.isArray(selectedValue) && selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
14167
|
-
children: /* @__PURE__ */
|
|
14233
|
+
children: /* @__PURE__ */ jsxs61(Flex_default, { alignItems: "center", children: [
|
|
14168
14234
|
option.icon && /* @__PURE__ */ jsx83(IconContainer7, { optionLabel: option.label ?? "", children: typeof option.icon === "string" ? /* @__PURE__ */ jsx83(Icon_default, { icon: option.icon }) : option.icon }),
|
|
14169
14235
|
option.label && /* @__PURE__ */ jsx83(LabelContainer6, { children: option.label })
|
|
14170
14236
|
] })
|
|
@@ -14259,13 +14325,13 @@ var IconContainer7 = styled75.div`
|
|
|
14259
14325
|
var ToggleGroup_default = DxcToggleGroup;
|
|
14260
14326
|
|
|
14261
14327
|
// src/wizard/Wizard.tsx
|
|
14262
|
-
import { useContext as useContext55, useMemo as useMemo22, useState as
|
|
14328
|
+
import { useContext as useContext55, useMemo as useMemo22, useState as useState40 } from "react";
|
|
14263
14329
|
import styled76, { ThemeProvider as ThemeProvider40 } from "styled-components";
|
|
14264
14330
|
|
|
14265
14331
|
// src/wizard/Icons.tsx
|
|
14266
|
-
import { jsx as jsx84, jsxs as
|
|
14332
|
+
import { jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
14267
14333
|
var icons2 = {
|
|
14268
|
-
valid: /* @__PURE__ */
|
|
14334
|
+
valid: /* @__PURE__ */ jsxs62("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", children: [
|
|
14269
14335
|
/* @__PURE__ */ jsx84("path", { "data-name": "Path 2946", d: "M0,0H18V18H0Z", fill: "none" }),
|
|
14270
14336
|
/* @__PURE__ */ jsx84(
|
|
14271
14337
|
"path",
|
|
@@ -14287,7 +14353,7 @@ var icons2 = {
|
|
|
14287
14353
|
}
|
|
14288
14354
|
)
|
|
14289
14355
|
] }),
|
|
14290
|
-
invalid: /* @__PURE__ */
|
|
14356
|
+
invalid: /* @__PURE__ */ jsxs62("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", children: [
|
|
14291
14357
|
/* @__PURE__ */ jsx84("path", { "data-name": "Path 2943", d: "M0,0H18V18H0Z", fill: "none" }),
|
|
14292
14358
|
/* @__PURE__ */ jsx84(
|
|
14293
14359
|
"path",
|
|
@@ -14312,7 +14378,7 @@ var icons2 = {
|
|
|
14312
14378
|
var Icons_default3 = icons2;
|
|
14313
14379
|
|
|
14314
14380
|
// src/wizard/Wizard.tsx
|
|
14315
|
-
import { jsx as jsx85, jsxs as
|
|
14381
|
+
import { jsx as jsx85, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
14316
14382
|
var StepsContainer = styled76.div`
|
|
14317
14383
|
display: flex;
|
|
14318
14384
|
flex-direction: ${(props) => props.mode === "vertical" ? "column" : "row"};
|
|
@@ -14434,14 +14500,14 @@ var DxcWizard = ({
|
|
|
14434
14500
|
tabIndex = 0
|
|
14435
14501
|
}) => {
|
|
14436
14502
|
const colorsTheme = useContext55(HalstackContext);
|
|
14437
|
-
const [innerCurrent, setInnerCurrentStep] =
|
|
14503
|
+
const [innerCurrent, setInnerCurrentStep] = useState40(defaultCurrentStep);
|
|
14438
14504
|
const renderedCurrent = useMemo22(() => currentStep ?? innerCurrent, [currentStep, innerCurrent]);
|
|
14439
14505
|
const handleStepClick = (newValue) => {
|
|
14440
14506
|
setInnerCurrentStep(newValue);
|
|
14441
14507
|
onStepClick?.(newValue);
|
|
14442
14508
|
};
|
|
14443
|
-
return /* @__PURE__ */ jsx85(ThemeProvider40, { theme: colorsTheme.wizard, children: /* @__PURE__ */ jsx85(StepsContainer, { mode, margin, role: "group", children: steps.map((step, i) => /* @__PURE__ */
|
|
14444
|
-
/* @__PURE__ */
|
|
14509
|
+
return /* @__PURE__ */ jsx85(ThemeProvider40, { theme: colorsTheme.wizard, children: /* @__PURE__ */ jsx85(StepsContainer, { mode, margin, role: "group", children: steps.map((step, i) => /* @__PURE__ */ jsxs63(StepContainer, { mode, lastStep: i === steps.length - 1, children: [
|
|
14510
|
+
/* @__PURE__ */ jsxs63(
|
|
14445
14511
|
Step,
|
|
14446
14512
|
{
|
|
14447
14513
|
onClick: () => {
|
|
@@ -14454,11 +14520,11 @@ var DxcWizard = ({
|
|
|
14454
14520
|
"aria-current": renderedCurrent === i ? "step" : "false",
|
|
14455
14521
|
tabIndex,
|
|
14456
14522
|
children: [
|
|
14457
|
-
/* @__PURE__ */
|
|
14523
|
+
/* @__PURE__ */ jsxs63(StepHeader, { validityIcon: step.valid != null, children: [
|
|
14458
14524
|
/* @__PURE__ */ jsx85(IconContainer8, { current: i === renderedCurrent, visited: i < renderedCurrent, disabled: step.disabled, children: step.icon ? typeof step.icon === "string" ? /* @__PURE__ */ jsx85(Icon_default, { icon: step.icon }) : step.icon : /* @__PURE__ */ jsx85(Number3, { children: i + 1 }) }),
|
|
14459
14525
|
step.valid != null && /* @__PURE__ */ jsx85(ValidityIconContainer, { children: step.valid ? Icons_default3.valid : Icons_default3.invalid })
|
|
14460
14526
|
] }),
|
|
14461
|
-
(step.label || step.description) && /* @__PURE__ */
|
|
14527
|
+
(step.label || step.description) && /* @__PURE__ */ jsxs63("div", { children: [
|
|
14462
14528
|
step.label && /* @__PURE__ */ jsx85(Label14, { current: i === renderedCurrent, disabled: step.disabled, visited: i <= innerCurrent, children: step.label }),
|
|
14463
14529
|
step.description && /* @__PURE__ */ jsx85(Description, { current: i === renderedCurrent, disabled: step.disabled, visited: i <= innerCurrent, children: step.description })
|
|
14464
14530
|
] })
|