@overmap-ai/blocks 1.0.7 → 1.0.8
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/README.md +3 -3
- package/dist/ButtonGroup/ButtonList.d.ts +2 -1
- package/dist/blocks.js +8 -37
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +39 -161
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/style.css +16 -16
- package/package.json +102 -102
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("
|
|
3
|
-
})(this, function(exports2,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@radix-ui/themes"), require("react"), require("react-responsive"), require("@radix-ui/react-icons"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-dialog"), require("re-resizable"), require("@radix-ui/react-dismissable-layer"), require("react-transition-group"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("react-dom"), require("@table-library/react-table-library/table.js"), require("@table-library/react-table-library/theme.js"), require("@table-library/react-table-library/sort.js"), require("@table-library/react-table-library/select.js"), require("@table-library/react-table-library/pagination.js"), require("react-device-detect")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@radix-ui/themes", "react", "react-responsive", "@radix-ui/react-icons", "@radix-ui/react-dropdown-menu", "@radix-ui/react-dialog", "re-resizable", "@radix-ui/react-dismissable-layer", "react-transition-group", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "react-dom", "@table-library/react-table-library/table.js", "@table-library/react-table-library/theme.js", "@table-library/react-table-library/sort.js", "@table-library/react-table-library/select.js", "@table-library/react-table-library/pagination.js", "react-device-detect"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.jsxRuntime, global.themes, global.React, global.reactResponsive, global.reactIcons, global.RadixDropdownMenu, global.RadixDialogPrimitive, global.reResizable, global.reactDismissableLayer, global.reactTransitionGroup, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.reactDom, global.table_js, global.theme_js, global.sort_js, global.select_js, global.pagination_js, global.reactDeviceDetect));
|
|
3
|
+
})(this, function(exports2, jsxRuntime, themes, React, reactResponsive, reactIcons, RadixDropdownMenu, RadixDialogPrimitive, reResizable, reactDismissableLayer, reactTransitionGroup, reactToggleGroup, reactToolbar, RadixToast, reactDom, table_js, theme_js, sort_js, select_js, pagination_js, reactDeviceDetect) {
|
|
4
4
|
"use strict";
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -94,11 +94,11 @@
|
|
|
94
94
|
info: "gray"
|
|
95
95
|
};
|
|
96
96
|
const useSeverityColor = (severity) => {
|
|
97
|
-
const
|
|
97
|
+
const theme = themes.useThemeContext();
|
|
98
98
|
if (!severity)
|
|
99
99
|
return void 0;
|
|
100
100
|
if (severity === "primary")
|
|
101
|
-
return
|
|
101
|
+
return theme.accentColor;
|
|
102
102
|
return nonThemeSeverityMapping[severity];
|
|
103
103
|
};
|
|
104
104
|
const useViewportSize = () => {
|
|
@@ -3101,7 +3101,7 @@
|
|
|
3101
3101
|
setSearch(e.target.value);
|
|
3102
3102
|
}, []);
|
|
3103
3103
|
const tableData = { nodes: rows };
|
|
3104
|
-
const tableSelect =
|
|
3104
|
+
const tableSelect = select_js.useRowSelect(
|
|
3105
3105
|
tableData,
|
|
3106
3106
|
{
|
|
3107
3107
|
onChange: (_action, state) => {
|
|
@@ -3109,13 +3109,13 @@
|
|
|
3109
3109
|
}
|
|
3110
3110
|
},
|
|
3111
3111
|
{
|
|
3112
|
-
rowSelect:
|
|
3113
|
-
buttonSelect:
|
|
3114
|
-
clickType:
|
|
3112
|
+
rowSelect: select_js.SelectTypes.MultiSelect,
|
|
3113
|
+
buttonSelect: select_js.SelectTypes.MultiSelect,
|
|
3114
|
+
clickType: select_js.SelectClickTypes.ButtonClick,
|
|
3115
3115
|
isCarryForward: false
|
|
3116
3116
|
}
|
|
3117
3117
|
);
|
|
3118
|
-
const pagination
|
|
3118
|
+
const pagination = pagination_js.usePagination(
|
|
3119
3119
|
tableData,
|
|
3120
3120
|
{
|
|
3121
3121
|
state: {
|
|
@@ -3127,7 +3127,7 @@
|
|
|
3127
3127
|
isServer: false
|
|
3128
3128
|
}
|
|
3129
3129
|
);
|
|
3130
|
-
const sort
|
|
3130
|
+
const sort = sort_js.useSort(
|
|
3131
3131
|
tableData,
|
|
3132
3132
|
{ onChange: () => null },
|
|
3133
3133
|
{
|
|
@@ -3207,7 +3207,7 @@
|
|
|
3207
3207
|
[columnFilterValues, columns, getFilterValues]
|
|
3208
3208
|
);
|
|
3209
3209
|
const columnCells = columnsData.map((column) => {
|
|
3210
|
-
const Component = column.sort ?
|
|
3210
|
+
const Component = column.sort ? sort_js.HeaderCellSort : table_js.HeaderCell;
|
|
3211
3211
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3212
3212
|
Component,
|
|
3213
3213
|
{
|
|
@@ -3220,7 +3220,7 @@
|
|
|
3220
3220
|
});
|
|
3221
3221
|
const SelectedModeButton = reactDeviceDetect.isMobile ? IconButton : Button2;
|
|
3222
3222
|
const layout = React.useMemo(() => ({ custom: true }), []);
|
|
3223
|
-
const theme
|
|
3223
|
+
const theme = theme_js.useTheme({
|
|
3224
3224
|
Table: `
|
|
3225
3225
|
--data-table-library_grid-template-columns: ${gridTemplateColumns};
|
|
3226
3226
|
`,
|
|
@@ -3243,14 +3243,14 @@
|
|
|
3243
3243
|
if (showPageNavigation) {
|
|
3244
3244
|
const numTotalPages = Math.ceil(rows.length / numRowsPerPage);
|
|
3245
3245
|
setTotalPages(numTotalPages);
|
|
3246
|
-
if (pagination
|
|
3247
|
-
pagination
|
|
3246
|
+
if (pagination.state.page < 0) {
|
|
3247
|
+
pagination.fns.onSetPage(0);
|
|
3248
3248
|
}
|
|
3249
|
-
if (pagination
|
|
3250
|
-
pagination
|
|
3249
|
+
if (pagination.state.page > numTotalPages - 1) {
|
|
3250
|
+
pagination.fns.onSetPage(numTotalPages - 1);
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
3253
|
-
}, [rowsPerPage, rows.length, numRowsPerPage, pagination
|
|
3253
|
+
}, [rowsPerPage, rows.length, numRowsPerPage, pagination, showPageNavigation]);
|
|
3254
3254
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames({ [styles$1.tableContainer]: showContainer }), children: [
|
|
3255
3255
|
(!!title || !!description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.headerContainer, children: [
|
|
3256
3256
|
!!title && /* @__PURE__ */ jsxRuntime.jsx(Text$1, { weight: "bold", size: "7", children: title }),
|
|
@@ -3283,7 +3283,7 @@
|
|
|
3283
3283
|
color: "crimson",
|
|
3284
3284
|
onClick: () => {
|
|
3285
3285
|
setColumnFilterValues(defaultColumnFilterValues);
|
|
3286
|
-
pagination
|
|
3286
|
+
pagination.fns.onSetPage(0);
|
|
3287
3287
|
},
|
|
3288
3288
|
children: [
|
|
3289
3289
|
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross2Icon, {}),
|
|
@@ -3305,33 +3305,33 @@
|
|
|
3305
3305
|
] }),
|
|
3306
3306
|
children,
|
|
3307
3307
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3308
|
-
|
|
3308
|
+
table_js.Table,
|
|
3309
3309
|
{
|
|
3310
3310
|
className: classNames(styles$1.table, className),
|
|
3311
3311
|
data: tableData,
|
|
3312
|
-
theme
|
|
3313
|
-
sort
|
|
3314
|
-
pagination: showPageNavigation && pagination
|
|
3312
|
+
theme,
|
|
3313
|
+
sort,
|
|
3314
|
+
pagination: showPageNavigation && pagination,
|
|
3315
3315
|
select: tableSelect,
|
|
3316
3316
|
layout,
|
|
3317
3317
|
ref,
|
|
3318
3318
|
children: (tableList) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3319
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3320
|
-
showSelect && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3319
|
+
/* @__PURE__ */ jsxRuntime.jsx(table_js.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(table_js.HeaderRow, { children: [
|
|
3320
|
+
showSelect && /* @__PURE__ */ jsxRuntime.jsx(select_js.HeaderCellSelect, { className: styles$1.tableHeaderCell }),
|
|
3321
3321
|
...columnCells
|
|
3322
3322
|
] }) }),
|
|
3323
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3324
|
-
tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3323
|
+
/* @__PURE__ */ jsxRuntime.jsxs(table_js.Body, { children: [
|
|
3324
|
+
tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(table_js.Cell, { children: emptyMessage }) }),
|
|
3325
3325
|
tableList.map((row) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3326
|
-
|
|
3326
|
+
table_js.Row,
|
|
3327
3327
|
{
|
|
3328
3328
|
item: row,
|
|
3329
3329
|
className: classNames(styles$1.tableRow, rowClassName, row.className),
|
|
3330
3330
|
onClick: row.onClick,
|
|
3331
3331
|
children: [
|
|
3332
|
-
showSelect && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3332
|
+
showSelect && /* @__PURE__ */ jsxRuntime.jsx(select_js.CellSelect, { item: row }, row.id),
|
|
3333
3333
|
columns.map((column, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3334
|
-
|
|
3334
|
+
table_js.Cell,
|
|
3335
3335
|
{
|
|
3336
3336
|
className: classNames(
|
|
3337
3337
|
styles$1.tableCell,
|
|
@@ -3359,7 +3359,7 @@
|
|
|
3359
3359
|
items: rowsPerPageOptions,
|
|
3360
3360
|
defaultValue: rowsPerPageOptions[0].value.toString(),
|
|
3361
3361
|
onValueChange: (v) => {
|
|
3362
|
-
pagination
|
|
3362
|
+
pagination.fns.onSetSize(Number(v));
|
|
3363
3363
|
setNumRowsPerPage(Number(v));
|
|
3364
3364
|
},
|
|
3365
3365
|
placeholder: rowsPerPageOptions[0].itemContent,
|
|
@@ -3367,14 +3367,14 @@
|
|
|
3367
3367
|
}
|
|
3368
3368
|
)
|
|
3369
3369
|
] }),
|
|
3370
|
-
showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: totalPages > 0 && `Page ${pagination
|
|
3370
|
+
showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: totalPages > 0 && `Page ${pagination.state.page + 1} of ${totalPages}` }),
|
|
3371
3371
|
showPageNavigation && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, gap: "2", justify: "end", children: [
|
|
3372
3372
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3373
3373
|
IconButton,
|
|
3374
3374
|
{
|
|
3375
3375
|
variant: "surface",
|
|
3376
|
-
onClick: () => pagination
|
|
3377
|
-
disabled: pagination
|
|
3376
|
+
onClick: () => pagination.fns.onSetPage(0),
|
|
3377
|
+
disabled: pagination.state.page === 0 || totalPages === 0,
|
|
3378
3378
|
"aria-label": "Go to first page",
|
|
3379
3379
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DoubleArrowLeftIcon, {})
|
|
3380
3380
|
}
|
|
@@ -3383,8 +3383,8 @@
|
|
|
3383
3383
|
IconButton,
|
|
3384
3384
|
{
|
|
3385
3385
|
variant: "surface",
|
|
3386
|
-
disabled: pagination
|
|
3387
|
-
onClick: () => pagination
|
|
3386
|
+
disabled: pagination.state.page === 0 || totalPages === 0,
|
|
3387
|
+
onClick: () => pagination.fns.onSetPage(pagination.state.page - 1),
|
|
3388
3388
|
"aria-label": "Previous page",
|
|
3389
3389
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronLeftIcon, {})
|
|
3390
3390
|
}
|
|
@@ -3393,8 +3393,8 @@
|
|
|
3393
3393
|
IconButton,
|
|
3394
3394
|
{
|
|
3395
3395
|
variant: "surface",
|
|
3396
|
-
disabled: pagination
|
|
3397
|
-
onClick: () => pagination
|
|
3396
|
+
disabled: pagination.state.page + 1 === totalPages || totalPages === 0,
|
|
3397
|
+
onClick: () => pagination.fns.onSetPage(pagination.state.page + 1),
|
|
3398
3398
|
"aria-label": "Next page",
|
|
3399
3399
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronRightIcon, {})
|
|
3400
3400
|
}
|
|
@@ -3403,8 +3403,8 @@
|
|
|
3403
3403
|
IconButton,
|
|
3404
3404
|
{
|
|
3405
3405
|
variant: "surface",
|
|
3406
|
-
disabled: pagination
|
|
3407
|
-
onClick: () => pagination
|
|
3406
|
+
disabled: pagination.state.page + 1 === totalPages || totalPages === 0,
|
|
3407
|
+
onClick: () => pagination.fns.onSetPage(totalPages - 1),
|
|
3408
3408
|
"aria-label": "Go to last page",
|
|
3409
3409
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DoubleArrowRightIcon, {})
|
|
3410
3410
|
}
|
|
@@ -3563,118 +3563,10 @@
|
|
|
3563
3563
|
] }) });
|
|
3564
3564
|
});
|
|
3565
3565
|
const ConfirmEditInput = React.memo(_ConfirmEditInput);
|
|
3566
|
-
Object.defineProperty(exports2, "AccessibleIcon", {
|
|
3567
|
-
enumerable: true,
|
|
3568
|
-
get: () => themes.AccessibleIcon
|
|
3569
|
-
});
|
|
3570
|
-
Object.defineProperty(exports2, "AspectRatio", {
|
|
3571
|
-
enumerable: true,
|
|
3572
|
-
get: () => themes.AspectRatio
|
|
3573
|
-
});
|
|
3574
|
-
Object.defineProperty(exports2, "Avatar", {
|
|
3575
|
-
enumerable: true,
|
|
3576
|
-
get: () => themes.Avatar
|
|
3577
|
-
});
|
|
3578
|
-
Object.defineProperty(exports2, "Blockquote", {
|
|
3579
|
-
enumerable: true,
|
|
3580
|
-
get: () => themes.Blockquote
|
|
3581
|
-
});
|
|
3582
|
-
Object.defineProperty(exports2, "Box", {
|
|
3583
|
-
enumerable: true,
|
|
3584
|
-
get: () => themes.Box
|
|
3585
|
-
});
|
|
3586
|
-
Object.defineProperty(exports2, "Callout", {
|
|
3587
|
-
enumerable: true,
|
|
3588
|
-
get: () => themes.Callout
|
|
3589
|
-
});
|
|
3590
|
-
Object.defineProperty(exports2, "Card", {
|
|
3591
|
-
enumerable: true,
|
|
3592
|
-
get: () => themes.Card
|
|
3593
|
-
});
|
|
3594
|
-
Object.defineProperty(exports2, "Code", {
|
|
3595
|
-
enumerable: true,
|
|
3596
|
-
get: () => themes.Code
|
|
3597
|
-
});
|
|
3598
|
-
Object.defineProperty(exports2, "Container", {
|
|
3599
|
-
enumerable: true,
|
|
3600
|
-
get: () => themes.Container
|
|
3601
|
-
});
|
|
3602
|
-
Object.defineProperty(exports2, "Em", {
|
|
3603
|
-
enumerable: true,
|
|
3604
|
-
get: () => themes.Em
|
|
3605
|
-
});
|
|
3606
|
-
Object.defineProperty(exports2, "Grid", {
|
|
3607
|
-
enumerable: true,
|
|
3608
|
-
get: () => themes.Grid
|
|
3609
|
-
});
|
|
3610
|
-
Object.defineProperty(exports2, "Heading", {
|
|
3611
|
-
enumerable: true,
|
|
3612
|
-
get: () => themes.Heading
|
|
3613
|
-
});
|
|
3614
|
-
Object.defineProperty(exports2, "HoverCard", {
|
|
3615
|
-
enumerable: true,
|
|
3616
|
-
get: () => themes.HoverCard
|
|
3617
|
-
});
|
|
3618
|
-
Object.defineProperty(exports2, "Inset", {
|
|
3619
|
-
enumerable: true,
|
|
3620
|
-
get: () => themes.Inset
|
|
3621
|
-
});
|
|
3622
|
-
Object.defineProperty(exports2, "Kbd", {
|
|
3623
|
-
enumerable: true,
|
|
3624
|
-
get: () => themes.Kbd
|
|
3625
|
-
});
|
|
3626
|
-
Object.defineProperty(exports2, "Link", {
|
|
3627
|
-
enumerable: true,
|
|
3628
|
-
get: () => themes.Link
|
|
3629
|
-
});
|
|
3630
|
-
Object.defineProperty(exports2, "Portal", {
|
|
3631
|
-
enumerable: true,
|
|
3632
|
-
get: () => themes.Portal
|
|
3633
|
-
});
|
|
3634
|
-
Object.defineProperty(exports2, "Quote", {
|
|
3635
|
-
enumerable: true,
|
|
3636
|
-
get: () => themes.Quote
|
|
3637
|
-
});
|
|
3638
|
-
Object.defineProperty(exports2, "RadioGroup", {
|
|
3639
|
-
enumerable: true,
|
|
3640
|
-
get: () => themes.RadioGroup
|
|
3641
|
-
});
|
|
3642
|
-
Object.defineProperty(exports2, "ScrollArea", {
|
|
3643
|
-
enumerable: true,
|
|
3644
|
-
get: () => themes.ScrollArea
|
|
3645
|
-
});
|
|
3646
|
-
Object.defineProperty(exports2, "Section", {
|
|
3647
|
-
enumerable: true,
|
|
3648
|
-
get: () => themes.Section
|
|
3649
|
-
});
|
|
3650
|
-
Object.defineProperty(exports2, "Slider", {
|
|
3651
|
-
enumerable: true,
|
|
3652
|
-
get: () => themes.Slider
|
|
3653
|
-
});
|
|
3654
|
-
Object.defineProperty(exports2, "Slot", {
|
|
3655
|
-
enumerable: true,
|
|
3656
|
-
get: () => themes.Slot
|
|
3657
|
-
});
|
|
3658
|
-
Object.defineProperty(exports2, "Strong", {
|
|
3659
|
-
enumerable: true,
|
|
3660
|
-
get: () => themes.Strong
|
|
3661
|
-
});
|
|
3662
|
-
Object.defineProperty(exports2, "Tabs", {
|
|
3663
|
-
enumerable: true,
|
|
3664
|
-
get: () => themes.Tabs
|
|
3665
|
-
});
|
|
3666
|
-
Object.defineProperty(exports2, "TextField", {
|
|
3667
|
-
enumerable: true,
|
|
3668
|
-
get: () => themes.TextField
|
|
3669
|
-
});
|
|
3670
3566
|
Object.defineProperty(exports2, "Theme", {
|
|
3671
3567
|
enumerable: true,
|
|
3672
3568
|
get: () => themes.Theme
|
|
3673
3569
|
});
|
|
3674
|
-
Object.defineProperty(exports2, "VisuallyHidden", {
|
|
3675
|
-
enumerable: true,
|
|
3676
|
-
get: () => themes.VisuallyHidden
|
|
3677
|
-
});
|
|
3678
3570
|
Object.defineProperty(exports2, "updateThemeAppearanceClass", {
|
|
3679
3571
|
enumerable: true,
|
|
3680
3572
|
get: () => themes.updateThemeAppearanceClass
|
|
@@ -3739,20 +3631,6 @@
|
|
|
3739
3631
|
exports2.useToast = useToast;
|
|
3740
3632
|
exports2.useViewportSize = useViewportSize;
|
|
3741
3633
|
exports2.useWrapCallbackInDialogClose = useWrapCallbackInDialogClose;
|
|
3742
|
-
Object.keys(colors).forEach((k) => {
|
|
3743
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k))
|
|
3744
|
-
Object.defineProperty(exports2, k, {
|
|
3745
|
-
enumerable: true,
|
|
3746
|
-
get: () => colors[k]
|
|
3747
|
-
});
|
|
3748
|
-
});
|
|
3749
|
-
Object.keys(reactIcons).forEach((k) => {
|
|
3750
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k))
|
|
3751
|
-
Object.defineProperty(exports2, k, {
|
|
3752
|
-
enumerable: true,
|
|
3753
|
-
get: () => reactIcons[k]
|
|
3754
|
-
});
|
|
3755
|
-
});
|
|
3756
3634
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
3757
3635
|
});
|
|
3758
3636
|
//# sourceMappingURL=blocks.umd.cjs.map
|