ish-ui 1.0.17 → 1.0.18

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 (222) hide show
  1. package/README.md +6 -6
  2. package/dist/Demo.d.ts +4 -0
  3. package/dist/Demo.js +41 -0
  4. package/dist/DemoField.d.ts +3 -0
  5. package/dist/DemoField.js +87 -0
  6. package/dist/actions/FieldProcessing.d.ts +10 -0
  7. package/dist/actions/FieldProcessing.js +17 -0
  8. package/dist/actions/index.d.ts +1 -0
  9. package/dist/actions/index.js +8 -0
  10. package/dist/appBar/AppBarHelpMenu.d.ts +3 -0
  11. package/dist/appBar/AppBarHelpMenu.js +77 -0
  12. package/dist/appBar/index.d.ts +2 -0
  13. package/dist/appBar/index.js +9 -0
  14. package/dist/buttons/AddButton.d.ts +14 -0
  15. package/dist/buttons/AddButton.js +9 -0
  16. package/dist/buttons/TimetableButton.d.ts +3 -0
  17. package/dist/buttons/TimetableButton.js +12 -0
  18. package/dist/buttons/index.d.ts +4 -0
  19. package/dist/buttons/index.js +11 -0
  20. package/dist/colorPicker/ColorPicker.d.ts +11 -0
  21. package/dist/colorPicker/ColorPicker.js +132 -0
  22. package/dist/colorPicker/index.d.ts +2 -0
  23. package/dist/colorPicker/index.js +9 -0
  24. package/dist/dev.d.ts +1 -0
  25. package/dist/dev.js +9 -0
  26. package/dist/dialog/BrowserWarning.d.ts +3 -0
  27. package/dist/dialog/BrowserWarning.js +16 -0
  28. package/dist/dialog/confirm/ConfirmBase.d.ts +7 -0
  29. package/dist/dialog/confirm/ConfirmBase.js +29 -0
  30. package/dist/dialog/index.d.ts +5 -0
  31. package/dist/dialog/index.js +12 -0
  32. package/dist/dialog/message/Message.d.ts +3 -0
  33. package/dist/dialog/message/Message.js +91 -0
  34. package/dist/documents/DocumentIconsChooser.d.ts +3 -0
  35. package/dist/documents/DocumentIconsChooser.js +51 -0
  36. package/dist/documents/index.d.ts +3 -0
  37. package/dist/documents/index.js +10 -0
  38. package/dist/documents/utils/index.d.ts +7 -0
  39. package/dist/documents/utils/index.js +61 -0
  40. package/dist/dynamicSizeList/DynamicSizeList.d.ts +17 -0
  41. package/dist/dynamicSizeList/DynamicSizeList.js +167 -0
  42. package/dist/dynamicSizeList/index.d.ts +2 -0
  43. package/dist/dynamicSizeList/index.js +9 -0
  44. package/dist/fieldMessage/ErrorMessage.d.ts +8 -0
  45. package/dist/fieldMessage/ErrorMessage.js +14 -0
  46. package/dist/fieldMessage/WarningMessage.d.ts +8 -0
  47. package/dist/fieldMessage/WarningMessage.js +14 -0
  48. package/dist/fieldMessage/index.d.ts +6 -0
  49. package/dist/fieldMessage/index.js +13 -0
  50. package/dist/fieldMessage/styles.d.ts +3 -0
  51. package/dist/fieldMessage/styles.js +18 -0
  52. package/dist/fileUploader/FileUploaderDialog.d.ts +15 -0
  53. package/dist/fileUploader/FileUploaderDialog.js +99 -0
  54. package/dist/fileUploader/index.d.ts +2 -0
  55. package/dist/fileUploader/index.js +9 -0
  56. package/dist/formFields/CheckboxField.d.ts +7 -0
  57. package/dist/formFields/CheckboxField.js +67 -0
  58. package/dist/formFields/CodeEditorField.d.ts +6 -0
  59. package/dist/formFields/CodeEditorField.js +69 -0
  60. package/dist/formFields/ColoredCheckBox.d.ts +3 -0
  61. package/dist/formFields/ColoredCheckBox.js +41 -0
  62. package/dist/formFields/DateTimeField.d.ts +2 -0
  63. package/dist/formFields/DateTimeField.js +27 -0
  64. package/dist/formFields/EditInPlaceDateTimeField.d.ts +10 -0
  65. package/dist/formFields/EditInPlaceDateTimeField.js +188 -0
  66. package/dist/formFields/EditInPlaceDurationField.d.ts +4 -0
  67. package/dist/formFields/EditInPlaceDurationField.js +63 -0
  68. package/dist/formFields/EditInPlaceField.d.ts +10 -0
  69. package/dist/formFields/EditInPlaceField.js +58 -0
  70. package/dist/formFields/EditInPlaceFieldBase.d.ts +28 -0
  71. package/dist/formFields/EditInPlaceFieldBase.js +123 -0
  72. package/dist/formFields/EditInPlaceFileField.d.ts +7 -0
  73. package/dist/formFields/EditInPlaceFileField.js +60 -0
  74. package/dist/formFields/EditInPlaceMoneyField.d.ts +9 -0
  75. package/dist/formFields/EditInPlaceMoneyField.js +37 -0
  76. package/dist/formFields/EditInPlacePhoneField.d.ts +4 -0
  77. package/dist/formFields/EditInPlacePhoneField.js +69 -0
  78. package/dist/formFields/EditInPlaceSearchSelect.d.ts +4 -0
  79. package/dist/formFields/EditInPlaceSearchSelect.js +321 -0
  80. package/dist/formFields/FieldAdornments.d.ts +13 -0
  81. package/dist/formFields/FieldAdornments.js +27 -0
  82. package/dist/formFields/FilePreview.d.ts +17 -0
  83. package/dist/formFields/FilePreview.js +77 -0
  84. package/dist/formFields/FormRadioButtons.d.ts +3 -0
  85. package/dist/formFields/FormRadioButtons.js +27 -0
  86. package/dist/formFields/SelectCustomComponents.d.ts +5 -0
  87. package/dist/formFields/SelectCustomComponents.js +182 -0
  88. package/dist/formFields/Switch.d.ts +7 -0
  89. package/dist/formFields/Switch.js +116 -0
  90. package/dist/formFields/TextField.d.ts +6 -0
  91. package/dist/formFields/TextField.js +42 -0
  92. package/dist/formFields/UneditableBase.d.ts +17 -0
  93. package/dist/formFields/UneditableBase.js +48 -0
  94. package/dist/formFields/index.d.ts +31 -0
  95. package/dist/formFields/index.js +38 -0
  96. package/dist/index.d.ts +18 -0
  97. package/dist/index.js +25 -0
  98. package/dist/layout/InfoPill.d.ts +7 -0
  99. package/dist/layout/InfoPill.js +26 -0
  100. package/dist/layout/index.d.ts +4 -0
  101. package/dist/layout/index.js +11 -0
  102. package/dist/layout/resizable/ResizableWrapper.d.ts +14 -0
  103. package/dist/layout/resizable/ResizableWrapper.js +42 -0
  104. package/dist/markdownEditor/HtmlEditor.d.ts +15 -0
  105. package/dist/markdownEditor/HtmlEditor.js +18 -0
  106. package/dist/markdownEditor/WysiwygEditor.d.ts +8 -0
  107. package/dist/markdownEditor/WysiwygEditor.js +98 -0
  108. package/dist/markdownEditor/index.d.ts +5 -0
  109. package/dist/markdownEditor/index.js +12 -0
  110. package/dist/markdownEditor/utils/index.d.ts +9 -0
  111. package/dist/markdownEditor/utils/index.js +38 -0
  112. package/dist/model/AppBar.d.ts +11 -0
  113. package/dist/model/AppBar.js +8 -0
  114. package/dist/model/CommomObjects.d.ts +5 -0
  115. package/dist/model/CommomObjects.js +1 -0
  116. package/dist/model/CommonFunctions.d.ts +8 -0
  117. package/dist/model/CommonFunctions.js +5 -0
  118. package/dist/model/Confirm.d.ts +16 -0
  119. package/dist/model/Confirm.js +8 -0
  120. package/dist/model/Fields.d.ts +250 -0
  121. package/dist/model/Fields.js +8 -0
  122. package/dist/model/NestedEntity.d.ts +9 -0
  123. package/dist/model/NestedEntity.js +5 -0
  124. package/dist/model/Theme.d.ts +34 -0
  125. package/dist/model/Theme.js +18 -0
  126. package/dist/model/index.d.ts +7 -0
  127. package/dist/model/index.js +14 -0
  128. package/dist/styles/GlobalStylesProvider.d.ts +3 -0
  129. package/dist/styles/GlobalStylesProvider.js +417 -0
  130. package/dist/styles/StylesProviderCustom.d.ts +3 -0
  131. package/dist/styles/StylesProviderCustom.js +6 -0
  132. package/dist/styles/animateStyles.d.ts +3 -0
  133. package/dist/styles/animateStyles.js +33 -0
  134. package/dist/styles/bootstrap.d.ts +491 -0
  135. package/dist/styles/bootstrap.js +496 -0
  136. package/dist/styles/hooks.d.ts +6 -0
  137. package/dist/styles/hooks.js +38 -0
  138. package/dist/styles/index.d.ts +11 -0
  139. package/dist/styles/index.js +18 -0
  140. package/dist/styles/makeStyles.d.ts +3 -0
  141. package/dist/styles/makeStyles.js +9 -0
  142. package/dist/styles/mixins/common.d.ts +8 -0
  143. package/dist/styles/mixins/common.js +32 -0
  144. package/dist/styles/mixins/keyframes.d.ts +3 -0
  145. package/dist/styles/mixins/keyframes.js +9 -0
  146. package/dist/styles/mixins/prefixer.d.ts +1 -0
  147. package/dist/styles/mixins/prefixer.js +23 -0
  148. package/dist/tagsInput/AddTagMenu.d.ts +12 -0
  149. package/dist/tagsInput/AddTagMenu.js +36 -0
  150. package/dist/tagsInput/AddTagMenuItem.d.ts +11 -0
  151. package/dist/tagsInput/AddTagMenuItem.js +29 -0
  152. package/dist/tagsInput/TagInputList.d.ts +4 -0
  153. package/dist/tagsInput/TagInputList.js +273 -0
  154. package/dist/tagsInput/index.d.ts +6 -0
  155. package/dist/tagsInput/index.js +6 -0
  156. package/dist/themes/appTheme.d.ts +4 -0
  157. package/dist/themes/appTheme.js +322 -0
  158. package/dist/themes/index.d.ts +2 -0
  159. package/dist/themes/index.js +9 -0
  160. package/dist/themes/ishTheme.d.ts +8 -0
  161. package/dist/themes/ishTheme.js +351 -0
  162. package/dist/timetable/datePeriodFilter/DayPeriodIcons.d.ts +8 -0
  163. package/dist/timetable/datePeriodFilter/DayPeriodIcons.js +27 -0
  164. package/dist/timetable/datePeriodFilter/index.d.ts +1 -0
  165. package/dist/timetable/datePeriodFilter/index.js +8 -0
  166. package/dist/timetable/index.d.ts +2 -0
  167. package/dist/timetable/index.js +9 -0
  168. package/dist/timetable/miniCalendar/CalendarDay.d.ts +15 -0
  169. package/dist/timetable/miniCalendar/CalendarDay.js +64 -0
  170. package/dist/timetable/miniCalendar/CalendarHeader.d.ts +10 -0
  171. package/dist/timetable/miniCalendar/CalendarHeader.js +22 -0
  172. package/dist/timetable/miniCalendar/CalendarWeekPanel.d.ts +8 -0
  173. package/dist/timetable/miniCalendar/CalendarWeekPanel.js +18 -0
  174. package/dist/timetable/miniCalendar/WeekDay.d.ts +10 -0
  175. package/dist/timetable/miniCalendar/WeekDay.js +25 -0
  176. package/dist/timetable/miniCalendar/index.d.ts +8 -0
  177. package/dist/timetable/miniCalendar/index.js +15 -0
  178. package/dist/utils/DOM/Links.d.ts +1 -0
  179. package/dist/utils/DOM/Links.js +12 -0
  180. package/dist/utils/DOM/getCaretCoordinates.d.ts +6 -0
  181. package/dist/utils/DOM/getCaretCoordinates.js +109 -0
  182. package/dist/utils/DOM/getOS.d.ts +2 -0
  183. package/dist/utils/DOM/getOS.js +32 -0
  184. package/dist/utils/DOM/index.d.ts +5 -0
  185. package/dist/utils/DOM/index.js +32 -0
  186. package/dist/utils/dates/datesNormalizing.d.ts +1 -0
  187. package/dist/utils/dates/datesNormalizing.js +3 -0
  188. package/dist/utils/dates/format.d.ts +24 -0
  189. package/dist/utils/dates/format.js +28 -0
  190. package/dist/utils/dates/formatRelative.d.ts +1 -0
  191. package/dist/utils/dates/formatRelative.js +14 -0
  192. package/dist/utils/dates/formatString.d.ts +2 -0
  193. package/dist/utils/dates/formatString.js +195 -0
  194. package/dist/utils/dates/formatTimezone.d.ts +2 -0
  195. package/dist/utils/dates/formatTimezone.js +35 -0
  196. package/dist/utils/dates/index.d.ts +6 -0
  197. package/dist/utils/dates/index.js +13 -0
  198. package/dist/utils/dates/timetable.d.ts +5 -0
  199. package/dist/utils/dates/timetable.js +38 -0
  200. package/dist/utils/events/index.d.ts +2 -0
  201. package/dist/utils/events/index.js +6 -0
  202. package/dist/utils/fields/index.d.ts +1 -0
  203. package/dist/utils/fields/index.js +20 -0
  204. package/dist/utils/formatting/PhoneMasks.d.ts +304 -0
  205. package/dist/utils/formatting/PhoneMasks.js +318 -0
  206. package/dist/utils/formatting/index.d.ts +2 -0
  207. package/dist/utils/formatting/index.js +10 -0
  208. package/dist/utils/hooks/index.d.ts +1 -0
  209. package/dist/utils/hooks/index.js +15 -0
  210. package/dist/utils/index.d.ts +9 -0
  211. package/dist/utils/index.js +16 -0
  212. package/dist/utils/numbers/decimalCalculation.d.ts +4 -0
  213. package/dist/utils/numbers/decimalCalculation.js +21 -0
  214. package/dist/utils/numbers/index.d.ts +2 -0
  215. package/dist/utils/numbers/index.js +9 -0
  216. package/dist/utils/numbers/numbersNormalizing.d.ts +10 -0
  217. package/dist/utils/numbers/numbersNormalizing.js +44 -0
  218. package/dist/utils/stubs/index.d.ts +3 -0
  219. package/dist/utils/stubs/index.js +10 -0
  220. package/dist/utils/tags/index.d.ts +3 -0
  221. package/dist/utils/tags/index.js +42 -0
  222. package/package.json +1 -1
