@upbound/monarch-blocks 0.4.1 → 0.5.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/cel-filter-bar.js +20 -12
- package/dist/cel-filter-bar.js.map +1 -1
- package/dist/data-table.d.ts +30 -5
- package/dist/data-table.js +395 -293
- package/dist/data-table.js.map +1 -1
- package/dist/filter-bar.d.ts +6 -2
- package/dist/filter-bar.js +90 -51
- package/dist/filter-bar.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +456 -354
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cel-filter-bar.js
CHANGED
|
@@ -1218,6 +1218,7 @@ function CelFilterBar({
|
|
|
1218
1218
|
(_a = onCompileResultChangeRef.current) == null ? void 0 : _a.call(onCompileResultChangeRef, __spreadProps(__spreadValues({}, displayResult), { isEmitReady }));
|
|
1219
1219
|
}, [displayResult, isEmitReady]);
|
|
1220
1220
|
const conditions = tree.root.children.filter(isCelFilterCondition);
|
|
1221
|
+
const containerRef = React.useRef(null);
|
|
1221
1222
|
function handleAddFilter(columnId) {
|
|
1222
1223
|
const condition = createDefaultCondition({ schema, columnId });
|
|
1223
1224
|
onChange(appendCondition(tree, condition));
|
|
@@ -1232,8 +1233,8 @@ function CelFilterBar({
|
|
|
1232
1233
|
onChange({ root: __spreadProps(__spreadValues({}, tree.root), { children: [] }) });
|
|
1233
1234
|
editor.clearSuppress();
|
|
1234
1235
|
}
|
|
1235
|
-
return /* @__PURE__ */ jsxs("div", { "data-slot": "cel-filter-bar", className: cn("flex flex-wrap items-center gap-2", className), children: [
|
|
1236
|
-
/* @__PURE__ */ jsx(CelAddFilterButton, { schema, conditions, onSelect: handleAddFilter }),
|
|
1236
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "cel-filter-bar", className: cn("flex flex-wrap items-center gap-2", className), ref: containerRef, children: [
|
|
1237
|
+
/* @__PURE__ */ jsx(CelAddFilterButton, { schema, conditions, onSelect: handleAddFilter, container: containerRef }),
|
|
1237
1238
|
conditions.map((condition) => {
|
|
1238
1239
|
const columnDef = resolveColumnDefinition(condition, schema);
|
|
1239
1240
|
if (!columnDef) return null;
|
|
@@ -1248,7 +1249,8 @@ function CelFilterBar({
|
|
|
1248
1249
|
controller: editor.getController(condition.id),
|
|
1249
1250
|
issues: displayResult.issues.filter((issue) => issue.nodeId === condition.id),
|
|
1250
1251
|
onRemove: () => handleRemove(condition.id),
|
|
1251
|
-
onRestrictedOptionSelect
|
|
1252
|
+
onRestrictedOptionSelect,
|
|
1253
|
+
container: containerRef
|
|
1252
1254
|
},
|
|
1253
1255
|
condition.id
|
|
1254
1256
|
);
|
|
@@ -1259,7 +1261,8 @@ function CelFilterBar({
|
|
|
1259
1261
|
function CelAddFilterButton({
|
|
1260
1262
|
schema,
|
|
1261
1263
|
conditions,
|
|
1262
|
-
onSelect
|
|
1264
|
+
onSelect,
|
|
1265
|
+
container
|
|
1263
1266
|
}) {
|
|
1264
1267
|
var _a, _b;
|
|
1265
1268
|
const usedSingleInstanceColumnIds = new Set(
|
|
@@ -1290,7 +1293,7 @@ function CelAddFilterButton({
|
|
|
1290
1293
|
/* @__PURE__ */ jsx(Icon, { name: "plus", "data-icon": "inline-start" }),
|
|
1291
1294
|
"Add filter"
|
|
1292
1295
|
] }),
|
|
1293
|
-
/* @__PURE__ */ jsxs(ComboboxContent, { align: "start", className: "w-64", children: [
|
|
1296
|
+
/* @__PURE__ */ jsxs(ComboboxContent, { container, align: "start", className: "w-64", children: [
|
|
1294
1297
|
/* @__PURE__ */ jsx(ComboboxInput, { showTrigger: false, placeholder: "Search filters\u2026" }),
|
|
1295
1298
|
/* @__PURE__ */ jsx(ComboboxEmpty, { children: "No filters found." }),
|
|
1296
1299
|
/* @__PURE__ */ jsx(ComboboxList, { children: (group) => /* @__PURE__ */ jsxs(ComboboxGroup, { items: group.items, children: [
|
|
@@ -1354,7 +1357,8 @@ function CelFilterPill({
|
|
|
1354
1357
|
controller,
|
|
1355
1358
|
issues,
|
|
1356
1359
|
onRemove,
|
|
1357
|
-
onRestrictedOptionSelect
|
|
1360
|
+
onRestrictedOptionSelect,
|
|
1361
|
+
container
|
|
1358
1362
|
}) {
|
|
1359
1363
|
var _a;
|
|
1360
1364
|
const shape = (_a = resolveFilterShape(condition, schema)) != null ? _a : columnDef.filterType;
|
|
@@ -1371,7 +1375,8 @@ function CelFilterPill({
|
|
|
1371
1375
|
controller,
|
|
1372
1376
|
issues,
|
|
1373
1377
|
onRemove,
|
|
1374
|
-
onRestrictedOptionSelect
|
|
1378
|
+
onRestrictedOptionSelect,
|
|
1379
|
+
container
|
|
1375
1380
|
}
|
|
1376
1381
|
);
|
|
1377
1382
|
}
|
|
@@ -1386,7 +1391,8 @@ function CelFilterPill({
|
|
|
1386
1391
|
controller,
|
|
1387
1392
|
issues,
|
|
1388
1393
|
onRemove,
|
|
1389
|
-
onRestrictedOptionSelect
|
|
1394
|
+
onRestrictedOptionSelect,
|
|
1395
|
+
container
|
|
1390
1396
|
}
|
|
1391
1397
|
);
|
|
1392
1398
|
}
|
|
@@ -1496,7 +1502,8 @@ function CelCheckboxComboboxPill({
|
|
|
1496
1502
|
controller,
|
|
1497
1503
|
issues,
|
|
1498
1504
|
onRemove,
|
|
1499
|
-
onRestrictedOptionSelect
|
|
1505
|
+
onRestrictedOptionSelect,
|
|
1506
|
+
container
|
|
1500
1507
|
}) {
|
|
1501
1508
|
var _a;
|
|
1502
1509
|
const options = (_a = columnDef.options) != null ? _a : [];
|
|
@@ -1555,7 +1562,7 @@ function CelCheckboxComboboxPill({
|
|
|
1555
1562
|
),
|
|
1556
1563
|
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", "aria-label": `Remove ${columnDef.title} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
|
|
1557
1564
|
] }),
|
|
1558
|
-
/* @__PURE__ */ jsxs(ComboboxContent, { className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
|
|
1565
|
+
/* @__PURE__ */ jsxs(ComboboxContent, { container, className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
|
|
1559
1566
|
/* @__PURE__ */ jsx(ComboboxInput, { showTrigger: false, placeholder: `Search ${columnDef.title.toLowerCase()}\u2026` }),
|
|
1560
1567
|
selected.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1561
1568
|
/* @__PURE__ */ jsxs(ComboboxSelectedChips, { children: [
|
|
@@ -1584,7 +1591,8 @@ function CelRadioComboboxPill({
|
|
|
1584
1591
|
controller,
|
|
1585
1592
|
issues,
|
|
1586
1593
|
onRemove,
|
|
1587
|
-
onRestrictedOptionSelect
|
|
1594
|
+
onRestrictedOptionSelect,
|
|
1595
|
+
container
|
|
1588
1596
|
}) {
|
|
1589
1597
|
var _a, _b;
|
|
1590
1598
|
const options = (_a = columnDef.options) != null ? _a : [];
|
|
@@ -1639,7 +1647,7 @@ function CelRadioComboboxPill({
|
|
|
1639
1647
|
),
|
|
1640
1648
|
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", "aria-label": `Remove ${columnDef.title} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
|
|
1641
1649
|
] }),
|
|
1642
|
-
/* @__PURE__ */ jsxs(ComboboxContent, { className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
|
|
1650
|
+
/* @__PURE__ */ jsxs(ComboboxContent, { container, className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
|
|
1643
1651
|
/* @__PURE__ */ jsx(ComboboxInput, { showTrigger: false, placeholder: `Search ${columnDef.title.toLowerCase()}\u2026` }),
|
|
1644
1652
|
/* @__PURE__ */ jsxs(ComboboxEmpty, { children: [
|
|
1645
1653
|
"No ",
|