@vertigis/react-ui 9.13.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/index.d.ts +3 -0
- package/AdapterDateFns/index.js +3 -0
- package/AdapterLuxon/index.d.ts +3 -0
- package/AdapterLuxon/index.js +3 -0
- package/AdapterMoment/index.d.ts +3 -0
- package/AdapterMoment/index.js +3 -0
- package/Checkbox/Checkbox.d.ts +3 -2
- package/ColorInput/ColorInput.d.ts +57 -0
- package/ColorInput/ColorInput.js +122 -0
- package/ColorInput/index.d.ts +2 -0
- package/ColorInput/index.js +2 -0
- package/CopyableText/CopyableText.d.ts +35 -0
- package/CopyableText/CopyableText.js +80 -0
- package/CopyableText/index.d.ts +2 -0
- package/CopyableText/index.js +2 -0
- package/DataGrid/index.d.ts +1 -0
- package/DataGrid/index.js +1 -0
- package/DatePicker/index.d.ts +3 -0
- package/DatePicker/index.js +3 -0
- package/DateRangePicker/index.d.ts +3 -0
- package/DateRangePicker/index.js +3 -0
- package/DateTimePicker/index.d.ts +3 -0
- package/DateTimePicker/index.js +3 -0
- package/FormControl/FormControl.d.ts +42 -0
- package/FormControl/FormControl.js +30 -0
- package/FormControl/index.d.ts +2 -2
- package/FormControl/index.js +2 -2
- package/FormLabel/FormLabel.d.ts +1 -1
- package/FormLabel/FormLabel.js +2 -2
- package/FormLabelTextField/FormLabelTextField.d.ts +15 -0
- package/FormLabelTextField/FormLabelTextField.js +34 -0
- package/FormLabelTextField/index.d.ts +2 -0
- package/FormLabelTextField/index.js +2 -0
- package/IconButton/IconButton.d.ts +1 -1
- package/IconMenu/IconMenu.d.ts +37 -0
- package/IconMenu/IconMenu.js +21 -0
- package/IconMenu/index.d.ts +2 -0
- package/IconMenu/index.js +2 -0
- package/InlineFormControl/InlineFormControl.d.ts +38 -0
- package/InlineFormControl/InlineFormControl.js +44 -0
- package/InlineFormControl/index.d.ts +2 -0
- package/InlineFormControl/index.js +2 -0
- package/InlineHelp/InlineHelp.d.ts +48 -0
- package/InlineHelp/InlineHelp.js +41 -0
- package/InlineHelp/index.d.ts +2 -0
- package/InlineHelp/index.js +2 -0
- package/LicenseInfo/index.d.ts +1 -0
- package/LicenseInfo/index.js +1 -0
- package/LicenseInfo/index.ts +1 -0
- package/Link/Link.d.ts +4 -7
- package/Link/Link.js +2 -3
- package/Loader/Loader.d.ts +33 -0
- package/Loader/Loader.js +75 -0
- package/Loader/index.d.ts +2 -0
- package/Loader/index.js +2 -0
- package/LocalizationProvider/index.d.ts +3 -0
- package/LocalizationProvider/index.js +3 -0
- package/Markdown/Markdown.d.ts +9 -10
- package/Markdown/Markdown.js +2 -1
- package/MenuItemSecondaryAction/MenuItemSecondaryAction.d.ts +2 -2
- package/MenuItemSecondaryAction/MenuItemSecondaryAction.js +4 -5
- package/Radio/Radio.d.ts +3 -2
- package/Switch/Switch.d.ts +1 -1
- package/Tab/Tab.d.ts +3 -3
- package/Tab/Tab.js +1 -1
- package/TableCell/TableCell.d.ts +1 -1
- package/Tabs/Tabs.d.ts +1 -1
- package/Tabs/Tabs.js +1 -1
- package/TimePicker/index.d.ts +3 -0
- package/TimePicker/index.js +3 -0
- package/ToggleButton/ToggleButton.d.ts +1 -1
- package/colors/blue.d.ts +1 -1
- package/colors/burntOrange.d.ts +1 -1
- package/colors/darkBurntOrange.d.ts +1 -1
- package/colors/darkRed.d.ts +1 -1
- package/colors/green.d.ts +1 -1
- package/colors/grey.d.ts +1 -1
- package/colors/orange.d.ts +1 -1
- package/colors/purple.d.ts +1 -1
- package/colors/red.d.ts +1 -1
- package/colors/teal.d.ts +1 -1
- package/colors/woodlandGreen.d.ts +1 -1
- package/icons/BufferIdentify.js +2 -2
- package/icons/BufferMeasure.js +2 -2
- package/icons/BufferShape.js +2 -2
- package/icons/SwapView.d.ts +4 -0
- package/icons/SwapView.js +3 -0
- package/icons/ViewSwitchList.js +2 -2
- package/icons/ViewSwitchTable.js +2 -2
- package/icons/index.d.ts +1 -0
- package/icons/index.js +1 -0
- package/icons/utils/createSvgIcon.d.ts +5 -4
- package/icons/utils/createSvgIcon.js +4 -3
- package/package.json +14 -5
- package/styles/CacheProvider.d.ts +1 -1
- package/styles/createTheme.js +27 -3
- package/styles/index.js +1 -1
- package/styles/themeAugmentation.d.ts +22 -0
- package/utils/color.d.ts +11 -0
- package/utils/color.js +39 -0
- package/utils/generateId.d.ts +1 -0
- package/utils/generateId.js +1 -0
- package/utils/html.d.ts +16 -0
- package/utils/html.js +105 -0
- package/utils/intl.d.ts +9 -6
- package/utils/intl.js +9 -6
- package/utils/markdown.d.ts +11 -3
- package/utils/markdown.js +11 -1
- package/utils/react.d.ts +15 -0
- package/utils/react.js +42 -0
- package/utils/url.d.ts +19 -0
- package/utils/url.js +74 -0
- package/CircularProgress/CircularProgress.d.ts +0 -2
- package/CircularProgress/CircularProgress.js +0 -2
package/Tabs/Tabs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import MUITabs, { tabsClasses as muiTabsClasses
|
|
2
|
+
import MUITabs, { tabsClasses as muiTabsClasses } from "@mui/material/Tabs";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { mergeStyles, styled } from "../styles/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonBaseClasses } from "@mui/material/ButtonBase";
|
|
2
2
|
import type { OverridableComponent } from "@mui/material/OverridableComponent";
|
|
3
|
-
import { ToggleButtonProps as MUIToggleButtonProps, ToggleButtonClasses as MUIToggleButtonClasses } from "@mui/material/ToggleButton";
|
|
3
|
+
import type { ToggleButtonProps as MUIToggleButtonProps, ToggleButtonClasses as MUIToggleButtonClasses } from "@mui/material/ToggleButton";
|
|
4
4
|
export * from "@mui/material/ToggleButton";
|
|
5
5
|
export interface ToggleButtonClasses extends MUIToggleButtonClasses, ButtonBaseClasses {
|
|
6
6
|
}
|
package/colors/blue.d.ts
CHANGED
package/colors/burntOrange.d.ts
CHANGED
package/colors/darkRed.d.ts
CHANGED
package/colors/green.d.ts
CHANGED
package/colors/grey.d.ts
CHANGED
package/colors/orange.d.ts
CHANGED
package/colors/purple.d.ts
CHANGED
package/colors/red.d.ts
CHANGED
package/colors/teal.d.ts
CHANGED
package/icons/BufferIdentify.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import createSvgIcon from "./utils/createSvgIcon.js";
|
|
3
|
-
export default createSvgIcon(
|
|
3
|
+
export default createSvgIcon(_jsx("g", { children: _jsx("path", { d: "M9.7 21l1.4-1.4c0-.5-.1-.9 0-1.4l-2.6 2.6c-.6-.2-1.1-.5-1.6-.9L9.8 17h1.3c0-.3.1-.7.2-1h-1.1L6 11.8V6h5.8l4.2 4.2v1.1c.3-.1.7-.2 1-.2V9.8l2.9-2.9c.4.5.7 1.1.9 1.6L18.3 11c.4 0 .8.1 1.2.2L21 9.7v2c.4.2.7.4 1 .6V10c0-1.6-.6-3.1-1.8-4.2l-4-4C15.1.6 13.6 0 12 0H6C2.7 0 0 2.7 0 6v6c0 1.6.6 3.1 1.8 4.2l4 4C6.9 21.4 8.4 22 10 22h2.3c-.3-.3-.5-.6-.6-1h-2zM1 9.7l4-4v2.6l-4 4V9.7zm6 4.5l-2.9 2.9-1.3-1.3 2.9-2.9L7 14.2zM9.7 5l3.8-3.8c.6.2 1.2.5 1.7.9l-3 2.9H9.7zm6.6 4.1L15 7.8l3-2.9 1.3 1.3-3 2.9zm-.35-6.25L17.2 4.1l-3 2.9L13 5.8l2.95-2.95zM12.3 1l-4 4H5.7l4-4h2.6zm-4 0L1 8.3V5.7L5.7 1h2.6zm-4.5.5L1.5 3.8C2 2.8 2.8 2 3.8 1.5zm-2.6 12L5 9.7v2.5l-2.9 2.9c-.4-.5-.7-1.1-.9-1.6zm3.7 4.3L7.8 15 9 16.2l-2.9 2.9-1.2-1.3zM18 12c-3.3 0-6 2.7-6 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm1 10h-2v-5h2v5zm0-6h-2v-2h2v2z" }, void 0) }, void 0), 'BufferIdentify');
|
package/icons/BufferMeasure.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import createSvgIcon from "./utils/createSvgIcon.js";
|
|
3
|
-
export default createSvgIcon(
|
|
3
|
+
export default createSvgIcon(_jsx("g", { children: _jsx("path", { d: "M17.7 17l3.3-3.3v2.6l-.7.7h1.6c.2-.49.07-6.34.1-7 0-1.6-.6-3.1-1.8-4.3l-4-4C15.1.6 13.6 0 12 0H6C2.7 0 0 2.7 0 6v6c0 1.6.6 3.1 1.8 4.2L6 20.4V19l-1.1-1.1L7.8 15 9 16.2l-.7.8h9.4zM16 16h-5.8L6 11.8V6h5.8l4.2 4.2V16zM12.2 5H9.7l3.8-3.8c.6.2 1.2.5 1.7.9l-3 2.9zM15 7.8l2.9-2.9 1.3 1.3-2.9 2.9L15 7.8zm6 4.5l-4 4v-2.6l4-4v2.6zm-.2-3.8L17 12.3V9.8l2.9-2.9c.4.5.7 1 .9 1.6zm-3.7-4.4L14.2 7 13 5.8l2.9-2.9 1.2 1.2zM12 1h.3l-4 4H5.7l4-4H12zM1 9.7l4-4v2.6l-4 4V9.7zM8.3 1L1 8.3V5.7L5.7 1h2.6zm-4.5.5L1.5 3.8C2 2.8 2.8 2 3.8 1.5zm-2.6 12L5 9.7v2.5l.1.1-2.9 2.9c-.4-.5-.8-1.1-1-1.7zm1.7 2.4L5.8 13l1.3 1.3-2.9 2.9-1.3-1.3zM7 18v6h17v-6H7zm16 5H8v-4h1v2h1v-2h1v3h1v-3h1v2h1v-2h1v3h1v-3h1v2h1v-2h1v3h1v-3h1v2h1v-2h1v4z" }, void 0) }, void 0), 'BufferMeasure');
|
package/icons/BufferShape.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import createSvgIcon from "./utils/createSvgIcon.js";
|
|
3
|
-
export default createSvgIcon(
|
|
3
|
+
export default createSvgIcon(_jsx("g", { children: _jsx("path", { d: "M21.2 6.7l-4-4C16.1 1.6 14.6 1 13 1H7C3.7 1 1 3.7 1 7c.04 9.41-.91 7.53 5.8 14.2C7.9 22.4 9.4 23 11 23h6c3.3 0 6-2.7 6-6v-6c0-1.6-.6-3.1-1.8-4.3zm.6 2.8L18 13.3v-2.5l2.9-2.9c.4.5.7 1.1.9 1.6zm-1.6-2.3l-3 2.8L16 8.8l2.9-2.9 1.3 1.3zm-3.2 4V17h-5.8L7 12.8V7h5.8l4.2 4.2zm1.2-6l-3 2.8L14 6.8l2.9-2.9 1.3 1.3zm-2.1-2L13.2 6h-2.5l3.8-3.8c.6.2 1.1.5 1.6 1zM13.3 2l-4 4H6.7l4-4h2.6zm-8.5.5L2.5 4.8C3 3.8 3.8 3 4.8 2.5zM2 6.7L6.7 2h2.6L2 9.3V6.7zm0 4l4-4v2.6l-4 4v-2.6zm.2 3.8L6 10.7v2.5l.1.1-2.9 2.9c-.4-.5-.8-1.1-1-1.7zm1.7 2.4L6.8 14l1.3 1.3-2.9 2.9-1.3-1.3zm2 2L8.8 16l1.3 1.3-2.9 2.9-1.3-1.3zm2.1 2l2.9-2.9h2.4l-3.8 3.8c-.5-.2-1.1-.5-1.5-.9zm3 1.1h-.3l4-4h2.6l-4 4H11zm8.2-.5l2.2-2.2c-.4.9-1.2 1.7-2.2 2.2zm2.8-4.3L17.3 22h-2.6l7.3-7.3v2.5zm0-3.9l-4 4v-2.6l4-4v2.6z" }, void 0) }, void 0), 'BufferShape');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import createSvgIcon from "./utils/createSvgIcon.js";
|
|
3
|
+
export default createSvgIcon(_jsx("g", { children: _jsx("path", { d: "M13 12l-3-3v2H3v2h7v2l3-3zm9-11H2C.9 1 0 1.9 0 3v14c0 1.1.9 2 2 2h7.5v2H8v1h8v-1h-1.5v-2H22c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm-8 2v2h7v2h-7v2l-3-3 3-3zM2 16c-.5 0-1-.5-1-1V3c0-.5.5-1 1-1h2l16 14H2zm19.5 2c-.3 0-.5-.2-.5-.5s.2-.5.5-.5.5.2.5.5-.2.5-.5.5z" }, void 0) }, void 0), 'SwapView');
|
package/icons/ViewSwitchList.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import createSvgIcon from "./utils/createSvgIcon.js";
|
|
3
|
-
export default createSvgIcon(
|
|
3
|
+
export default createSvgIcon(_jsx("g", { children: _jsx("path", { d: "M7 10v1H6v-1h1m0-1H6c-.6 0-1 .4-1 1v1c0 .6.4 1 1 1h1c.6 0 1-.4 1-1v-1c0-.6-.4-1-1-1zm0 6v1H6v-1h1m0-1H6c-.6 0-1 .4-1 1v1c0 .6.4 1 1 1h1c.6 0 1-.4 1-1v-1c0-.6-.4-1-1-1zm0 6v1H6v-1h1m0-1H6c-.6 0-1 .4-1 1v1c0 .6.4 1 1 1h1c.6 0 1-.4 1-1v-1c0-.6-.4-1-1-1zm-5-3H1v-3h1v-1H1V9h1V8H1V5h4v1h1V5h4v1h1V5h4v1h1V5h4v1h1V1c0-.6-.4-1-1-1H1C.4 0 0 .4 0 1v15c0 .6.4 1 1 1h1v-1zM16 1h4v3h-4V1zm-5 0h4v3h-4V1zM6 1h4v3H6V1zM1 1h4v3H1V1zm22 7v15H4V8h19m0-1H4c-.6 0-1 .4-1 1v15c0 .6.4 1 1 1h19c.6 0 1-.4 1-1V8c0-.6-.4-1-1-1zm-4 4H9v-1h10v1zm2 5H9v-1h12v1zm-3 5H9v-1h9v1z" }, void 0) }, void 0), 'ViewSwitchList');
|
package/icons/ViewSwitchTable.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import createSvgIcon from "./utils/createSvgIcon.js";
|
|
3
|
-
export default createSvgIcon(
|
|
3
|
+
export default createSvgIcon(_jsx("g", { children: _jsx("path", { d: "M23 7H4c-.6 0-1 .4-1 1v15c0 .6.4 1 1 1h19c.6 0 1-.4 1-1V8c0-.6-.4-1-1-1zM8 23H4v-3h4v3zm0-4H4v-3h4v3zm0-4H4v-3h4v3zm-4-4V8h4v3H4zm9 12H9v-3h4v3zm0-4H9v-3h4v3zm0-4H9v-3h4v3zm-4-4V8h4v3H9zm9 12h-4v-3h4v3zm0-4h-4v-3h4v3zm0-4h-4v-3h4v3zm-4-4V8h4v3h-4zm9 12h-4v-3h4v3zm0-4h-4v-3h4v3zm0-4h-4v-3h4v3zm0-4h-4V8h4v3zM4 5c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1H3c-.6 0-1 .4-1 1v1c0 .6.4 1 1 1h1zM3 3h1v1H3V3zM1 1h19v5h1V1c0-.6-.4-1-1-1H1C.4 0 0 .4 0 1v15c0 .6.4 1 1 1h1v-1H1V1zm5 2h10v1H6V3z" }, void 0) }, void 0), 'ViewSwitchTable');
|
package/icons/index.d.ts
CHANGED
|
@@ -588,6 +588,7 @@ export { default as Subtract } from "./Subtract.js";
|
|
|
588
588
|
export { default as Success } from "./Success.js";
|
|
589
589
|
export { default as Survey } from "./Survey.js";
|
|
590
590
|
export { default as Suspend } from "./Suspend.js";
|
|
591
|
+
export { default as SwapView } from "./SwapView.js";
|
|
591
592
|
export { default as SwatchPicker } from "./SwatchPicker.js";
|
|
592
593
|
export { default as SweepingEdit } from "./SweepingEdit.js";
|
|
593
594
|
export { default as SweepingGlobal } from "./SweepingGlobal.js";
|
package/icons/index.js
CHANGED
|
@@ -588,6 +588,7 @@ export { default as Subtract } from "./Subtract.js";
|
|
|
588
588
|
export { default as Success } from "./Success.js";
|
|
589
589
|
export { default as Survey } from "./Survey.js";
|
|
590
590
|
export { default as Suspend } from "./Suspend.js";
|
|
591
|
+
export { default as SwapView } from "./SwapView.js";
|
|
591
592
|
export { default as SwatchPicker } from "./SwatchPicker.js";
|
|
592
593
|
export { default as SweepingEdit } from "./SweepingEdit.js";
|
|
593
594
|
export { default as SweepingGlobal } from "./SweepingGlobal.js";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import SvgIcon from "@mui/material/SvgIcon";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Creates an SVG icon component from a <path>.
|
|
5
|
+
*
|
|
5
6
|
* @param path The React component representing the inner path of the SVG.
|
|
6
7
|
* @param displayName The display name.
|
|
7
8
|
* @param mirror Whether or not to mirror the icon in RTL mode. By default it
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* icons should be mirrored.
|
|
9
|
+
* will mirror anything with "Left" or "Right" in the display name, as well as
|
|
10
|
+
* some built-in icons. See the Material UI guidelines for a discussion of
|
|
11
|
+
* which icons should be mirrored.
|
|
11
12
|
*/
|
|
12
13
|
export default function createSvgIcon(path: ReactNode, displayName: string, mirror?: boolean): typeof SvgIcon;
|
|
@@ -10,12 +10,13 @@ const gcxSvgIconClasses = {
|
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Creates an SVG icon component from a <path>.
|
|
13
|
+
*
|
|
13
14
|
* @param path The React component representing the inner path of the SVG.
|
|
14
15
|
* @param displayName The display name.
|
|
15
16
|
* @param mirror Whether or not to mirror the icon in RTL mode. By default it
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* icons should be mirrored.
|
|
17
|
+
* will mirror anything with "Left" or "Right" in the display name, as well as
|
|
18
|
+
* some built-in icons. See the Material UI guidelines for a discussion of
|
|
19
|
+
* which icons should be mirrored.
|
|
19
20
|
*/
|
|
20
21
|
export default function createSvgIcon(path, displayName, mirror) {
|
|
21
22
|
const Icon = baseCreateSvgIcon(path, displayName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertigis/react-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Utilities and React components used in VertiGIS applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vertigis",
|
|
@@ -15,24 +15,33 @@
|
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"scripts": {},
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@esri/arcgis-html-sanitizer": "^2.10.0",
|
|
18
19
|
"@emotion/cache": "^11.7.1",
|
|
19
20
|
"@emotion/react": "^11.8.2",
|
|
20
21
|
"@emotion/styled": "^11.8.1",
|
|
21
|
-
"@mui/icons-material": "5.
|
|
22
|
-
"@mui/
|
|
22
|
+
"@mui/icons-material": "5.8.4",
|
|
23
|
+
"@mui/x-date-pickers-pro": "5.0.0-alpha.7",
|
|
24
|
+
"@mui/x-data-grid-pro": "5.13.0",
|
|
25
|
+
"@mui/material": "5.9.0",
|
|
23
26
|
"clsx": "^1.1.1",
|
|
27
|
+
"color": "^3.1.3",
|
|
24
28
|
"lodash.escape": "^4.0.1",
|
|
25
29
|
"lodash.merge": "^4.6.2",
|
|
26
30
|
"marked": "^4.0.12",
|
|
27
|
-
"
|
|
31
|
+
"react-color": "^2.19.3",
|
|
32
|
+
"tslib": "^2.1.0",
|
|
33
|
+
"xss": "^1.0.13"
|
|
28
34
|
},
|
|
29
35
|
"devDependencies": {
|
|
30
|
-
"@geocortex/icons": "5.0.
|
|
36
|
+
"@geocortex/icons": "5.0.457",
|
|
31
37
|
"@testing-library/react": "^12.1.2",
|
|
32
38
|
"@testing-library/user-event": "^13.5.0",
|
|
39
|
+
"@types/color": "^3.0.1",
|
|
40
|
+
"@types/lodash.escape": "^4.0.1",
|
|
33
41
|
"@types/lodash.merge": "^4.6.7",
|
|
34
42
|
"@types/marked": "^4.0.2",
|
|
35
43
|
"@types/react": "^17.0.34",
|
|
44
|
+
"@types/react-color": "^3.0.6",
|
|
36
45
|
"@types/react-dom": "^17.0.11",
|
|
37
46
|
"react": "^17.0.2",
|
|
38
47
|
"react-dom": "^17.0.2"
|
package/styles/createTheme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alpha, createTheme as createMuiTheme
|
|
1
|
+
import { alpha, createTheme as createMuiTheme } from "@mui/material/styles";
|
|
2
2
|
import merge from "lodash.merge";
|
|
3
3
|
import blue from "../colors/blue.js";
|
|
4
4
|
import common from "../colors/common.js";
|
|
@@ -137,8 +137,8 @@ const getMenuItemStyles = ({ palette, transitions }) => ({
|
|
|
137
137
|
},
|
|
138
138
|
});
|
|
139
139
|
/**
|
|
140
|
-
* The overrides may be based on the theme's palette.
|
|
141
|
-
*
|
|
140
|
+
* The overrides may be based on the theme's palette. We must create these
|
|
141
|
+
* separately after the fact.
|
|
142
142
|
*/
|
|
143
143
|
function getOverrides(theme) {
|
|
144
144
|
const { palette, shape, spacing, transitions, typography } = theme;
|
|
@@ -335,6 +335,24 @@ function getOverrides(theme) {
|
|
|
335
335
|
},
|
|
336
336
|
},
|
|
337
337
|
},
|
|
338
|
+
MuiDatePicker: {
|
|
339
|
+
defaultProps: {
|
|
340
|
+
OpenPickerButtonProps: { size: "small" },
|
|
341
|
+
PopperProps: { dir: theme.direction },
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
MuiDateRangePicker: {
|
|
345
|
+
defaultProps: {
|
|
346
|
+
OpenPickerButtonProps: { size: "small" },
|
|
347
|
+
PopperProps: { dir: theme.direction },
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
MuiDateTimePicker: {
|
|
351
|
+
defaultProps: {
|
|
352
|
+
OpenPickerButtonProps: { size: "small" },
|
|
353
|
+
PopperProps: { dir: theme.direction },
|
|
354
|
+
},
|
|
355
|
+
},
|
|
338
356
|
MuiDialogActions: {
|
|
339
357
|
styleOverrides: {
|
|
340
358
|
root: {
|
|
@@ -782,6 +800,12 @@ function getOverrides(theme) {
|
|
|
782
800
|
},
|
|
783
801
|
},
|
|
784
802
|
},
|
|
803
|
+
MuiTimePicker: {
|
|
804
|
+
defaultProps: {
|
|
805
|
+
OpenPickerButtonProps: { size: "small" },
|
|
806
|
+
PopperProps: { dir: theme.direction },
|
|
807
|
+
},
|
|
808
|
+
},
|
|
785
809
|
MuiToggleButton: {
|
|
786
810
|
defaultProps: {
|
|
787
811
|
disableFocusRipple: true,
|
package/styles/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export function mergeStyles(standardClasses, classesProp = {}) {
|
|
|
15
15
|
...classesProp,
|
|
16
16
|
...standardClasses,
|
|
17
17
|
};
|
|
18
|
-
for (const key of Object.keys(standardClasses).filter(
|
|
18
|
+
for (const key of Object.keys(standardClasses).filter(k => k in classesProp)) {
|
|
19
19
|
// The order here is important. The class name(s) passed into the props
|
|
20
20
|
// for a given class key need to come after the component's own class
|
|
21
21
|
// name for that key in order to be able to override default styles.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ComponentsProps, ComponentsOverrides, ComponentsVariants } from "@mui/material/styles";
|
|
2
|
+
|
|
3
|
+
export * from "@mui/x-date-pickers-pro/themeAugmentation";
|
|
4
|
+
export * from "@mui/x-date-pickers/themeAugmentation";
|
|
5
|
+
|
|
1
6
|
// These are needed to mimic the MUI v4 "default" color for buttons, which was
|
|
2
7
|
// removed in v5. See https://mui.com/guides/migration-v4/#button for more
|
|
3
8
|
// details.
|
|
@@ -24,3 +29,20 @@ declare module "@mui/material" {
|
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export default {};
|
|
32
|
+
|
|
33
|
+
// TODO: For some reason, MUI's list of x-date-pickers components in the above
|
|
34
|
+
// augmentation is incomplete. Remove these overrides if they ever fix this.
|
|
35
|
+
export interface UndocumentedDatePickersComponents {
|
|
36
|
+
MuiDateRangePicker?: {
|
|
37
|
+
defaultProps?: ComponentsProps["MuiDateRangePicker"];
|
|
38
|
+
styleOverrides?: ComponentsOverrides["MuiDateRangePicker"];
|
|
39
|
+
};
|
|
40
|
+
MuiTimePicker?: {
|
|
41
|
+
defaultProps?: ComponentsProps["MuiTimePicker"];
|
|
42
|
+
styleOverrides?: ComponentsOverrides["MuiTimePicker"];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare module "@mui/material/styles" {
|
|
47
|
+
interface Components extends UndocumentedDatePickersComponents {}
|
|
48
|
+
}
|
package/utils/color.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Color from "color";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a Color object if valid. Undefined if invalid
|
|
4
|
+
*/
|
|
5
|
+
export declare function parse(color: string | {
|
|
6
|
+
r: string | number;
|
|
7
|
+
g: string | number;
|
|
8
|
+
b: string | number;
|
|
9
|
+
a?: string | number;
|
|
10
|
+
alpha?: string | number;
|
|
11
|
+
} | undefined): Color | undefined;
|
package/utils/color.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Color from "color";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a Color object if valid. Undefined if invalid
|
|
4
|
+
*/
|
|
5
|
+
export function parse(color) {
|
|
6
|
+
try {
|
|
7
|
+
if (!color) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
// Likely testing a value from the input element
|
|
11
|
+
if (typeof color === "string") {
|
|
12
|
+
return Color(color);
|
|
13
|
+
}
|
|
14
|
+
if (typeof color.r !== "undefined" &&
|
|
15
|
+
typeof color.g !== "undefined" &&
|
|
16
|
+
typeof color.b !== "undefined") {
|
|
17
|
+
const rgb = [
|
|
18
|
+
parseInt(color.r),
|
|
19
|
+
parseInt(color.g),
|
|
20
|
+
parseInt(color.b),
|
|
21
|
+
];
|
|
22
|
+
let alpha = undefined;
|
|
23
|
+
if (color.a !== undefined) {
|
|
24
|
+
alpha = color.a;
|
|
25
|
+
}
|
|
26
|
+
else if (color.alpha !== undefined) {
|
|
27
|
+
alpha = color.alpha;
|
|
28
|
+
}
|
|
29
|
+
if (alpha !== undefined) {
|
|
30
|
+
rgb.push(parseFloat(alpha));
|
|
31
|
+
}
|
|
32
|
+
return Color(rgb);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Didn't validate. Let's ignore.
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
package/utils/generateId.d.ts
CHANGED
package/utils/generateId.js
CHANGED
package/utils/html.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitize a string of unsafe HTML to eliminate XSS (cross-site scripting)
|
|
3
|
+
* security risks. This method allows tags and standard attributes, however
|
|
4
|
+
* `data-` attributes are not allowed. Script tags are not allowed either.
|
|
5
|
+
*
|
|
6
|
+
* @param unsafeHtml String of HTML to be scrubbed clean.
|
|
7
|
+
* @returns Safe HTML that has been sanitized.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeHtml(unsafeHtml: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Strip all HTML out of a string.
|
|
12
|
+
*
|
|
13
|
+
* @param html String of text which will have its HTML stripped away.
|
|
14
|
+
* @returns A plain text string without any HTML markup.
|
|
15
|
+
*/
|
|
16
|
+
export declare function stripHtml(html: string | undefined): string | undefined;
|
package/utils/html.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Sanitizer } from "@esri/arcgis-html-sanitizer";
|
|
2
|
+
import { escapeAttrValue, safeAttrValue, friendlyAttrValue } from "xss";
|
|
3
|
+
/**
|
|
4
|
+
* Sanitize a string of unsafe HTML to eliminate XSS (cross-site scripting)
|
|
5
|
+
* security risks. This method allows tags and standard attributes, however
|
|
6
|
+
* `data-` attributes are not allowed. Script tags are not allowed either.
|
|
7
|
+
*
|
|
8
|
+
* @param unsafeHtml String of HTML to be scrubbed clean.
|
|
9
|
+
* @returns Safe HTML that has been sanitized.
|
|
10
|
+
*/
|
|
11
|
+
export function sanitizeHtml(unsafeHtml) {
|
|
12
|
+
const checkUris = (tag, attr, value, cssFilter) => {
|
|
13
|
+
if (attr === "href" || attr === "src") {
|
|
14
|
+
// Override the default implementation to allow relative URLs.
|
|
15
|
+
if (!value) {
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
// Unescape attribute value first.
|
|
20
|
+
let href = friendlyAttrValue(value);
|
|
21
|
+
// Remove any surrounding grave accents and embedded whitespace
|
|
22
|
+
// that can fool the parsing in the URL class, potentially
|
|
23
|
+
// allowing unsafe URLs through.
|
|
24
|
+
href = href.replace(/^`|`$|\s+/g, "");
|
|
25
|
+
// The base URL can be anything -- it's just there to set the
|
|
26
|
+
// protocol to "https" for all relative URLs.
|
|
27
|
+
const url = new URL(href, "https://vertigis.com/");
|
|
28
|
+
if (url.protocol === "http:" ||
|
|
29
|
+
url.protocol === "https:" ||
|
|
30
|
+
url.protocol === "mailto:") {
|
|
31
|
+
return escapeAttrValue(value);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Ignore and let it be stripped out below. It's probably
|
|
36
|
+
// safest to err on the side of disallowing URLs that cannot be
|
|
37
|
+
// parsed.
|
|
38
|
+
}
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
return safeAttrValue(tag, attr, value, cssFilter);
|
|
42
|
+
};
|
|
43
|
+
const options = {
|
|
44
|
+
safeAttrValue: checkUris,
|
|
45
|
+
// This list builds on the default list in Esri's sanitization
|
|
46
|
+
// library (since we are passing `true` as the second parameter).
|
|
47
|
+
// See here for the default rules:
|
|
48
|
+
// https://github.com/Esri/arcgis-html-sanitizer/blob/master/src/index.ts
|
|
49
|
+
// In addition to what they support, we also need to support benign
|
|
50
|
+
// tags generated by the markdown library.
|
|
51
|
+
whiteList: {
|
|
52
|
+
a: ["href", "style", "target", "title"],
|
|
53
|
+
code: [],
|
|
54
|
+
blockquote: [],
|
|
55
|
+
del: [],
|
|
56
|
+
h1: [],
|
|
57
|
+
h2: [],
|
|
58
|
+
h3: [],
|
|
59
|
+
h4: [],
|
|
60
|
+
h5: [],
|
|
61
|
+
h6: [],
|
|
62
|
+
img: ["alt", "border", "height", "src", "style", "title", "width"],
|
|
63
|
+
ol: ["start"],
|
|
64
|
+
p: ["style"],
|
|
65
|
+
pre: [],
|
|
66
|
+
span: ["style"],
|
|
67
|
+
thead: [],
|
|
68
|
+
},
|
|
69
|
+
stripIgnoreTag: true,
|
|
70
|
+
stripIgnoreTagBody: true,
|
|
71
|
+
allowCommentTag: false,
|
|
72
|
+
css: {
|
|
73
|
+
// Allow properties that are configurable on PopupTemplate
|
|
74
|
+
// content, via AGOL Map Viewer's rich text editor; they are
|
|
75
|
+
// injected as span elements with style attributes.
|
|
76
|
+
whiteList: {
|
|
77
|
+
"background-color": true,
|
|
78
|
+
color: true,
|
|
79
|
+
"font-size": true,
|
|
80
|
+
"font-family": true,
|
|
81
|
+
"font-weight": true,
|
|
82
|
+
"text-align": true,
|
|
83
|
+
"text-decoration": true,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
return new Sanitizer(options, true).sanitize(unsafeHtml);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Strip all HTML out of a string.
|
|
91
|
+
*
|
|
92
|
+
* @param html String of text which will have its HTML stripped away.
|
|
93
|
+
* @returns A plain text string without any HTML markup.
|
|
94
|
+
*/
|
|
95
|
+
export function stripHtml(html) {
|
|
96
|
+
if (!html) {
|
|
97
|
+
return html;
|
|
98
|
+
}
|
|
99
|
+
// Sanitize any HTML that is present, to make it safe (from XSS risks).
|
|
100
|
+
const safe = sanitizeHtml(html);
|
|
101
|
+
// Create a temporary div (using the browser to strip away HTML content).
|
|
102
|
+
const div = document.createElement("div");
|
|
103
|
+
div.innerHTML = safe;
|
|
104
|
+
return div.innerText;
|
|
105
|
+
}
|
package/utils/intl.d.ts
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Formats a date for display. The time portion will not appear in the output.
|
|
3
|
+
*
|
|
3
4
|
* @param date The Date value to format.
|
|
4
5
|
* @param locale An optional locale to use. If not specified, the browser's
|
|
5
|
-
*
|
|
6
|
+
* locale will be used.
|
|
6
7
|
* @param options Additional options that control how the date is formatted.
|
|
7
8
|
*/
|
|
8
9
|
export declare function formatDate(date: Date | undefined, options?: Intl.DateTimeFormatOptions, locale?: string): string;
|
|
9
10
|
/**
|
|
10
11
|
* Formats a time for display. The date portion will not appear in the output.
|
|
12
|
+
*
|
|
11
13
|
* @param date The Date value to format.
|
|
12
14
|
* @param locale An optional locale to use. If not specified, the browser's
|
|
13
|
-
*
|
|
15
|
+
* locale will be used.
|
|
14
16
|
* @param options Additional options that control how the time is formatted.
|
|
15
17
|
*/
|
|
16
18
|
export declare function formatTime(date: Date | undefined, options?: Intl.DateTimeFormatOptions, locale?: string): string;
|
|
17
19
|
/**
|
|
18
20
|
* Formats a date and time for display.
|
|
21
|
+
*
|
|
19
22
|
* @param date The Date value to format.
|
|
20
23
|
* @param locale An optional locale to use. If not specified, the browser's
|
|
21
|
-
*
|
|
22
|
-
* @param options Additional options that control how the date & time are
|
|
23
|
-
* formatted.
|
|
24
|
+
* locale will be used.
|
|
25
|
+
* @param options Additional options that control how the date & time are formatted.
|
|
24
26
|
*/
|
|
25
27
|
export declare function formatDateTime(date: Date | undefined, options?: Intl.DateTimeFormatOptions, locale?: string): string;
|
|
26
28
|
/**
|
|
27
29
|
* Formats a number for display.
|
|
30
|
+
*
|
|
28
31
|
* @param number The number to format.
|
|
29
32
|
* @param locale An optional locale to use. If not specified, the browser's
|
|
30
|
-
*
|
|
33
|
+
* locale will be used.
|
|
31
34
|
* @param options Additional options that control how the number is formatted.
|
|
32
35
|
*/
|
|
33
36
|
export declare function formatNumber(number: number | undefined, options?: Intl.NumberFormatOptions, locale?: string): string;
|