package/README.md CHANGED
@@ -18,10 +18,10 @@ git clone https://github.com/ishgroup/ish-ui.git
18
18
 
19
19
  <br>
20
20
 
21
- Install dependencies using Yarn:
21
+ Install dependencies using NPM:
22
22
 
23
23
  ```bash
24
- yarn install
24
+ npm install
25
25
  ```
26
26
 
27
27
  <br />
@@ -31,7 +31,7 @@ yarn install
31
31
  To develop and run your web application, you need to run following command :
32
32
 
33
33
  ```bash
34
- yarn start
34
+ npm start
35
35
  ```
36
36
 
37
37
  <br />
@@ -41,7 +41,7 @@ yarn start
41
41
  To lint application source code using ESLint via this command :
42
42
 
43
43
  ```bash
44
- yarn lint
44
+ npm lint
45
45
  ```
46
46
 
47
47
  <br />
@@ -53,7 +53,7 @@ Distribution files output will be generated in `dist/` directory by default.
53
53
  To build the production ready files for distribution, use the following command :
54
54
 
55
55
  ```bash
56
- yarn build
56
+ npm build
57
57
  ```
58
58
 
59
59
  <br />
@@ -63,7 +63,7 @@ yarn build
63
63
  Serve helps you serve a static site, single page application or just a static file. It also provides a neat interface for listing the directory's contents. This command serves build files from `dist/` directory.
