react-better-html 1.1.143 → 1.1.145
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 +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3266,6 +3266,7 @@ var ModalComponent = forwardRef6(function Modal({
|
|
|
3266
3266
|
headerBackgroundColor,
|
|
3267
3267
|
name,
|
|
3268
3268
|
overflow,
|
|
3269
|
+
withoutCloseButton,
|
|
3269
3270
|
onOpen,
|
|
3270
3271
|
onClose,
|
|
3271
3272
|
children
|
|
@@ -3300,6 +3301,15 @@ var ModalComponent = forwardRef6(function Modal({
|
|
|
3300
3301
|
setIsOpenedLate(false);
|
|
3301
3302
|
}, 0.2 * 1e3);
|
|
3302
3303
|
}, [onClose, urlQuery, name]);
|
|
3304
|
+
const onKeyDown = useCallback6(
|
|
3305
|
+
(event) => {
|
|
3306
|
+
if (event.key === "Escape") {
|
|
3307
|
+
if (!withoutCloseButton) return;
|
|
3308
|
+
event.preventDefault();
|
|
3309
|
+
}
|
|
3310
|
+
},
|
|
3311
|
+
[withoutCloseButton]
|
|
3312
|
+
);
|
|
3303
3313
|
useImperativeHandle(
|
|
3304
3314
|
ref,
|
|
3305
3315
|
() => {
|
|
@@ -3319,6 +3329,7 @@ var ModalComponent = forwardRef6(function Modal({
|
|
|
3319
3329
|
colorTheme,
|
|
3320
3330
|
opacity: !isOpened ? 0 : 1,
|
|
3321
3331
|
onClose: onClickClose,
|
|
3332
|
+
onKeyDown,
|
|
3322
3333
|
ref: dialogRef,
|
|
3323
3334
|
children: isOpenedLate ? /* @__PURE__ */ jsx11(
|
|
3324
3335
|
Div_default.column,
|
|
@@ -3378,7 +3389,7 @@ var ModalComponent = forwardRef6(function Modal({
|
|
|
3378
3389
|
}
|
|
3379
3390
|
)
|
|
3380
3391
|
] }),
|
|
3381
|
-
/* @__PURE__ */ jsx11(
|
|
3392
|
+
!withoutCloseButton && /* @__PURE__ */ jsx11(
|
|
3382
3393
|
Button_default.icon,
|
|
3383
3394
|
{
|
|
3384
3395
|
icon: "XMark",
|
|
@@ -3392,7 +3403,7 @@ var ModalComponent = forwardRef6(function Modal({
|
|
|
3392
3403
|
}
|
|
3393
3404
|
),
|
|
3394
3405
|
/* @__PURE__ */ jsx11(Divider_default.horizontal, {})
|
|
3395
|
-
] }) : /* @__PURE__ */ jsx11(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ jsx11(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }),
|
|
3406
|
+
] }) : /* @__PURE__ */ jsx11(Fragment2, { children: !withoutCloseButton && /* @__PURE__ */ jsx11(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ jsx11(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }) }),
|
|
3396
3407
|
/* @__PURE__ */ jsx11(
|
|
3397
3408
|
Div_default,
|
|
3398
3409
|
{
|
|
@@ -7015,6 +7026,7 @@ var ToggleInput_default = {
|
|
|
7015
7026
|
{
|
|
7016
7027
|
alignItems: "center",
|
|
7017
7028
|
gap: theme2.styles.gap,
|
|
7029
|
+
isTabAccessed: true,
|
|
7018
7030
|
onMouseDown: setIsMouseDown.setTrue,
|
|
7019
7031
|
onMouseUp: setIsMouseDown.setFalse,
|
|
7020
7032
|
onMouseOut: setIsMouseDown.setFalse,
|
|
@@ -7504,14 +7516,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7504
7516
|
);
|
|
7505
7517
|
}
|
|
7506
7518
|
case "expand": {
|
|
7507
|
-
return /* @__PURE__ */ jsx22(
|
|
7519
|
+
return /* @__PURE__ */ jsx22(Div_default, { isTabAccessed: true, children: /* @__PURE__ */ jsx22(
|
|
7508
7520
|
Icon_default,
|
|
7509
7521
|
{
|
|
7510
7522
|
name: "chevronDown",
|
|
7511
7523
|
transform: `rotate(${expandedRows[itemIndex] ? 180 : 0}deg)`,
|
|
7512
7524
|
transition: theme2.styles.transition
|
|
7513
7525
|
}
|
|
7514
|
-
);
|
|
7526
|
+
) });
|
|
7515
7527
|
}
|
|
7516
7528
|
default: {
|
|
7517
7529
|
return /* @__PURE__ */ jsx22(Fragment6, {});
|
|
@@ -7527,8 +7539,10 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7527
7539
|
if (oldValue[index] === void 0) {
|
|
7528
7540
|
const newValue = expandColumn.onlyOneExpanded ? [] : [...oldValue];
|
|
7529
7541
|
newValue[index] = true;
|
|
7542
|
+
expandColumn.onExpand?.(item, index);
|
|
7530
7543
|
return newValue;
|
|
7531
7544
|
}
|
|
7545
|
+
expandColumn.onCollapse?.(item, index);
|
|
7532
7546
|
return oldValue.map((isExpanded, internalIndex) => internalIndex === index ? !isExpanded : isExpanded);
|
|
7533
7547
|
});
|
|
7534
7548
|
} else onClickRow?.(item, index);
|