ish-ui 1.0.55 → 1.1.1

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.
Files changed (62) hide show
  1. package/dist/appBar/AppBarHelpMenu.d.ts +17 -1
  2. package/dist/appBar/AppBarHelpMenu.js +5 -5
  3. package/dist/colorPicker/ColorPicker.js +6 -7
  4. package/dist/dialog/message/Message.js +3 -4
  5. package/dist/documents/DocumentIconsChooser.js +4 -5
  6. package/dist/fieldMessage/ErrorMessage.d.ts +1 -1
  7. package/dist/fieldMessage/ErrorMessage.js +8 -6
  8. package/dist/fieldMessage/WarningMessage.d.ts +1 -1
  9. package/dist/fieldMessage/WarningMessage.js +8 -6
  10. package/dist/fieldMessage/styles.d.ts +12 -1
  11. package/dist/fieldMessage/styles.js +1 -2
  12. package/dist/fileUploader/FileUploaderDialog.d.ts +1 -1
  13. package/dist/fileUploader/FileUploaderDialog.js +9 -9
  14. package/dist/formFields/CheckboxField.d.ts +1 -1
  15. package/dist/formFields/CheckboxField.js +4 -4
  16. package/dist/formFields/CodeEditorField.js +3 -4
  17. package/dist/formFields/ColoredCheckBox.js +3 -2
  18. package/dist/formFields/DateTimeField.js +2 -3
  19. package/dist/formFields/EditInPlaceDateTimeField.js +40 -20
  20. package/dist/formFields/EditInPlaceField.js +3 -4
  21. package/dist/formFields/EditInPlaceFieldBase.js +10 -11
  22. package/dist/formFields/EditInPlaceMoneyField.js +3 -2
  23. package/dist/formFields/EditInPlaceSearchSelect.js +16 -13
  24. package/dist/formFields/FilePreview.d.ts +1 -1
  25. package/dist/formFields/FilePreview.js +6 -6
  26. package/dist/formFields/FormRadioButtons.js +3 -3
  27. package/dist/formFields/SelectCustomComponents.d.ts +10 -1
  28. package/dist/formFields/SelectCustomComponents.js +13 -12
  29. package/dist/formFields/Switch.d.ts +1 -1
  30. package/dist/formFields/Switch.js +11 -11
  31. package/dist/formFields/TextField.d.ts +5 -1
  32. package/dist/formFields/TextField.js +2 -2
  33. package/dist/formFields/UneditableBase.js +3 -4
  34. package/dist/layout/InfoPill.js +4 -4
  35. package/dist/layout/resizable/ResizableWrapper.js +6 -6
  36. package/dist/markdownEditor/HtmlEditor.d.ts +2 -2
  37. package/dist/markdownEditor/WysiwygEditor.js +1 -1
  38. package/dist/model/Theme.d.ts +2 -2
  39. package/dist/styles/GlobalStylesProvider.d.ts +3 -2
  40. package/dist/styles/GlobalStylesProvider.js +714 -383
  41. package/dist/styles/hooks.d.ts +9 -1
  42. package/dist/styles/hooks.js +5 -4
  43. package/dist/styles/index.d.ts +0 -4
  44. package/dist/styles/index.js +0 -4
  45. package/dist/styles/makeStyles.d.ts +37 -2
  46. package/dist/styles/makeStyles.js +7 -2
  47. package/dist/tagsInput/AddTagMenu.d.ts +2 -1
  48. package/dist/tagsInput/AddTagMenu.js +4 -4
  49. package/dist/tagsInput/AddTagMenuItem.js +5 -4
  50. package/dist/tagsInput/TagInputList.js +21 -15
  51. package/dist/themes/ishTheme.js +2 -2
  52. package/dist/timetable/miniCalendar/CalendarDay.d.ts +1 -1
  53. package/dist/timetable/miniCalendar/CalendarDay.js +38 -39
  54. package/dist/timetable/miniCalendar/CalendarHeader.js +3 -4
  55. package/dist/timetable/miniCalendar/CalendarWeekPanel.js +3 -4
  56. package/dist/timetable/miniCalendar/WeekDay.js +3 -4
  57. package/package.json +62 -71
  58. package/assets/fonts/inter/inter.scss +0 -17
  59. package/dist/styles/StylesProviderCustom.d.ts +0 -3
  60. package/dist/styles/StylesProviderCustom.js +0 -6
  61. package/dist/styles/bootstrap.d.ts +0 -491
  62. package/dist/styles/bootstrap.js +0 -496
@@ -1,3 +1,19 @@
1
1
  import * as React from 'react';
