ish-ui 1.0.55 → 1.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/dist/appBar/AppBarHelpMenu.d.ts +17 -1
- package/dist/appBar/AppBarHelpMenu.js +5 -5
- package/dist/colorPicker/ColorPicker.js +5 -6
- package/dist/dialog/message/Message.js +3 -4
- package/dist/documents/DocumentIconsChooser.js +4 -5
- package/dist/fieldMessage/ErrorMessage.d.ts +1 -1
- package/dist/fieldMessage/ErrorMessage.js +8 -6
- package/dist/fieldMessage/WarningMessage.d.ts +1 -1
- package/dist/fieldMessage/WarningMessage.js +8 -6
- package/dist/fieldMessage/styles.d.ts +12 -1
- package/dist/fieldMessage/styles.js +1 -2
- package/dist/fileUploader/FileUploaderDialog.d.ts +1 -1
- package/dist/fileUploader/FileUploaderDialog.js +9 -9
- package/dist/formFields/CheckboxField.d.ts +1 -1
- package/dist/formFields/CheckboxField.js +4 -4
- package/dist/formFields/CodeEditorField.js +3 -4
- package/dist/formFields/ColoredCheckBox.js +3 -2
- package/dist/formFields/DateTimeField.js +2 -3
- package/dist/formFields/EditInPlaceDateTimeField.js +40 -20
- package/dist/formFields/EditInPlaceField.js +3 -4
- package/dist/formFields/EditInPlaceFieldBase.js +9 -10
- package/dist/formFields/EditInPlaceMoneyField.js +3 -2
- package/dist/formFields/EditInPlaceSearchSelect.js +16 -13
- package/dist/formFields/FilePreview.d.ts +1 -1
- package/dist/formFields/FilePreview.js +5 -5
- package/dist/formFields/FormRadioButtons.js +3 -3
- package/dist/formFields/SelectCustomComponents.d.ts +10 -1
- package/dist/formFields/SelectCustomComponents.js +7 -6
- package/dist/formFields/Switch.d.ts +1 -1
- package/dist/formFields/Switch.js +5 -5
- package/dist/formFields/TextField.d.ts +5 -1
- package/dist/formFields/TextField.js +2 -2
- package/dist/formFields/UneditableBase.js +3 -4
- package/dist/layout/InfoPill.js +4 -4
- package/dist/layout/resizable/ResizableWrapper.js +5 -5
- package/dist/markdownEditor/HtmlEditor.d.ts +2 -2
- package/dist/markdownEditor/WysiwygEditor.js +1 -1
- package/dist/model/Theme.d.ts +2 -2
- package/dist/styles/GlobalStylesProvider.d.ts +3 -2
- package/dist/styles/GlobalStylesProvider.js +714 -383
- package/dist/styles/hooks.d.ts +9 -1
- package/dist/styles/hooks.js +5 -4
- package/dist/styles/index.d.ts +0 -4
- package/dist/styles/index.js +0 -4
- package/dist/styles/makeStyles.d.ts +37 -2
- package/dist/styles/makeStyles.js +7 -2
- package/dist/tagsInput/AddTagMenu.d.ts +2 -1
- package/dist/tagsInput/AddTagMenu.js +4 -4
- package/dist/tagsInput/AddTagMenuItem.js +5 -4
- package/dist/tagsInput/TagInputList.js +21 -15
- package/dist/timetable/miniCalendar/CalendarDay.d.ts +1 -1
- package/dist/timetable/miniCalendar/CalendarDay.js +38 -39
- package/dist/timetable/miniCalendar/CalendarHeader.js +3 -4
- package/dist/timetable/miniCalendar/CalendarWeekPanel.js +3 -4
- package/dist/timetable/miniCalendar/WeekDay.js +3 -4
- package/package.json +62 -71
- package/assets/fonts/inter/inter.scss +0 -17
- package/dist/styles/StylesProviderCustom.d.ts +0 -3
- package/dist/styles/StylesProviderCustom.js +0 -6
- package/dist/styles/bootstrap.d.ts +0 -491
- package/dist/styles/bootstrap.js +0 -496
|
@@ -19,9 +19,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
19
19
|
import React, { useCallback } from 'react';
|
|
20
20
|
import NumberFormat from 'react-number-format';
|
|
21
21
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
22
|
-
import clsx from 'clsx';
|
|
23
22
|
import EditInPlaceField from './EditInPlaceField';
|
|
24
23
|
import { formatCurrency, normalizeNumber } from '../utils';
|
|
24
|
+
import { useStyles } from 'tss-react/mui';
|
|
25
25
|
const NumberFormatCustom = React.forwardRef((props, ref) => {
|
|
26
26
|
const { onChange, allowNegative = true } = props, other = __rest(props, ["onChange", "allowNegative"]);
|
|
27
27
|
const onValueChange = useCallback(values => {
|
|
@@ -33,7 +33,8 @@ const preformatDisplayValue = value => value || value === 0 ? formatCurrency(val
|
|
|
33
33
|
function EditInPlaceMoneyField(_a) {
|
|
34
34
|
var _b;
|
|
35
35
|
var { InputProps, currencySymbol, className } = _a, restProps = __rest(_a, ["InputProps", "currencySymbol", "className"]);
|
|
36
|
+
const { cx } = useStyles();
|
|
36
37
|
return (React.createElement(EditInPlaceField, Object.assign({}, restProps, { preformatDisplayValue: preformatDisplayValue, InputProps: Object.assign(Object.assign({}, InputProps), { startAdornment: React.createElement(InputAdornment, { position: "start", className: (_b = restProps.fieldClasses) === null || _b === void 0 ? void 0 : _b.text },
|
|
37
|
-
React.createElement("span", null, currencySymbol)), inputComponent: NumberFormatCustom }), className:
|
|
38
|
+
React.createElement("span", null, currencySymbol)), inputComponent: NumberFormatCustom }), className: cx('money', className) })));
|
|
38
39
|
}
|
|
39
40
|
export default EditInPlaceMoneyField;
|
|
@@ -20,17 +20,18 @@ import CircularProgress from '@mui/material/CircularProgress';
|
|
|
20
20
|
import Popper from '@mui/material/Popper';
|
|
21
21
|
import { Autocomplete, IconButton, InputAdornment, Select } from '@mui/material';
|
|
22
22
|
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
23
|
-
import CloseIcon from '@mui/icons-material
|
|
24
|
-
import clsx from 'clsx';
|
|
23
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
25
24
|
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
26
|
-
import { ListboxComponent,
|
|
25
|
+
import { ListboxComponent, useSelectStyles } from './SelectCustomComponents';
|
|
27
26
|
import EditInPlaceFieldBase from './EditInPlaceFieldBase';
|
|
28
27
|
import { makeAppStyles } from '../styles';
|
|
29
28
|
import { getHighlightedPartLabel, stubComponent } from '../utils';
|
|
30
29
|
import { usePrevious } from '../utils/hooks';
|
|
31
|
-
const useStyles = makeAppStyles(
|
|
30
|
+
const useStyles = makeAppStyles()({
|
|
31
|
+
popper: {
|
|
32
32
|
zIndex: 1400
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
34
35
|
const SelectContext = React.createContext({});
|
|
35
36
|
const ListBoxAdapter = React.forwardRef((_a, ref) => {
|
|
36
37
|
var { children } = _a, other = __rest(_a, ["children"]);
|
|
@@ -48,7 +49,9 @@ const PopperAdapter = React.memo(params => {
|
|
|
48
49
|
: React.createElement(Popper, Object.assign({}, params, { style: inline ? null : params.style })));
|
|
49
50
|
});
|
|
50
51
|
function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, inline, loading, creatable, allowEmpty, fieldClasses = {}, selectAdornment, selectValueMark = 'value', selectLabelMark = 'label', selectLabelCondition, selectFilterCondition, defaultValue, disableUnderline, items = [], rowHeight, remoteRowCount, loadMoreRows, onCreateOption, itemRenderer, onInputChange, onClearRows, onInnerValueChange, hideMenuOnNoResults, hideEditIcon, remoteData, createLabel, returnType = 'string', alwaysDisplayDefault, valueRenderer, popperAnchor, input, meta: { error, invalid }, placeholder, sort, sortPropKey, inputRef, warning, multiple, rightAligned, hasError, categoryKey, editIcon, variant }) {
|
|
51
|
-
const classes = useStyles();
|
|
52
|
+
const { classes: ownClasses, cx } = useStyles();
|
|
53
|
+
const { classes: selectClasses } = useSelectStyles();
|
|
54
|
+
const classes = Object.assign(Object.assign({}, selectClasses), ownClasses);
|
|
52
55
|
const sortedItems = useMemo(() => {
|
|
53
56
|
const sorted = items && (sort
|
|
54
57
|
? [...items].sort(typeof sort === 'function'
|
|
@@ -265,7 +268,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
265
268
|
: (React.createElement("div", null,
|
|
266
269
|
allowEmpty && input.value && (React.createElement(IconButton, { size: "small", onClick: onClear, color: "inherit" },
|
|
267
270
|
React.createElement(CloseIcon, { fontSize: "inherit" }))),
|
|
268
|
-
editIcon === undefined ? React.createElement(IconButton, { size: "small", color: "inherit", className:
|
|
271
|
+
editIcon === undefined ? React.createElement(IconButton, { size: "small", color: "inherit", className: cx(classes.expandIcon, 'pl-0 pr-0'), disableRipple: true },
|
|
269
272
|
React.createElement(ExpandMore, { className: inline && 'fsInherit' })) : editIcon))), [disabled, loading, inline, allowEmpty, input.value]);
|
|
270
273
|
const inputValue = useMemo(() => {
|
|
271
274
|
if (multiple) {
|
|
@@ -282,8 +285,8 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
282
285
|
return (React.createElement(EditInPlaceFieldBase, Object.assign({}, params, { variant: variant, key: input.name, name: input.name, value: value, error: error, invalid: hasError || invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, rightAligned: rightAligned, shrink: Boolean(label || input.value), labelAdornment: labelAdornment, placeholder: renderedPlaceholder, editIcon: !hideEditIcon && renderIcons, InputProps: Object.assign(Object.assign({}, InputProps), { endAdornment: null, onChange: handleInputChange, onFocus: edit, onClick: onEditButtonFocus, onBlur,
|
|
283
286
|
disableUnderline, classes: {
|
|
284
287
|
underline: fieldClasses.underline,
|
|
285
|
-
input:
|
|
286
|
-
}, inputProps: Object.assign(Object.assign({}, inputProps), { value: multiple ? inputProps.value : value, className:
|
|
288
|
+
input: cx(disabled && classes.readonly, fieldClasses.text),
|
|
289
|
+
}, inputProps: Object.assign(Object.assign({}, inputProps), { value: multiple ? inputProps.value : value, className: cx(fieldClasses.text, 'mr-auto', inputProps.className), ref: ref => {
|
|
287
290
|
inputProps.ref.current = ref;
|
|
288
291
|
inputNode.current = ref;
|
|
289
292
|
if (inputRef)
|
|
@@ -293,7 +296,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
293
296
|
React.createElement(Select, Object.assign({}, InputProps, { inputRef: ref => {
|
|
294
297
|
inputProps.ref.current = ref === null || ref === void 0 ? void 0 : ref.node;
|
|
295
298
|
}, classes: {
|
|
296
|
-
select:
|
|
299
|
+
select: cx('cursor-text', fieldClasses.text)
|
|
297
300
|
}, onFocus: edit, value: (returnType === 'object' ? input.value[selectValueMark] : input.value) || '', endAdornment: React.createElement(InputAdornment, { position: "end", className: 'd-none' }, renderIcons), IconComponent: stubComponent }), renderValue)
|
|
298
301
|
: null })));
|
|
299
302
|
}, [
|
|
@@ -325,7 +328,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
325
328
|
multiple,
|
|
326
329
|
isEditing
|
|
327
330
|
]);
|
|
328
|
-
return (React.createElement("div", { className:
|
|
331
|
+
return (React.createElement("div", { className: cx(className, 'outline-none', inline && classes.inline), id: input === null || input === void 0 ? void 0 : input.name },
|
|
329
332
|
React.createElement(SelectContext.Provider, { value: {
|
|
330
333
|
rowHeight,
|
|
331
334
|
remoteRowCount,
|
|
@@ -340,10 +343,10 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
340
343
|
selectAdornment
|
|
341
344
|
} },
|
|
342
345
|
React.createElement(Autocomplete, { blurOnSelect: !multiple, disableCloseOnSelect: multiple, multiple: multiple, value: inputValue, options: sortedItems, loading: loading, freeSolo: creatable, disabled: disabled, disableClearable: !allowEmpty, isOptionEqualToValue: getOptionSelected, onChange: handleChange, classes: {
|
|
343
|
-
root:
|
|
346
|
+
root: cx('d-inline-flex', classes.root),
|
|
344
347
|
hasPopupIcon: classes.hasPopup,
|
|
345
348
|
hasClearIcon: classes.hasClear,
|
|
346
|
-
inputRoot:
|
|
349
|
+
inputRoot: cx(classes.inputWrapper, multiple && classes.multiple),
|
|
347
350
|
option: 'w-100 text-pre',
|
|
348
351
|
popper: classes.popper,
|
|
349
352
|
groupUl: 'm-0'
|
|
@@ -13,5 +13,5 @@ interface Props {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
avatarSize?: number;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: React.
|
|
16
|
+
declare const _default: React.FC<Props>;
|
|
17
17
|
export default _default;
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import Typography from '@mui/material/Typography';
|
|
7
7
|
import Button from '@mui/material/Button';
|
|
8
|
-
import {
|
|
8
|
+
import { useStyles, withStyles } from 'tss-react/mui';
|
|
9
9
|
import { darken } from '@mui/material/styles';
|
|
10
10
|
import IconButton from '@mui/material/IconButton';
|
|
11
11
|
import Tooltip from '@mui/material/Tooltip';
|
|
12
12
|
import Avatar from '@mui/material/Avatar';
|
|
13
|
-
|
|
14
|
-
const styles = (theme) => createStyles({
|
|
13
|
+
const styles = (theme) => ({
|
|
15
14
|
root: {
|
|
16
15
|
height: 'fit-content',
|
|
17
16
|
width: 'fit-content',
|
|
@@ -62,10 +61,11 @@ const styles = (theme) => createStyles({
|
|
|
62
61
|
});
|
|
63
62
|
const FilePreview = ({ label, actions, data, classes, iconPlacementRow, disabled, avatarSize }) => {
|
|
64
63
|
const size = avatarSize || 90;
|
|
64
|
+
const { cx } = useStyles();
|
|
65
65
|
return (React.createElement(React.Fragment, null,
|
|
66
66
|
label && (React.createElement(Typography, { variant: "caption", color: "textSecondary", component: "div", className: "pb-1" }, label)),
|
|
67
67
|
data ? (React.createElement("div", { className: classes.root },
|
|
68
|
-
!disabled && (React.createElement("div", { className:
|
|
68
|
+
!disabled && (React.createElement("div", { className: cx(classes.backdrop, avatarSize && classes.rounded, actions && classes.active) },
|
|
69
69
|
React.createElement("div", { className: iconPlacementRow ? 'centeredFlex' : 'flex-column' }, actions
|
|
70
70
|
&& actions.map((a, i) => (a.icon ? (React.createElement(Tooltip, { key: i, title: a.actionLabel, placement: iconPlacementRow ? 'top' : 'right' },
|
|
71
71
|
React.createElement(IconButton, { color: "inherit", size: "medium", onClick: a.onAction, disabled: a.disabled }, a.icon))) : (React.createElement(Button, { key: i, size: "small", variant: "outlined", color: "secondary", classes: {
|
|
@@ -74,4 +74,4 @@ const FilePreview = ({ label, actions, data, classes, iconPlacementRow, disabled
|
|
|
74
74
|
avatarSize
|
|
75
75
|
? (React.createElement(Avatar, { alt: "FilePreview", src: `data:image/png;base64, ${data}`, sx: { width: size, height: size }, classes: { root: classes.avatarRoot } })) : (React.createElement("img", { alt: "FilePreview", src: `data:image/png;base64, ${data}`, className: classes.avatarRoot })))) : (React.createElement(Typography, { variant: "body1", className: classes.noValue }, "No Value"))));
|
|
76
76
|
};
|
|
77
|
-
export default withStyles(styles)
|
|
77
|
+
export default withStyles(FilePreview, styles);
|
|
@@ -6,16 +6,16 @@
|
|
|
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 { FormControl, FormControlLabel, FormHelperText, InputLabel, Radio, RadioGroup
|
|
9
|
+
import { FormControl, FormControlLabel, FormHelperText, InputLabel, Radio, RadioGroup } from '@mui/material';
|
|
10
10
|
import Typography from '@mui/material/Typography';
|
|
11
11
|
import { makeAppStyles } from '../styles';
|
|
12
|
-
const useStyles = makeAppStyles(theme => ({
|
|
12
|
+
const useStyles = makeAppStyles()(theme => ({
|
|
13
13
|
group: {
|
|
14
14
|
margin: theme.spacing(1, 0)
|
|
15
15
|
}
|
|
16
16
|
}));
|
|
17
17
|
function FormRadioButtons({ items, disabled, input: { value, onChange, name }, meta: { invalid, error }, labelPath = 'label', valuePath = 'value', color = 'primary', row, label, labelClass, labelAdornment, radioProps, radioGroupProps }) {
|
|
18
|
-
const classes = useStyles();
|
|
18
|
+
const { classes } = useStyles();
|
|
19
19
|
return (React.createElement(FormControl, { fullWidth: true, component: "fieldset", error: invalid },
|
|
20
20
|
label && (React.createElement(InputLabel, { shrink: true, htmlFor: `input-${name}`, className: labelClass },
|
|
21
21
|
label,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { AppTheme } from '../model';
|
|
3
|
+
export declare const useSelectStyles: (params: void, muiStyleOverridesParams?: {
|
|
4
|
+
props: Record<string, unknown>;
|
|
5
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
6
|
+
} | undefined) => {
|
|
7
|
+
classes: Record<"label" | "error" | "root" | "multiple" | "inline" | "expandIcon" | "menuItem" | "inputWrapper" | "readonly" | "editIcon" | "bottomMargin" | "bottomPadding" | "topMargin" | "editable" | "valid" | "autoWidthSelect" | "emptySelect" | "validUnderline" | "menuItemActive" | "menuList" | "hasPopup" | "hasClear", string>;
|
|
8
|
+
theme: AppTheme;
|
|
9
|
+
css: import("tss-react").Css;
|
|
10
|
+
cx: import("tss-react").Cx;
|
|
11
|
+
};
|
|
3
12
|
export declare const ListRow: React.MemoExoticComponent<any>;
|
|
4
13
|
export declare const ListboxComponent: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
5
14
|
export declare const NoWrapOption: (content: any, data: any, search: any, parentProps: any) => React.JSX.Element;
|
|
@@ -16,18 +16,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
16
16
|
}
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
|
-
import useTheme from '@mui/
|
|
19
|
+
import { useTheme } from '@mui/system';
|
|
20
20
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import ListSubheader from '@mui/material/ListSubheader';
|
|
23
23
|
import InfiniteLoader from 'react-window-infinite-loader';
|
|
24
24
|
import { areEqual, FixedSizeList as List } from 'react-window';
|
|
25
|
-
import { createStyles } from '@mui/styles';
|
|
26
25
|
import { green } from '@mui/material/colors';
|
|
27
|
-
import clsx from 'clsx';
|
|
28
26
|
import { ListItemButton } from '@mui/material';
|
|
29
27
|
import Tooltip from '@mui/material/Tooltip';
|
|
30
|
-
|
|
28
|
+
import { makeAppStyles } from '../styles';
|
|
29
|
+
import { useStyles } from 'tss-react/mui';
|
|
30
|
+
export const useSelectStyles = makeAppStyles()(theme => ({
|
|
31
31
|
bottomMargin: {
|
|
32
32
|
marginBottom: `${theme.spacing(1) + 1}`
|
|
33
33
|
},
|
|
@@ -122,7 +122,7 @@ export const selectStyles = theme => createStyles({
|
|
|
122
122
|
paddingRight: 0
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
});
|
|
125
|
+
}));
|
|
126
126
|
export const ListRow = React.memo(({ data: { children, selectAdornment }, index, style }) => {
|
|
127
127
|
const inlineStyle = Object.assign(Object.assign({}, style), { top: style.top + 8, paddingLeft: 0, paddingRight: 0, whiteSpace: 'nowrap' });
|
|
128
128
|
return (React.createElement(ListItemButton, { style: inlineStyle }, (((selectAdornment === null || selectAdornment === void 0 ? void 0 : selectAdornment.position) === 'start' && index === 0)
|
|
@@ -137,6 +137,7 @@ const OuterElementType = React.forwardRef((props, ref) => {
|
|
|
137
137
|
});
|
|
138
138
|
export const ListboxComponent = React.forwardRef((props, ref) => {
|
|
139
139
|
const { children, rowHeight, remoteRowCount, loadMoreRows, classes, loading, selectAdornment, fieldClasses } = props, other = __rest(props, ["children", "rowHeight", "remoteRowCount", "loadMoreRows", "classes", "loading", "selectAdornment", "fieldClasses"]);
|
|
140
|
+
const { cx } = useStyles();
|
|
140
141
|
const itemData = { selectAdornment, children: React.Children.toArray(children) };
|
|
141
142
|
const theme = useTheme();
|
|
142
143
|
const smUp = useMediaQuery(theme.breakpoints.up('sm'), { noSsr: true });
|
|
@@ -158,7 +159,7 @@ export const ListboxComponent = React.forwardRef((props, ref) => {
|
|
|
158
159
|
const isItemLoaded = index => index < (children.length + (selectAdornment ? 1 : 0));
|
|
159
160
|
return (React.createElement("div", { ref: ref },
|
|
160
161
|
React.createElement(OuterElementContext.Provider, { value: other },
|
|
161
|
-
React.createElement(InfiniteLoader, { isItemLoaded: isItemLoaded, itemCount: itemCount, loadMoreItems: loadMoreItems }, ({ onItemsRendered, ref }) => (React.createElement(List, { ref: ref, height: getHeight() + 2 * 8, width: "100%", className:
|
|
162
|
+
React.createElement(InfiniteLoader, { isItemLoaded: isItemLoaded, itemCount: itemCount, loadMoreItems: loadMoreItems }, ({ onItemsRendered, ref }) => (React.createElement(List, { ref: ref, height: getHeight() + 2 * 8, width: "100%", className: cx(classes.menuList, fieldClasses.selectMenu), itemData: itemData, outerElementType: OuterElementType, onItemsRendered: onItemsRendered, itemSize: itemSize, itemCount: itemCount }, ListRow))))));
|
|
162
163
|
});
|
|
163
164
|
export const NoWrapOption = (content, data, search, parentProps) => (React.createElement("div", Object.assign({}, parentProps || {}),
|
|
164
165
|
React.createElement(Tooltip, { title: content },
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FieldInputProps, FormSwitchProps } from '../model';
|
|
6
|
-
export declare const Switch:
|
|
6
|
+
export declare const Switch: (props: any) => React.JSX.Element;
|
|
7
7
|
export declare function FormSwitch<InputProps extends FieldInputProps>({ input, color, disabled, stringValue, label, className, inline, onChangeHandler, onClick }: FormSwitchProps<InputProps>): React.JSX.Element;
|
|
@@ -22,8 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
import React, { useCallback } from 'react';
|
|
23
23
|
import MuiSwitch from '@mui/material/Switch';
|
|
24
24
|
import Typography from '@mui/material/Typography';
|
|
25
|
-
import {
|
|
26
|
-
import clsx from 'clsx';
|
|
25
|
+
import { useStyles, withStyles } from 'tss-react/mui';
|
|
27
26
|
const getValue = value => {
|
|
28
27
|
switch (value) {
|
|
29
28
|
case 'false':
|
|
@@ -34,7 +33,7 @@ const getValue = value => {
|
|
|
34
33
|
return value;
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
|
-
const styles = theme =>
|
|
36
|
+
const styles = theme => ({
|
|
38
37
|
bar: {
|
|
39
38
|
height: '22px',
|
|
40
39
|
borderRadius: '12px',
|
|
@@ -86,16 +85,17 @@ const styles = theme => createStyles({
|
|
|
86
85
|
});
|
|
87
86
|
const SwitchBase = props => {
|
|
88
87
|
const { classes, color = 'primary', inline, checked } = props, custom = __rest(props, ["classes", "color", "inline", "checked"]);
|
|
88
|
+
const { cx } = useStyles();
|
|
89
89
|
return (React.createElement(MuiSwitch, Object.assign({ color: color, checked: Boolean(checked), classes: {
|
|
90
90
|
track: classes.bar,
|
|
91
|
-
root:
|
|
91
|
+
root: cx(classes.root, { [classes.inline]: inline }),
|
|
92
92
|
checked: classes.checked,
|
|
93
93
|
thumb: classes.icon,
|
|
94
94
|
switchBase: classes.default,
|
|
95
95
|
disabled: classes.disabled
|
|
96
96
|
} }, custom)));
|
|
97
97
|
};
|
|
98
|
-
export const Switch = withStyles(styles)
|
|
98
|
+
export const Switch = withStyles(SwitchBase, styles);
|
|
99
99
|
export function FormSwitch({ input, color, disabled, stringValue, label, className, inline, onChangeHandler, onClick }) {
|
|
100
100
|
const onChange = useCallback((e, value) => {
|
|
101
101
|
let checked = value;
|
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
* Wrapper component for Material Text Field
|
|
3
3
|
* */
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
|
|
5
|
+
declare class TextInput extends React.Component<any, any> {
|
|
6
|
+
render(): React.JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export declare const TextField: typeof TextInput;
|
|
6
9
|
export declare const FormTextField: (props: any) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
* Wrapper component for Material Text Field
|
|
21
21
|
* */
|
|
22
22
|
import * as React from 'react';
|
|
23
|
-
import { withStyles } from '
|
|
23
|
+
import { withStyles } from 'tss-react/mui';
|
|
24
24
|
import MuiTextField from '@mui/material/TextField';
|
|
25
25
|
const styles = theme => ({
|
|
26
26
|
textField: {
|
|
@@ -34,7 +34,7 @@ class TextInput extends React.Component {
|
|
|
34
34
|
return (React.createElement(MuiTextField, Object.assign({ name: props.id, onChange: e => onChange(e.target.value, id), margin: margin }, props, { variant: "standard" })));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
export const TextField = withStyles(styles)
|
|
37
|
+
export const TextField = withStyles(TextInput, styles);
|
|
38
38
|
// Form field text component creator
|
|
39
39
|
export const FormTextField = props => {
|
|
40
40
|
const { input, meta: { error, invalid, touched }, helperText, inputRef } = props, custom = __rest(props, ["input", "meta", "helperText", "inputRef"]);
|
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
*
|
|
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
|
-
import clsx from 'clsx';
|
|
9
8
|
import React, { useCallback } from 'react';
|
|
10
9
|
import { FormControl, FormHelperText, Input, InputLabel } from '@mui/material';
|
|
11
10
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
12
11
|
import { makeAppStyles } from '../styles';
|
|
13
12
|
import { LinkAdornment } from './FieldAdornments';
|
|
14
13
|
import { formatCurrency, openInternalLink } from '../utils';
|
|
15
|
-
const useStyles = makeAppStyles({
|
|
14
|
+
const useStyles = makeAppStyles()({
|
|
16
15
|
rightAlignedLabel: {
|
|
17
16
|
left: 'unset',
|
|
18
17
|
right: 0,
|
|
@@ -21,12 +20,12 @@ const useStyles = makeAppStyles({
|
|
|
21
20
|
});
|
|
22
21
|
const UneditableBase = React.memo(props => {
|
|
23
22
|
const { label, labelAdornment, placeholder, rightAligned, value, url, money, currencySymbol, className, format, multiline, error } = props;
|
|
24
|
-
const classes = useStyles();
|
|
23
|
+
const { classes, cx } = useStyles();
|
|
25
24
|
const inputId = `input-${label.toLowerCase().replace(' ', '-')}`;
|
|
26
25
|
const openLink = useCallback(() => {
|
|
27
26
|
openInternalLink(url);
|
|
28
27
|
}, [url]);
|
|
29
|
-
return (React.createElement(FormControl, { className:
|
|
28
|
+
return (React.createElement(FormControl, { className: cx(className, money && 'money'), error: Boolean(error), variant: "standard", fullWidth: true },
|
|
30
29
|
React.createElement(InputLabel, { shrink: true, classes: {
|
|
31
30
|
root: rightAligned ? classes.rightAlignedLabel : null
|
|
32
31
|
}, htmlFor: inputId },
|
package/dist/layout/InfoPill.js
CHANGED
|
@@ -9,18 +9,18 @@ import { Chip } from '@mui/material';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { alpha } from '@mui/material/styles';
|
|
11
11
|
import { makeAppStyles } from '../styles';
|
|
12
|
-
const useStyles = makeAppStyles(theme => ({
|
|
12
|
+
const useStyles = makeAppStyles()((theme, { color }) => ({
|
|
13
13
|
chip: {
|
|
14
14
|
textTransform: 'uppercase',
|
|
15
15
|
fontWeight: 600,
|
|
16
16
|
fontSize: '12px',
|
|
17
17
|
marginLeft: theme.spacing(1),
|
|
18
|
-
color:
|
|
19
|
-
backgroundColor:
|
|
18
|
+
color: theme.palette[color].light,
|
|
19
|
+
backgroundColor: alpha(theme.palette[color].light, 0.15)
|
|
20
20
|
}
|
|
21
21
|
}));
|
|
22
22
|
const InfoPill = ({ label, color = label === 'custom' ? 'primary' : 'success' }) => {
|
|
23
|
-
const classes = useStyles({ label, color });
|
|
23
|
+
const { classes } = useStyles({ label, color });
|
|
24
24
|
return React.createElement(Chip, { className: classes.chip, label: label, size: "small" });
|
|
25
25
|
};
|
|
26
26
|
export default InfoPill;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Resizable } from 're-resizable';
|
|
3
|
-
import {
|
|
3
|
+
import { useStyles, withStyles } from 'tss-react/mui';
|
|
4
4
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
5
|
const LIST_SIDE_BAR_DEFAULT_WIDTH = 280;
|
|
7
|
-
const styles = (theme) =>
|
|
6
|
+
const styles = (theme) => ({
|
|
8
7
|
sideBar: {
|
|
9
8
|
borderRight: `1px solid ${theme.palette.divider}`,
|
|
10
9
|
display: 'flex',
|
|
@@ -35,8 +34,9 @@ const styles = (theme) => createStyles({
|
|
|
35
34
|
});
|
|
36
35
|
const ResizableWrapper = (props) => {
|
|
37
36
|
const { classes, onResizeStop, onResize, sidebarWidth, minWidth, maxWidth, children, className, ignoreScreenWidth } = props;
|
|
38
|
-
|
|
37
|
+
const { cx } = useStyles();
|
|
38
|
+
return useMediaQuery('(min-width:992px)') || ignoreScreenWidth ? (React.createElement(Resizable, { size: { width: sidebarWidth, height: '100%' }, minWidth: minWidth || LIST_SIDE_BAR_DEFAULT_WIDTH, maxWidth: maxWidth, onResizeStop: onResizeStop, onResize: onResize, enable: { right: true }, className: cx(classes.sideBar, className), handleClasses: { right: classes.resizeLine }, handleComponent: { right: React.createElement("div", { className: props.classes.line }) } },
|
|
39
39
|
React.createElement("div", { className: classes.sideBarWrapper }, children))) : (children);
|
|
40
40
|
};
|
|
41
|
-
const wrapped = withStyles(styles)
|
|
41
|
+
const wrapped = withStyles(ResizableWrapper, styles);
|
|
42
42
|
export default wrapped;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
2
|
import 'ace-builds/webpack-resolver';
|
|
3
3
|
import 'ace-builds/src-noconflict/mode-html';
|
|
4
4
|
import 'ace-builds/src-noconflict/mode-textile';
|
|
@@ -11,5 +11,5 @@ interface Props {
|
|
|
11
11
|
mode?: string;
|
|
12
12
|
onChange?: (html: any) => void;
|
|
13
13
|
}
|
|
14
|
-
declare const _default:
|
|
14
|
+
declare const _default: FunctionComponent<Props>;
|
|
15
15
|
export default _default;
|
|
@@ -22,7 +22,7 @@ import Image from '@ckeditor/ckeditor5-image/src/image';
|
|
|
22
22
|
import LinkImage from '@ckeditor/ckeditor5-link/src/linkimage';
|
|
23
23
|
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
|
|
24
24
|
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
|
|
25
|
-
import { CKEditor } from '@ckeditor/ckeditor5-react
|
|
25
|
+
import { CKEditor } from '@ckeditor/ckeditor5-react';
|
|
26
26
|
import { createRoot } from 'react-dom/client';
|
|
27
27
|
import CodeIcon from '@mui/icons-material/Code';
|
|
28
28
|
const SourceEditingSwitch = () => (React.createElement("div", { className: "ck_source_edit_custom" },
|
package/dist/model/Theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Theme, Palette, SimplePaletteColorOptions, TypeText } from '@mui/material';
|
|
2
1
|
import { StringKeyObject } from '../model/CommomObjects';
|
|
2
|
+
import { Palette, SimplePaletteColorOptions, Theme, TypeText } from '@mui/material/styles';
|
|
3
3
|
declare enum ThemeValuesEnum {
|
|
4
4
|
'default' = 0,
|
|
5
5
|
'dark' = 1,
|
|
@@ -11,7 +11,7 @@ export declare const DefaultThemeKey: ThemeValues;
|
|
|
11
11
|
export declare const DarkThemeKey: ThemeValues;
|
|
12
12
|
export declare const MonochromeThemeKey: ThemeValues;
|
|
13
13
|
export declare const HighcontrastThemeKey: ThemeValues;
|
|
14
|
-
type ColorGetter = string
|
|
14
|
+
type ColorGetter = string;
|
|
15
15
|
type TextExtended = TypeText & {
|
|
16
16
|
primaryEditable: string;
|
|
17
17
|
hint: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
2
|
+
export declare const GlobalStylesProvider: ({ children }: {
|
|
3
|
+
children: any;
|
|
4
|
+
}) => React.JSX.Element;
|