@overmap-ai/blocks 1.0.27 → 1.0.28
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/Buttons/index.d.ts +1 -1
- package/dist/Buttons/typings.d.ts +7 -5
- package/dist/CollapsibleTree/CollapsibleTree.d.ts +5 -0
- package/dist/CollapsibleTree/context.d.ts +14 -0
- package/dist/CollapsibleTree/index.d.ts +2 -0
- package/dist/CollapsibleTree/typings.d.ts +71 -0
- package/dist/DialogMenu/Provider.d.ts +6 -0
- package/dist/DialogMenu/components/DialogCommandMenu.d.ts +6 -0
- package/dist/DialogMenu/components/DialogMultiSelectMenu.d.ts +6 -0
- package/dist/DialogMenu/components/DialogSelectMenu.d.ts +7 -0
- package/dist/DialogMenu/components/index.d.ts +3 -0
- package/dist/DialogMenu/constants.d.ts +3 -0
- package/dist/DialogMenu/content/Content.d.ts +8 -0
- package/dist/DialogMenu/content/SubContent.d.ts +5 -0
- package/dist/DialogMenu/content/index.d.ts +2 -0
- package/dist/DialogMenu/context.d.ts +14 -0
- package/dist/DialogMenu/groups/Group.d.ts +3 -0
- package/dist/DialogMenu/groups/MultiSelectGroup.d.ts +3 -0
- package/dist/DialogMenu/groups/SelectGroup.d.ts +3 -0
- package/dist/DialogMenu/groups/index.d.ts +3 -0
- package/dist/DialogMenu/index.d.ts +20 -0
- package/dist/DialogMenu/items/Item.d.ts +3 -0
- package/dist/DialogMenu/items/MultiSelectItem.d.ts +3 -0
- package/dist/DialogMenu/items/SelectItem.d.ts +3 -0
- package/dist/DialogMenu/items/Separator.d.ts +4 -0
- package/dist/DialogMenu/items/SubTrigger.d.ts +3 -0
- package/dist/DialogMenu/items/index.d.ts +5 -0
- package/dist/DialogMenu/root/Root.d.ts +6 -0
- package/dist/DialogMenu/root/index.d.ts +1 -0
- package/dist/DialogMenu/typings.d.ts +59 -0
- package/dist/Dialogs/BaseDialog/BaseDialog.d.ts +3 -0
- package/dist/Dialogs/BaseDialog/index.d.ts +2 -0
- package/dist/Dialogs/BaseDialog/typings.d.ts +31 -0
- package/dist/Dialogs/Dialog/typings.d.ts +2 -7
- package/dist/Dialogs/Dialog/utils.d.ts +1 -1
- package/dist/Dialogs/Overlay/Overlay.d.ts +7 -0
- package/dist/Dialogs/Overlay/index.d.ts +1 -0
- package/dist/Dialogs/index.d.ts +2 -0
- package/dist/Dialogs/typings.d.ts +5 -0
- package/dist/DownloadButtonUtility/DownloadButtonUtility.d.ts +7 -0
- package/dist/DownloadButtonUtility/index.d.ts +1 -0
- package/dist/Layout/SlideOutOverlay.d.ts +2 -2
- package/dist/Layout/index.d.ts +1 -1
- package/dist/OvermapInputItem/OvermapInputItem.d.ts +6 -0
- package/dist/OvermapInputItem/index.d.ts +2 -0
- package/dist/OvermapInputItem/typings.d.ts +4 -0
- package/dist/OvermapItem/OvermapItem.d.ts +5 -0
- package/dist/OvermapItem/constants.d.ts +2 -0
- package/dist/OvermapItem/index.d.ts +2 -0
- package/dist/OvermapItem/typings.d.ts +24 -0
- package/dist/OvermapItemGroup/OvermapItemGroup.d.ts +3 -0
- package/dist/OvermapItemGroup/context.d.ts +9 -0
- package/dist/OvermapItemGroup/index.d.ts +3 -0
- package/dist/OvermapItemGroup/typings.d.ts +7 -0
- package/dist/RiIcon/RiIcon.d.ts +7 -0
- package/dist/RiIcon/index.d.ts +1 -0
- package/dist/SelectContext/Provider.d.ts +14 -0
- package/dist/SelectContext/context.d.ts +5 -0
- package/dist/SelectContext/index.d.ts +3 -0
- package/dist/SelectContext/typings.d.ts +10 -0
- package/dist/Table/typings.d.ts +1 -0
- package/dist/ToggleButton/ToggleButton.d.ts +8 -0
- package/dist/ToggleButton/index.d.ts +1 -0
- package/dist/blocks.js +1012 -164
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +1013 -169
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/style.css +100 -28
- package/dist/typings.d.ts +4 -0
- package/dist/utils.d.ts +10 -4
- package/package.json +8 -3
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-
|
|
3
|
-
})(this, function(exports2, jsxRuntime, themes, React, reactResponsive,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@radix-ui/themes"), require("react"), require("react-responsive"), require("@react-hook/resize-observer"), require("react-icons/ri"), require("@radix-ui/react-dialog"), require("@radix-ui/react-collapsible"), require("@radix-ui/react-context-menu"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-slot"), require("react-device-detect"), require("re-resizable"), require("react-transition-group"), require("react-dom"), require("@radix-ui/react-dismissable-layer"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("@radix-ui/react-toggle"), require("react-error-boundary"), 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")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@radix-ui/themes", "react", "react-responsive", "@react-hook/resize-observer", "react-icons/ri", "@radix-ui/react-dialog", "@radix-ui/react-collapsible", "@radix-ui/react-context-menu", "@radix-ui/react-dropdown-menu", "@radix-ui/react-slot", "react-device-detect", "re-resizable", "react-transition-group", "react-dom", "@radix-ui/react-dismissable-layer", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "@radix-ui/react-toggle", "react-error-boundary", "@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"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.jsxRuntime, global.themes, global.React, global.reactResponsive, global.useResizeObserver, global.RiIcons, global.RadixDialogPrimitive, global.RadixPrimitiveCollapsible, global.RadixContextMenu, global.RadixDropdownMenu, global.reactSlot, global.reactDeviceDetect, global.reResizable, global.reactTransitionGroup, global.ReactDOM, global.reactDismissableLayer, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.Toggle, global.reactErrorBoundary, global.table_js, global.theme_js, global.sort_js, global.select_js, global.pagination_js));
|
|
3
|
+
})(this, function(exports2, jsxRuntime, themes, React, reactResponsive, useResizeObserver, RiIcons, RadixDialogPrimitive, RadixPrimitiveCollapsible, RadixContextMenu, RadixDropdownMenu, reactSlot, reactDeviceDetect, reResizable, reactTransitionGroup, ReactDOM, reactDismissableLayer, reactToggleGroup, reactToolbar, RadixToast, Toggle, reactErrorBoundary, table_js, theme_js, sort_js, select_js, pagination_js) {
|
|
4
4
|
"use strict";
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -18,10 +18,13 @@
|
|
|
18
18
|
n.default = e;
|
|
19
19
|
return Object.freeze(n);
|
|
20
20
|
}
|
|
21
|
+
const RiIcons__namespace = /* @__PURE__ */ _interopNamespaceDefault(RiIcons);
|
|
22
|
+
const RadixDialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixDialogPrimitive);
|
|
23
|
+
const RadixPrimitiveCollapsible__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixPrimitiveCollapsible);
|
|
21
24
|
const RadixContextMenu__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixContextMenu);
|
|
22
25
|
const RadixDropdownMenu__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixDropdownMenu);
|
|
23
|
-
const RadixDialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixDialogPrimitive);
|
|
24
26
|
const RadixToast__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixToast);
|
|
27
|
+
const Toggle__namespace = /* @__PURE__ */ _interopNamespaceDefault(Toggle);
|
|
25
28
|
function getDefaultExportFromCjs(x) {
|
|
26
29
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
27
30
|
}
|
|
@@ -95,11 +98,11 @@
|
|
|
95
98
|
info: "gray"
|
|
96
99
|
};
|
|
97
100
|
const useSeverityColor = (severity) => {
|
|
98
|
-
const
|
|
101
|
+
const theme = themes.useThemeContext();
|
|
99
102
|
if (!severity)
|
|
100
103
|
return void 0;
|
|
101
104
|
if (severity === "primary")
|
|
102
|
-
return
|
|
105
|
+
return theme.accentColor;
|
|
103
106
|
return nonThemeSeverityMapping[severity];
|
|
104
107
|
};
|
|
105
108
|
const useViewportSize = () => {
|
|
@@ -189,12 +192,39 @@
|
|
|
189
192
|
}, [filterFunction, filterValue, values]);
|
|
190
193
|
return [filteredOptions, filterValue, setFilterValue];
|
|
191
194
|
}
|
|
195
|
+
const useSize = (target) => {
|
|
196
|
+
const [size, setSize] = React.useState();
|
|
197
|
+
React.useLayoutEffect(() => {
|
|
198
|
+
var _a;
|
|
199
|
+
setSize((_a = target.current) == null ? void 0 : _a.getBoundingClientRect());
|
|
200
|
+
}, [target]);
|
|
201
|
+
const handleResize = React.useCallback((entry) => {
|
|
202
|
+
const rect = entry.contentRect;
|
|
203
|
+
setSize(rect);
|
|
204
|
+
}, []);
|
|
205
|
+
useResizeObserver(target, handleResize);
|
|
206
|
+
return size;
|
|
207
|
+
};
|
|
192
208
|
const splitTextForEllipsisAndExpansion = (text, numChars) => {
|
|
193
209
|
const indexOfSpace = text.indexOf(" ", numChars);
|
|
194
210
|
const firstLine = indexOfSpace === -1 ? text : text.substring(0, indexOfSpace);
|
|
195
211
|
const secondLine = indexOfSpace === -1 ? "" : text.substring(indexOfSpace);
|
|
196
212
|
return [firstLine, secondLine];
|
|
197
213
|
};
|
|
214
|
+
const genericMemo = React.memo;
|
|
215
|
+
function useOvermapResponsiveValue(value) {
|
|
216
|
+
const { size } = useViewportSize();
|
|
217
|
+
if (value === null || value === void 0)
|
|
218
|
+
return value;
|
|
219
|
+
if (typeof value === "object") {
|
|
220
|
+
if (!("initial" in value)) {
|
|
221
|
+
throw new Error("Expected initial property to be set in Responsive object");
|
|
222
|
+
} else {
|
|
223
|
+
return value[size];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
198
228
|
const _Badge = React.forwardRef(function Badge2({ className, severity = "primary", color, children, ...rest }, ref) {
|
|
199
229
|
const severityColor = useSeverityColor(severity);
|
|
200
230
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -212,7 +242,7 @@
|
|
|
212
242
|
const zeroMinWidth = "_zeroMinWidth_curjh_1";
|
|
213
243
|
const zeroMinHeight = "_zeroMinHeight_curjh_5";
|
|
214
244
|
const radius = "_radius_curjh_9";
|
|
215
|
-
const styles$
|
|
245
|
+
const styles$t = {
|
|
216
246
|
zeroMinWidth,
|
|
217
247
|
zeroMinHeight,
|
|
218
248
|
radius
|
|
@@ -224,9 +254,9 @@
|
|
|
224
254
|
themes.Flex,
|
|
225
255
|
{
|
|
226
256
|
className: classNames(className, {
|
|
227
|
-
[styles$
|
|
228
|
-
[styles$
|
|
229
|
-
[styles$
|
|
257
|
+
[styles$t.radius]: radius2,
|
|
258
|
+
[styles$t.zeroMinWidth]: zeroMinWidth2,
|
|
259
|
+
[styles$t.zeroMinHeight]: zeroMinHeight2
|
|
230
260
|
}),
|
|
231
261
|
ref,
|
|
232
262
|
...rest,
|
|
@@ -238,14 +268,14 @@
|
|
|
238
268
|
);
|
|
239
269
|
const BreadcrumbContext = React.createContext({});
|
|
240
270
|
const useBreadcrumbContext = () => React.useContext(BreadcrumbContext);
|
|
241
|
-
const Item = React.memo(
|
|
271
|
+
const Item$1 = React.memo(
|
|
242
272
|
React.forwardRef(({ className, children, ...rest }, ref) => {
|
|
243
273
|
const { size, severity } = useBreadcrumbContext();
|
|
244
274
|
const severityColor = useSeverityColor(severity);
|
|
245
275
|
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { className: classNames("overmap-breadcrumb-item", className), height: "max-content", width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(themes.Link, { ref, size, color: severityColor, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { height: "100%", width: "100%", align: "center", gap: "1", children }) }) });
|
|
246
276
|
})
|
|
247
277
|
);
|
|
248
|
-
const Group = React.memo(
|
|
278
|
+
const Group$1 = React.memo(
|
|
249
279
|
React.forwardRef(
|
|
250
280
|
({ className, children, separator, severity = "info", size, gap = "2", ...rest }, ref) => {
|
|
251
281
|
const severityColor = useSeverityColor(severity);
|
|
@@ -272,23 +302,23 @@
|
|
|
272
302
|
)
|
|
273
303
|
);
|
|
274
304
|
const Breadcrumb = {
|
|
275
|
-
Group,
|
|
276
|
-
Item
|
|
305
|
+
Group: Group$1,
|
|
306
|
+
Item: Item$1
|
|
277
307
|
};
|
|
278
308
|
const fluid$1 = "_fluid_r73gr_1";
|
|
279
309
|
const hoverSpin90Clockwise = "_hoverSpin90Clockwise_r73gr_15";
|
|
280
310
|
const hoverSpin180Clockwise = "_hoverSpin180Clockwise_r73gr_25";
|
|
281
311
|
const hoverSpin360Clockwise = "_hoverSpin360Clockwise_r73gr_35";
|
|
282
|
-
const styles$
|
|
312
|
+
const styles$s = {
|
|
283
313
|
fluid: fluid$1,
|
|
284
314
|
hoverSpin90Clockwise,
|
|
285
315
|
hoverSpin180Clockwise,
|
|
286
316
|
hoverSpin360Clockwise
|
|
287
317
|
};
|
|
288
318
|
const hoverEffectClassNameMapping = {
|
|
289
|
-
spin90Clockwise: styles$
|
|
290
|
-
spin180Clockwise: styles$
|
|
291
|
-
spin360Clockwise: styles$
|
|
319
|
+
spin90Clockwise: styles$s.hoverSpin90Clockwise,
|
|
320
|
+
spin180Clockwise: styles$s.hoverSpin180Clockwise,
|
|
321
|
+
spin360Clockwise: styles$s.hoverSpin360Clockwise
|
|
292
322
|
};
|
|
293
323
|
const clickOnEnterOrSpace = (e) => {
|
|
294
324
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -305,16 +335,17 @@
|
|
|
305
335
|
medium: "2",
|
|
306
336
|
large: "3"
|
|
307
337
|
};
|
|
338
|
+
const DEFAULT_ICON_SIZE = "15px";
|
|
308
339
|
const ButtonGroupContext = React.createContext({});
|
|
309
340
|
const useButtonGroupContext = () => React.useContext(ButtonGroupContext);
|
|
310
|
-
const spinner = "
|
|
311
|
-
const spin = "
|
|
312
|
-
const styles$
|
|
341
|
+
const spinner = "_spinner_1oknc_9";
|
|
342
|
+
const spin = "_spin_1oknc_9";
|
|
343
|
+
const styles$r = {
|
|
313
344
|
spinner,
|
|
314
345
|
spin
|
|
315
346
|
};
|
|
316
347
|
const Spinner = React.memo(() => {
|
|
317
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$
|
|
348
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$r.spinner });
|
|
318
349
|
});
|
|
319
350
|
Spinner.displayName = "Spinner";
|
|
320
351
|
const _Button$1 = React.forwardRef(function Button(props, ref) {
|
|
@@ -350,7 +381,7 @@
|
|
|
350
381
|
ref,
|
|
351
382
|
type,
|
|
352
383
|
className: classNames(className, hoverEffectClasses, {
|
|
353
|
-
[styles$
|
|
384
|
+
[styles$s.fluid]: fluid2
|
|
354
385
|
}),
|
|
355
386
|
color,
|
|
356
387
|
size: useResponsiveMapping(size, SizeMapping),
|
|
@@ -392,7 +423,7 @@
|
|
|
392
423
|
themes.IconButton,
|
|
393
424
|
{
|
|
394
425
|
className: classNames(className, hoverEffectClasses, {
|
|
395
|
-
[styles$
|
|
426
|
+
[styles$s.fluid]: fluid2
|
|
396
427
|
}),
|
|
397
428
|
ref,
|
|
398
429
|
color,
|
|
@@ -407,7 +438,7 @@
|
|
|
407
438
|
});
|
|
408
439
|
const IconButton = React.memo(_Button);
|
|
409
440
|
const merged = "_merged_wdgxo_1";
|
|
410
|
-
const styles$
|
|
441
|
+
const styles$q = {
|
|
411
442
|
merged
|
|
412
443
|
};
|
|
413
444
|
const GhostVariantSizeToGapMapping = {
|
|
@@ -434,7 +465,7 @@
|
|
|
434
465
|
themes.Flex,
|
|
435
466
|
{
|
|
436
467
|
className: classNames("overmap-button-group", className, {
|
|
437
|
-
[styles$
|
|
468
|
+
[styles$q.merged]: merged2
|
|
438
469
|
}),
|
|
439
470
|
ref,
|
|
440
471
|
gap: merged2 ? gap ?? mergedAutoGap : gap ?? "2",
|
|
@@ -447,7 +478,7 @@
|
|
|
447
478
|
});
|
|
448
479
|
const ButtonGroup = React.memo(_ButtonGroup);
|
|
449
480
|
const separators = "_separators_1f7v1_1";
|
|
450
|
-
const styles$
|
|
481
|
+
const styles$p = {
|
|
451
482
|
separators
|
|
452
483
|
};
|
|
453
484
|
const ButtonListBorder = React.memo(
|
|
@@ -478,7 +509,7 @@
|
|
|
478
509
|
size,
|
|
479
510
|
severity: "info",
|
|
480
511
|
variant: buttonVariant,
|
|
481
|
-
className: classNames(className, styles$
|
|
512
|
+
className: classNames(className, styles$p.separators),
|
|
482
513
|
merged: true,
|
|
483
514
|
gap: "0",
|
|
484
515
|
direction: "column",
|
|
@@ -502,13 +533,22 @@
|
|
|
502
533
|
Root: ButtonListRoot,
|
|
503
534
|
Item: ButtonListItem
|
|
504
535
|
};
|
|
536
|
+
const RiIcon = React.memo((props) => {
|
|
537
|
+
const { icon, size = DEFAULT_ICON_SIZE, color, ...rest } = props;
|
|
538
|
+
const Icon = RiIcons__namespace[icon];
|
|
539
|
+
if (!Icon) {
|
|
540
|
+
throw new Error(`no icon with the name ${icon} exists.`);
|
|
541
|
+
}
|
|
542
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon, { size, color, ...rest });
|
|
543
|
+
});
|
|
544
|
+
RiIcon.displayName = "IconComponent";
|
|
505
545
|
const DialogContent = React.memo(function DialogContent2(props) {
|
|
506
546
|
const { title, description, content, closeDialog } = props;
|
|
507
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "2", children: [
|
|
547
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "2", grow: "1", children: [
|
|
508
548
|
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "1", children: [
|
|
509
549
|
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { justify: "between", children: [
|
|
510
550
|
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Title, { mb: "0", children: title }),
|
|
511
|
-
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(themes.IconButton, { color: "gray", variant: "ghost", "aria-label": "Close", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
551
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(themes.IconButton, { color: "gray", variant: "ghost", "aria-label": "Close", children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCloseLargeLine" }) }) })
|
|
512
552
|
] }),
|
|
513
553
|
description && /* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Description, { children: description })
|
|
514
554
|
] }),
|
|
@@ -660,6 +700,696 @@
|
|
|
660
700
|
[openAlertDialog]
|
|
661
701
|
);
|
|
662
702
|
};
|
|
703
|
+
const BaseDialog = React.memo(
|
|
704
|
+
React.forwardRef((props, ref) => {
|
|
705
|
+
const {
|
|
706
|
+
children,
|
|
707
|
+
defaultOpen = false,
|
|
708
|
+
onInterruptClose,
|
|
709
|
+
content,
|
|
710
|
+
onClose,
|
|
711
|
+
open: controlledOpen,
|
|
712
|
+
onOpenChange: controlledOpenChange,
|
|
713
|
+
className,
|
|
714
|
+
style,
|
|
715
|
+
overlay: overlay2 = false,
|
|
716
|
+
overlayClass,
|
|
717
|
+
overlayStyle
|
|
718
|
+
} = props;
|
|
719
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
|
|
720
|
+
const open = React.useMemo(
|
|
721
|
+
() => controlledOpen !== void 0 ? controlledOpen : uncontrolledOpen,
|
|
722
|
+
[controlledOpen, uncontrolledOpen]
|
|
723
|
+
);
|
|
724
|
+
const handleOpenChange = React.useCallback(
|
|
725
|
+
(nextOpen) => {
|
|
726
|
+
if (controlledOpenChange) {
|
|
727
|
+
controlledOpenChange(nextOpen);
|
|
728
|
+
} else if (!nextOpen && onInterruptClose) {
|
|
729
|
+
const closeInner = () => {
|
|
730
|
+
setUncontrolledOpen(false);
|
|
731
|
+
if (onClose)
|
|
732
|
+
onClose();
|
|
733
|
+
};
|
|
734
|
+
onInterruptClose(closeInner);
|
|
735
|
+
} else if (!nextOpen) {
|
|
736
|
+
setUncontrolledOpen(false);
|
|
737
|
+
if (onClose)
|
|
738
|
+
onClose();
|
|
739
|
+
} else {
|
|
740
|
+
setUncontrolledOpen(nextOpen);
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
[controlledOpenChange, onClose, onInterruptClose]
|
|
744
|
+
);
|
|
745
|
+
const close = React.useCallback(
|
|
746
|
+
(closeOptions) => {
|
|
747
|
+
if (closeOptions == null ? void 0 : closeOptions.force) {
|
|
748
|
+
setUncontrolledOpen(false);
|
|
749
|
+
} else {
|
|
750
|
+
handleOpenChange(false);
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
[handleOpenChange]
|
|
754
|
+
);
|
|
755
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RadixDialogPrimitive__namespace.Root, { open, onOpenChange: handleOpenChange, modal: overlay2, children: [
|
|
756
|
+
children !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(RadixDialogPrimitive__namespace.Trigger, { children }),
|
|
757
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixDialogPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
758
|
+
overlay2 && /* @__PURE__ */ jsxRuntime.jsx(themes.Theme, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(RadixDialogPrimitive__namespace.Overlay, { className: overlayClass, style: overlayStyle }) }),
|
|
759
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Theme, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(RadixDialogPrimitive__namespace.Content, { className, style, ref, children: content(close) }) })
|
|
760
|
+
] }) })
|
|
761
|
+
] });
|
|
762
|
+
})
|
|
763
|
+
);
|
|
764
|
+
const OverlayContent = "_OverlayContent_1nr9w_1";
|
|
765
|
+
const OverlayOverlay = "_OverlayOverlay_1nr9w_6";
|
|
766
|
+
const styles$o = {
|
|
767
|
+
OverlayContent,
|
|
768
|
+
OverlayOverlay
|
|
769
|
+
};
|
|
770
|
+
const Overlay$2 = React.memo(
|
|
771
|
+
React.forwardRef((props, ref) => {
|
|
772
|
+
const { className, overlayClass, ...rest } = props;
|
|
773
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
774
|
+
BaseDialog,
|
|
775
|
+
{
|
|
776
|
+
ref,
|
|
777
|
+
overlayClass: classNames("overmap-overlay-overlay", styles$o.OverlayOverlay, overlayClass),
|
|
778
|
+
className: classNames("overmap-overlay-content", styles$o.OverlayContent, className),
|
|
779
|
+
...rest
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
})
|
|
783
|
+
);
|
|
784
|
+
const OvermapItemSizeDependantProps = {
|
|
785
|
+
"1": {
|
|
786
|
+
gap: "1",
|
|
787
|
+
px: "1",
|
|
788
|
+
height: "5",
|
|
789
|
+
fontSize: "var(--font-size-2)"
|
|
790
|
+
},
|
|
791
|
+
"2": {
|
|
792
|
+
gap: "2",
|
|
793
|
+
px: "2",
|
|
794
|
+
height: "6",
|
|
795
|
+
fontSize: "var(--font-size-2)"
|
|
796
|
+
},
|
|
797
|
+
"3": {
|
|
798
|
+
gap: "2",
|
|
799
|
+
px: "3",
|
|
800
|
+
height: "7",
|
|
801
|
+
fontSize: "var(--font-size-3)"
|
|
802
|
+
},
|
|
803
|
+
"4": {
|
|
804
|
+
gap: "2",
|
|
805
|
+
px: "4",
|
|
806
|
+
height: "8",
|
|
807
|
+
fontSize: "var(--font-size-3)"
|
|
808
|
+
},
|
|
809
|
+
"5": {
|
|
810
|
+
gap: "3",
|
|
811
|
+
px: "5",
|
|
812
|
+
height: "9",
|
|
813
|
+
fontSize: "var(--font-size-4)"
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
const OvermapItemGroupContext = React.createContext({});
|
|
817
|
+
const useOvermapItemGroupContext = () => React.useContext(OvermapItemGroupContext);
|
|
818
|
+
const OvermapItemGroup = React.memo(
|
|
819
|
+
React.forwardRef(function(props, ref) {
|
|
820
|
+
const { size, compact = false, children, ...rest } = props;
|
|
821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(OvermapItemGroupContext.Provider, { value: { size, compact }, children: /* @__PURE__ */ jsxRuntime.jsx(themes.Grid, { ref, columns: "1", width: "100%", height: "max-content", ...rest, children }) });
|
|
822
|
+
})
|
|
823
|
+
);
|
|
824
|
+
const OvermapItem = React.memo(
|
|
825
|
+
React.forwardRef((props, ref) => {
|
|
826
|
+
const overmapItemGroupContext = useOvermapItemGroupContext();
|
|
827
|
+
const {
|
|
828
|
+
leftSlot,
|
|
829
|
+
compact = overmapItemGroupContext.compact,
|
|
830
|
+
rightSlot,
|
|
831
|
+
children,
|
|
832
|
+
size = overmapItemGroupContext.size,
|
|
833
|
+
style,
|
|
834
|
+
...rest
|
|
835
|
+
} = props;
|
|
836
|
+
const computedSize = useOvermapResponsiveValue(size);
|
|
837
|
+
const { fontSize, ...restSizeProps } = OvermapItemSizeDependantProps[computedSize ?? "2"];
|
|
838
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
839
|
+
themes.Flex,
|
|
840
|
+
{
|
|
841
|
+
ref,
|
|
842
|
+
align: "center",
|
|
843
|
+
shrink: "0",
|
|
844
|
+
style: { fontSize, ...style },
|
|
845
|
+
...restSizeProps,
|
|
846
|
+
...rest,
|
|
847
|
+
width: compact ? restSizeProps.height : void 0,
|
|
848
|
+
children: [
|
|
849
|
+
!compact && leftSlot && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { width: "max-content", height: "max-content", align: "center", children: leftSlot }),
|
|
850
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { height: "max-content", align: "center", grow: "1", justify: compact ? "center" : void 0, children }),
|
|
851
|
+
!compact && rightSlot && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { width: "max-content", height: "max-content", align: "center", children: rightSlot })
|
|
852
|
+
]
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
})
|
|
856
|
+
);
|
|
857
|
+
const DialogMenuContext = React.createContext({});
|
|
858
|
+
const useDialogMenuContext = () => React.useContext(DialogMenuContext);
|
|
859
|
+
const DialogMenuItem = "_DialogMenuItem_1ojd2_1";
|
|
860
|
+
const styles$n = {
|
|
861
|
+
DialogMenuItem
|
|
862
|
+
};
|
|
863
|
+
const Item = React.memo(
|
|
864
|
+
React.forwardRef((props, ref) => {
|
|
865
|
+
const dialogMenuContext = useDialogMenuContext();
|
|
866
|
+
const {
|
|
867
|
+
className,
|
|
868
|
+
children,
|
|
869
|
+
onSelect,
|
|
870
|
+
onClick,
|
|
871
|
+
closeOnSelect = dialogMenuContext.closeOnSelect,
|
|
872
|
+
size = dialogMenuContext.size,
|
|
873
|
+
leftSlot,
|
|
874
|
+
rightSlot,
|
|
875
|
+
...rest
|
|
876
|
+
} = props;
|
|
877
|
+
const handleClick = React.useCallback(
|
|
878
|
+
(e) => {
|
|
879
|
+
if (onClick)
|
|
880
|
+
onClick(e);
|
|
881
|
+
if (onSelect)
|
|
882
|
+
onSelect();
|
|
883
|
+
if (closeOnSelect)
|
|
884
|
+
dialogMenuContext.close();
|
|
885
|
+
},
|
|
886
|
+
[closeOnSelect, dialogMenuContext, onClick, onSelect]
|
|
887
|
+
);
|
|
888
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
889
|
+
OvermapItem,
|
|
890
|
+
{
|
|
891
|
+
className: classNames(className, styles$n.DialogMenuItem),
|
|
892
|
+
onClick: handleClick,
|
|
893
|
+
ref,
|
|
894
|
+
leftSlot,
|
|
895
|
+
rightSlot,
|
|
896
|
+
size,
|
|
897
|
+
role: "menuitem",
|
|
898
|
+
tabIndex: 0,
|
|
899
|
+
...rest,
|
|
900
|
+
children
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
})
|
|
904
|
+
);
|
|
905
|
+
const SelectContext = React.createContext({});
|
|
906
|
+
function useSelectContext() {
|
|
907
|
+
return React.useContext(SelectContext);
|
|
908
|
+
}
|
|
909
|
+
const SelectContextProvider = React.memo((props) => {
|
|
910
|
+
const { type, children } = props;
|
|
911
|
+
const [controlledValue, setControlledValue] = React.useState(
|
|
912
|
+
type === "single" ? (props == null ? void 0 : props.defaultValue) ?? null : null
|
|
913
|
+
);
|
|
914
|
+
const [controlledValues, setControlledValues] = React.useState(
|
|
915
|
+
type === "multi" ? (props == null ? void 0 : props.defaultValues) ?? [] : []
|
|
916
|
+
);
|
|
917
|
+
const onValuesChange = React.useCallback(
|
|
918
|
+
(values) => {
|
|
919
|
+
setControlledValues(values);
|
|
920
|
+
if (type === "multi" && (props == null ? void 0 : props.onValuesChange))
|
|
921
|
+
props.onValuesChange(values);
|
|
922
|
+
},
|
|
923
|
+
[props, type]
|
|
924
|
+
);
|
|
925
|
+
const onValueChange = React.useCallback(
|
|
926
|
+
(value2) => {
|
|
927
|
+
setControlledValue(value2);
|
|
928
|
+
if (type === "single" && (props == null ? void 0 : props.onValueChange))
|
|
929
|
+
props.onValueChange(value2);
|
|
930
|
+
},
|
|
931
|
+
[props, type]
|
|
932
|
+
);
|
|
933
|
+
const value = React.useMemo(
|
|
934
|
+
() => type === "multi" ? {
|
|
935
|
+
type,
|
|
936
|
+
values: (props == null ? void 0 : props.values) ?? controlledValues,
|
|
937
|
+
handleValuesChange: onValuesChange
|
|
938
|
+
} : {
|
|
939
|
+
type,
|
|
940
|
+
value: props.value ?? controlledValue,
|
|
941
|
+
handleValueChange: onValueChange
|
|
942
|
+
},
|
|
943
|
+
[controlledValue, controlledValues, onValueChange, onValuesChange, props, type]
|
|
944
|
+
);
|
|
945
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContext.Provider, { value, children });
|
|
946
|
+
});
|
|
947
|
+
SelectContextProvider.displayName = "SelectContextProvider";
|
|
948
|
+
const SelectItem = React.memo(
|
|
949
|
+
React.forwardRef((props, ref) => {
|
|
950
|
+
const dialogMenuContext = useDialogMenuContext();
|
|
951
|
+
const { value, rightSlot, selectedIndicator = dialogMenuContext.selectedIndicator, onSelect, ...rest } = props;
|
|
952
|
+
const { value: currentValue, handleValueChange } = useSelectContext();
|
|
953
|
+
const handleSelect = React.useCallback(() => {
|
|
954
|
+
handleValueChange(value !== currentValue ? value : null);
|
|
955
|
+
if (onSelect)
|
|
956
|
+
onSelect();
|
|
957
|
+
}, [currentValue, handleValueChange, onSelect, value]);
|
|
958
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
959
|
+
Item,
|
|
960
|
+
{
|
|
961
|
+
ref,
|
|
962
|
+
onSelect: handleSelect,
|
|
963
|
+
role: "menuitemradio",
|
|
964
|
+
rightSlot: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
965
|
+
currentValue === value && selectedIndicator,
|
|
966
|
+
" ",
|
|
967
|
+
rightSlot
|
|
968
|
+
] }),
|
|
969
|
+
...rest
|
|
970
|
+
}
|
|
971
|
+
);
|
|
972
|
+
})
|
|
973
|
+
);
|
|
974
|
+
const MultiSelectItem$1 = React.memo(
|
|
975
|
+
React.forwardRef((props, ref) => {
|
|
976
|
+
const dialogMenuContext = useDialogMenuContext();
|
|
977
|
+
const { value, rightSlot, selectedIndicator = dialogMenuContext.selectedIndicator, onSelect, ...rest } = props;
|
|
978
|
+
const { values: currentValues, handleValuesChange } = useSelectContext();
|
|
979
|
+
const handleSelect = React.useCallback(() => {
|
|
980
|
+
handleValuesChange(
|
|
981
|
+
currentValues.includes(value) ? [...currentValues, value] : (
|
|
982
|
+
// If value currently in selected values, remove it (filter out)
|
|
983
|
+
currentValues.filter((currentValue) => currentValue !== value)
|
|
984
|
+
)
|
|
985
|
+
);
|
|
986
|
+
if (onSelect)
|
|
987
|
+
onSelect();
|
|
988
|
+
}, [currentValues, handleValuesChange, onSelect, value]);
|
|
989
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
990
|
+
Item,
|
|
991
|
+
{
|
|
992
|
+
onSelect: handleSelect,
|
|
993
|
+
ref,
|
|
994
|
+
role: "menuitemcheckbox",
|
|
995
|
+
rightSlot: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
996
|
+
currentValues.includes(value) && selectedIndicator,
|
|
997
|
+
rightSlot
|
|
998
|
+
] }),
|
|
999
|
+
...rest
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
})
|
|
1003
|
+
);
|
|
1004
|
+
const SubTrigger = React.memo(
|
|
1005
|
+
React.forwardRef((props, ref) => {
|
|
1006
|
+
const { subContentId, onSelect, ...rest } = props;
|
|
1007
|
+
const { setSubContentId } = useDialogMenuContext();
|
|
1008
|
+
const handleSelect = React.useCallback(() => {
|
|
1009
|
+
setSubContentId(subContentId);
|
|
1010
|
+
if (onSelect)
|
|
1011
|
+
onSelect();
|
|
1012
|
+
}, [subContentId, onSelect, setSubContentId]);
|
|
1013
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item, { onSelect: handleSelect, ref, ...rest });
|
|
1014
|
+
})
|
|
1015
|
+
);
|
|
1016
|
+
const light = "_light_1u8fs_1";
|
|
1017
|
+
const bold = "_bold_1u8fs_8";
|
|
1018
|
+
const full = "_full_1u8fs_15";
|
|
1019
|
+
const Text$1 = "_Text_1u8fs_22";
|
|
1020
|
+
const styles$m = {
|
|
1021
|
+
light,
|
|
1022
|
+
bold,
|
|
1023
|
+
full,
|
|
1024
|
+
Text: Text$1
|
|
1025
|
+
};
|
|
1026
|
+
const SeparatorSizeMapping = {
|
|
1027
|
+
"1": "max-content",
|
|
1028
|
+
"2": "max-content",
|
|
1029
|
+
"3": "max-content",
|
|
1030
|
+
"4": "100%"
|
|
1031
|
+
};
|
|
1032
|
+
const _Separator = React.forwardRef(function Separator2({
|
|
1033
|
+
className,
|
|
1034
|
+
severity = "info",
|
|
1035
|
+
textWeight = "light",
|
|
1036
|
+
gap = "1",
|
|
1037
|
+
text,
|
|
1038
|
+
orientation = "horizontal",
|
|
1039
|
+
size,
|
|
1040
|
+
weight = "medium",
|
|
1041
|
+
...rest
|
|
1042
|
+
}, ref) {
|
|
1043
|
+
const computedSizing = useResponsiveMapping(size, SeparatorSizeMapping);
|
|
1044
|
+
const severityColor = useSeverityColor(severity);
|
|
1045
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1046
|
+
themes.Flex,
|
|
1047
|
+
{
|
|
1048
|
+
className: classNames("overmap-separator", className, {
|
|
1049
|
+
[styles$m.light]: weight === "light",
|
|
1050
|
+
[styles$m.bold]: weight === "bold",
|
|
1051
|
+
[styles$m.full]: weight === "full"
|
|
1052
|
+
}),
|
|
1053
|
+
ref,
|
|
1054
|
+
width: orientation === "horizontal" ? computedSizing : "max-content",
|
|
1055
|
+
height: orientation === "vertical" ? computedSizing : "max-content",
|
|
1056
|
+
direction: orientation === "vertical" ? "column" : "row",
|
|
1057
|
+
align: "center",
|
|
1058
|
+
gap,
|
|
1059
|
+
children: [
|
|
1060
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Separator, { size, orientation, color: severityColor, ...rest }),
|
|
1061
|
+
text && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1062
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Text, { className: styles$m.Text, as: "span", size: "1", weight: textWeight, color: severityColor, children: text }),
|
|
1063
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Separator, { size, orientation, color: severityColor, ...rest })
|
|
1064
|
+
] })
|
|
1065
|
+
]
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
1068
|
+
});
|
|
1069
|
+
const Separator$1 = React.memo(_Separator);
|
|
1070
|
+
const Separator = React.memo(
|
|
1071
|
+
React.forwardRef((props, ref) => {
|
|
1072
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { ref, py: "2", children: /* @__PURE__ */ jsxRuntime.jsx(Separator$1, { size: "4", weight: "light", ...props }) });
|
|
1073
|
+
})
|
|
1074
|
+
);
|
|
1075
|
+
const DEFAULT_DIALOG_MENU_SIZE = "3";
|
|
1076
|
+
const DEFAULT_SELECTED_INDICATOR = /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCheckLine" });
|
|
1077
|
+
const Group = React.memo(
|
|
1078
|
+
React.forwardRef((props, ref) => {
|
|
1079
|
+
const dialogMenuContext = useDialogMenuContext();
|
|
1080
|
+
const { size = dialogMenuContext.size, grid = false, children } = props;
|
|
1081
|
+
const computedSize = useOvermapResponsiveValue(size);
|
|
1082
|
+
const computedColumns = React.useMemo(() => {
|
|
1083
|
+
const { height } = OvermapItemSizeDependantProps[computedSize ?? DEFAULT_DIALOG_MENU_SIZE];
|
|
1084
|
+
return `repeat(auto-fit,var(--space-${height})`;
|
|
1085
|
+
}, [computedSize]);
|
|
1086
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1087
|
+
OvermapItemGroup,
|
|
1088
|
+
{
|
|
1089
|
+
role: "group",
|
|
1090
|
+
compact: grid,
|
|
1091
|
+
size,
|
|
1092
|
+
ref,
|
|
1093
|
+
columns: grid ? computedColumns : void 0,
|
|
1094
|
+
flow: "dense",
|
|
1095
|
+
children
|
|
1096
|
+
}
|
|
1097
|
+
);
|
|
1098
|
+
})
|
|
1099
|
+
);
|
|
1100
|
+
const SelectGroup = React.memo(
|
|
1101
|
+
React.forwardRef((props, ref) => {
|
|
1102
|
+
const { value, onValueChange, ...rest } = props;
|
|
1103
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContextProvider, { type: "single", value, onValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(Group, { ref, ...rest }) });
|
|
1104
|
+
})
|
|
1105
|
+
);
|
|
1106
|
+
const MultiSelectGroup = React.memo(
|
|
1107
|
+
React.forwardRef((props, ref) => {
|
|
1108
|
+
const { values, onValuesChange, ...rest } = props;
|
|
1109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContextProvider, { type: "multi", values, onValuesChange, children: /* @__PURE__ */ jsxRuntime.jsx(Group, { ref, ...rest }) });
|
|
1110
|
+
})
|
|
1111
|
+
);
|
|
1112
|
+
const OvermapInputItem$1 = "_OvermapInputItem_1jgzv_1";
|
|
1113
|
+
const styles$l = {
|
|
1114
|
+
OvermapInputItem: OvermapInputItem$1
|
|
1115
|
+
};
|
|
1116
|
+
const OvermapInputItem = React.memo(
|
|
1117
|
+
React.forwardRef((props, ref) => {
|
|
1118
|
+
const { size, className, style, leftSlot, rightSlot, ...rest } = props;
|
|
1119
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1120
|
+
OvermapItem,
|
|
1121
|
+
{
|
|
1122
|
+
className,
|
|
1123
|
+
style,
|
|
1124
|
+
size,
|
|
1125
|
+
leftSlot,
|
|
1126
|
+
rightSlot,
|
|
1127
|
+
compact: false,
|
|
1128
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("input", { className: styles$l.OvermapInputItem, ref, ...rest })
|
|
1129
|
+
}
|
|
1130
|
+
);
|
|
1131
|
+
})
|
|
1132
|
+
);
|
|
1133
|
+
OvermapInputItem.displayName = "OvermapInputItem";
|
|
1134
|
+
const DialogContentScrollArea = "_DialogContentScrollArea_i3a60_1";
|
|
1135
|
+
const styles$k = {
|
|
1136
|
+
DialogContentScrollArea
|
|
1137
|
+
};
|
|
1138
|
+
const ContentImpl = React.memo(
|
|
1139
|
+
React.forwardRef((props, ref) => {
|
|
1140
|
+
const { size } = useDialogMenuContext();
|
|
1141
|
+
const {
|
|
1142
|
+
topSlot,
|
|
1143
|
+
bottomSlot,
|
|
1144
|
+
numberOfItems,
|
|
1145
|
+
filterValue,
|
|
1146
|
+
onFilterValueChange,
|
|
1147
|
+
placeholder,
|
|
1148
|
+
leftFilterSlot,
|
|
1149
|
+
rightFilterSlot,
|
|
1150
|
+
children
|
|
1151
|
+
} = props;
|
|
1152
|
+
const handleChange = React.useCallback(
|
|
1153
|
+
(e) => {
|
|
1154
|
+
if (onFilterValueChange)
|
|
1155
|
+
onFilterValueChange(e.target.value);
|
|
1156
|
+
},
|
|
1157
|
+
[onFilterValueChange]
|
|
1158
|
+
);
|
|
1159
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", width: "100%", ref, py: "2", children: [
|
|
1160
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", width: "100%", px: "2", children: [
|
|
1161
|
+
topSlot && /* @__PURE__ */ jsxRuntime.jsx(OvermapItem, { size, children: topSlot }),
|
|
1162
|
+
filterValue !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1163
|
+
OvermapInputItem,
|
|
1164
|
+
{
|
|
1165
|
+
size,
|
|
1166
|
+
leftSlot: leftFilterSlot,
|
|
1167
|
+
rightSlot: rightFilterSlot,
|
|
1168
|
+
value: filterValue,
|
|
1169
|
+
onChange: handleChange,
|
|
1170
|
+
placeholder
|
|
1171
|
+
}
|
|
1172
|
+
)
|
|
1173
|
+
] }),
|
|
1174
|
+
(topSlot || filterValue !== void 0) && numberOfItems > 0 && /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
1175
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.ScrollArea, { className: styles$k.DialogContentScrollArea, scrollbars: "vertical", type: "hover", children: /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { px: "2", children }) }),
|
|
1176
|
+
bottomSlot && /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
1177
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { direction: "column", width: "100%", px: "2", children: bottomSlot && /* @__PURE__ */ jsxRuntime.jsx(OvermapItem, { size, children: bottomSlot }) })
|
|
1178
|
+
] });
|
|
1179
|
+
})
|
|
1180
|
+
);
|
|
1181
|
+
const Content = React.memo(
|
|
1182
|
+
React.forwardRef((props, ref) => {
|
|
1183
|
+
const { subContentId } = useDialogMenuContext();
|
|
1184
|
+
return !subContentId && /* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref, ...props });
|
|
1185
|
+
})
|
|
1186
|
+
);
|
|
1187
|
+
const SubContent = React.memo(
|
|
1188
|
+
React.forwardRef((props, ref) => {
|
|
1189
|
+
const { id, ...rest } = props;
|
|
1190
|
+
const { subContentId } = useDialogMenuContext();
|
|
1191
|
+
return subContentId === id && /* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref, ...rest });
|
|
1192
|
+
})
|
|
1193
|
+
);
|
|
1194
|
+
const DialogMenuContextProvider = React.memo((props) => {
|
|
1195
|
+
const { size, closeOnSelect, close, selectedIndicator, children } = props;
|
|
1196
|
+
const [subContentId, setSubContentId] = React.useState(null);
|
|
1197
|
+
const value = React.useMemo(
|
|
1198
|
+
() => ({ size, close, closeOnSelect, subContentId, setSubContentId, selectedIndicator }),
|
|
1199
|
+
[close, closeOnSelect, selectedIndicator, size, subContentId]
|
|
1200
|
+
);
|
|
1201
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogMenuContext.Provider, { value, children });
|
|
1202
|
+
});
|
|
1203
|
+
DialogMenuContextProvider.displayName = "DialogMenuContextProvider";
|
|
1204
|
+
const DialogMenuWrapper = "_DialogMenuWrapper_16hy0_1";
|
|
1205
|
+
const DialogMenu$1 = "_DialogMenu_16hy0_1";
|
|
1206
|
+
const styles$j = {
|
|
1207
|
+
DialogMenuWrapper,
|
|
1208
|
+
DialogMenu: DialogMenu$1
|
|
1209
|
+
};
|
|
1210
|
+
const Root$3 = React.memo(
|
|
1211
|
+
React.forwardRef((props, ref) => {
|
|
1212
|
+
const {
|
|
1213
|
+
className,
|
|
1214
|
+
content: contentFromProps,
|
|
1215
|
+
selectedIndicator = DEFAULT_SELECTED_INDICATOR,
|
|
1216
|
+
size = DEFAULT_DIALOG_MENU_SIZE,
|
|
1217
|
+
closeOnSelect = false,
|
|
1218
|
+
...rest
|
|
1219
|
+
} = props;
|
|
1220
|
+
const content = React.useCallback(
|
|
1221
|
+
(close) => {
|
|
1222
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { className: classNames(styles$j.DialogMenu, className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1223
|
+
DialogMenuContextProvider,
|
|
1224
|
+
{
|
|
1225
|
+
size,
|
|
1226
|
+
close,
|
|
1227
|
+
closeOnSelect,
|
|
1228
|
+
selectedIndicator,
|
|
1229
|
+
children: contentFromProps
|
|
1230
|
+
}
|
|
1231
|
+
) });
|
|
1232
|
+
},
|
|
1233
|
+
[className, closeOnSelect, contentFromProps, selectedIndicator, size]
|
|
1234
|
+
);
|
|
1235
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BaseDialog, { className: styles$j.DialogMenuWrapper, ref, content, ...rest });
|
|
1236
|
+
})
|
|
1237
|
+
);
|
|
1238
|
+
const DialogCommandMenu = React.memo(
|
|
1239
|
+
React.forwardRef((props, ref) => {
|
|
1240
|
+
const {
|
|
1241
|
+
// Command menu scoped props
|
|
1242
|
+
size,
|
|
1243
|
+
items,
|
|
1244
|
+
closeOnSelect = true,
|
|
1245
|
+
// Content scoped props
|
|
1246
|
+
filterValue,
|
|
1247
|
+
onFilterValueChange,
|
|
1248
|
+
placeholder,
|
|
1249
|
+
leftFilterSlot,
|
|
1250
|
+
rightFilterSlot,
|
|
1251
|
+
topSlot,
|
|
1252
|
+
bottomSlot,
|
|
1253
|
+
...rest
|
|
1254
|
+
} = props;
|
|
1255
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1256
|
+
Root$3,
|
|
1257
|
+
{
|
|
1258
|
+
ref,
|
|
1259
|
+
size,
|
|
1260
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1261
|
+
Content,
|
|
1262
|
+
{
|
|
1263
|
+
filterValue,
|
|
1264
|
+
onFilterValueChange,
|
|
1265
|
+
placeholder,
|
|
1266
|
+
leftFilterSlot,
|
|
1267
|
+
rightFilterSlot,
|
|
1268
|
+
numberOfItems: items.length,
|
|
1269
|
+
topSlot,
|
|
1270
|
+
bottomSlot,
|
|
1271
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Group, { size, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(Item, { ...item }, index)) })
|
|
1272
|
+
}
|
|
1273
|
+
),
|
|
1274
|
+
closeOnSelect,
|
|
1275
|
+
...rest
|
|
1276
|
+
}
|
|
1277
|
+
);
|
|
1278
|
+
})
|
|
1279
|
+
);
|
|
1280
|
+
const DialogSelectMenu = React.memo(
|
|
1281
|
+
React.forwardRef((props, ref) => {
|
|
1282
|
+
const {
|
|
1283
|
+
// Select scoped props
|
|
1284
|
+
size,
|
|
1285
|
+
value,
|
|
1286
|
+
onValueChange,
|
|
1287
|
+
items,
|
|
1288
|
+
selectedIndicator,
|
|
1289
|
+
// Content scoped props
|
|
1290
|
+
filterValue,
|
|
1291
|
+
onFilterValueChange,
|
|
1292
|
+
placeholder,
|
|
1293
|
+
leftFilterSlot,
|
|
1294
|
+
rightFilterSlot,
|
|
1295
|
+
topSlot,
|
|
1296
|
+
bottomSlot,
|
|
1297
|
+
...rest
|
|
1298
|
+
} = props;
|
|
1299
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1300
|
+
Root$3,
|
|
1301
|
+
{
|
|
1302
|
+
ref,
|
|
1303
|
+
size,
|
|
1304
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1305
|
+
Content,
|
|
1306
|
+
{
|
|
1307
|
+
filterValue,
|
|
1308
|
+
onFilterValueChange,
|
|
1309
|
+
placeholder,
|
|
1310
|
+
leftFilterSlot,
|
|
1311
|
+
rightFilterSlot,
|
|
1312
|
+
numberOfItems: items.length,
|
|
1313
|
+
topSlot,
|
|
1314
|
+
bottomSlot,
|
|
1315
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SelectGroup, { size, value, onValueChange, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1316
|
+
SelectItem,
|
|
1317
|
+
{
|
|
1318
|
+
selectedIndicator,
|
|
1319
|
+
...item
|
|
1320
|
+
},
|
|
1321
|
+
`${item.value}-${index}`
|
|
1322
|
+
)) })
|
|
1323
|
+
}
|
|
1324
|
+
),
|
|
1325
|
+
...rest
|
|
1326
|
+
}
|
|
1327
|
+
);
|
|
1328
|
+
})
|
|
1329
|
+
);
|
|
1330
|
+
const DialogMultiSelectMenu = React.memo(
|
|
1331
|
+
React.forwardRef((props, ref) => {
|
|
1332
|
+
const {
|
|
1333
|
+
// Multi select scoped props
|
|
1334
|
+
size,
|
|
1335
|
+
selectedIndicator,
|
|
1336
|
+
values,
|
|
1337
|
+
onValuesChange,
|
|
1338
|
+
items,
|
|
1339
|
+
// Content scoped props
|
|
1340
|
+
filterValue,
|
|
1341
|
+
onFilterValueChange,
|
|
1342
|
+
placeholder,
|
|
1343
|
+
leftFilterSlot,
|
|
1344
|
+
rightFilterSlot,
|
|
1345
|
+
topSlot,
|
|
1346
|
+
bottomSlot,
|
|
1347
|
+
...rest
|
|
1348
|
+
} = props;
|
|
1349
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1350
|
+
Root$3,
|
|
1351
|
+
{
|
|
1352
|
+
ref,
|
|
1353
|
+
size,
|
|
1354
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1355
|
+
Content,
|
|
1356
|
+
{
|
|
1357
|
+
filterValue,
|
|
1358
|
+
onFilterValueChange,
|
|
1359
|
+
placeholder,
|
|
1360
|
+
leftFilterSlot,
|
|
1361
|
+
rightFilterSlot,
|
|
1362
|
+
numberOfItems: items.length,
|
|
1363
|
+
topSlot,
|
|
1364
|
+
bottomSlot,
|
|
1365
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MultiSelectGroup, { size, values, onValuesChange, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1366
|
+
MultiSelectItem$1,
|
|
1367
|
+
{
|
|
1368
|
+
...item,
|
|
1369
|
+
selectedIndicator
|
|
1370
|
+
},
|
|
1371
|
+
`${item.value}-${index}`
|
|
1372
|
+
)) })
|
|
1373
|
+
}
|
|
1374
|
+
),
|
|
1375
|
+
...rest
|
|
1376
|
+
}
|
|
1377
|
+
);
|
|
1378
|
+
})
|
|
1379
|
+
);
|
|
1380
|
+
const DialogMenu = {
|
|
1381
|
+
Root: Root$3,
|
|
1382
|
+
Item,
|
|
1383
|
+
SelectItem,
|
|
1384
|
+
MultiSelectItem: MultiSelectItem$1,
|
|
1385
|
+
Separator,
|
|
1386
|
+
Content,
|
|
1387
|
+
Group,
|
|
1388
|
+
SelectGroup,
|
|
1389
|
+
MultiSelectGroup,
|
|
1390
|
+
SubTrigger,
|
|
1391
|
+
SubContent
|
|
1392
|
+
};
|
|
663
1393
|
const BaseMenuItem$1 = "_BaseMenuItem_5r3et_1";
|
|
664
1394
|
const RemoveOutline = "_RemoveOutline_5r3et_15";
|
|
665
1395
|
const BaseMenuSeparator$1 = "_BaseMenuSeparator_5r3et_19";
|
|
@@ -813,7 +1543,7 @@
|
|
|
813
1543
|
onChange: textFilterChangeHandler(onFilterValueChange),
|
|
814
1544
|
placeholder,
|
|
815
1545
|
leftSlot: icons == null ? void 0 : icons.left,
|
|
816
|
-
rightSlot: (icons == null ? void 0 : icons.right) || /* @__PURE__ */ jsxRuntime.jsx(
|
|
1546
|
+
rightSlot: (icons == null ? void 0 : icons.right) || /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiSearchLine" })
|
|
817
1547
|
}
|
|
818
1548
|
),
|
|
819
1549
|
items.length !== 0 && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
@@ -831,7 +1561,7 @@
|
|
|
831
1561
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
832
1562
|
BaseMenuItem,
|
|
833
1563
|
{
|
|
834
|
-
rightSlot: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorElement, { asChild: true, children: selectedIndicator || /* @__PURE__ */ jsxRuntime.jsx(
|
|
1564
|
+
rightSlot: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorElement, { asChild: true, children: selectedIndicator || /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCheckLine" }) }),
|
|
835
1565
|
children: content
|
|
836
1566
|
}
|
|
837
1567
|
)
|
|
@@ -910,7 +1640,7 @@
|
|
|
910
1640
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
911
1641
|
BaseMenuItem,
|
|
912
1642
|
{
|
|
913
|
-
rightSlot: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorElement, { asChild: true, children: selectedIndicator || /* @__PURE__ */ jsxRuntime.jsx(
|
|
1643
|
+
rightSlot: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorElement, { asChild: true, children: selectedIndicator || /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCheckLine" }) }),
|
|
914
1644
|
children: content
|
|
915
1645
|
}
|
|
916
1646
|
)
|
|
@@ -938,6 +1668,123 @@
|
|
|
938
1668
|
separator && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
939
1669
|
] });
|
|
940
1670
|
});
|
|
1671
|
+
const CollapsibleTreeContext = React.createContext(
|
|
1672
|
+
{}
|
|
1673
|
+
);
|
|
1674
|
+
function useCollapsibleTreeContext() {
|
|
1675
|
+
return React.useContext(CollapsibleTreeContext);
|
|
1676
|
+
}
|
|
1677
|
+
const CollapsibleNode = genericMemo(function(props) {
|
|
1678
|
+
const { meta, nodes, level = 0, disabled: disabled2 } = props;
|
|
1679
|
+
const [controlledOpenState, setControlledOpenState] = React.useState(false);
|
|
1680
|
+
const {
|
|
1681
|
+
nodeRenderer,
|
|
1682
|
+
disabled: disabledFromContext,
|
|
1683
|
+
nodeGap,
|
|
1684
|
+
onNodeOpen,
|
|
1685
|
+
onNodeClose,
|
|
1686
|
+
onNodeClick,
|
|
1687
|
+
nodeStyles,
|
|
1688
|
+
nodeClassName,
|
|
1689
|
+
levelGap
|
|
1690
|
+
} = useCollapsibleTreeContext();
|
|
1691
|
+
const isDisabled = disabled2 ?? disabledFromContext;
|
|
1692
|
+
const handleClick = React.useCallback(() => {
|
|
1693
|
+
if (onNodeClick)
|
|
1694
|
+
onNodeClick(meta);
|
|
1695
|
+
}, [meta, onNodeClick]);
|
|
1696
|
+
const toggleOpenState = React.useCallback(() => {
|
|
1697
|
+
setControlledOpenState(!controlledOpenState);
|
|
1698
|
+
if (!controlledOpenState && onNodeOpen)
|
|
1699
|
+
onNodeOpen(meta);
|
|
1700
|
+
if (controlledOpenState && onNodeClose)
|
|
1701
|
+
onNodeClose(meta);
|
|
1702
|
+
}, [meta, onNodeClose, onNodeOpen, controlledOpenState]);
|
|
1703
|
+
const { children, leftSlot, rightSlot, style, className } = React.useMemo(() => {
|
|
1704
|
+
return nodeRenderer({
|
|
1705
|
+
meta,
|
|
1706
|
+
toggleOpen: toggleOpenState,
|
|
1707
|
+
open: controlledOpenState,
|
|
1708
|
+
disabled: isDisabled
|
|
1709
|
+
});
|
|
1710
|
+
}, [isDisabled, meta, nodeRenderer, toggleOpenState, controlledOpenState]);
|
|
1711
|
+
const combinedStyles = React.useMemo(
|
|
1712
|
+
() => ({
|
|
1713
|
+
// want node specific styles to overwrite and global node styles
|
|
1714
|
+
...nodeStyles,
|
|
1715
|
+
...style
|
|
1716
|
+
}),
|
|
1717
|
+
[nodeStyles, style]
|
|
1718
|
+
);
|
|
1719
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixPrimitiveCollapsible__namespace.Root, { asChild: true, open: controlledOpenState, disabled: isDisabled, children: /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { width: "100%", direction: "column", children: [
|
|
1720
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1721
|
+
OvermapItem,
|
|
1722
|
+
{
|
|
1723
|
+
onClick: handleClick,
|
|
1724
|
+
disabled: disabled2 ?? disabledFromContext,
|
|
1725
|
+
className: classNames(nodeClassName, className),
|
|
1726
|
+
style: combinedStyles,
|
|
1727
|
+
leftSlot,
|
|
1728
|
+
rightSlot,
|
|
1729
|
+
"data-state": controlledOpenState ? "open" : "closed",
|
|
1730
|
+
"data-disabled": isDisabled,
|
|
1731
|
+
children
|
|
1732
|
+
}
|
|
1733
|
+
),
|
|
1734
|
+
nodes && nodes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(RadixPrimitiveCollapsible__namespace.Content, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1735
|
+
themes.Flex,
|
|
1736
|
+
{
|
|
1737
|
+
width: "100%",
|
|
1738
|
+
pl: levelGap,
|
|
1739
|
+
height: "max-content",
|
|
1740
|
+
direction: "column",
|
|
1741
|
+
gap: nodeGap,
|
|
1742
|
+
pt: nodeGap,
|
|
1743
|
+
children: nodes.map((treeNodeProps, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1744
|
+
CollapsibleNode,
|
|
1745
|
+
{
|
|
1746
|
+
level: level + 1,
|
|
1747
|
+
...treeNodeProps
|
|
1748
|
+
},
|
|
1749
|
+
`${level},${index}`
|
|
1750
|
+
))
|
|
1751
|
+
}
|
|
1752
|
+
) })
|
|
1753
|
+
] }) });
|
|
1754
|
+
});
|
|
1755
|
+
const CollapsibleTree = genericMemo(function(props) {
|
|
1756
|
+
const {
|
|
1757
|
+
nodes,
|
|
1758
|
+
disabled: disabled2 = false,
|
|
1759
|
+
nodeClassName,
|
|
1760
|
+
nodeStyles,
|
|
1761
|
+
size = "2",
|
|
1762
|
+
nodeGap = "0",
|
|
1763
|
+
levelGap = "2",
|
|
1764
|
+
onNodeClick,
|
|
1765
|
+
onNodeClose,
|
|
1766
|
+
onNodeOpen,
|
|
1767
|
+
nodeRenderer,
|
|
1768
|
+
...rest
|
|
1769
|
+
} = props;
|
|
1770
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1771
|
+
CollapsibleTreeContext.Provider,
|
|
1772
|
+
{
|
|
1773
|
+
value: {
|
|
1774
|
+
nodeRenderer,
|
|
1775
|
+
nodeGap,
|
|
1776
|
+
levelGap,
|
|
1777
|
+
nodeClassName,
|
|
1778
|
+
nodeStyles,
|
|
1779
|
+
disabled: disabled2,
|
|
1780
|
+
onNodeClick,
|
|
1781
|
+
onNodeClose,
|
|
1782
|
+
onNodeOpen
|
|
1783
|
+
},
|
|
1784
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(OvermapItemGroup, { width: "100%", height: "max-content", size, ...rest, gapY: nodeGap, children: nodes.map((treeNodeProps, index) => /* @__PURE__ */ jsxRuntime.jsx(CollapsibleNode, { ...treeNodeProps }, `${0},${index}`)) })
|
|
1785
|
+
}
|
|
1786
|
+
);
|
|
1787
|
+
});
|
|
941
1788
|
const ActionItemGroup = React.memo((props) => {
|
|
942
1789
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseItemGroup, { ...props, groupElement: RadixContextMenu__namespace.Group, itemElement: RadixContextMenu__namespace.Item });
|
|
943
1790
|
});
|
|
@@ -980,11 +1827,20 @@
|
|
|
980
1827
|
});
|
|
981
1828
|
SubItemGroup.displayName = "SubItemGroup";
|
|
982
1829
|
const Root$2 = React.memo((props) => {
|
|
983
|
-
const { disabled: disabled2 = false, children, modal = false, content, ...rest } = props;
|
|
1830
|
+
const { disabled: disabled2 = false, children, modal = false, content, className, ...rest } = props;
|
|
984
1831
|
const infoColor = useSeverityColor("info");
|
|
985
1832
|
return /* @__PURE__ */ jsxRuntime.jsxs(themes.ContextMenu.Root, { modal, children: [
|
|
986
1833
|
/* @__PURE__ */ jsxRuntime.jsx(themes.ContextMenu.Trigger, { disabled: disabled2, children }),
|
|
987
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1834
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1835
|
+
themes.ContextMenu.Content,
|
|
1836
|
+
{
|
|
1837
|
+
className: classNames("overmap-context-menu", className),
|
|
1838
|
+
variant: "soft",
|
|
1839
|
+
color: infoColor,
|
|
1840
|
+
...rest,
|
|
1841
|
+
children: content
|
|
1842
|
+
}
|
|
1843
|
+
)
|
|
988
1844
|
] });
|
|
989
1845
|
});
|
|
990
1846
|
Root$2.displayName = "ContextMenuRoot";
|
|
@@ -1218,6 +2074,20 @@
|
|
|
1218
2074
|
}
|
|
1219
2075
|
)
|
|
1220
2076
|
);
|
|
2077
|
+
const DownloadButtonUtility = React.memo((props) => {
|
|
2078
|
+
const { children, file } = props;
|
|
2079
|
+
const anchorRef = React.useRef(null);
|
|
2080
|
+
const objectURL = React.useMemo(() => URL.createObjectURL(file), [file]);
|
|
2081
|
+
const handleClick = React.useCallback(() => {
|
|
2082
|
+
if (anchorRef.current)
|
|
2083
|
+
anchorRef.current.click();
|
|
2084
|
+
}, []);
|
|
2085
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2086
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { onClick: handleClick, children }),
|
|
2087
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { style: { display: "none" }, href: objectURL, target: "_blank", rel: "noreferrer", ref: anchorRef })
|
|
2088
|
+
] });
|
|
2089
|
+
});
|
|
2090
|
+
DownloadButtonUtility.displayName = "DownloadButtonUtility";
|
|
1221
2091
|
const HoverUtility = React.memo(function Root2({ children }) {
|
|
1222
2092
|
const [isHovered, setIsHovered] = React.useState(reactDeviceDetect.isMobile);
|
|
1223
2093
|
const handlePointerEnter = React.useCallback(() => {
|
|
@@ -1481,8 +2351,8 @@
|
|
|
1481
2351
|
enable: { right: resizable2 && isLeft, left: resizable2 && isRight },
|
|
1482
2352
|
handleClasses: { left: styles$f.resizeHandle, right: styles$f.resizeHandle },
|
|
1483
2353
|
handleComponent: {
|
|
1484
|
-
right: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1485
|
-
left: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2354
|
+
right: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiDraggable" }),
|
|
2355
|
+
left: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiDraggable" })
|
|
1486
2356
|
},
|
|
1487
2357
|
children
|
|
1488
2358
|
}
|
|
@@ -2406,7 +3276,7 @@
|
|
|
2406
3276
|
maxWidth: leftPanelMaxWidth,
|
|
2407
3277
|
handleClasses: { right: classNames(styles$a.resizeHandle, styles$a.left) },
|
|
2408
3278
|
handleComponent: {
|
|
2409
|
-
right: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3279
|
+
right: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiDraggable", height: "14px", width: "14px" })
|
|
2410
3280
|
},
|
|
2411
3281
|
children: leftPanel
|
|
2412
3282
|
}
|
|
@@ -2445,7 +3315,7 @@
|
|
|
2445
3315
|
minWidth: rightMinWidth,
|
|
2446
3316
|
maxWidth: rightPanelMaxWidth,
|
|
2447
3317
|
handleClasses: { left: classNames(styles$a.resizeHandle, styles$a.right) },
|
|
2448
|
-
handleComponent: { left: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3318
|
+
handleComponent: { left: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiDraggable", height: "14px", width: "14px" }) },
|
|
2449
3319
|
children: rightPanel
|
|
2450
3320
|
}
|
|
2451
3321
|
)
|
|
@@ -2697,7 +3567,7 @@
|
|
|
2697
3567
|
action && /* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Action, { className: styles$6.actionButton, altText: action.altText, asChild: true, children: action.content })
|
|
2698
3568
|
] })
|
|
2699
3569
|
] }),
|
|
2700
|
-
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { "aria-label": "Close", variant: "ghost", severity, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3570
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { "aria-label": "Close", variant: "ghost", severity, children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCloseLine" }) }) })
|
|
2701
3571
|
] }) }) });
|
|
2702
3572
|
});
|
|
2703
3573
|
const Toast = React.memo(_Toast);
|
|
@@ -2791,11 +3661,34 @@
|
|
|
2791
3661
|
);
|
|
2792
3662
|
})
|
|
2793
3663
|
);
|
|
2794
|
-
const
|
|
3664
|
+
const ToggleButton$1 = "_ToggleButton_13aus_1";
|
|
2795
3665
|
const styles$4 = {
|
|
3666
|
+
ToggleButton: ToggleButton$1
|
|
3667
|
+
};
|
|
3668
|
+
const ToggleButton = React.memo(
|
|
3669
|
+
React.forwardRef((props, ref) => {
|
|
3670
|
+
const { children, className, severity, fluid: fluid2, variant = "solid", size, hoverEffects, ...rest } = props;
|
|
3671
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Toggle__namespace.Root, { ref, asChild: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3672
|
+
IconButton,
|
|
3673
|
+
{
|
|
3674
|
+
className: classNames(className, styles$4.ToggleButton),
|
|
3675
|
+
"aria-label": props["aria-label"],
|
|
3676
|
+
severity,
|
|
3677
|
+
fluid: fluid2,
|
|
3678
|
+
variant,
|
|
3679
|
+
hoverEffects,
|
|
3680
|
+
size,
|
|
3681
|
+
"data-variant": variant,
|
|
3682
|
+
children
|
|
3683
|
+
}
|
|
3684
|
+
) });
|
|
3685
|
+
})
|
|
3686
|
+
);
|
|
3687
|
+
const noWrap = "_noWrap_1wpa5_1";
|
|
3688
|
+
const styles$3 = {
|
|
2796
3689
|
noWrap
|
|
2797
3690
|
};
|
|
2798
|
-
const Text
|
|
3691
|
+
const Text = React.memo(
|
|
2799
3692
|
React.forwardRef(({ className, noWrap: noWrap2, severity, as, ...props }, ref) => {
|
|
2800
3693
|
const color = useSeverityColor(severity);
|
|
2801
3694
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2803,7 +3696,7 @@
|
|
|
2803
3696
|
{
|
|
2804
3697
|
ref,
|
|
2805
3698
|
as,
|
|
2806
|
-
className: classNames(className, { [styles$
|
|
3699
|
+
className: classNames(className, { [styles$3.noWrap]: noWrap2 }),
|
|
2807
3700
|
color,
|
|
2808
3701
|
...props
|
|
2809
3702
|
}
|
|
@@ -2817,60 +3710,6 @@
|
|
|
2817
3710
|
return /* @__PURE__ */ jsxRuntime.jsx(themes.Theme, { panelBackground, radius: radius2, ref, ...rest });
|
|
2818
3711
|
})
|
|
2819
3712
|
);
|
|
2820
|
-
const light = "_light_1u8fs_1";
|
|
2821
|
-
const bold = "_bold_1u8fs_8";
|
|
2822
|
-
const full = "_full_1u8fs_15";
|
|
2823
|
-
const Text = "_Text_1u8fs_22";
|
|
2824
|
-
const styles$3 = {
|
|
2825
|
-
light,
|
|
2826
|
-
bold,
|
|
2827
|
-
full,
|
|
2828
|
-
Text
|
|
2829
|
-
};
|
|
2830
|
-
const SeparatorSizeMapping = {
|
|
2831
|
-
"1": "max-content",
|
|
2832
|
-
"2": "max-content",
|
|
2833
|
-
"3": "max-content",
|
|
2834
|
-
"4": "100%"
|
|
2835
|
-
};
|
|
2836
|
-
const _Separator = React.forwardRef(function Separator2({
|
|
2837
|
-
className,
|
|
2838
|
-
severity = "info",
|
|
2839
|
-
textWeight = "light",
|
|
2840
|
-
gap = "1",
|
|
2841
|
-
text,
|
|
2842
|
-
orientation = "horizontal",
|
|
2843
|
-
size,
|
|
2844
|
-
weight = "medium",
|
|
2845
|
-
...rest
|
|
2846
|
-
}, ref) {
|
|
2847
|
-
const computedSizing = useResponsiveMapping(size, SeparatorSizeMapping);
|
|
2848
|
-
const severityColor = useSeverityColor(severity);
|
|
2849
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2850
|
-
themes.Flex,
|
|
2851
|
-
{
|
|
2852
|
-
className: classNames("overmap-separator", className, {
|
|
2853
|
-
[styles$3.light]: weight === "light",
|
|
2854
|
-
[styles$3.bold]: weight === "bold",
|
|
2855
|
-
[styles$3.full]: weight === "full"
|
|
2856
|
-
}),
|
|
2857
|
-
ref,
|
|
2858
|
-
width: orientation === "horizontal" ? computedSizing : "max-content",
|
|
2859
|
-
height: orientation === "vertical" ? computedSizing : "max-content",
|
|
2860
|
-
direction: orientation === "vertical" ? "column" : "row",
|
|
2861
|
-
align: "center",
|
|
2862
|
-
gap,
|
|
2863
|
-
children: [
|
|
2864
|
-
/* @__PURE__ */ jsxRuntime.jsx(themes.Separator, { size, orientation, color: severityColor, ...rest }),
|
|
2865
|
-
text && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2866
|
-
/* @__PURE__ */ jsxRuntime.jsx(themes.Text, { className: styles$3.Text, as: "span", size: "1", weight: textWeight, color: severityColor, children: text }),
|
|
2867
|
-
/* @__PURE__ */ jsxRuntime.jsx(themes.Separator, { size, orientation, color: severityColor, ...rest })
|
|
2868
|
-
] })
|
|
2869
|
-
]
|
|
2870
|
-
}
|
|
2871
|
-
);
|
|
2872
|
-
});
|
|
2873
|
-
const Separator = React.memo(_Separator);
|
|
2874
3713
|
const centerStyles = { placeSelf: "center" };
|
|
2875
3714
|
const ErrorFallback = React.memo((props) => {
|
|
2876
3715
|
const { absoluteCentering } = props;
|
|
@@ -2879,8 +3718,8 @@
|
|
|
2879
3718
|
const outerFlexStyles = absoluteCentering ? { position: "absolute", top: "50%", transform: "translateY(-50%)" } : void 0;
|
|
2880
3719
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "2", direction: "row", width: "100%", style: outerFlexStyles, children: [
|
|
2881
3720
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } }),
|
|
2882
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2883
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text
|
|
3721
|
+
/* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiAlertLine", size: height, style: centerStyles }),
|
|
3722
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { style: { lineHeight: height, ...centerStyles }, children: "Something went wrong" }),
|
|
2884
3723
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2885
3724
|
IconButton,
|
|
2886
3725
|
{
|
|
@@ -2889,7 +3728,7 @@
|
|
|
2889
3728
|
onClick: resetBoundary,
|
|
2890
3729
|
style: centerStyles,
|
|
2891
3730
|
hoverEffects: ["spin180Clockwise"],
|
|
2892
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3731
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiLoopLeftLine", size: height })
|
|
2893
3732
|
}
|
|
2894
3733
|
),
|
|
2895
3734
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } })
|
|
@@ -3470,7 +4309,7 @@
|
|
|
3470
4309
|
},
|
|
3471
4310
|
ref,
|
|
3472
4311
|
...rest,
|
|
3473
|
-
children: /* @__PURE__ */ jsxRuntime.jsx($e698a72e93240346$export$adb584737d712b70, { className: styles$2.checkboxIndicator, children: checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4312
|
+
children: /* @__PURE__ */ jsxRuntime.jsx($e698a72e93240346$export$adb584737d712b70, { className: styles$2.checkboxIndicator, children: checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiSubtractLine" }) : /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCheckLine" }) })
|
|
3474
4313
|
}
|
|
3475
4314
|
),
|
|
3476
4315
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3560,7 +4399,7 @@
|
|
|
3560
4399
|
const tableContainer = "_tableContainer_5i91d_25";
|
|
3561
4400
|
const searchContainer = "_searchContainer_5i91d_30";
|
|
3562
4401
|
const columnFilterSelect = "_columnFilterSelect_5i91d_40";
|
|
3563
|
-
const table
|
|
4402
|
+
const table = "_table_5i91d_21";
|
|
3564
4403
|
const tableHeaderCell = "_tableHeaderCell_5i91d_58";
|
|
3565
4404
|
const showSortIcon = "_showSortIcon_5i91d_74";
|
|
3566
4405
|
const tableRow = "_tableRow_5i91d_78";
|
|
@@ -3579,7 +4418,7 @@
|
|
|
3579
4418
|
tableContainer,
|
|
3580
4419
|
searchContainer,
|
|
3581
4420
|
columnFilterSelect,
|
|
3582
|
-
table
|
|
4421
|
+
table,
|
|
3583
4422
|
tableHeaderCell,
|
|
3584
4423
|
showSortIcon,
|
|
3585
4424
|
tableRow,
|
|
@@ -3591,16 +4430,6 @@
|
|
|
3591
4430
|
pageText,
|
|
3592
4431
|
descriptionSecondLine
|
|
3593
4432
|
};
|
|
3594
|
-
const table = import("@overmap-ai/react-table-library/table.js");
|
|
3595
|
-
const { Body, Cell, Header, HeaderCell, HeaderRow, Row, Table: ReactLibraryTable } = table;
|
|
3596
|
-
const theme = import("@overmap-ai/react-table-library/theme.js");
|
|
3597
|
-
const { useTheme } = theme;
|
|
3598
|
-
const sort = import("@overmap-ai/react-table-library/sort.js");
|
|
3599
|
-
const { HeaderCellSort, useSort } = sort;
|
|
3600
|
-
const select = import("@overmap-ai/react-table-library/select.js");
|
|
3601
|
-
const { CellSelect, HeaderCellSelect, SelectClickTypes, SelectTypes, useRowSelect } = select;
|
|
3602
|
-
const pagination = import("@overmap-ai/react-table-library/pagination.js");
|
|
3603
|
-
const { usePagination } = pagination;
|
|
3604
4433
|
const _Table = React.forwardRef(function Table2(props, ref) {
|
|
3605
4434
|
var _a;
|
|
3606
4435
|
const {
|
|
@@ -3624,6 +4453,7 @@
|
|
|
3624
4453
|
emptyMessage = "There is no data",
|
|
3625
4454
|
topBarComponents,
|
|
3626
4455
|
children,
|
|
4456
|
+
containerClassName,
|
|
3627
4457
|
className,
|
|
3628
4458
|
columnClassName,
|
|
3629
4459
|
rowClassName,
|
|
@@ -3749,7 +4579,7 @@
|
|
|
3749
4579
|
setSearch(e.target.value);
|
|
3750
4580
|
}, []);
|
|
3751
4581
|
const tableData = { nodes: rows };
|
|
3752
|
-
const tableSelect = useRowSelect(
|
|
4582
|
+
const tableSelect = select_js.useRowSelect(
|
|
3753
4583
|
tableData,
|
|
3754
4584
|
{
|
|
3755
4585
|
onChange: (_action, state) => {
|
|
@@ -3757,13 +4587,13 @@
|
|
|
3757
4587
|
}
|
|
3758
4588
|
},
|
|
3759
4589
|
{
|
|
3760
|
-
rowSelect: SelectTypes.MultiSelect,
|
|
3761
|
-
buttonSelect: SelectTypes.MultiSelect,
|
|
3762
|
-
clickType: SelectClickTypes.ButtonClick,
|
|
4590
|
+
rowSelect: select_js.SelectTypes.MultiSelect,
|
|
4591
|
+
buttonSelect: select_js.SelectTypes.MultiSelect,
|
|
4592
|
+
clickType: select_js.SelectClickTypes.ButtonClick,
|
|
3763
4593
|
isCarryForward: false
|
|
3764
4594
|
}
|
|
3765
4595
|
);
|
|
3766
|
-
const
|
|
4596
|
+
const pagination = pagination_js.usePagination(
|
|
3767
4597
|
tableData,
|
|
3768
4598
|
{
|
|
3769
4599
|
state: {
|
|
@@ -3775,7 +4605,7 @@
|
|
|
3775
4605
|
isServer: false
|
|
3776
4606
|
}
|
|
3777
4607
|
);
|
|
3778
|
-
const
|
|
4608
|
+
const sort = sort_js.useSort(
|
|
3779
4609
|
tableData,
|
|
3780
4610
|
{
|
|
3781
4611
|
onChange: (_action, state) => {
|
|
@@ -3786,9 +4616,9 @@
|
|
|
3786
4616
|
sortIcon: {
|
|
3787
4617
|
margin: "10px",
|
|
3788
4618
|
size: "15px",
|
|
3789
|
-
iconDefault: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3790
|
-
iconUp: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3791
|
-
iconDown: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4619
|
+
iconDefault: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiExpandUpDownLine" }),
|
|
4620
|
+
iconUp: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiArrowUpLine" }),
|
|
4621
|
+
iconDown: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiArrowUpLine" })
|
|
3792
4622
|
},
|
|
3793
4623
|
sortFns: Object.assign(
|
|
3794
4624
|
{},
|
|
@@ -3860,7 +4690,7 @@
|
|
|
3860
4690
|
[columnFilterValues, columns, getFilterValues]
|
|
3861
4691
|
);
|
|
3862
4692
|
const columnCells = columnsData.map((column) => {
|
|
3863
|
-
const Component = column.sort ? HeaderCellSort : HeaderCell;
|
|
4693
|
+
const Component = column.sort ? sort_js.HeaderCellSort : table_js.HeaderCell;
|
|
3864
4694
|
let firstLine = column.label;
|
|
3865
4695
|
let secondLine = void 0;
|
|
3866
4696
|
if (column.label && typeof column.label === "string") {
|
|
@@ -3892,7 +4722,7 @@
|
|
|
3892
4722
|
});
|
|
3893
4723
|
const SelectedModeButton = reactDeviceDetect.isMobile ? IconButton : Button2;
|
|
3894
4724
|
const layout = React.useMemo(() => ({ custom: true, ...fixHeader && { fixedHeader: true } }), [fixHeader]);
|
|
3895
|
-
const
|
|
4725
|
+
const theme = theme_js.useTheme({
|
|
3896
4726
|
Table: `
|
|
3897
4727
|
--data-table-library_grid-template-columns: ${gridTemplateColumns} !important;
|
|
3898
4728
|
`,
|
|
@@ -3915,18 +4745,18 @@
|
|
|
3915
4745
|
if (showPageNavigation) {
|
|
3916
4746
|
const numTotalPages = Math.ceil(rows.length / numRowsPerPage);
|
|
3917
4747
|
setTotalPages(numTotalPages);
|
|
3918
|
-
if (
|
|
3919
|
-
|
|
4748
|
+
if (pagination.state.page < 0) {
|
|
4749
|
+
pagination.fns.onSetPage(0);
|
|
3920
4750
|
}
|
|
3921
|
-
if (
|
|
3922
|
-
|
|
4751
|
+
if (pagination.state.page > numTotalPages - 1) {
|
|
4752
|
+
pagination.fns.onSetPage(numTotalPages - 1);
|
|
3923
4753
|
}
|
|
3924
4754
|
}
|
|
3925
|
-
}, [rowsPerPage, rows.length, numRowsPerPage,
|
|
4755
|
+
}, [rowsPerPage, rows.length, numRowsPerPage, pagination, showPageNavigation]);
|
|
3926
4756
|
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: classNames({ [styles$1.outerTableContainer]: showContainer }), direction: "column", height: "100%", children: [
|
|
3927
4757
|
(!!title || !!description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.headerContainer, children: [
|
|
3928
|
-
!!title && /* @__PURE__ */ jsxRuntime.jsx(Text
|
|
3929
|
-
!!description && /* @__PURE__ */ jsxRuntime.jsx(Text
|
|
4758
|
+
!!title && /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: "bold", size: "5", children: title }),
|
|
4759
|
+
!!description && /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "div", children: description })
|
|
3930
4760
|
] }),
|
|
3931
4761
|
showTopBar && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { justify: "between", gap: "2", className: styles$1.tableTopContainer, children: [
|
|
3932
4762
|
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { gap: "2", children: [
|
|
@@ -3935,7 +4765,7 @@
|
|
|
3935
4765
|
{
|
|
3936
4766
|
value: search,
|
|
3937
4767
|
onChange: handleSearch,
|
|
3938
|
-
leftSlot: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4768
|
+
leftSlot: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiSearchLine" }),
|
|
3939
4769
|
placeholder: searchBarPlaceholder || "Filter tasks..."
|
|
3940
4770
|
}
|
|
3941
4771
|
) }) }),
|
|
@@ -3944,7 +4774,7 @@
|
|
|
3944
4774
|
{
|
|
3945
4775
|
color,
|
|
3946
4776
|
page: columnFilterPopoverContent,
|
|
3947
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { variant: "surface", "aria-label": "Filter columns", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4777
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { variant: "surface", "aria-label": "Filter columns", children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiEqualizerLine" }) }),
|
|
3948
4778
|
children: (_Close) => ""
|
|
3949
4779
|
}
|
|
3950
4780
|
),
|
|
@@ -3955,46 +4785,46 @@
|
|
|
3955
4785
|
color: "crimson",
|
|
3956
4786
|
onClick: () => {
|
|
3957
4787
|
setColumnFilterValues(defaultColumnFilterValues);
|
|
3958
|
-
|
|
4788
|
+
pagination.fns.onSetPage(0);
|
|
3959
4789
|
},
|
|
3960
4790
|
"aria-label": "Clear filters",
|
|
3961
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4791
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCloseLine" })
|
|
3962
4792
|
}
|
|
3963
4793
|
)
|
|
3964
4794
|
] }),
|
|
3965
4795
|
topBarComponents,
|
|
3966
4796
|
showSelect && selected.length !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { gap: "2", children: [
|
|
3967
4797
|
/* @__PURE__ */ jsxRuntime.jsxs(SelectedModeButton, { variant: "soft", "aria-label": "Edit rows", children: [
|
|
3968
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4798
|
+
/* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiPencilLine" }),
|
|
3969
4799
|
!reactDeviceDetect.isMobile && "Edit"
|
|
3970
4800
|
] }),
|
|
3971
4801
|
/* @__PURE__ */ jsxRuntime.jsxs(SelectedModeButton, { color: "red", "aria-label": "Delete rows", children: [
|
|
3972
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4802
|
+
/* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiDeleteBin2Line" }),
|
|
3973
4803
|
!reactDeviceDetect.isMobile && "Delete"
|
|
3974
4804
|
] })
|
|
3975
4805
|
] })
|
|
3976
4806
|
] }),
|
|
3977
4807
|
children,
|
|
3978
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.tableContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3979
|
-
|
|
4808
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames(styles$1.tableContainer, containerClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4809
|
+
table_js.Table,
|
|
3980
4810
|
{
|
|
3981
4811
|
className: classNames(styles$1.table, className),
|
|
3982
4812
|
data: tableData,
|
|
3983
|
-
theme
|
|
3984
|
-
sort
|
|
3985
|
-
pagination: showPageNavigation &&
|
|
4813
|
+
theme,
|
|
4814
|
+
sort,
|
|
4815
|
+
pagination: showPageNavigation && pagination,
|
|
3986
4816
|
select: tableSelect,
|
|
3987
4817
|
layout,
|
|
3988
4818
|
ref,
|
|
3989
4819
|
children: (tableList) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3990
|
-
/* @__PURE__ */ jsxRuntime.jsx(Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(HeaderRow, { children: [
|
|
3991
|
-
showSelect && /* @__PURE__ */ jsxRuntime.jsx(HeaderCellSelect, { className: styles$1.tableHeaderCell }),
|
|
4820
|
+
/* @__PURE__ */ jsxRuntime.jsx(table_js.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(table_js.HeaderRow, { children: [
|
|
4821
|
+
showSelect && /* @__PURE__ */ jsxRuntime.jsx(select_js.HeaderCellSelect, { className: styles$1.tableHeaderCell }),
|
|
3992
4822
|
...columnCells
|
|
3993
4823
|
] }) }),
|
|
3994
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Body, { children: [
|
|
3995
|
-
tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: emptyMessage }) }),
|
|
4824
|
+
/* @__PURE__ */ jsxRuntime.jsxs(table_js.Body, { children: [
|
|
4825
|
+
tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(table_js.Cell, { children: emptyMessage }) }),
|
|
3996
4826
|
tableList.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3997
|
-
Row,
|
|
4827
|
+
table_js.Row,
|
|
3998
4828
|
{
|
|
3999
4829
|
item: row,
|
|
4000
4830
|
className: classNames(styles$1.tableRow, rowClassName, row.className, {
|
|
@@ -4002,7 +4832,7 @@
|
|
|
4002
4832
|
}),
|
|
4003
4833
|
onClick: !row.disabled && row.onClick,
|
|
4004
4834
|
children: row.loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4005
|
-
Cell,
|
|
4835
|
+
table_js.Cell,
|
|
4006
4836
|
{
|
|
4007
4837
|
style: {
|
|
4008
4838
|
gridColumn: `1 / span ${columns.length}`
|
|
@@ -4011,11 +4841,11 @@
|
|
|
4011
4841
|
},
|
|
4012
4842
|
`loading-${row.id}`
|
|
4013
4843
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4014
|
-
showSelect && /* @__PURE__ */ jsxRuntime.jsx(CellSelect, { item: row }, row.id),
|
|
4844
|
+
showSelect && /* @__PURE__ */ jsxRuntime.jsx(select_js.CellSelect, { item: row }, row.id),
|
|
4015
4845
|
columns.map((column, i) => {
|
|
4016
4846
|
const cell = row[column.id];
|
|
4017
4847
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4018
|
-
Cell,
|
|
4848
|
+
table_js.Cell,
|
|
4019
4849
|
{
|
|
4020
4850
|
className: classNames(
|
|
4021
4851
|
styles$1.tableCell,
|
|
@@ -4041,14 +4871,14 @@
|
|
|
4041
4871
|
) }),
|
|
4042
4872
|
showBottomBar && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.tableBottomContainer, wrap: "wrap", direction: reactDeviceDetect.isMobile ? "column" : "row", children: [
|
|
4043
4873
|
showRowsPerPage && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, children: [
|
|
4044
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text
|
|
4874
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { className: styles$1.rowsPerPageText, size: "2", children: "Rows per page:" }),
|
|
4045
4875
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4046
4876
|
Select,
|
|
4047
4877
|
{
|
|
4048
4878
|
items: rowsPerPageOptions,
|
|
4049
4879
|
defaultValue: (_a = rowsPerPageOptions.find((rowPerPage) => rowPerPage.value === defaultRowsPerPage.toString())) == null ? void 0 : _a.value.toString(),
|
|
4050
4880
|
onValueChange: (v) => {
|
|
4051
|
-
|
|
4881
|
+
pagination.fns.onSetSize(Number(v));
|
|
4052
4882
|
setNumRowsPerPage(Number(v));
|
|
4053
4883
|
},
|
|
4054
4884
|
placeholder: rowsPerPageOptions[0].itemContent,
|
|
@@ -4056,46 +4886,46 @@
|
|
|
4056
4886
|
}
|
|
4057
4887
|
)
|
|
4058
4888
|
] }),
|
|
4059
|
-
showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Text
|
|
4889
|
+
showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { className: styles$1.pageText, size: "2", children: totalPages > 0 && `Page ${pagination.state.page + 1} of ${totalPages}` }) }),
|
|
4060
4890
|
showPageNavigation && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, gap: "2", justify: "end", children: [
|
|
4061
4891
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4062
4892
|
IconButton,
|
|
4063
4893
|
{
|
|
4064
4894
|
variant: "surface",
|
|
4065
|
-
onClick: () =>
|
|
4066
|
-
disabled:
|
|
4895
|
+
onClick: () => pagination.fns.onSetPage(0),
|
|
4896
|
+
disabled: pagination.state.page === 0 || totalPages === 0,
|
|
4067
4897
|
"aria-label": "Go to first page",
|
|
4068
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4898
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiArrowLeftDoubleLine" })
|
|
4069
4899
|
}
|
|
4070
4900
|
),
|
|
4071
4901
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4072
4902
|
IconButton,
|
|
4073
4903
|
{
|
|
4074
4904
|
variant: "surface",
|
|
4075
|
-
disabled:
|
|
4076
|
-
onClick: () =>
|
|
4905
|
+
disabled: pagination.state.page === 0 || totalPages === 0,
|
|
4906
|
+
onClick: () => pagination.fns.onSetPage(pagination.state.page - 1),
|
|
4077
4907
|
"aria-label": "Previous page",
|
|
4078
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4908
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiArrowLeftSLine" })
|
|
4079
4909
|
}
|
|
4080
4910
|
),
|
|
4081
4911
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4082
4912
|
IconButton,
|
|
4083
4913
|
{
|
|
4084
4914
|
variant: "surface",
|
|
4085
|
-
disabled:
|
|
4086
|
-
onClick: () =>
|
|
4915
|
+
disabled: pagination.state.page + 1 === totalPages || totalPages === 0,
|
|
4916
|
+
onClick: () => pagination.fns.onSetPage(pagination.state.page + 1),
|
|
4087
4917
|
"aria-label": "Next page",
|
|
4088
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4918
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiArrowRightSLine" })
|
|
4089
4919
|
}
|
|
4090
4920
|
),
|
|
4091
4921
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4092
4922
|
IconButton,
|
|
4093
4923
|
{
|
|
4094
4924
|
variant: "surface",
|
|
4095
|
-
disabled:
|
|
4096
|
-
onClick: () =>
|
|
4925
|
+
disabled: pagination.state.page + 1 === totalPages || totalPages === 0,
|
|
4926
|
+
onClick: () => pagination.fns.onSetPage(totalPages - 1),
|
|
4097
4927
|
"aria-label": "Go to last page",
|
|
4098
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4928
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiArrowRightDoubleLine" })
|
|
4099
4929
|
}
|
|
4100
4930
|
)
|
|
4101
4931
|
] })
|
|
@@ -4221,7 +5051,7 @@
|
|
|
4221
5051
|
disabled: isConfirmDisabled,
|
|
4222
5052
|
onClick: onCheckClick,
|
|
4223
5053
|
"aria-label": "Confirm edit",
|
|
4224
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5054
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCheckLine" })
|
|
4225
5055
|
}
|
|
4226
5056
|
),
|
|
4227
5057
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4238,7 +5068,7 @@
|
|
|
4238
5068
|
severity,
|
|
4239
5069
|
onClick: onCancelClick,
|
|
4240
5070
|
"aria-label": "Cancel edit",
|
|
4241
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5071
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiCloseLargeLine" })
|
|
4242
5072
|
}
|
|
4243
5073
|
)
|
|
4244
5074
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4255,7 +5085,7 @@
|
|
|
4255
5085
|
severity,
|
|
4256
5086
|
onClick: onPencilClick,
|
|
4257
5087
|
"aria-label": "Edit text",
|
|
4258
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5088
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiPencilLine" })
|
|
4259
5089
|
}
|
|
4260
5090
|
))
|
|
4261
5091
|
] }) });
|
|
@@ -4286,6 +5116,7 @@
|
|
|
4286
5116
|
exports2.ButtonGroup = ButtonGroup;
|
|
4287
5117
|
exports2.ButtonList = ButtonList;
|
|
4288
5118
|
exports2.Checkbox = Checkbox;
|
|
5119
|
+
exports2.CollapsibleTree = CollapsibleTree;
|
|
4289
5120
|
exports2.ConfirmEditInput = ConfirmEditInput;
|
|
4290
5121
|
exports2.ContextActionMenu = ContextActionMenu;
|
|
4291
5122
|
exports2.ContextMenu = ContextMenu;
|
|
@@ -4293,6 +5124,11 @@
|
|
|
4293
5124
|
exports2.ContextSelectMenu = ContextSelectMenu;
|
|
4294
5125
|
exports2.DefaultTheme = DefaultTheme;
|
|
4295
5126
|
exports2.Dialog = Dialog;
|
|
5127
|
+
exports2.DialogCommandMenu = DialogCommandMenu;
|
|
5128
|
+
exports2.DialogMenu = DialogMenu;
|
|
5129
|
+
exports2.DialogMultiSelectMenu = DialogMultiSelectMenu;
|
|
5130
|
+
exports2.DialogSelectMenu = DialogSelectMenu;
|
|
5131
|
+
exports2.DownloadButtonUtility = DownloadButtonUtility;
|
|
4296
5132
|
exports2.DropdownItemMenu = DropdownItemMenu;
|
|
4297
5133
|
exports2.DropdownMenu = DropdownMenu;
|
|
4298
5134
|
exports2.DropdownMenuItemGroup = DropdownMenuItemGroup;
|
|
@@ -4311,22 +5147,28 @@
|
|
|
4311
5147
|
exports2.LeftAndRightPanels = LeftAndRightPanels;
|
|
4312
5148
|
exports2.MultiPagePopover = MultiPagePopover;
|
|
4313
5149
|
exports2.MultiSelect = MultiSelect;
|
|
5150
|
+
exports2.Overlay = Overlay$2;
|
|
4314
5151
|
exports2.OvermapErrorBoundary = OvermapErrorBoundary;
|
|
5152
|
+
exports2.OvermapInputItem = OvermapInputItem;
|
|
5153
|
+
exports2.OvermapItem = OvermapItem;
|
|
5154
|
+
exports2.OvermapItemGroup = OvermapItemGroup;
|
|
4315
5155
|
exports2.Popover = Popover;
|
|
5156
|
+
exports2.RiIcon = RiIcon;
|
|
4316
5157
|
exports2.Select = Select;
|
|
4317
5158
|
exports2.SelectAllCheckbox = SelectAllCheckbox;
|
|
4318
|
-
exports2.Separator = Separator;
|
|
5159
|
+
exports2.Separator = Separator$1;
|
|
4319
5160
|
exports2.Sidebar = Sidebar;
|
|
4320
5161
|
exports2.SlideOutV2 = SlideOutV2;
|
|
4321
5162
|
exports2.SlideOutV3 = SlideOutV3;
|
|
4322
5163
|
exports2.Spinner = Spinner;
|
|
4323
5164
|
exports2.Switch = Switch;
|
|
4324
5165
|
exports2.Table = Table;
|
|
4325
|
-
exports2.Text = Text
|
|
5166
|
+
exports2.Text = Text;
|
|
4326
5167
|
exports2.TextArea = TextArea;
|
|
4327
5168
|
exports2.Toast = Toast;
|
|
4328
5169
|
exports2.ToastContext = ToastContext;
|
|
4329
5170
|
exports2.ToastProvider = ToastProvider;
|
|
5171
|
+
exports2.ToggleButton = ToggleButton;
|
|
4330
5172
|
exports2.ToggleGroup = ToggleGroup;
|
|
4331
5173
|
exports2.Toolbar = Toolbar;
|
|
4332
5174
|
exports2.Tooltip = Tooltip;
|
|
@@ -4336,7 +5178,9 @@
|
|
|
4336
5178
|
exports2.useDiscardAlertDialog = useDiscardAlertDialog;
|
|
4337
5179
|
exports2.useKeyboardShortcut = useKeyboardShortcut;
|
|
4338
5180
|
exports2.useLayoutContext = useLayoutContext;
|
|
5181
|
+
exports2.useOvermapItemGroupContext = useOvermapItemGroupContext;
|
|
4339
5182
|
exports2.useSeverityColor = useSeverityColor;
|
|
5183
|
+
exports2.useSize = useSize;
|
|
4340
5184
|
exports2.useStopEventPropagation = useStopEventPropagation;
|
|
4341
5185
|
exports2.useTextFilter = useTextFilter;
|
|
4342
5186
|
exports2.useToast = useToast;
|