@mshuja288/aksuicore 0.4.3 → 0.4.4
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +21 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/primitives/Dialog.tsx +28 -3
package/dist/index.js
CHANGED
|
@@ -412,17 +412,35 @@ function Dialog({
|
|
|
412
412
|
children,
|
|
413
413
|
wide = true
|
|
414
414
|
}) {
|
|
415
|
+
const allowBackdropClose = useRef(false);
|
|
416
|
+
useEffect(() => {
|
|
417
|
+
if (!open) {
|
|
418
|
+
allowBackdropClose.current = false;
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
allowBackdropClose.current = false;
|
|
422
|
+
const timer = window.setTimeout(() => {
|
|
423
|
+
allowBackdropClose.current = true;
|
|
424
|
+
}, 0);
|
|
425
|
+
return () => window.clearTimeout(timer);
|
|
426
|
+
}, [open]);
|
|
415
427
|
if (!open) {
|
|
416
428
|
return null;
|
|
417
429
|
}
|
|
418
|
-
|
|
430
|
+
function onBackdropMouseDown(event) {
|
|
431
|
+
if (event.target !== event.currentTarget || !allowBackdropClose.current) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
onClose();
|
|
435
|
+
}
|
|
436
|
+
return /* @__PURE__ */ jsx("div", { className: "dialog-backdrop", onMouseDown: onBackdropMouseDown, children: /* @__PURE__ */ jsxs(
|
|
419
437
|
"div",
|
|
420
438
|
{
|
|
421
439
|
className: wide ? "dialog form-dialog" : "dialog",
|
|
422
440
|
role: "dialog",
|
|
423
441
|
"aria-modal": "true",
|
|
424
442
|
"aria-label": title,
|
|
425
|
-
|
|
443
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
426
444
|
children: [
|
|
427
445
|
/* @__PURE__ */ jsxs("div", { className: "dialog-head", children: [
|
|
428
446
|
/* @__PURE__ */ jsx("h2", { children: title }),
|
|
@@ -1428,7 +1446,7 @@ function RecordWorkspace({
|
|
|
1428
1446
|
className: "ghost side-rail-icon",
|
|
1429
1447
|
title: "Show filters",
|
|
1430
1448
|
"aria-label": "Show filters",
|
|
1431
|
-
onClick: () =>
|
|
1449
|
+
onClick: () => setSideOpenValue(true),
|
|
1432
1450
|
children: [
|
|
1433
1451
|
/* @__PURE__ */ jsx(FilterIcon, {}),
|
|
1434
1452
|
activeFilterCount > 0 ? /* @__PURE__ */ jsx("span", { className: "filter-badge", children: activeFilterCount }) : null
|