2
- declare const _default: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles").StyledComponentProps<"button" | "info" | "divider">>;
2
+ interface Props {
3
+ classes?: any;
4
+ created?: any;
5
+ modified?: any;
6
+ manualUrl?: string;
7
+ auditsUrl?: string;
8
+ iconClasses?: any;
9
+ }
10
+ declare class AppBarHelpMenu extends React.Component<Props, any> {
11
+ constructor(props: any);
12
+ handleAddFieldClick: (e: any) => void;
13
+ handleClose: () => void;
14
+ openManual: () => void;
15
+ openAudits: () => void;
16
+ render(): React.JSX.Element;
17
+ }
18
+ declare const _default: typeof AppBarHelpMenu;
3
19
  export default _default;
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
- import { withStyles, createStyles } from '@mui/styles';
3
- import clsx from 'clsx';
2
+ import { useStyles, withStyles } from 'tss-react/mui';
4
3
  import HelpOutline from '@mui/icons-material/HelpOutline';
5
4
  import IconButton from '@mui/material/IconButton';
6
5
  import Typography from '@mui/material/Typography';
@@ -9,7 +8,7 @@ import MenuItem from '@mui/material/MenuItem';
9
8
  import Tooltip from '@mui/material/Tooltip';
10
9
  import { format as formatDate } from 'date-fns';
11
10
  import { III_DD_MMM_YYYY_HH_MM_SPECIAL, openInternalLink } from '../utils';
