@overmap-ai/blocks 1.0.16 → 1.0.17-linkify.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/Table/typings.d.ts +1 -0
- package/dist/blocks.js +68 -29
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +69 -31
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/style.css +53 -37
- package/dist/utils.d.ts +7 -0
- package/package.json +3 -1
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("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) {
|
|
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("linkify-react"), 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", "linkify-react", "@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.Linkify, 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, Linkify, 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" } });
|
|
@@ -188,6 +188,12 @@
|
|
|
188
188
|
}, [filterFunction, filterValue, values]);
|
|
189
189
|
return [filteredOptions, filterValue, setFilterValue];
|
|
190
190
|
}
|
|
191
|
+
const splitTextForEllipsisAndExpansion = (text, numChars) => {
|
|
192
|
+
const indexOfSpace = text.indexOf(" ", numChars);
|
|
193
|
+
const firstLine = indexOfSpace === -1 ? text : text.substring(0, indexOfSpace);
|
|
194
|
+
const secondLine = indexOfSpace === -1 ? "" : text.substring(indexOfSpace);
|
|
195
|
+
return [firstLine, secondLine];
|
|
196
|
+
};
|
|
191
197
|
const _Badge = React.forwardRef(function Badge2({ className, severity = "primary", color, children, ...rest }, ref) {
|
|
192
198
|
const severityColor = useSeverityColor(severity);
|
|
193
199
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1841,11 +1847,11 @@
|
|
|
1841
1847
|
}
|
|
1842
1848
|
);
|
|
1843
1849
|
});
|
|
1844
|
-
const multiPagePopover = "
|
|
1845
|
-
const pageTitle = "
|
|
1846
|
-
const buttonContainer = "
|
|
1847
|
-
const optionsButtonContainer = "
|
|
1848
|
-
const optionsButton = "
|
|
1850
|
+
const multiPagePopover = "_multiPagePopover_16xvh_1";
|
|
1851
|
+
const pageTitle = "_pageTitle_16xvh_12";
|
|
1852
|
+
const buttonContainer = "_buttonContainer_16xvh_16";
|
|
1853
|
+
const optionsButtonContainer = "_optionsButtonContainer_16xvh_21";
|
|
1854
|
+
const optionsButton = "_optionsButton_16xvh_21";
|
|
1849
1855
|
const styles$9 = {
|
|
1850
1856
|
multiPagePopover,
|
|
1851
1857
|
pageTitle,
|
|
@@ -1876,7 +1882,7 @@
|
|
|
1876
1882
|
`${option.value}-page-${page}-button-${i}`
|
|
1877
1883
|
));
|
|
1878
1884
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1879
|
-
popoverOption.title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1885
|
+
popoverOption.title && /* @__PURE__ */ jsxRuntime.jsx(themes.Text, { className: styles$9.pageTitle, size: "3", children: popoverOption.title }),
|
|
1880
1886
|
popoverOption.content,
|
|
1881
1887
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1882
1888
|
"div",
|
|
@@ -1957,6 +1963,17 @@
|
|
|
1957
1963
|
...rest
|
|
1958
1964
|
}
|
|
1959
1965
|
),
|
|
1966
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rt-TextAreaInput", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1967
|
+
Linkify,
|
|
1968
|
+
{
|
|
1969
|
+
options: {
|
|
1970
|
+
target: "_blank",
|
|
1971
|
+
rel: "noopener"
|
|
1972
|
+
},
|
|
1973
|
+
children: value
|
|
1974
|
+
}
|
|
1975
|
+
) }),
|
|
1976
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rt-TextAreaChrome" }),
|
|
1960
1977
|
displayInputLength && /* @__PURE__ */ jsxRuntime.jsx(themes.Text, { as: "p", className: styles$8.charCount, color: infoColor, align: "right", children: displayInputLengthValue })
|
|
1961
1978
|
] });
|
|
1962
1979
|
});
|
|
@@ -2968,25 +2985,28 @@
|
|
|
2968
2985
|
childrenWithProps
|
|
2969
2986
|
] });
|
|
2970
2987
|
});
|
|
2971
|
-
const
|
|
2972
|
-
const headerContainer = "
|
|
2973
|
-
const tableTopContainer = "
|
|
2974
|
-
const
|
|
2975
|
-
const
|
|
2976
|
-
const
|
|
2977
|
-
const
|
|
2978
|
-
const
|
|
2979
|
-
const
|
|
2980
|
-
const
|
|
2981
|
-
const
|
|
2982
|
-
const
|
|
2983
|
-
const
|
|
2984
|
-
const
|
|
2985
|
-
const
|
|
2988
|
+
const outerTableContainer = "_outerTableContainer_1wqc9_1";
|
|
2989
|
+
const headerContainer = "_headerContainer_1wqc9_13";
|
|
2990
|
+
const tableTopContainer = "_tableTopContainer_1wqc9_17";
|
|
2991
|
+
const tableContainer = "_tableContainer_1wqc9_21";
|
|
2992
|
+
const searchContainer = "_searchContainer_1wqc9_26";
|
|
2993
|
+
const columnFilterSelect = "_columnFilterSelect_1wqc9_36";
|
|
2994
|
+
const table = "_table_1wqc9_17";
|
|
2995
|
+
const tableHeaderCell = "_tableHeaderCell_1wqc9_54";
|
|
2996
|
+
const showSortIcon = "_showSortIcon_1wqc9_70";
|
|
2997
|
+
const tableRow = "_tableRow_1wqc9_74";
|
|
2998
|
+
const tableCell = "_tableCell_1wqc9_89";
|
|
2999
|
+
const noDataTextContainer = "_noDataTextContainer_1wqc9_99";
|
|
3000
|
+
const tableBottomContainer = "_tableBottomContainer_1wqc9_105";
|
|
3001
|
+
const rowsPerPageContainer = "_rowsPerPageContainer_1wqc9_109";
|
|
3002
|
+
const rowsPerPageText = "_rowsPerPageText_1wqc9_119";
|
|
3003
|
+
const pageText = "_pageText_1wqc9_124";
|
|
3004
|
+
const descriptionSecondLine = "_descriptionSecondLine_1wqc9_128";
|
|
2986
3005
|
const styles$1 = {
|
|
2987
|
-
|
|
3006
|
+
outerTableContainer,
|
|
2988
3007
|
headerContainer,
|
|
2989
3008
|
tableTopContainer,
|
|
3009
|
+
tableContainer,
|
|
2990
3010
|
searchContainer,
|
|
2991
3011
|
columnFilterSelect,
|
|
2992
3012
|
table,
|
|
@@ -2998,7 +3018,8 @@
|
|
|
2998
3018
|
tableBottomContainer,
|
|
2999
3019
|
rowsPerPageContainer,
|
|
3000
3020
|
rowsPerPageText,
|
|
3001
|
-
pageText
|
|
3021
|
+
pageText,
|
|
3022
|
+
descriptionSecondLine
|
|
3002
3023
|
};
|
|
3003
3024
|
const _Table = React.forwardRef(function Table2(props, ref) {
|
|
3004
3025
|
var _a;
|
|
@@ -3009,6 +3030,7 @@
|
|
|
3009
3030
|
title = "",
|
|
3010
3031
|
description = "",
|
|
3011
3032
|
rowsPerPage = [10, 20, 30, 40, 50],
|
|
3033
|
+
fixHeader = false,
|
|
3012
3034
|
showSearchBar,
|
|
3013
3035
|
searchBarPlaceholder,
|
|
3014
3036
|
showSelect,
|
|
@@ -3198,6 +3220,7 @@
|
|
|
3198
3220
|
);
|
|
3199
3221
|
const columnFilterPopoverContent = React.useMemo(
|
|
3200
3222
|
() => ({
|
|
3223
|
+
title: "Filter by:",
|
|
3201
3224
|
options: columns.filter((column) => column.filter).map((column) => ({
|
|
3202
3225
|
label: column.label,
|
|
3203
3226
|
value: column.id.toString(),
|
|
@@ -3258,7 +3281,15 @@
|
|
|
3258
3281
|
);
|
|
3259
3282
|
const columnCells = columnsData.map((column) => {
|
|
3260
3283
|
const Component = column.sort ? sort_js.HeaderCellSort : table_js.HeaderCell;
|
|
3261
|
-
|
|
3284
|
+
let firstLine = column.label;
|
|
3285
|
+
let secondLine = void 0;
|
|
3286
|
+
if (column.label && typeof column.label === "string") {
|
|
3287
|
+
const numChars = 31;
|
|
3288
|
+
const [first, second] = splitTextForEllipsisAndExpansion(column.label, numChars);
|
|
3289
|
+
firstLine = first;
|
|
3290
|
+
secondLine = second;
|
|
3291
|
+
}
|
|
3292
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HoverUtility, { children: ({ isHovered, ...props2 }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3262
3293
|
Component,
|
|
3263
3294
|
{
|
|
3264
3295
|
className: classNames(
|
|
@@ -3269,12 +3300,18 @@
|
|
|
3269
3300
|
),
|
|
3270
3301
|
sortKey: column.sort ? column.id.toString().toUpperCase() : "",
|
|
3271
3302
|
...props2,
|
|
3272
|
-
children:
|
|
3303
|
+
children: [
|
|
3304
|
+
firstLine && /* @__PURE__ */ jsxRuntime.jsx("div", { children: firstLine }),
|
|
3305
|
+
secondLine && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.descriptionSecondLine, children: [
|
|
3306
|
+
" ",
|
|
3307
|
+
secondLine
|
|
3308
|
+
] })
|
|
3309
|
+
]
|
|
3273
3310
|
}
|
|
3274
3311
|
) }, column.id);
|
|
3275
3312
|
});
|
|
3276
3313
|
const SelectedModeButton = reactDeviceDetect.isMobile ? IconButton : Button2;
|
|
3277
|
-
const layout = React.useMemo(() => ({ custom: true }), []);
|
|
3314
|
+
const layout = React.useMemo(() => ({ custom: true, ...fixHeader && { fixedHeader: true } }), [fixHeader]);
|
|
3278
3315
|
const theme = theme_js.useTheme({
|
|
3279
3316
|
Table: `
|
|
3280
3317
|
--data-table-library_grid-template-columns: ${gridTemplateColumns} !important;
|
|
@@ -3306,7 +3343,7 @@
|
|
|
3306
3343
|
}
|
|
3307
3344
|
}
|
|
3308
3345
|
}, [rowsPerPage, rows.length, numRowsPerPage, pagination, showPageNavigation]);
|
|
3309
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3346
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: classNames({ [styles$1.outerTableContainer]: showContainer }), direction: "column", height: "100%", children: [
|
|
3310
3347
|
(!!title || !!description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.headerContainer, children: [
|
|
3311
3348
|
!!title && /* @__PURE__ */ jsxRuntime.jsx(Text$1, { weight: "bold", size: "5", children: title }),
|
|
3312
3349
|
!!description && /* @__PURE__ */ jsxRuntime.jsx(Text$1, { as: "div", children: description })
|
|
@@ -3358,7 +3395,7 @@
|
|
|
3358
3395
|
] })
|
|
3359
3396
|
] }),
|
|
3360
3397
|
children,
|
|
3361
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3398
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.tableContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3362
3399
|
table_js.Table,
|
|
3363
3400
|
{
|
|
3364
3401
|
className: classNames(styles$1.table, className),
|
|
@@ -3404,7 +3441,7 @@
|
|
|
3404
3441
|
] })
|
|
3405
3442
|
] })
|
|
3406
3443
|
}
|
|
3407
|
-
),
|
|
3444
|
+
) }),
|
|
3408
3445
|
showBottomBar && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.tableBottomContainer, wrap: "wrap", direction: reactDeviceDetect.isMobile ? "column" : "row", children: [
|
|
3409
3446
|
showRowsPerPage && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, children: [
|
|
3410
3447
|
/* @__PURE__ */ jsxRuntime.jsx(Text$1, { className: styles$1.rowsPerPageText, size: "2", children: "Rows per page:" }),
|
|
@@ -3677,6 +3714,7 @@
|
|
|
3677
3714
|
exports2.Toolbar = Toolbar;
|
|
3678
3715
|
exports2.Tooltip = Tooltip;
|
|
3679
3716
|
exports2.divButtonProps = divButtonProps;
|
|
3717
|
+
exports2.splitTextForEllipsisAndExpansion = splitTextForEllipsisAndExpansion;
|
|
3680
3718
|
exports2.useAlertDialog = useAlertDialog;
|
|
3681
3719
|
exports2.useDiscardAlertDialog = useDiscardAlertDialog;
|
|
3682
3720
|
exports2.useKeyboardShortcut = useKeyboardShortcut;
|