64
64
 
65
65
  ```bash
66
- yarn serve
66
+ npm serve
67
67
  ```
68
68
 
69
69
  <br />
package/dist/Demo.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const muiCache: import("@emotion/utils").EmotionCache;
3
+ declare function Demo(): React.JSX.Element;
4
+ export default Demo;
package/dist/Demo.js ADDED
@@ -0,0 +1,41 @@
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, { useRef, useState } from 'react';
6
+ import { CacheProvider } from '@emotion/react';
7
+ import createCache from '@emotion/cache';
8
+ import { ThemeProvider } from '@mui/material/styles';
9
+ import { Box, Grid } from '@mui/material';
10
+ import CssBaseline from '@mui/material/CssBaseline';
11
+ import { defaultTheme } from './themes';
12
+ import { GlobalStylesProvider } from './styles';
13
+ import { DemoField } from './DemoField';
14
+ import { WysiwygEditor } from './markdownEditor';
15
+ export const muiCache = createCache({
16
+ key: 'mui',
17
+ prepend: true,
18
+ });
19
+ function Demo() {
20
+ const wysiwygRef = useRef();
21
+ const [draftContent, setDraftContent] = useState('');
22
+ return (React.createElement(CacheProvider, { value: muiCache },
23
+ React.createElement(ThemeProvider, { theme: defaultTheme },
24
+ React.createElement(CssBaseline, null),
25
+ React.createElement(GlobalStylesProvider, null,
26
+ React.createElement(Box, { sx: {
27
+ width: '100vw',
28
+ height: '100vh',
29
+ padding: 4
30
+ } },
31
+ React.createElement(Grid, { container: true, columnSpacing: 3, rowSpacing: 2 },
32
+ React.createElement(Grid, { item: true, xs: 6 },
33
+ React.createElement(DemoField, { label: "Test phone", type: "phone" })),
34
+ React.createElement(Grid, { item: true, xs: 6 },
35
+ React.createElement(DemoField, { label: "Test text", type: "text" })),
36
+ React.createElement(Grid, { item: true, xs: 12 },
37
+ React.createElement(WysiwygEditor, { value: draftContent, onChange: setDraftContent, wysiwygRef: wysiwygRef })),
38
+ React.createElement(Grid, { item: true, xs: 6 }),
39
+ React.createElement(Grid, { item: true, xs: 6 })))))));
40
+ }
41
+ export default Demo;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { FormFieldProps } from './model';
3
+ export declare function DemoField(props: FormFieldProps): React.JSX.Element;
@@ -0,0 +1,87 @@
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
+ import React, { useMemo, useState } from 'react';
20
+ import { stubFunction } from './utils';
21
+ import { CheckboxField, CodeEditorField, ColoredCheckBox, EditInPlaceDateTimeField, EditInPlaceDurationField, EditInPlaceField, EditInPlaceFileField, EditInPlaceMoneyField, EditInPlacePhoneField, EditInPlaceSearchSelect, FormSwitch } from './formFields';
22
+ import { TagInputList } from './tagsInput';
23
+ const stubFieldMocks = { input: { onChange: stubFunction, onBlur: stubFunction }, format: null, debounced: null };
24
+ export function DemoField(props) {
25
+ const { type } = props, rest = __rest(props, ["type"]);
26
+ const { input, format, debounced = true } = type !== 'stub'
27
+ ? props
28
+ : stubFieldMocks;
29
+ // const currencySymbol = useAppSelector(state => state.currency?.shortCurrencySymbol);
30
+ // const processActionId = useAppSelector(state => state.fieldProcessing[input?.name]);
31
+ //
32
+ // const entity = type === "remoteDataSelect" ? props.entity : null;
33
+ //
34
+ // const color = type === "coloredCheckbox" ? props.color : null;
35
+ //
36
+ // const rootEntity = type === "aql" ? props.rootEntity : null;
37
+ //
38
+ // const tags = type === "tags" ? props.tags : null;
39
+ const [value, setValue] = useState(undefined);
40
+ const inputProxy = useMemo(() => (Object.assign(Object.assign({}, input || {}), { value, onChange: e => {
41
+ const val = (e === null || e === void 0 ? void 0 : e.target) ? e.target.value : e;
42
+ setValue(format ? format(val) : val);
43
+ }, onBlur: e => {
44
+ const val = (e === null || e === void 0 ? void 0 : e.target) ? e.target.value : e;
45
+ setValue(format ? format(val) : val);
46
+ } })), [value, input]);
47
+ const sharedProps = Object.assign(Object.assign(Object.assign({}, rest), debounced ? { input: inputProxy } : {}), { meta: {} });
48
+ switch (type) {
49
+ case 'phone':
50
+ return React.createElement(EditInPlacePhoneField, Object.assign({}, sharedProps));
51
+ case 'duration':
52
+ return React.createElement(EditInPlaceDurationField, Object.assign({}, sharedProps));
53
+ case 'file':
54
+ return React.createElement(EditInPlaceFileField, Object.assign({}, sharedProps));
55
+ case 'money':
56
+ return React.createElement(EditInPlaceMoneyField, Object.assign({}, sharedProps, { currencySymbol: "$" }));
57
+ case 'select':
58
+ return React.createElement(EditInPlaceSearchSelect, Object.assign({}, sharedProps));
59
+ case 'number':
60
+ return React.createElement(EditInPlaceField, Object.assign({}, sharedProps, { type: "number" }));
61
+ case 'date':
62
+ return React.createElement(EditInPlaceDateTimeField, Object.assign({}, sharedProps, { type: "date" }));
63
+ case 'time':
64
+ return React.createElement(EditInPlaceDateTimeField, Object.assign({}, sharedProps, { type: "time" }));
65
+ case 'dateTime':
66
+ return React.createElement(EditInPlaceDateTimeField, Object.assign({}, sharedProps, { type: "datetime" }));
67
+ case 'code':
68
+ return React.createElement(CodeEditorField, Object.assign({}, sharedProps));
69
+ case 'coloredCheckbox':
70
+ return React.createElement(ColoredCheckBox, Object.assign({}, sharedProps, { color: "red" }));
71
+ case 'password':
72
+ return React.createElement(EditInPlaceField, Object.assign({}, sharedProps, { type: "password" }));
73
+ case 'switch':
74
+ return React.createElement(FormSwitch, Object.assign({}, sharedProps));
75
+ case 'checkbox':
76
+ return React.createElement(CheckboxField, Object.assign({}, sharedProps));
77
+ case 'multilineText':
78
+ return React.createElement(EditInPlaceField, Object.assign({}, sharedProps, { multiline: true }));
79
+ case 'stub':
80
+ return React.createElement("div", { className: "invisible" });
81
+ case 'tags':
82
+ return React.createElement(TagInputList, Object.assign({}, sharedProps, { tags: [] }));
83
+ case 'text':
84
+ default:
85
+ return React.createElement(EditInPlaceField, Object.assign({}, sharedProps));
86
+ }
87
+ }
@@ -0,0 +1,10 @@
1
+ export declare const START_FIELD_PROCESSING_ACTION = "add/field/processing/action";
2
+ export declare const END_FIELD_PROCESSING_ACTION = "remove/field/processing/action";
3
+ export declare const startFieldProcessingAction: (id: string) => {
4
+ type: string;
5
+ payload: string;
6
+ };
7
+ export declare const endFieldProcessingAction: (id: string) => {
8
+ type: string;
9
+ payload: string;
10
+ };
@@ -0,0 +1,17 @@
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 const START_FIELD_PROCESSING_ACTION = 'add/field/processing/action';
9
+ export const END_FIELD_PROCESSING_ACTION = 'remove/field/processing/action';
10
+ export const startFieldProcessingAction = (id) => ({
11
+ type: START_FIELD_PROCESSING_ACTION,
12
+ payload: id
13
+ });
14
+ export const endFieldProcessingAction = (id) => ({
15
+ type: END_FIELD_PROCESSING_ACTION,
16
+ payload: id
17
+ });
@@ -0,0 +1 @@
1
+ export * from './FieldProcessing';
@@ -0,0 +1,8 @@
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 './FieldProcessing';
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const _default: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles").StyledComponentProps<"button" | "info" | "divider">>;
3
+ export default _default;
@@ -0,0 +1,77 @@
1
+ import * as React from 'react';
2
+ import { withStyles, createStyles } from '@mui/styles';
3
+ import clsx from 'clsx';
4
+ import HelpOutline from '@mui/icons-material/HelpOutline';
5
+ import IconButton from '@mui/material/IconButton';
6
+ import Typography from '@mui/material/Typography';
7
+ import Menu from '@mui/material/Menu';
8
+ import MenuItem from '@mui/material/MenuItem';
9
+ import Tooltip from '@mui/material/Tooltip';
10
+ import { format as formatDate } from 'date-fns';
11
+ import { III_DD_MMM_YYYY_HH_MM_SPECIAL, openInternalLink } from '../utils';
12
+ const styles = theme => createStyles({
13
+ button: {
14
+ color: theme.appBarButton.helpMenu.color,
15
+ },
16
+ info: {
17
+ display: 'flex',
18
+ flexDirection: 'column',
19
+ alignItems: 'baseline',
20
+ padding: theme.spacing(1, 2, 0, 2)
21
+ },
22
+ divider: {
23
+ marginTop: theme.spacing(2),
24
+ borderTop: `1px solid ${theme.palette.divider}`
25
+ }
26
+ });
27
+ class AppBarHelpMenu extends React.Component {
28
+ constructor(props) {
29
+ super(props);
30
+ this.handleAddFieldClick = e => {
31
+ this.setState({ anchorEl: e.currentTarget });
32
+ };
33
+ this.handleClose = () => {
34
+ this.setState({ anchorEl: null });
35
+ };
36
+ this.openManual = () => {
37
+ window.open(this.props.manualUrl);
38
+ this.handleClose();
39
+ };
40
+ this.openAudits = () => {
41
+ openInternalLink('/' + this.props.auditsUrl);
42
+ this.handleClose();
43
+ };
44
+ this.state = {
45
+ anchorEl: null
46
+ };
47
+ }
48
+ render() {
49
+ const { anchorEl } = this.state;
50
+ const { classes, created, modified, iconClasses, auditsUrl } = this.props;
51
+ return (React.createElement(React.Fragment, null,
52
+ React.createElement(Menu, { id: "form-help-menu", anchorEl: anchorEl, open: Boolean(anchorEl), onClose: this.handleClose, marginThreshold: 16, transformOrigin: {
53
+ vertical: 'center',
54
+ horizontal: 'right'
55
+ } },
56
+ created && (React.createElement(MenuItem, { disabled: true, className: classes.info },
57
+ React.createElement(Typography, { variant: "caption" }, "Created"),
58
+ React.createElement(Typography, { variant: "subtitle1" }, typeof created === 'object' && isFinite(created)
59
+ ? formatDate(created, III_DD_MMM_YYYY_HH_MM_SPECIAL)
60
+ : '---- ---- ---- ---- ----'))),
61
+ modified && (React.createElement(MenuItem, { disabled: true, className: classes.info },
62
+ React.createElement(Typography, { variant: "caption" }, "Modified"),
63
+ React.createElement(Typography, { variant: "subtitle1" }, typeof modified === 'object' && isFinite(modified)
64
+ ? formatDate(modified, III_DD_MMM_YYYY_HH_MM_SPECIAL)
65
+ : '---- ---- ---- ---- ----'))),
66
+ React.createElement(MenuItem, { className: created || modified ? classes.divider : undefined, onClick: this.openManual }, "Open manual"),
67
+ auditsUrl && (React.createElement(MenuItem, { onClick: this.openAudits }, "View audit trail"))),
68
+ React.createElement(Tooltip, { title: "Additional information" },
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({
71
+ [classes.button]: !iconClasses,
72
+ [iconClasses]: !!iconClasses
73
+ }) },
74
+ React.createElement(HelpOutline, null))))));
75
+ }
76
+ }
77
+ export default withStyles(styles)(AppBarHelpMenu);
@@ -0,0 +1,2 @@
1
+ export * from './AppBarHelpMenu';
2
+ export { default as AppBarHelpMenu } from './AppBarHelpMenu';
@@ -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 './AppBarHelpMenu';
9
+ export { default as AppBarHelpMenu } from './AppBarHelpMenu';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { IconButtonProps, IconButtonPropsColorOverrides, IconButtonPropsSizeOverrides } from '@mui/material/IconButton';
3
+ import { OverridableStringUnion } from '@mui/types';
4
+ interface Props extends Partial<IconButtonProps> {
5
+ onClick?: any;
6
+ className?: any;
7
+ disabled?: boolean;
8
+ iconClassName?: any;
9
+ iconFontSize?: 'inherit' | 'large' | 'medium' | 'small';
10
+ color?: OverridableStringUnion<'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning', IconButtonPropsColorOverrides>;
11
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', IconButtonPropsSizeOverrides>;
12
+ }
13
+ declare const AddButton: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<any>>;
14
+ export default AddButton;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import AddCircleOutlineOutlinedIcon from '@mui/icons-material/AddCircleOutlineOutlined';
3
+ import IconButton from '@mui/material/IconButton';
4
+ const AddButton = React.forwardRef((props, ref) => {
5
+ const { onClick, className, disabled, iconClassName, iconFontSize, color, size } = props;
6
+ return (React.createElement(IconButton, { color: color, size: size, onClick: onClick, className: className, disabled: disabled, ref: ref },
7
+ React.createElement(AddCircleOutlineOutlinedIcon, { className: iconClassName || 'addButtonColor', fontSize: iconFontSize || 'small' })));
8
+ });
9
+ export default AddButton;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const TimetableButton: React.FC<any>;
3
+ export default TimetableButton;
@@ -0,0 +1,12 @@
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 OpenInNew from '@mui/icons-material/OpenInNew';
7
+ import IconButton from '@mui/material/IconButton';
8
+ const TimetableButton = ({ title = 'Timetable', onClick }) => (React.createElement("div", { className: "centeredFlex" },
9
+ React.createElement("div", { className: "heading" }, title),
10
+ React.createElement(IconButton, { size: "small", color: "primary", onClick: onClick },
11
+ React.createElement(OpenInNew, { fontSize: "inherit" }))));
12
+ export default TimetableButton;
@@ -0,0 +1,4 @@
1
+ export * from './AddButton';
2
+ export * from './TimetableButton';
3
+ export { default as AddButton } from './AddButton';
4
+ export { default as TimetableButton } from './TimetableButton';
@@ -0,0 +1,11 @@
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 './AddButton';
9
+ export * from './TimetableButton';
10
+ export { default as AddButton } from './AddButton';
11
+ export { default as TimetableButton } from './TimetableButton';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { PopperPlacementType, Theme } from '@mui/material';
3
+ import { FieldInputProps } from '../model';
4
+ interface ColorPickerWrapperProps {
5
+ input?: FieldInputProps;
6
+ classes?: any;
7
+ theme?: Theme;
8
+ placement?: PopperPlacementType;
9
+ }
10
+ declare const _default: React.JSXElementConstructor<Omit<ColorPickerWrapperProps, "theme" | "classes"> & import("@mui/styles").StyledComponentProps<never>>;
11
+ export default _default;
@@ -0,0 +1,132 @@
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, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
9
+ import ButtonBase from '@mui/material/ButtonBase';
10
+ import Popper from '@mui/material/Popper';
11
+ import { AlphaPicker, HuePicker } from 'react-color';
12
+ import { createStyles, withStyles } from '@mui/styles';
13
+ import { ClickAwayListener } from '@mui/base';
14
+ import Paper from '@mui/material/Paper';
15
+ import Grow from '@mui/material/Grow';
16
+ import clsx from 'clsx';
17
+ import { stopEventPropagation } from '../utils/events';
18
+ const styles = createStyles(({ spacing, transitions, palette, zIndex }) => ({
19
+ paper: {
20
+ width: 200,
21
+ padding: spacing(2),
22
+ position: 'relative',
23
+ bottom: '12px',
24
+ background: palette.background.paper,
25
+ '&:after': {
26
+ bottom: '0px',
27
+ left: '50%',
28
+ width: '22px',
29
+ height: '10px',
30
+ position: 'absolute',
31
+ transform: 'translateX(-50%)',
32
+ background: palette.background.paper,
33
+ content: '\'\'',
34
+ zIndex: 1
35
+ },
36
+ '&:before': {
37
+ content: '\'\'',
38
+ bottom: '-6px',
39
+ left: '50%',
40
+ width: '12px',
41
+ height: '12px',
42
+ position: 'absolute',
43
+ transform: 'translateX(-50%) rotate(45deg)',
44
+ background: palette.background.paper,
45
+ boxShadow: '1px 1px 2px 0px rgba(0,0,0,0.2), 2px 1px 2px -1px rgba(0,0,0,0.12), 1px 1px 1px 0px rgba(0,0,0,0.12);'
46
+ }
47
+ },
48
+ paperPlaceBottom: {
49
+ marginTop: spacing(3),
50
+ '&:after': {
51
+ bottom: 'unset',
52
+ top: '0px'
53
+ },
54
+ '&:before': {
55
+ bottom: 'unset',
56
+ top: '-6px',
57
+ }
58
+ },
59
+ colorPickerButton: {
60
+ width: '14px',
61
+ height: '14px',
62
+ borderRadius: '100%',
63
+ transition: transitions.create('transform', {
64
+ duration: transitions.duration.shorter,
65
+ easing: transitions.easing.easeInOut
66
+ }),
67
+ '&:hover,&$opened': {
68
+ transform: 'scale(2)'
69
+ }
70
+ },
71
+ popper: {
72
+ zIndex: zIndex.tooltip
73
+ },
74
+ bottomOffset: {
75
+ marginBottom: spacing(1.25)
76
+ },
77
+ customAlfa: {
78
+ '& > div > div:first-child > div': {
79
+ background: 'none !important'
80
+ }
81
+ },
82
+ opened: {}
83
+ }));
84
+ const ColorPickerBase = React.memo(({ classes, color, input: { value, onChange }, TransitionProps, setAnchorEl, placement }) => {
85
+ const [hueColor, setHueColor] = useState(color);
86
+ const [alfaColor, setAlfaColor] = useState(color);
87
+ const hueRef = useRef();
88
+ const onHueChange = useCallback(color => {
89
+ setHueColor(color.hsv);
90
+ setAlfaColor(color.hsv);
91
+ }, []);
92
+ const onAlfaChange = useCallback(color => {
93
+ setHueColor({
94
+ h: color.hsv.h, s: color.hsv.a, v: color.hsv.v, a: 1
95
+ });
96
+ setAlfaColor(color.hsv);
97
+ }, []);
98
+ const handleClickAway = useCallback(() => {
99
+ setAnchorEl(null);
100
+ }, []);
101
+ useEffect(() => {
102
+ if (!hueColor && value) {
103
+ setHueColor('#' + value);
104
+ }
105
+ }, [value, hueColor]);
106
+ useEffect(() => {
107
+ const hueHsv = hueRef.current.state.hsv;
108
+ setAlfaColor({
109
+ h: hueHsv.h, s: 1, v: hueHsv.v, a: hueHsv.s
110
+ });
111
+ }, [hueRef.current]);
112
+ const onChangeComplete = () => {
113
+ onChange(hueRef.current.state.hex.replace('#', ''));
114
+ };
115
+ return (React.createElement(ClickAwayListener, { onClickAway: handleClickAway },
116
+ React.createElement(Grow, Object.assign({}, TransitionProps, { timeout: 200 }),
117
+ React.createElement("div", null,
118
+ React.createElement(Paper, { className: clsx(classes.paper, placement === 'bottom' && classes.paperPlaceBottom) },
119
+ React.createElement(HuePicker, { ref: hueRef, color: hueColor, onChange: onHueChange, onChangeComplete: onChangeComplete, width: "168", className: classes.bottomOffset }),
120
+ React.createElement(AlphaPicker, { className: classes.customAlfa, color: alfaColor, width: "168", onChange: onAlfaChange, onChangeComplete: onChangeComplete }))))));
121
+ });
122
+ const ColorPickerWrapper = React.memo(({ classes, theme, input, placement = 'top' }) => {
123
+ const [anchorEl, setAnchorEl] = useState(null);
124
+ const handleClick = useCallback((event) => {
125
+ setAnchorEl(anchorEl ? null : event.currentTarget);
126
+ }, [anchorEl]);
127
+ const color = useMemo(() => (input.value ? '#' + input.value : theme.palette.primary.main), [theme, input.value]);
128
+ return (React.createElement("div", { className: "d-flex", onClick: stopEventPropagation },
129
+ React.createElement(ButtonBase, { onClick: handleClick, className: clsx(classes.colorPickerButton, anchorEl && classes.opened), style: { backgroundColor: color } }),
130
+ React.createElement(Popper, { open: Boolean(anchorEl), anchorEl: anchorEl, placement: placement, className: classes.popper, transition: true }, ({ TransitionProps }) => (React.createElement(ColorPickerBase, { classes: classes, color: color, input: input, TransitionProps: TransitionProps, setAnchorEl: setAnchorEl, placement: placement })))));
131
+ });
132
+ export default withStyles(styles, { withTheme: true })(ColorPickerWrapper);
@@ -0,0 +1,2 @@
1
+ export * from './ColorPicker';
2
+ export { default as ColorPicker } from './ColorPicker';
@@ -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 './ColorPicker';
9
+ export { default as ColorPicker } from './ColorPicker';
package/dist/dev.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/dev.js ADDED
@@ -0,0 +1,9 @@
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 { createRoot } from 'react-dom/client';
7
+ import Demo from './Demo';
8
+ const root = createRoot(document.getElementById('dev-demo'));
9
+ root.render(React.createElement(Demo, null));
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ export declare const isOldIE: () => boolean;
3
+ export declare const BrowserWarning: () => React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { Alert } from '@mui/lab';
2
+ import * as React from 'react';
3
+ const BROWSER_WARNING_TEXT = 'Your current browser is not supported. Please ensure you are using an up to date version of Chrome, Firefox or Edge.';
4
+ export const isOldIE = () => {
5
+ const ua = window.navigator.userAgent;
6
+ const msie = ua.indexOf('MSIE ');
7
+ return msie !== -1;
8
+ };
9
+ export const BrowserWarning = () => isOldIE() && (React.createElement("div", { style: {
10
+ position: 'fixed',
11
+ bottom: '50vh',
12
+ left: '35vw',
13
+ right: '35vw',
14
+ zIndex: 10000
15
+ } },
16
+ React.createElement(Alert, { variant: "filled", severity: "error" }, BROWSER_WARNING_TEXT)));
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Common confirm dialog
3
+ * */
4
+ import React from 'react';
5
+ import { ConfirmState } from '../../model';
6
+ declare const ConfirmBase: React.FunctionComponent<ConfirmState>;
7
+ export default ConfirmBase;
@@ -0,0 +1,29 @@
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
+ /**
9
+ * Common confirm dialog
10
+ * */
11
+ import React from 'react';
12
+ import Button from '@mui/material/Button';
13
+ import Dialog from '@mui/material/Dialog';
14
+ import DialogActions from '@mui/material/DialogActions';
15
+ import DialogContent from '@mui/material/DialogContent';
16
+ import DialogContentText from '@mui/material/DialogContentText';
17
+ import DialogTitle from '@mui/material/DialogTitle';
18
+ const ConfirmBase = props => {
19
+ const { open, onCancel, title, confirmMessage, onConfirm, cancelButtonText, confirmButtonText, onCancelCustom, confirmCustomComponent } = props;
20
+ return (React.createElement(Dialog, { open: open, onClose: onCancel },
21
+ title && React.createElement(DialogTitle, { id: "alert-dialog-title" }, title),
22
+ confirmMessage && (React.createElement(DialogContent, null,
23
+ React.createElement(DialogContentText, { id: "alert-dialog-description" }, confirmMessage))),
24
+ React.createElement(DialogActions, null,
25
+ React.createElement(Button, { onClick: onCancelCustom || onCancel, color: "primary" }, cancelButtonText),
26
+ onConfirm && !confirmCustomComponent && (React.createElement(Button, { onClick: () => onConfirm(), variant: "contained", color: "primary" }, confirmButtonText)),
27
+ confirmCustomComponent && confirmCustomComponent)));
28
+ };
29
+ export default ConfirmBase;
@@ -0,0 +1,5 @@
1
+ export * from './message/Message';
2
+ export * from './confirm/ConfirmBase';
3
+ export * from './BrowserWarning';
4
+ export { default as Message } from './message/Message';
5
+ export { default as ConfirmBase } from './confirm/ConfirmBase';