ish-ui 1.0.19 → 1.0.21
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/actions/FieldProcessing.d.ts +10 -0
- package/dist/actions/FieldProcessing.js +17 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +8 -0
- package/dist/appBar/AppBarHelpMenu.d.ts +3 -0
- package/dist/appBar/AppBarHelpMenu.js +77 -0
- package/dist/appBar/index.d.ts +2 -0
- package/dist/appBar/index.js +9 -0
- package/dist/buttons/AddButton.d.ts +14 -0
- package/dist/buttons/AddButton.js +9 -0
- package/dist/buttons/TimetableButton.d.ts +3 -0
- package/dist/buttons/TimetableButton.js +12 -0
- package/dist/buttons/index.d.ts +4 -0
- package/dist/buttons/index.js +11 -0
- package/dist/colorPicker/ColorPicker.d.ts +4 -0
- package/dist/colorPicker/ColorPicker.js +138 -0
- package/dist/colorPicker/index.d.ts +2 -0
- package/dist/colorPicker/index.js +9 -0
- package/dist/dialog/BrowserWarning.d.ts +3 -0
- package/dist/dialog/BrowserWarning.js +16 -0
- package/dist/dialog/confirm/ConfirmBase.d.ts +7 -0
- package/dist/dialog/confirm/ConfirmBase.js +29 -0
- package/dist/dialog/index.d.ts +5 -0
- package/dist/dialog/index.js +12 -0
- package/dist/dialog/message/Message.d.ts +3 -0
- package/dist/dialog/message/Message.js +91 -0
- package/dist/documents/DocumentIconsChooser.d.ts +3 -0
- package/dist/documents/DocumentIconsChooser.js +51 -0
- package/dist/documents/index.d.ts +3 -0
- package/dist/documents/index.js +10 -0
- package/dist/documents/utils/index.d.ts +7 -0
- package/dist/documents/utils/index.js +61 -0
- package/dist/dynamicSizeList/DynamicSizeList.d.ts +17 -0
- package/dist/dynamicSizeList/DynamicSizeList.js +167 -0
- package/dist/dynamicSizeList/index.d.ts +2 -0
- package/dist/dynamicSizeList/index.js +9 -0
- package/dist/fieldMessage/ErrorMessage.d.ts +8 -0
- package/dist/fieldMessage/ErrorMessage.js +14 -0
- package/dist/fieldMessage/WarningMessage.d.ts +8 -0
- package/dist/fieldMessage/WarningMessage.js +14 -0
- package/dist/fieldMessage/index.d.ts +6 -0
- package/dist/fieldMessage/index.js +13 -0
- package/dist/fieldMessage/styles.d.ts +3 -0
- package/dist/fieldMessage/styles.js +18 -0
- package/dist/fileUploader/FileUploaderDialog.d.ts +15 -0
- package/dist/fileUploader/FileUploaderDialog.js +99 -0
- package/dist/fileUploader/index.d.ts +2 -0
- package/dist/fileUploader/index.js +9 -0
- package/dist/formFields/CheckboxField.d.ts +7 -0
- package/dist/formFields/CheckboxField.js +67 -0
- package/dist/formFields/CodeEditorField.d.ts +6 -0
- package/dist/formFields/CodeEditorField.js +69 -0
- package/dist/formFields/ColoredCheckBox.d.ts +3 -0
- package/dist/formFields/ColoredCheckBox.js +41 -0
- package/dist/formFields/DateTimeField.d.ts +2 -0
- package/dist/formFields/DateTimeField.js +27 -0
- package/dist/formFields/EditInPlaceDateTimeField.d.ts +10 -0
- package/dist/formFields/EditInPlaceDateTimeField.js +188 -0
- package/dist/formFields/EditInPlaceDurationField.d.ts +4 -0
- package/dist/formFields/EditInPlaceDurationField.js +63 -0
- package/dist/formFields/EditInPlaceField.d.ts +10 -0
- package/dist/formFields/EditInPlaceField.js +58 -0
- package/dist/formFields/EditInPlaceFieldBase.d.ts +28 -0
- package/dist/formFields/EditInPlaceFieldBase.js +123 -0
- package/dist/formFields/EditInPlaceFileField.d.ts +7 -0
- package/dist/formFields/EditInPlaceFileField.js +60 -0
- package/dist/formFields/EditInPlaceMoneyField.d.ts +9 -0
- package/dist/formFields/EditInPlaceMoneyField.js +37 -0
- package/dist/formFields/EditInPlacePhoneField.d.ts +4 -0
- package/dist/formFields/EditInPlacePhoneField.js +69 -0
- package/dist/formFields/EditInPlaceSearchSelect.d.ts +4 -0
- package/dist/formFields/EditInPlaceSearchSelect.js +321 -0
- package/dist/formFields/FieldAdornments.d.ts +13 -0
- package/dist/formFields/FieldAdornments.js +27 -0
- package/dist/formFields/FilePreview.d.ts +17 -0
- package/dist/formFields/FilePreview.js +77 -0
- package/dist/formFields/FormRadioButtons.d.ts +3 -0
- package/dist/formFields/FormRadioButtons.js +27 -0
- package/dist/formFields/SelectCustomComponents.d.ts +5 -0
- package/dist/formFields/SelectCustomComponents.js +182 -0
- package/dist/formFields/Switch.d.ts +7 -0
- package/dist/formFields/Switch.js +116 -0
- package/dist/formFields/TextField.d.ts +6 -0
- package/dist/formFields/TextField.js +42 -0
- package/dist/formFields/UneditableBase.d.ts +17 -0
- package/dist/formFields/UneditableBase.js +48 -0
- package/dist/formFields/index.d.ts +31 -0
- package/dist/formFields/index.js +38 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +25 -0
- package/dist/layout/InfoPill.d.ts +7 -0
- package/dist/layout/InfoPill.js +26 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.js +11 -0
- package/dist/layout/resizable/ResizableWrapper.d.ts +14 -0
- package/dist/layout/resizable/ResizableWrapper.js +42 -0
- package/dist/markdownEditor/HtmlEditor.d.ts +15 -0
- package/dist/markdownEditor/HtmlEditor.js +18 -0
- package/dist/markdownEditor/WysiwygEditor.d.ts +8 -0
- package/dist/markdownEditor/WysiwygEditor.js +98 -0
- package/dist/markdownEditor/index.d.ts +5 -0
- package/dist/markdownEditor/index.js +12 -0
- package/dist/markdownEditor/utils/index.d.ts +9 -0
- package/dist/markdownEditor/utils/index.js +38 -0
- package/dist/model/AppBar.d.ts +11 -0
- package/dist/model/AppBar.js +8 -0
- package/dist/model/CommomObjects.d.ts +5 -0
- package/dist/model/CommomObjects.js +1 -0
- package/dist/model/CommonFunctions.d.ts +8 -0
- package/dist/model/CommonFunctions.js +5 -0
- package/dist/model/Confirm.d.ts +16 -0
- package/dist/model/Confirm.js +8 -0
- package/dist/model/Fields.d.ts +258 -0
- package/dist/model/Fields.js +8 -0
- package/dist/model/NestedEntity.d.ts +9 -0
- package/dist/model/NestedEntity.js +5 -0
- package/dist/model/Theme.d.ts +34 -0
- package/dist/model/Theme.js +18 -0
- package/dist/model/index.d.ts +7 -0
- package/dist/model/index.js +14 -0
- package/dist/styles/GlobalStylesProvider.d.ts +3 -0
- package/dist/styles/GlobalStylesProvider.js +417 -0
- package/dist/styles/StylesProviderCustom.d.ts +3 -0
- package/dist/styles/StylesProviderCustom.js +6 -0
- package/dist/styles/animateStyles.d.ts +3 -0
- package/dist/styles/animateStyles.js +33 -0
- package/dist/styles/bootstrap.d.ts +491 -0
- package/dist/styles/bootstrap.js +496 -0
- package/dist/styles/hooks.d.ts +6 -0
- package/dist/styles/hooks.js +38 -0
- package/dist/styles/index.d.ts +11 -0
- package/dist/styles/index.js +18 -0
- package/dist/styles/makeStyles.d.ts +3 -0
- package/dist/styles/makeStyles.js +9 -0
- package/dist/styles/mixins/common.d.ts +8 -0
- package/dist/styles/mixins/common.js +32 -0
- package/dist/styles/mixins/keyframes.d.ts +3 -0
- package/dist/styles/mixins/keyframes.js +9 -0
- package/dist/styles/mixins/prefixer.d.ts +1 -0
- package/dist/styles/mixins/prefixer.js +23 -0
- package/dist/tagsInput/AddTagMenu.d.ts +12 -0
- package/dist/tagsInput/AddTagMenu.js +36 -0
- package/dist/tagsInput/AddTagMenuItem.d.ts +11 -0
- package/dist/tagsInput/AddTagMenuItem.js +29 -0
- package/dist/tagsInput/TagInputList.d.ts +4 -0
- package/dist/tagsInput/TagInputList.js +273 -0
- package/dist/tagsInput/index.d.ts +6 -0
- package/dist/tagsInput/index.js +6 -0
- package/dist/themes/appTheme.d.ts +4 -0
- package/dist/themes/appTheme.js +322 -0
- package/dist/themes/index.d.ts +2 -0
- package/dist/themes/index.js +9 -0
- package/dist/themes/ishTheme.d.ts +8 -0
- package/dist/themes/ishTheme.js +351 -0
- package/dist/timetable/datePeriodFilter/DayPeriodIcons.d.ts +8 -0
- package/dist/timetable/datePeriodFilter/DayPeriodIcons.js +27 -0
- package/dist/timetable/datePeriodFilter/index.d.ts +1 -0
- package/dist/timetable/datePeriodFilter/index.js +8 -0
- package/dist/timetable/index.d.ts +2 -0
- package/dist/timetable/index.js +9 -0
- package/dist/timetable/miniCalendar/CalendarDay.d.ts +15 -0
- package/dist/timetable/miniCalendar/CalendarDay.js +64 -0
- package/dist/timetable/miniCalendar/CalendarHeader.d.ts +10 -0
- package/dist/timetable/miniCalendar/CalendarHeader.js +22 -0
- package/dist/timetable/miniCalendar/CalendarWeekPanel.d.ts +8 -0
- package/dist/timetable/miniCalendar/CalendarWeekPanel.js +18 -0
- package/dist/timetable/miniCalendar/WeekDay.d.ts +10 -0
- package/dist/timetable/miniCalendar/WeekDay.js +25 -0
- package/dist/timetable/miniCalendar/index.d.ts +8 -0
- package/dist/timetable/miniCalendar/index.js +15 -0
- package/dist/utils/DOM/Links.d.ts +1 -0
- package/dist/utils/DOM/Links.js +12 -0
- package/dist/utils/DOM/getCaretCoordinates.d.ts +6 -0
- package/dist/utils/DOM/getCaretCoordinates.js +109 -0
- package/dist/utils/DOM/getOS.d.ts +2 -0
- package/dist/utils/DOM/getOS.js +32 -0
- package/dist/utils/DOM/index.d.ts +5 -0
- package/dist/utils/DOM/index.js +32 -0
- package/dist/utils/dates/datesNormalizing.d.ts +1 -0
- package/dist/utils/dates/datesNormalizing.js +3 -0
- package/dist/utils/dates/format.d.ts +24 -0
- package/dist/utils/dates/format.js +28 -0
- package/dist/utils/dates/formatRelative.d.ts +1 -0
- package/dist/utils/dates/formatRelative.js +14 -0
- package/dist/utils/dates/formatString.d.ts +2 -0
- package/dist/utils/dates/formatString.js +195 -0
- package/dist/utils/dates/formatTimezone.d.ts +2 -0
- package/dist/utils/dates/formatTimezone.js +35 -0
- package/dist/utils/dates/index.d.ts +6 -0
- package/dist/utils/dates/index.js +13 -0
- package/dist/utils/dates/timetable.d.ts +5 -0
- package/dist/utils/dates/timetable.js +38 -0
- package/dist/utils/events/index.d.ts +2 -0
- package/dist/utils/events/index.js +6 -0
- package/dist/utils/fields/index.d.ts +1 -0
- package/dist/utils/fields/index.js +20 -0
- package/dist/utils/formatting/PhoneMasks.d.ts +304 -0
- package/dist/utils/formatting/PhoneMasks.js +318 -0
- package/dist/utils/formatting/index.d.ts +2 -0
- package/dist/utils/formatting/index.js +10 -0
- package/dist/utils/hooks/index.d.ts +1 -0
- package/dist/utils/hooks/index.js +15 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/numbers/decimalCalculation.d.ts +4 -0
- package/dist/utils/numbers/decimalCalculation.js +21 -0
- package/dist/utils/numbers/index.d.ts +2 -0
- package/dist/utils/numbers/index.js +9 -0
- package/dist/utils/numbers/numbersNormalizing.d.ts +10 -0
- package/dist/utils/numbers/numbersNormalizing.js +44 -0
- package/dist/utils/stubs/index.d.ts +3 -0
- package/dist/utils/stubs/index.js +10 -0
- package/dist/utils/tags/index.d.ts +3 -0
- package/dist/utils/tags/index.js +42 -0
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2022.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
10
|
+
export const formatDocumentSize = (size) => {
|
|
11
|
+
if (size < Math.pow(1024, 2)) {
|
|
12
|
+
return `${Math.round(size / 1024)} kb`;
|
|
13
|
+
}
|
|
14
|
+
if (size < Math.pow(1024, 3)) {
|
|
15
|
+
return `${Math.round(size / 1024 / 1024)} Mb`;
|
|
16
|
+
}
|
|
17
|
+
if (size < Math.pow(1024, 4)) {
|
|
18
|
+
return `${Math.round(size / 1024 / 1024 / 1024)} Gb`;
|
|
19
|
+
}
|
|
20
|
+
return size.toString();
|
|
21
|
+
};
|
|
22
|
+
export const getDocumentContent = (file) => {
|
|
23
|
+
const reader = new FileReader();
|
|
24
|
+
return new Promise(resolve => {
|
|
25
|
+
reader.onload = () => resolve(reader.result);
|
|
26
|
+
reader.readAsDataURL(file);
|
|
27
|
+
}).then((result) => result.replace(`data:${file.type};base64,`, ''));
|
|
28
|
+
};
|
|
29
|
+
export const getDocumentThumbnail = (file) => {
|
|
30
|
+
if (file.type.match(/image/)) {
|
|
31
|
+
return getDocumentContent(file);
|
|
32
|
+
}
|
|
33
|
+
return new Promise(resolve => resolve(''));
|
|
34
|
+
};
|
|
35
|
+
const getIcon = type => {
|
|
36
|
+
switch (type) {
|
|
37
|
+
case 'image/tiff':
|
|
38
|
+
case 'image/bmp':
|
|
39
|
+
case 'image/png':
|
|
40
|
+
case 'image/gif':
|
|
41
|
+
case 'image/jpeg':
|
|
42
|
+
return 'file-image';
|
|
43
|
+
case 'application/pdf':
|
|
44
|
+
return 'file-pdf';
|
|
45
|
+
case 'application/msword':
|
|
46
|
+
return 'file-word';
|
|
47
|
+
case 'application/vnd.ms-excel':
|
|
48
|
+
return 'file-excel';
|
|
49
|
+
case 'application/vnd.ms-powerpoint':
|
|
50
|
+
return 'file-powerpoint';
|
|
51
|
+
case 'application/zip':
|
|
52
|
+
return 'file-archive';
|
|
53
|
+
case 'application/x-gzip':
|
|
54
|
+
return 'file-archive';
|
|
55
|
+
case 'application/txt':
|
|
56
|
+
return 'file-alt';
|
|
57
|
+
default:
|
|
58
|
+
return 'file';
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export const FileTypeIcon = ({ mimeType }) => React.createElement(FontAwesomeIcon, { icon: getIcon(mimeType), fixedWidth: true, className: "w-100 h-100" });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VariableSizeListProps } from 'react-window';
|
|
3
|
+
interface Props extends Omit<VariableSizeListProps, 'itemSize'> {
|
|
4
|
+
listRef?: any;
|
|
5
|
+
}
|
|
6
|
+
declare class DynamicSizeList extends React.Component<Props> {
|
|
7
|
+
listRef: React.RefObject<any>;
|
|
8
|
+
rowSizes: any[];
|
|
9
|
+
componentDidMount(): void;
|
|
10
|
+
attachRefs: (node: any) => void;
|
|
11
|
+
render(): React.JSX.Element;
|
|
12
|
+
scrollToItem(index: any, align: any): void;
|
|
13
|
+
renderItem: (props: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
14
|
+
handleNewMeasurements: (index: any, newSize: any) => void;
|
|
15
|
+
getItemSize: (index: any) => any;
|
|
16
|
+
}
|
|
17
|
+
export default DynamicSizeList;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2022.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
+
t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
import React from 'react';
|
|
20
|
+
import { VariableSizeList } from 'react-window';
|
|
21
|
+
class ItemMeasurer extends React.Component {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this._node = null;
|
|
25
|
+
this._resizeObserver = null;
|
|
26
|
+
this._measureItem = () => {
|
|
27
|
+
const { handleNewMeasurements, index } = this.props;
|
|
28
|
+
const node = this._node;
|
|
29
|
+
if (node) {
|
|
30
|
+
const { height, width } = node.getBoundingClientRect();
|
|
31
|
+
const isVisible = height > 0 || width > 0;
|
|
32
|
+
if (isVisible) {
|
|
33
|
+
const newSize = Math.ceil(height);
|
|
34
|
+
handleNewMeasurements(index, newSize);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this._refSetter = ref => {
|
|
39
|
+
if (this._resizeObserver !== null && this._node !== null) {
|
|
40
|
+
this._resizeObserver.unobserve(this._node);
|
|
41
|
+
}
|
|
42
|
+
if (ref) {
|
|
43
|
+
this._node = ref;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this._node = null;
|
|
47
|
+
}
|
|
48
|
+
if (this._resizeObserver !== null && this._node !== null) {
|
|
49
|
+
this._resizeObserver.observe(this._node);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
this._onResize = entries => {
|
|
53
|
+
const _this = this;
|
|
54
|
+
window.requestAnimationFrame(() => {
|
|
55
|
+
if (!Array.isArray(entries) || !entries.length) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
_this._measureItem();
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
componentDidMount() {
|
|
63
|
+
this._measureItem();
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
if (typeof window.ResizeObserver !== 'undefined') {
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
this._resizeObserver = new window.ResizeObserver(this._onResize);
|
|
68
|
+
if (this._node !== null) {
|
|
69
|
+
this._resizeObserver.observe(this._node);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
//
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
componentWillUnmount() {
|
|
77
|
+
if (this._resizeObserver !== null) {
|
|
78
|
+
this._resizeObserver.disconnect();
|
|
79
|
+
this._resizeObserver = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return React.cloneElement(this.props.item, {
|
|
84
|
+
ref: this._refSetter
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
class DynamicSizeList extends React.Component {
|
|
89
|
+
constructor() {
|
|
90
|
+
super(...arguments);
|
|
91
|
+
this.listRef = React.createRef();
|
|
92
|
+
this.rowSizes = [];
|
|
93
|
+
this.attachRefs = node => {
|
|
94
|
+
const { listRef } = this.props;
|
|
95
|
+
if (node) {
|
|
96
|
+
if (!this.listRef.current) {
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
this.listRef.current = node;
|
|
99
|
+
}
|
|
100
|
+
if (typeof listRef === 'function') {
|
|
101
|
+
listRef(node);
|
|
102
|
+
}
|
|
103
|
+
if (typeof listRef === 'object') {
|
|
104
|
+
listRef.current = node;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
this.renderItem = props => {
|
|
109
|
+
// clear height
|
|
110
|
+
if (props.style.height !== undefined) {
|
|
111
|
+
props.style.height = undefined;
|
|
112
|
+
}
|
|
113
|
+
return React.createElement(ItemMeasurer, {
|
|
114
|
+
index: props.index,
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
item: React.createElement(this.props.children, props),
|
|
117
|
+
handleNewMeasurements: this.handleNewMeasurements
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
this.handleNewMeasurements = (index, newSize) => {
|
|
121
|
+
const itemSizeDelta = newSize - this.getItemSize(index);
|
|
122
|
+
if (itemSizeDelta !== 0) {
|
|
123
|
+
this.rowSizes[index] = newSize;
|
|
124
|
+
const ref = this.listRef.current;
|
|
125
|
+
if (ref) {
|
|
126
|
+
const { isScrolling, scrollDirection } = ref.state;
|
|
127
|
+
if (isScrolling && scrollDirection === 'backward') {
|
|
128
|
+
ref._outerRef.scrollBy({
|
|
129
|
+
top: itemSizeDelta,
|
|
130
|
+
left: 0,
|
|
131
|
+
behavior: 'auto'
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
ref.resetAfterIndex(index, true);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
this.getItemSize = index => {
|
|
139
|
+
// https://react-window.now.sh/#/api/VariableSizeList
|
|
140
|
+
const defaultEstimatedItemSize = 50;
|
|
141
|
+
return (this.rowSizes[index]
|
|
142
|
+
|| this.props.estimatedItemSize
|
|
143
|
+
|| defaultEstimatedItemSize);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
componentDidMount() {
|
|
147
|
+
const ref = this.listRef.current;
|
|
148
|
+
if (ref) {
|
|
149
|
+
ref.resetAfterIndex(0, true);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
const _a = this.props, { children } = _a, rest = __rest(_a, ["children"]);
|
|
154
|
+
return (React.createElement(VariableSizeList, Object.assign({}, rest, { ref: this.attachRefs, itemSize: this.getItemSize }), this.renderItem));
|
|
155
|
+
}
|
|
156
|
+
scrollToItem(index, align) {
|
|
157
|
+
const ref = this.listRef.current;
|
|
158
|
+
if (ref) {
|
|
159
|
+
ref.scrollToItem(index, align);
|
|
160
|
+
//
|
|
161
|
+
window.requestAnimationFrame(() => {
|
|
162
|
+
ref.scrollToItem(index, align);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export default DynamicSizeList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
export * from './DynamicSizeList';
|
|
9
|
+
export { default as DynamicSizeList } from './DynamicSizeList';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
classes?: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"icon" | "root">>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
|
|
3
|
+
* No copying or use of this code is allowed without permission in writing from ish.
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Error from '@mui/icons-material/Error';
|
|
7
|
+
import Typography from '@mui/material/Typography';
|
|
8
|
+
import withStyles from '@mui/styles/withStyles';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
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);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
classes?: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
warning: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"icon" | "root">>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
|
|
3
|
+
* No copying or use of this code is allowed without permission in writing from ish.
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Warning from '@mui/icons-material/Warning';
|
|
7
|
+
import Typography from '@mui/material/Typography';
|
|
8
|
+
import withStyles from '@mui/styles/withStyles';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
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);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
export * from './styles';
|
|
9
|
+
export * from './ErrorMessage';
|
|
10
|
+
export * from './WarningMessage';
|
|
11
|
+
export { default as styles } from './styles';
|
|
12
|
+
export { default as ErrorMessage } from './ErrorMessage';
|
|
13
|
+
export { default as WarningMessage } from './WarningMessage';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
|
|
3
|
+
* No copying or use of this code is allowed without permission in writing from ish.
|
|
4
|
+
*/
|
|
5
|
+
import { createStyles } from '@mui/styles';
|
|
6
|
+
export default (theme) => createStyles({
|
|
7
|
+
root: {
|
|
8
|
+
marginTop: `-${theme.spacing(1)}`,
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
paddingBottom: `${theme.spacing(2) - 3}`,
|
|
11
|
+
},
|
|
12
|
+
icon: {
|
|
13
|
+
fontSize: theme.spacing(2),
|
|
14
|
+
display: 'inline-block',
|
|
15
|
+
verticalAlign: 'middle',
|
|
16
|
+
marginRight: theme.spacing(0.5),
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
fileRef?: any;
|
|
4
|
+
classes?: any;
|
|
5
|
+
opened?: boolean;
|
|
6
|
+
backdropEnabled?: boolean;
|
|
7
|
+
dialog?: boolean;
|
|
8
|
+
onChange?: (acceptedfiles: any[], fileRejections: any[]) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
accept?: string | string[];
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
isBackdropDragging?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<never>>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import { useDropzone } from 'react-dropzone';
|
|
11
|
+
import { createStyles, withStyles } from '@mui/styles';
|
|
12
|
+
import { darken } from '@mui/material/styles';
|
|
13
|
+
import Typography from '@mui/material/Typography';
|
|
14
|
+
import Dialog from '@mui/material/Dialog';
|
|
15
|
+
import IconButton from '@mui/material/IconButton';
|
|
16
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
17
|
+
import Button from '@mui/material/Button';
|
|
18
|
+
const styles = createStyles((theme) => ({
|
|
19
|
+
fileContainer: {
|
|
20
|
+
border: `2px dotted ${theme.palette.primary.main}`,
|
|
21
|
+
borderRadius: 6,
|
|
22
|
+
transition: theme.transitions.create('background-color', {
|
|
23
|
+
duration: theme.transitions.duration.shorter,
|
|
24
|
+
easing: theme.transitions.easing.easeInOut
|
|
25
|
+
})
|
|
26
|
+
},
|
|
27
|
+
dragActive: {
|
|
28
|
+
backgroundColor: darken(theme.palette.background.default, 0.03),
|
|
29
|
+
boxShadow: theme.shadows[2]
|
|
30
|
+
},
|
|
31
|
+
fullScreenFileDropContainer: {
|
|
32
|
+
zIndex: 1300,
|
|
33
|
+
left: 0,
|
|
34
|
+
top: 0,
|
|
35
|
+
position: 'fixed'
|
|
36
|
+
},
|
|
37
|
+
boxDropContainer: {
|
|
38
|
+
zIndex: 1400
|
|
39
|
+
},
|
|
40
|
+
dialogCloseButton: {
|
|
41
|
+
right: theme.spacing(1),
|
|
42
|
+
top: theme.spacing(1),
|
|
43
|
+
color: theme.palette.grey[100]
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
const FileUploaderDialog = (props => {
|
|
47
|
+
const { fileRef, accept, disabled, classes, dialog, onChange, onClose, opened, backdropEnabled, isBackdropDragging } = props;
|
|
48
|
+
const onFileDrop = (acceptedfiles, fileRejections) => {
|
|
49
|
+
if (onChange)
|
|
50
|
+
onChange(acceptedfiles, fileRejections);
|
|
51
|
+
};
|
|
52
|
+
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
53
|
+
onDrop: onFileDrop,
|
|
54
|
+
multiple: false,
|
|
55
|
+
disabled,
|
|
56
|
+
accept
|
|
57
|
+
});
|
|
58
|
+
const acceptText = () => {
|
|
59
|
+
const text = [];
|
|
60
|
+
if (Array.isArray(accept)) {
|
|
61
|
+
accept.forEach(type => {
|
|
62
|
+
const typePart = type.split('/');
|
|
63
|
+
if (typePart.length > 1)
|
|
64
|
+
text.push(`*.${typePart[1]}`);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const typePart = accept.split('/');
|
|
69
|
+
if (typePart.length > 1)
|
|
70
|
+
text.push(`*.${typePart[1]}`);
|
|
71
|
+
}
|
|
72
|
+
return text.join(', ');
|
|
73
|
+
};
|
|
74
|
+
const backdropUploaderContent = (React.createElement("div", Object.assign({}, getRootProps(), { className: clsx('w-100 h-100', classes.fullScreenFileDropContainer) }),
|
|
75
|
+
React.createElement("div", { className: "h-100 outline-none overflow-hidden cursor-pointer" },
|
|
76
|
+
React.createElement("div", { className: "h-100 p-1" },
|
|
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 }) }),
|
|
79
|
+
React.createElement("div", { className: "h-100 outline-none overflow-hidden cursor-pointer" },
|
|
80
|
+
React.createElement("div", { className: "h-100 p-1" },
|
|
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 }) },
|
|
83
|
+
React.createElement(Typography, { variant: "subtitle1", gutterBottom: true, className: "mb-0" }, "Drop files here"),
|
|
84
|
+
React.createElement(Typography, { variant: "caption", className: "mb-1" }, "or"),
|
|
85
|
+
React.createElement(Button, { variant: "contained", size: "small", color: "primary", className: "mb-1 fontWeight-normal" }, "Browse"),
|
|
86
|
+
accept && (React.createElement(Typography, { variant: "caption", color: "error" },
|
|
87
|
+
"Please upload only:",
|
|
88
|
+
' ',
|
|
89
|
+
acceptText())))))));
|
|
90
|
+
return dialog ? (React.createElement(Dialog, { ref: fileRef, open: opened, disableEscapeKeyDown: true, onClose: onClose, classes: {
|
|
91
|
+
paper: 'w-100'
|
|
92
|
+
} },
|
|
93
|
+
React.createElement("div", null,
|
|
94
|
+
onClose && (React.createElement(IconButton, { className: clsx('fixed zIndex1401 p-1', classes.dialogCloseButton), onClick: onClose },
|
|
95
|
+
React.createElement(CloseIcon, { fontSize: "small" }))),
|
|
96
|
+
uploadContent,
|
|
97
|
+
isBackdropDragging && backdropEnabled && backdropUploaderContent))) : backdropEnabled ? backdropUploaderContent : uploadContent;
|
|
98
|
+
});
|
|
99
|
+
export default withStyles(styles)(FileUploaderDialog);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
export * from './FileUploaderDialog';
|
|
9
|
+
export { default as FileUploaderDialog } from './FileUploaderDialog';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redux Form field checkbox component creator
|
|
3
|
+
* */
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { CheckboxFieldProps, FieldInputProps } from '../model';
|
|
6
|
+
export declare const StyledCheckbox: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"root"> & object>;
|
|
7
|
+
export declare function CheckboxField<IP extends FieldInputProps>({ input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation }: CheckboxFieldProps<IP>): React.JSX.Element;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
+
t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Redux Form field checkbox component creator
|
|
21
|
+
* */
|
|
22
|
+
import React, { useCallback } from 'react';
|
|
23
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
24
|
+
import withStyles from '@mui/styles/withStyles';
|
|
25
|
+
import clsx from 'clsx';
|
|
26
|
+
const getValue = (value, stringValue) => {
|
|
27
|
+
if (!stringValue) {
|
|
28
|
+
return !!value;
|
|
29
|
+
}
|
|
30
|
+
switch (value) {
|
|
31
|
+
case 'false':
|
|
32
|
+
return false;
|
|
33
|
+
case 'true':
|
|
34
|
+
return true;
|
|
35
|
+
default:
|
|
36
|
+
return Boolean(value);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const styles = theme => ({
|
|
40
|
+
root: {
|
|
41
|
+
width: theme.spacing(4),
|
|
42
|
+
height: theme.spacing(4),
|
|
43
|
+
margin: theme.spacing(0.5)
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const StyledCheckboxBase = props => {
|
|
47
|
+
const { classes, uncheckedClass, className } = props, rest = __rest(props, ["classes", "uncheckedClass", "className"]);
|
|
48
|
+
return (React.createElement(Checkbox, Object.assign({ classes: {
|
|
49
|
+
root: clsx(classes.root, uncheckedClass, className),
|
|
50
|
+
} }, rest)));
|
|
51
|
+
};
|
|
52
|
+
export const StyledCheckbox = withStyles(styles)(StyledCheckboxBase);
|
|
53
|
+
export function CheckboxField({ input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation }) {
|
|
54
|
+
const onChange = useCallback((e, value) => {
|
|
55
|
+
let checked = value;
|
|
56
|
+
if (stringValue) {
|
|
57
|
+
checked = checked.toString();
|
|
58
|
+
}
|
|
59
|
+
if (typeof onChangeHandler === 'function') {
|
|
60
|
+
onChangeHandler(e, checked);
|
|
61
|
+
}
|
|
62
|
+
if (!e.isDefaultPrevented()) {
|
|
63
|
+
input.onChange(checked);
|
|
64
|
+
}
|
|
65
|
+
}, [stringValue, input, onChangeHandler]);
|
|
66
|
+
return (React.createElement(StyledCheckbox, { checked: getValue(input.value, stringValue), onChange: onChange, color: color, disabled: disabled, className: className, uncheckedClass: uncheckedClass, onClick: stopPropagation ? e => e.stopPropagation() : undefined, id: `input-${input.name}`, name: input.name }));
|
|
67
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'ace-builds/src-noconflict/mode-groovy';
|
|
3
|
+
import 'ace-builds/src-noconflict/theme-textmate';
|
|
4
|
+
import { CodeFieldProps, FieldInputProps, FieldMetaProps } from '../model';
|
|
5
|
+
declare function CodeEditorField<IP extends FieldInputProps, MP extends FieldMetaProps>({ input, meta: { error }, errorMessage, disabled, onFocus, className }: CodeFieldProps<IP, MP>): React.JSX.Element;
|
|
6
|
+
export default CodeEditorField;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import AceEditor from 'react-ace';
|
|
11
|
+
import 'ace-builds/src-noconflict/mode-groovy';
|
|
12
|
+
import 'ace-builds/src-noconflict/theme-textmate';
|
|
13
|
+
import { makeAppStyles } from '../styles';
|
|
14
|
+
const useStyles = makeAppStyles(theme => ({
|
|
15
|
+
editor: {
|
|
16
|
+
filter: theme.palette.mode === 'dark' ? 'invert(80%)' : '',
|
|
17
|
+
zIndex: 0,
|
|
18
|
+
outline: 'none'
|
|
19
|
+
},
|
|
20
|
+
errorBackground: {
|
|
21
|
+
'&.ace-tm': {
|
|
22
|
+
backgroundColor: theme.palette.error.light
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
errorMessage: {
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
top: '50%',
|
|
28
|
+
left: '50%',
|
|
29
|
+
transform: 'translate(calc(-50% + 21px), -50%)',
|
|
30
|
+
color: '#fff',
|
|
31
|
+
fontFamily: 'sans-serif',
|
|
32
|
+
zIndex: 1
|
|
33
|
+
},
|
|
34
|
+
queryMarker: {
|
|
35
|
+
borderRadius: '4px',
|
|
36
|
+
width: '55px',
|
|
37
|
+
paddingLeft: '4px',
|
|
38
|
+
height: '25px',
|
|
39
|
+
background: '#fff',
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
zIndex: 2,
|
|
43
|
+
boxShadow: theme.shadows[1],
|
|
44
|
+
'&:after': {
|
|
45
|
+
content: '\'Query\'',
|
|
46
|
+
marginLeft: '2px'
|
|
47
|
+
},
|
|
48
|
+
'&:hover': {
|
|
49
|
+
background: theme.palette.grey[100]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
function CodeEditorField({ input, meta: { error }, errorMessage, disabled, onFocus, className }) {
|
|
54
|
+
const classes = useStyles();
|
|
55
|
+
return (React.createElement("div", { id: input.name, className: className },
|
|
56
|
+
error && React.createElement("div", { className: classes.errorMessage },
|
|
57
|
+
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, {
|
|
59
|
+
[classes.errorBackground]: error
|
|
60
|
+
}), wrapEnabled: true, setOptions: {
|
|
61
|
+
enableBasicAutocompletion: true,
|
|
62
|
+
enableLiveAutocompletion: true,
|
|
63
|
+
enableSnippets: true,
|
|
64
|
+
showLineNumbers: true,
|
|
65
|
+
readOnly: disabled,
|
|
66
|
+
tabSize: 2
|
|
67
|
+
}, editorProps: { $blockScrolling: Infinity } })));
|
|
68
|
+
}
|
|
69
|
+
export default CodeEditorField;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ColoredCheckboxFieldProps, FieldInputProps, FieldMetaProps } from '../model';
|
|
3
|
+
export declare function ColoredCheckBox<IP extends FieldInputProps, MP extends FieldMetaProps>({ input, label, color, className, disabled }: ColoredCheckboxFieldProps<IP, MP>): React.JSX.Element;
|