@upbound/monarch-blocks 0.8.2 → 0.9.0

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/graph.js CHANGED
@@ -526,16 +526,21 @@ var defaultNoFilterFoundConfig = {
526
526
  header: "No matching results",
527
527
  subheader: "Try adjusting your search or filters."
528
528
  };
529
+ function mergeConfig(defaults, custom) {
530
+ if (!custom) return defaults;
531
+ const provided = Object.fromEntries(Object.entries(custom).filter(([, value]) => value !== void 0));
532
+ return __spreadValues(__spreadValues({}, defaults), provided);
533
+ }
529
534
  function DataTableEmptyView({
530
535
  emptyView,
531
536
  tableState,
532
537
  filterCount,
533
538
  resetFilters
534
539
  }) {
535
- var _a, _b, _c, _d, _e, _f, _g;
540
+ var _a, _b, _c, _d;
536
541
  const isFilteredEmpty = tableState === "empty" && filterCount > 0;
537
- const config = tableState === "error" ? (_a = emptyView == null ? void 0 : emptyView.error) != null ? _a : defaultErrorConfig : tableState === "empty" ? isFilteredEmpty ? (_b = emptyView == null ? void 0 : emptyView.filter) != null ? _b : defaultNoFilterFoundConfig : (_c = emptyView == null ? void 0 : emptyView.empty) != null ? _c : defaultEmptyConfig : null;
538
- const wrapperClassName = tableState === "error" ? (_f = (_d = emptyView == null ? void 0 : emptyView.error) == null ? void 0 : _d.wrapperClassName) != null ? _f : (_e = emptyView == null ? void 0 : emptyView.empty) == null ? void 0 : _e.wrapperClassName : config == null ? void 0 : config.wrapperClassName;
542
+ const config = tableState === "error" ? mergeConfig(defaultErrorConfig, emptyView == null ? void 0 : emptyView.error) : tableState === "empty" ? isFilteredEmpty ? mergeConfig(defaultNoFilterFoundConfig, emptyView == null ? void 0 : emptyView.filter) : mergeConfig(defaultEmptyConfig, emptyView == null ? void 0 : emptyView.empty) : null;
543
+ const wrapperClassName = tableState === "error" ? (_c = (_a = emptyView == null ? void 0 : emptyView.error) == null ? void 0 : _a.wrapperClassName) != null ? _c : (_b = emptyView == null ? void 0 : emptyView.empty) == null ? void 0 : _b.wrapperClassName : config == null ? void 0 : config.wrapperClassName;
539
544
  const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs3(Button, { variant: "outline", size: "sm", onClick: resetFilters, children: [
540
545
  /* @__PURE__ */ jsx4(Icon2, { name: "xmark" }),
541
546
  "Clear filters"
@@ -548,7 +553,7 @@ function DataTableEmptyView({
548
553
  ] }),
549
554
  (config.details || config.action || defaultAction) && /* @__PURE__ */ jsxs3(EmptyContent, { children: [
550
555
  config.details && /* @__PURE__ */ jsx4(Alert, { children: /* @__PURE__ */ jsx4(AlertDescription, { children: config.details }) }),
551
- (_g = config.action) != null ? _g : defaultAction
556
+ (_d = config.action) != null ? _d : defaultAction
552
557
  ] })
553
558
  ] }) });
554
559
  }