@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/data-table.js +9 -4
- package/dist/data-table.js.map +1 -1
- package/dist/graph.js +9 -4
- package/dist/graph.js.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4473,16 +4473,21 @@ var defaultNoFilterFoundConfig = {
|
|
|
4473
4473
|
header: "No matching results",
|
|
4474
4474
|
subheader: "Try adjusting your search or filters."
|
|
4475
4475
|
};
|
|
4476
|
+
function mergeConfig(defaults, custom) {
|
|
4477
|
+
if (!custom) return defaults;
|
|
4478
|
+
const provided = Object.fromEntries(Object.entries(custom).filter(([, value]) => value !== void 0));
|
|
4479
|
+
return __spreadValues(__spreadValues({}, defaults), provided);
|
|
4480
|
+
}
|
|
4476
4481
|
function DataTableEmptyView({
|
|
4477
4482
|
emptyView,
|
|
4478
4483
|
tableState,
|
|
4479
4484
|
filterCount,
|
|
4480
4485
|
resetFilters
|
|
4481
4486
|
}) {
|
|
4482
|
-
var _a, _b, _c, _d
|
|
4487
|
+
var _a, _b, _c, _d;
|
|
4483
4488
|
const isFilteredEmpty = tableState === "empty" && filterCount > 0;
|
|
4484
|
-
const config = tableState === "error" ? (
|
|
4485
|
-
const wrapperClassName = tableState === "error" ? (
|
|
4489
|
+
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;
|
|
4490
|
+
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;
|
|
4486
4491
|
const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs8(Button5, { variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
4487
4492
|
/* @__PURE__ */ jsx10(Icon6, { name: "xmark" }),
|
|
4488
4493
|
"Clear filters"
|
|
@@ -4495,7 +4500,7 @@ function DataTableEmptyView({
|
|
|
4495
4500
|
] }),
|
|
4496
4501
|
(config.details || config.action || defaultAction) && /* @__PURE__ */ jsxs8(EmptyContent, { children: [
|
|
4497
4502
|
config.details && /* @__PURE__ */ jsx10(Alert, { children: /* @__PURE__ */ jsx10(AlertDescription, { children: config.details }) }),
|
|
4498
|
-
(
|
|
4503
|
+
(_d = config.action) != null ? _d : defaultAction
|
|
4499
4504
|
] })
|
|
4500
4505
|
] }) });
|
|
4501
4506
|
}
|