@datawheel/data-explorer 1.1.12 → 1.1.14
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/main.mjs +48 -28
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { keyframes, createStyles, Select, Center, Text, rem, Input, Box, Stack, Group, Button, SimpleGrid, Flex, ScrollArea, LoadingOverlay, Table, MultiSelect, NumberInput, Menu, ActionIcon, UnstyledButton, Loader, Container, Title, useMantineTheme, TextInput, CopyButton, Alert, MantineProvider, Modal, Space, useComponentDefaultProps, Paper, Anchor, Skeleton, Accordion, Tooltip, Tabs, Switch, ThemeIcon, CloseButton,
|
|
2
|
-
import { useClipboard, useDebouncedState,
|
|
1
|
+
import { keyframes, createStyles, Select, Center, Text, rem, Input, Box, Stack, Group, Button, SimpleGrid, Flex, ScrollArea, LoadingOverlay, Table, MultiSelect, NumberInput, Menu, ActionIcon, UnstyledButton, Loader, Container, Title, useMantineTheme, TextInput, CopyButton, Alert, MantineProvider, Modal, Space, useComponentDefaultProps, Paper, Anchor, Skeleton, Accordion, Tooltip, Tabs, Switch, ThemeIcon, CloseButton, Divider, Drawer, Checkbox, packSx, Popover } from '@mantine/core';
|
|
2
|
+
import { useClipboard, useDebouncedState, useMediaQuery, useFullscreen, useDisclosure } from '@mantine/hooks';
|
|
3
3
|
import { IconWorld, IconExternalLink, IconClipboard, IconSettings, IconMathGreater, IconMathLower, IconArrowsLeftRight, IconWorldWww, IconClipboardCheck, IconAlertCircle, IconAlertTriangle, IconCopy, IconDownload, IconDotsVertical, IconBox, IconArrowRight, IconArrowLeft, IconBrandGithub, IconCheck, IconShare, IconLanguage, IconTrash, IconInfoCircleFilled, IconX, IconChevronLeft, IconChevronRight, IconSearch, IconArrowsMinimize, IconArrowsMaximize, IconCircleOff, IconArrowsSort, IconSortDescendingNumbers, IconSortDescendingLetters, IconSortAscendingNumbers, IconSortAscendingLetters, IconPlus, IconStack3, IconFilterOff, IconFilter, IconAdjustments, IconClock, IconHelpCircle, IconPhotoDown, IconVectorTriangle } from '@tabler/icons-react';
|
|
4
4
|
import * as React13 from 'react';
|
|
5
5
|
import React13__default, { createContext, forwardRef, useMemo, useCallback, useContext, useRef, useEffect, useState, Suspense, Component, useLayoutEffect } from 'react';
|
|
@@ -2356,6 +2356,7 @@ function TableFooter(props) {
|
|
|
2356
2356
|
Box,
|
|
2357
2357
|
{
|
|
2358
2358
|
w: "100%",
|
|
2359
|
+
id: "dex-table-footer-container",
|
|
2359
2360
|
sx: (t2) => ({
|
|
2360
2361
|
flex: "0 0 70px",
|
|
2361
2362
|
maxWidth: "100vw",
|
|
@@ -3051,8 +3052,18 @@ function useTable({
|
|
|
3051
3052
|
align: { base: "flex-start", sm: "center" },
|
|
3052
3053
|
direction: { base: "column", sm: "row" }
|
|
3053
3054
|
},
|
|
3054
|
-
/* @__PURE__ */ React13__default.createElement(Box, { sx: { flexGrow: 1 }, w: { base: "100%", sm: "auto" } }, /* @__PURE__ */ React13__default.createElement(
|
|
3055
|
-
|
|
3055
|
+
/* @__PURE__ */ React13__default.createElement(Box, { sx: { flexGrow: 1 }, w: { base: "100%", sm: "auto" } }, /* @__PURE__ */ React13__default.createElement(
|
|
3056
|
+
Flex,
|
|
3057
|
+
{
|
|
3058
|
+
gap: { base: 0, sm: "xs" },
|
|
3059
|
+
align: "center",
|
|
3060
|
+
justify: { base: "flex-start", sm: "space-between" }
|
|
3061
|
+
},
|
|
3062
|
+
getActionIcon(entityType),
|
|
3063
|
+
/* @__PURE__ */ React13__default.createElement(Text, { size: "sm" }, header),
|
|
3064
|
+
!isMobile && /* @__PURE__ */ React13__default.createElement(Box, { ml: "auto" }, actionSort)
|
|
3065
|
+
)),
|
|
3066
|
+
/* @__PURE__ */ React13__default.createElement(Group, { position: "apart", w: { base: "100%", sm: "auto" } }, isMobile && actionSort, showTrashIcon(finalKeys, entityType) && /* @__PURE__ */ React13__default.createElement(
|
|
3056
3067
|
CustomActionIcon_default,
|
|
3057
3068
|
{
|
|
3058
3069
|
label: `At least one ${getEntityText(entityType)} is required.`,
|
|
@@ -3432,7 +3443,7 @@ var MultiFilter = ({ header }) => {
|
|
|
3432
3443
|
);
|
|
3433
3444
|
const query = useSelector$1(selectCurrentQueryItem);
|
|
3434
3445
|
if (!drilldown || !cut) return null;
|
|
3435
|
-
return /* @__PURE__ */ React13__default.createElement(Box, { pt: "
|
|
3446
|
+
return /* @__PURE__ */ React13__default.createElement(Box, { pt: "sm", style: { fontWeight: "normal" } }, /* @__PURE__ */ React13__default.createElement(
|
|
3436
3447
|
MultiSelect,
|
|
3437
3448
|
{
|
|
3438
3449
|
sx: { flex: "1 1 100%" },
|
|
@@ -4554,7 +4565,16 @@ function useCubeSearch(graph, input, locale) {
|
|
|
4554
4565
|
var [useSideBar, Provider] = createContext4("SideBar");
|
|
4555
4566
|
function SideBarProvider(props) {
|
|
4556
4567
|
const [input, setInput] = useDebouncedState("", 150, { leading: true });
|
|
4557
|
-
const
|
|
4568
|
+
const theme = useMantineTheme();
|
|
4569
|
+
const isSmallScreen = useMediaQuery(
|
|
4570
|
+
`(max-width: ${theme.breakpoints.md}${/(?:px|em|rem|vh|vw|%)$/.test(theme.breakpoints.md) ? "" : "px"})`,
|
|
4571
|
+
true
|
|
4572
|
+
// Default to 'true' when undefined (assuming small screen to be safe)
|
|
4573
|
+
);
|
|
4574
|
+
const [expanded, setExpanded] = useState(false);
|
|
4575
|
+
useEffect(() => {
|
|
4576
|
+
setExpanded(!isSmallScreen);
|
|
4577
|
+
}, [isSmallScreen]);
|
|
4558
4578
|
const graph = useBuildGraph(props.locale);
|
|
4559
4579
|
const { results, map } = useCubeSearch(graph, input, props.locale);
|
|
4560
4580
|
return /* @__PURE__ */ React13__default.createElement(
|
|
@@ -4621,6 +4641,10 @@ function SideBar(props) {
|
|
|
4621
4641
|
paddingTop: expanded ? t2.spacing.md : 0,
|
|
4622
4642
|
paddingBottom: expanded ? t2.spacing.md : 0,
|
|
4623
4643
|
borderRadius: expanded ? 0 : "100%"
|
|
4644
|
+
},
|
|
4645
|
+
[t2.fn.smallerThan("sm")]: {
|
|
4646
|
+
width: expanded ? "100vw" : 0,
|
|
4647
|
+
maxWidth: expanded ? "100vw" : 0
|
|
4624
4648
|
}
|
|
4625
4649
|
})
|
|
4626
4650
|
},
|
|
@@ -4630,12 +4654,16 @@ function SideBar(props) {
|
|
|
4630
4654
|
position: "apart",
|
|
4631
4655
|
align: "center",
|
|
4632
4656
|
noWrap: true,
|
|
4633
|
-
sx: {
|
|
4657
|
+
sx: (t2) => ({
|
|
4634
4658
|
overflow: "hidden",
|
|
4635
4659
|
whiteSpace: "nowrap",
|
|
4636
4660
|
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4637
|
-
width: expanded ? 300 : 0
|
|
4638
|
-
|
|
4661
|
+
width: expanded ? 300 : 0,
|
|
4662
|
+
[t2.fn.smallerThan("sm")]: {
|
|
4663
|
+
width: expanded ? "100vw" : 0,
|
|
4664
|
+
maxWidth: expanded ? "100vw" : 0
|
|
4665
|
+
}
|
|
4666
|
+
})
|
|
4639
4667
|
},
|
|
4640
4668
|
/* @__PURE__ */ React13__default.createElement(Text, { sx: (t2) => ({ color: t2.colorScheme === "dark" ? t2.white : t2.black }), ml: "sm" }, t("params.label_dataset")),
|
|
4641
4669
|
/* @__PURE__ */ React13__default.createElement(
|
|
@@ -4681,12 +4709,16 @@ function SideBarItem(props) {
|
|
|
4681
4709
|
return /* @__PURE__ */ React13__default.createElement(
|
|
4682
4710
|
Box,
|
|
4683
4711
|
{
|
|
4684
|
-
sx: {
|
|
4712
|
+
sx: (t) => ({
|
|
4685
4713
|
overflow: "hidden",
|
|
4686
4714
|
whiteSpace: "nowrap",
|
|
4687
4715
|
width: expanded ? 300 : 0,
|
|
4688
|
-
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
4689
|
-
|
|
4716
|
+
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4717
|
+
[t.fn.smallerThan("sm")]: {
|
|
4718
|
+
width: expanded ? "100vw" : 0,
|
|
4719
|
+
maxWidth: expanded ? "100vw" : 0
|
|
4720
|
+
}
|
|
4721
|
+
})
|
|
4690
4722
|
},
|
|
4691
4723
|
props.children
|
|
4692
4724
|
);
|
|
@@ -4734,22 +4766,10 @@ function CubeSearchInput(props) {
|
|
|
4734
4766
|
}
|
|
4735
4767
|
|
|
4736
4768
|
// src/components/ExplorerResults.tsx
|
|
4737
|
-
function SideBarControlBtn2(
|
|
4769
|
+
function SideBarControlBtn2() {
|
|
4738
4770
|
const { expanded, setExpanded } = useSideBar();
|
|
4739
|
-
const
|
|
4740
|
-
|
|
4741
|
-
color: t.colorScheme === "dark" ? t.white : t.colors.gray[7]
|
|
4742
|
-
});
|
|
4743
|
-
return /* @__PURE__ */ React13__default.createElement(Group, { spacing: "xs", display: { base: "flex", md: "none" }, align: "center" }, /* @__PURE__ */ React13__default.createElement(
|
|
4744
|
-
ActionIcon,
|
|
4745
|
-
{
|
|
4746
|
-
onClick: () => setExpanded(!expanded),
|
|
4747
|
-
variant: "subtle",
|
|
4748
|
-
...actionIconProps,
|
|
4749
|
-
sx: [sx, ...packSx(actionIconProps.sx)]
|
|
4750
|
-
},
|
|
4751
|
-
/* @__PURE__ */ React13__default.createElement(DataSetSVG, null)
|
|
4752
|
-
), /* @__PURE__ */ React13__default.createElement(Text, { size: "sm" }, "Select Dataset"));
|
|
4771
|
+
const { translate: t } = useTranslation();
|
|
4772
|
+
return /* @__PURE__ */ React13__default.createElement(UnstyledButton, { display: { base: "block", md: "none" }, onClick: () => setExpanded(!expanded) }, /* @__PURE__ */ React13__default.createElement(Group, { align: "center", spacing: "xs", noWrap: true }, /* @__PURE__ */ React13__default.createElement(ThemeIcon, { variant: "subtle" }, /* @__PURE__ */ React13__default.createElement(DataSetSVG, null)), /* @__PURE__ */ React13__default.createElement(Text, { size: "sm" }, t("params.label_dataset"))));
|
|
4753
4773
|
}
|
|
4754
4774
|
var useStyles2 = createStyles(() => ({
|
|
4755
4775
|
container: {
|
|
@@ -5206,7 +5226,7 @@ function SubtopicAccordion({
|
|
|
5206
5226
|
onChange: setValue,
|
|
5207
5227
|
key: `subtopic-${parent}`,
|
|
5208
5228
|
chevronPosition: "left",
|
|
5209
|
-
w: 300,
|
|
5229
|
+
w: { base: "100vw", sm: 300 },
|
|
5210
5230
|
ml: 0,
|
|
5211
5231
|
styles: (t) => ({
|
|
5212
5232
|
control: {
|