@apia/components 4.0.46 → 4.0.50
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.ts +12 -3
- package/dist/index.js +102 -41
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -980,6 +980,7 @@ type TIconButton = Omit<IconButtonProps, 'sx'> & React$1.AriaAttributes & {
|
|
|
980
980
|
size?: TIconSize;
|
|
981
981
|
title?: string;
|
|
982
982
|
variant?: string;
|
|
983
|
+
'data-test-id'?: string;
|
|
983
984
|
};
|
|
984
985
|
/**
|
|
985
986
|
* Renderiza un botón con un ícono adentro.
|
|
@@ -1066,8 +1067,9 @@ type TDateProps = {
|
|
|
1066
1067
|
onError?: (error: string) => unknown;
|
|
1067
1068
|
value?: string;
|
|
1068
1069
|
inputRef?: MutableRefObject<any>;
|
|
1070
|
+
props?: React.HTMLAttributes<HTMLInputElement>;
|
|
1069
1071
|
};
|
|
1070
|
-
declare const DateInput: (({ className, disabled, id: outerId, inputRef, onBlur, onChange, onError, readonly, value: outerValue, }: TDateProps) => React$1.JSX.Element) & {
|
|
1072
|
+
declare const DateInput: (({ className, disabled, id: outerId, inputRef, onBlur, onChange, onError, readonly, value: outerValue, props, }: TDateProps) => React$1.JSX.Element) & {
|
|
1071
1073
|
displayName: string;
|
|
1072
1074
|
};
|
|
1073
1075
|
|
|
@@ -1123,15 +1125,17 @@ declare function parseNumberInputValueToNumber(value: string): number;
|
|
|
1123
1125
|
declare function parseNumberValueToNumberInput(value: string | number): string;
|
|
1124
1126
|
declare const NumberInput: React__default.ForwardRefExoticComponent<Omit<TNumberInput, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
1125
1127
|
|
|
1126
|
-
interface IRequiredMark {
|
|
1128
|
+
interface IRequiredMark extends Partial<BoxProps> {
|
|
1127
1129
|
isFormReadonly?: boolean;
|
|
1128
1130
|
isRequired?: boolean;
|
|
1129
1131
|
isReadonly?: boolean;
|
|
1132
|
+
sx?: ThemeUICSSObject;
|
|
1133
|
+
style?: Record<string, any>;
|
|
1130
1134
|
}
|
|
1131
1135
|
/**
|
|
1132
1136
|
* Muestra el * en los campos de requerido.
|
|
1133
1137
|
*/
|
|
1134
|
-
declare const RequiredMark: ({ isFormReadonly, isRequired, isReadonly, }: IRequiredMark) => React$1.JSX.Element | null;
|
|
1138
|
+
declare const RequiredMark: ({ isFormReadonly, isRequired, isReadonly, sx, style, ...rest }: IRequiredMark) => React$1.JSX.Element | null;
|
|
1135
1139
|
|
|
1136
1140
|
declare const getFieldErrorStyles: (isValid: boolean) => ThemeUICSSObject;
|
|
1137
1141
|
declare const getFieldTouchedStyles: (isTouched: boolean) => ThemeUICSSObject;
|
|
@@ -1184,6 +1188,7 @@ interface IAccordionItemButton {
|
|
|
1184
1188
|
className?: string;
|
|
1185
1189
|
disableSelection?: boolean;
|
|
1186
1190
|
domButtonProps?: ISimpleButton;
|
|
1191
|
+
isHtml?: boolean | boolean[];
|
|
1187
1192
|
label: string;
|
|
1188
1193
|
/**
|
|
1189
1194
|
* Evento que se dispara cuando el usuario hace click en el checkbox o
|
|
@@ -1900,6 +1905,10 @@ declare const FileCard: React$1.ForwardRefExoticComponent<{
|
|
|
1900
1905
|
onDoubleClick?: () => void;
|
|
1901
1906
|
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
1902
1907
|
onDropFiles?: (files: File[]) => void;
|
|
1908
|
+
previewProps?: {
|
|
1909
|
+
hasPreview?: boolean;
|
|
1910
|
+
previewUrl?: string;
|
|
1911
|
+
};
|
|
1903
1912
|
} & React$1.RefAttributes<unknown>>;
|
|
1904
1913
|
|
|
1905
1914
|
declare const Dropzone: ({ sx, className, messageError, progress, defaultLabel, draggingLabel, onClick, onChange, handleInfoButton, }: {
|
package/dist/index.js
CHANGED
|
@@ -1594,9 +1594,15 @@ class ApiaUtilNotifications {
|
|
|
1594
1594
|
});
|
|
1595
1595
|
__publicField$m(this, "notify", (notification) => {
|
|
1596
1596
|
if (notification.type === "modal") {
|
|
1597
|
-
this.util.
|
|
1597
|
+
this.util.modals.open({
|
|
1598
|
+
size: "flex",
|
|
1598
1599
|
children: notification.message,
|
|
1599
|
-
title: notification.title || ""
|
|
1600
|
+
title: notification.title || "",
|
|
1601
|
+
onConfirm: () => {
|
|
1602
|
+
},
|
|
1603
|
+
confirmProps: {
|
|
1604
|
+
hideCancelButton: true
|
|
1605
|
+
}
|
|
1600
1606
|
});
|
|
1601
1607
|
} else {
|
|
1602
1608
|
defaultNotifier.notify({
|
|
@@ -1867,9 +1873,9 @@ const Confirm = ({
|
|
|
1867
1873
|
children,
|
|
1868
1874
|
additionalButtons,
|
|
1869
1875
|
additionalButtonsOnRight,
|
|
1870
|
-
cancelButtonText: cancelText
|
|
1876
|
+
cancelButtonText: cancelText,
|
|
1871
1877
|
className,
|
|
1872
|
-
confirmButtonText: confirmText
|
|
1878
|
+
confirmButtonText: confirmText,
|
|
1873
1879
|
confirmButtonVariant = "primary",
|
|
1874
1880
|
contentRef,
|
|
1875
1881
|
disabled,
|
|
@@ -1881,6 +1887,14 @@ const Confirm = ({
|
|
|
1881
1887
|
variant
|
|
1882
1888
|
}) => {
|
|
1883
1889
|
const { descriptionId } = useModalContext();
|
|
1890
|
+
const showsCancelButton = onCancel && !hideCancelButton;
|
|
1891
|
+
const showsConfirmButton = !hideConfirmButton;
|
|
1892
|
+
if (!showsCancelButton && showsConfirmButton) {
|
|
1893
|
+
confirmText = confirmText || getLabel("btnClose").text;
|
|
1894
|
+
} else if (showsConfirmButton) {
|
|
1895
|
+
confirmText = getLabel("btnCon").text;
|
|
1896
|
+
cancelText = getLabel("btnCan").text;
|
|
1897
|
+
}
|
|
1884
1898
|
return /* @__PURE__ */ jsxs(
|
|
1885
1899
|
Box,
|
|
1886
1900
|
{
|
|
@@ -1918,12 +1932,12 @@ const Confirm = ({
|
|
|
1918
1932
|
children: additionalButtonsOnRight
|
|
1919
1933
|
}
|
|
1920
1934
|
),
|
|
1921
|
-
|
|
1935
|
+
showsConfirmButton && /* @__PURE__ */ jsx(
|
|
1922
1936
|
SimpleButton,
|
|
1923
1937
|
{
|
|
1924
1938
|
onClick: onConfirm,
|
|
1925
1939
|
title: confirmText,
|
|
1926
|
-
variant: confirmButtonVariant,
|
|
1940
|
+
variant: !showsCancelButton && showsConfirmButton ? "outline" : confirmButtonVariant,
|
|
1927
1941
|
disabled: isLoading ?? disabled,
|
|
1928
1942
|
isLoading,
|
|
1929
1943
|
className: "confirm__confirmButton",
|
|
@@ -1932,7 +1946,7 @@ const Confirm = ({
|
|
|
1932
1946
|
children: confirmText
|
|
1933
1947
|
}
|
|
1934
1948
|
),
|
|
1935
|
-
|
|
1949
|
+
showsCancelButton && /* @__PURE__ */ jsx(
|
|
1936
1950
|
SimpleButton,
|
|
1937
1951
|
{
|
|
1938
1952
|
onClick: onCancel,
|
|
@@ -4273,7 +4287,8 @@ const DateInput = observer(
|
|
|
4273
4287
|
onChange,
|
|
4274
4288
|
onError,
|
|
4275
4289
|
readonly,
|
|
4276
|
-
value: outerValue
|
|
4290
|
+
value: outerValue,
|
|
4291
|
+
props
|
|
4277
4292
|
}) => {
|
|
4278
4293
|
const controller = useMemo(
|
|
4279
4294
|
() => new DateInputController(outerId),
|
|
@@ -4288,7 +4303,8 @@ const DateInput = observer(
|
|
|
4288
4303
|
onChange,
|
|
4289
4304
|
onError,
|
|
4290
4305
|
readonly,
|
|
4291
|
-
value: outerValue
|
|
4306
|
+
value: outerValue,
|
|
4307
|
+
props
|
|
4292
4308
|
});
|
|
4293
4309
|
return /* @__PURE__ */ jsx(
|
|
4294
4310
|
Box,
|
|
@@ -4320,7 +4336,8 @@ const DateInput = observer(
|
|
|
4320
4336
|
onChange: controller.onInputChange.bind(controller),
|
|
4321
4337
|
value: controller.inputValue,
|
|
4322
4338
|
id: outerId,
|
|
4323
|
-
name: outerId
|
|
4339
|
+
name: outerId,
|
|
4340
|
+
...props
|
|
4324
4341
|
},
|
|
4325
4342
|
mask: getMaskForDateFormat(),
|
|
4326
4343
|
maskPlaceholder: DEFAULT_MASK_PLACEHOLDER,
|
|
@@ -4507,9 +4524,29 @@ const NumberInput = React__default.forwardRef(
|
|
|
4507
4524
|
const RequiredMark = ({
|
|
4508
4525
|
isFormReadonly = false,
|
|
4509
4526
|
isRequired = false,
|
|
4510
|
-
isReadonly = false
|
|
4527
|
+
isReadonly = false,
|
|
4528
|
+
sx,
|
|
4529
|
+
style,
|
|
4530
|
+
...rest
|
|
4511
4531
|
}) => {
|
|
4512
|
-
|
|
4532
|
+
const mergedSx = {
|
|
4533
|
+
color: "palette.error.main",
|
|
4534
|
+
fontWeight: "bold",
|
|
4535
|
+
...sx ?? style ?? {}
|
|
4536
|
+
};
|
|
4537
|
+
if (!isRequired || isReadonly || isFormReadonly)
|
|
4538
|
+
return null;
|
|
4539
|
+
return /* @__PURE__ */ jsx(
|
|
4540
|
+
Box,
|
|
4541
|
+
{
|
|
4542
|
+
as: "span",
|
|
4543
|
+
sx: mergedSx,
|
|
4544
|
+
className: "requiredMark",
|
|
4545
|
+
title: getLabel("msgReqField").text,
|
|
4546
|
+
...rest,
|
|
4547
|
+
children: "*"
|
|
4548
|
+
}
|
|
4549
|
+
);
|
|
4513
4550
|
};
|
|
4514
4551
|
|
|
4515
4552
|
const getFieldErrorStyles = (isValid) => {
|
|
@@ -4884,7 +4921,25 @@ const DefaultAccordionItemButton = (props) => {
|
|
|
4884
4921
|
onChange: setIsChecked
|
|
4885
4922
|
}
|
|
4886
4923
|
),
|
|
4887
|
-
|
|
4924
|
+
(props.label ?? props.title ?? props.ariaLabel).split(" | ").map((content, i) => {
|
|
4925
|
+
if (typeof props.isHtml === "boolean" && props.isHtml || Array.isArray(props.isHtml) && props.isHtml[i]) {
|
|
4926
|
+
return /* @__PURE__ */ jsx(
|
|
4927
|
+
Box,
|
|
4928
|
+
{
|
|
4929
|
+
className: "accordion__item__button__html",
|
|
4930
|
+
dangerouslySetInnerHTML: {
|
|
4931
|
+
__html: String(content).replaceAll(
|
|
4932
|
+
/<TOK(\d+)/g,
|
|
4933
|
+
"<TOK$1"
|
|
4934
|
+
)
|
|
4935
|
+
},
|
|
4936
|
+
as: "span"
|
|
4937
|
+
}
|
|
4938
|
+
);
|
|
4939
|
+
} else {
|
|
4940
|
+
return /* @__PURE__ */ jsx(Box, { as: "h3", className: "accordion__item__button__label", children: /* @__PURE__ */ jsx(AutoEllipsis, { overrideStyles: () => ({ textAlign: "left" }), children: content }) });
|
|
4941
|
+
}
|
|
4942
|
+
})
|
|
4888
4943
|
] }),
|
|
4889
4944
|
/* @__PURE__ */ jsxs(Box, { className: "accordion__item__button__rightGroup", children: [
|
|
4890
4945
|
props.rightButtons,
|
|
@@ -7510,7 +7565,8 @@ const FileCard = forwardRef(
|
|
|
7510
7565
|
handleClose,
|
|
7511
7566
|
onDoubleClick,
|
|
7512
7567
|
onClick,
|
|
7513
|
-
onDropFiles
|
|
7568
|
+
onDropFiles,
|
|
7569
|
+
previewProps
|
|
7514
7570
|
}, ref) => {
|
|
7515
7571
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
7516
7572
|
return /* @__PURE__ */ createElement(
|
|
@@ -7552,32 +7608,35 @@ const FileCard = forwardRef(
|
|
|
7552
7608
|
}
|
|
7553
7609
|
}
|
|
7554
7610
|
},
|
|
7555
|
-
/* @__PURE__ */ jsxs(Box, { className: "
|
|
7556
|
-
/* @__PURE__ */
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7611
|
+
/* @__PURE__ */ jsxs(Box, { className: "fileCard__container", children: [
|
|
7612
|
+
/* @__PURE__ */ jsxs(Box, { className: "fileCard__content", children: [
|
|
7613
|
+
/* @__PURE__ */ jsx(FileIcon, { docName: name, iconSize: iconsSize }),
|
|
7614
|
+
/* @__PURE__ */ jsx(Box, { as: "span", className: "fileCard__name", children: name })
|
|
7615
|
+
] }),
|
|
7616
|
+
/* @__PURE__ */ jsx(Box, { className: "fileCard__additionalButtons", children: additionalButtons?.map((c) => {
|
|
7617
|
+
return /* @__PURE__ */ jsx(
|
|
7618
|
+
IconButton,
|
|
7619
|
+
{
|
|
7620
|
+
iconSize: "Md",
|
|
7621
|
+
...c,
|
|
7622
|
+
className: `fileCard__additionalButton ${c.className ?? ""}`
|
|
7623
|
+
}
|
|
7624
|
+
);
|
|
7625
|
+
}) }),
|
|
7626
|
+
handleClose && /* @__PURE__ */ jsx(
|
|
7627
|
+
Close,
|
|
7562
7628
|
{
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
Close,
|
|
7571
|
-
{
|
|
7572
|
-
type: "button",
|
|
7573
|
-
className: "fileCard__delete",
|
|
7574
|
-
onClick: (e) => {
|
|
7575
|
-
e.stopPropagation();
|
|
7576
|
-
e.preventDefault();
|
|
7577
|
-
handleClose(name);
|
|
7629
|
+
type: "button",
|
|
7630
|
+
className: "fileCard__delete",
|
|
7631
|
+
onClick: (e) => {
|
|
7632
|
+
e.stopPropagation();
|
|
7633
|
+
e.preventDefault();
|
|
7634
|
+
handleClose(name);
|
|
7635
|
+
}
|
|
7578
7636
|
}
|
|
7579
|
-
|
|
7580
|
-
)
|
|
7637
|
+
)
|
|
7638
|
+
] }),
|
|
7639
|
+
previewProps?.hasPreview && previewProps?.previewUrl && /* @__PURE__ */ jsx(Box, { className: "fileCard__preview", children: /* @__PURE__ */ jsx("img", { src: previewProps.previewUrl, alt: name }) })
|
|
7581
7640
|
);
|
|
7582
7641
|
}
|
|
7583
7642
|
);
|
|
@@ -8018,7 +8077,7 @@ const NoMemoPagination = ({
|
|
|
8018
8077
|
{
|
|
8019
8078
|
disabled: isPerforming,
|
|
8020
8079
|
className: "pagination__deleteFiltersButton",
|
|
8021
|
-
"data-id": "
|
|
8080
|
+
"data-test-id": "btn-clear-filters",
|
|
8022
8081
|
onClick: onDeleteFilters,
|
|
8023
8082
|
children: [
|
|
8024
8083
|
breakPoint > 3 && /* @__PURE__ */ jsx(Box, { as: "span", className: "pagination__deleteLabels", children: definedLabels.deleteFilters }),
|
|
@@ -8044,7 +8103,8 @@ const NoMemoPagination = ({
|
|
|
8044
8103
|
disabled: disabled || isLoading,
|
|
8045
8104
|
variant: "icon-primary",
|
|
8046
8105
|
isLoading: isPerforming,
|
|
8047
|
-
className: "pagiantion__refreshIcon"
|
|
8106
|
+
className: "pagiantion__refreshIcon",
|
|
8107
|
+
"data-test-id": "btn-refresh"
|
|
8048
8108
|
}
|
|
8049
8109
|
)
|
|
8050
8110
|
] }) })
|
|
@@ -8288,7 +8348,8 @@ const TagReplacers = {
|
|
|
8288
8348
|
label: Label$1,
|
|
8289
8349
|
input: Input,
|
|
8290
8350
|
p: Paragraph,
|
|
8291
|
-
select: Select
|
|
8351
|
+
select: Select,
|
|
8352
|
+
table: (props) => /* @__PURE__ */ jsx(Box, { as: "table", ...props })
|
|
8292
8353
|
};
|
|
8293
8354
|
|
|
8294
8355
|
const contextMethods = {};
|