@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/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
- return /* @__PURE__ */ jsx("div", { className: "dialog-backdrop", onClick: onClose, children: /* @__PURE__ */ jsxs(
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
- onClick: (event) => event.stopPropagation(),
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: () => setSideOpen(true),
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