@datawheel/data-explorer 1.1.12 → 1.1.13
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 +35 -25
- 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",
|
|
@@ -4554,7 +4555,16 @@ function useCubeSearch(graph, input, locale) {
|
|
|
4554
4555
|
var [useSideBar, Provider] = createContext4("SideBar");
|
|
4555
4556
|
function SideBarProvider(props) {
|
|
4556
4557
|
const [input, setInput] = useDebouncedState("", 150, { leading: true });
|
|
4557
|
-
const
|
|
4558
|
+
const theme = useMantineTheme();
|
|
4559
|
+
const isSmallScreen = useMediaQuery(
|
|
4560
|
+
`(max-width: ${theme.breakpoints.md}${/(?:px|em|rem|vh|vw|%)$/.test(theme.breakpoints.md) ? "" : "px"})`,
|
|
4561
|
+
true
|
|
4562
|
+
// Default to 'true' when undefined (assuming small screen to be safe)
|
|
4563
|
+
);
|
|
4564
|
+
const [expanded, setExpanded] = useState(false);
|
|
4565
|
+
useEffect(() => {
|
|
4566
|
+
setExpanded(!isSmallScreen);
|
|
4567
|
+
}, [isSmallScreen]);
|
|
4558
4568
|
const graph = useBuildGraph(props.locale);
|
|
4559
4569
|
const { results, map } = useCubeSearch(graph, input, props.locale);
|
|
4560
4570
|
return /* @__PURE__ */ React13__default.createElement(
|
|
@@ -4621,6 +4631,10 @@ function SideBar(props) {
|
|
|
4621
4631
|
paddingTop: expanded ? t2.spacing.md : 0,
|
|
4622
4632
|
paddingBottom: expanded ? t2.spacing.md : 0,
|
|
4623
4633
|
borderRadius: expanded ? 0 : "100%"
|
|
4634
|
+
},
|
|
4635
|
+
[t2.fn.smallerThan("sm")]: {
|
|
4636
|
+
width: expanded ? "100vw" : 0,
|
|
4637
|
+
maxWidth: expanded ? "100vw" : 0
|
|
4624
4638
|
}
|
|
4625
4639
|
})
|
|
4626
4640
|
},
|
|
@@ -4630,12 +4644,16 @@ function SideBar(props) {
|
|
|
4630
4644
|
position: "apart",
|
|
4631
4645
|
align: "center",
|
|
4632
4646
|
noWrap: true,
|
|
4633
|
-
sx: {
|
|
4647
|
+
sx: (t2) => ({
|
|
4634
4648
|
overflow: "hidden",
|
|
4635
4649
|
whiteSpace: "nowrap",
|
|
4636
4650
|
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
|
-
|
|
4651
|
+
width: expanded ? 300 : 0,
|
|
4652
|
+
[t2.fn.smallerThan("sm")]: {
|
|
4653
|
+
width: expanded ? "100vw" : 0,
|
|
4654
|
+
maxWidth: expanded ? "100vw" : 0
|
|
4655
|
+
}
|
|
4656
|
+
})
|
|
4639
4657
|
},
|
|
4640
4658
|
/* @__PURE__ */ React13__default.createElement(Text, { sx: (t2) => ({ color: t2.colorScheme === "dark" ? t2.white : t2.black }), ml: "sm" }, t("params.label_dataset")),
|
|
4641
4659
|
/* @__PURE__ */ React13__default.createElement(
|
|
@@ -4681,12 +4699,16 @@ function SideBarItem(props) {
|
|
|
4681
4699
|
return /* @__PURE__ */ React13__default.createElement(
|
|
4682
4700
|
Box,
|
|
4683
4701
|
{
|
|
4684
|
-
sx: {
|
|
4702
|
+
sx: (t) => ({
|
|
4685
4703
|
overflow: "hidden",
|
|
4686
4704
|
whiteSpace: "nowrap",
|
|
4687
4705
|
width: expanded ? 300 : 0,
|
|
4688
|
-
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
4689
|
-
|
|
4706
|
+
transition: "width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4707
|
+
[t.fn.smallerThan("sm")]: {
|
|
4708
|
+
width: expanded ? "100vw" : 0,
|
|
4709
|
+
maxWidth: expanded ? "100vw" : 0
|
|
4710
|
+
}
|
|
4711
|
+
})
|
|
4690
4712
|
},
|
|
4691
4713
|
props.children
|
|
4692
4714
|
);
|
|
@@ -4734,22 +4756,10 @@ function CubeSearchInput(props) {
|
|
|
4734
4756
|
}
|
|
4735
4757
|
|
|
4736
4758
|
// src/components/ExplorerResults.tsx
|
|
4737
|
-
function SideBarControlBtn2(
|
|
4759
|
+
function SideBarControlBtn2() {
|
|
4738
4760
|
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"));
|
|
4761
|
+
const { translate: t } = useTranslation();
|
|
4762
|
+
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
4763
|
}
|
|
4754
4764
|
var useStyles2 = createStyles(() => ({
|
|
4755
4765
|
container: {
|
|
@@ -5206,7 +5216,7 @@ function SubtopicAccordion({
|
|
|
5206
5216
|
onChange: setValue,
|
|
5207
5217
|
key: `subtopic-${parent}`,
|
|
5208
5218
|
chevronPosition: "left",
|
|
5209
|
-
w: 300,
|
|
5219
|
+
w: { base: "100vw", sm: 300 },
|
|
5210
5220
|
ml: 0,
|
|
5211
5221
|
styles: (t) => ({
|
|
5212
5222
|
control: {
|