12
- const styles = theme => createStyles({
11
+ const styles = theme => ({
13
12
  button: {
14
13
  color: theme.appBarButton.helpMenu.color,
15
14
  },
@@ -48,6 +47,7 @@ class AppBarHelpMenu extends React.Component {
48
47
  render() {
49
48
  const { anchorEl } = this.state;
50
49
  const { classes, created, modified, iconClasses, auditsUrl } = this.props;
50
+ const { cx } = useStyles();
51
51
  return (React.createElement(React.Fragment, null,
52
52
  React.createElement(Menu, { id: "form-help-menu", anchorEl: anchorEl, open: Boolean(anchorEl), onClose: this.handleClose, marginThreshold: 16, transformOrigin: {
53
53
  vertical: 'center',
@@ -67,11 +67,11 @@ class AppBarHelpMenu extends React.Component {
67
67
  auditsUrl && (React.createElement(MenuItem, { onClick: this.openAudits }, "View audit trail"))),
68
68
  React.createElement(Tooltip, { title: "Additional information" },
69
69
  React.createElement("div", null,
70
- React.createElement(IconButton, { type: "button", "aria-owns": anchorEl ? 'form-help-menu' : null, "aria-haspopup": "true", onClick: this.handleAddFieldClick, size: "large", className: clsx({
70
+ React.createElement(IconButton, { type: "button", "aria-owns": anchorEl ? 'form-help-menu' : null, "aria-haspopup": "true", onClick: this.handleAddFieldClick, size: "large", className: cx({
71
71
  [classes.button]: !iconClasses,
72
72
  [iconClasses]: !!iconClasses
73
73
  }) },
74
74
  React.createElement(HelpOutline, null))))));
75
75
  }
76
76
  }
77
- export default withStyles(styles)(AppBarHelpMenu);
77
+ export default withStyles(AppBarHelpMenu, styles);
@@ -12,11 +12,10 @@ import { AlphaPicker, HuePicker } from 'react-color';
12
12
  import { ClickAwayListener } from '@mui/base';
13
13
  import Paper from '@mui/material/Paper';
14
14
  import Grow from '@mui/material/Grow';
15
- import clsx from 'clsx';
16
15
  import { stopEventPropagation } from '../utils/events';
17
16
  import { makeAppStyles } from '../styles';
18
17
  import { useAppTheme } from '../themes';
19
- const useStyles = makeAppStyles(({ spacing, palette, zIndex, transitions }) => ({
18
+ const useStyles = makeAppStyles()(({ spacing, palette, zIndex, transitions }, p, classes) => ({
20
19
  paper: {
21
20
  width: 200,
22
21
  padding: spacing(2),
@@ -65,7 +64,7 @@ const useStyles = makeAppStyles(({ spacing, palette, zIndex, transitions }) => (
65
64
  duration: transitions.duration.shorter,
66
65
  easing: transitions.easing.easeInOut
67
66
  }),
68
- '&:hover,&$opened': {
67
+ [`&:hover,&.${classes.opened}`]: {
69
68
  transform: 'scale(2)',
70
69
  zIndex: zIndex.modal,
71
70
  boxShadow: '1px 0px 1px -1px rgba(0,0,0,0.2), 0px 0px 2px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);'
@@ -85,7 +84,7 @@ const useStyles = makeAppStyles(({ spacing, palette, zIndex, transitions }) => (
85
84
  opened: {}
86
85
  }));
87
86
  const ColorPickerBase = React.memo(({ color, input: { value, onChange }, TransitionProps, setAnchorEl, placement }) => {
88
- const classes = useStyles();
87
+ const { classes, cx } = useStyles();
89
88
  const [hueColor, setHueColor] = useState(color);
90
89
  const [alfaColor, setAlfaColor] = useState(color);
91
90
  const hueRef = useRef();
@@ -119,12 +118,12 @@ const ColorPickerBase = React.memo(({ color, input: { value, onChange }, Transit
119
118
  return (React.createElement(ClickAwayListener, { onClickAway: handleClickAway },
120
119
  React.createElement(Grow, Object.assign({}, TransitionProps, { timeout: 200 }),
121
120
  React.createElement("div", null,
122
- React.createElement(Paper, { className: clsx(classes.paper, placement === 'bottom' && classes.paperPlaceBottom) },
121
+ React.createElement(Paper, { className: cx(classes.paper, placement === 'bottom' && classes.paperPlaceBottom) },
123
122
  React.createElement(HuePicker, { ref: hueRef, color: hueColor, onChange: onHueChange, onChangeComplete: onChangeComplete, width: "168", className: classes.bottomOffset }),
124
123
  React.createElement(AlphaPicker, { className: classes.customAlfa, color: alfaColor, width: "168", onChange: onAlfaChange, onChangeComplete: onChangeComplete }))))));
125
124
  });
126
125
  const ColorPickerWrapper = React.memo(({ input, placement = 'top', width }) => {
127
- const classes = useStyles();
126
+ const { classes, cx } = useStyles();
128
127
  const theme = useAppTheme();
129
128
  const [anchorEl, setAnchorEl] = useState(null);
130
129
  const handleClick = useCallback((event) => {
@@ -132,7 +131,7 @@ const ColorPickerWrapper = React.memo(({ input, placement = 'top', width }) => {
132
131
  }, [anchorEl]);
133
132
  const color = useMemo(() => (input.value ? '#' + input.value : theme.palette.primary.main), [theme, input.value]);
134
133
  return (React.createElement("div", { className: "d-flex", onClick: stopEventPropagation },
135
- React.createElement(ButtonBase, { onClick: handleClick, className: clsx(classes.colorPickerButton, anchorEl && classes.opened), style: { backgroundColor: color, width, height: width } }),
134
+ React.createElement(ButtonBase, { onClick: handleClick, className: cx(classes.colorPickerButton, anchorEl && classes.opened), style: { backgroundColor: color, width, height: width } }),
136
135
  React.createElement(Popper, { open: Boolean(anchorEl), anchorEl: anchorEl, placement: placement, className: classes.popper, transition: true }, ({ TransitionProps }) => (React.createElement(ColorPickerBase, { color: color, input: input, TransitionProps: TransitionProps, setAnchorEl: setAnchorEl, placement: placement })))));
137
136
  });
138
137
  export default ColorPickerWrapper;
@@ -3,13 +3,12 @@
3
3
  * No copying or use of this code is allowed without permission in writing from ish.
4
4
  */
5
5
  import React from 'react';
6
- import clsx from 'clsx';
7
6
  import Snackbar from '@mui/material/Snackbar';
8
7
  import IconButton from '@mui/material/IconButton';
9
8
  import Alert from '@mui/material/Alert';
10
9
  import CloseIcon from '@mui/icons-material/Close';
11
10
  import { makeAppStyles } from '../../styles';
12
- const useStyles = makeAppStyles((theme) => ({
11
+ const useStyles = makeAppStyles()((theme) => ({
13
12
  close: {
14
13
  color: theme.palette.primary.contrastText,
15
14
  width: theme.spacing(4),
@@ -40,7 +39,7 @@ const useStyles = makeAppStyles((theme) => ({
40
39
  }
41
40
  }));
42
41
  const Message = ({ opened, text, clearMessage, success, persist }) => {
43
- const classes = useStyles();
42
+ const { classes, cx } = useStyles();
44
43
  const handleClose = () => {
45
44
  if (!persist && clearMessage) {
46
45
  clearMessage();
@@ -53,7 +52,7 @@ const Message = ({ opened, text, clearMessage, success, persist }) => {
53
52
  root: classes.autoWidthRoot
54
53
  }, ContentProps: {
55
54
  classes: {
56
- root: clsx(classes.autoWidth, {
55
+ root: cx(classes.autoWidth, {
57
56
  [classes.success]: success
58
57
  }),
59
58
  message: persist ? classes.fullScreenMessage : undefined
@@ -6,10 +6,9 @@
6
6
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
7
  */
8
8
  import * as React from 'react';
9
- import clsx from 'clsx';
10
9
  import { FileTypeIcon } from './utils';
11
10
  import { makeAppStyles } from '../styles';
12
- const useStyles = makeAppStyles(theme => ({
11
+ const useStyles = makeAppStyles()(theme => ({
13
12
  preview: {
14
13
  backgroundSize: 'cover',
15
14
  width: '36px',
@@ -36,13 +35,13 @@ const useStyles = makeAppStyles(theme => ({
36
35
  }
37
36
  }));
38
37
  const DocumentIconsChooser = ({ type, thumbnail, className, hovered = true, isHeader }) => {
39
- const classes = useStyles();
38
+ const { classes, cx } = useStyles();
40
39
  return thumbnail ? (React.createElement("div", { style: {
41
40
  backgroundImage: `url(data:image;base64,${thumbnail})`
42
- }, className: clsx(classes.preview, {
41
+ }, className: cx(classes.preview, {
43
42
  [classes.previewHoverImage]: hovered,
44
43
  [classes.previewNormal]: isHeader
45
- }, className) })) : (React.createElement("div", { className: clsx(classes.preview, {
44
+ }, className) })) : (React.createElement("div", { className: cx(classes.preview, {
46
45
  [classes.previewHoverIcon]: hovered
47
46
  }, className) },
48
47
  React.createElement(FileTypeIcon, { mimeType: type })));
@@ -4,5 +4,5 @@ interface Props {
4
4
  className?: string;
5
5
  message: string;
6
6
  }
7
- declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"icon" | "root">>;
7
+ declare const _default: React.FC<Props>;
8
8
  export default _default;
@@ -5,10 +5,12 @@
5
5
  import React from 'react';
6
6
  import Error from '@mui/icons-material/Error';
7
7
  import Typography from '@mui/material/Typography';
8
- import withStyles from '@mui/styles/withStyles';
9
- import clsx from 'clsx';
8
+ import { useStyles, withStyles } from 'tss-react/mui';
10
9
  import styles from './styles';
11
- const ErrorMessage = ({ classes, className, message }) => (React.createElement("div", { className: clsx(classes.root, className) },
12
- React.createElement(Error, { color: "error", className: classes.icon }),
13
- React.createElement(Typography, { variant: "caption", className: "errorColor" }, message)));
14
- export default withStyles(styles)(ErrorMessage);
10
+ const ErrorMessage = ({ classes, className, message }) => {
11
+ const { cx } = useStyles();
12
+ return React.createElement("div", { className: cx(classes.root, className) },
13
+ React.createElement(Error, { color: "error", className: classes.icon }),
14
+ React.createElement(Typography, { variant: "caption", className: "errorColor" }, message));
15
+ };
16
+ export default withStyles(ErrorMessage, styles);
@@ -4,5 +4,5 @@ interface Props {
4
4
  className?: string;
5
5
  warning: string;
6
6
  }
7
- declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"icon" | "root">>;
7
+ declare const _default: React.FC<Props>;
8
8
  export default _default;
@@ -5,10 +5,12 @@
5
5
  import React from 'react';
6
6
  import Warning from '@mui/icons-material/Warning';
7
7
  import Typography from '@mui/material/Typography';
8
- import withStyles from '@mui/styles/withStyles';
9
- import clsx from 'clsx';
8
+ import { useStyles, withStyles } from 'tss-react/mui';
10
9
  import styles from './styles';
11
- const WarningMessage = ({ classes, className, warning }) => (React.createElement("div", { className: clsx(classes.root, className) },
12
- React.createElement(Warning, { className: clsx(classes.icon, 'warningColor') }),
13
- React.createElement(Typography, { variant: "caption", className: "warningColor" }, warning)));
14
- export default withStyles(styles)(WarningMessage);
10
+ const WarningMessage = ({ classes, className, warning }) => {
11
+ const { cx } = useStyles();
12
+ return React.createElement("div", { className: cx(classes.root, className) },
13
+ React.createElement(Warning, { className: cx(classes.icon, 'warningColor') }),
14
+ React.createElement(Typography, { variant: "caption", className: "warningColor" }, warning));
15
+ };
16
+ export default withStyles(WarningMessage, styles);
@@ -1,3 +1,14 @@
1
1
  import { AppTheme } from '../model';
2
- declare const _default: (theme: AppTheme) => import("@mui/styles").StyleRules<{}, "icon" | "root">;
2
+ declare const _default: (theme: AppTheme) => {
3
+ root: {
4
+ marginTop: string;
5
+ paddingBottom: string;
6
+ };
7
+ icon: {
8
+ fontSize: string;
9
+ display: string;
10
+ verticalAlign: string;
11
+ marginRight: string;
12
+ };
13
+ };
3
14
  export default _default;
@@ -2,8 +2,7 @@
2
2
  * Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
3
3
  * No copying or use of this code is allowed without permission in writing from ish.
4
4
  */
5
- import { createStyles } from '@mui/styles';
6
- export default (theme) => createStyles({
5
+ export default (theme) => ({
7
6
  root: {
8
7
  marginTop: `-${theme.spacing(1)}`,
9
8
  // @ts-ignore
@@ -11,5 +11,5 @@ interface Props {
11
11
  onClose?: () => void;
12
12
  isBackdropDragging?: boolean;
13
13
  }
14
- declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<never>>;
14
+ declare const _default: React.FC<Props>;
15
15
  export default _default;
@@ -6,16 +6,15 @@
6
6
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
7
  */
8
8
  import React from 'react';
9
- import clsx from 'clsx';
10
9
  import { useDropzone } from 'react-dropzone';
11
- import { createStyles, withStyles } from '@mui/styles';
10
+ import { useStyles, withStyles } from 'tss-react/mui';
12
11
  import { darken } from '@mui/material/styles';
13
12
  import Typography from '@mui/material/Typography';
14
13
  import Dialog from '@mui/material/Dialog';
15
14
  import IconButton from '@mui/material/IconButton';
16
15
  import CloseIcon from '@mui/icons-material/Close';
17
16
  import Button from '@mui/material/Button';
18
- const styles = createStyles((theme) => ({
17
+ const styles = (theme) => ({
19
18
  fileContainer: {
20
19
  border: `2px dotted ${theme.palette.primary.main}`,
21
20
  borderRadius: 6,
@@ -42,9 +41,10 @@ const styles = createStyles((theme) => ({
42
41
  top: theme.spacing(1),
43
42
  color: theme.palette.grey[100]
44
43
  }
45
- }));
44
+ });
46
45
  const FileUploaderDialog = (props => {
47
46
  const { fileRef, accept, disabled, classes, dialog, onChange, onClose, opened, backdropEnabled, isBackdropDragging } = props;
47
+ const { cx } = useStyles();
48
48
  const onFileDrop = (acceptedfiles, fileRejections) => {
49
49
  if (onChange)
50
50
  onChange(acceptedfiles, fileRejections);
@@ -71,15 +71,15 @@ const FileUploaderDialog = (props => {
71
71
  }
72
72
  return text.join(', ');
73
73
  };
74
- const backdropUploaderContent = (React.createElement("div", Object.assign({}, getRootProps(), { className: clsx('w-100 h-100', classes.fullScreenFileDropContainer) }),
74
+ const backdropUploaderContent = (React.createElement("div", Object.assign({}, getRootProps(), { className: cx('w-100 h-100', classes.fullScreenFileDropContainer) }),
75
75
  React.createElement("div", { className: "h-100 outline-none overflow-hidden cursor-pointer" },
76
76
  React.createElement("div", { className: "h-100 p-1" },
77
77
  React.createElement("input", Object.assign({}, getInputProps()))))));
78
- const uploadContent = (React.createElement("div", Object.assign({}, getRootProps(), { className: clsx('w-100 overflow-y-auto relative', classes.boxDropContainer, { 'zIndex2': isBackdropDragging }) }),
78
+ const uploadContent = (React.createElement("div", Object.assign({}, getRootProps(), { className: cx('w-100 overflow-y-auto relative', classes.boxDropContainer, { 'zIndex2': isBackdropDragging }) }),
79
79
  React.createElement("div", { className: "h-100 outline-none overflow-hidden cursor-pointer" },
80
80
  React.createElement("div", { className: "h-100 p-1" },
81
81
  React.createElement("input", Object.assign({}, getInputProps())),
82
- React.createElement("div", { className: clsx('w-100 h-100 flex-column align-items-center justify-content-center text-center p-2 pb-3', classes.fileContainer, { [classes.dragActive]: isDragActive }) },
82
+ React.createElement("div", { className: cx('w-100 h-100 flex-column align-items-center justify-content-center text-center p-2 pb-3', classes.fileContainer, { [classes.dragActive]: isDragActive }) },
83
83
  React.createElement(Typography, { variant: "subtitle1", gutterBottom: true, className: "mb-0" }, "Drop files here"),
84
84
  React.createElement(Typography, { variant: "caption", className: "mb-1" }, "or"),
85
85
  React.createElement(Button, { variant: "contained", size: "small", color: "primary", className: "mb-1 fontWeight-normal" }, "Browse"),
@@ -91,9 +91,9 @@ const FileUploaderDialog = (props => {
91
91
  paper: 'w-100'
92
92
  } },
93
93
  React.createElement("div", null,
94
- onClose && (React.createElement(IconButton, { className: clsx('fixed zIndex1401 p-1', classes.dialogCloseButton), onClick: onClose },
94
+ onClose && (React.createElement(IconButton, { className: cx('fixed zIndex1401 p-1', classes.dialogCloseButton), onClick: onClose },
95
95
  React.createElement(CloseIcon, { fontSize: "small" }))),
96
96
  uploadContent,
97
97
  isBackdropDragging && backdropEnabled && backdropUploaderContent))) : backdropEnabled ? backdropUploaderContent : uploadContent;
98
98
  });
99
- export default withStyles(styles)(FileUploaderDialog);
99
+ export default withStyles(FileUploaderDialog, styles);
@@ -4,5 +4,5 @@
4
4
  import React from 'react';
5
5
  import { CheckboxFieldProps, FieldInputProps } from '../model';
6
6
  import { CheckboxProps } from '@mui/material/Checkbox/Checkbox';
7
- export declare const StyledCheckbox: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"root"> & object>;
7
+ export declare const StyledCheckbox: (props: any) => React.JSX.Element;
8
8
  export declare function CheckboxField<IP extends FieldInputProps>({ input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation, ...rest }: CheckboxFieldProps<IP> & CheckboxProps): React.JSX.Element;
@@ -21,8 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  * */
22
22
  import React, { useCallback } from 'react';
23
23
  import Checkbox from '@mui/material/Checkbox';
24
- import withStyles from '@mui/styles/withStyles';
25
- import clsx from 'clsx';
24
+ import { useStyles, withStyles } from 'tss-react/mui';
26
25
  const getValue = (value, stringValue) => {
27
26
  if (!stringValue) {
28
27
  return !!value;
@@ -45,11 +44,12 @@ const styles = theme => ({
45
44
  });
46
45
  const StyledCheckboxBase = props => {
47
46
  const { classes, uncheckedClass, className } = props, rest = __rest(props, ["classes", "uncheckedClass", "className"]);
47
+ const { cx } = useStyles();
48
48
  return (React.createElement(Checkbox, Object.assign({ classes: {
49
- root: clsx(classes.root, uncheckedClass, className),
49
+ root: cx(classes.root, uncheckedClass, className),
50
50
  } }, rest)));
51
51
  };
52
- export const StyledCheckbox = withStyles(styles)(StyledCheckboxBase);
52
+ export const StyledCheckbox = withStyles(StyledCheckboxBase, styles);
53
53
  export function CheckboxField(_a) {
54
54
  var { input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation } = _a, rest = __rest(_a, ["input", "color", "disabled", "stringValue", "className", "uncheckedClass", "onChangeHandler", "stopPropagation"]);
55
55
  const onChange = useCallback((e, value) => {
@@ -6,12 +6,11 @@
6
6
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
7
  */
8
8
  import React from 'react';
9
- import clsx from 'clsx';
10
9
  import AceEditor from 'react-ace';
11
10
  import 'ace-builds/src-noconflict/mode-groovy';
12
11
  import 'ace-builds/src-noconflict/theme-textmate';
13
12
  import { makeAppStyles } from '../styles';
14
- const useStyles = makeAppStyles(theme => ({
13
+ const useStyles = makeAppStyles()(theme => ({
15
14
  editor: {
16
15
  filter: theme.palette.mode === 'dark' ? 'invert(80%)' : '',
17
16
  zIndex: 0,
@@ -51,11 +50,11 @@ const useStyles = makeAppStyles(theme => ({
51
50
  }
52
51
  }));
53
52
  function CodeEditorField({ input, meta: { error }, errorMessage, disabled, onFocus, className }) {
54
- const classes = useStyles();
53
+ const { classes, cx } = useStyles();
55
54
  return (React.createElement("div", { id: input.name, className: className },
56
55
  error && React.createElement("div", { className: classes.errorMessage },
57
56
  React.createElement("div", { className: "shakingError" }, errorMessage || error)),
58
- React.createElement(AceEditor, { mode: "groovy", theme: "textmate", value: input.value || ' ', onFocus: onFocus, onChange: input.onChange, fontSize: 14, showPrintMargin: false, showGutter: true, highlightActiveLine: true, width: "100%", maxLines: Infinity, className: clsx(classes.editor, {
57
+ React.createElement(AceEditor, { mode: "groovy", theme: "textmate", value: input.value || ' ', onFocus: onFocus, onChange: input.onChange, fontSize: 14, showPrintMargin: false, showGutter: true, highlightActiveLine: true, width: "100%", maxLines: Infinity, className: cx(classes.editor, {
59
58
  [classes.errorBackground]: error
60
59
  }), wrapEnabled: true, setOptions: {
61
60
  enableBasicAutocompletion: true,
@@ -7,13 +7,14 @@
7
7
  */
8
8
  import React, { useCallback, useRef } from 'react';
9
9
  import { ButtonBase, Typography } from '@mui/material';
10
- import clsx from 'clsx';
11
10
  import { alpha } from '@mui/material/styles';
12
11
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
13
12
  import { useAppTheme } from '../themes';
14
13
  import { rgbToHex } from '@mui/system/colorManipulator';
15
14
  import { getCheckboxValue } from '../utils';
15
+ import { useStyles } from 'tss-react/mui';
16
16
  export function ColoredCheckBox({ input, label, color, className, disabled }) {
17
+ const { cx } = useStyles();
17
18
  const theme = useAppTheme();
18
19
  const inputRef = useRef();
19
20
  const onClick = useCallback(() => {
@@ -22,7 +23,7 @@ export function ColoredCheckBox({ input, label, color, className, disabled }) {
22
23
  if (disabled) {
23
24
  color = rgbToHex(theme.palette.divider);
24
25
  }
25
- return (React.createElement("div", { className: clsx('centeredFlex cursor-pointer', className), onClick: onClick },
26
+ return (React.createElement("div", { className: cx('centeredFlex cursor-pointer', className), onClick: onClick },
26
27
  React.createElement("input", Object.assign({ ref: inputRef, type: "checkbox" }, input, { checked: getCheckboxValue(input.value, false), hidden: true })),
27
28
  React.createElement(ButtonBase, { component: "div", disabled: disabled, sx: {
28
29
  width: theme => theme.spacing(3),
@@ -17,11 +17,10 @@ var __rest = (this && this.__rest) || function (s, e) {
17
17
  return t;
18
18
  };
19
19
  import * as React from 'react';
20
- import TextField from '@mui/material/TextField';
21
20
  import { MobileDatePicker, MobileDateTimePicker, MobileTimePicker } from '@mui/x-date-pickers';
22
21
  import { DD_MM_YYYY_HH_MM_SPECIAL, DD_MMM_YYYY_MINUSED, HH_MM_COLONED } from '../utils';
23
22
  export const DateTimeField = props => {
24
- const { onChange, type, ampm, value, setPickerRef, formatDate, maxDate, minDate } = props, rest = __rest(props, ["onChange", "type", "ampm", "value", "setPickerRef", "formatDate", "maxDate", "minDate"]);
25
- const picker = type === 'date' ? (React.createElement(MobileDatePicker, Object.assign({ ref: setPickerRef, onChange: onChange, ampm: ampm || false, value: value, format: formatDate || DD_MMM_YYYY_MINUSED, maxDate: maxDate || undefined, minDate: minDate || undefined, renderInput: props => React.createElement(TextField, Object.assign({}, props)), variant: "standard" }, rest))) : type === 'time' ? (React.createElement(MobileTimePicker, Object.assign({ ref: setPickerRef, onChange: onChange, ampm: ampm || false, value: value, format: formatDate || HH_MM_COLONED, maxDate: maxDate || undefined, minDate: minDate || undefined, renderInput: props => React.createElement(TextField, Object.assign({}, props)), variant: "standard" }, rest))) : type === 'datetime' ? (React.createElement(MobileDateTimePicker, Object.assign({ ref: setPickerRef, onChange: onChange, ampm: ampm || false, value: value, format: formatDate || DD_MM_YYYY_HH_MM_SPECIAL, maxDate: maxDate || undefined, minDate: minDate || undefined, renderInput: props => React.createElement(TextField, Object.assign({}, props)), variant: "standard" }, rest))) : null;
23
+ const { onChange, type, ampm, value, setPickerRef, formatDate, maxDate, minDate, renderInput } = props, rest = __rest(props, ["onChange", "type", "ampm", "value", "setPickerRef", "formatDate", "maxDate", "minDate", "renderInput"]);
24
+ const picker = type === 'date' ? (React.createElement(MobileDatePicker, Object.assign({ ref: setPickerRef, onChange: onChange, ampm: ampm || false, value: value, format: formatDate || DD_MMM_YYYY_MINUSED, maxDate: maxDate || undefined, minDate: minDate || undefined, variant: "standard" }, rest))) : type === 'time' ? (React.createElement(MobileTimePicker, Object.assign({ ref: setPickerRef, onChange: onChange, ampm: ampm || false, value: value, format: formatDate || HH_MM_COLONED, maxDate: maxDate || undefined, minDate: minDate || undefined, variant: "standard" }, rest))) : type === 'datetime' ? (React.createElement(MobileDateTimePicker, Object.assign({ ref: setPickerRef, onChange: onChange, ampm: ampm || false, value: value, format: formatDate || DD_MM_YYYY_HH_MM_SPECIAL, maxDate: maxDate || undefined, minDate: minDate || undefined, variant: "standard" }, rest))) : null;
26
25
  return picker || null;
27
26
  };
@@ -9,7 +9,6 @@
9
9
  * Wrapper component for DateTimeField with edit in place functional
10
10
  * */
11
11
  import React, { useEffect, useMemo, useRef, useState } from 'react';
12
- import clsx from 'clsx';
13
12
  import DateRange from '@mui/icons-material/DateRange';
14
13
  import QueryBuilder from '@mui/icons-material/QueryBuilder';
15
14
  import { format, isValid } from 'date-fns';
@@ -17,9 +16,9 @@ import IconButton from '@mui/material/IconButton';
17
16
  import { DateTimeField } from './DateTimeField';
18
17
  import { makeAppStyles } from '../styles';
19
18
  import EditInPlaceFieldBase from './EditInPlaceFieldBase';
20
- import { appendTimezone, formatStringDate, HH_MM_COLONED, III_DD_MMM_YYYY, III_DD_MMM_YYYY_HH_MM, prependTimezone, YYYY_MM_DD_MINUSED } from '../utils';
19
+ import { appendTimezone, formatStringDate, HH_MM_COLONED, III_DD_MMM_YYYY, III_DD_MMM_YYYY_HH_MM, prependTimezone, YYYY_MM_DD_MINUSED, } from '../utils';
21
20
  import { endFieldProcessingAction, startFieldProcessingAction } from '../actions/FieldProcessing';
22
- const useStyles = makeAppStyles(theme => ({
21
+ const useStyles = makeAppStyles()(theme => ({
23
22
  inlinePickerButton: {
24
23
  padding: '2px',
25
24
  fontSize: '1.3em',
@@ -35,7 +34,7 @@ function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime
35
34
  const [textValue, setTextValue] = useState(defaultValue || '');
36
35
  const [pickerOpened, setPickerOpened] = useState(false);
37
36
  const inputNode = useRef(null);
38
- const classes = useStyles();
37
+ const { classes, cx } = useStyles();
39
38
  const formatDateInner = dateObj => {
40
39
  if (!dateObj) {
41
40
  return '';
@@ -160,27 +159,48 @@ function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime
160
159
  inputNode.current.blur();
161
160
  }
162
161
  };
163
- return (React.createElement("div", { className: clsx(className, 'outline-none', {
162
+ return (React.createElement("div", { className: cx(className, 'outline-none', {
164
163
  [classes.inlineContainer]: inline,
165
164
  'pointer-events-none': disabled
166
165
  }) },
167
166
  React.createElement("div", { id: input.name, className: "w-100" },
168
- React.createElement(DateTimeField, { type: type, toolbarTitle: label, open: pickerOpened, value: dateValue, onChange: onChange, onClose: onClose, renderInput: () => (React.createElement(EditInPlaceFieldBase, { name: input.name, value: textValue, variant: variant, error: error, invalid: invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, rightAligned: rightAligned, shrink: Boolean(label || input.value), disabled: disabled, labelAdornment: labelAdornment, placeholder: placeholder, editIcon: React.createElement(IconButton, { tabIndex: -1, onClick: openPicker, sx: variant === 'outlined' ? {
169
- marginRight: -1
170
- } : null, classes: {
171
- root: clsx(fieldClasses.text, inline && classes.inlinePickerButton)
172
- } }, type === 'time'
173
- ? React.createElement(QueryBuilder, { fontSize: "inherit", color: "inherit" })
174
- : React.createElement(DateRange, { color: "inherit", fontSize: "inherit" })), InputProps: {
175
- type: 'text',
176
- onFocus: input.onFocus,
177
- inputRef: inputNode,
167
+ React.createElement(DateTimeField, { type: type, toolbarTitle: label, open: pickerOpened, value: dateValue, onChange: onChange, onClose: onClose, slots: {
168
+ field: EditInPlaceFieldBase
169
+ }, slotProps: {
170
+ field: {
171
+ name: input.name,
178
172
  value: textValue,
179
- onKeyPress,
173
+ variant,
174
+ error,
175
+ invalid,
176
+ inline,
177
+ label,
178
+ warning,
179
+ fieldClasses,
180
+ rightAligned,
180
181
  disabled,
181
- onBlur,
182
- onKeyDown: onEnterPress,
183
- onChange: onInputChange
184
- } })) }))));
182
+ labelAdornment,
183
+ placeholder,
184
+ shrink: Boolean(label || input.value),
185
+ editIcon: React.createElement(IconButton, { tabIndex: -1, onClick: openPicker, sx: variant === 'outlined' ? {
186
+ marginRight: -1
187
+ } : null, classes: {
188
+ root: cx(fieldClasses.text, inline && classes.inlinePickerButton)
189
+ } }, type === 'time'
190
+ ? React.createElement(QueryBuilder, { fontSize: "inherit", color: "inherit" })
191
+ : React.createElement(DateRange, { color: "inherit", fontSize: "inherit" })),
192
+ InputProps: {
193
+ type: 'text',
194
+ onFocus: input.onFocus,
195
+ inputRef: inputNode,
196
+ value: textValue,
197
+ onKeyPress,
198
+ disabled,
199
+ onBlur,
200
+ onKeyDown: onEnterPress,
201
+ onChange: onInputChange
202
+ }
203
+ }
204
+ } }))));
185
205
  }
186
206
  export default EditInPlaceDateTimeField;
@@ -9,11 +9,10 @@
9
9
  * Wrapper component for Material Select and Text Field with edit in plaxce functional
10
10
  * */
11
11
  import React, { useMemo } from 'react';
12
- import clsx from 'clsx';
13
12
  import { Edit } from '@mui/icons-material';
14
13
  import EditInPlaceFieldBase from './EditInPlaceFieldBase';
15
14
  import { makeAppStyles } from '../styles';
16
- const useStyles = makeAppStyles(theme => ({
15
+ const useStyles = makeAppStyles()(theme => ({
17
16
  rightAligned: {
18
17
  display: 'flex',
19
18
  alignItems: 'center',
@@ -32,14 +31,14 @@ const useStyles = makeAppStyles(theme => ({
32
31
  }
33
32
  }));
34
33
  function EditInPlaceField({ inputRef, input, label, maxLength, disabled, min, max, step, className, onKeyPress, labelAdornment, truncateLines, rightAligned, defaultValue, onKeyDown, multiline, inline, warning, preformatDisplayValue, type = 'text', meta: { error, invalid }, placeholder, fieldClasses = {}, InputProps = {}, editIcon, variant }) {
35
- const classes = useStyles();
34
+ const { classes, cx } = useStyles();
36
35
  const onBlur = () => {
37
36
  (input === null || input === void 0 ? void 0 : input.onBlur) && input.onBlur(input.value);
38
37
  };
39
38
  const inputValue = useMemo(() => preformatDisplayValue
40
39
  ? preformatDisplayValue(input.value === 0 ? input.value : input.value || defaultValue)
41
40
  : (input.value === 0 ? String(input.value) : input.value) || defaultValue || '', [preformatDisplayValue, input.value, defaultValue]);
42
- return (React.createElement("div", { id: input.name, className: clsx(className, 'outline-none', {
41
+ return (React.createElement("div", { id: input.name, className: cx(className, 'outline-none', {
43
42
  [classes.rightAligned]: rightAligned,
44
43
  [classes.inlineContainer]: inline
45
44
  }) },